Game Shark and Game Genie are external cartridge adapters that can beplugged in between the Game Boy and the actual game cartridge.
Game Genie (ROM patches)
Game Genie codes consist of nine-digit hex numbers, formatted asABC-DEF-GHI, the meaning of the separate digits is:
AB, new dataFCDE, memory address, XORed by $F000GI, old data, XORed by $BA and rotated left by twoH, Unknown, maybe checksum and/or else
The address should be located in ROM area $0000-7FFF, the adapterpermanently compares address/old data with address/data being read bythe game, and replaces that data by new data if necessary. That method(more or less) prohibits unwanted patching of wrong memory banks.Eventually it is also possible to patch external RAM ? Newer devicesreportedly allow to specify only the first six digits (optionally).Three codes can be used at once.
Check theGame Genie manual for reference.
Game Shark (RAM patches)
Game Shark codes consist of eight hexadecimal digits, with the following meaning:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| SRAM bank | New value | Address | |||||
So, for example, cheat code010238CD switches to SRAM bank $01, and writes $02 at address $CD38.
As far as it is understood, patching is implemented by hooking the originalVBlank interrupt handler, and re-writing RAM values each frame. Thedownside is that this method steals some CPU time, also, it cannot beused to patch program code in ROM. 10-25 codes can be used simultaneously.