<pclass="rvps2"><spanclass="rvts6">FCE Ultra allows cheating by the periodic "patching" of arbitrary addresses in the 6502's memory space with arbitrary values, as well as read substitution. "Read substitution" is the method that would be used on a real NES/Famicom, such as done by the Game Genie and Pro Action Replay. It is required to support GG and PAR codes, but since it is relatively slow when done in emulation, it is not the preferred method when a RAM patch will suffice. Also, in FCE Ultra, read substitution will not work properly with zero-page addressing modes(instructions that operate on RAM at $0000 through $00FF).</span></p>
<pclass="rvps2"><spanclass="rvts6">The RAM patches are all applied a short time before the emulated vertical blanking period. This detail shouldn't concern most people, though. However, this does mean that cheating with games that use bank-switched RAM may be problematic. Fortunately, such games are not very common (in relation to the total number of NES and Famicom games).</span></p>
<pclass="rvps2"><spanclass="rvts6">The cheat search comes with its own set of tools for finding addresses in memory to use for making cheats (or for monitoring the addresses in the </span><aclass="rvts69"href="MemoryWatch.html">memory watch window</a><spanclass="rvts6">)</span></p>
<pclass="rvps2"><spanclass="rvts6">By default cheat files (.cht) are stored in the "cheats" subdirectory under the base FCEUX. The files are in a simple plain-text format. Each line represents a one-byte memory patch. The format is as follows(text in brackets [] represents optional parameters):</span></p>
<pclass="rvps2"><spanclass="rvts6">A colon(:) near the beginning of the line is used to disable the cheat. "S" denotes a cheat that is a read-substitute-style cheat(such as with Game Genie cheats), and a "C" denotes that the cheat has a compare value.</span></p>
<pclass="rvps2"><spanclass="rvts6">The default .cht file folder can be changed with the </span><aclass="rvts69"href="Directories.html">Directory Override menu</a><spanclass="rvts6">.</span></p>
<pclass="rvps2"><spanclass="rvts6">The cheat search interface consists of several components: a list of addresses and associated data for a search, several command buttons, and the search parameters.</span></p>
<pclass="rvps2"><spanclass="rvts6">All addresses listed in the cheat search windows are in unsigned 16-bit hexadecimal format and all values in these windows are in an unsigned 8-bit decimal format(the range for values is 0 through 255).</span></p>
<pclass="rvps2"><spanclass="rvts6">The Active cheats window on the left contains the list of cheats for the currently loaded game. Existing cheats can be selected, edited, and updated using the "Update" button.</span></p>
<pclass="rvps2"><spanclass="rvts6">Each entry in the list can be named. If you didn't provide a name, it will be automatically named using this format:</span></p>
<pclass="rvps2"><spanclass="rvts6">For simple "Substitute" type of cheats: * Address:Value</span></p>
<pclass="rvps2"><spanclass="rvts6">For "Compare" type of cheats: * Address?Compare:Value</span></p>
<pclass="rvps2"><spanclass="rvts6">The "Address" is the location in the 6502's address space. The checkbox denotes that the current cheat is active or not (click on it will toggle on/off). "Value" is the value (in hex) that is written to the addresses on each update. "Compare" it the value that must be at the address, or else the Value won't be written there. This allows making cheats more safe.</span></p>
<pclass="rvps2"><spanclass="rvts6">You can use "Import..." button to load cheats from an existing file (in case the file name does not match the ROM name, so it didn't load automatically). Alternatively, you can drag and drop any .cht file into the FCEUX window.</span></p>
<pclass="rvps2"><spanclass="rvts6">You can also use "Export..." button to save cheats to another file.</span></p>
<pclass="rvps2"><spanclass="rvts6">There is also a right-click menu with the options Toggle selected Cheats, Poke Cheat Value, Goto in Hex Editor and Delete selected Cheats.</span></p>
<pclass="rvps2"><spanclass="rvts6">Toggle Cheats is like check the checkmark on the left side of the cheat, it enables or disables the cheat code. You can select many cheats in the list and toggle them all at once.</span></p>
<pclass="rvps2"><spanclass="rvts6">Poke Cheat Value is like turning the cheat on, but in this case there's no off switch. If the code is on when you use this, then when the code is turned off, it will revert to the value last used. Good for one time life refills, if you want that sort of thing.</span></p>
<pclass="rvps2"><spanclass="rvts6">Goto in Hex Editor opens the Hex Editor window, and puts the cursor on the address shown. It's somewhat similar to how Bookmarks work in the Hex Editor.</span></p>
<pclass="rvps2"><spanclass="rvts6">The possibilities window is in the format of Address:Original Value:Current Value</span></p>
<pclass="rvps2"><spanclass="rvts6">The address is the location in the 6502's address space, the original value is the value that was stored at this address when the search was reset, and the current value is the value that is currently stored at that address. Selecting an item in this list will automatically cause the "Address" field in the cheat information box on the right side of the window to be updated with the selected address.</span></p>
<pclass="rvps2"><spanclass="rvts6">The "Reset" button resets the search process; all valid addresses are displayed in the possibilities window and the data values at those addresses noted in both the left and right columns. The number of possibilities is displayed at the top. Resetting will set it to 2048 or 10240 depending on if the game uses "On cartridge ram" ($6000-$7FFF). (See </span><aclass="rvts69"href="NESRAMMappingFindingValues.html">NES RAM</a><spanclass="rvts6">)</span></p>
<pclass="rvps2"><spanclass="rvts6">The "Known Value", "Equal", "Not Equal", Greater than" and Less than" buttons perform a search based on the search parameter and removes any non-matching addresses from the address list. It then sets the "previous value" column to the contents of the "current value"</span></p>
<pclass="rvps2"><spanclass="rvts6">"Known Value" will search for all addresses that match the value in the box to the right (the value is in hex).</span></p>
<pclass="rvps2"><spanclass="rvts6">"Equal" will search for all addresses that have the same value now as the last search (or since reset was pressed, if there has not yet been a search).</span></p>
<pclass="rvps2"><spanclass="rvts6">"Not equal" will search for all addresses that have changed sine the last search (or since reset was pressed, if there has not yet been a search).</span></p>
<pclass="rvps2"><spanclass="rvts6">If the checkbox next to it is checked it will looks for values that have changed by the value in the number box to the right. For instance, if it is checked and the number is 5, it will search for all values that are +- 5 from the previous value.</span></p>
<pclass="rvps2"><spanclass="rvts6">"Greater than" functions like "Not equal" except it only searches for values that have increased since the last search.</span></p>
<pclass="rvps2"><spanclass="rvts6">"Less than" functions like "Not equal" except it only searches for values that have decreased since the last search.</span></p>
<pclass="rvps2"><spanclass="rvts6">Any value in the possibilities list can be sent to memory watch by double clicking it. </span></p>
<pclass="rvps2"><spanclass="rvts6">Highlighting it and hitting the "Add" button under the Active cheats window will automatically activate it as a cheat with the value set to its current value.</span></p>
<pclass="rvps2"><spanclass="rvts6">When you activate a cheat, the item in </span><aclass="rvts70"href="RAMSearch.html">RAM Search</a><spanclass="rvts6"> and </span><aclass="rvts70"href="RAMWatch.html">RAM Watch</a><spanclass="rvts6"> which corresponding to that address will be marked with a significant color.</span></p>
<pclass="rvps2"><spanclass="rvts6">Let's say I am playing Mega man 3 and I want to find Mega man's energy level in the game's ram. I will start by opening the ROM and selecting a level. At this point, I know Mega man's energy address is active. So I will pause the game and open the cheat search and hit the reset button. The game uses SRAM so the possibilities window will say 10240 "possibilities". </span></p>
<pclass="rvps2"><spanclass="rvts6">Next I will frame advance (or briefly unpause) the game. At this point I know Mega man's energy level is still the same as it was. So I click the "equal" button. Next I want to take damage. I know for sure now that the energy level has decreased so after the "ouch" animation, I click the "Less than button". This will cut the possibilities down significantly. Next I will advance some more and click the "Equal" button since I know the value is still the previous value. I will repeat this cycle until I am down to 1 or just a few values. From there I can double click the values to send them to memory watch to monitor them more closely to weed them out. (Note: Mega man's energy is located in $00A2).</span></p>
<pclass="rvps2"><spanclass="rvts50">Poke cheat value</span><spanclass="rvts6"> - has a different affect that normal freezing, this makes a one time write of that value as opposed to freezing it temporarily to that value and having it restored later. It has the same affect as typing in values in the </span><aclass="rvts69"href="HexEditor.html">Hex Editor</a><spanclass="rvts6">.</span></p>
<pclass="rvps2"><spanclass="rvts50">Goto In Hex Editor</span><spanclass="rvts6"> - Opens the </span><aclass="rvts69"href="HexEditor.html">Hex editor</a><spanclass="rvts6"> dialog to the position of the selected RAM value.</span></p>
<pclass="rvps2"><spanclass="rvts6">Right-clicking in the search result list, you can add the address to memory watch, add cheat or goto in </span><aclass="rvts69"href="HexEditor.html">Hex Editor</a><spanclass="rvts6">.</span><spanclass="rvts6"></span></p>
<pclass="rvps4"style="clear: both;"><spanclass="rvts18">Created with the Personal Edition of HelpNDoc: </span><aclass="rvts19"href="https://www.helpndoc.com">Full-featured Documentation generator</a></p>