Hex Editor
Hex Editor
The Hex Editor is a very powerful memory viewing/editing tool, it obsoletes the Memory Viewer tool from the FCE Ultra and FCEU Rerecording branches.
It can do a wide range of things. It allows you to view the entire RAM & ROM contents in a resizable dialog window. It makes it easy to edit the game's RAM, PPU memory, and even its currently-loaded ROM data by simply typing in values in the editor. You can also "freeze" parts of RAM (to prevent the game from modifying the data there), search for data (Ctrl+F), and even copy and paste data to/from the clipboard. Furthermore, table files are supported, so you can edit a game's text in real-time and see the result immediately.
Basically, it lets you tinker with any part of a game's RAM or ROM while it is running.
Using the Hex Editor
The Hex Editor lets you edit three major areas:
1. NES MEMORY
This allows you to directly edit all of the NES address space (System Bus - $0000-$FFFF). While you can easily modify RAM, or write directly to registers by typing in data, you cannot modify ROM data ($8000-$FFFF) itself. This is because most mappers have registers which are located in this space; so writing there can trigger mapper operations that may cause the game to crash or glitch if you don't know what you're doing. If you want to edit the ROM itself, right-click on the offset and select "Go here in ROM file"; that will take you directly to where you need to be so you can start editing. You can also freeze RAM by clicking on it with the middle mouse button, or by using the right-click menu. This works by adding it directly to the Cheat List, which you can see from the Cheat Console. Finally, the right-click menu can be used to quickly add a read or write breakpoint to the debugger. When adding a breakpoint to the range of ROM addresses ($8000-$FFFF), the Hex Editor also takes into account the number of the bank in which the byte is located.
2. PPU MEMORY
This allows you to directly view and write to PPU memory (VRAM).
3. OAM MEMORY
This allows you to directly view and write to OAM memory (sprite RAM).
4. THE ROM FILE
This allows you to edit the ROM file in real time, i.e. while the game is running. If you make a mistake, press Ctrl+Z or Edit->Undo to undo your change (then load a save-state if the game crashed).
The Hex Editor also has support for table files (*.tbl) to map bytes to text. Each line consists of four characters of the form "xx=y", where "xx" is the hex value, and "y" is the character that that value represents. I have also added an extension to represent the Return key: xx=ret whereby pressing the Return key will enter that value into the ROM. You can copy/paste data or text by selecting it and using Ctrl+C (to copy) and Ctrl+V (to paste). Plus, there is an Edit->Find feature that you can use to search for data. This feature should be fairly intuitive, so I won't bother to explain it.
When you're done editing, remember to save the ROM file (File->Save) or your changes will be lost when you close the ROM.
Why can't I edit NES memory beyond $8000?
NES memory from $8000-$FFFF is where the game's PRG-ROM code is mapped. Whenever you type in a value in the NES memory editor, it effectively writes that value to that address. Many games use mappers, which are usually accessed by writing to $8000-$FFFF (which is read-only)... and if *you* were to do so, it may trigger a bankswitch, which could easily make the game crash. In any event, doing so will not modify the ROM itself. What you *can* do, though, is edit the PRG-ROM itself by right-clicking on the offset you wish to edit, and selecting "Go here in the ROM file", which should take you to that spot in the ROM instead, where you can change the data at instead.
Highlighting
The Hex Editor highlights certain bytes with different colors to help you distinguish different data.
Usually all bytes are colored black.
Bookmarked RAM addresses are highlighted by green color.
Freezed RAM addresses are highlighted by blue color.
Modified ROM bytes are highlighted by red color.
If you have the Code/Data Logger running, bytes that were logged will be colored:
For PRG ROM segment:
Dark-yellow - the byte is code
Blue - the byte is data
Cyan - the byte is PCM audio data
Green - the byte is both code and data
For CHR ROM segment:
Yellow - the byte was rendered
Light-blue - the byte was read programmatically
Light-green - the byte was both rendered and read programmatically
Highlight Activity
This feature of the Hex Editor can draw your attention to bytes that changed their value since the last frame, or since the last update of Hex Editor window (if "Fade when paused" option is enabled).
If you don't need this feature, you can switch it off in the "Highlighting" submenu.
You can customize this feature by changing "fading period".
IMPORTANT NOTE: this feature does not track the actual changes of RAM. It works by simply comparing current values to previously displayed values of the same addresses. That's why the feature works with RAM/PPU/OAM/ROM as well.
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator