Has anyone tried dumping a Game Boy Camera save? #301
Replies: 11 comments 2 replies
-
The GB Camera seems to have an additional chip between the data and the cart edge so the current functions probably need to be slowed down. You can try doubling the nops starting from Line 432 in GB.ino until the name is read correctly. |
Beta Was this translation helpful? Give feedback.
-
Okay. So there are three ways of programming:
Let's skip over the first option since nobody got time for that. Here is a pretty good write-up about dumping saves from the Game Boy Camera: https://dragaosemchama.com/en/2016/02/downloading-game-boy-camera-pics/ If you have a look at this persons source code and compare it with mine you will notice two major things.
My code:
He uses "_delay_us(2)" before reading data which is a 2000ns delay. What I meant with my previous post was to replace every "asm("nop\n\t""nop\n\t""nop\n\t""nop\n\t");" with "asm("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");" The second difference is that he in his code only toggles CS/MREQ every bank instead of every byte like me
But I would try out changing the delay like shown above first. The goal should be that the Cart Reader displays the name of the cartridge correctly "GAMEBOYCAMERA" and also give the correct ROM and RAM size, which according to the link is 64 and 16 banks. |
Beta Was this translation helpful? Give feedback.
-
After reading your comments in the GB.ino file about how one nop is 62.5ns I added nops that would total 32 for each call as that would be exactly 2000ns and flashed that but no luck. I also added an extra nop for good measure before the next flash with the same result. I would assume this leaves what you suspected at the end of your last post being the CS/MREQ toggles every bank instead of every byte. I'll try to take a stab at that soon next. |
Beta Was this translation helpful? Give feedback.
-
Here is another code example, this one does a 5ms delay instead after the bank switch. That's a huge delay but it's probably there for a reason. |
Beta Was this translation helpful? Give feedback.
-
I kept the added 32 nops as well as adding a _delay_ms(5); (appears to be the equivalent for delay_ms(); ) on to line 764 line but with the same result. I'll take another look and try to discern some more differences between the gbxcart_rw code and this one in the mean time. |
Beta Was this translation helpful? Give feedback.
-
I noticed two more differences, in GBxCartRW's read_8bit_data function https://github.com/insidegadgets/GBxCart-RW/blob/master/MCU_Files/GBxCart_RW_v1.3_R22/setup.c#L263 he pulls rd high then cs high, while I do the opposite order in my two read functions, might be worth changing the order around in my code: The second difference is that I only toggle CS in the readsram function and not in the normal read function, so it might be worth a shot making both function the same and adding the CS toggle to the normal read function. |
Beta Was this translation helpful? Give feedback.
-
If you just want to get the pictures off the cartridge and don't actually care about the full save, you can use this project: https://github.com/mofosyne/arduino-gameboy-printer-emulator It's a Gameboy Printer Emulator, using any old Arduino. It emulates a Gameboy Printer towards the Gameboy and turns it into a serial-over-USB stream, which you can then convert into a png using their web page. I didn't want to cut up a Link Cable, so I bought this Link Cable breakout board as well: https://github.com/Palmr/gb-link-cable |
Beta Was this translation helpful? Give feedback.
-
Hello! Finally had some time to look at this. I followed your suggestion and played around with it for a bit. I think we're getting closer to the answer and I made sure that the toggles looked identical for both calls (The comments use pull and toggle interchangeably but the code below them looks the same.) Finally I think it's worth noting at I check with a copy of Pokémon Red every so often to see if I can still read regular carts, and at this point it's not detecting it anymore. EDIT: (This was a mistake it totally does read Pokémon Red still, I'm just tired and put the cart in backwards lol), Here is my code for the two functions, also realized that I added nops for the write functions too, not sure if that was needed. I'll paste the two read functions I edited here. Final Edit: Forgot to mention the cart reader recognizes the GameBoy Camera but not the rom size or the sram size.
|
Beta Was this translation helpful? Give feedback.
-
Hey! Happy to say this is the last update! Somewhere along the lines of messing with this I was able to get this to read and dump the save. But the kicker is that it read with ONLY the nops as a change, and didn't require editing for the two read functions we were talking about above. I think the contacts on my Game Boy Camera must be getting real old at this point because I just happened to get it to read this one time out of the 10 I tried. All of my other games read on the first try just not this one. For brevity sake and anyone who is reading this with the same issue just add 32 nops which is 2000ns and be patient unlike me. Edit: Yeah, I'm definitely the worst person to test this. I tried for an hour to get this to even read again and confirm that the nops were indeed the only thing needed to get everything to read. Either my contacts are almost dead or the battery is almost dead lol. |
Beta Was this translation helpful? Give feedback.
-
I was having trouble getting my HW4 to read the camera cart. I finally got it working by changing the code to this.
Surprisingly I didn't need to add the extra nops. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I have updated the code and made a readByteCLK_GB function out of the code you posted and am using it as the default for both ROM and SRAM/FRAM. |
Beta Was this translation helpful? Give feedback.
-
I haven't been able to get this to work. I cleaned the contacts on the cart and can get it to read first time on my actual Game Boy but the cart reader shows nothing for the name and an error for the checksum. I read around that the cart is a little different than some of the other GB ones and I'm not sure if that meant SRAM. Even without the name I can dump the file, but the .sav is empty.
Beta Was this translation helpful? Give feedback.
All reactions