Find an unused RAM location, if possible. You need a minimum of 10 bytes. Note the address. Find the game's NMI vector, note it. Find code in the game that clears RAM. If possible, see if it can be disabled with a single byte patch.
1) replace Game Genie EPROM
2) clear NES RAM
3) put an NMI routine at the unused RAM location, and have it write your frozen RAM location. Instead of RTI, ends with JMP absolute to the cart's (previously noted) NMI vector.
4) use the Game Genie's first 2 wishes to change the NMI vector, pointing it to your replacement in RAM.
5) use the 3rd wish to patch the game's RAM clearing routine, preserving your code in RAM.
The 10 byte NMI routine, for freezing one RAM location is like:
Code: Select all
pha
lda #$XX
sta $YYYY
pla
jmp real_game_NMI