Comment by 🐰 NovaSquirrel

Re: "Game Genie Codes"

In: s/gameboy

I made a Game Genie code for Avenging Spirit to make the energy meter go down at a slower rate: FF5-A3C

I already knew how to program Game Boy games and the Mesen debugger is extremely good so this was actually pretty easy; I used the memory search to find the energy meter and then set a breakpoint for it getting written to.

🐰 NovaSquirrel

Feb 11 Β· 3 months ago

3 Later Comments ↓

πŸ›ž MaAkThRsYoOySrHtKaAm [OP] Β· Feb 12 at 05:42:

@drcouzelis That's cool. That's an intersting code to develop. Does it pretty much just patch the bug and make the animation happen when it is intended to?

@NovaSquirrel That's a great code. You were able to find the address that applies the rate and reduce it? I would consider that to be a little more advanced that, say, just keeping the meter full. Having a good debugger makes such a huge difference. I spent way too long poring over hexadecimal in the diff between save states to narrow it down to the offset I was after.

When you are overriding a functional aspect of the game in some way it's more more difficult than finding a known value like number of lives or something. After watching a vid, mesen looks like a very good debugger. The last one I think I used was mednafen. It was good enough to let me teleport Link around in the first LoZ game on nes. Thanks for sharing.

🐰 NovaSquirrel · Feb 12 at 06:03:

If I remember right, setting a breakpoint on the energy amount getting written to led me to some code that ANDed a frame counter with $3F and decreased the meter if the result was zero. So I just changed it to $FF.

It is definitely a lot trickier if you want to dig into behavior that isn't tied to something like a palette entry changing, or a position or other number with an obvious visible effect changing. For PokΓ©mon in particular, I'd probably try to see if one of the commented disassemblies those games have would be any help.

🐝 drcouzelis · Feb 12 at 17:30:

@MaAkThRsYoOySrHtKaAm

It was super strange! So, there is an address in memory for a "random number", and that address is read many times in the code. It's used to randomly show the rhinoceros panting, to have the ostrich look around, and to make DK and Diddy randomly look around while ducking.

There is a randomization routine that will update the number, but it is ONLY executed on the title screen. Which means those animations will play but only if you happen to press Start on a number that would cause the animations to run.

The Game Genie code inserts a call to the randomization procedure every game loop.

Original Post

πŸŒ’ s/gameboy

πŸ›ž MaAkThRsYoOySrHtKaAm:

Game Genie Codes β€” Let this be a place for sharing codes for Game Genie/ Game Shark / Action Replay and save state hacks for Game Boy games. Tell your harrowing tales of code creation! Request a code! Maybe somebody will answer... Sometimes I just have more fun hacking these old games than I do playing them. At the time the following code was made, which is coming up on a decade ago now, it was surprising to see that such a popular game as Pokemon did not seem to have a published Game Genie...

πŸ’¬ 6 comments Β· 2 likes Β· Feb 09 Β· 3 months ago