euan-forrester / save-file-converter

Converter for retro console save files to and from MiSTer, flash cartridges, Nintendo Switch Online, and save states from online emulation websites. Convert files found around the Internet: All common formats for NES/SNES/GBA/N64/TG16/SMS/Genesis/Neo Geo/PS1 supported. Decrypt PSP saves.
https://savefileconverter.com
GNU General Public License v3.0
138 stars 5 forks source link

Need to pad 512B MiSTer GBA EEPROM saves & truncate RTC data #285

Closed euan-forrester closed 5 months ago

euan-forrester commented 5 months ago

It looks like the core isn't able to tell whether a GBA EEPROM game is 512B or 8kB and so it requires a file that's 8kB long.

It doesn't sound like the core even clears the data -- it just leaves it uninitialized and so you can get junk from a previous game. So we can just pad it with 0x00.

When going backwards from MiSTer to emulator we can select the size, so although I think most emulators will accept an 8kB file for a 512B game the user can choose to truncate it in the interface.

Check out https://misterfpga.org/viewtopic.php?t=2040 for more info

That link also notes that there may be RTC data appended after the save data. We should test that this gets truncated properly when converting to emulator format.