Game Genie NSF patching

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Game Genie NSF patching
by on (#57272)
I have successfully applied game Genie codes to all NSFs that I wanted except for Super Mario Bros and Super Mario Bros. 3. Is there an extra step for these games that needs to be taken?

by on (#57289)
Those games don't have their sound screwed up by the real Game Genie, do they? If you deliberately want to screw up the music, you could, but... why?

by on (#57300)
Yes they do. Codes like PPPPPP don't work on the Super Mario Bros. 1 nsf and for Super Mario Bros. 3 ZKIPEE, SKIPEA, EAGVIT, KLOTOE don't work when patched.

OKEATS does not work when patched into Super Mario Bros. 2 but all other codes I've tried work like they do on hardware.

I've also ran into yet another problem... when a value for the Game Genie code is higher then the nsf permits due to the smaller initial size of the nsf, I have no idea on what to do. Do I subtract the value to the offset of the missing PRG data and if so, I would have to basically rip the nsf to find where the music code is, right?

by on (#57343)
I just checked PPPPPP for SMB 1. The reason it won't work is because that's in the song init routine, and the song init routine is now custom coding in a new location.

SMB 2 OKEATS:
40 AD 09 06 > 40 AD C9 06

SMB 3 ZKIPEE, SKIPEA:
Both of these hack the same byte of the music init routine. NSF hacks the value to be whatever the user chooses it to be. Useless to apply.

SMB 3 EAGVIT:
AE F8 07 > AE F8 80

SMB 3 KLOTOE:
F2 07 A5 6E > F2 07 A5 BC


To apply these, I just decoded the GG code, put read and execute on a range of address-3 to address in the debugger, and found the likely or only bytes being affected. Once I could see the spot in question, I recorded the bytes, and added more searchable bytes before and after the changed spot until searching for it in the file resulted in only 1 matching address.

by on (#57345)
With OKEATS patched into Super Mario Bros. 2, I got that same result the first time around; The nsf should have been locked into sample mode but instead, it's locked into hard drum mode.

The Super Mario Bros. 3 codes worked.
Thanks! :D

by on (#57352)
SMB2 relies on some graphics data, I think. Here's a mod that does the same thing(not having tested it much)

SMB 2 OKEATS Alternate:
40 AD 09 06 > 40 A9 EE EA

by on (#57376)
Cool, thanks, again.