my emulator supports entering Game Genie codes like most others do, but what i really wanted was to be able to use the real Game Genie ROM for authenticity. i wanted to be able to enter codes through the actual Game Genie screen, and then my emulator determine the codes entered in it so it could handle starting the actual game and implementing the cheats when the player hits start.
the info to actually convert Genie codes into addresses and values is all over the place, but i couldn't find out what else i needed to accomplish this anywhere on the web, so i sat down and kinda reverse-engineered it.
in case anybody else wants to do the same thing in their emulator, i typed up a small doc to share what i found. this probably would be great to put in the nesdev wiki as well.
enjoy!
the info to actually convert Genie codes into addresses and values is all over the place, but i couldn't find out what else i needed to accomplish this anywhere on the web, so i sat down and kinda reverse-engineered it.
in case anybody else wants to do the same thing in their emulator, i typed up a small doc to share what i found. this probably would be great to put in the nesdev wiki as well.
enjoy!
Code:
Game Genie technical notes v1.0
Nov. 25, 2011
===============================
This information was determined by Mike Chambers (aka king_crimson, aka king_crim)
(e-mail: miker00lz@gmail.com)
Overview
========
The NES Game Genie works by replacing values at a specified memory address
with a different value. Addresses and values are determined by 6 or 8 character
codes entered by a player. Some codes also specify a comparison value, which
indicates that the value at the given address should only be replaced if the
original value matches the comparison value.
The algorithm to convert Game Genie codes to addresses and values is already
well-documented, so I will not be covering that here. For that information,
a great document is at this URL:
http://tuxnes.sourceforge.net/gamegenie.html
What I wanted to accomplish here was being able to use the real Game Genie ROM
from Galoob in my NES emulator for authenticity, rather than entering the codes
through another method.
To determine the information described below, I manually converted some Game Genie
codes into address and comparison/replacement values. I then added code to my
NES emulator to dump CPU memory writes to addresses above $7FFF to the console.
I then compared the values written to these memory locations with the address/data
values I converted the Game Genie codes to. This gave me all the info I needed.
The Game Genie ROM writes the data to following specific memory addresses once the
code(s) are entered and the player hits start:
Code 1:
$8004 = Replacement byte value
$8003 = Comparison byte value (if $00, don't compare. always replace the value.)
$8002 = Address low-byte value
$8001 = Address high-byte value (bitwise OR this value with $80 for final address.)
Code 2:
$8008 = Replacement byte value
$8007 = Comparison byte value (if $00, don't compare. always replace the value.)
$8006 = Address low-byte value
$8005 = Address high-byte value (bitwise OR this value with $80 for final address.)
Code 3:
$800C = Replacement byte value
$800B = Comparison byte value (if $00, don't compare. always replace the value.)
$800A = Address low-byte value
$8009 = Address high-byte value (bitwise OR this value with $80 for final address.)
If values written to $8001, $8002, $8003, and $8004 are all $FF, there is no code 1.
If values written to $8005, $8006, $8007, and $8008 are all $FF, there is no code 2.
If values written to $8009, $800A, $800B, and $800C are all $FF, there is no code 3.
When player hits START at game genie screen to begin game on cart,
a value of $00 is written to $8000 immediately after the data described above is written.
Nov. 25, 2011
===============================
This information was determined by Mike Chambers (aka king_crimson, aka king_crim)
(e-mail: miker00lz@gmail.com)
Overview
========
The NES Game Genie works by replacing values at a specified memory address
with a different value. Addresses and values are determined by 6 or 8 character
codes entered by a player. Some codes also specify a comparison value, which
indicates that the value at the given address should only be replaced if the
original value matches the comparison value.
The algorithm to convert Game Genie codes to addresses and values is already
well-documented, so I will not be covering that here. For that information,
a great document is at this URL:
http://tuxnes.sourceforge.net/gamegenie.html
What I wanted to accomplish here was being able to use the real Game Genie ROM
from Galoob in my NES emulator for authenticity, rather than entering the codes
through another method.
To determine the information described below, I manually converted some Game Genie
codes into address and comparison/replacement values. I then added code to my
NES emulator to dump CPU memory writes to addresses above $7FFF to the console.
I then compared the values written to these memory locations with the address/data
values I converted the Game Genie codes to. This gave me all the info I needed.
The Game Genie ROM writes the data to following specific memory addresses once the
code(s) are entered and the player hits start:
Code 1:
$8004 = Replacement byte value
$8003 = Comparison byte value (if $00, don't compare. always replace the value.)
$8002 = Address low-byte value
$8001 = Address high-byte value (bitwise OR this value with $80 for final address.)
Code 2:
$8008 = Replacement byte value
$8007 = Comparison byte value (if $00, don't compare. always replace the value.)
$8006 = Address low-byte value
$8005 = Address high-byte value (bitwise OR this value with $80 for final address.)
Code 3:
$800C = Replacement byte value
$800B = Comparison byte value (if $00, don't compare. always replace the value.)
$800A = Address low-byte value
$8009 = Address high-byte value (bitwise OR this value with $80 for final address.)
If values written to $8001, $8002, $8003, and $8004 are all $FF, there is no code 1.
If values written to $8005, $8006, $8007, and $8008 are all $FF, there is no code 2.
If values written to $8009, $800A, $800B, and $800C are all $FF, there is no code 3.
When player hits START at game genie screen to begin game on cart,
a value of $00 is written to $8000 immediately after the data described above is written.