Why does this game genie code work? (The Legend of Zelda)
Posted: Sat Jul 15, 2017 6:38 pm
Hello, everyone.
I have been playing around with game genie codes trying to create my own using an emulator. I looked up some codes online and found one for Legend of Zelda: AVVLAUSZ - Don't take damage from anything. Inserting this code (using FCE-UX's gg bios functionality) works perfectly. Now I'm trying to work out why.
Putting the code into a decoder brings up the result:
Address: $33e0
Value: $60
Compare: $ad
Fair enough, it's replacing a LDA instruction with an RTS. The trouble is, I'm assuming that the rom address is ($8000+$33e0=$b3e0), but when I go to that address during gameplay (without inputting the gg code) the code there doesn't contain any LDA instruction. Does the game really switch out rom banks just for Link taking damage? or am I missing something?
Something else that's confusing me; sometimes when I stop the game to look at code, the game seems to be executing from the $6000-$7fff range. I was under the impression that this range is SRAM. Does the game copy code here for execution and, if so, why?
I have been playing around with game genie codes trying to create my own using an emulator. I looked up some codes online and found one for Legend of Zelda: AVVLAUSZ - Don't take damage from anything. Inserting this code (using FCE-UX's gg bios functionality) works perfectly. Now I'm trying to work out why.
Putting the code into a decoder brings up the result:
Address: $33e0
Value: $60
Compare: $ad
Fair enough, it's replacing a LDA instruction with an RTS. The trouble is, I'm assuming that the rom address is ($8000+$33e0=$b3e0), but when I go to that address during gameplay (without inputting the gg code) the code there doesn't contain any LDA instruction. Does the game really switch out rom banks just for Link taking damage? or am I missing something?
Something else that's confusing me; sometimes when I stop the game to look at code, the game seems to be executing from the $6000-$7fff range. I was under the impression that this range is SRAM. Does the game copy code here for execution and, if so, why?