diff --git a/Docs/content/_index.md b/Docs/content/_index.md index cebfcac2..eacea9a8 100644 --- a/Docs/content/_index.md +++ b/Docs/content/_index.md @@ -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) \ No newline at end of file diff --git a/Docs/content/debugging/Debugger.md b/Docs/content/debugging/Debugger.md index 4a0577f9..76d88639 100644 --- a/Docs/content/debugging/Debugger.md +++ b/Docs/content/debugging/Debugger.md @@ -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 -[
]: (Byte) Memory value at
(CPU) -{
}: (Word) Memory value at
(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 +* **[<address>]**: (Byte) Memory value at <address> (CPU) +* **{<address>}**: (Word) Memory value at <address> (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 diff --git a/Docs/content/debugging/DebuggerIntegration.md b/Docs/content/debugging/DebuggerIntegration.md index 26977882..a23b3337 100644 --- a/Docs/content/debugging/DebuggerIntegration.md +++ b/Docs/content/debugging/DebuggerIntegration.md @@ -1,6 +1,6 @@ --- title: Integration with compilers -weight: 18 +weight: 40 pre: "" chapter: false --- diff --git a/Docs/content/debugging/MemoryTools.md b/Docs/content/debugging/MemoryTools.md index 06dbbca5..fc464f04 100644 --- a/Docs/content/debugging/MemoryTools.md +++ b/Docs/content/debugging/MemoryTools.md @@ -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 ## - -
- - Code Profiler -
- -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. \ No newline at end of file diff --git a/Docs/content/debugging/PerformanceProfiler.md b/Docs/content/debugging/PerformanceProfiler.md new file mode 100644 index 00000000..af0cbc4f --- /dev/null +++ b/Docs/content/debugging/PerformanceProfiler.md @@ -0,0 +1,25 @@ +--- +title: Performance Profiler +weight: 15 +chapter: false +--- + +
+ + Performance Profiler +
+ +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. \ No newline at end of file diff --git a/Docs/content/debugging/PpuViewer.md b/Docs/content/debugging/PpuViewer.md index 7c79640b..35fdc269 100644 --- a/Docs/content/debugging/PpuViewer.md +++ b/Docs/content/debugging/PpuViewer.md @@ -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 **right-click** 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 red grid. * **Show Attribute Grid**: Displays a 16x16 pixels blue grid. * **Use Grayscale Palette**: Forces the nametables to be shown in a 4-color grayscale palette. @@ -95,6 +98,8 @@ Like the nametable viewer, **double-click** on a tile to view/edit it Additionally, you can **right-click** 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 ##
@@ -104,4 +109,20 @@ Additionally, you can **right-click** 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. \ No newline at end of file +You can click on any color to select another color for that slot. + +## Compact View ## + +
+ + Sprite Viewer (Compact View) +
+ +
+ + Palette Viewer (Compact View) +
+ +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. \ No newline at end of file diff --git a/Docs/content/debugging/ScriptWindow.md b/Docs/content/debugging/ScriptWindow.md index 43fc5437..dfeeff2a 100644 --- a/Docs/content/debugging/ScriptWindow.md +++ b/Docs/content/debugging/ScriptWindow.md @@ -1,6 +1,6 @@ --- title: Script Window -weight: 16 +weight: 25 chapter: false --- diff --git a/Docs/content/debugging/TextHooker.md b/Docs/content/debugging/TextHooker.md index 5a077517..18a1bff7 100644 --- a/Docs/content/debugging/TextHooker.md +++ b/Docs/content/debugging/TextHooker.md @@ -1,6 +1,6 @@ --- title: Text Hooker -weight: 16 +weight: 30 chapter: false --- diff --git a/Docs/content/debugging/TraceLogger.md b/Docs/content/debugging/TraceLogger.md index 0b0a8481..62c0566b 100644 --- a/Docs/content/debugging/TraceLogger.md +++ b/Docs/content/debugging/TraceLogger.md @@ -1,6 +1,6 @@ --- title: Trace Logger -weight: 17 +weight: 35 chapter: false --- diff --git a/Docs/content/debugging/_index.md b/Docs/content/debugging/_index.md index c155f1b7..539a9c5a 100644 --- a/Docs/content/debugging/_index.md +++ b/Docs/content/debugging/_index.md @@ -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.) diff --git a/Docs/static/images/ChrViewer.png b/Docs/static/images/ChrViewer.png index 56997bd1..2c927038 100644 Binary files a/Docs/static/images/ChrViewer.png and b/Docs/static/images/ChrViewer.png differ diff --git a/Docs/static/images/DebuggerWindow.png b/Docs/static/images/DebuggerWindow.png index b9a75962..3c455259 100644 Binary files a/Docs/static/images/DebuggerWindow.png and b/Docs/static/images/DebuggerWindow.png differ diff --git a/Docs/static/images/HexEditor.png b/Docs/static/images/HexEditor.png index 79dc9a68..1d3453b8 100644 Binary files a/Docs/static/images/HexEditor.png and b/Docs/static/images/HexEditor.png differ diff --git a/Docs/static/images/MemoryAccessCounters.png b/Docs/static/images/MemoryAccessCounters.png index ea78cb25..a0b2a896 100644 Binary files a/Docs/static/images/MemoryAccessCounters.png and b/Docs/static/images/MemoryAccessCounters.png differ diff --git a/Docs/static/images/NametableViewer.png b/Docs/static/images/NametableViewer.png index 6c390e16..5b304b3b 100644 Binary files a/Docs/static/images/NametableViewer.png and b/Docs/static/images/NametableViewer.png differ diff --git a/Docs/static/images/PaletteViewer.png b/Docs/static/images/PaletteViewer.png index 475aba2e..2beda1b6 100644 Binary files a/Docs/static/images/PaletteViewer.png and b/Docs/static/images/PaletteViewer.png differ diff --git a/Docs/static/images/PaletteViewerCompact.png b/Docs/static/images/PaletteViewerCompact.png new file mode 100644 index 00000000..d6d7731a Binary files /dev/null and b/Docs/static/images/PaletteViewerCompact.png differ diff --git a/Docs/static/images/Profiler.png b/Docs/static/images/Profiler.png index 7d387acb..82ad6819 100644 Binary files a/Docs/static/images/Profiler.png and b/Docs/static/images/Profiler.png differ diff --git a/Docs/static/images/SpriteViewer.png b/Docs/static/images/SpriteViewer.png index b2c6dda6..fa348578 100644 Binary files a/Docs/static/images/SpriteViewer.png and b/Docs/static/images/SpriteViewer.png differ diff --git a/Docs/static/images/SpriteViewerCompact.png b/Docs/static/images/SpriteViewerCompact.png new file mode 100644 index 00000000..b3eeb963 Binary files /dev/null and b/Docs/static/images/SpriteViewerCompact.png differ