Cheats and Patches
Cheats are when you modify variables from the RAM so that the game becomes more enjoyable to play outside what devs intended. Patches are cheats which act like executable code to achieve the same goal and are more prevalent on systems like the GC/Wii/PS3/PSP/3DS.
There are either common cheat codes by manufacturers of unlicensed devices plugged to real consoles to do the RAM manipulation, including the Game Genie, GameShark, Code Breaker, and Action Replay. Some homebrew mods offer cheats and tools to make them, like CWCheats on the PSP. These cheats are also supported by many emulators. Emulators offer the possibility to have another type of cheat codes directly modifying one specific RAM address, and tools to find these wanted RAM addresses and create cheats for them.
Some cheat formats (notable are the DS ones) are so advanced they offer the possibility to hook new programming on the game.
Sometimes cheats are also needed to circumvent anti-piracy protection, bugs or emulator crashes. Cheats alter games only temporarily. If you want permanent alterations, you may want to alter the ROM image itself. See modding articles.
Mednafen supports the usual cheats such as GameShark, Code Breaker, and Action Replay. The cheats menu can be accessed (or quit back to normal gameplay) with ALT+C.
The cheat engine interface is command-based but still easy to use. Each time a menu appears, you have a bunch of options with a number (or key) before each choice. You're supposed to write the number (# just means to choose the number for the line you want) or letter standing for your choice. Occasionally, when asked to input some values or names, a value appears between brackets after the question - if that's what you want to write down, you can simply leave the entry field empty and press Enter.
To add an existing GS/AR/PAR/CB cheat code, use "Gameshark Codes". Else, if you have a memory address and a given value for it, choose "Search Code" then "Add Code", then put in the address (as $XXXXXXXX), the byte range depending on the values your variable can take (1 is 0-255, 2 is 0-65535, etc), and the numeric value proper (in decimal, or hexadecimal if followed by a lower-case h). Various cheat types exist too (S(substitute on read), C(substitute on read with compare) or R(replace value before vblank) -- R being the default recommended option).
Searching for new cheat codes is also possible. The general idea being comparing variables, going back to gameplay so that this variable changes then back to the cheat engine searching for any variables that changed in that particular way. For example:
- Infinite Health / Ammo / Time / Money: you start with 5 hearts, reset search (in the cheat engine, not reset the game you silly!), you get hurt to 4 hearts, search variables that decreased, get healed back to 5 hearts, search variables that increased, and so on. For money, you can start with 0 when you have 0 gold and try earning/spending money. You could try using save states as well when you don't have as much freedom changing the value.
- Infinite Lives: It's game over when the internal variable for "Lives" is 0. So in some cases, when it shows "REST/LEFT=1" in-game and you lose a life then it becomes 0 but you're still allowed to play on your last life, that means the internal counter for lives has actually changed from 2 to 1 and not from 1 to 0, but in other games (where if you die on "LIVESx1" it's game over) it's not the case. In the case of lives, you actually know the exact value: reset search initially, then (if you have 2 lives on a game that allows you to play on "LEFT=0") search for variables with values equal to 3. Lose a life, search for variables equal to 2, and so on.
- Character Modifier / Level Modifier / Having an Item: reset search, play without changing whatever you're searching for (let's say the stage), do lots of searches for new value equals old value. In-game, change it, then do a new value doesn't equal old value. And so on.
- Walk Though Walls / Invincibility / In-game Cheats & Features : you need to find the value that tells the character if he can move or not (he can't really move when walking against a wall) / if he's blinking or being invincible right now after getting hurt. Same methods as before, but there are hints that could be useful here -- both states could be 0/1, or something else... for example, one could assume 0 is not enabled and 1 is enabled.
- Debug Modes: stuff that stays 0 no matter what, extra off-screen inaccessible options in menus, extra dialogue... you name it. Have fun experimenting.
The goal of these searches is to narrow down the list of results to a single or handful of addresses (variables) pertinent directly to whatever we're searching for. The search always starts with "Reset Search", going back in-game (Alt+C) to play and change stuff, then back to the cheat engine to compare the "Original" value with the "Current" value. Then you check the results page which must get smaller and smaller (if it's 0 results, you screwed up and need to reset search to try again). The comparing options offered by Mednafen are as follow, with O being the Original value, and C being the Current value (when you reset a search, they're the same):
- 1) O==V1 && C==V2 : if you know the explicit numerical values for the variable you write it here. The first time, just write the same value in both. Subsequent times, leave O blank and press Enter so that you don't write the old value again, and write the current value under C.
- 2) O==V1 && |O-C|==V2 : same, but instead of writing the current value you write by how much it changed (0 if old value equals new value)
- 3) |O-C|==V2 : you write by how much it changed (0 if old value equals new value)
- 4) O!=C : if old value doesn't equal new value
- 5) Value decreased : if new value smaller than old value
- 6) Value increased : if new value bigger than old value
PCSX-R has a built-in cheat function. To use it, follow these steps:
1. Load the game
2. Press ESC
3. Go to Configuration -> Cheat Code
4. Click Add Code
5. Name the cheat, enter the desired code, and press OK
6. Toggle it on or off by pressing Enable/Disable
7. Repeat steps 3-6 for every desired code
8. Save the cheats by clicking on Save As, and name the file whatever you want
9. Click Close, and get back to the game by going to Emulator -> Run
Tutorials on how to apply patches and cheats can be found here.
Resources for cheats: CodeTwink
Patches for games may be found here.
The CRC code for a PS2 game is found in the PCSX2 console.
DeSmuME has a built-in cheat function. To use it, follow these steps:
1. Download the latest cheat pack from here and extract "cheat.dat" or "usrcheat.dat" in some folder.
2. start the emulator and open Config -> Path settings
3. Enter the path where you extracted "cheat.dat" or "usrcheat.dat", click the correct radio button and press OK
4. Load any game
5. open Tools -> Cheats -> List
6. click "Cheats base"
7. select the codes you want to use
GameHacking.org Offers a great collection of user submitted codes for many systems, complete with a search engine, code downloader and converter.