Explainer
How Cheat Codes Work: Game Genie, Action Replay and the Konami Code

Key takeaways
- A cheat either changes a byte of the game's program or writes a value into its memory again and again.
- Most cheats on Yes This Game change one or two bytes: unlimited lives in Contra is a single byte.
- The Game Genie (1990) changed what the console read from the cartridge; Action Replay codes wrote into memory.
- Cheats can break games: writing player 2's lives made extra heroes join, and the Neo Geo stops if memory changes during its start-up test.
A cheat code changes a few bytes of a game while it runs: either a byte of the program itself, so an instruction such as “take away one life” never happens, or a value in the game’s memory, such as the number of lives, written again and again so it never goes down. We added cheats to nine classic games on Yes This Game this month, and most of them change only one or two bytes. Below is how the classic cheat devices worked, the four kinds of cheats we used, and the surprises we met on the way.
Game Genie, Action Replay and the Konami Code
Cheats are almost as old as home consoles. Three names stand out:
- Game Genie. Made by the British studio Codemasters and sold in the United States by Galoob from 1990, it plugged in between the cartridge and the console. Each code tells it an address in the cartridge and the value the console should read there instead of the real one. Versions followed for the Sega Genesis, Super NES, Game Boy and Game Gear. Nintendo took Galoob to court, and the American courts decided in Galoob’s favour in the early 1990s.
- Action Replay. The British company Datel started with cartridges for home computers such as the Commodore 64 and the Amiga, which could freeze a running program, and later sold Pro Action Replay devices for the NES, Mega Drive, SNES and many other systems. Their best known codes write a value into the game’s memory instead of changing the program.
- The Konami Code. Up, up, down, down, left, right, left, right, B, A. Programmer Kazuhisa Hashimoto added it to the NES version of Gradius because the game was too hard to test, and it stayed in by accident. In Contra the same code gives you 30 lives, which made it famous.
The four kinds of cheats we used
Every switch in the cheat panels on Yes This Game is one of four kinds. Which one we use depends on what the game and its emulator allow.
1. Change the program: skip one instruction
This is how a Game Genie works. In Snow Bros for the Mega Drive, the instruction that removes a life is a single line of 68000 machine code at address $003BA4: subtract 1 from the life counter. The cheat replaces its first two bytes with a short jump over it. The game still runs exactly as before, it simply never reaches that subtraction. In Contra the same idea needs only one byte: the instruction decrease lives becomes read lives, which changes nothing.
2. Write a value into memory every frame
This is the Action Replay way. The game keeps its state in a small memory, and the cheat writes a fixed value into one address 60 times a second. In Contra the weapon of player 1 sits at address $00AA, and holding it at $13 means the spread gun (3) with rapid fire ($10), whatever you pick up. In Battle City the strongest tank is the value $60 in the tank’s power level, the same value three stars from the game give you.
3. Let the emulator load a cheat file
Arcade games on our site run on the FBNeo emulator, which does not take codes at all. Instead it reads a small text file with cheats for each game, the same format used by the community cheat collection for FBNeo. We wrote our own short files, so Metal Slug gets unlimited lives, bombs, invincibility and time, each as a simple switch.
4. Patch the game file itself
The Atari 2600 emulator has no cheat support of any kind, so for River Raid we made copies of the 4 KB game with one or two bytes changed. Unlimited fuel turns the instruction decrease fuel into a harmless test of the same value. Switching a cheat simply restarts the game with the other copy.
How many bytes a cheat changes
We counted the bytes that differ between the original game and the cheat for every cheat that changes the program. Most need one or two bytes.

| Game and cheat | Bytes | What changes |
|---|---|---|
| Contra, unlimited lives | 1 | “decrease lives” becomes “read lives” |
| Sonic & Knuckles, unlimited lives | 1 | “subtract 1 from lives” becomes “test lives” |
| River Raid, unlimited fuel | 1 | “decrease fuel” becomes “test fuel” |
| River Raid, unlimited jets | 2 | a crash subtracts 0 jets instead of 1, and the first start still gives 3 jets |
| Snow Bros, invincible | 2 | one branch flipped in each of the two copies of the hit check |
| Snow Bros, unlimited lives | 8 | four places that subtract a life, two for each player |
| Snow Bros, all powers | 27 | the game-start code rewritten to hand out all three potions, and four places that take them away |
The one big number has a reason. Snow Bros has no spare room at the start of a game, so we rewrote three instructions in a shorter form to make space for one more: the one that gives both players the speed, power and range potions.
What can go wrong
A cheat that is one byte off can break a game. These are the problems we found ourselves while testing.
- Extra players out of nowhere. The cheat file for Cadillacs and Dinosaurs first gave lives and energy to all three players. The game took a life counter above zero as a sign that a player had joined, so three heroes started and the game waited for players who were not there. Our cheats now touch player 1 only.
- A machine that tests its own memory. The Neo Geo arcade board checks its memory when it powers on. A cheat that writes during that check stops the machine with a “WORK RAM ERROR” screen. Our Neo Geo cheats now wait about ten seconds before they start.
- The wrong half of a number. The Mega Drive stores numbers in pairs of bytes. A one-byte cheat for Sonic & Knuckles first gave 12,800 rings instead of 50, because it landed on the other byte of the pair.
- The emulator clearing cheats. When it starts, the emulator sets up its own cheat list and removes everything else, sometimes after our cheats were already in place. We now put them back each time it does that.
Cheats the games already had
Some games came with cheats of their own. Contra has the Konami Code. Snow Bros has a hidden invincibility switch in its memory, left in the code by its developers, and our Invincible switch works by turning that same check around. Battle City’s power-ups are a cheat table too: the code that runs when you pick one up told us exactly where the shield, the frozen clock and the tank’s three stars are kept.
How to use the cheats on Yes This Game
- Open one of the classic games, for example Contra or River Raid.
- Press the magic wand button next to the full screen button above the game.
- Switch on what you want. The game waits while the panel is open.
- Close the panel and play. Reloading the page turns everything off again.
The cheats are optional: every game starts exactly as it was released, and you decide if and when to switch something on.
Frequently asked questions
How do cheat codes work?
A cheat code changes a few bytes of a game while it runs. Either it changes an instruction of the program, so for example a life is never taken away, or it writes a fixed value into the game’s memory every frame, such as the number of lives.
What is the difference between Game Genie and Action Replay?
A Game Genie code replaces a value the console reads from the cartridge, so it changes the program. The best known Action Replay codes write a value into the game’s memory again and again. Both reach the same goal in different ways.
What is the Konami Code?
Up, up, down, down, left, right, left, right, B, A. Kazuhisa Hashimoto added it to the NES version of Gradius for testing. In Contra it gives 30 lives instead of 3.
Can cheats break a game?
Yes. A cheat that writes the wrong address or the wrong player can change the game in unexpected ways. In our tests, lives written for players 2 and 3 made those players join, and a cheat active while a Neo Geo checked its memory stopped the machine.
How do I use cheats on Yes This Game?
Open a classic game, press the magic wand button next to the full screen button and switch on the cheats you want. The game waits while the panel is open. Reloading the page turns the cheats off.