Hacking Emulation Gaming Hardware ROM Hack GBA EEPROM Save Fixed Patch For GBA Shantae Advance - Risky Revolution

  • Thread starter Thread starter Wokann
  • Start date Start date
  • Views Views 16,728
  • Replies Replies 40
  • Likes Likes 10

Wokann

Well-Known Member
Newcomer
Joined
Feb 6, 2023
Messages
92
Reaction score
95
Trophies
1
Website
wokann.github.io
XP
871
Country
China
Preface:
The gba game Shantae Advance - Risky Revolution, which has been shelved for 20 years, was officially released recently, and many pre-order players have received the physical cartridge.

Problems :
However, many people will find that the ROM dumped from the physical cartridge can be played in some emulators, but some emulator can't.

Reason:
This is because the game was originally a 16MB eeprom 512B save game, and Limited Run used the FRAM save chip cartridge to make the physical cartridge, rather than the EEPROM 512B save chip cartridge which designed for the cartridge itself. (sorry that the eeprom save size of shantae gba is 512B not 8KB, I now fixed the text)
Limited Run used the GBA Tool Advance to apply the sram patch to the rom (the modified content has been compared and it has the same result with the sram-patching rom applied by the folk tool: GBA Tool Advance). So the rom dumped from the cartridge that the player got has been patched with the SRAM patch.
Some emulators automatically recognize or read and write according to the native EEPROM save or mistakenly recognize it as a FLASH save, so in this case, the savefile cannot be saved and read normally.
Some emulators can recognize it as SRAM save, so they can save and read savefile normally.

Repair patch:
Here is a patch to restore the sram patch back to the eeprom save for use.

Original Rom Info (dumped from limited run cartridge)
Title Name: (no title name)
Size: 16MB
Save Type: EEPROM_V122
CRC32: 31265c5d
MD5: a82bd152baf314b0d69a12a47c38e60f
SHA-1: 13ba1ab9af37fe874bb8a7c34c7597fa8554a241

EEPROM Save Fixed Rom info
CRC32: f2f66f5e
MD5: 05c018273689ebf67f5c7f5d39927a62
SHA-1: f4b85cac70ee41fd3f84507afec55ff4e7113b8e

Note: If you see a 32MB Shantea ROM, it is a dump problem. The first 16MB of the ROM is the complete content of this game. Just delete the last 16MB is ok.

Plus Patch:
I made a new patch that can be compatible with both EEPROM and SRAM saves. It may work well for some emulator or flashcart which cannot recognize EEPROM and use SRAM in its auto mode.

EEPROM and SRAM compatible Rom info
CRC32: 38f5d059
MD5: d791ac71aca5dfb8725a0668d3757a41
SHA-1: 40ec2ba9edf6969af6d34b71f2cdbbb549846c3e

Q: How to cut 32MB rom to 16MB?
A: You can use hex editor like Hxd, winhex etc. to delete the last half part of the 32MB rom, just remian the first 16MB (0x00000000-0x00FFFFFF) part. Or you can use GBA Tool Advance to open 32MB rom, finding 'Fix OverDump', choose '128Mbit (16Mbyte)', then press 'Fix' button, you will get the 16MB rom.
1747370005884.png


===============================================================================================
Below is a more detailed explanations of the mechanism and considerations for choosing patched rom (Fisrt post on #9 , Now list on #1)

ROM INFO
1. Original dumped rom

Save Type: SRAM 32KB(/256Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original EEPROM 512B(/4Kbit) with SRAM 32KB(/256Kbit) patch applied by using GBATA. For purpose of burning game on FRAM save chip (= SRAM without battery) physical cartridges.

2. EEPROM save fixed rom (eeprom_back patch)
Save Type: EEPROM 512B(/4Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original save function status of this game.
(sorry that the eeprom save size of shantae gba is 512B not 8KB, I now fixed the text)

3. EEPROM & SRAM compatible rom (eeprom&sram patch)
Save Type: EEPROM 512B(/4Kbit) and SRAM 32KB(/256Kbit) compatible
Save ID String in rom: EEPROM_V122
P.S. : Save hack which can support most emluators and flashcarts whether they recognize this patched game as EEPROM or SRAM.


Save Mechanism
1. Pre-built Save Library

The AUTO mode of ezo(de) use Pre-built Save Library to determine save type of game by finding the Game Code in rom header. If one game isn't in this Lib, save type will choose SRAM in default. everdrive x5 is similar and have a Pre-built Save Library too.
Shantae Advance isn't in this lib, so in AUTO mode it will be run as SRAM type.
And The Game Title and Game Code of Shantae is empty (0x00) which is also a bad status for recognizing.

2. Recognize Save ID String in rom
There are Save ID string stored in retail rom, such as EEPROM_V***, SRAM_V***, FLASH_V***, FLASH512_V***, FLASH1M_V***. Some emulators find these ID strings in rom to determine save type of game, Such as GbaRunner2/3, Open_agb_frim, OpenFpga Core of Analogue Pocket.
GbaRunner2/3
will apply SRAM patch to repalce the original save hex after finding ID string in rom in some cases. That why some sram-patched rom can't be saved in GbaRunner2/3, cause original save hex has already been replaced and Gbarunner2/3 can't find the correct palce to apply its sram patch.

3. Identify program execution
Some emulator determine save type of game by Identifying program execution when running game. Finding what addresses the game trying to read and write to distinguish the save type. It may also combine the Pre-built Save Library and Recognize Save ID String in rom to Improve accuracy. mgba 's autodetect uses a similar mechanism like this.

4. Manual settings by the player
Many emulators and flashcarts provide Manual settings for player to choose save type, such as ezo(de), everdrive x5, mgba, Open_agb_frim, Tools for making 3dsVC, wiiuVC etc. . Choosing the correct save type can let patched rom work well.

5. Physical Cartridges
This situation requires the Save Chip of the Cartridge Hardware to match the Save Function of the ROM Program Software.
Limited Run Games decide to use FRAM chip cartridge to burning rom, while rom's original Save Function is for EEPROM chip. That why they use GBATA to apply SRAM patch on rom to change its Save Function for SRAM/FRAM chip.
(They said they were going to acquire the discontinued FRAM chips, but why didn't they choose to acquire the equally discontinued EEPROM chips?)


[TABLE=full]
[TR]
[TD][/TD]

[TD]Pre-built Save Library *1[/TD]
[TD]Recognize Save ID String in rom[/TD]
[TD]Identify program execution[/TD]
[TD]Manual settings by the player[/TD]
[TD]Physical Cartridges[/TD]
[/TR]
[TR]
[TD]Original dumped rom[/TD]
[TD]CAN work[/TD]
[TD]CANNOT work *2[/TD]
[TD]Sometimes CAN,
Sometimes CANNOT work[/TD]
[TD]Choose SRAM[/TD]
[TD]SRAM/FRAM 32KB(/256Kbit) cartridges[/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD]CANNOT work *3[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Choose EEPROM *4[/TD]
[TD]16MB EEPROM 512B(/4Kbit) cartridges *5[/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Both above can[/TD]
[TD]Both above can[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]*1: Using SRAM if not in Lib.
*2: Change the ID string to SRAM_V*** can make it work.
*3: Give rom a Game Code and add it to lib can make it work.
*4: If there is a classification, choose EEPROM 512B(/4Kbit), some emulator or flashcarts can work fine if choose EEPROM 8KB(/64Kbit) .
*5
: NOT!!! 32MB either EEPROM 8KB(/64Kbit) cartridges.[/TD]
[/TR]
[/TABLE]
 

Attachments

Last edited by Wokann,
Thank you, I was going insane thinking my Analogue Pocket was trying to save it wrong because there was never a .sav file, only save states worked. Thank you for this!

(And is there a certain way to remove the SRAM save patches from other GBATA-patched ROMs?)
 
(And is there a certain way to remove the SRAM save patches from other GBATA-patched ROMs?)
Actually for the hack roms based on retail game, if they were sram-patched, the easiest way to remove patch is to use its original retail rom to apply sram patch.
Then using patch tool to compare the original retail game and patched retail game, you can get the remove/add sram patch.
This patch only contain the difference of sram hack, so you can use this patch on most hacked rom based on this retail game to remove/add sram patch.
 
Thanks! I patched the rom and got a matching checksum. I tested it in mgba and it saves and loads as expected.
I then copied the rom and save to my Omega, starting as usual with save type left on auto, it didn't find the existing save, and saving didn't work. Choosing eeprom-8k when starting the rom let it load the save. What would it need to make the Omega recognise it as eeprom-8k when left on auto? Or I guess I could try it without the patch and see if it works as SRAM on auto.
 
Last edited by hippy dave,
  • Like
Reactions: zfreeman
Thanks! I patched the rom and got a matching checksum. I tested it in mgba and it saves and loads as expected.
I then copied the rom and save to my Omega, starting as usual with save type left on auto, it didn't find the existing save, and saving didn't work. Choosing eeprom-8k when starting the rom let it load the save. What would it need to make the Omega recognise it as eeprom-8k when left on auto?
It's because in AUTO mode ezo(de) and everdrive x5 use a hard-coded save type library to find what save type the gba game is.
If this game can't be found in lib, it will use SRAM type to run this game. That's why the dumped rom which has sram patch can run normally in AUTO mode while the eeprom fixed rom can't run well in AUTO mode and need to select eeprom 8k by yourself.
As usual, we can add the last 4 byte char of title name in rom header and the save type to the lib, so that AUTO mode can recognize it normally.
But regrettably, gba shantea doesn't give a title name, and remain empty bytes 0x00 for title name in rom header. So adding game's save type to the lib can't work well, and we still need to switch the save type manually when running eeprom fixed rom.
 
Last edited by Wokann,
It's because in AUTO mode ezo(de) and everdrive x5 use a hard-coded save type library to find what save type the gba game is.
If this game can't be found in lib, it will use SRAM type to run this game. That's why the dumped rom which has sram patch can run normally in AUTO mode while the eeprom fixed rom can't run well in AUTO mode and need to select eeprom 8k by yourself.
As usual, we can add the last 4 byte char of title name in rom header and the save type to the lib, so that AUTO mode can recognize it normally.
But regrettably, gba shantea doesn't give a title name, and remain empty bytes 0x00 for title name in rom header. So adding game's save type to the lib can't work well, and we still need to switch the save type manually when running eeprom fixed rom.
Thanks, yeah that's a pain. I guess I can just use the SRAM version if it functions ok
 
It's because in AUTO mode ezo(de) and everdrive x5 use a hard-coded save type library to find what save type the gba game is.
If this game can't be found in lib, it will use SRAM type to run this game. That's why the dumped rom which has sram patch can run normally in AUTO mode while the eeprom fixed rom can't run well in AUTO mode and need to select eeprom 8k by yourself.
As usual, we can add the last 4 byte char of title name in rom header and the save type to the lib, so that AUTO mode can recognize it normally.
But regrettably, gba shantea doesn't give a title name, and remain empty bytes 0x00 for title name in rom header. So adding game's save type to the lib can't work well, and we still need to switch the save type manually when running eeprom fixed rom.
oh bless you, thank you so much i was just about to ask if we put on AUTO or EEPROM as using AUTO works if one soft resets, but not if you hard reset
Post automatically merged:

oh bless you, thank you so much i was just about to ask if we put on AUTO or EEPROM as using AUTO works if one soft resets, but not if you hard reset
so the new patch didn't work on my ezfoDE is there something im missing?
 
Last edited by ChronoCrossfangirl2002,
oh bless you, thank you so much i was just about to ask if we put on AUTO or EEPROM as using AUTO works if one soft resets, but not if you hard reset

so the new patch didn't work on my ezfoDE is there something im missing?
ROM INFO
1. Original dumped rom

Save Type: SRAM 32KB(/256Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original EEPROM 512B(/4Kbit) with SRAM 32KB(/256Kbit) patch applied by using GBATA. For purpose of burning game on FRAM save chip (= SRAM without battery) physical cartridges.

2. EEPROM save fixed rom (eeprom_back patch)
Save Type: EEPROM 512B(/4Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original save function status of this game.
(sorry that the eeprom save size of shantae gba is 512B not 8KB, I now fixed the text)

3. EEPROM & SRAM compatible rom (eeprom&sram patch)
Save Type: EEPROM 512B(/4Kbit) and SRAM 32KB(/256Kbit) compatible
Save ID String in rom: EEPROM_V122
P.S. : Save hack which can support most emluators and flashcarts whether they recognize this patched game as EEPROM or SRAM.


Save Mechanism
1. Pre-built Save Library

The AUTO mode of ezo(de) use Pre-built Save Library to determine save type of game by finding the Game Code in rom header. If one game isn't in this Lib, save type will choose SRAM in default. everdrive x5 is similar and have a Pre-built Save Library too.
Shantae Advance isn't in this lib, so in AUTO mode it will be run as SRAM type.
And The Game Title and Game Code of Shantae is empty (0x00) which is also a bad status for recognizing.

2. Recognize Save ID String in rom
There are Save ID string stored in retail rom, such as EEPROM_V***, SRAM_V***, FLASH_V***, FLASH512_V***, FLASH1M_V***. Some emulators find these ID strings in rom to determine save type of game, Such as GbaRunner2/3, Open_agb_frim, OpenFpga Core of Analogue Pocket.
GbaRunner2/3
will apply SRAM patch to repalce the original save hex after finding ID string in rom in some cases. That why some sram-patched rom can't be saved in GbaRunner2/3, cause original save hex has already been replaced and Gbarunner2/3 can't find the correct palce to apply its sram patch.

3. Identify program execution
Some emulator determine save type of game by Identifying program execution when running game. Finding what addresses the game trying to read and write to distinguish the save type. It may also combine the Pre-built Save Library and Recognize Save ID String in rom to Improve accuracy. mgba 's autodetect uses a similar mechanism like this.

4. Manual settings by the player
Many emulators and flashcarts provide Manual settings for player to choose save type, such as ezo(de), everdrive x5, mgba, Open_agb_frim, Tools for making 3dsVC, wiiuVC etc. . Choosing the correct save type can let patched rom work well.

5. Physical Cartridges
This situation requires the Save Chip of the Cartridge Hardware to match the Save Function of the ROM Program Software.
Limited Run Games decide to use FRAM chip cartridge to burning rom, while rom's original Save Function is for EEPROM chip. That why they use GBATA to apply SRAM patch on rom to change its Save Function for SRAM/FRAM chip.
(They said they were going to acquire the discontinued FRAM chips, but why didn't they choose to acquire the equally discontinued EEPROM chips?)


[TABLE=full]
[TR]
[TD][/TD]

[TD]Pre-built Save Library *1[/TD]
[TD]Recognize Save ID String in rom[/TD]
[TD]Identify program execution[/TD]
[TD]Manual settings by the player[/TD]
[TD]Physical Cartridges[/TD]
[/TR]
[TR]
[TD]Original dumped rom[/TD]
[TD]CAN work[/TD]
[TD]CANNOT work *2[/TD]
[TD]Sometimes CAN,
Sometimes CANNOT work[/TD]
[TD]Choose SRAM[/TD]
[TD]SRAM/FRAM 32KB(/256Kbit) cartridges[/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD]CANNOT work *3[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Choose EEPROM *4[/TD]
[TD]16MB EEPROM 512B(/4Kbit) cartridges *5[/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Both above can[/TD]
[TD]Both above can[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]*1: For case using SRAM if not in Lib.
*2: Change the ID string to SRAM_V*** can make it work.
*3: Give rom a Game Code and add it to lib can make it work.
*4: If there is a classification, choose EEPROM 512B(/4Kbit), some emulator or flashcarts can work fine if choose EEPROM 8KB(/64Kbit) .
*5
: NOT!!! 32MB either EEPROM 8KB(/64Kbit) cartridges.[/TD]
[/TR]
[/TABLE]
 
Last edited by Wokann,
All I can say
ROM INFO
1. Original dumped rom

Save Type: SRAM 32KB(/256Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original EEPROM 8KB(/64Kbit) with SRAM 32KB(/256Kbit) patch applied by using GBATA. For purpose of burning game on FRAM save chip (= SRAM without battery) physical cartridges.

2. EEPROM save fixed rom (eeprom_back patch)
Save Type: EEPROM 8KB(/64Kbit)
Save ID String in rom: EEPROM_V122
P.S. : Original save function status of this game.

3. EEPROM & SRAM compatible rom (eeprom&sram patch)
Save Type: EEPROM 8KB(/64Kbit) and SRAM 32KB(/256Kbit) compatible
Save ID String in rom: EEPROM_V122
P.S. : Save hack which can support most emluators and flashcarts whether they recognize this patched game as EEPROM or SRAM.


Save Mechanism
1. Pre-built Save Library

The AUTO mode of ezo(de) use Pre-built Save Library to determine save type of game by finding the Game Code in rom header. If one game isn't in this Lib, save type will choose SRAM in default. everdrive x5 is similar and have a Pre-built Save Library too.
Shantae Advance isn't in this lib, so in AUTO mode it will be run as SRAM type.
And The Game Title and Game Code of Shantae is empty (0x00) which is also a bad status for recognizing.

2. Recognize Save ID String in rom
There are Save ID string stored in retail rom, such as EEPROM_V***, SRAM_V***, FLASH_V***, FLASH512_V***, FLASH1M_V***. Some emulators find these ID strings in rom to determine save type of game, Such as GbaRunner2/3, Open_agb_frim, OpenFpga Core of Analogue Pocket.
GbaRunner2/3
will apply SRAM patch to repalce the original save hex after finding ID string in rom in some cases. That why some sram-patched rom can't be saved in GbaRunner2/3, cause original save hex has already been replaced and Gbarunner2/3 can't find the correct palce to apply its sram patch.

3. Identify program execution
Some emulator determine save type of game by Identifying program execution when running game. Finding what addresses the game trying to read and write to distinguish the save type. It may also combine the Pre-built Save Library and Recognize Save ID String in rom to Improve accuracy. mgba 's autodetect uses a similar mechanism like this.

4. Manual settings by the player
Many emulators and flashcarts provide Manual settings for player to choose save type, such as ezo(de), everdrive x5, mgba, Open_agb_frim, Tools for making 3dsVC, wiiuVC etc. . Choosing the correct save type can let patched rom work well.

5. Physical Cartridges
This situation requires the Save Chip of the Cartridge Hardware to match the Save Function of the ROM Program Software.
Limited Run Games decide to use FRAM chip cartridge to burning rom, while rom's original Save Function is for EEPROM chip. That why they use GBATA to apply SRAM patch on rom to change its Save Function for SRAM/FRAM chip.
(They said they were going to acquire the discontinued FRAM chips, but why didn't they choose to acquire the equally discontinued EEPROM chips?)


[TABLE=full]
[TR]
[TD][/TD]

[TD]Pre-built Save Library *1[/TD]
[TD]Recognize Save ID String in rom[/TD]
[TD]Identify program execution[/TD]
[TD]Manual settings by the player[/TD]
[TD]Physical Cartridges[/TD]
[/TR]
[TR]
[TD]Original dumped rom[/TD]
[TD]CAN work[/TD]
[TD]CANNOT work *2[/TD]
[TD]Sometimes CAN,
Sometimes CANNOT work[/TD]
[TD]Choose SRAM[/TD]
[TD]SRAM/FRAM 32KB(/256Kbit) cartridges[/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD]CANNOT work *3[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Choose EEPROM *4[/TD]
[TD]16MB EEPROM 8KB(/64Kbit) cartridges *5[/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]CAN work[/TD]
[TD]Both above can[/TD]
[TD]Both above can[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]*1: For case using SRAM if not in Lib.
*2: Change the ID string to SRAM_V*** can make it work.
*3: Give rom a Game Code and add it to lib can make it work.
*4: If there is a classification, choose EEPROM 8KB(/64Kbit), NOT!!! EEPROM 512B(/4Kbit) .
*5
: NOT!!! 32MB either EEPROM 512B(/4Kbit) cartridges.[/TD]
[/TR]
[/TABLE]
I got this game working on a SRAM repro cart with a battery and it works fine and saves up to a certain point. I also got it working on a Flash Save Cart if I patch the SRAM patched ROM with gba-flash.exe, I also got it working and saving fine on this cart.
Unfortunately the saves between the emulator and the Flash Cart are not compatible. And the saves on the SRAM cart with battery work but at some point the game graphics do glitch out and the game crashes.

So no way to use save states and cheats and then export the save and load it to cart. It has to be played through from start to finish on just Retroarch or just the cart with the rom flashed

**Edit**

OK I just tried a Pokemon 16MB repro cart I have, it uses SRAM and the rom works on it but does not save. However I patched the rom for batteryless and it saves fine to the ROM and I also can transfer the save to Retroarch and back to the rom and it works with no glitches.

This is the rom to use on the emulator
-----------------------------------------
Software Title: SHANTAE ADV
Game Serial: AGB-CSAE-USA
Maker Code: 08
Publisher: Capcom
Version: 1.0
Logo Code: OK
Complement: AEh
Save Type: SRAM_F_V103 (256Kbit)
File Size: 128 mbit (16777216 bytes)
CRC32: 0BBDF665
-----------------------------------------

And it needs to be patched for batteryless save. I will try it again on my SRAM cart that has a battery but I think it was glitching on that one.
 
Last edited by saulin,
All I can say

I got this game working on a SRAM repro cart with a battery and it works fine and saves up to a certain point. I also got it working on a Flash Save Cart if I patch the SRAM patched ROM with gba-flash.exe, I also got it working and saving fine on this cart.
Unfortunately the saves between the emulator and the Flash Cart are not compatible. And the saves on the SRAM cart with battery work but at some point the game graphics do glitch out and the game crashes.

So no way to use save states and cheats and then export the save and load it to cart. It has to be played through from start to finish on just Retroarch or just the cart with the rom flashed

**Edit**

OK I just tried a Pokemon 16MB repro cart I have, it uses SRAM and the rom works on it but does not save. However I patched the rom for batteryless and it saves fine to the ROM and I also can transfer the save to Retroarch and back to the rom and it works with no glitches.

This is the rom to use on the emulator
-----------------------------------------
Software Title: SHANTAE ADV
Game Serial: AGB-CSAE-USA
Maker Code: 08
Publisher: Capcom
Version: 1.0
Logo Code: OK
Complement: AEh
Save Type: SRAM_F_V103 (256Kbit)
File Size: 128 mbit (16777216 bytes)
CRC32: 0BBDF665
-----------------------------------------

And it needs to be patched for batteryless save. I will try it again on my SRAM cart that has a battery but I think it was glitching on that one.
Since the details in your description are incomplete, I have tried to reorganize it. Please check if there are any parts that do not match your actual situation, and I will modify the text accordingly.

Are these Roms you mentioned?
1. Original dumped Rom (The same as what I mentioned above, Pre-SRAMPatched by Limited Run Games)
2. SRAM save fixed Rom (Another save fix patch from Reddit to apply on Original dumped Rom , which add custom GameTitle, GameCode, and change Publisher, checksum, save ID string)
(Besides, There is also a SRAM save fixed patch from gbarunner3's github issue, which add another custom GameTitle, GameCode, and change checksum, save ID string)
(The core factor for fixing save of these two patches, is changing save ID string, and the sram-patched eeprom sdk is still here without changing.
Which is different from what I did to remove sram-patch and let the original eeprom sdk back.)
3. FLASH save patched Rom (FLASH save patch apply on SRAM save fixed Rom)
4. BatteryLess patched Rom (BatteryLess patch apply on SRAM save fixed Rom)

(Well, you did not use either my EEPROM save fixed patch or my EEPROM & SRAM compatible patch?)

Are these physical cartridges you mentioned?
1. SRAM(256Kbit) chip cartridge with battery
2. FLASH(512Kbit/1Mbit) chip cartridge
3. Another Pokemon SRAM(512Kbit/1Mbit) chip cartridge with battery

Are these the problem you met?
[TABLE=full]
[TR]
[TD][/TD]

[TD]Emulator (Retroarch)[/TD]
[TD]
SRAM(256Kbit) chip cartridge with battery[/TD]
[TD]FLASH(512Kbit/1Mbit) chip cartridge[/TD]
[TD]Another Pokemon SRAM(512Kbit/1Mbit) chip cartridge with battery[/TD]
[/TR]
[TR]
[TD]Original dumped Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]SRAM save fixed Rom[/TD]
[TD]CAN save
(Named it Save No.1)[/TD]
[TD]CAN save,
Sometimes graphics do glitch out and the game crashes.
(Named it Save No.2)[/TD]
[TD][/TD]

[TD]CANNOT save[/TD]
[/TR]
[TR]
[TD]FLASH save patched Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD]CAN save
(Named it Save No.3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BatteryLess patched Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD]CAN save
(Named it Save No.4)[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]Compatibility Problems:
1. Save No.3 CANNOT Work in Save No.1's environment. The reverse is also.
2. Save No.4 CAN Work in Save No.1's environment, and No graphic glitch or crash. The reverse is also.[/TD]
[/TR]
[/TABLE]

Before you confirm the above information, I can answer Compatibility Problem 1 for you first.
When the SRAM patch is applied to the EEPROM or FLASH game, it will not change the order of the save bytes. After the EEPROM 512B Shantae is patched with SRAM, only the original data of the first 512B will be used, and the remaining part of the SRAM 32KB will be filled with 0x00 or 0xFF. So when this save is read by the ROM without the SRAM patch, it will still read the first 512B normally without any impact.
However, the FLASH patch is different. It fills 0xFF between each byte of the original EEPROM and SRAM save to fill the entire FLASH 64KB space. Each EEPROM 512B/8KB byte will be filled with 7 0xFFs, and each SRAM 32KB byte will be filled with 1 0xFF. The filled FLASH save cannot be directly recognized by the original ROM without the patch, which is why the save of SAVE No.3 and Save No.1 cannot run in each other's environment.

You can use the conversion tool I made to convert the save between the FLASH patch save and the Original save.
Also for some emulator and flashcart, there is another problems about the bytes reverse of EEPROM save, I post the reverse tool here too in case.
 

Attachments

Last edited by Wokann,
  • Like
Reactions: Nephiel and qkwyx
Since the details in your description are incomplete, I have tried to reorganize it. Please check if there are any parts that do not match your actual situation, and I will modify the text accordingly.

Are these Roms you mentioned?
1. Original dumped Rom (The same as what I mentioned above, Pre-SRAMPatched by Limited Run Games)
2. SRAM save fixed Rom (Another save fix patch from Reddit to apply on Original dumped Rom , which add custom GameTitle, GameCode, and change Publisher, checksum, save ID string)
(Besides, There is also a SRAM save fixed patch from gbarunner3's github issue, which add another custom GameTitle, GameCode, and change checksum, save ID string)
(The core factor for fixing save of these two patches, is changing save ID string, and the sram-patched eeprom sdk is still here without changing.
Which is different from what I did to remove sram-patch and let the original eeprom sdk back.)
3. FLASH save patched Rom (FLASH save patch apply on SRAM save fixed Rom)
4. BatteryLess patched Rom (BatteryLess patch apply on SRAM save fixed Rom)

(Well, you did not use either my EEPROM save fixed patch or my EEPROM & SRAM compatible patch?)

Are these physical cartridges you mentioned?
1. SRAM(256Kbit) chip cartridge with battery
2. FLASH(512Kbit/1Mbit) chip cartridge
3. Another Pokemon SRAM(512Kbit/1Mbit) chip cartridge with battery

Are these the problem you met?
[TABLE=full]
[TR]
[TD][/TD]

[TD]Emulator (Retroarch)[/TD]
[TD]
SRAM(256Kbit) chip cartridge with battery[/TD]
[TD]FLASH(512Kbit/1Mbit) chip cartridge[/TD]
[TD]Another Pokemon SRAM(512Kbit/1Mbit) chip cartridge with battery[/TD]
[/TR]
[TR]
[TD]Original dumped Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]SRAM save fixed Rom[/TD]
[TD]CAN save
(Named it Save No.1)[/TD]
[TD]CAN save,
Sometimes graphics do glitch out and the game crashes.
(Named it Save No.2)[/TD]
[TD][/TD]

[TD]CANNOT save[/TD]
[/TR]
[TR]
[TD]FLASH save patched Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD]CAN save
(Named it Save No.3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BatteryLess patched Rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD]CAN save
(Named it Save No.4)[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]Compatibility Problems:
1. Save No.3 CANNOT Work in Save No.1's environment. The reverse is also.
2. Save No.4 CAN Work in Save No.1's environment, and No graphic glitch or crash. The reverse is also.[/TD]
[/TR]
[/TABLE]

Before you confirm the above information, I can answer Compatibility Problem 1 for you first.
When the SRAM patch is applied to the EEPROM or FLASH game, it will not change the order of the save bytes. After the EEPROM 512B Shantae is patched with SRAM, only the original data of the first 512B will be used, and the remaining part of the SRAM 32KB will be filled with 0x00 or 0xFF. So when this save is read by the ROM without the SRAM patch, it will still read the first 512B normally without any impact.
However, the FLASH patch is different. It fills 0xFF between each byte of the original EEPROM and SRAM save to fill the entire FLASH 64KB space. Each EEPROM 512B/8KB byte will be filled with 7 0xFFs, and each SRAM 32KB byte will be filled with 1 0xFF. The filled FLASH save cannot be directly recognized by the original ROM without the patch, which is why the save of SAVE No.3 and Save No.1 cannot run in each other's environment.

You can use the conversion tool I made to convert the save between the FLASH patch save and the Original save.
Also for some emulator and flashcart, there is another problems about the bytes reverse of EEPROM save, I post the reverse tool here too in case.

OK so the Flash Save Cart I'm using is this one

https://www.aliexpress.com/item/1005008075270034.html

And this is the ROM I used for it.

-----------------------------------------
Software Title:
Game Serial: AGB-
Maker Code: 01
Publisher: Nintendo
Version: 1.0
Logo Code: OK
Complement: F0h
Save Type: EEPROM_V122
File Size: 128 mbit (16777216 bytes)
CRC32: F2F66F5E
-----------------------------------------

I took that rom and patched it for SRAM with gbata and then I patched it to work on a Flash only Save cart with gba-flash.exe

This makes this cart work and save normal on this cart.

Now the other cart where it works fine is a 16MB Pokemon repro cart I got from someone, I'm pretty sure it uses SRAM to save but it has no battery, so I patched the rom for batteryless save. Again it works and saves fine.

The info for the cart is bellow

I also tried it on this other cart and the game starts working fine and saves fine for the first few saves but later has graphics glitches and locks up on a 32MB Yugioh Double Pack repro cart I bought. This one does have a battery. I just flashed all the versions I had to it and some will save but at some point, it does glitch and locks up.

https://www.aliexpress.com/item/1005006986022075.html

Also I would like to convert the SRAM save to Flash type save to put it on the cart with 1MB Flash Save, is that possible?
 

Attachments

  • Shantae-16MB-Pokemon Cart.JPG
    Shantae-16MB-Pokemon Cart.JPG
    76.9 KB · Views: 65
  • shantae1-32MB-Flash-RTC-Solar.JPG
    shantae1-32MB-Flash-RTC-Solar.JPG
    74.4 KB · Views: 70
  • Shantae_Saves.zip
    Shantae_Saves.zip
    961 bytes · Views: 31
Last edited by saulin,
OK so the Flash Save Cart I'm using is this one

https://www.aliexpress.com/item/1005008075270034.html

And this is the ROM I used for it.

-----------------------------------------
Software Title:
Game Serial: AGB-
Maker Code: 01
Publisher: Nintendo
Version: 1.0
Logo Code: OK
Complement: F0h
Save Type: EEPROM_V122
File Size: 128 mbit (16777216 bytes)
CRC32: F2F66F5E
-----------------------------------------

I took that rom and patched it for SRAM with gbata and then I patched it to work on a Flash only Save cart with gba-flash.exe

This makes this cart work and save normal on this cart.

Now the other cart where it works fine is a 16MB Pokemon repro cart I got from someone, I'm pretty sure it uses SRAM to save but it has no battery, so I patched the rom for batteryless save. Again it works and saves fine.

The info for the cart is bellow

I also tried it on this other cart and the game starts working fine and saves fine for the first few saves but later has graphics glitches and locks up on a 32MB Yugioh Double Pack repro cart I bought. This one does have a battery. I just flashed all the versions I had to it and some will save but at some point, it does glitch and locks up.

https://www.aliexpress.com/item/1005006986022075.html

Also I would like to convert the SRAM save to Flash type save to put it on the cart with 1MB Flash Save, is that possible?
The Rom you mentioned (crc32: F2F66F5E) is EEPROM save fixed rom which remove gabta's SRAM patch. And you patched it with gbata's SRAM patch again. So in fact this rom is the same as Original dumped Rom. I will still call this rom as Original dumped Rom below.

So the new roms info are:
1. Original dumped Rom (The same as what I mentioned above, Pre-SRAMPatched by Limited Run Games) (You used EEPROM save fixed to fix it and then re-patched the gbata's SRAM patch to back getting this Original dumped Rom)
2. SRAM save fixed Rom (Another save fix patch from Reddit to apply on Original dumped Rom , which add custom GameTitle, GameCode, and change Publisher, checksum, save ID string)
(Besides, There is also a SRAM save fixed patch from gbarunner3's github issue, which add another custom GameTitle, GameCode, and change checksum, save ID string)
(The core factor for fixing save of these two patches, is changing save ID string, and the sram-patched eeprom sdk is still here without changing.
Which is different from what I did to remove sram-patch and let the original eeprom sdk back.)
3. FLASH save patched Rom (FLASH save patch apply on Original dumped Rom/SRAM save fixed Rom)
4. BatteryLess patched Rom (BatteryLess patch apply on Original dumped Rom/SRAM save fixed Rom)

HOWEVER, although you said you used EEPROM save fixed rom to patch gbata's SRAM patch (At this moment , rom is the same as Original dumped Rom), and then used it to patch gba-flash patch, but the screenshots you posted show you used SRAM save fixed Rom to patch FLASH patch and BatteryLess patch, which has GameTitle, GameCode and 0xAE checksum.
But of course, whether you use Original dumped Rom or SRAM save fixed Rom to patch, the result of running on the physical cartridges is the same.

The new cartridges info are:
1. 32MB+SRAM(256Kbit) chip cartridge with battery (32MB Yugioh Double Pack repro cart)
2. 32MB+FLASH(1Mbit)+RTC+Solar chip cartridge with battery (battery only works for RTC)
3. 16MB+SRAM(512Kbit/1Mbit) chip cartridge without battery (16MB Pokemon repro cart. Batteryless-patch needed, and since it's for pokemon, it may use SRAM 512Kbit only or 1Mbit with bank-switching hareware)

The problems are:
[TABLE=full]
[TR]
[TD][/TD]

[TD]Emulator (Retroarch)[/TD]
[TD]32MB+SRAM(256Kbit) chip cartridge with battery[/TD]
[TD]32MB+FLASH(1Mbit)+RTC+Solar chip cartridge with battery[/TD]
[TD]16MB+SRAM(512Kbit/1Mbit) chip cartridge without battery[/TD]
[/TR]
[TR]
[TD]Original dumped Rom[/TD]
[TD][/TD]

[TD]CAN save
(Named it Save No.2)[/TD]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM save fixed rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]EEPROM & SRAM compatible rom[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]SRAM save fixed Rom[/TD]
[TD]CAN save
(Named it Save No.1)[/TD]
[TD][/TD]

[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD]FLASH save patched Rom[/TD]
[TD][/TD]

[TD]Not Sure. You don't say much.
(In theory it CANNOT save)
(Named it Save No.5)[/TD]
[TD]CAN save
(Named it Save No.3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BatteryLess patched Rom[/TD]
[TD][/TD]

[TD]Not Sure. You don't say much.
(In theory it CAN save)
(Named it Save No.6)[/TD]
[TD][/TD]

[TD]CAN save
(Named it Save No.4)[/TD]
[/TR]
[/TABLE]
[TABLE=full]
[TR]
[TD]Compatibility Problems:
1. Save No.3 CANNOT Work in Save No.1's environment. The reverse is also.
2. Save No.4 CAN Work in Save No.1's environment, and No graphic glitch or crash. The reverse is also.
3. Save No.2 Sometimes graphics do glitch out and the game crashes. (I move this problem from table to this area.)
4. Save No.5 and Save No.6, some will save but at some point, it does glitch and locks up.[/TD]
[/TR]
[/TABLE]

So the main problems is about the 32MB+SRAM(256Kbit) chip cartridge with battery (32MB Yugioh Double Pack repro cart). The roms which can save on it will always meet graphic glitch and crash.
I guess the hareware of this cartridge has been broken which occur these problems. You may find another SRAM chip cartridge with battery to try. Or can you give an accurate process that can trigger the bug and its corresponding save, so that I can test it.

Also I would like to convert the SRAM save to Flash type save to put it on the cart with 1MB Flash Save, is that possible?
For this, you need to cut the SRAM save to the size 512Bytes (Just keep first 0x200Bytes), then use my tool above (gba_FLASH512K_trans2_EEPROMorSRAM) to convert it to Flash patched save and use it on FLASH cartridges with FLASH patched rom.
ADD: your flash save is 1Mbit and the empty bytes is 0x00 not 0xFF, the tool I made can't recognize it, I will update this tool later.
 
Last edited by Wokann,
What are the steps for playing the game on 3DS? I installed a cia file I made with 3DS GBA Footer Generator v.0.2d and 3DS Simple GBA Converter v1.3. The game runs fine, but it's unable to save. The game does not crash, but the save file is not created or found. I tried with each patch, eeprom&sram and eeprom_back, applied separately to the rom to no avail. I don't know how you turned this into a 16MB file and if that is necessary or if any additional steps are required. Thank you.

EDIT: I will run a few more tests, but I finally managed to create and load save file. I did not use any patch and I selected Memory Config Type 2 instead of Type 1 when creating the footer.
 
Last edited by Waveracer,
What are the steps for playing the game on 3DS? I installed a cia file I made with 3DS GBA Footer Generator and 3DS Simple GBA Converter. The game runs fine, but it's unable to save. The game does not crash, but the save file is not created or found. I tried with each patch, eeprom&sram and eeprom_back, applied separately to the rom to no avail. I don't know how you turned this to a 16MB file and if that is necessary or if any additional steps are required. Thank you.

EDIT: I will make a few more tests, but I finally managed to create save file. I did not use any patch and I selected Memory Config Type 2 instead of Type 1 when creating the footer.
could you provide a play by play of how you figured this out? i'm sorta stuck with the 32mb bad dump and im unsure if it's just a matter of patching the rom or using GBATA and doing extra stuff
 
What are the steps for playing the game on 3DS? I installed a cia file I made with 3DS GBA Footer Generator and 3DS Simple GBA Converter. The game runs fine, but it's unable to save. The game does not crash, but the save file is not created or found. I tried with each patch, eeprom&sram and eeprom_back, applied separately to the rom to no avail. I don't know how you turned this into a 16MB file and if that is necessary or if any additional steps are required. Thank you.

EDIT: I will run a few more tests, but I finally managed to create save file. I did not use any patch and I selected Memory Config Type 2 instead of Type 1 when creating the footer.
I will explain your questions here both from your reply in this post and from private conversations you started.

Q1: Is cutting rom from 32MB to 16MB necessary?
A1: I recommend using a 16MB ROM, which is the correct content dumped from the 16MB rom chip in the offical physical cartridge. The 32MB ROM is the product of an error in the dump process and is an overdump.

Q2: How to cut 32MB rom to 16MB?
A2: You can use hex editor like Hxd, winhex etc. to delete the last half part of the 32MB rom, just remian the first 16MB (0x00000000-0x00FFFFFF) part. Or you can use GBA Tool Advance to open 32MB rom, finding 'Fix OverDump', choose '128Mbit (16Mbyte)', then press 'Fix' button, you will get the 16MB rom.
1746951202686.png


Q3: How to use eeprom&srameeprom_back patches?
A3: These ips patches are supposed to be applied on the 16MB Original dumped Rom. So you need to cut the 32MB rom to 16MB rom first.

Q4: The problems about '3DS GBA Footer Generator' and '3DS Simple GBA Converter'
A4:
I need to point out that the description in the footer program is actually wrong because it is too old.
1746951159894.png

The 'Memory Config' is actually about ‘Video LUT’ which named as 'Color Config' in Ultimate GBA VC inject for 3DS and in New Super Ultimate Injector for 3DS.
The 'Save Chip Manufacturer' is actually about ‘LCD Ghosting’ which named as 'Ghosting Adjustment' in Ultimate GBA VC inject for 3DS and in New Super Ultimate Injector for 3DS.
So these two option do NOTHING about save manual setting.
1746951633891.png


I've tested that whether you use the Original dumped Rom 16MB or 32MB (Pre-SRAM-patched), Selecting the corresponding ROM size and set the save type to SRAM do can save normally in 3DS.
Then I've tested the EEPROM save fixed rom to make 3DSVC, choosing 16MB, and set Save type to EEPROM. However it cannot save.
I checked the footer file it made, the problem is that the save type id was wrong. In fact, There are 15 save type for 3ds gbavc footer. Footer construction see here Link1 and Link2.
  • 0x0: EEPROM 4kbit for <= 128Mbit(16MB) roms
  • 0x1: EEPROM 4kbit for 128Mbit(16MB) ~ 256Mbit(32MB) roms
  • 0x2: EEPROM 64kbit for <= 128Mbit(16MB) roms
  • 0x3: EEPROM 64kbit for 128Mbit(16MB) ~ 256Mbit(32MB) roms
  • 0x4: Flash 512kbit (Atmel, ID: 0x3D1F) + RTC
  • 0x5: Flash 512kbit (Atmel, ID: 0x3D1F)
  • 0x6: Flash 512kbit (SST, ID: 0xD4BF) + RTC
  • 0x7: Flash 512kbit (SST, ID: 0xD4BF)
  • 0x8: Flash 512kbit (Panasonic, ID: 0x1B32) + RTC
  • 0x9: Flash 512kbit (Panasonic, ID: 0x1B32)
  • 0xA: Flash 1Mbit (Macronix, ID: 0x09C2) + RTC
  • 0xB: Flash 1Mbit (Macronix, ID: 0x09C2)
  • 0xC: Flash 1Mbit (Sanyo, ID: 0x1362) + RTC
  • 0xD: Flash 1Mbit (Sanyo, ID: 0x1362)
  • 0xE: SRAM/FRAM 256kbit
3DS GBA Footer Generator choose 0x02: EEPROM 64kbit for < 256 Mbit titles as the save type if you choose 'EEPROM'.
The actual Save type of Shantae advance is 0x0: EEPROM 4kbit for < 256 Mbit titles. I change the wrong value to correct value 0x0 and make 3ds gbavc. This time gbavc save is normal.
1746952428584.png

Ultimate GBA VC inject for 3DS may have similar problems cause it only have one choice for EEPROM.
New Super Ultimate Injector for 3DS can select the acutal save type, but the value of Flash and EEPROM configuration was wrong that using the value for FLASH/SRAM, which will also make save failed.
1746952977835.png

1746953007190.png

1746953039750.png

Conclusion: Since the eeprom mechanism is relatively complicated, several existing 3DS gbavc production tools have not been able to handle it well and manual correction is difficult for most players. I suggest you use Original dumped Rom or EEPROM & SRAM compatible rom, and choose the SRAM type to make gbavc.
Post automatically merged:

could you provide a play by play of how you figured this out? i'm sorta stuck with the 32mb bad dump and im unsure if it's just a matter of patching the rom or using GBATA and doing extra stuff
What emulator or flashcart are you using to play the game and facing problems?
 
Last edited by Wokann,
Nintendo 3DS plays Game Boy Advance titles natively but, like an emulator, the different save types and chips are emulated. Like Wokann explained, Shantae Advance: Risky Revolution has some characteristics that are unusual, and it's a new release on top of that, so problems with storing and loading save data might occur. On Nintendo 3DS, I managed to store and load save data using the tools and settings described above, but further testing is required.
 
So for anyone that has one of these carts. The game works perfect SRAM patched and patched for betteryless save. And the saves are compatible with Retroarch and the mGBA core, you just need to rename the the save to .srm for Retroarch and back to .sav to inject it back to the rom.

IMG_5252.JPG
 

Attachments

  • IMG_5253.JPG
    IMG_5253.JPG
    1.5 MB · Views: 70
So for anyone that has one of these carts. The game works perfect SRAM patched and patched for betteryless save. And the saves are compatible with Retroarch and the mGBA core, you just need to rename the the save to .srm for Retroarch and back to .sav to inject it back to the rom.

View attachment 504412
from the chip you shown, it seems not having bank-switching hardware, which means this is a SRAM 512Kbit batteryless cartridge. I guess when you played the batteryless patched pokemon on it, it will always show save is broken and use the backup save.
Then how about the most problematic situation of your 32MB+SRAM(256Kbit) chip cartridge with battery (32MB Yugioh Double Pack repro cart)?
 
Last edited by Wokann,
Thank you so much for doing this. Works perfectly on VBA GX on my hacked Wii! (well not flawless, but nearly) Now I don't have to spend exhorbitent eBay prices to play this somewhat mediocre Shantae game.
 

Site & Scene News

Popular threads in this forum