ROM Hack GBAATM-Rebirth (GBA Auto Trainer Maker): A new hope

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy
Well it is the 4th may so this title is kind of necessary...
It is a long post :-)

What is GBAATM:

Basically is a generator or patcher of GBA roms that add a trainer at rom start to enable the cheats. Also add slow motion support and some button combination to reboot the rom and renable cheats.
This is possible because the tool scan the rom to find hooks or memory address unused where inject the new assembly code and generating a new rom file.
Also, the tool support 2+1 cheatcodes type: raw, codebreaker and gameshark (this one is not enabled in some builds).
From a developer point of view the tool is an Ui where the users set various things like the cheats or the background image, cheatcodes converter and generate a new rom.
Why GBAATM-Rebirth (story):

It is a refactoring of the original GBAATM tool by Cracker that is compatible only with Windows.
Also, the purpose is to add support to other platform (I am working on this new project on Linux), create a new UI and add maybe new features.
I have GBA that since a year I am using it (backlit modded, new shell, everdrive the usual things), an original atari 2600 and a PSC modded.

Everything started in this forum where I found around the end of March the thread from the author of tool and found that it was still active. I already did months ago a porting of another tool for rom patching to Linux https://github.com/Mte90/Game-Genie-Good-Guy (short story compared to this one at this link), in Italy in that period there was the quarantine/lockdown (finished today) and I chosen to invest my time on doing something that for me with my work was difficult to achieve. Study reverse engineering and how works assembly, maybe also about GB development (this free book was very helpful https://github.com/ahrnbom/gbapfomgd).
Honestly I prefer the trainer inside the rom or the rom patched for that cheat so with other emulators and so on I can just play.

So I asked with a pm in this forum to Cracker if it was possible to get the original source code and do a new version of the tool, since that day I kept updates about it in the original thread.
Initially I didn't have the source code, so I tried on decompiling/reverse engineering the tool but with my missing experience was very hard. Also because I didn't know assembly and this project was very old.
When Cracker accepted and sent to me the code started everything. The code was written around 2008/2010, convert the project files from Microsoft Developer Studio 6 to Visual Code wasn't working. So I had to get a Windows XP Virtual Machine to compile the code and helping me with migrating and understand what was doing.

Probably I was very spammy on the thread with updates about development also because this was the first real C++ project I worked on. I never developed in C++ also if studied it a bit.
During the quarantine I studied a bit various open source GBA emulators and did some patches, you can find some info about it on my FOSS monthly reports of March and April (I usually do that since few years, I am active in the open source world).

The project wasn't easy initially because I had to integrate a very old codebase with modern C++ compilers, with a new framework (Qt that I already use a lot with Python). At same time I was busy with other open source projects and work but at the end I did it.

Tools used during development/experimenting:

During my experimenting I tried to get the assembly code from a rom but is not easy at all, Ghidra is not very friendly to get that as just txt to study and also radare. So my first thoughts was to get a GBA emulator and use it to generate that code but no one does. Luckyly eggvance gba emulator author was very friendly and did it for me a patched version and was very helpful to see the difference (original/rebirth rom generated instead of a full binary diff) during the debug, this rom to assembly is available at this link. Of course doesn't include the memory address used because is not a real emulator.
Virtualbox for the virtual machine with Microsoft Develop Studio 6, on Linux Qt Creator with visualbindiff, okteta, kompare, this disassembler and a lot of time.
Status:
The tool is not yet finished but right now can add the trainer and the rom generated is 1:1 with the same data of the original Windows version.
I chose to start a new thread because I consider the project as working and official and not just experimenting.

Right now before to consider it complete I need to improve the code quality, some bugfixes from the migration of this old codebase and evaluate new features.

There is also the feature of the slow motion that is not working yet. I was thinking if drop that feature now because all the emulators now support it and probably on a real GBA this is not required anymore.
Anyway when everything will be done I will build a version also for Windows (I have to see for Mac OSX) but I will keep posting updates.
Thanks:

To Cracker for sharing the original source code that is available on GitHub if someone is interested, but for bugs and feature requests I suggest using the GitHub project page.
Also thanks to this project I can study how works C++, knows more assembly and how compiled languages are very a mess (if you have no patience).
Thanks also to you for reading :-D

PS: sorry for my English if wasn't good.
 
Last edited by mte90,

Zense

Well-Known Member
Member
Joined
Apr 20, 2008
Messages
1,977
Trophies
2
XP
4,306
Country
Italy
Nice read! I'll be interested to see how this works - especially because a lot of people ask if they can use cheats in GBARunner2 for the DS family of systems (3ds included). I do agree that having the cheats in a trainer menu in the rom is easier than having to figure out how to use cheats with every single new emulator or system (like if you move between mGBA, no$gba, Gbarunner2, VBA etc.).

Oh and maybe you could increase the font size of your text and if it becomes too long you can just add parts in spoilers? :yaysp:
 
  • Like
Reactions: Alexander1970

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy
Some Updates:

* Started the code refactoring and now the rom is not broken if generated twice or changing the parameters
* Reimplemented the GS cheatcodes support as experimental as looking it was in debugging phase
* Some UI improvements
* Got 2 bugs reported, 1 already fixed
* Code that remove Slow Motion is already available but I will wait some days before approve it https://github.com/Mte90/GBAATM-Rebirth/pull/7 this will change again the UI and simplify more the code with an updated readme

81478548-88cc8380-921e-11ea-8a90-fc25344fecbc.png


About Previous post:

Thanks @Zense! Seems that there was some BBcode issues that I didn't spot.
 

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy
Last updates:

  • Fixed an issue with file picker with custom BMP
  • Investigating on the original code for Vblank (in progress) that seems broken https://github.com/Mte90/GBAATM-Rebirth/issues/5 we need help on converting the original code with VBA to the assembly version
  • Compile instructions in the readme
  • Fixed some compiling issues
  • Evaluation of some service to auto build the latest version for Windows/Linux/OSX automatically
 

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy
Last Updates:
  • Now it is possible to release the tool automatically for Windows/OSX/Linux by flagging a new version on GitHub
  • New vblank code to injects to roms to support 32 bit address
  • Added checksum when a rom is picked
  • More information added in the log
I am studying how to change the background to a new one that for me is the last step to release officially a version. It is not simple because I have to work with binary data inside C++ code with a legacy file that is a binary file converted in C++.
 

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy
Release 1.0.0-alpha for Windows/OSX/Linux

Official first release as alpha version, just because I don't want that all of you wait until I don't understand how to change the default background built-in with the tool (the last requirement for me to release the 1.0.0).
If you find any issues or you have suggestions you can write in this thread or use the GitHub project itself.

You can download the tool from: https://github.com/Mte90/GBAATM-Rebirth/releases/tag/pre-1.0.0-alpha
Official page on GBATemp: https://gbatemp.net/download/gbaatm-rebirth.36493/
 
Last edited by mte90,

mte90

Well-Known Member
OP
Newcomer
Joined
Mar 28, 2020
Messages
98
Trophies
0
Age
33
Website
daniele.tech
XP
389
Country
Italy

chronoss

Well-Known Member
Member
Joined
May 26, 2015
Messages
3,007
Trophies
1
XP
4,893
Country
Congo, Republic of the

chronoss

Well-Known Member
Member
Joined
May 26, 2015
Messages
3,007
Trophies
1
XP
4,893
Country
Congo, Republic of the
Can I get the cheat file @chronoss? I need to replicate it.
Sorry for the delay, you need to remove "GameInfo" line until the end to make the cheat working on your program. I tested codebreaker and gameshark cheat and same thing, i see all link on my rom patched :(

Edit : I tesed this one and it work, i think it's a Gateshark code :(
Infinite HP
8201327A 270F

Infinite MP
8201327C 270F

Infinite MP
8201327C 270F

Max Experience
8201328C E0FF
8201328E 05F5

Max Gold
82013290 423F
82013292 000F
 

Attachments

  • 0612 - Castlevania - Harmony of Dissonance (US).rar
    823 bytes · Views: 284
Last edited by chronoss,

Theone5000

Well-Known Member
Member
Joined
Feb 22, 2009
Messages
167
Trophies
1
Location
Earth
XP
1,403
Country
Netherlands
Looks very promising. What I miss though is a small tutorial on how various functionalities work such as:

  1. What does the button [DEADBEEF] mean and do.
  2. What is the proper way to add cheats in the CheatCodes tab.
  3. Explain what the functions within the [Paramaters] do for example:
  4. - How is the menu text displayed within a game?
  5. - How do I know what RAM to use and what are the differences?
  6. - What is the difference between 1 / 255 cycles and what is the impact?
  7. - What happens when VBLANK Check is checked and not?
  8. - What does the trainer do?
Screenshots of these examples would be visually best for users. In addition a minor UX suggestion:

When input GBA rom display (next to MD5 checksum):
- Region (USA/EU/JP) etc.
- Rom version (V1.0/V1.1) etc.
- Rom ID
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    AncientBoi @ AncientBoi: :rofl2: