Author Topic: Cannot grab sram from Game Boy Camera  (Read 1406 times)

Offline sirmirkr

  • Baby Retrode
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Cannot grab sram from Game Boy Camera
« on: 04/Nov/2017 09:34:53 PM »
Hello,

I've been trying to grab the sram from my GB Camera but without success. On firmware versions .18d-beta3 and newer, the sram file is not detected by the Retrode 2 at all; on older firmware versions, the sram is shown but at an incorrect size of 1024 kB (it should be 128 kB, right?). I tried the Game Boy Camera Dump program with this 1024 kB sram file anyway, but it only showed the game face from the cart, and all 30 pictures were garbled. The save and photos on the cart are still intact.

In the retrode.cfg I've tried setting the force detection as below, but it hasn't helped with the sram file:

[forceSystem] gboy
[forceSize] 128
[forceMapper] 0

I've read through these topics but haven't had much luck either:

http://forum.retrode.org/index.php/topic,295.msg1952.html#msg1952

http://forum.retrode.org/index.php/topic,324.msg2188.html#msg2188

http://forum.retrode.org/index.php/topic,335.msg2334.html#msg2334

I'm loving the new N64 save support, by the way.

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #1 on: 24/Nov/2017 01:37:22 AM »
I couldn't get the SRAM file at all from mine. Using the 0.20 Beta firmware that my Retrode 2 came with, I could only see a 1.2 megs "WMuzoysMur.gb" file on the Retrode. It works in 3 different Game Boy types, and I cleaned the contacts with alcohol first, then contact cleaner as a second pass, having removed the cartridge shell.

The "[forceSize]" configuration option you added is probably not going to change anything, as that's just for the ROM size, not the SRAM size.

Answering @Wannado's question in http://forum.retrode.org/index.php/topic,335.msg2334.html#msg2334
Quote
Which firmware version have you been using when reading the GB camera save still worked?

It never worked for me, and it's the only version of the firmware that I ever used. Maybe someone else can help?

Quote
Please take a look at the .gb file with a hex editor: What are the values at offsets 147 hex (327 dec) and 149 hex (329 dec) of the GB camera ROM?

This is hexdump's output for those values:
00000140  59 7f 7f 7f 36 31 7b fc  75 76 7d 33 7f 9d ba f9  |Y...61{.uv}3....|

Quote
What's the file name of the .gb / .sav file?

No .sav file, the ROM is "WMuzoysMur.gb".

Quote
What's the size of the .gb file?

The file is 1192960 bytes long.

Quote
Do the first few hundred bytes from the start of the .gb file repeat at offset 4000 hex (16384 dec)?

No, here's about 10 lines of the stuff:
00004000  f2 59 fb 59 76 5a 6d 5a  56 5a 4f 5a aa 5a d1 5a  |.Y.YvZmZVZOZ.Z.Z|
00004010  6a 53 53 53 4a 53 4d 53  52 53 57 53 74 53 8d 53  |jSSSJSMSRSWStS.S|
00004020  ee 53 57 56 ae 56 d9 56  fe 56 57 55 de 55 5d 56  |.SWV.V.V.VWU.U]V|
00004030  b6 56 e3 56 3c 57 a9 57  ce 57 77 4a 2e 4a 39 4a  |.V.V<W.W.WwJ.J9J|
00004040  4e 4a 6f 4a 96 4a 9d 4a  ae 4a bf 4a d6 4a e9 4a  |NJoJ.J.J.J.J.J.J|
00004050  f2 4a fb 4a 6c 49 5d 49  22 49 27 49 2c 49 31 49  |.J.JlI]I"I'I,I1I|
00004060  36 49 3b 49 5f 49 55 49  56 49 67 49 7a 49 a9 49  |6I;I_IUIVIgIzI.I|
00004070  9a 49 ab 49 b4 49 bd 49  ce 49 df 49 f6 49 7d 4a  |.I.I.I.I.I.I.I}J|
00004080  52 4a 23 4a 9c 4a a9 4a  a6 4a ab 4a b6 4a b5 4a  |RJ#J.J.J.J.J.J.J|
00004090  ba 4a bf 4a d4 4a c9 4a  ce 4a d3 4a da 4a dd 4a  |.J.J.J.J.J.J.J.J|
000040a0  e2 4a f3 4a 76 4b 55 4b  26 4b 37 4b 4a 4b 65 4b  |.J.JvKUK&K7KJKeK|

Offline sirmirkr

  • Baby Retrode
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #2 on: 09/Dec/2017 05:43:19 PM »
This doesn't help troubleshoot the Retrode, but I was able to get the SRAM off my GB Camera by using a Joey-JoeBags by BennVenn.

Unrelated: For getting GBA saves, I used a DS Lite or Original DS with an R4 flashcard and the savemanager homebrew. Rudolph's GBABackup homebrew was able to get both the save and ROM of Mario and Luigi SuperStar Saga, something that the Retrode couldn't do.

Offline Wannado

  • Sgt. Retrode
  • ***
  • Posts: 101
  • Karma: +13/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #3 on: 01/Jan/2018 09:11:04 PM »
I couldn't get the SRAM file at all from mine. Using the 0.20 Beta firmware that my Retrode 2 came with, I could only see a 1.2 megs "WMuzoysMur.gb" file on the Retrode. It works in 3 different Game Boy types, and I cleaned the contacts with alcohol first, then contact cleaner as a second pass, having removed the cartridge shell.
...
This is hexdump's output for those values:
00000140  59 7f 7f 7f 36 31 7b fc  75 76 7d 33 7f 9d ba f9  |Y...61{.uv}3....|
...
No .sav file, the ROM is "WMuzoysMur.gb".
...
00004000  f2 59 fb 59 76 5a 6d 5a  56 5a 4f 5a aa 5a d1 5a  |.Y.YvZmZVZOZ.Z.Z|
00004010  6a 53 53 53 4a 53 4d 53  52 53 57 53 74 53 8d 53  |jSSSJSMSRSWStS.S|
...


The data you posted doesn't look like a valid GB ROM to me (though I'm not a GB ROM expert). The only value that looks good to me is "fc" at offset 147, which identifies the GB Camera as such.

Since you cleaned the cartridge's contacts, please also check the other connectors involved for dirt and damage: both connectors of the plug-in as well as the connector of the Retrode.

For example, Wren had a plug-in with broken ground pin on the GB connector. See gb-pins-small.jpg attached to the post http://forum.retrode.org/index.php/topic,338.msg2296.html#msg2296 (reply #8 in that thread). See also my reply (#10) in the same thread.

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #4 on: 28/Jan/2018 01:30:29 AM »
I couldn't get the SRAM file at all from mine. Using the 0.20 Beta firmware that my Retrode 2 came with, I could only see a 1.2 megs "WMuzoysMur.gb" file on the Retrode. It works in 3 different Game Boy types, and I cleaned the contacts with alcohol first, then contact cleaner as a second pass, having removed the cartridge shell.
...
This is hexdump's output for those values:
00000140  59 7f 7f 7f 36 31 7b fc  75 76 7d 33 7f 9d ba f9  |Y...61{.uv}3....|
...
No .sav file, the ROM is "WMuzoysMur.gb".
...
00004000  f2 59 fb 59 76 5a 6d 5a  56 5a 4f 5a aa 5a d1 5a  |.Y.YvZmZVZOZ.Z.Z|
00004010  6a 53 53 53 4a 53 4d 53  52 53 57 53 74 53 8d 53  |jSSSJSMSRSWStS.S|
...


The data you posted doesn't look like a valid GB ROM to me (though I'm not a GB ROM expert). The only value that looks good to me is "fc" at offset 147, which identifies the GB Camera as such.

Right, it's total garbage, we agree.

Quote
Since you cleaned the cartridge's contacts, please also check the other connectors involved for dirt and damage: both connectors of the plug-in as well as the connector of the Retrode.

For example, Wren had a plug-in with broken ground pin on the GB connector. See gb-pins-small.jpg attached to the post http://forum.retrode.org/index.php/topic,338.msg2296.html#msg2296 (reply #8 in that thread). See also my reply (#10) in the same thread.

I looked at this, but I'm not sure why that would be the case. I managed to dump a number of other cartridges, including some with RAM, using the same adapter. If the problem was dirt, I'm not sure why when plugging it in again 2 months later I would get the exact same garbage (same filename, same data).

So, the adapter works (I just tried and successfully dumped a copy of Zelda DX), the camera works in real hardware. The only 2 things I can think of are software (though I'm guessing you expect it to work, if it did in the past), or a physical difference in the cartridge which would mean it doesn't connect as well.

I'll try to update to the latest firmware to start with, and I'll be receiving another Gameboy Camera soon (not for this particular problem :) that I can test as well.

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #5 on: 28/Jan/2018 02:00:44 AM »
I'll try to update to the latest firmware to start with, and I'll be receiving another Gameboy Camera soon (not for this particular problem :) that I can test as well.

Same thing with ".24b-beta" from skaman. I'll see whether the other camera shows the same problem.

Offline skaman

  • Global Moderator
  • Sgt. Retrode
  • *****
  • Posts: 111
  • Karma: +35/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #6 on: 28/Jan/2018 09:36:49 PM »
I haven't touched any of the Gameboy code so there won't be any improvements in the latest firmware.

I built a standalone Gameboy reader with support for all of the carts awhile back.  I'll look into porting the relevant code to the Retrode later.  I still need to finish up the SMS/GG firmware and release the VBOY SRAM firmware.

Offline Wannado

  • Sgt. Retrode
  • ***
  • Posts: 101
  • Karma: +13/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #7 on: 28/Jan/2018 10:46:48 PM »
@hadess: Wren's broken plug-in also worked for quite a few things. The GB camera may just be more picky about some input voltage than your other cartridges.

@hadess, skaman: Since even the ROM header appears as garbage, the only firmware issue I could imagine here is something about the control signals like /CS etc. (timings, ...?). But why would only the GB camera notice it?
I remember that in v0.19 beta, I fixed GB SRAM bugs related to the control signals (see my commit message).

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #8 on: 29/Jan/2018 02:19:16 AM »
@hadess: Wren's broken plug-in also worked for quite a few things. The GB camera may just be more picky about some input voltage than your other cartridges.

Right, and I did inspect the pins visually, and couldn't see anything wrong. I'll test again with the new Camera when I get it. If the same problem happens, I'll break the multimeter out to see if there's any obvious connectivity problems.

Offline skaman

  • Global Moderator
  • Sgt. Retrode
  • *****
  • Posts: 111
  • Karma: +35/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #9 on: 29/Jan/2018 04:52:03 AM »
Yes, Gameboy Camera was tricky and handled different from normal carts.

From my notes on my Arduino GB reader:
WR, RD, CS must be low to get valid header
Hold CS low for read/write operations

There's probably more.  I wrote and tested the code a few years ago so my memory of it is pretty vague.  At the time, I wrote support for all of the mapper chips and also the Camera, Gameshark, Mega Memory, Nintendo Power carts, and all of the BUNG carts.

There were a couple of items that I never finished which were the MBC7 and TAMA5 saves.  One good thing with working on the Retrode code, I should be able to use the GG 93C46 EEPROM code as a framework to get the MBC7 93C56 EEPROM working on the standalone reader.

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #10 on: 01/Feb/2018 04:22:45 PM »
Received the second Game Boy Camera today, and can't access the SRAM just the same. Only one ROM file still named "WMuzoysMur.gb", as with the other Camera.

I'll give the Retrode and the adapter a good clean, and check if I can see any physical problems.

Offline hadess

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #11 on: 01/Feb/2018 09:21:36 PM »
I'll give the Retrode and the adapter a good clean, and check if I can see any physical problems.

I retinned 2 connectors in the Game Boy adapter, and checked the solder points on the Retrode's Megadrive connector, but no difference I'm afraid.

At this point, it would be helpful to know if somebody else sees the same problem, with the same ROM name, on this cart, so that we know for sure that the problem is the Retrode's firmware, rather than going on a wild goose chase.

Offline Wannado

  • Sgt. Retrode
  • ***
  • Posts: 101
  • Karma: +13/-0
    • View Profile
Re: Cannot grab sram from Game Boy Camera
« Reply #12 on: 01/Feb/2018 10:32:46 PM »
Yes, Gameboy Camera was tricky and handled different from normal carts.

From my notes on my Arduino GB reader:
WR, RD, CS must be low to get valid header
Hold CS low for read/write operations

That's a strange combination, pulling WR and RD both low. Do you know if (and why) a real GB would do that? Before v0.19 beta, the Retrode actually did it, but I'm sure that was unintentional.
Anyway, this interesting feature would explain why v0.19 beta and later cannot read the GB Camera. Quoting myself from the commit log:

Quote
Fixed issues with GB SRAM access: (...)
- Pulling /CS low when writing to mapper register address 0x1EFF caused SRAM to be corrupted. I read on the internet that /CS is required for SRAM access, but optional for ROM access. It seems that some MBCs take /CS to select SRAM even if the address is outside the SRAM range. I therefore guess that the real GB pulls /CS low only when accessing SRAM, not when reading ROM or writing mapper registers. And so does the Retrode now.
- Due to confusion about the port bits assigned to /CS and /RD, gbWriteByte allowed /RD to stay low while pulling /WR low as well. This caused SRAM writing to fail on MBC2.

Note that the SRAM corruption was hard to spot (only one byte changed, often an unused one). But my Kid Icarus savegame was affected noticeably.

Since reading the header neither requires writing to 0x1EFF nor to SRAM: Could the solution be to let auto-detection read the header as if it were a GB Camera, then chose the appropriate r/w methods based on the detected cartridge type (from the header)?