Game Genie

From NESdev Wiki
Revision as of 22:58, 28 February 2014 by Natt (talk | contribs) (Created page with "== Overview == The Game Genie was a enhancement cart for the NES designed by Camerica and distributed by Galoob and Camerica. It functions as a pass-thru, with a 72 pin cart...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Overview

The Game Genie was a enhancement cart for the NES designed by Camerica and distributed by Galoob and Camerica. It functions as a pass-thru, with a 72 pin cartridge connector connecting it to the NES, and a 72 pin cartridge slot for a game to be inserted into. When plugged in between a game and the NES and turned on, it provides a simple interface to enter up to three cheat codes, which then modify the behavior of the game.

Technical

The Game Genie works by intercepting CPU reads and replacing the game cart's response with it's own response. It can intercept any three addresses in CPU $8000:$FFFF and respond with a single replacement for each. To make the tool more compatible with bank-switching, each of the three codes has an option compare value which can be used to only replace the byte if the original byte matches the compare, hopefully limiting the cheat to functioning on the desired bank.

When first booted, the Game Genie presents its own 4KiB PRG ROM and a series of simple gates masquerading as a CHR ROM. The included PRG ROM runs code to show a simple code entry user interface. When the user presses Start, the cheat values are written to memory mapped registers, and then another register is written which switches the Game Genie into game mode, where the attached game cart's CHR and PRG is passed through, save whatever code replacements were defined. The Game Genie remains in game mode until power cycled, and will respond to no further writes.

Registers

Master Control ($8000)

7  bit  0
---- ----
.DDD CCCE
 ||| ||||
 ||| |||+- Master enable: write 1 then 0 to switch into game mode.
 ||| +++-- Compare enable for each of the three codes
 +++------ Disable each of the three codes

Address High ($8001, $8005, $8009)

7  bit  0
---- ----
.AAA AAAA
 ||| ||||
 +++-++++- Bits 8:14 of address for this cheat (Bit 15 fixed to 1)

Address Low ($8002, $8006, $800a)

7  bit  0
---- ----
AAAA AAAA
|||| ||||
++++-++++- Bits 0:7 of address for this cheat

Compare ($8003, $8007, $800b)

7  bit  0
---- ----
CCCC CCCC
|||| ||||
++++-++++- Compare value for this cheat (write 0 if unused?)

Replace ($8004, $8008, $800c)

7  bit  0
---- ----
RRRR RRRR
|||| ||||
++++-++++- Replacement value for this cheat

Unknown ($FFF0, $FFF1)

The Game Genie rom writes 0 to $FFF0, $FFF1, $FFF0 in that sequence.