Using Cheats in DeSmuMe
This manual explains the 'raw' or 'internal' cheat system in desmume. The 'raw' or 'internal' cheats include cheat-finding facilities where you may manually search for and alter the memory positions which work to your advantage. This article will provide a rundown of the cheat searching menu and functions, followed by a pair of examples. Please note that, in post-0.9.2 versions, there is also the support for Action Replay cheat codes. The cheat system described here is referred to as 'raw' or 'internal' cheats.
The Cheat Menu
The cheat searching menu can be found in the toolbar under : Emulation | Cheats | Search. The initial cheat window has the following options:
Select the memory addresses' size for the value you are searching for. Choose the smallest range applicable to the value you're trying to change. If you're trying to change an energy value which maxes out at 100, choose 1 byte (which has a range of 0 to 255). If you're trying to change HP and it maxes out in the game at 9999, choose 2 bytes (which has a range of 0 to 65536), etc. It usually is inadvisable to use larger memory sizes than required, as it may have undesirable effects on your game.
Select whether the memory address should be signed or unsigned. A signed memory refers to a memory that can include both positive or negative numbers. So if the value you're searching for can be less than zero, it is likely to be a signed memory type. Do note that when choosing a memory as signed, the range is halved in both directions. 1 byte, rather than covering a range of 0 to 255, will cover a range of -128 to +127 (not -255 to +255). This option does not work in 0.9.2
Select Search Type
Select the type of search you would like to perform. In some cases, the exact value you're searching for is unknown - such as hidden, or non-numerical values. Exact searches allow you to enter a known value (say, 100 for energy), and then continue with known values. A comparative search allows you to search for an unknown value by comparison - You run an initial search, and in following searches you narrow the possible values down by choosing whether the value increased, decreased, changed in any direction, or remained the same.
Examples Of Usage
The following provide theoretical examples for using the cheat searching system in both exact and comparative search modes.
Example 1: Modifying A Known Value
Let's assume you are playing a game in which your character currently has 100 health points. What we'll try to do is freeze his health at that value.
1. First thing you'll need to do is figure out the size of the memory address you're attempting to modify. Your character in the game has 100 health points, and that is the highest value it can reach throughout the game. You'll choose "1 byte", unsigned, exact search. "1 byte" because you need to use the smallest possible memory size which fits the value you're changing, unsigned because the hero's health points can not be less than zero, and exact search because his health points can be clearly seen.
2. Click "search", and enter the health points value in the next window. In this case, it's 100. Click "search again".
3. Close the cheat searching window and keep playing until you get hurt. The character's health points are now no longer at 100. Let's assume they are now at 90.
4. Go back into the search menu, and this time run a search for 90. What actually happened is that in the above search the emulator found all of the addresses that at the time of the search were equal to 100 and saved them. This second search is called a filter search - it goes through the previous found addresses and finds the ones that changed to 90. This essentially weeds out addresses that matched the initial search by coincidence in order to find the desired address.
5. After the second search, the number of results shown should be considerably lower. At this time there are three options: either there is only one result left, there are more than one, or there are none. If there are more than you you'll need to continue getting hurt in the game in order for the health point value to change, and running more filter searches until there is one result left. until I get the results down to 1. If it's 1 we're ready to set the value to what we want. If there are no results remaining, either the initial search parameters (size, sign) were wrong, or one of the searches was run with a wrong value. If there's one result left, continue to the next step.
6. Click "view", and a window with the address and the value will appear. Click the line that holds the current health points value, and click "Add".
7. Change the value in the new window to 100, add a description if you want, and choose whether you want the value to be frozen or not. If it's frozen, the value will remain at 100. If not, it will simply be set once to the value you chose, but will not be frozen and will be free to change later. Click "Add", and the value should now be frozen at 100.
Example 2: Modifying an Unknown Value Via Comparative Searches
Let's assume you're playing a game in which after your character is hit, he flashes for three seconds during which he is invulnerable (like in megaman games). What happens behind the scenes of the game is that when you get hit, some address is set to some value (usually 1, but not always) that tells the game that right now, your character is invulnerable. What we want to do is make that value always be in the "invulnerable" state.
1) First thing you do is get hit in the game, to have the invulnerability flashing on.
2) Begin a search. Choosing a memory size for unknown values is trickier because they're, well, unknown. However, in situations such as these (on/off functions, or boolean functions as they are called), memories are usually saved as booleans (1 or 0), or as flags (1,2,4,8,16...). Both of those are 1 byte memory addresses, so you'll first attempt the comparative search with a 1 byte size and if it fails - you'll try with increasing sizes.
2) After clicking "search", you won't be asked to enter a value of course. Don't be alarmed by seeing that there are 0 results. What actually happened is that the emulator just saved all of the addresses of our specified memory size. At this time you'll return to the game and wait for the invulnerability to wear off. When it does, go back to the search menu where you'll be presented with a couple of options. As you don't know how the game saves the invulnerability state, you can't actually know if the value is now higher or lower, so the first two options are irrelevant for this search. What you do know is that the value has changed. Choose "new value is != old value" -- ! in programming means not, so != means "not equal". Click search, and go back to the game.
3) In these kinds of searches youu'll usually need to do quite a couple of filtering searches. Do note that you can also use the "new value is = old value" searches. For example, when you're not invulnerable you run the first search, then seconds later when you're still not invulnerable, you run the "new value is = old value" search. This will usually have very little effect on the amount of values remaining, though.
4) After finally weeding the amount of values down to 1, You'll need to get hit again so the value will be set at the invulnerable state. Go to the search menu, hit "view", click the remaining value, click add, and do not change the value (the current value is the state for invulnerability), make sure "frozen" is checked, and click add. Your character is now invulnerable for as long as the cheat is on.
Still a work in progress, the cheat engine has a couple of quirks.
Mini Ninja (US Version) (Game Code YNJP)
- Shuriken Ammo = 0969D3