Skip to content

Add mgba save compatibility option. - #178

Open
Wrsford wants to merge 2 commits into
profi200:masterfrom
Wrsford:mgba_save_compat
Open

Add mgba save compatibility option.#178
Wrsford wants to merge 2 commits into
profi200:masterfrom
Wrsford:mgba_save_compat

Conversation

@Wrsford

@Wrsford Wrsford commented Apr 16, 2024

Copy link
Copy Markdown

Supersedes #177
This adds an advanced option (mgbaSaveCompat) to swap save and ROM .ini files to be in the same directory as the ROM. This allows a user to play on mGBA and seamlessly swap over to open_agb without moving saves around.

Neither mGBA nor open_agb allowed configuring save locations, so this would provide the only option for users wanting to be able to swap between them easily.

@profi200

Copy link
Copy Markdown
Owner

Hmm, this is not mGBA specific. Maybe a different name for this option would make sense? Something like "sharedRomAndSaveFolder". If you have a better name let me know.

There is also a small problem with this. EEPROM saves are not compatible between mGBA and oaf. If we share the same folder again switching between mGBA and oaf will corrupt savegames.

@Masamune3210

Copy link
Copy Markdown

Is eeprom a raw blob or is there a header? Maybe flag those made by oaf?

@profi200

Copy link
Copy Markdown
Owner

It's raw but the byte order is different. Unfortunately the most common format is the byte swapped one. oaf uses the format that preserves byte order. See: https://gist.github.com/profi200/e06794d7561ed552c518b4b0b2f5f2f6#file-gbaeepromsavefix-c-L44

@Wrsford

Wrsford commented Apr 22, 2024

Copy link
Copy Markdown
Author

My proposed changes to deal with the issues you brought up are:

  1. Change the name of the setting to "sharedRomAndSaveFolder"
  2. Omit applying this setting to games using any EEPROM save type to avoid users losing their save.
  3. Update documentation to note the incompatibility with EEPROM saves.

A longer term fix for the EEPROM would probably require writing both versions of the save and comparing them to see if one updated without the other, then syncing with the newer one. Currently, I don't have the familiarity with the codebase to know if that is possible or to be able to make that change, but I can look into it.

I'll get started, but let me know if you have any objections.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants