Hacking ROM Hack GBA GBA Automatic Batteryless Patcher

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
Automatic batteryless saving patcher for GBA

This program patches a GBA game for batteryless saving (i.e. saving on a bootleg cartridge containing SRAM but no battery).

The game must be SRAM patched before using this program. The patch will trigger a countdown lasting a few seconds whenever the game writes to SRAM. When the countdown expires, the patch tries to copy the save data to ROM. While the countdown is taking place, the graphics are purposefully corrupted.

Some games write to SRAM more frequently than you think. To save time, you may play the game in an emulator and observe when saving takes place to determine if it will be too often. Be sure to set the emulator to an SRAM save type if you do this.

Links:

Source:
https://github.com/metroid-maniac/gba-auto-batteryless-patcher

Releases:
https://github.com/metroid-maniac/gba-auto-batteryless-patcher/releases/
 

MaD_mAnIaC

In a mad world, only the mad are sane
Member
Joined
Oct 24, 2002
Messages
242
Trophies
2
Age
37
XP
1,782
Country
Portugal
Nice work! Tested it on some castlevanias and sonic games and seems to be working fine. One question, i tried patching the castlevania double pack rom, but only the first game (harmony of dissonance) seems to be patched and saving fine on the bootleg cart. the second game (aria of sorrow) boots and plays fine, but doesn't seem patched at all and doesn't hold the save. Is it possible to add support to this kind of double pack games? Thanks!
 

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
Nice work! Tested it on some castlevanias and sonic games and seems to be working fine. One question, i tried patching the castlevania double pack rom, but only the first game (harmony of dissonance) seems to be patched and saving fine on the bootleg cart. the second game (aria of sorrow) boots and plays fine, but doesn't seem patched at all and doesn't hold the save. Is it possible to add support to this kind of double pack games? Thanks!
It seems likely that this is a duplicate of this problem with YuGiOh Reshef of Darkness. I'm pretty busy these days but I'll look at it if I get a chance.
 
  • Like
Reactions: MaD_mAnIaC

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
Nice work! Tested it on some castlevanias and sonic games and seems to be working fine. One question, i tried patching the castlevania double pack rom, but only the first game (harmony of dissonance) seems to be patched and saving fine on the bootleg cart. the second game (aria of sorrow) boots and plays fine, but doesn't seem patched at all and doesn't hold the save. Is it possible to add support to this kind of double pack games? Thanks!
New release fixed this issue for me.
https://github.com/metroid-maniac/gba-auto-batteryless-patcher/releases/tag/0.3.6
 

MaD_mAnIaC

In a mad world, only the mad are sane
Member
Joined
Oct 24, 2002
Messages
242
Trophies
2
Age
37
XP
1,782
Country
Portugal

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
I can confirm both castlevanias from the double pack rom now save fine on a 16mb pokemon leafgreen bootleg cart, awesome! This makes these kind of cheap bootlegs a decent option to flash and play most games on real hardware. Many thanks for the update and tool!
If you're purchasing bootlegs for this purpose, you can get better carts (including carts with batteries!) by choosing the bootleg games wisely.
Currently, bootlegs of Yu-Gi-Oh! Double Pack and Yu-Gi-Oh! Ultimate Masters: World Championship Tournament 2006 seem to be available from AliExpress sellers and contain 32MB ROM, 64KB SRAM, and batteries. Such carts should handle 95% of the GBA's library.
If you already have batteryless carts then this tool is still useful.
 

MaD_mAnIaC

In a mad world, only the mad are sane
Member
Joined
Oct 24, 2002
Messages
242
Trophies
2
Age
37
XP
1,782
Country
Portugal
If you're purchasing bootlegs for this purpose, you can get better carts (including carts with batteries!) by choosing the bootleg games wisely.
Currently, bootlegs of Yu-Gi-Oh! Double Pack and Yu-Gi-Oh! Ultimate Masters: World Championship Tournament 2006 seem to be available from AliExpress sellers and contain 32MB ROM, 64KB SRAM, and batteries. Such carts should handle 95% of the GBA's library.
If you already have batteryless carts then this tool is still useful.
the leafgreen cart i already had it's nice to be able to repurpose with 2 castlevanias. i recently bought one of those 369-in-1 carts too to experiment, that seems to have 256mb and would be niceto hold several games. still didn't try to flash as i can't make a full backup of the cart and would like to do it before messing with flashing. but it's good to know about the Yu-Gi-Oh! carts specs, thanks!
 

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
the leafgreen cart i already had it's nice to be able to repurpose with 2 castlevanias. i recently bought one of those 369-in-1 carts too to experiment, that seems to have 256mb and would be niceto hold several games. still didn't try to flash as i can't make a full backup of the cart and would like to do it before messing with flashing. but it's good to know about the Yu-Gi-Oh! carts specs, thanks!
Fexean's GBABF should be able to dump the 369-in-1 cart slowly, one bank at a time. There's also dumps of it floating around if you know where to look. If you do want to use that cart, check out Ausar's menu, precompiled version attached.

https://github.com/ArcheyChen/GBAMultiCartMenuV2
 

Attachments

  • gba_manager_mb.23.04.21.gba.zip
    57.4 KB · Views: 58
  • Like
Reactions: MaD_mAnIaC

MaD_mAnIaC

In a mad world, only the mad are sane
Member
Joined
Oct 24, 2002
Messages
242
Trophies
2
Age
37
XP
1,782
Country
Portugal
Fexean's GBABF should be able to dump the 369-in-1 cart slowly, one bank at a time. There's also dumps of it floating around if you know where to look. If you do want to use that cart, check out Ausar's menu, precompiled version attached.

https://github.com/ArcheyChen/GBAMultiCartMenuV2
GBA BF gives me a "unable to open file" error when i try to dump. Maybe i'm using wrong starting address, any ideia what is the correct one?

That gba manager is a menu for the cart? i flash it to bank 0 and it'll autodetect the roms on the other banks?
 

ScoopDunk

Member
Newcomer
Joined
May 9, 2023
Messages
7
Trophies
0
Age
30
XP
69
Country
United States
Hi new to this. How do I run the code? I understand GitHub is an only a repository, but once I have the files where do I go from there?
 

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
Hi new to this. How do I run the code? I understand GitHub is an only a repository, but once I have the files where do I go from there?

The releases are linked in the OP of this thread. Download the .exe file and drag-and-drop an SRAM-patched GBA ROM onto it in the file browser.
 

ScoopDunk

Member
Newcomer
Joined
May 9, 2023
Messages
7
Trophies
0
Age
30
XP
69
Country
United States
The releases are linked in the OP of this thread. Download the .exe file and drag-and-drop an SRAM-patched GBA ROM onto it in the file browser.
Thanks, worked perfectly. I was able to flash a debug build of Pokémon sapphire to a cheap cartridge from china, but now I have the ability to save
 

inmortalkaktus

New Member
Newbie
Joined
May 21, 2023
Messages
1
Trophies
0
Age
23
XP
13
Country
Spain
The "auto bateryless" makes it impossible to save, getting a wait message when trying to save, and on the part of the 512 patcher, it simply says it has not found any write hooks, and asks if I have patched the SRAM (yes, I patched it with GBATA).

I've tested all this with emulators, but it doesn't seem that flashing these ROMs on my cartridges will yield any different results.

It would be great to have compatibility with Pokémon, there are plenty of fan ROMs whose structure is practically the same as Pokémon Emerald or Fire Red, and it would be a very good advance to be able to enjoy them with a more nostalgic experience.
 

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
The "auto bateryless" makes it impossible to save, getting a wait message when trying to save,

I've tested all this with emulators, but it doesn't seem that flashing these ROMs on my cartridges will yield any different results.
If you are are testing with emulators, have you ensured that the save type is SRAM (ideally SRAM 64KB)? mGBA has this option in the game overrides menu.

on the part of the 512 patcher, it simply says it has not found any write hooks, and asks if I have patched the SRAM (yes, I patched it with GBATA).
If you're trying to play Pokemon, it won't do anything, because those games are already using a flash save type. Flash 1M not flash 512k though.
 

Blung

New Member
Newbie
Joined
Jun 5, 2023
Messages
3
Trophies
0
XP
39
Country
Spain
When I try to patch Mother 3 Spanish Translation the program said: ROM already max size. Cannot expand. Cannot install payload.

Any solution for that, I'm very confused.
 

metroid maniac

An idiot with an opinion
OP
Member
Joined
May 16, 2009
Messages
2,088
Trophies
2
XP
2,636
Country
When I try to patch Mother 3 Spanish Translation the program said: ROM already max size. Cannot expand. Cannot install payload.

Any solution for that, I'm very confused.
There is no workaround. Mother 3 is a 32MB ROM, which is the maximum size the GBA can support. There is no available space inside the ROM to store the patch and the save file.
 
  • Like
Reactions: Blung

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
12,983
Trophies
4
Location
WA State
Website
ko-fi.com
XP
17,023
Country
United States
When I try to patch Mother 3 Spanish Translation the program said: ROM already max size. Cannot expand. Cannot install payload.

Any solution for that, I'm very confused.
There is no workaround. Mother 3 is a 32MB ROM, which is the maximum size the GBA can support. There is no available space inside the ROM to store the patch and the save file.
Not only this above, but Mother 3 is a FLASH_512K save ROM, so it's best just to buy a Mother 3 bootleg if you want proper saving of the game on real hardware. Golden Sun 2 uses the same type of PCB in it's cartridge.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Metoroid0 @ Metoroid0: im more interested in metroid prime 4