gamegen, version 4.0
	Welcome to the memetically-named README for gamegen, the Super
Nintendo Game Genie <--> hexadecimal convertor.  But first, let's play
Twenty Questions.  (You'll find out how to use the program in Question
6.  Or look at README.ez.)

	+--------------------------------------------------+
	|Note to all the lawyer-weasels:  the trademark and|
	|copyright  acknowledgements  are  at  the  bottom.|
	+--------------------------------------------------+

			-=GENERAL QUESTIONS=-

(1) What's a Super Nintendo?
	A 16-bit game system which can do sprite panning and rotation.
In the US, it's made by Nintendo of America. (In Canada it's made by
Nintendo of Canada.  Oooh, big surprise there.)  Look elsewhere if you
want more hype, er, information.  Hereafter, I'll call it the SNES,
short for Super Nintendo Entertainment System.

(2) What's a Game Genie?
	A nifty little piece of hardware that fits between the game
cartridge and the console that changes bits in the ROM, depending on
what 'codes' you enter; it might do so on-the-fly, depending on the 
version.  (The SNES version has a switch which controls whether the
codes are active or not.)  Hereafter, I'll call it the GG.

(3) Why would I need such a program as gamegen?
	Because the GG codes are scrambled.  Here's an example:
		ADA3-8D9B	Does funny things to the 12000BC map
				in Chrono Trigger.
	The equivalent hex code is C0:C6C6E1.

(4) Wait, wait, wait.  What's this C0:C6C6E1 thing?
	It's the hexadecimal equivalent of the above code.  The first
two digits are the data, the last six the address you want to put the
data in.  (For you technophiles, this means 1 byte for data and 3 for
addressing; the high bit of the address is always on, so this means
1M of addressable memory.  Or 8 megabits, as the advertising folk
might say.)

(5) Ah.  'kay.  But why would I want to convert it to hex, anyhow?
	There are two ways of coming up with codes for the GG:

	   (a) Alter an existing code,
	or (b) Input a random one, and hope.

	Let's say you use choose the (b) method, and you come up with
the above code, and want to search around the general area of memory.
The reason you'd want to do this is that if you find an interesting
effect, it's likely that the memory locations nearby contain something
interesting, too.
	So, you take ADA3-8D9B, convert it (Using, say, oh, I dunno,
gamegen) to C0:C6C6E1, then add or subtract one from the resultant
hex number, and convert it back to GG:

	C0:C6C6E0	(Resultant code: ADA3-8DFB)
	C0:C6C6E2	(Resultant code: ADA3-8DBB)

	Then you could try the codes to see what happens.
	As well, there are different versions of game cartridges, and
different versions of the SNES, so you may find that a code fails to
work.  The correct address is probably nearby, and converting to
hexadecimal will help you find it more easily.

(6) How *does* gamegen work, anyhow?
	Typing 'gamegen ADA3-8D9B' (without the quotes, of course)
then pressing enter will output (without the lines of hyphens):
-------------
C0:C6C6E1
This program (C) Copyright 1996-1998 David McGrath
                (pat@snowfox.fur.com)
Game Genie is a registered trademark of Lewis Galoob Toys, Inc.
-------------

	'gamegen C0:C6C6E1' will display (perhaps predictably)
-------------
ADA3-8D9B
This program (C) Copyright 1996-1998 David McGrath
                (pat@snowfox.fur.com)
Game Genie is a registered trademark of Lewis Galoob Toys, Inc.
-------------

(7) But I have more than one code I want decoded!
	That's not a question, but I'll answer it anyway.  Just
use something like 'gamegen ADA3-8DFB ADA3-8DBB ADA3-8D9B' -- you can
keep going, as long as your command line can contain all those characters.
(In DOS, you're limited to 127 characters.  C'est la vie.)

			 -=OPTION QUESTIONS=-

(8) I have a GG code like 'ADAE842B'.  What should I do?
	The hyphen's missing.  You might either try putting the dang
thing in, or use the '-g' flag: 'gamegen -g ADAE842B'.  '-x' is the
equivalent flag for codes that you know are in hexadecimal.  The '-g'
flag remains in effect until gamegen comes upon a '-x' flag (or the end
of the line) and vice versa.  If you want to process codes normally,
simply use the '-c' flag to cancel the effects of '-x' and '-g' --
otherwise, they'll be effective until the program ends.

(9) That end banner's nice and all, but how do I suppress it?
	Use the '-s' flag.

(10) And what if I want to see the version number?
	That's the '-v' flag.

(11) And I suppose help is '-h'?
	Ya betcha.

(12) I've found a code that supposedly works, but not for me.  What gives?
	There's more than one release of the GG; some codes work on
some GG units and not on others.  One release fixed a bug that read
whether a certain bit was on or off.  When converting codes, simply
use the '-b' flag before each code you want converted, but be aware
that the flag stays active until the program ends.
	Converting a GG code to its fixed form is a two-step process:
first convert the code to hex with the '-b' flag, then run gamegen 
again with the output code, this time omitting the '-b' flag.
	The GGCCC, the Game Genie Code Creators Club, discovered this
bit (pun intended) of information.  The credit for it goes to them.

(13) But what does this '-o' flag do?  And how about the '-e' flag?
	Turns opcode reading on and off, respectively.  See the file
OPCODES.

(14) But the version I'm running doesn't have the '-o' flag, not to
     mention a few others.  Now what?
	You'll need to recompile, removing the comment lines from the
OPCODE #define in gamegen.h.  See the next question.

(15) I have a file so chock-full of GG codes that it would take ages to
     input each one.  Is there an easier way?
	Definitely.  Use the '-f' flag followed immediately by the name
of the file you want scanned.  gamegen will zip through the file, pick
out all GG (or hex) codes, and convert them.  The program will print the
line on which the code occurs before the converted code itself so you
can judge its meaning from context.
	Also, note that '-o' can be used along with this flag, but the
'-x' and '-g' flags cannot.

(16) I have this binary file that I want disassembled into its component
opcodes.  Are you gonna tell me gamegen can do *that*, too?
	Natch.  Use the '-F' flag, followed by the appropriate filename.
Be aware that the address field (the part after the colon) will wrap around
to zero after it reaches FFFFFF.  Also be aware that to use this flag,
OPCODE must be defined while compiling.

(17) Huh.  Any other flags, while we're at it?
	Sure.  '--' will stop gamegen from scanning the rest of the line,
including any subsequent flags or codes.

		    -=TROUBLESHOOTING QUESTIONS=-

(17) I just looked at the executables.  There's one for DOS and one for
     Linux, but none for my OS.  What should I do?!?
	First off, calm down!  Secondly, you need a C compiler.  Any ANSI
compiler should do; as long as it knows unsigned long ints are 32 bits
long, and knows what strtoul() is, it'll manage.  If you're using Un*x,
simply type 'make', though you'll have to change the CC= line if you don't
use gcc.
	(And if it doesn't compile, e-mail me at the address in question
20 with all the details...)

(18) But I want a version for Windows!  Have one?
	Well, er, no.  It's a command-line program.  However,
mstuart@ionet.net has a similar program for Windows 3.1 and
Windows '95 that's more interactive.  However, although it's
a code alterer, the program (or the 3.1 demo version, at least --
there's no documentation provided) doesn't do anything with the
address area.  It's useful if you want to print out a listing of
all the possible codes for a given address, though.
	You can get a copy of Mr. Stuart's program from the GGCCC home
page, which is presently at http://ggccc.dragonfire.net/GGCCC/ --
you'll find a lot of useful and original Game Genie codes there as
well, especially if you like RPGs.
	 There's a copy of gamegen there, too, in the non-member file
section.

(19) I have a Game Genie for another game console.  Can you help me?
	Well, not yet.  I'm working on decoding how the NES Game Genie
works, and I have methods of doing it for two other game systems, the
Gen*sis and the G*me B*y.
	If you're interested in helping me decode the NES GG, read
ggnes.txt.

(20) I have flames/bug reports/suggestions/comments/commendations/oversexed
     people I want to send.  How do I get in touch with you?
	My e-mail address is pat@snowfox.fur.com.

(21) Will my codes become the property of the author of gamegen if I use the
     program to make them?
	Nope.  They're yours.  Unless you take all or part of my source
code and claim it as your own (i.e. by using it in your own programs
without mentioning in a prominent way that it came from me, or by not
following the GNU license) you can do with the codes, and the program,
what you will.  Read the first comment in gamegen.c for more
information, or read COPYING.  (To summarize:  You can borrow my source
code for your own program, but you have to release the result under the
GNU license, as well.)

Acknowledgements (the 'We're not worthy, we're not worthy' section):

Super Nintendo (C) Copyright 1991, Nintendo of America
NES, SNES, Nintendo, Super Nintendo, and Super Nintendo Entertainment System
	are registered trademarks of Nintendo of America Inc.
Game Genie (C) Copyright 1991, 1992, 1993, Lewis Galoob Toys, Inc.
Game Genie and Galoob are trademarks of Lewis Galoob Toys, Inc.
Chrono Trigger  (C) Copyright 1995 Square Co., Ltd.
		(C) Copyright 1995 Bird Studio / Shueisha
Chrono Trigger is a registered trademark of Square Co., Ltd.
Microsoft Windows (C) 1990, 1991, 1992 Microsoft Corporation.
Microsoft is a registered trademark, and Windows is a trademark
	of Microsoft Corporation.

(DOS isn't trademarked.  Nyah-nyah.)

No endorsement is intended or implied by the above companies.

	Linux is a trademark owned by Linus Torvalds, and it's a
wonderful OS to boot, to boot.  It's Un*x-like, includes source, and
it's FREE.  All praise Linus, the FSF, and everyone else who made Linux
either directly or indirectly.
	(I'd copyright Un*x and remove the asterisk if I was sure who had
the dang copyright this week.)
	The GG codes used in this document are of my own creation unless
otherwise specified.
	The method of translation was snagged from the rec.games.video
FAQ, managed (until recently) by Ken Arromdee. (Hi, Jiro! :)

	Finally, great thanks to the GGCCC -- the Game Genie Code Creators
Club -- for keeping gamegen on their website, and for giving me the idea for
the GG fix.  Keep up the good work, guys!
