Hacker News new | ask | show | jobs
by Lord_Nightmare 3558 days ago
The Game genie gameboy code "encryption", if anyone cares:

each letter is one hex digit.

GG CODE: ghi-jkl-mno

Address = lijk XOR 0xF000

Data = gh

Compare = mo ROTATED right by 2, and the result XOR by 0xBA

Mystery value = n

Codes can be 6 or 9 digits long, 6 digits if the compare value feature is not used.

The game genie can only modify addresses in the 0000-7fff range, meaning it cannot modify on-cart ram banked in the a000-bfff area (the later datel action replay, however, can modify this and other ram areas, using a periodic interrupt and swapping out the interrupt vectors for its own)

Mystery value has a min of 0, never greater than 7? this was apparently, from what I remember from the usenet leak, intended to thwart games which would checksum their roms before starting, but seems to me to have little practical use, and I'm not even sure how it worked if it worked at all, it may have restored the original value if it saw an access to rom 'mystery value' bytes away from the value being changed by the code within a certain number of cycles, or something like that.

The compare value is so that the game genie can selectively patch values in banked rom gameboy games which have multiple rom pages appear at certain addresses due to mapper chips, in which case it will only replace the value at said address if the compare value matches.

LN

1 comments

There is a Game Genie code decoder/encoder here:

http://www.smspower.org/maxim/forumstuff/gamegenie.html

(This was designed for the Sega Game Gear version, but the Game Boy algorithm is the same.)