Docs: Various updates to online docs

This commit is contained in:
Sour 2018-06-15 21:11:54 -04:00
parent 7c07baceab
commit 71f3105f9d
19 changed files with 127 additions and 31 deletions

View file

@ -42,13 +42,13 @@ Removes a previously registered callback function.
**Syntax**
emu.addMemoryCallback(function, type, startAddress, endAddress)
emu.addMemoryCallback(function, type, startAddress [, endAddress])
**Parameters**
function - A Lua function.
type - *Enum* See [memCallbackType](/apireference/enums.html#memcallbacktype)
startAddress - *Integer* Start of the CPU memory address range to register the callback on.
endAddress - *Integer* End of the CPU memory address range to register the callback on.
endAddress - (optional) *Integer* End of the CPU memory address range to register the callback on.
**Return value**
Returns an integer value that can be used to remove the callback by calling [removeMemoryCallback](#removememorycallback).
@ -75,13 +75,13 @@ emu.addMemoryCallback(writeCallback, emu.memCallbackType.ppuWrite, 0, 0x1FFF)
**Syntax**
emu.removeMemoryCallback(reference, type, startAddress, endAddress)
emu.removeMemoryCallback(reference, type, startAddress [, endAddress])
**Parameters**
reference - The value returned by the call to [addMemoryCallback](#addmemorycallback).
type - *Enum* See [memCallbackType](/apireference/enums.html#memcallbacktype).
startAddress - *Integer* Start of the CPU memory address range to unregister the callback from.
endAddress - *Integer* End of the CPU memory address range to unregister the callback from.
endAddress - (optional) *Integer* End of the CPU memory address range to unregister the callback from.
**Return value**
*None*

View file

@ -5,6 +5,21 @@ pre: ""
chapter: false
---
## Changes between 0.9.5 and 0.9.6 ##
### New Features ###
* New event callbacks: [**<kbd>scriptEnded</kbd>**](/apireference/enums.html#eventtype)
### Changes ###
* The end address parameter for <kbd>[addMemoryCallback](/apireference/callbacks.html#addmemorycallback)</kbd> and <kbd>[removeMemoryCallback](/apireference/callbacks.html#removememorycallback)</kbd> is now optional.
### Bug Fixes ###
* <kbd>[addMemoryCallback](/apireference/callbacks.html#addmemorycallback)</kbd> and <kbd>[removeMemoryCallback](/apireference/callbacks.html#removememorycallback)</kbd> no longer exclude the end address from the range.
## Changes between 0.9.4 and 0.9.5 ##
### New features ###

View file

@ -52,6 +52,8 @@ Several options in this section should NOT be enabled to avoid issues in some ga
**Allow invalid input**: On a NES controller, it is impossible to press both left and right or up and down at the same time on the controller's D-pad. Some games rely on this and pressing both buttons at once can cause glitches. When enabled, this option makes it possible to press opposite directional buttons at the same time.
**Randomize power-on state for mappers**: Cartridges often have a random state at power-on and need to be fully initialized before being used. This option causes Mesen to randomize the power-on state of the most common mappers. This is useful when developing homebrew software.
**Default power on state for RAM**: On a console, the RAM's state at power on is undetermined and relatively random. This option lets you select Mesen's behavior when initializing RAM - set all bits to 0, set all bits to 1, or randomize the value of each bit.

View file

@ -82,6 +82,7 @@ Available shortcuts:
* **Run Single Frame**: Press to run a single frame and pause.
* **Set Scale 1x to 6x**: Sets the scale to the matching value.
* **Toggle Fullscreen Mode**: Enters/exits fullscreen mode.
* **Toggle Debug Information**: Turns on/off the debug screen overlay.
* **Toggle FPS Counter**: Turns on/off the FPS counter.
* **Toggle Game Timer**: Turns on/off the game timer.
* **Toggle Frame Counter**: Turns on/off the frame counter.
@ -136,6 +137,8 @@ Available shortcuts:
**Disable built-in game database**: Mesen contains a built-in database containing information on thousands of rom files -- it uses this database to use the most appropriate settings when loading a game (e.g `NTSC` vs `PAL`) and to fix incorrect file headers. *Disabling this option is not recommended.*
**Disable high resolution timer**: Mesen normally forces Windows' timer resolution down to 1 millisecond when a game is running. Keeping a low timer resolution helps keep the video and audio output as smooth as possible. Enabling this option disables Mesen's default behavior and keeps the timer interval to its regular value, which may slightly improve battery life on a laptop (which is the only reason why this option exists). *Disabling this option is not recommended.*
**Keep rewind data for the last [x] minutes**: The rewind feature in Mesen periodically takes save states and keeps them in memory to allow the emulator to rewind the game. These save states take a minimal amount of memory (roughly 1MB per minute). To limit the amount of memory that Mesen can use for rewind data, this configures the number of minutes that it is possible to rewind for.
### FDS Settings ###

View file

@ -29,8 +29,6 @@ chapter: false
**Show FPS**: Displays an FPS counter on the screen. The first number is the number of frames emulated, the second number is the number of frames displayed on the screen. These values are usually identical, except when vertical sync is enabled.
**Overscan**: The overscan settings allow you to cut out pixels on any edge of the screen. On a CRT TV, a few pixels on each side of the screen was usually invisible to the player. Because of this, games often have glitches or incorrect palette colors on the edges of the screen -- this is normal and caused by the game itself. Setting a value of 8 or so on each side of the overscan configuration will usually hide most glitches.
## Picture ##
<div class="imgBox"><div>
@ -64,6 +62,17 @@ The 2 filters have a different set of options:
Feel free to experiment with the settings and choose what you feel looks best.
## Overscan ##
<div class="imgBox"><div>
<img src="/images/VideoOptions_Overscan.png" />
<span>Overscan Options</span>
</div></div>
The overscan settings allow you to cut out pixels on any edge of the screen. On a CRT TV, a few pixels on each side of the screen was usually invisible to the player. Because of this, games often have glitches or incorrect palette colors on the edges of the screen -- this is normal and caused by the game itself. Setting a value of 8 or so on each side of the overscan configuration will usually hide most glitches.
It is possible to configure the overscan settings on a per-game basis in the *Game-Specific* tab. All games without specific settings will automatically use the overscan parameters shown in the *Global* tab.
## Palette ##
<div class="imgBox"><div>

View file

@ -112,28 +112,28 @@ The used syntax is identical to C/C++ syntax (e.g && for and, || for or, etc.) a
**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)
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**
```
[$10] //Displays the value of memory at address $10 (CPU)
a == 10 || x == $23
scanline == 10 && (cycle >= 55 && cycle <= 100)
x == [$150] || y == [10]
[[$15] + y] //Reads the value at address $15, adds Y to it and reads the value at the resulting address.
{$FFFA} //Returns the NMI handler's address.
[$10] //Displays the value of memory at address $10 (CPU)
a == 10 || x == $23
scanline == 10 && (cycle >= 55 && cycle <= 100)
x == [$150] || y == [10]
[[$15] + y] //Reads the value at address $15, adds Y to it and reads the value at the resulting address.
{$FFFA} //Returns the NMI handler's address.
```
**Using labels**
@ -141,6 +141,14 @@ The used syntax is identical to C/C++ syntax (e.g && for and, || for or, etc.) a
Any label defined in the debugger can be used in watch expressions (their value will match the label's address in CPU memory).
For example, if you have a label called "velocity" that points to 1-byte value at address $30 in the CPU's memory, you can display its value in the watch using the following syntax: `[velocity]`
**Displaying arrays**
The watch window allows you display several consecutive memory values on the same row using a special syntax. e.g:
```
[$30, 16] //This will display the values of addresses $30 to $3F
[MyLabel, 10] //This syntax can also be used with labels
```
## Breakpoints ##
<div class="imgBox"><div>
@ -291,7 +299,17 @@ Additionally, two special tooltip windows can be enabled here:
### Break Options ###
The `Break Options` submenu contains a number of options to configure under which conditions the debugger will break (even when no breakpoint is hit).
The `Break Options` submenu contains a number of options to configure under which conditions the debugger will break (even when no breakpoint is hit):
* **Break on power/reset**: Break the emulation whenever a reset or power cycle occurs.
* **Break on unofficial opcodes**: Break the emulation whenever an unofficial opcode is about to execute.
* **Break on BRK**: Break the emulation whenever a BRK instruction is about to execute.
* **Break on CPU crash**: Break the emulation whenever an instruction that will cause the CPU to freeze is about to execute.
* **Break on uninitialized memory read**: Break whenever the code reads from a memory address containing an uninitialized value. **Note**: *This option only works if the debugger has been opened since the last reset or power cycle.*
* **Break when debugger is opened**: The emulation will break when you first open the debugger.
* **Break on debugger focus**: Whenever the debugger's window gains focus (e.g by clicking on it), the emulation will break.
Additionally, you can configure whether or not the debugger window gets focused when a break or pause occurs.
### Copy Options ###

View file

@ -4,11 +4,22 @@ weight: 13
chapter: false
---
## PPU View ##
<div class="imgBox"><div>
<img src="/images/EventViewer.png" />
<span>Event Viewer</span>
<span>Event Viewer - PPU View</span>
</div></div>
The Event Viewer allows you to visually check the timing at which various events (register read/writes, NMIs, IRQs, etc.) occur. This can be useful when trying to perform timing-critical mid-frame changes to the PPU, or to verify that PPU updates finish before vertical blank ends, etc.
The Event Viewer's PPU view allows you to visually check the timing at which various events (register read/writes, NMIs, IRQs, etc.) occur. This can be useful when trying to perform timing-critical mid-frame changes to the PPU, or to verify that PPU updates finish before vertical blank ends, etc.
The colors can be configured and it's also possible to define [breakpoints](/debugging/debugger.html#breakpoint-configuration) as marks to be shown on the Event Viewer. This is done by enabling a breakpoint's `Mark on Event Viewer` option. This allows the event viewer to be used to display virtually any special event that needs to be tracked.
The colors can be configured and it's also possible to define [breakpoints](/debugging/debugger.html#breakpoint-configuration) as marks to be shown on the Event Viewer. This is done by enabling a breakpoint's `Mark on Event Viewer` option. This allows the event viewer to be used to display virtually any special event that needs to be tracked.
## List View ##
<div class="imgBox"><div>
<img src="/images/EventViewer_ListView.png" />
<span>Event Viewer - List View</span>
</div></div>
The list view displays the same general information as the PPU view, but in a sortable list.

View file

@ -27,6 +27,8 @@ There are also a number of display options:
* **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.
* **Highlight Tile Updates**: Displays a 8x8 red square overlay over tiles that have changed since the last frame.
* **Highlight Attribute Updates**: Displays a 16x16 yellow square overlay over attributes that have changed since the last frame.
* **Highlight tile selected in CHR viewer**: When enabled, click on a tile in the CHR viewer to select it, all occurrences of that tile will then be marked by a <span class="red">red</span> rectangle in the nametable viewer.
<kbd>**Double-click**</kbd> on a tile in the nametable viewer to view/edit it in the CHR Viewer.

View file

@ -20,4 +20,11 @@ To start a script, press **<kbd>F5</kbd>**.
To stop a script, press **<kbd>Escape</kbd>** or close the script window.
The Log Window at the bottom will display any Lua errors that occur while running the script.
Additionally, any calls to `emu.log()` will also display their content in the log window.
Additionally, any calls to `emu.log()` will also display their content in the log window.
### Built-in Scripts ###
A number of built-in scripts are accessible from the script window's UI. They can be accessed from the **<kbd>File&rarr;Built-in Scripts</kbd>** menu, or directly from the toolbar.
These scripts serve as both examples for the Lua API and can also be useful in a number of ways.
The scripts have (mostly) been contributed by users of Mesen (see the top of each script for proper credits) - **if you have useful/interesting scripts that you have written and would like to have included, let me know!**

View file

@ -23,6 +23,35 @@ Additionally, you can alter the way some elements are displayed:
* **Indent code based on stack pointer**: When enabled, the log's lines will be indented by 1 character for every byte pushed to the stack. This is useful to quickly be able to identify function calls, for example.
* **Use Labels**: When enabled, addresses that match known labels will be replaced by their label instead.
### Custom Formatting ###
The trace logger's output can be customized by enabling the **Format Override** option and editing the format string.
The following tags can be used to customize the format:
```text
[ByteCode]: The byte code for the instruction (1 to 3 bytes).
[Disassembly]: The disassembly for the current instruction.
[EffectiveAddress]: The effective address used for indirect addressing modes.
[MemoryValue]: The value stored at the memory location referred to by the instruction.
[PC]: Program Counter
[A]: A register
[X]: X register
[Y]: Y register
[SP]: Stack Pointer
[P]: Processor Flags
[Cycle]: The current PPU cycle.
[Scanline]: The current PPU scanline.
[FrameCount]: The current PPU frame.
[CycleCount]: The current CPU cycle (32-bit signed value, resets to 0 at power on)
```
You can also specify some options by using a comma. e.g:
```text
[Cycle,3] will display the cycle and pad out the output to always be 3 characters wide.
[Scanline,h] will display the scanline in hexadecimal.
[Align,50]: Align is a special tag that is useful when trying to align some content. [Align,50] will make the next tag start on column 50.
```
### Conditional Logging ###
The `Condition` field accepts conditional statements in the same format as [breakpoints](/debugging/debugger.html#breakpoint-configuration).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -1,5 +1,5 @@
<div class="menuFooter">
<div class="donateButton"><a class="bmc-button" target="_blank" href="https://www.mesen.ca/Donate.php"><img src="/images/BMC-btn-logo.svg" alt="Donate"><span style="margin-left:5px">Donate</span></a></div>
Version: <b>{{ .Site.Params.MesenVersion }}</b><br/>
Last Updated: <b>{{ .Now.Format "2006-01-02"}}</b>
Last Updated: <b>{{ now.Format "2006-01-02"}}</b>
</div>