libretro / vbam-libretro

A fork of VBA-M with libretro integration
24 stars 29 forks source link

EEPROM64K(8kb) save files improperly loaded #33

Closed Uvik closed 5 years ago

Uvik commented 7 years ago

With the vbam_libretro core in Retroarch, it looks like 8kb EEPROM64K save files (the name might be wrong, my apologies in advance) are not properly loaded.

Upon save, the emulator overwrites the original 8192b save file with an empty one weighing 139264 bytes.

Reliably reproduced the issue with the latest vba_next_libretro core as well (reported the same issue under VBA-Next issue #83, but both mgba_libretro and the latest standalone release of VBA-M (taken from commit 2e8bee1) load my save files just fine.

It might be important to add that I got these issues by loading my own GBA ROMs and save files, dumped from my original cartridges using a DS linker and a backup tool. Coming straight from the cartridges, they are completely unaltered and the incompatibility might be expected (who knows?).

I noticed the issue with the following ROMs (with the names retrieved by the backup tool, just in case):

All of these games seem to use the same 8kb EEPROM64K save format.

Please let me know if you require any information. I am obviously uncomfortable with sharing the ROMs I dumped, but I can provide problematic save files if required.

Thank you in advance !

P.S.: After a quick glance at the code, it looks like the libretro workaround (defined at EEprom.cpp, line 14) might be related in one way of the other. At least, that seems to be why the save file ends up being 139264 bytes large after loading it. I have no idea about the rationale behind this workaround though, so my guess could very well be utterly wrong :-)

ghost commented 5 years ago

proper save file types and sizes for most games should now be identified with the latest commit (EEPROM_512, EEPROM_8K, SRAM 32K, FLASH_512K and FLASH_1M)

please post if there are games which are not detected properly

hizzlekizzle commented 5 years ago

alright, since there haven't been any more reports, I'm going to close this issue.