From b6ed7284c48e7a9b67e8439e6cc3135bf1ca30e3 Mon Sep 17 00:00:00 2001 From: LeonarthCG Date: Wed, 4 Mar 2026 12:01:05 +0100 Subject: [PATCH 1/4] improved save type detection 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 --- src/save/installer.event | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/save/installer.event b/src/save/installer.event index 812ca44..badec15 100644 --- a/src/save/installer.event +++ b/src/save/installer.event @@ -310,3 +310,29 @@ WORD 0x203FE00+(06*2) //offset //WORD 0x203FE00+(07*2) //offset of times quickwarped #include "credits/credits.event" + +//improve save type detection on emulators, virtual console injectors, etc +//none of this has an actual impact on the game itself +PUSH + //game title and game code, to prevent automatic EEPROM save type selection for TMC + //this used to be more common, although I believe nowadays the string check method is used more often + //game title (GBAZELDA MC) + ORG $A0 // 3 words + WORD 0 0 0 // clear the previous game title + ORG $A0 + String("MINISH RANDO"); + //game code (BZMP) + ORG $AC // 1 word + String("TMCR"); + //complement check (checksum), needs to be adjusted or the game won't boot on real hardware + ORG $BD + BYTE 0x82 + + //EEPROM strings, often checked by external programs + //the strings must be at a word aligned offset, and must have a length multipled of word size + //here the original strings in the rom are replaced with equal length or smaller strings, padded with 0s + ORG $EF32CC + String("SRAM_F_V103"); BYTE 0 + ORG $EF330C + String("SRAM_F_V103"); BYTE 0 0 0 0 0 +POP From 4f6ad3fab260f3ab86ad34f5f87c9a75870e4d5c Mon Sep 17 00:00:00 2001 From: LeonarthCG Date: Wed, 4 Mar 2026 12:42:18 +0100 Subject: [PATCH 2/4] typo --- src/save/installer.event | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/save/installer.event b/src/save/installer.event index badec15..2efeb56 100644 --- a/src/save/installer.event +++ b/src/save/installer.event @@ -329,7 +329,7 @@ PUSH BYTE 0x82 //EEPROM strings, often checked by external programs - //the strings must be at a word aligned offset, and must have a length multipled of word size + //the strings must be at a word aligned offset, and must have a length multiple of word size //here the original strings in the rom are replaced with equal length or smaller strings, padded with 0s ORG $EF32CC String("SRAM_F_V103"); BYTE 0 From a0bdf1c0d8f5c7703dadb568795e0dcb7b725277 Mon Sep 17 00:00:00 2001 From: LeonarthCG Date: Wed, 4 Mar 2026 15:55:37 +0100 Subject: [PATCH 3/4] use two different sram save type strings this further improves automatic save type detection --- src/save/installer.event | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/save/installer.event b/src/save/installer.event index 2efeb56..d72e800 100644 --- a/src/save/installer.event +++ b/src/save/installer.event @@ -332,7 +332,7 @@ PUSH //the strings must be at a word aligned offset, and must have a length multiple of word size //here the original strings in the rom are replaced with equal length or smaller strings, padded with 0s ORG $EF32CC - String("SRAM_F_V103"); BYTE 0 + String("SRAM_V103"); BYTE 0 0 0 ORG $EF330C String("SRAM_F_V103"); BYTE 0 0 0 0 0 POP From 15f6cc31b812dc4540fc043357f253d00357e802 Mon Sep 17 00:00:00 2001 From: LeonarthCG Date: Thu, 5 Mar 2026 09:58:07 +0100 Subject: [PATCH 4/4] game code starting with S for save type detect 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 --- src/save/installer.event | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/save/installer.event b/src/save/installer.event index d72e800..5962c28 100644 --- a/src/save/installer.event +++ b/src/save/installer.event @@ -322,11 +322,12 @@ PUSH ORG $A0 String("MINISH RANDO"); //game code (BZMP) + //apparently game codes starting with S can be detected as SRAM games, at least for open_agb_firm ORG $AC // 1 word - String("TMCR"); + String("SZMR"); //complement check (checksum), needs to be adjusted or the game won't boot on real hardware ORG $BD - BYTE 0x82 + BYTE 0x98 //EEPROM strings, often checked by external programs //the strings must be at a word aligned offset, and must have a length multiple of word size