1. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    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.
    Green Joy-Con D-Pad Shells for Nintendo Switch


    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.
    Green Joy-Con D-Pad Shells for Nintendo Switch
    [/SIZE]

    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, May 9, 2020
    Frexxos, E1ite007, navimor and 6 others like this.
  2. Zense

    Zense GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 20, 2008
    Messages:
    1,600
    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:
     
    alexander1970 likes this.
  3. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    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

    [​IMG]

    About Previous post:

    Thanks @Zense! Seems that there was some BBcode issues that I didn't spot.
     
    cearp, Zense and alexander1970 like this.
  4. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    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
     
    Zense, cearp and alexander1970 like this.
  5. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    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++.
     
  6. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    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, Jun 9, 2020
    Vulpes-Vulpeos and Zense like this.
  7. chronoss

    chronoss GBAtemp Addict
    Member

    Joined:
    May 26, 2015
    Messages:
    2,242
    Country:
    Congo, Republic of the
    Can't open Windows version : libgcc_s_seh-1.dll
     
  8. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    Country:
    Italy
    chronoss, andreiarturo and Zense like this.
  9. Zidapi

    Zidapi GBAtemp Psycho!
    Member

    Joined:
    Dec 1, 2002
    Messages:
    3,087
    Country:
    Great work, this is very useful!
     
  10. chronoss

    chronoss GBAtemp Addict
    Member

    Joined:
    May 26, 2015
    Messages:
    2,242
    Country:
    Congo, Republic of the
    It work not but it show the cheat name and the code of the cheat in the rom menu :(
    1.PNG 2.PNG
     
  11. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    Country:
    Italy
    Seems that cannot parse the cheat that you provided. What kind of cheat format is? As I can see it isn't codebreaker/gameshark.
     
    Zense and chronoss like this.
  12. chronoss

    chronoss GBAtemp Addict
    Member

    Joined:
    May 26, 2015
    Messages:
    2,242
    Country:
    Congo, Republic of the
    I don't know, i use this with the old program and it work well...

    Capture.PNG
     
    Last edited by chronoss, Jun 11, 2020
  13. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    Country:
    Italy
    Can I get the cheat file @chronoss? I need to replicate it.
     
    Last edited by mte90, Jun 12, 2020
    chronoss likes this.
  14. chronoss

    chronoss GBAtemp Addict
    Member

    Joined:
    May 26, 2015
    Messages:
    2,242
    Country:
    Congo, Republic of the
    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
     

    Attached Files:

    Last edited by chronoss, Jun 15, 2020
  15. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    Country:
    Italy
    Thanks I will test with this cheat and give updates about it.
     
    chronoss likes this.
  16. mte90

    OP mte90 Member
    Newcomer

    Joined:
    Mar 28, 2020
    Messages:
    45
    Country:
    Italy
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Trainer, Rebirth, GBAATM