News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Making GBA cheats into ROM patches  (Read 4309 times)

MathUser2929

  • Hero Member
  • *****
  • Posts: 1604
    • View Profile
Making GBA cheats into ROM patches
« on: June 28, 2016, 04:03:33 am »
I want to learn how to make a couple cheats to permanent game patches for GBA. First I wanna make the Aladdin darkest color option the default option, and I'd also like to skip the non arcade levels in Double Dragon Advance. I might be able to make cheats to do this if I find a VBA with working cheat support. But I'd need advice how to convert those codes to a ROM patch.

FAST6191

  • Hero Member
  • *****
  • Posts: 2809
    • View Profile
Re: Making GBA cheats into ROM patches
« Reply #1 on: June 28, 2016, 05:13:16 am »
Most would just use GBAATM to hardpatch cheats into the ROM.
http://gbatemp.net/threads/gba-auto-trainer-maker-gbaatm.99334/

no$gba has nice cheat support and the debug version is free these days.

Still if you want to do it yourself then two main paths

1) You basically remake a cheat engine approach. Here you would insert a memory write into the vblank routine to write to the location every vblank.

2) You edit the offending instructions.
The method above works by keeping the health value high and hopefully whatever subs from it is not enough to kill you (I always remember invincibility in Goldeneye vs explosions which could still kill you). Here though you would find the instruction that subbed from the health value (or wrote it back to the memory location if it is not held in a register or the stack) and nop it it change it to an add or get it to return whatever you want.

I have a worked example for health in http://www.romhacking.net/forum/index.php?topic=14708.0

On brightness I imagine it is a selection in the options menu, hopefully it is a slider and hopefully it saves it right there and then rather than only when you exit the options menu. That said if it is a three choice selection or something you can still find the flag/option choice in memory, it can just take a bit longer than just using health or ammo or potions when trying to get infinite of them.

I am not sure what level skip would be as a simple cheat and would probably approach it as a more traditional ROM hack anyway -- I imagine there would be a series of pointers for each level, change these pointers instead like you might for a music hack (in music if you want to change what song plays and it has a list of locations for each song then when the game things it is calling song 7 the pointers for song 7 actually are those of 4 like you want). If it does have a level progression in memory or an unlockable classic mode or something then you could do it. If there is a skip level cheat then I guess you could do something like 1) but find a signal that you are in a level you do not want (in the vblank add a thing that says if level value = ?? then call skip cheat, repeat as appropriate for all the non arcade levels).

Also worth having
http://doc.kodewerx.org/hacking_gba.html

MathUser2929

  • Hero Member
  • *****
  • Posts: 1604
    • View Profile
Re: Making GBA cheats into ROM patches
« Reply #2 on: June 28, 2016, 06:29:36 am »
Well, trainer maker would be good for personal purposes. But it's nothing I could submit here.

FAST6191

  • Hero Member
  • *****
  • Posts: 2809
    • View Profile
Re: Making GBA cheats into ROM patches
« Reply #3 on: June 28, 2016, 06:34:37 am »
Why not? They accept pokemon patches that make a right mess of things internally.
It is not ideal and I would not exactly encourage it but a graphical change would probably be acceptable -- infinite health/ammo would probably not be taken but this not that.