How To Do Some Downright Mr.Robot Sh*t With NES Game Genie Hacking.
--
A few months back I wrote a kinda snarky beginners guide to Game Genie hacking for Modern Rogue. I’m going to assume you read it, and if you haven’t you should because I’m gonna open this up with the same examples but in more detail as a warm up.
Opened up that article with a relatively simple straightforward Game Genie code, one that provides Unlimited Continues in the NES game Teenage Mutant Ninja Turtles. It replaces the hexadecimal opcode ($C6) for the 6502 Assembly command DEC (Decrement By 1) with the hexadecimal opcode ($A5) for the 6502 Assembly command LDA (Load Accumulator). This is a very common trick used in Game Genie codes for Unlimited Hit Points, Unlimited Money, Unlimited Lives, etc by interrupting the operations that decrease them, as long as they are decreasing by one.
IMPORTANT NOTE! You want to always match the format of the command you are replacing or you’re gonna break stuff in unpleasant ways. If you replace a zero page ASM command (that affects RAM addresses from $00-FF) with an absolute one (that affects RAM addresses from $0000-FFFF) it will actually throw off how the processor reads the following commands. You can replace any of the following commands with ones on the same horizontal line:
LDA — STA — INC — DEC — ASM SYNTAX
$A5 — $85 — $E6 — $C6 — CMD $44
$B5 — $95 — $F6 — $D6 — CMD $44,X
$AD — $8D — $EE — $CE — CMD $4400
$BD — $9D — $FE — $DE — CMD $4400,X
$B9 — $99 — N/A — N/A — CMD $4400,Y
$A1 — $81 — N/A — N/A — CMD ($44,X)
$B1 — $91 — N/A — N/A — CMD ($44),Y
If it’s decreasing by more than one, you want to look for a command along the lines of a SBC (Subtract With Carry, possible opcodes $E9, $E5, $F5, $ED, $FD, $F9, $E1, $F1) and set whatever the following value is to zero. So it subtracts zero. Still pretty simple stuff, but we are getting slightly ahead of ourselves. Lets get a better idea of the sort of thing we are looking for and how to find it.
This is what the bit of code that decreases the number of continues in Teenage Mutant Ninja Turtles looks like, written out in 6502 Assembly: