1---
2title: Memory Tools
3weight: 14
4chapter: false
5---
6
7## Memory Viewer ##
8
9<div class="imgBox"><div>
10	<img src="/images/HexEditor.png" />
11	<span>Memory Viewer</span>
12</div></div>
13
14The memory viewer offers read and write access to all types of ROM and RAM:
15
16* CPU Memory
17* PPU Memory
18
19<div></div>
20
21* PRG ROM
22* Work RAM
23* Save RAM
24
25<div></div>
26
27* CHR ROM
28* CHR RAM
29* Nametable RAM
30* Palette RAM
31* Sprite / OAM RAM
32* Secondary OAM RAM
33
34**Note:** Only memory types that are available for the currently loaded ROM will be shown in the dropdown.
35
36<div style="clear:both"></div>
37
38{{% notice tip %}}
39PRG ROM and CHR ROM *are* writable from the memory viewer.  Any change will remain in effect until a power cycle. If you want to save your PRG/CHR ROM modifications to a .nes file, or as an IPS patch, you can use the **<kbd>File&rarr;Save</kbd>** or **<kbd>File&rarr;Save edits as IPS</kbd>** commands in the [debugger window](/debugging/debugger.html).
40{{% /notice %}}
41
42### Highlighting ###
43
44There are a number of highlighting/coloring options in the memory viewer.
45
46<kbd>**View&rarr;Memory Access Highlighting**</kbd> has coloring options for addresses that were recently read, written or executed (colored in <span class="blue">blue</span>, <span class="red">red</span> and <span class="green">green</span>, respectively). A fade-out period can also be configured, after which the byte will revert to its normal black color.
47
48<kbd>**View&rarr;Data Type Highlighting**</kbd> offers options to change the background color of specific bytes based on their type:</span>
49
50* Labeled bytes
51* Breakpoints
52* Code bytes *(PRG ROM only)*
53* Data bytes *(PRG ROM only)*
54* DMC sample bytes *(PRG ROM only)*
55* Drawn bytes *(CHR ROM only)*
56* Read bytes *(CHR ROM only)*
57
58<kbd>**View&rarr;De-emphasize**</kbd> offers options to display bytes matching certain conditions (unused, read, written or executed) in <span class="gray">gray</span>.
59
60The `Ignore writes that do not alter data` option prevents CPU writes from being highlighted when the value being written matches the one already present in memory.
61
62**Note:** It is possible to customize the colors used by the memory viewer in <kbd>**View&rarr;Configure Colors**</kbd>
63
64### Options ###
65
66#### Display Options ###
67
68* **Auto-refresh speed:** Configures the speed at which the memory view refreshes.
69* **Select Font:** Allows you to select which font to use in the memory view.
70* **Use high text density mode:** When enabled, the vertical space between every row is reduced, allowing more bytes to be shown on the screen at once.
71* **Show characters:** When enabled, a character representation of the binary data is shown on the right. This can be combined with TBL files to find/edit in-game dialog in the memory tools.
72* **Show label tooltip on mouseover:** When enabled, bytes for which a label exists will have a tooltip with the label's information.
73
74#### Other Options ####
75
76* **Use per-byte left/right navigation**: When enabled, pressing the left or right arrows more directly to the next byte, instead of the next nibble.
77* **Use per-byte editing mode**: When enabled, it is no longer possible to select individual nibbles and a full byte's value must be written before it takes effect. (Normally, edits are applied immediately once either nibble is modified)
78
79### Editing Memory Values ###
80
81There are 2 ways to edit memory values:
82
83* **Using the hex view**: Click on the byte you want to change in the hex view (on the left), and type hexadecimal values to replace it.
84
85* **Using the text view**: Click on the section you want to change in the text view (on the right), and type ASCII text to replace. This method is rather limited and usually not very useful unless the ROM uses ASCII values for its text.
86
87### Importing / Exporting ###
88
89For most types of memory, it is possible to export its contents to a binary file as well as import it back from a file.  Use the `Import` and `Export` commands to do this.
90
91### Freezing values ###
92
93Using the right-click menu, you can `Freeze` values in CPU Memory. Frozen addresses are shown in <span class="magenta">magenta</span>.
94Frozen addresses will no longer be affected by write operations - effectively making those addresses read-only for the CPU.  It is still possible to manually edit the value of frozen addresses using the memory viewer.
95
96### Using TBL Files ###
97
98<div class="imgBox"><div>
99	<img src="/images/HexEditorTbl.png" />
100	<span>Memory Viewer with a TBL file loaded to display Japanese text</span>
101</div></div>
102
103TBL files are text files that define mappings between sequences of bytes and text characters.  For example, it might define the byte $95 as the character 'A'.
104
105Normally, when no TBL file is loaded, the memory viewer will display each byte's standard ASCII representation on the right-hand side.
106Once a TBL file is loaded, the text representation of the data will be updated to reflect the TBL mappings. This is useful, for example, when translating text.
107
108
109## Memory Access Counters ##
110
111<div class="imgBox"><div>
112	<img src="/images/MemoryAccessCounters.png" />
113	<span>Memory Access Counters</span>
114</div></div>
115
116When active, the debugger keeps track of all CPU and PPU memory reads, writes and executions.  It is possible to view these counters here.
117
118Use the `Sort By` option to sort the list based on different criteria.
119
120The `Reset` button allows you to reset all counters back to 0 -- this is useful when you are trying to gather data for a specific portion of the execution.
121
122Use the `Highlight uninitialized memory reads` option to track down any reads done to RAM memory before the RAM memory has been initialized after a power cycle -- reading from uninitialized memory can produce random behavior, which is usually unwanted.
123