EstebanFuentealba / MALVEKE-Flipper-Zero

GAME BOY Tools for Flipper Zero. The perfect companion for your Flipper Zero. Equipped with ESP32-S2 for WiFi. MALVEKE allows you to connect all GAME BOY peripherals and additional accessories such as NRF24, CC1101, and GPS.
MIT License
243 stars 4 forks source link

GB/GBC save file dump sometimes wipes save from cart #34

Open nortakales opened 7 months ago

nortakales commented 7 months ago

Occasionally when I dump the save file of a GB cartridge, and then go to play the game again, the save file is gone. Sometimes this doesn't happen. I cannot figure out how to reproduce it 100% of the time, it seems random.

I think if users were not expecting this, they may accidentally lose data, especially since when I try to write the dumped save file back to the cart, that also doesn't seem to work.

EstebanFuentealba commented 7 months ago

Which cartridges does this happen to? Are they cartridges with batteries (original) or clones? Could you upload a video showing this? It would help to see the steps you're taking.

Best regards!

nortakales commented 7 months ago

I've only tried real cartridges. No reproductions, flash carts, or anything like that.

This is all using the latest OFW release (0.100.3) and the latest FAPs from the store (2.2). Video shows making a new save on Link's Awakening, dumping the save with the Flipper, the save is then missing from the cartridge, but I can write it back to the cartridge.

https://photos.app.goo.gl/ct36Xi94bRgNver2A

This does not always happen though, it seems random. I did notice it happen with the Game Boy Camera once too.

EstebanFuentealba commented 6 months ago

Perhaps when the cartridge is removed and tilted at an angle, the pins might be making contact. One thing I could do to test this is, once the DUMP process is finished, set all the pins to LOW. However, to solve this issue permanently, we would need a cartridge casing that prevents this tilting when removing the cartridge.

nortakales commented 6 months ago

Ah, interesting! I hadn't thought about the fact I was pulling the cart off at an angle like that. Good catch.

I also have a JoeyJR for dumping ROMs and saves. I've used that for a few years now, and dumped dozens, or maybe more than a hundred saves at this point, and never had the same issue. That said, I know his (BennVenn) source code is not open. But he does have a Discord. Might be worth a quick ask to see if he ever encountered the same issue with his device. By design it would be equally susceptible to pulling the cart off at an angle. I'll pose the question over there and see if he has any insight.

Side note: a 3D printed shell would be absolutely killer for the Malveke. Especially if we could go through PCBWay with some of their awesome transparent options!

nortakales commented 6 months ago

Would it be better to pull the Malveke board from the flipper (with cart still attached) rather than pulling the cart first?

EstebanFuentealba commented 6 months ago

I will deactivate the pins (LOW) when removing the cartridge, that will help a lot.

Regarding the casing, @fran122157 is working on it, although I'm not sure when it will be ready. Here's a preview they sent me.

WhatsApp Image 2024-04-02 at 2 23 52 PM (1)

WhatsApp Image 2024-04-02 at 2 23 52 PM (1) (1)

nortakales commented 6 months ago

Regarding save files being wiped, the new faps you created for https://github.com/EstebanFuentealba/MALVEKE-Flipper-Zero/issues/35 seems to have made this issue worse - I could not get ANY save file dumped correctly, and my save was wiped from the cartridge 100% of the time.

EstebanFuentealba commented 6 months ago

Regarding save files being wiped, the new faps you created for #35 seems to have made this issue worse - I could not get ANY save file dumped correctly, and my save was wiped from the cartridge 100% of the time.

The strange thing is that I haven't modified anything in that application yet. I've only moved code from malveke_gb_photo. The other issues must be related to the F0 compilation problems.