This is a program for the NES (or an NES-emulator) which decodes Game
Genie codes into CPU addresses.  It can be used to change game values
for cheating in emulators, as well as on a real NES.

For those of you who weren't into the Nintendo Entertainment System in the late
'80s and early '90s, the Game Genie was a device that let you cheat in games by
modifying values of a game program plugged into your NES.  With this, you could
get infinite lives, invincibility, mega-jumps, level codes, and other weird
effects.  Unfortunately, the code system was a little complicated, as it didn't
allow you explicitly to modify chosen CPU addresses with explicit values.
Usually, I would just pick words at random and see if they did cool things.

What this program will do is tell you, after you enter in a GG code, what ROM
and CPU address the code modifies, as well as tell you the value of this modi-
fication. So far, unfortunately, you can only decode a GG code, not encode one.

To use GameGenie.NES, just load it into a suitable NES emulator or into a real
NES (for you lucky ones) and start it up.  You will be presented with a screen
(remarkably :-) ) similar to the real GG's input screen.  The top half of the
screen shows you the 16 code letters.  You can scroll the hand cursor between
them with the direction pad.  The bottom half of the screen is where all the
action is :-).  To enter a code, just scroll to the code letter that you want,
and hit the A button.  To delete a code letter, press the B button, and it will
go back to the previous letter space in the CODE window.  To decode a code,
enter the code and press the start button. If you have used a GG in the past,
you'll know that some codes are 6 characters long, while most are 8 long. The
differences between the two will be explained further down.  Just enter a code
that you know for now.  I'll enter "ZELGYU", which is the code to start you on
level 10 in Bomberman.  GG.NES  will show you four values.  The code value is
the easiest to understand.  It tells you what value will be placed in the given
RAM location.  With the code I just entered, the code value will read 0A. This
is hexadecimal (learn it before you do ANY NES hacking!!!) for the number 10.
10 = start on level 10, get it?

GG.NES gives 3 values, the ROM address, the CPU address, and the .NES address.
These numbers represent the location in memory that the code affects.  The CPU
address will be most useful for people using emulators.  In some emulators, you
can change the value of a certain memory location while the game is running.
The ROM address is the address that the game value is stored in the game ROM,
but be warned that with the larger games that use mappers, this ROM address
could be one of several locations depending on which location to which the map-
per is pointing.  But, if you know your stuff, you could potentially use a hex
editor on a game ROM, and modify the location, so that you could have a game
cheat permanently stored in ROM!  Note that the CPU address is the ROM address
with 8000h added to it.  Finally, the .NES address is the address into an NES
ROM in the common .NES format.  Since most .NES games have a 16-byte header at
the beginning, the actual game code begins $10 higher.

If you enter an 8-character GG code into GG.NES, you will be presented with an
extra value, called the compare value.  What this is, is a value that a Game
Genie will search for in the given memory location.  When the value of that
location is the same as the compared value, the GG puts the code value in its
place.  This means that it will maintain a code value in a memory location for
the whole time that you're playing the game, instead of just setting it to the
code value at the beginning of the game.  Say, for example, I put in "AANAOZGE"
into GG.NES.  This is a code for MegaMan 2 (a great game!!) that gives you mega
jumping ability.  What GG.NES gives you is a compared value of 4, and a code
value of 8.  The ROM address is 'A71', which stores the height of your jumps.
So, since your jumping power will always be 8 because of the GG code, you can
now jump twice as high.  The Game Genie maintains this as your jumping height
throughout the entire game.  That's how it works.

This program is a direct port (Hell, I even ported the documentation! ;-) ) of
my program "AmiGenie" for the Amiga.  What AmiGenie does that GameGenie.NES
can't is also encode GG codes!  If you want to check it out, go to AmiNet at
http://wuarchive.wustl.edu/~aminet/dirs/aminet/misc/emu/AmiGenie.lha.  I have
also included the C source code for that, if you want to compile it for the
computer platform of your choice.  (Of course, thanks to Lennart Johannesson,
it now has a great GUI!)  So, yeah, check that out!!

And of course, my webpage at http://mypage.direct.ca/c/ccovell/
It has lots of stuff that you might enjoy exploring.

I hope you enjoy GameGenie.NES.  I put a lot of hard work into it.
I've also included the asm source for you to look at.  You should assemble it
with the cross-assembler DASM for good results.  If you are using an Amiga 
(yay!), just execute the make script.  If not, then assemble the source, and
join the header to the output file at the front, and the CHR file at the end.

I've tried to code this demo by the book, without using any bad tricks
(since I don't really know any tricks anyway).  A _good_ NES emulator,
that is, one that behaves closest to a real NES, should have no problem
running this thing.  Nearly all the emulators on which I've tested all
my demos have had no problems.

Enjoy!

Chris Covell
ccovell@direct.ca
http://mypage.direct.ca/c/ccovell/
Powered by Amiga!
