Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mgba save compatibility option. #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Wrsford
Copy link

@Wrsford Wrsford commented Apr 16, 2024

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
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

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

@profi200
Copy link
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
Copy link
Author

Wrsford commented Apr 22, 2024

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.

None yet

3 participants