Is there a tutorial or program for this?


New Member
Sep 15, 2020
California, United States
United States
I'm in the process of learning how to hardcode "codes" into games, obviously GameGenie is the easiest, since there's a tool that literally does it for ya. But right now I have a whole slew of Gameshark codes for GBC games that I would like to hardcode into the game itself, as opposed to having to re-enter the code every single time.

So I was wondering, is there a tool or tutorial, or something for this?


Editorial Team
Nov 21, 2005
United Kingdom
The thing about the game genie is that classically they were alterations to the ROM so are trivial to hardpatch -- get them decoded and the literal contents are what to patch and where.

Gameshark, codebreaker, goldfinger, most emulator cheats, action replay and all that jazz tend to be RAM based and thus not something that it is absolutely trivial to patch in. for various explanations of such things on different systems.

You have two approaches then for patching something in hardpatch style, and some refinements to both if you wanted to go there. Either can be made to respond to button combos with a bit of effort.

1) You fiddle with the instructions responsible for the RAM address of the cheat.

2) You do like the cheat devices themselves typically do and insert something into a vblank routine or similar to twiddle the numbers.

1) For an example we will go with infinite money then.
Finding money is classic cheat finding ( ) but eventually when you buy something in a shop something will subtract from it.
You find this subtraction and blank it out, or change it for an add if you want to get silly.
Might still have the "not enough to buy this" problem but you can solve that readily enough

If doing this for something like lives there might be multiple things that twiddle the value. Think say deaths in mario -- down a pit, drowning, poison mushroom, enemy, hazard, out of time, crushing, out of life energy... to say nothing of positives. Each of those might fire off its own subtract command.

2) If the console is a 60Hz one then 60 times a second (once a frame) there will be a routine run called a vblank (vertical blank) to allow it to update things on screen. Should you find this routine and slide in a little set memory value to whatever then you have your cheat.

Trouble usually comes in doing longer cheats and more generally timing issues/race conditions, that in addition to the usual problems with "must fail" type sections that cheats aim to prevent.
My usual example is Goldeneye on the N64 for anybody that played such things with a gameshark. Here if you got hit with a big enough explosion (everything was explosions, rockets, bullets landing*, items blowing up...) you would still die as it got the value down to zero and the game checked before it managed to get set back to full health at some point over the next 60th of a second. This usually means people go in for 1) or refine it further -- if you are lucky then the check happens at some other point during the vblank and you can set it full before the check)

*get the game to slow down and fire into a wall or something.

Guides. One for the DS but the principle is the same for any system really
This is to say make your cheat, get a debugger and set a break on read or break on write to the location of the cheat, alter game accordingly, or find vblank routine (or equivalent) and go from there.
Conditionals can be a bit harder but only in as much as you either need a bit more space or have to know the compare instructions. Said conditionals are also what you will read to see if a button press/combo happened and turn the thing on or off, or do it.

Tools wise there are hardpatch tools for RAM cheats for the GBA (see GBAATM and gabsharky) and DS (see DSATM), I did see an early stages version for the N64 a while back, and presumably anything newer can also have it done. Older stuff tends to be a more manual affair as they tend to have more complicated setups that automated tools struggle with, and less space to do it in once you get there.
General chit-chat
Help Users
  • No one is chatting at the moment.
    AkiraKurusu @ AkiraKurusu: Though the bed in the Guest Bedroom is so large there's ironically not much space leftover...