Skip to content

Improved save type detection#2

Draft
LeonarthCG wants to merge 4 commits intoeternalcode0:mainfrom
LeonarthCG:sram-detection
Draft

Improved save type detection#2
LeonarthCG wants to merge 4 commits intoeternalcode0:mainfrom
LeonarthCG:sram-detection

Conversation

@LeonarthCG
Copy link

@LeonarthCG LeonarthCG commented Mar 4, 2026

TMCR patches the game to use SRAM, which it then uses to keep track of a bunch of extra stuff (time played, enemy kills, when each item was found, etc.).

However, from time to time someone tries to play TMCR on an emulator, through VC injection or by using a flashcart that incorrectly detects the save type as EEPROM, which is TMC's original save type. I wrote this change for that, and I figured it could be added here as well.

The issue happens because the ROM is checked for strings containing the save type (from what I understand, these were inserted by the devkit back in the day, so it is pretty reliable) or because the game title or game code are used to check against some list of known save types for GBA titles.

These changes do away with the original game title, code and save type strings so that automatic detection cannot have a reason to select EEPROM. The save type strings are also replaced by SRAM ones, so that the new save type may be detected. The functionality of the game itself is not changed, although some emulators may display the new game title (MINISH RANDO) in the window title.

I checked the results with GBA Tool Advance, which now correctly detects the save type as SRAM, and a GBA VC injector for 3DS, which failed to detect a save type at all. Originally, both of these tools detected the save type as EEPROM, so I believe this is an improvement.
edit: After the 2 strings change, the VC injector also detects the SRAM save type.

If you would like, the game title and game code can be adjusted, but if they are changed then the complement needs to be updated as well.

PS: I also tested with an EZ-Flash Omega, but it continues having the same issue: the save is updated too quickly for it to ever catch up. I think this could be fixed by having the changes only write to the save every so often (iirc it's just the playtime that gets saved every frame anyway?) but that's a different topic.

makes emulators, vc injectors, etc., more likely to detect SRAM as the save type
it does so by changing the game title, game code and save type strings
@LeonarthCG
Copy link
Author

Not sure if this is where the PR is meant to be made, please let me know if I should make it against some other branch.

this further improves automatic save type detection
open_agb_firm detect unknown games starting with an S game code as games using SRAM: https://github.com/profi200/open_agb_firm/blob/1914b3524e085173a73e56f88e278bbb71e42074/source/arm11/save_type.c#L33

unsure how widely adopted that is, but I figure, if anything, that the number of platforms doing it will increase over time
@LeonarthCG LeonarthCG marked this pull request as draft March 6, 2026 15:26
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.

1 participant