Docs: Updates for debug tools (ppu viewer, etc.)

This commit is contained in:
Sour 2019-01-20 19:44:34 -05:00
parent 295a68f43d
commit 9c326e8248
20 changed files with 92 additions and 50 deletions

View file

@ -24,12 +24,15 @@ toc: false
* [Video Recorder](/tools.html#video-recorder)
* [Log Window](/tools.html#log-window)
4. [Debugging Tools](/debugging.html)
* [Debugger](/debugging/debugger.html)
* [PPU Viewer](/debugging/ppuviewer.html)
* [Memory Tools](/debugging/memorytools.html)
* [Trace Logger](/debugging/tracelogger.html)
* [Assembler](/debugging/assembler.html)
* [Debugger](/debugging/debugger.html)
* [Event Viewer](/debugging/eventviewer.html)
* [Memory Tools](/debugging/memorytools.html)
* [Performance Profiler](/debugging/performanceprofiler.html)
* [PPU Viewer](/debugging/ppuviewer.html)
* [Script Window](/debugging/scriptwindow.html)
* [Text Hooker](/debugging/texthooker.html)
* [Trace Logger](/debugging/tracelogger.html)
* [Integration with CC65/ASM6](/debugging/debuggerintegration.html)
5. [HD Packs](/hdpacks.html)
6. [Lua API reference](/apireference.html)

View file

@ -120,27 +120,41 @@ The watch window allows you to evaluate expression and see their value. Mesen su
### Syntax ###
The used syntax is identical to C/C++ syntax (e.g && for and, || for or, etc.) and should have the same operator precedence as C/C++.
The used syntax is identical to C/C++ syntax (e.g && for and, || for or, etc.) and have the same operator precedence as C/C++.
**Note:** Use the $ prefix to denote hexadecimal values.
**Special values**
```text
A/X/Y/PS/SP: Value of corresponding registers
PC: Program Counter
OpPC: Address of the current instruction's first byte
Irq/Nmi: True if the Irq/Nmi flags are set
Cycle/Scanline: Current cycle (0-340)/scanline(-1 to 260) of the PPU
Frame: PPU frame number (since power on/reset)
Value: Current value being read/written from/to memory
IsRead: True if the CPU is reading from a memory address
IsWrite: True if the CPU is writing to a memory address
Address: Current CPU memory address being read/written
RomAddress: Current ROM address being read/written
[<address>]: (Byte) Memory value at <address> (CPU)
{<address>}: (Word) Memory value at <address> (CPU)
```
**Examples**
#### Special values ####
The following "variables" can be used in both the watch window and contional breakpoints to check the state of specific portions of the emulation core.
**Numeric values**
* **A/X/Y/PS/SP**: Value of corresponding registers
* **PC**: Program Counter
* **OpPC**: Address of the current instruction's first byte
* **PreviousOpPC**: Address of the previous instruction's first byte
* **Cycle/Scanline**: Current cycle (0-340)/scanline(-1 to 260) of the PPU
* **Frame**: PPU frame number (since power on/reset)
* **Value**: Current value being read/written from/to memory
* **Address**: Current CPU memory address being read/written
* **RomAddress**: Current ROM address being read/written
* **[&lt;address&gt;]**: (Byte) Memory value at &lt;address&gt; (CPU)
* **{&lt;address&gt;}**: (Word) Memory value at &lt;address&gt; (CPU)
**Flags**
* **Branched**: true if the current instruction was reached by a branch/jump instruction
* **IsRead**: true if the CPU is reading from a memory address
* **IsWrite**: true if the CPU is writing to a memory address
* **IRQ**: true if the IRQ flag is set
* **NMI**: true if the NMI flag is set
* **Sprite0Hit**: true if the PPU's "Sprite 0 Hit" flag is set
* **SpriteOverflow**: true if the PPU's "Sprite Overflow" flag is set
* **VerticalBlank**: true if the PPU's "Vertical Blank" flag is set
#### Usage Examples ####
```
[$10] //Displays the value of memory at address $10 (CPU)
a == 10 || x == $23

View file

@ -1,6 +1,6 @@
---
title: Integration with compilers
weight: 18
weight: 40
pre: ""
chapter: false
---

View file

@ -120,25 +120,3 @@ Use the `Sort By` option to sort the list based on different criteria.
The `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.
Use 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.
## Profiler ##
<div class="imgBox"><div>
<img src="/images/Profiler.png" />
<span>Code Profiler</span>
</div></div>
The profiler automatically collects data about all function calls done by the code, as well as the number of clock cycles spent in each respective function.
Using the profiler makes it is easy to find the bottlenecks in a game's code, which can help code optimization efforts.
If you are familiar with Visual Studio's profiler, these columns should be familiar:
* **Call Count**: The number of times this function was called during profiling
* **Inclusive Time (Cyc)**: The amount of CPU cycles spent within this function (including the cycles spent by all functions called by this function)
* **Inclusive Time (%)**: The relative portion of CPU time spent within this function (including the time spent by all functions called by this function)
* **Exclusive Time (Cyc)**: The amount of CPU cycles spent within this function (functions called by this function are excluded)
* **Exclusive Time (%)**: The relative portion of CPU time spent within this function (functions called by this function are excluded)
* **Call Count**: The number of times this function was called during profiling
Use the `Reset` button to reset the profiler's data -- use this when you want to profile a specific portion of the execution.

View file

@ -0,0 +1,25 @@
---
title: Performance Profiler
weight: 15
chapter: false
---
<div class="imgBox"><div>
<img src="/images/Profiler.png" />
<span>Performance Profiler</span>
</div></div>
The profiler automatically collects data about all function calls done by the code, as well as the number of clock cycles spent in each respective function.
Using the profiler makes it is easy to find the bottlenecks in a game's code, which can help code optimization efforts.
If you are familiar with Visual Studio's profiler, these columns should be familiar:
* **Call Count**: The number of times this function was called during profiling
* **Inclusive Time (Cyc)**: The amount of CPU cycles spent within this function (including the cycles spent by all functions called by this function)
* **Inclusive Time (%)**: The relative portion of CPU time spent within this function (including the time spent by all functions called by this function)
* **Exclusive Time (Cyc)**: The amount of CPU cycles spent within this function (functions called by this function are excluded)
* **Exclusive Time (%)**: The relative portion of CPU time spent within this function (functions called by this function are excluded)
* **Call Count**: The number of times this function was called during profiling
Use the `Reset` button to reset the profiler's data -- use this when you want to profile a specific portion of the execution.

View file

@ -1,6 +1,6 @@
---
title: PPU Viewer
weight: 15
weight: 20
pre: ""
chapter: false
---
@ -10,6 +10,8 @@ The PPU Viewer is a collection of tools allowing you to view/edit the current st
All tabs share some common settings:
* **Auto-refresh**: Enabled by default, this makes the PPU viewer refresh at a rate of 15 FPS.
* **Auto-refresh speed**: Configures at what speed the PPU viewer will refresh itself (15/30/60 FPS)
* **Show information overlay**: When enabled, a mouse-over overlay is shown in the nametable/CHR/sprite viewers with information on the tile/sprite below the mouse cursor.
* **When emulation is running, show PPU data at scanline [y] and cycle [x]**: When using the auto-refresh option, this allows you to control at which point in a frame (cycle & scanline) the data is refreshed while the emulation is running. This is useful for games that perform CHR bank switching in the middle of a frame, for example.
## Nametable Viewer ##
@ -34,6 +36,7 @@ Additionally, you can <kbd>**right-click**</kbd> on a tile to get more options:
There are also a number of display options:
* **Show PPU Scroll Overlay**: Shows a blue rectangular overlay showing the current scroll position of the screen.
* **Show attribute colors only**: When enabled, the viewer will show the 4 colors available in each tile, rather than the actual contents of the nametables. This can be useful when trying to debug attribute-related coloring issues.
* **Show Tile Grid**: Displays a 8x8 pixels <span class="red">red</span> grid.
* **Show Attribute Grid**: Displays a 16x16 pixels <span class="blue">blue</span> grid.
* **Use Grayscale Palette**: Forces the nametables to be shown in a 4-color grayscale palette.
@ -95,6 +98,8 @@ Like the nametable viewer, <kbd>**double-click**</kbd> on a tile to view/edit it
Additionally, you can <kbd>**right-click**</kbd> on a tile to copy the tile's information to the clipboard (for use with [HD Packs](/hdpacks.html)).
**Display outline around all sprites in preview**: When enabled, all the sprites shown in the preview screen will be highlighted by a white rectangle.
## Palette Viewer/Editor ##
<div class="imgBox"><div>
@ -104,4 +109,20 @@ Additionally, you can <kbd>**right-click**</kbd> on a tile to copy the tile's in
The Palette Viewer displays basic information about the current state of palette RAM.
It shows which colors are configured in each of the 8 available palettes.
You can click on any color to select another color for that slot.
You can click on any color to select another color for that slot.
## Compact View ##
<div class="imgBox"><div>
<img src="/images/SpriteViewerCompact.png" />
<span>Sprite Viewer (Compact View)</span>
</div></div>
<div class="imgBox" style="clear: none;"><div>
<img src="/images/PaletteViewerCompact.png" />
<span>Palette Viewer (Compact View)</span>
</div></div>
All PPU viewer tabs can be toggled to a standalone compact window, this can be done by pressing on the green arrow at the top right of the window. There is also a customizable keyboard shortcut for this (Default: `Ctrl+Q`) and the windows can be opened in compact mode directly using keyboard shortcuts or the `PPU Viewer (Compact)` menu in the `Tools` or `Debug` menus.
The compact viewers save their own position independently from the regular full-sized PPU window.

View file

@ -1,6 +1,6 @@
---
title: Script Window
weight: 16
weight: 25
chapter: false
---

View file

@ -1,6 +1,6 @@
---
title: Text Hooker
weight: 16
weight: 30
chapter: false
---

View file

@ -1,6 +1,6 @@
---
title: Trace Logger
weight: 17
weight: 35
chapter: false
---

View file

@ -12,6 +12,7 @@ The debugging capabilities of Mesen are split across a number of different tools
[Debugger](/debugging/debugger.html): View the code, add breakpoints, labels, watch values, and much more.
[Event Viewer](/debugging/eventviewer.html): Visualize the timing of a variety of events (register read/writes, nmi, irq, etc.).
[Memory Tools](/debugging/memorytools.html): Contains a hex editor and performance profiler.
[Performance Profiler](/debugging/performanceprofiler.html): Profiles the CPU's execution to help find bottlenecks in code.
[PPU Viewer](/debugging/ppuviewer.html): Displays information on the nametables, sprites, CHR banks and palette. Contains a CHR graphic editor and a palette editor.
[Script Window](/debugging/scriptwindow.html): Allows the execution of Lua scripts, which can communicate with the emulation via an API.
[Text Hooker](/debugging/texthooker.html): Converts text shown on the screen into a text string (useful when trying to translate games.)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB