Docs: First version of documentation

This commit is contained in:
Sour 2020-06-28 23:14:30 -04:00
parent 3ac5aeaf4a
commit bfaff15dda
209 changed files with 15374 additions and 22 deletions

1
.gitignore vendored
View File

@ -184,5 +184,4 @@ packages/*
!Libretro/hakchi/bin
Docs/*
TestHelper/*

View File

@ -551,8 +551,8 @@ int32_t ExpressionEvaluator::Evaluate(ExpressionData &data, DebugState &state, E
case EvalValues::SFR: token = (state.Gsu.SFR.GetFlagsHigh() << 8) | state.Gsu.SFR.GetFlagsLow(); break;
case EvalValues::PBR: token = state.Gsu.ProgramBank; break;
case EvalValues::RomBR: token = state.Gsu.ProgramBank; break;
case EvalValues::RamBR: token = state.Gsu.ProgramBank; break;
case EvalValues::RomBR: token = state.Gsu.RomBank; break;
case EvalValues::RamBR: token = state.Gsu.RamBank; break;
}
break;

View File

@ -81,7 +81,6 @@ int LuaApi::GetLibrary(lua_State *lua)
{ "log", LuaApi::Log },
{ "displayMessage", LuaApi::DisplayMessage },
{ "reset", LuaApi::Reset },
{ "stop", LuaApi::Stop },
{ "breakExecution", LuaApi::Break },
{ "resume", LuaApi::Resume },
{ "execute", LuaApi::Execute },
@ -550,16 +549,6 @@ int LuaApi::Reset(lua_State *lua)
return l.ReturnCount();
}
int LuaApi::Stop(lua_State *lua)
{
LuaCallHelper l(lua);
int32_t stopCode = l.ReadInteger(0);
checkminparams(0);
checkinitdone();
_console->Stop(stopCode);
return l.ReturnCount();
}
int LuaApi::Break(lua_State *lua)
{
LuaCallHelper l(lua);

5
Docs/README.md Normal file
View File

@ -0,0 +1,5 @@
This is the source code/resources used to build the documentation website located at [https://www.mesen.ca/snes/docs/](https://www.mesen.ca/snes/docs/)
It requires hugo to build. You can download hugo here: [https://gohugo.io/](https://gohugo.io/).
Use the "build.cmd" batch file to build a copy of the documentation - it will be saved to the "docs" subfolder.

4
Docs/build.cmd Normal file
View File

@ -0,0 +1,4 @@
hugo
del docs\js\searchjson.js
echo var searchjson = >>docs\js\searchjson.js
type docs\index.json>>docs\js\searchjson.js

26
Docs/config.toml Normal file
View File

@ -0,0 +1,26 @@
baseURL = ""
relativeURLS = true
uglyURLs = true
languageCode = "en-us"
title = "Mesen-S Documentation"
theme = "learn"
publishDir = "docs"
[outputs]
home = [ "HTML", "RSS", "JSON"]
[params]
themeVariant = "green"
mesenVersion = "0.4.0"
[[menu.shortcuts]]
name = "<img style='vertical-align: middle' src='/images/favicon.png'/> <span style='display: inline;vertical-align: middle'>Website</span>"
identifier = "website"
url = "https://www.mesen.ca"
weight = 9
[[menu.shortcuts]]
name = "<i class='fa fa-github'></i> GitHub"
identifier = "github"
url = "https://github.com/SourMesen/Mesen-S"
weight = 10

41
Docs/content/_index.md Normal file
View File

@ -0,0 +1,41 @@
---
title: Home
weight: 1
chapter: false
toc: false
---
<h1>Mesen-S - SNES Emulator</h1>
### Table of contents ###
1. [Getting Started](/gettingstarted.html)
2. [Configuration](/configuration.html)
* [Audio Options](/configuration/audio.html)
* [Input Options](/configuration/input.html)
* [Video Options](/configuration/video.html)
* [Emulation Options](/configuration/emulation.html)
* [Game Boy Options](/configuration/gameboy.html)
* [Preferences](/configuration/preferences.html)
3. [Tools](/tools.html)
* [Netplay](/tools.html#netplay)
* [Movies](/tools.html#movies)
* [Cheats](/tools.html#cheats)
* [Sound Recorder](/tools.html#sound-recorder)
* [Video Recorder](/tools.html#video-recorder)
* [Log Window](/tools.html#log-window)
4. [Debugging Tools](/debugging.html)
* [Assembler](/debugging/assembler.html)
* [Debugger](/debugging/debugger.html)
* [Event Viewer](/debugging/eventviewer.html)
* [Memory Tools](/debugging/memorytools.html)
* [Performance Profiler](/debugging/performanceprofiler.html)
* [Script Window](/debugging/scriptwindow.html)
* PPU Tools:
1. [Tilemap Viewer](/debugging/ppuviewers.html#tilemap-viewer)
2. [Tile Viewer](/debugging/ppuviewers.html#tile-viewer)
3. [Sprite Viewer](/debugging/ppuviewers.html#sprite-viewer)
4. [Palette Viewer](/debugging/ppuviewers.html#palette-viewer)
* [Trace Logger](/debugging/tracelogger.html)
* [Integration with assemblers](/debugging/debuggerintegration.html)
5. [Lua API reference](/apireference.html)

View File

@ -0,0 +1,82 @@
---
title: Callbacks
weight: 5
pre: ""
chapter: false
---
## addEventCallback ##
**Syntax**
emu.addEventCallback(function, type)
**Parameters**
function - A Lua function.
type - *Enum* See [eventType](/apireference/enums.html#eventtype).
**Return value**
Returns an integer value that can be used to remove the callback by calling [removeEventCallback](#removeeventcallback).
**Description**
Registers a callback function to be called whenever the specified event occurs.
The callback function receives no parameters.
## removeEventCallback ##
**Syntax**
emu.removeEventCallback(reference, type)
**Parameters**
reference - The value returned by the call to [addEventCallback](#addeventcallback).
type - *Enum* See [eventType](/apireference/enums.html#eventtype).
**Return value**
*None*
**Description**
Removes a previously registered callback function.
## addMemoryCallback ##
**Syntax**
emu.addMemoryCallback(function, type, startAddress [, endAddress, cpuType])
**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 - (optional) *Integer* End of the CPU memory address range to register the callback on.
cpuType - (optional) *Enum* See [cpuType](/apireference/enums.html#cputype)
**Return value**
Returns an integer value that can be used to remove the callback by calling [removeMemoryCallback](#removememorycallback).
**Description**
Registers a callback function to be called whenever the specified memory address is read/written/executed (based on `type`) by the specific CPU (`cpuType` - When no CPU type is specified, this defaults to emu.cpuType.cpu).
The callback function receives 2 parameters `address` and `value` that correspond to the address being written to or read from, and the value that is being read/written.
For reads, the callback is called *after* the read is performed.
For writes, the callback is called *before* the write is performed.
## removeMemoryCallback ##
**Syntax**
emu.removeMemoryCallback(reference, type, startAddress [, endAddress, cpuType])
**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 - (optional) *Integer* End of the CPU memory address range to unregister the callback from.
cpuType - (optional) *Enum* See [cpuType](/apireference/enums.html#cputype)
**Return value**
*None*
**Description**
Removes a previously registered callback function.

View File

@ -0,0 +1,10 @@
---
title: Changelog
weight: 1
pre: ""
chapter: false
---
## Changes between 0.1.0 and 0.5.0 ##
* First version of the documentation - no documented changes.

View File

@ -0,0 +1,168 @@
---
title: Drawing
weight: 10
pre: ""
chapter: false
---
## Drawing basics ##
All drawing-related functions share a few properties:
- (x, y) coordinates must be between (0, 0) and (255, 238)
- The "duration" is specified as a number of frames during which the drawing must remain on the screen. This defaults to 1 frame when unspecified, and draw calls will be permanent (until a call to [clearScreen](#clearscreen)) if duration is set to 0.
- Colors are integers in ARGB format:
White: 0xFFFFFF
Black: 0x000000
Red: 0xFF0000
Green: 0x00FF00
Blue: 0x0000FF
The alpha component (transparency) can be used and defaults to being fully opaque when set to 0 or omitted. (0xFF is fully transparent)
e.g:
semi-transparent black: 0x7F000000
opaque gray: 0xFF888888 (fully transparent gray color)
## drawPixel ##
**Syntax**
emu.drawPixel(x, y, color [, duration, delay])
**Parameters**
x - *Integer* X position
y - *Integer* Y position
color - *Integer* Color
duration - *Integer* Number of frames to display (Default: 1 frame)
delay - *Integer* Number of frames to wait before drawing the pixel (Default: 0 frames)
**Return value**
*None*
**Description**
Draws a pixel at the specified (x, y) coordinates using the specified color for a specific number of frames.
## drawLine ##
**Syntax**
emu.drawLine(x, y, x2, y2, color [, duration, delay])
**Parameters**
x - *Integer* X position (start of line)
y - *Integer* Y position (start of line)
x2 - *Integer* X position (end of line)
y2 - *Integer* Y position (end of line)
color - *Integer* Color
duration - *Integer* Number of frames to display (Default: 1 frame)
delay - *Integer* Number of frames to wait before drawing the line (Default: 0 frames)
**Return value**
*None*
**Description**
Draws a line between (x, y) to (x2, y2) using the specified color for a specific number of frames.
## drawRectangle ##
**Syntax**
emu.drawRectangle(x, y, width, height, color, fill [, duration, delay])
**Parameters**
x - *Integer* X position
y - *Integer* Y position
width - *Integer* The rectangle's width
height - *Integer* The rectangle's height
color - *Integer* Color
fill - *Boolean* Whether or not to draw an outline, or a filled rectangle.
duration - *Integer* Number of frames to display (Default: 1 frame)
delay - *Integer* Number of frames to wait before drawing the rectangle (Default: 0 frames)
**Return value**
*None*
**Description**
Draws a rectangle between (x, y) to (x+width, y+height) using the specified color for a specific number of frames.
If *fill* is false, only the rectangle's outline will be drawn.
## drawString ##
**Syntax**
emu.drawString(x, y, text, textColor, backgroundColor [, duration, delay])
**Parameters**
x - *Integer* X position
y - *Integer* Y position
text- *String* The text to display
textColor - *Integer* Color to use for the text
backgroundColor - *Integer* Color to use for the text's background color
duration - *Integer* Number of frames to display (Default: 1 frame)
delay - *Integer* Number of frames to wait before drawing the text (Default: 0 frames)
**Return value**
*None*
**Description**
Draws text at (x, y) using the specified text and colors for a specific number of frames.
## clearScreen ##
**Syntax**
emu.clearScreen()
**Return value**
*None*
**Description**
Removes all drawings from the screen.
## getPixel ##
**Syntax**
emu.getPixel(x, y)
**Parameters**
x - *Integer* X position
y - *Integer* Y position
**Return value**
*Integer* ARGB color
**Description**
Returns the color (in ARGB format) of the PPU's output for the specified location.
## getScreenBuffer ##
**Syntax**
emu.getScreenBuffer()
**Return value**
*Array* 32-bit integers in ARGB format
**Description**
Returns an array of ARGB values for the entire screen (256px by 239px) - can be used with [emu.setScreenBuffer()](#setscreenbuffer) to alter the frame.
## setScreenBuffer ##
**Syntax**
emu.setScreenBuffer(screenBuffer)
**Parameters**
screenBuffer - *Array* An array of 32-bit integers in ARGB format
**Return value**
*None*
**Description**
Replaces the current frame with the contents of the specified array.

View File

@ -0,0 +1,87 @@
---
title: Emulation
weight: 15
pre: ""
chapter: false
---
## getState ##
**Syntax**
emu.getState()
**Return value**
*Table* Current emulation state.
**Description**
Return a table containing information about the state of the CPU, PPU and SPC.
## breakExecution ##
**Syntax**
emu.breakExecution()
**Return value**
*None*
**Description**
Breaks the execution of the game and displays the debugger window.
## execute ##
**Syntax**
emu.execute(count, type)
**Parameters**
count - *Integer* The number of cycles or instructions to run before breaking
type - *Enum* See [executeCountType](/apireference/enums.html#executecounttype)
**Return value**
*None*
**Description**
Runs the emulator for the specified number of cycles/instructions and then breaks the execution.
## reset ##
**Syntax**
emu.reset()
**Return value**
*None*
**Description**
Resets the current game.
## resume ##
**Syntax**
emu.resume()
**Return value**
*None*
**Description**
Resumes execution after breaking.
## rewind ##
**Syntax**
emu.rewind(seconds)
**Parameters**
seconds - *Integer* The number of seconds to rewind
**Return value**
*None*
**Description**
Instantly rewinds the emulation by the number of seconds specified.
**Note:** this can only be called from within a "StartFrame" event callback.

View File

@ -0,0 +1,141 @@
---
title: Enums
weight: 55
pre: ""
chapter: false
---
## eventType ##
**Syntax**
emu.eventType.[value]
**Values**
```text
nmi, Triggered when an nmi occurs
irq, Triggered when an irq occurs
startFrame, Triggered at the start of a frame (cycle 0, scanline 0) (SNES only)
endFrame, Triggered at the end of a frame (cycle 0 on the NMI scanline) (SNES only)
reset, Triggered when a soft reset occurs
scriptEnded, Triggered when the current Lua script ends (script window closed, execution stopped, etc.)
inputPolled, Triggered when the emulation core polls the state of the input devices for the next frame
stateLoaded, Triggered when a user manually loads a savestate
stateSaved, Triggered when a user manually saves a savestate
gbStartFrame, Triggered at the start of a frame (cycle 0, scanline 0) (Game Boy only)
gbEndFrame, Triggered at the end of a frame (cycle 0, scanline 144) (Game Boy only)
```
**Description**
Used by [addEventCallback](/apireference/callbacks.html#addeventcallback) / [removeEventCallback](/apireference/callbacks.html#removeeventcallback) calls.
## memCallbackType ##
**Syntax**
emu.memCallbackType.[value]
**Values**
```text
read, Triggered when a read instruction is executed
write, Triggered when a write instruction is executed
exec, Triggered when any memory read occurs due to the CPU's code execution
```
**Description**
Used by [addMemoryCallback](/apireference/callbacks.html#addmemorycallback) / [removeMemoryCallback](/apireference/callbacks.html#removememorycallback) calls.
## memType ##
**Syntax**
emu.memType.[value]
**Values**
```text
cpu, CPU memory - Max: $FFFFFF Warning: Reading or writing to this memory type may cause side-effects!
spc, SPC memory - Max: $FFFF Warning: Reading or writing to this memory type may cause side-effects!
sa1, SPC memory - Max: $FFFFFF Warning: Reading or writing to this memory type may cause side-effects!
gsu, SPC memory - Max: $FFFFFF Warning: Reading or writing to this memory type may cause side-effects!
cx4, SPC memory - Max: $FFFFFF Warning: Reading or writing to this memory type may cause side-effects!
gameboy, Game Boy memory - Max: $FFFF Warning: Reading or writing to this memory type may cause side-effects!
cgram, CG/Palette RAM - Max: $1FF
oam, OAM / Sprite RAM - Max: $21F
vram, Video RAM - Max: $FFFF
prgRom, PRG ROM - Size varies by game
workRam, Work RAM - Max: $1FFFF
saveRam, Save RAM - Size varies by game
gbPrgRom, Game Boy PRG ROM - Size varies by game
gbWorkRam, Game Boy Work RAM - Max: $1FFF (GB) or $7FFF (GBC)
gbCartRam, Gmae Boy Cart/Save RAM - Size varies by game
gbVideoRam, Game Boy Video RAM - Max: $1FFF (GB) or $3FFF (GBC)
cpuDebug, CPU memory - Max: $FFFFFF Same as non-debug variant, but avoid side-effects.
spcDebug, SPC memory - Max: $FFFF Same as non-debug variant, but avoid side-effects.
sa1Debug, SA-1 memory - Max: $FFFFFF Same as non-debug variant, but avoid side-effects.
gsuDebug, GSU memory - Max: $FFFFFF Same as non-debug variant, but avoid side-effects.
cx4Debug, CX4 memory - Max: $FFFFFF Same as non-debug variant, but avoid side-effects.
gameboyDebug, Game Boy memory - Max: $FFFF Same as non-debug variant, but avoid side-effects.
```
**Description**
Used by [read](/apireference/memoryaccess.html#read-readword) / [write](/apireference/memoryaccess.html#write-writeword) calls.
## counterOpType ##
**Syntax**
emu.counterOpType.[value]
**Values**
```text
read,
write,
exec
```
**Description**
Used by [getAccessCounters](/apireference/misc.html#getaccesscounters) calls.
## stepType ##
**Syntax**
emu.stepType.[value]
**Values**
```text
cpuInstructions,
ppuCycles
```
**Description**
Used by [execute](/apireference/emulation.html#execute) calls.
## cpuType ##
**Syntax**
emu.cpuType.[value]
**Values**
```text
cpu, This represents the main SNES CPU (S-CPU)
spc,
dsp,
sa1,
gsu,
cx4,
gameboy
```
**Description**
Used by [registerMemoryCallback](/apireference/callbacks.html#registermemorycallback) calls.

View File

@ -0,0 +1,48 @@
---
title: Input
weight: 20
pre: ""
chapter: false
---
## getInput ##
**Syntax**
emu.getInput(port)
**Parameters**
port - *Integer* The port number to read (0 to 4)
**Return value**
*Table* A table containing the status of all 12 buttons.
**Description**
Returns a table containing the status of all 12 buttons: { a, b, x, y, l, r, select, start, up, down, left, right }
## getMouseState ##
**Syntax**
emu.getMouseState()
**Return value**
*Table* The mouse's state
**Description**
Returns a table containing the position and the state of all 3 buttons: { x, y, left, middle, right }
## isKeyPressed ##
**Syntax**
emu.isKeyPressed(keyName)
**Parameters**
keyName - *String* The name of the key to check
**Return value**
*Boolean* The key's state (true = pressed)
**Description**
Returns whether or not a specific key is pressed. The "keyName" must be the same as the string shown in the UI when the key is bound to a button.

View File

@ -0,0 +1,37 @@
---
title: Logging
weight: 25
pre: ""
chapter: false
---
## displayMessage ##
**Syntax**
emu.displayMessage(category, text)
**Parameters**
category - *String* The category is the portion shown between brackets []
text - *String* Text to show on the screen
**Return value**
*None*
**Description**
Displays a message on the main window in the format "[category] text"
## log ##
**Syntax**
emu.log(text)
**Parameters**
text - *String* Text to log
**Return value**
*None*
**Description**
Logs the given string in the script's log window - useful for debugging scripts.

View File

@ -0,0 +1,81 @@
---
title: Memory Access
weight: 30
pre: ""
chapter: false
---
## read / readWord ##
**Syntax**
emu.read(address, type, signed = false)
emu.readWord(address, type, signed = false)
**Parameters**
address - *Integer* The address/offset to read from.
type - *Enum* The type of memory to read from. See [memType](/apireference/enums.html#memtype).
signed - (optional) *Boolean* If true, the value returned will be interpreted as a signed value.
**Return value**
An 8-bit (read) or 16-bit (readWord) value.
**Description**
Reads a value from the specified [memory type](/apireference/enums.html#memtype).
When calling read / readWord, it is possible to trigger side-effects (such as register reads) when not using the "debug" memory types.
To avoid triggering side-effects, use the "debug" memory types.
## write / writeWord ##
**Syntax**
emu.write(address, value, type)
emu.writeWord(address, value, type)
**Parameters**
address - *Integer* The address/offset to write to.
value - *Integer* The value to write.
type - *Enum* The type of memory to write to. See [memType](/apireference/enums.html#memtype).
**Return value**
*None*
**Description**
Writes an 8-bit or 16-bit value to the specified [memory type](/apireference/enums.html#memtype).
Read-only memory such as PRG ROM can be written to using write/writeWord. Changes will remain in effect until the ROM is reloaded.
When calling write / writeWord, it is possible to trigger side-effects (such as register writes) when not using the "debug" memory types.
To avoid triggering side-effects, use the "debug" memory types.
## getPrgRomOffset ##
**Syntax**
emu.getPrgRomOffset(address)
**Parameters**
address - *Integer* A CPU address (Valid range: $0000-$FFFFFF)
**Return value**
*Integer* The corresponding byte offset in PRG ROM
**Description**
Returns an integer representing the byte offset of the specified CPU address in PRG ROM based on the mapper's current configuration. Returns -1 when the specified address is not mapped to PRG ROM.
## getLabelAddress ##
**Syntax**
emu.getLabelAddress(label)
**Parameters**
label - *String* The label to look up
**Return value**
*Integer* The corresponding CPU address
**Description**
Returns the address of the specified label. This address can be used with the memory read/write functions (`read()`, `readWord()`, `write()`, `writeWord()`) using the `emu.memType.cpu` or `emu.memType.cpuDebug` memory types.

View File

@ -0,0 +1,99 @@
---
title: Miscellaneous
weight: 40
pre: ""
chapter: false
---
## Access Counters ##
### getAccessCounters ###
**Syntax**
emu.getAccessCounters(memType, counterOpType)
**Parameters**
memType - *Enum* A value from the [emu.memType](/apireference/enums.html#memtype) enum
counterOpType - *Enum* A value from the [emu.counterOpType](/apireference/enums.html#counteroptype) enum
**Return value**
*Array* 32-bit integers
**Description**
Returns an array of access counters for the specified memory and operation types.
### resetAccessCounters ###
**Syntax**
emu.resetAccessCounters()
**Return value**
*None*
**Description**
Resets all access counters.
## Misc ##
### getLogWindowLog ###
**Syntax**
emu.getLogWindowLog()
**Return value**
*String* A string containing the log shown in the log window
**Description**
Returns the same text as what is shown in the emulator's Log Window.
### getRomInfo ###
**Syntax**
emu.getRomInfo()
**Return value**
*Table* Information about the current ROM with the following structure:
```text
name: string, Filename of the current ROM
path: string, Full path to the current ROM (including parent compressed archive when needed)
fileSha1Hash: string, The SHA1 hash for the whole ROM file
```
**Description**
Returns information about the ROM file that is currently running.
### getScriptDataFolder ###
**Syntax**
emu.getScriptDataFolder()
**Return value**
*String* The script's data folder
**Description**
This function returns the path to a unique folder (based on the script's filename) where the script should store its data (if any data needs to be saved).
The data will be saved in subfolders inside the LuaScriptData folder in Mesen-S' home folder.
### takeScreenshot ###
**Syntax**
emu.takeScreenshot()
**Return value**
*String* A binary string containing a PNG image.
**Description**
Takes a screenshot and returns a PNG file as a string.
The screenshot is not saved to the disk.

View File

@ -0,0 +1,54 @@
---
title: Lua API reference
weight: 55
chapter: false
toc: false
---
This section documents the Mesen-specific Lua API that is available in scripts via the [script window](/debugging/scriptwindow.html).
## Changelog ##
To get a list of API changes between different versions of Mesen-S, take a look at the [Changelog](/apireference/changelog.html).
## API References ##
* [Callbacks](/apireference/callbacks.html)
* [Drawing](/apireference/drawing.html)
* [Emulation](/apireference/emulation.html)
* [Input](/apireference/input.html)
* [Logging](/apireference/logging.html)
* [Memory Access](/apireference/memoryaccess.html)
* [Miscellaneous](/apireference/misc.html)
* [Enums](/apireference/enums.html)
## Additional features ##
### LuaSocket ###
The Lua implementation found in Mesen-S has a version of [LuaSocket](http://w3.impa.br/~diego/software/luasocket/) ([GitHub](https://github.com/diegonehab/luasocket)) built into it. The `socket` and `mime` packages are available and can be accessed by using `local socket = require("socket.core")` and `local mime = require("mime.core")`, respectively.
See [LuaSocket's documentation](http://w3.impa.br/~diego/software/luasocket/reference.html) for more information on how to use this library.
Here is a tiny TCP socket sample that connects to google.com via HTTP and downloads the page:
```
local socket = require("socket.core")
local tcp = sock.tcp()
--Set a 2-second timeout for all request, otherwise the process could hang!
tcp:settimeout(2)
local res = tcp:connect("www.google.com", 80)
tcp:send("GET / HTTP/1.1\r\nHost: www.google.com\r\nConnection: close\r\n\r\n")
local text
repeat
text = tcp:receive()
emu.log(text)
until text == nil
```
{{% notice warning %}}
Using sockets without calling the `settimeout(seconds)` function (and specifying a reasonable number of seconds) first can result in the Mesen-S process hanging until the socket finishes the operation it is waiting for.
For this reason, it is highly recommended to **ALWAYS** call `settimeout(seconds)` on any newly created TCP/etc object before calling any other function on it.
{{% /notice %}}

View File

@ -0,0 +1,33 @@
---
title: Audio Options
weight: 2
chapter: false
---
### General Options ###
<div class="imgBox"><div>
<img src="/images/AudioOptions_General.png" />
<span>General Options</span>
</div></div>
**Audio Device**: Selects which device is used for audio output (e.g computer speakers, or a headset)
**Sample Rate**: Selects the sample rate for the audio output -- typically, computers output at 44,100Hz or 48,000Hz, so they usually offer the best sound quality.
**Latency**: This represents the length of the buffer used in audio processing. A smaller value results in less delay between the audio and video, however, depending on the hardware used, a value that is too small may cause sound problems.
The **equalizer** can be used to alter the relative strength of specific frequencies.
<div class="clear"></div>
### Advanced Options ###
<div class="imgBox"><div>
<img src="/images/AudioOptions_Advanced.png" />
<span>Advanced Options</span>
</div></div>
* **Enable cubic interpolation**: This option replaces the SNES' default gaussian interpolation filter with a cubic interpolation filter which can produce better audio.
* **Disable dynamic sample rate**: While a game is running, the video and audio typically slowly drift out of sync. Mesen-S will automatically make adjustments to the audio sample rate while the game is running to keep them in sync. Disabling this option will typically cause sound issues such as crackling.

View File

@ -0,0 +1,73 @@
---
title: Emulation Options
weight: 8
chapter: false
---
## General Options ##
<div class="imgBox"><div>
<img src="/images/EmulationSettings_General.png" />
<span>General Options</span>
</div></div>
{{% notice tip %}}
Set any speed value below to 0 to make Mesen-S run as fast as possible.
{{% /notice %}}
**Emulation Speed**: This configures the regular speed to use when emulating. This should normally be set to `100%`.
**Fast Forward Speed**: This is the alternate speed that is used when the [Fast Forward button](/configuration/preferences.html#shortcut-keys) is held down.
**Rewind Speed**: This configures the speed at which to rewind the gameplay when the [Rewind button](/configuration/preferences.html#shortcut-keys) is held down.
**Region**: When set to `Auto`, the emulator will try to detect the game's region (NTSC or PAL) - however, this is not always possible. When there is nothing to suggest a game is for the `PAL` region (Australia & Europe), the `NTSC` region (North America & Japan) will be used by default.
**Run Ahead**: Run ahead allows the reduction of input lag by the number of frames specified. CPU requirements increase proportionally with the number of run ahead frames specified.
* Run ahead is currently not compatible with movies or netplay - the movies and netplay menus will be disabled if runahead is turned on.
* **Note for speedrunners:** Using features such as run ahead to reduce lag typically counts as cheating for the purposes of speed running.
## BS-X ##
<div class="imgBox"><div>
<img src="/images/EmulationSettings_Bsx.png" />
<span>BS-X Options</span>
</div></div>
This section configures the date and time that BS-X/Satellaview games use. It can either be set to the current date and time, or to a specific date and time which is used each time a BS-X title is launched.
## Advanced Options ##
<div class="imgBox"><div>
<img src="/images/EmulationSettings_Advanced.png" />
<span>Advanced Options</span>
</div></div>
{{% notice tip %}}
When developing software for the SNES, enabling these options can help you catch bugs. Setting the power on state for RAM to **random values** is also recommended.
{{% /notice %}}
**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.
**Randomize power-on state**: When enabled, various chips (PPU, etc.) often have a random state at power-on and need to be fully initialized before being used. This option causes their power on state to be random, forcing the program to initialize them to run properly.
**Use strict board mappings**: When enabled, this option turns on stricter board mappings for some cartridges. Currently, this only affects CX4 games.
## Overclocking ##
{{% notice warning %}}
Overclocking can cause issues in some games. The safest way to overclock is to increase the `Additional scanlines before NMI` option and leave the other options to their default values.
{{% /notice %}}
<div class="imgBox"><div>
<img src="/images/EmulationSettings_Overclocking.png" />
<span>Overclocking Options</span>
</div></div>
**Additional scanlines before NMI**: Increases the number of scanlines in the PPU, *before* the NMI signal is triggered at the end of the visible frame. This effectively gives more time for games to perform calculations, which can reduce slowdowns in games. **This is the preferred option for overclocking.**
**Additional scanlines after NMI**: Increases the number of scanlines in the PPU, *after* the NMI signal is triggered at the end of the visible frame. This effectively gives more time for games to perform calculations, which can reduce slowdowns in games. **This option is less compatible and should only be used if the `before NMI` variation does not work as expected.**
**Super FX Clock Speed**: Increases the clock speed used for the Super FX chip, which can reduce lag in Super FX games. This method of overclocking is more efficient for Super FX titles.

View File

@ -0,0 +1,38 @@
---
title: Game Boy Options
weight: 15
chapter: false
---
## General Options ##
<div class="imgBox"><div>
<img src="/images/Gameboy_General.png" />
<span>General Options</span>
</div></div>
* **Model**: Determines which Game Boy model to emulate when loading a Game Boy or Game Boy Color game. When `Auto` is selected, Super Game Boy emulation is used for Game Boy games, and Game Boy Color emulation is used for Game Boy Color games.
* **Use Super Game Boy 2 timings and behavior**: When enabled, Super Game Boy 2 is used when emulating the SGB.
## Video Options ##
<div class="imgBox"><div>
<img src="/images/Gameboy_Video.png" />
<span>Video Options</span>
</div></div>
* **Game Boy (DMG) Palette**: This section configures the colors used for all 3 palettes for the original Game Boy (background palette and both sprite palettes.) The `Select Preset...` button can be used to select from a number of preset palettes.
* **Enable GBC LCD color emulation**: When enabled, the colors used by Game Boy Color games are tweaked to better reproduce the colors shown by the Game Boy Color screen. (*Only affects Game Boy Color games*)
* **Enable LCD frame blending**: When enabled, the current frame is blended with the previous frame to simulate the Game Boy LCD screen's slow response time. (*This option has no effect in Super Game Boy mode*)
## Audio Options ##
<div class="imgBox"><div>
<img src="/images/Gameboy_Audio.png" />
<span>Audio Options</span>
</div></div>
* **Volume**: The volume sliders can be used to change the volume of each independent Game Boy sound channel.

View File

@ -0,0 +1,59 @@
---
title: Input Options
weight: 5
chapter: false
---
## General Options ##
<div class="imgBox"><div>
<img src="/images/InputOptions_General.png" />
<span>Controller Options</span>
</div></div>
## Setting up controllers ##
For each player, select the device you want to use. To connect more than 2 controllers, select the `Super Multitap` controller, which will display 4 additional controller configuration dropdowns.
To setup the key mappings for a controller (or other device-specific options), click the `Setup` button on the right of the player you want to configure.
## Configuring Key Bindings ##
<div class="imgBox"><div>
<img src="/images/InputOptions_Controller.png" />
<span>Controller Setup</span>
</div></div>
Each player can have up to four tabs of key bindings -- this allows you to control the same player with different input devices. For example, you can setup player 1 to be controlled by your keyboard and your Xbox controller at the same time.
To select a binding for a button, click on the corresponding button in the UI and then press the key or gamepad button you want to use for this button.
To clear a binding, click on it and then close the popup window by clicking on the X button.
To clear all bindings for this tab, click on the `Clear Key Bindings`.
To simplify configuration, a number of presets are available -- click on the `Select Preset` button to choose one.
You can also configure that controller's turbo buttons' speed with the `Turbo Speed` slider. *Note: setting the turbo speed to the fastest setting may cause some games to not detect the button presses at all.*
## Super Scope ##
The mouse is used to simulate the Super Scope's buttons:
* **Fire**: Left Button
* **Turbo**: Right Button
* **Cursor**: Middle Button
## Advanced Options ##
<div class="imgBox"><div>
<img src="/images/InputOptions_Advanced.png" />
<span>Advanced Options</span>
</div></div>
**Controller axis deadzone size**: Controls the deadzone size for analog sticks. A larger deadzone means that the analog stick will need to be moved more before a button press is registered.
### Display Controller Input ###
Use these options to display the controller input on the screen.
{{% notice warning %}}
This will be recorded by the [Video Recorder](/tools.html#video-recorder) - so make sure you turn it off if you do not want it to appear on the video.
{{% /notice %}}

View File

@ -0,0 +1,143 @@
---
title: Preferences
weight: 10
chapter: false
---
## General Options ##
<div class="imgBox"><div>
<img src="/images/Preferences_General.png" />
<span>General Options</span>
</div></div>
**Automatically check for updates**: When enabled, Mesen-S will check for a new version of the emulator every time the emulator is started.
**Only allow one instance of Mesen-S at a time**: When enabled, only a single copy of Mesen-S can be opened at the same time. This is useful when using file associations to load games by double-clicking on the rom files.
### Pause/Background settings ###
**Pause when in**:
* **Background**: When enabled, the emulator will automatically pause when in the background.
* **Menu and config dialogs**: When enabled, the emulator will automatically pause when in menus or configuration dialogs.
* **Debugging tools**: When enabled, the emulator will automatically pause when in debugging tools.
**Allow input when in background**: When enabled, gamepad input can still be used even if the window is in the background. *This does not work for keyboard key bindings.*
**Pause when a movie finishes playing**: When enabled, the emulator will automatically pause when a movie ends its playback.
### Misc. Settings ###
**Automatically apply IPS/BPS patches**: When enabled, any IPS or BPS patch file found in the same folder as the ROM file will automatically be applied. (i.e: when loading `MyRom.sfc`, if a file called `MyRom.ips` exists in the same folder, it will be loaded automatically.)
**Automatically hide the menu bar**: When enabled, the menu bar will automatically be hidden when not in use, even in windowed mode. *The menu bar is always hidden automatically when playing in fullscreen mode, whether this option is enabled or not.*
## Shortcut Keys ##
<div class="imgBox"><div>
<img src="/images/Preferences_ShortcutKeys.png" />
<span>Shortcut Keys</span>
</div></div>
Shortcut keys are user-defined shortcuts for various features in Mesen-S. Some of these features can only be accessed via shortcut keys (e.g: `Fast Forward` and `Rewind`).
Most of these options are also available through the main window's menu -- the shortcuts configured in this section will appear next to the matching action in the main window's menu.
**To change a shortcut**, click on the button for the shortcut you want to change and press the key(s) you want to set for this shortcut. Once you release a key, all the keys you had pressed will be assigned to the shortcut.
**To clear a key binding**, right-click on the button.
Available shortcuts:
* **Fast Forward (Hold button)**: Hold down this key to fast forward the game.
* **Toggle Fast Forward**: Start/stop fast forwarding.
* **Rewind (Hold button)**: Hold down this key to rewind the game in real-time.
* **Toggle Rewind**: Start/stop rewinding.
* **Rewind 10 seconds**: Instantly rewinds 10 seconds of gameplay.
* **Rewind 1 minute**: Instantly rewinds 1 minute of gameplay.
* **Pause**: Pauses or unpauses the game.
* **Reset**: Resets the game (equivalent to pressing the reset button on the SNES.)
* **Power Cycle**: Power cycles the game (equivalent to turning the power off and then back on.)
* **Reload ROM**: Reloads the ROM from the disk and power cycles the console.
* **Power Off**: Powers off the game, returning to the game selection screen.
* **Exit**: Exits the emulator.
* **Start/Stop Recording Video**: Starts (or stops) recording video (`.avi` file)
* **Start/Stop Recording Audio**: Starts (or stops) recording audio (`.wav` file)
* **Start/Stop Recording Movie**: Starts (or stops) recording a movie (`.msm` file)
* **Take Screenshot**: Takes a screenshot.
* **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.
* **Toggle OSD (On-Screen Display)**: Turns on/off the OSD.
* **Toggle Display on Top**: Turns on/off the display on top option.
* **Enable/Disable Cheat Codes**: Press to toggle cheats on or off.
* **Toggle BG Layer 0-3**: Turns on/off the display of the corresponding background layer.
* **Toggle Sprite Layer**: Turns on/off the display of all sprites.
* **Enable All Layers**: Turns on the display of all background layers and all sprites.
* **Enable/Disable Audio**: Press to toggle audio output on or off.
* **Toggle Maximum Speed**: Toggles emulation speed between 100% and maximum speed.
* **Increase Speed**: Increases the emulation speed.
* **Decrease Speed**: Decreases the emulation speed.
* **Open File**: Displays the open file dialog.
* **Load Random Game**: Loads a random game from your game folder.
* **Select Next Save Slot**: Move to the next save state slot.
* **Select Previous Save Slot**: Move to the previous save state slot.
* **Save State**: Save the game's state in the currently selected slot.
* **Load State**: Load the game's state from the currently selected slot.
* **Save State - Slot X**: Save the game's state to the matching slot.
* **Load State - Slot X**: Load the game's state from the matching slot.
* **Save State to File**: Save the game's state to a user-specified file.
* **Load State from File**: Load the game's state from a user-specified file.
* **Select Save Slot X**: Select the specified save state slot.
* **Open Save State Menu**: Opens the save state menu (Graphical interface to save a new save state)
* **Open Load State Menu**: Opens the load state menu (Graphical interface to load an existing save state)
## Folders and File Associations ##
<div class="imgBox"><div>
<img src="/images/Preferences_FoldersFiles.png" />
<span>Folders and File Associations</span>
</div></div>
**File Associations**: Use these options to associate Mesen-S with these file types. This will allow you to double-click on these files in a file explorer to open them in Mesen-S.
**Data Storage Location**: Mesen-S can either store its data in your user profile or in the same folder as the executable file itself.
This is configured when you launch Mesen-S for the first time, but can also be changed here.
When changing from one option to the other, Mesen-S will automatically copy all files from one folder to the other, allowing you to keep your save data and all other important files automatically.
**Folder Overrides**: On top of configuring the main folder where Mesen-S keeps its data, you may also specify custom locations for certain folders used by Mesen-S to store user-created files such as recordings or save data.
## Advanced Options ##
<div class="imgBox"><div>
<img src="/images/Preferences_Advanced.png" />
<span>Advanced Options</span>
</div></div>
### Window Settings ###
**Always display on top of other windows**: When enabled, the Mesen-S window will always be displayed above all other windows.
### UI Settings ###
**Disable on-screen display (OSD)**: When enabled, all on-screen messages are disabled.
**Disable game selection screen**: When enabled, the game selection screen is hidden and cannot be used.
**Display additional information in title bar**: When enabled, additional information is shown in the title bar (such as filter, scale, etc.), next to the game's name.
**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.
**Show frame counter**: When enabled, the number of frames emulated since the last reset will be shown on the screen.
**Show game timer**: When enabled, the amount of time elapsed since the last reset will be shown on the screen.
**Show debug information**: When enabled, a debug information overlay will be shown on the screen.
### Miscellaneous Settings ###
**Keep rewind data for the last [x] minutes**: The rewind feature in Mesen-S 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 5MB per minute). To limit the amount of memory that Mesen-S can use for rewind data, this configures the number of minutes that it is possible to rewind for.

View File

@ -0,0 +1,88 @@
---
title: Video Options
weight: 6
chapter: false
---
## General Options ##
<div class="imgBox"><div>
<img src="/images/VideoOptions_General.png" />
<span>General Options</span>
</div></div>
**Scale**: The scale determines the emulator window's size - use integer factors (e.g: 2x, 3x, 4x) for best results.
**Aspect Ratio**: The SNES' resolution in most games is 256x224, but it used to be displayed on CRT TVs that had a rectangular picture. To simulate a CRT TV, you can use the `Auto` option - it will switch between NTSC and PAL aspect ratios depending on the game you are playing. Using anything other than the `Default (No Stretching)` option may cause pixels to have irregular sizes. You can reduce this effect by using a combination of video filters and the bilinear filtering option.
**Enable integer FPS mode**: Under normal conditions, the NTSC SNES runs at 60.1 fps. When playing a 60hz LCD, this causes a lot of dropped frames. This option slows down the emulation by a tiny amount to produce 60 frames per second instead, which reduces the number of dropped frames.
**Enable vertical sync**: Turns on vertical sync -- can help prevent screen tearing on some hardware configurations.
**Use exclusive fullscreen mode**: Turns on exclusive fullscreen mode. This may be useful if you are experiencing screen tearing issues in regular fullscreen despite vertical sync being turned on.
**Fulscreen Resolution**: This option is shown only when exclusive fullsceen mode is enabled. It allows you to select the screen resolution that should be used when in exclusive fullscreen mode. The default resolution is the current Windows screen resolution.
**Requested Refresh Rate**: This option is shown only when exclusive fullsceen mode is enabled. It allows you to select your preferred refresh rate when running in exclusive fullscreen mode.
**Use integer scale values when entering fullscreen mode**: By default, fullscreen mode fills the entire screen. However, this can cause non-integer scaling values to be used -- for example, in 1080p resolution, the scale becomes 4.5x. Since this can cause irregularly shaped pixels, you can use this option to use the nearest integer scale value instead (e.g 4x in this example).
## Picture ##
<div class="imgBox"><div>
<img src="/images/VideoOptions_Picture.png" />
<span>Picture Options</span>
</div></div>
**Filter**: Allows you to select a video filter. Selecting NTSC filters will cause additional configuration options to appear below.
### Common Options ###
The `Brightness`, `Contrast`, `Hue`, `Saturation`, `Scanline` settings are common to all filters and can even be used without a filter.
**Use bilinear interpolation when scaling**: When enabled, bilinear interpolation is used when stretching (due to scale or aspect ratio). When disabled, nearest neighbor scaling is used. An easy way to get a slightly-softened screen, for example, is to use the `Prescale` filters (which use nearest neighbor scaling), use a bigger scale and enable bilinear filtering. For example, try this configuration:
```text
Filter: Prescale 3x
Scale: 4x
Use bilinear interpolation when scaling: Enabled
```
**Blend high resolution modes**: Some games use the SNES' "high resolution" mode which produces a 512x224 picture.
However, this mode causes horizontal blending, which is sometimes used for pseudo-transparency effects.
Enabling this option will allow these pseudo-transparency effects to look as they were intended (but causes the entire picture to look softer/blurrier)
**Scanlines**: Simulates the scanlines on a CRT TV - the higher the value, the deeper the scanlines appear on the screen.
### NTSC Filter Options ###
The `NTSC` filter available in Mesen-S is blargg's NTSC filter - this filter is very fast, and available in various other emulators.
This filter supports a large number of options which are visible on this tab when the NTSC filter is selected.
**NTSC options**: `Artifacts`, `Bleed`, `Fringing`, `Gamma`, `Resolution`, `Sharpness`
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 are usually hidden.
Most SNES games output 224 scanlines, while others use the SNES' 239 scanlines mode.
To avoid the window or picture size changing when the game changes between either mode, Mesen-S always outputs 239 scanlines.
In the vast majority of games, this results in 7 blank lines on the top and 8 on the bottom. To hide these blank scanlienes, set the top overscan value to 7 and the bottom to 8 (these are the default values)
## Advanced Options ##
<div class="imgBox"><div>
<img src="/images/VideoOptions_Advanced.png" />
<span>Advanced Options</span>
</div></div>
**Hide background layer 0-3**: The SNES can display up to 4 different background layers. These options control whether or not each layer is shown on the screen.
**Hide sprites**: When enabled, all sprites will be hidden.
**Disable frame skipping while fast forwarding**: By default, Mesen-S skips some frames when fast forwarding to improve performance. When enabled, this option forces the emulator to render every single frame, which makes fast forwarding slower.

View File

@ -0,0 +1,33 @@
---
title: Configuration
weight: 2
chapter: false
---
## Options Menu ##
<div class="imgBox right"><div>
<img src="/images/OptionsMenu.png" />
<span>Options Menu</span>
</div></div>
The options menu contains a number of shortcuts to change some popular settings:
**Speed**: Selects the emulation's current speed. Also see the [Rewind and Fast Forward shortcut keys](/configuration/preferences.html#shortcut-keys).
**Video Size**: Selects the picture's size -- when fullscreen is selected, the picture will automatically fill the screen. Additionally, you can also manually resize the window to select any size you prefer.
**Video Filter**: Selects a filter to apply to the picture. The `NTSC` filters attempt to reproduce the feeling of old CRT screens, while the other filters are a variety of different techniques used to scale up pixel art. Additional NTSC filter specific settings are available in the [video options](/configuration/video.html#picture).
**Region**: When set to `Auto`, the emulator will try to detect the game's region (NTSC or PAL) - however, this is not always possible. When there is nothing to suggest a game is for the `PAL` region (Australia & Europe), the `NTSC` region (North America & Japan) will be used by default.
## Configuration Dialogs ##
Additional settings can be found in each of the available menu options:
* [Audio Options](/configuration/audio.html)
* [Input Options](/configuration/input.html)
* [Video Options](/configuration/video.html)
* [Emulation Options](/configuration/emulation.html)
* [Game Boy Options](/configuration/gameboy.html)
* [Preferences](/configuration/preferences.html)

View File

@ -0,0 +1,40 @@
---
title: Assembler
weight: 11
chapter: false
---
<div class="imgBox"><div>
<img src="/images/Assembler.png" />
<span>Assembler</span>
</div></div>
The assembler allows writing new code, editing existing code and running arbitrary code. At the moment, the assembler can be used for the SNES's main CPU, the SA-1 and the Game Boy's CPU.
### Usage ###
Code is assembled on-the-fly, with the resulting byte code being shown on the right.
Any compilation error will be shown in the list at the bottom -- **<kbd>double-click</kbd>** an error in the list to navigate to the line that caused it.
Once you are done editing the code, click `Apply` to write the code to the specified memory address - this can be used to create new code in RAM, for example, or alter existing code in the ROM.
{{% notice tip %}}
Any changes done to the ROM will remain in effect until the ROM is reloaded. If you want to save your modifications to a .sfc file, or as an IPS patch, you can use the **<kbd>File&rarr;Save ROM as</kbd>** or **<kbd>File&rarr;Save edits as IPS</kbd>** commands in the [debugger window](/debugging/debugger.html).
{{% /notice %}}
**Note**: When [editing an existing block of code](/debugging/debugger.html#how-to-edit-code), the assembler keeps track of how many bytes of code the original code contained. If the new code is too large to fit into the original block of code, a warning will be shown before applying the changes.
### Supported features ###
* All opcodes and addressing modes are supported.
* Hexadecimal ($ prefix), binary (% prefix) and decimal values can be used
* Labels can be used and defined in the code. Labels defined in the assembler are not permanent - they are discarded once the assembler is closed.
* The `.db` directive can be used to add arbitrary data to the output.
### Display Options ###
Syntax highlighting can be configured (or disabled) via the `View` menu.
It is also possible to change the font size.

View File

@ -0,0 +1,15 @@
---
title: Debug Log
weight: 12
chapter: false
---
<div class="imgBox"><div>
<img src="/images/DebugLog.png" />
<span>Debug Log</span>
</div></div>
The debug log displays various emulation-related events. Currently, these include:
* Uninitialized memory reads
* SGB command packets

View File

@ -0,0 +1,368 @@
---
title: Debugger
weight: 10
pre: ""
chapter: false
---
<div class="imgBox"><div>
<img style="zoom:0.75" src="/images/DebuggerWindow.png" />
<span>The debugger window</span>
</div></div>
This window displays the disassembled code and allows you to configure breakpoints, labels and watch values. It also contains a large number of options and smaller features -- all of which are described below.
Each supported CPU has its own debugger window and its own set of breakpoints and watch values.
## General Usage Tips ##
Most elements in the debugger's interface have right-click menu options - make sure you explore the right-click options available in each list and window.
Watch expressions, breakpoints and labels are automatically saved on a per-rom basis. These are stored in a `.xml` file in the `Debugger` folder.
## Search Tools ##
There are a number of different tools that can be used to search/navigate the code:
<div class="imgBox"><div>
<img src="/images/GoToAll.png" />
<span>Go To All</span>
</div></div>
* **Go To All**: The *Go To All* feature allows you to search for any label by its name and navigate to it. It also works with CA/CC65 and displays the location of the labels in the original source code. (**<kbd>Ctrl+,</kbd>**)
* **Find/Find Next/Find Previous**: Incremental search that can be used to search through any text shown in the code window (**<kbd>Ctrl+F</kbd>**)
* **Go To...**: These options allow you to quickly reach the NMI, IRQ or Reset handlers or a specific address (**<kbd>Ctrl+G</kbd>**)
## Customizing the debugger ##
All keyboard shortcuts can be customized in **<kbd>Options&rarr;Customize Shortcut Keys</kbd>**
The font used in the code window can be customized in **<kbd>Options&rarr;Font Options&rarr;Select Font</kbd>**
The colors used for syntax highlighting can be changed in **<kbd>Options&rarr;Configure Colors</kbd>**
## Code Window ##
<div class="imgBox"><div>
<img src="/images/CodeWindow.png" />
<span>Code Window</span>
</div></div>
The code window displays the disassembled code and contains a number of features and options.
### General information ###
* Several options control what is shown in the code window, and how it is shown - see [Display Options](#display-options) below.
* Labels and comments defined in the label list are shown in the code.
* Single-line comments appear on the right, multi-line comments appear on top.
* The instruction that's currently executing is highlighted in yellow.
* Mouse-hovering any label or address will display a tooltip giving additional information (label, comment, current value in memory, etc.)
### Disassembly Options ###
**Unidentified Code/Data**: Configures how to display bytes when the debugger has not yet determined whether these bytes represent code or data.
**Verified Data**: Configures how to display bytes that the debugger has marked as data.
**Show in lower case**: When enabled, OP codes and hexadecimal values are displayed using lowercase letters
**Show byte code**: When enabled, the byte code matching the instructions will be displayed next to them (on the left)
**Use alternative mnemonics** (SPC only): When enabled, the disassembly will use an alternative set of mnemonics for the instructions.
## CPU/PPU Status ##
<div class="imgBox"><div>
<img src="/images/EmulationStatus.png" />
<span>Emulation Status</span>
</div></div>
This section of the debugger window displays the CPU and PPU's current state. The values displayed vary depending on the CPU type.
**Note:** These values are (currently) read-only.
## Watch List ##
<div class="imgBox" style="margin-top: 10px"><div>
<img src="/images/WatchList.png" />
<span>Watch List</span>
</div></div>
The watch list allows you to evaluate expressions and see their value.
**To add a new watch expression**, click on the last empty line in the list to enter edit mode.
**To edit a watch expression**, double-click on it to enter edit mode.
You can use the right-click context menu to delete or move entries, as well as select formatting options.
An import and export feature is also available to save/load watch expressions from a plain text file.
### Syntax ###
The syntax is identical to C/C++ (e.g `&&` for AND, `||` for OR) and uses the same operator precedence as well.
{{% notice tip %}}
Use the $ prefix to denote hexadecimal values (e.g: `$FF`) or the % prefix for binary values (e.g: `%1101`)
{{% /notice %}}
### Operators ###
The following operators are supported (same usage/precedence as C):
`*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `<`, `<=`, `>`, `>=`, `==`, `!=`, `&`, `^`, `|`, `&&`, `||`, `~`, `!`, `(`, `)`
Additionally, the following special operators exist:
* **[*address/label*]**: Surrounding a value/expression with brackets will read the corresponding memory address and return its value (1 byte).
* e.g: `[$8000]` will read the value at address $8000 and return it.
* **{*address/label*}**: Surrounding a value/expression with curly brackets will read the corresponding memory address and return its value (2 byte).
* e.g: `{myLabel}` will read 2 bytes of memory at the address represented by the `myLabel` label and return its value
### Special values ###
The following "variables" can be used in both the watch list and contional breakpoints to check the state of specific portions of the emulation core.
Each CPU type supports its own set of special values.
#### Common values ####
* **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
* **IsRead**: true if the CPU is reading from a memory address
* **IsWrite**: true if the CPU is writing to a memory address
#### CPU and SPC ####
* **A/X/Y/PS/SP**: Value of corresponding registers
* **PC**: Program Counter
* **OpPC**: Address of the current instruction's first byte
* **IRQ**: true if the IRQ flag is set
* **NMI**: true if the NMI flag is set
#### Game Boy ####
* **A/B/C/D/E/F/H/L**: Value of corresponding registers
* **PC**: Program Counter
* **SP**: Stack Pointer
#### GSU (Super FX) ####
* **R0 to R15**: Value of corresponding registers
* **SrcReg**: Source Register
* **DstReg**: Destination Register
* **SFR**: Status Flags Register
* **PBR**: Program Bank Register
* **RomBR**: ROM Bank Register
* **RamBR**: RAM Bank Register
### Formatting ###
It is possible to customize the format of each entry by adding a suffix to the expression.
Suffixes contain a single letter and are optionally followed by a number indicating the number of bytes expected in the return value (up to 4).
The available suffixes are:
* `S` - Signed decimal value
* `U` - Unsigned decimal value
* `H` - Hexadecimal
* `B` - Binary
For example, suffixing an expression with:
* `, H2` will display the result as a 2-byte hexadecimal value (e.g: `26, H2` will display as `$001A`)
* `, B` will display the result as a binary value (e.g: `141,B` will display as `%10001101`)
* `, S2` will display the result as a 16-bit signed decimal value (e.g: `$FE4F, S2` will display as `-433`)
* `, U` will display the result as an unsigned decimal value (e.g: `180, U` will display as `180`)
You can select the default format to use for entries without prefixes by right-clicking and choosing between:
* **Decimal Display** (equivalent to `S4` to all entries - displays the result as 32-bit signed decimal values)
* **Hexadecimal Display** (equivalent to `H1` to all entries)
* **Binary Display** (equivalent to `B1` to all entries)
### Usage 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.
{$FFFC} //Returns the reset handler's address.
[$14] | ([$15] << 8), H2 //Display the value of the 2-byte variable stored at $14 in hexadecimal format.
```
**Using labels**
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 list 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>
<img src="/images/BreakpointList.png" />
<span>Breakpoint List</span>
</div></div>
Breakpoints define conditions under which the execution of the game's code will be suspended. Any number of breakpoints can be defined.
You can also make a breakpoint appear as a mark on the [Event Viewer](/debugging/eventviewer.html) by checking the `M` column.
**To add a breakpoint**, right-click the breakpoint list and select **Add**.
**To edit a breakpoint**, double-click on it in the list.
**To disable a breakpoint**, uncheck it.
**To delete a breakpoint**, right-click on it and select **Delete**
**To view the breakpoint in the code**, right-click on it and select **Go to location**
### Breakpoint configuration ###
<div class="imgBox"><div>
<img src="/images/EditBreakpoint.png" />
<span>Edit Breakpoint Window</span>
</div></div>
Breakpoints can be set to trigger based on CPU/PPU memory accesses at specific memory addresses.
**Breakpoint Type**
Select the type of memory for which you want to set a breakpoint. The valid range of addresses for the breakpoint will vary based on the selected memory type.
**Break On**
Select which types of accesses (read, write or execute) should trigger the breakpoint.
**Address**
Select which address or address range this breakpoint should apply to.
It is also possible to specify no address at all by selecting **Any** - in this case, breakpoints will be evaluated on every CPU cycle.
**Condition** (optional)
Conditions allow you to use the same expression syntax as the one used in the [Watch List](#watch-list) to cause a breakpoint to trigger under specific conditions.
**Mark on Event Viewer**
When enabled, a mark will be visible on the [Event Viewer](/debugging/eventviewer.html) whenever this breakpoint's conditions are met. This can be used to add marks to the event viewer based on a variety of conditions by using conditional breakpoints.
**Break Execution**
This enables the breakpoint - if this is disabled, the execution will not break when the breakpoint is hit.
**Examples**
To break when the sum of the X and Y registers is 5:
x + y == 5
To break when the value at memory address $10 is smaller or equal to $40:
[$10] <= $40
To break when the CPU writes the value $60 to any address:
IsWrite && Value == $60
## Call Stack ##
<div class="imgBox"><div>
<img src="/images/CallStack.png" />
<span>Call Stack example with labels</span>
</div></div>
The call stack displays the currently executing function, and all functions that are below it on the stack.
The top of the list is the current function, while the row below it is the location that the code will return to once the current function returns. The call stack also displays interrupt handlers as an entry in the call stack.
**Labels:** When labels are defined for the PRG ROM offset matching the function's entry point, that label is shown as the function's name in the call stack.
**To view the code** at any location in the call stack, double-click on the row.
## Labels ##
<div class="imgBox"><div>
<img src="/images/LabelList.png" />
<span>Label List</span>
</div></div>
Labels can be used to simplify debugging. They allow you to give names to variables and functions which will be used instead of numeric addresses when viewing the code in the debugger. Labels can also be used to display single and multi-line comments to the code.
The label list displays every label defined in alphabetical order.
**To add a label**, right-click in the label list and select `Add`.
**To edit a label**, right-click in the label list and select `Edit`.
**To delete a label**, right-click in the label list and select `Delete`.
**To add a breakpoint to a label**, right-click in the label list and select `Add breakpoint`.
**To add the label to the watch**, right-click in the label list and select `Add to watch`.
**To view the code** at the label's location, double-click on the label in the list.
**To view the label in the hex editor**, use any of the `View in [...]` options shown in the right-click menu.
`Show Comments` controls wheter or not code comments that are not labelled are shown in the label list.
**Note:** Labels shown in gray color and italic font are currently not mapped in CPU memory.
### Editing Labels ###
<div class="imgBox"><div>
<img src="/images/EditLabel.png" />
<span>Edit Label Window</span>
</div></div>
Labels can be defined on different types of memory, depending on the CPU.
There are some restrictions on what a label can contain -- in general, they must begin with a letter or an underscore and cannot contain spaces or most non-alphanumeric characters.
Labels can also contain a comment which is shown in the code window as well as in the tooltips that are displayed when putting your cursor over a label in the code window.
Multi-byte labels can be defined using the `Length` setting. This can be used to define multi-byte values, arrays or pointers in the code. Multi-byte labels will be shown with a +X offset modifier when referred to in the code window (e.g: `MyArrayLabel+2`)
## CPU Memory Mappings ##
<div class="imgBox inline"><div>
<img src="/images/MemoryMappings.png" />
<span>CPU Memory Mappings</span>
</div></div>
**Note:** This is a Game Boy debugger specific feature.
The CPU memory mappings are visual aids that display information about the currently selected PRG/Work RAM/Save RAM banks.
## Other Options ##
### 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 available options vary based on the CPU type.
* **Break on power/reset**: Break the emulation whenever a reset or power cycle occurs.
* **Break when debugger is opened**: The emulation will break when you first open the debugger.
<div></div>
* **Break on BRK**: Break the emulation whenever a BRK instruction is about to execute.
* **Break on COP**: Break the emulation whenever a COP instruction is about to execute.
* **Break on STP**: Break the emulation whenever a STP instruction is about to execute.
* **Break on WDM**: Break the emulation whenever a WDM instruction is about to execute.
<div></div>
* **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.*
<div></div>
* **Bring debugger to front on break**: When enabled, the debugger window will get focus whenever a break/pause occurs.
<div></div>
* **Break on invalid OAM access** (Game Boy only): Break if the CPU attempts to read or write to OAM when it is not allowed to do so.
* **Break on invalid VRAM access** (Game Boy only): Break if the CPU attempts to read or write to video RAM when it is not allowed to do so.
* **Break on LCD disable outside vblank** (Game Boy only): Break if the program disables the LCD outside of vertical blank. This may cause damage to the Game Boy's LCD and should be avoided.
* **Break on invalid instructions** (Game Boy only): Break if the CPU executes one of the invalid instructions.
* **Break on LD B,B (nop)** (Game Boy only): Break if the CPU executes the LD B, B ($40) instruction, which is a NOP. This can be used to add software breakpoints by using this instruction in your code.
## How To: Edit Code ##
From the code window, you can select code (via click and drag, or shift+arrow keys) and use the "Edit Selected Code" command to open the [Assembler](/debugging/assembler.html) and edit that section of code.
The assembler recognizes labels and allows you to define temporary labels as well. If the new code is smaller (in terms of bytes) than the original code, the extra bytes will be replaced by NOPs. If the new code is larger, it will override whatever comes next in the code -- a warning will be shown beforehand in this case.
When you're ready to apply your modifications, press the Apply button.
{{% notice tip %}}
If you want to save your code 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.
{{% /notice %}}

View File

@ -0,0 +1,94 @@
---
title: Integration with assemblers
weight: 40
pre: ""
chapter: false
---
When building homebrew software in assembly or C, it is possible to export the labels used in your code and import them into Mesen-S to simplify the debugging process.
This allows the debugger to know which portions of the ROM correspond to which functions in your code, as well as display your code's comments inside the debugger itself.
## Integration with assemblers ##
### CC65 / CA65 ###
CC65/CA65 are able to produce .DBG files which can be imported into Mesen-S' debugger.
To make CC65/CA65 create a .DBG file during the compilation, use the `--dbgfile` command line option.
To import the .DBG file, use the **<kbd>File&rarr;Workspace&rarr;Import Labels</kbd>** command in the debugger window.
You can also enable the `Automatically load DBG/MSL debug symbols` option in **<kbd>File&rarr;Import/Export&rarr;Integration Settings</kbd>** to make Mesen-S load any .DBG file it finds next to the ROM whenever the debugger is opened.
**Note:** For this option to work, the ROM file must have the same name as the DBG file (e.g `MyRom.sfc` and `MyRom.dbg`) and be inside the same folder.
#### Source View ####
<div class="imgBox"><div>
<img src="/images/SourceView.png" />
<span>Source View</span>
</div></div>
When a .DBG file is loaded, an additional option appears in the code window's right-click menu:
* **Switch to Source View**: This turns on `Source View` mode, which allows you to debug the game using the original code files, rather than the disassembly. This can be used for both assembly and C projects.
### bass ###
Integration with bass is possible via `.sym` files.
When the `Automatically load DBG/MSL debug symbols` option in **<kbd>File&rarr;Import/Export&rarr;Integration Settings</kbd>** is enabled, the debugger will automatically attempt to load `.sym` files with the same name as the ROM (e.g `MyRom.sfc` and `MyRom.sym`)
### RGBDS ###
Integration with RGBDS (for Game Boy projects) is possible via the `.sym` files that RGBDS produces.
When the `Automatically load DBG/MSL debug symbols` option in **<kbd>File&rarr;Import/Export&rarr;Integration Settings</kbd>** is enabled, the debugger will automatically attempt to load `.sym` files with the same name as the ROM (e.g `MyRom.sfc` and `MyRom.sym`)
## Importing and exporting labels ##
<div class="imgBox"><div>
<img src="/images/ImportExportMenu.png" />
<span>Import/Export</span>
</div></div>
Mesen-S can also import and export labels in `.msl` format. The ability to import labels can be used to integrate the debugger with your own workflow (e.g by creating your own scripts that produce `.msl` files)
<div style="clear:both"></div>
### Mesen-S Label Files (.msl) ###
The `.msl` files used by Mesen-S to import/export labels is a simple text format. For example, this defines a label and comment on byte $100 of PRG ROM:
```
PRG:100:MyLabel:This is a comment
```
The format also supports multi-byte labels, defined by giving specifying an address range:
```
PRG:200-2FF:MyArray
```
The first part on each row is used to specify the label's type:
```
PRG: PRG ROM labels
WORK: Work RAM labels (for the SNES' internal 128kb Work RAM)
SAVE: Save RAM labels
REG: Register labels
SPCRAM: SPC RAM labels
SPCROM: SPC IPL ROM labels
IRAM: SA-1 IRAM labels
PSRAM: BS-X PS RAM labels
MPACK: BS-X Memory Pack labels
DSPPRG: DSP Program ROM labels
GBPRG: Game Boy Program ROM labels
GBWRAM: Game Boy Work RAM labels
GBSRAM: Game Boy Cart/Save RAM labels
GBHRAM: Game Boy High RAM labels
GBBOOT: Game Boy Boot ROM labels
GBREG: Game Boy Register labels
```
### Integration Settings ###
<div class="imgBox"><div>
<img src="/images/IntegrationSettings.png" />
<span>Integration Settings</span>
</div></div>
For fine-grain control over the DBG/MSL file imports, the `Integration Settings` ( **<kbd>File&rarr;Import/Export&rarr;Integration Settings</kbd>**) window can be used.
This allows you to configure which types of labels/comments should be imported, as well as choosing whether or not Mesen-S should delete all existing labels before importing DBG/MSL files.

View File

@ -0,0 +1,27 @@
---
title: Event Viewer
weight: 13
chapter: false
---
## PPU View ##
<div class="imgBox"><div>
<img src="/images/EventViewer.png" />
<span>Event Viewer - PPU View</span>
</div></div>
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.
When the `Show previous frame's events` option is enabled, all events for the last full frame will be shown. Otherwise, only events that have occurred since the beginnning of the current frame will be shown.
## 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

@ -0,0 +1,92 @@
---
title: Memory Tools
weight: 14
chapter: false
---
## Memory Viewer ##
<div class="imgBox"><div>
<img src="/images/MemoryViewer.png" />
<span>Memory Viewer</span>
</div></div>
The memory viewer offers read and write access to all types of ROM and RAM memory, including those exclusive to specific enhancement chips.
**Note:** Only memory types that are available for the currently loaded ROM will be shown in the dropdown.
<div style="clear:both"></div>
{{% notice tip %}}
PRG ROM can be written from the memory viewer. Any change will remain in effect until the ROM is reloaded. If you want to save your modifications to a .sfc file, or as an IPS patch, you can use the **<kbd>File&rarr;Save ROM as</kbd>** or **<kbd>File&rarr;Save edits as IPS</kbd>** commands in the [debugger window](/debugging/debugger.html).
{{% /notice %}}
### Highlighting ###
There are a number of highlighting/coloring options in the memory viewer.
<kbd>**View&rarr;Memory Access Highlighting**</kbd> has coloring options for addresses that were recently read, written or executed. A fade-out period can also be configured, after which the byte will revert to its normal black color.
<kbd>**View&rarr;Data Type Highlighting**</kbd> offers options to change the background color of specific bytes based on their type:</span>
* Labeled bytes
* Breakpoints
* Code bytes *(PRG ROM only)*
* Data bytes *(PRG ROM only)*
<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>.
**Note:** It is possible to customize the colors used by the memory viewer in <kbd>**View&rarr;Configure Colors**</kbd>
### Options ###
#### Display Options ###
* **Auto-refresh speed:** Configures the speed at which the memory view refreshes.
* **Select Font:** Allows you to select which font to use in the memory view.
* **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.
* **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.
* **Show label tooltip on mouseover:** When enabled, bytes for which a label exists will have a tooltip with the label's information.
#### Other Options ####
* **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.
* **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)
### Editing Memory Values ###
There are 2 ways to edit memory values:
* **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.
* **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.
### Importing / Exporting ###
For 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 in the `File` menu to do this.
### Using TBL Files ###
<div class="imgBox"><div>
<img src="/images/MemoryViewerTbl.png" />
<span>Memory Viewer with a TBL file loaded to display Japanese text</span>
</div></div>
TBL 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'.
Normally, when no TBL file is loaded, the memory viewer will display each byte's standard ASCII representation on the right-hand side.
Once 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.
## Memory Access Counters ##
<div class="imgBox"><div>
<img src="/images/MemoryAccessCounters.png" />
<span>Memory Access Counters</span>
</div></div>
When active, the debugger keeps track of all reads, writes and executions done by the CPU. It is possible to view these counters here.
Click on any column header to sort the data.
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.

View File

@ -0,0 +1,28 @@
---
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 easy to find the bottlenecks in a game's code, which can help code optimization efforts.
The SNES' main CPU, the SPC, the SA-1 and the Game Boy CPU are all supported by the profiler. Each will appear in its own tab.
The following columns are shown in the list:
* **Call Count**: The number of times this function was called during profiling
* **Inclusive Time (Cyc)**: The amount of 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 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)
* **Avg. Cycles**: The average number of cycles taken by this function
* **Min. Cycles**: The minimum number of cycles taken by this function (e.g the fastest execution time across all of its calls)
* **Max. Count**: The maximum number of cycles taken by this function (e.g the slowest execution time across all of its calls)
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,84 @@
---
title: PPU Viewers
weight: 20
pre: ""
chapter: false
---
The PPU viewers are a collection of separate tools that allow you to view the current state of various parts of the PPU's memory - tiles, tilemaps, sprites and palettes.
All viewers have some settings in common:
* **Auto-refresh**: Enabled by default, this makes the viewer refresh automatically at a specific scanline/cycle each frame.
* **Auto-refresh speed**: Configures at what speed the viewer will refresh itself (15/30/60 FPS)
* **Refresh on 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.
You can **zoom in and out** the viewer by using the zoom in and zoom out shortcuts in the view menu, or by holding the `Ctrl` key and using the mouse wheel.
Additionally, you can pan/scroll the viewer by clicking and dragging, or by using the mouse wheel (use the `Shift` key to scroll horizontally.)
## Tilemap Viewer ##
<div class="imgBox"><div>
<img src="/images/TilemapViewer.png" />
<span>Tilemap Viewer</span>
</div></div>
The tilemap viewer displays the contents of each background layer, based on the current PPU mode.
For Game Boy games, this displays either the background or window's contents.
<kbd>**Click**</kbd> on a tile in the tilemap to display information about the selected tile on the right. The information displayed changes depending on whether the current ROM is a SNES or Game Boy game.
There are also a number of display options:
* **Show tile grid**: Displays a 8x8 grid (or 16x16 depending on PPU settings) over the image to help distinguish each tile.
* **Show scroll Overlay**: Shows a gray transparent overlay showing the current scroll offsets for the selected layer.
## Tile Viewer ##
<div class="imgBox"><div>
<img src="/images/TileViewer.png" />
<span>Tile Viewer</span>
</div></div>
The tile viewer can display the content of any type of memory (including video ram itself) as if it were tile data, in one of the various tile formats supported (2 BPP, 4 BPP, 8 BPP, etc.).
For the SNES, there are a number of preset buttons that can be used to quickly view the tiles used by the matching background layer or sprites.
Options:
* **Source**: Selects which memory type to display in the viewer.
* **Format**: Selects the tile format to use to interpret the data in memory.
* **Address**: The offset in the selected memory type of the first byte of the first tile to display in the viewer.
* **Size**: The number of bytes to display in the viewer (limited to 64kb)
* **Columns**: The number of columns to use when displaying the data.
There are also a number of display options:
* **Show tile grid**: Displays a 8x8 grid (or 16x16 depending on PPU settings) over the image to help distinguish each tile.
## Sprite Viewer ##
<div class="imgBox"><div>
<img src="/images/SpriteViewer.png" />
<span>Sprite Viewer</span>
</div></div>
The sprite viewer displays the contents of OAM RAM.
The left portion of the screen displays the sprites as they are on the screen, while the right half is a list of all sprites in OAM.
Sprites displayed in gray in the list are off-screen.
**Click** on a sprite in either side of the viewer to highlight the same sprite on the opposite half.
**Hide off-screen sprites**: When enabled, sprites that are off-screen will not be shown in the list.
## Palette Viewer ##
<div class="imgBox"><div>
<img src="/images/PaletteViewer.png" />
<span>Palette Viewer</span>
</div></div>
The Palette Viewer displays basic information about the current state of CG RAM (palette RAM).
**Click** on a color in the viewer to see details about it.
For **Game Boy** games, the selected palettes for the background and the two sprite palettes.
For **Game Boy Color** games, the 8 background and 8 sprite palettes are shown.

View File

@ -0,0 +1,12 @@
---
title: Register Viewer
weight: 21
chapter: false
---
<div class="imgBox"><div>
<img src="/images/RegisterViewer.png" />
<span>Register Viewer</span>
</div></div>
The register viewer displays the state of most chips in the SNES (PPU, SPC, DSP, etc.) in a list format. The data for each chip is shown in a separate tab. For Game Boy games (including Game Boy Color and Super Game Boy), a `Game Boy` tab will be shown.

View File

@ -0,0 +1,32 @@
---
title: Script Window
weight: 25
chapter: false
---
<div class="imgBox"><div>
<img src="/images/ScriptWindow.png" />
<span>Script Window</span>
</div></div>
## Script Window ##
The Script Window allows [Lua](https://www.lua.org/) scripting via an [API](/apireference.html). Using this API, you can interact with the emulation core to perform a variety of things (e.g: logging, drawing, implementing an AI).
The code editor contains an autocomplete feature for all of Mesen-S' API -- typing `emu.` will display an autocomplete popup displaying all available functions. Select a function in the list to see its parameters, return value and description.
Multiple script windows can be opened at once to combine the effects of several scripts together.
Scripts can be loaded from the disk and edited in any other text editor. When using an external editor to modify the script, it is suggested to turn on the **<kbd>Script&rarr;Auto-reload when file changes</kbd>** option to automatically reload the script each time it is saved to the disk.
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.
### 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.
Most of these scripts have been contributed by users (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

@ -0,0 +1,33 @@
---
title: Trace Logger
weight: 35
chapter: false
---
<div class="imgBox"><div>
<img src="/images/TraceLogger.png" />
<span>Trace Logger</span>
</div></div>
### Basic Information ###
The trace logger displays the execution log of any of the supported CPUs. It can display the last 30,000 instructions executed.
Additionally, it is also possible to log these instructions to the disk by using the `Start Logging` button.
Log files can rapidly grow in size (to several GBs worth of data in a few seconds), so it is recommended to log for the shortest amount of time needed.
### Display Options ###
This section configures which CPUs are logged, and allows you to customize the content of each row.
**Note**: Currently, only the main CPU (S-CPU) can have its format customized - all other CPUs use a preset format that cannot be changed.
Additional options:
* **Status Flag Format**: Offers a number of different ways to display the CPU's status flags.
* **Use Labels**: When enabled, addresses that match known labels will be replaced by their label instead.
* **Use Windows EOL**: When enabled, the log will use Windows-style end-of-line characters (LF+CR) instead of just LF.
### Custom Formatting ###
The trace logger's output can be customized by enabling the **Format Override** option and editing the format string.
See the help icon in the trace logger window for a summary of available tags and features.

View File

@ -0,0 +1,24 @@
---
title: Debugging Tools
weight: 5
chapter: false
toc: false
---
The debugging capabilities of Mesen are split across a number of different tools, including the debugger itself:
[Assembler](/debugging/assembler.html): Allows you to edit a game's code or run custom code on-the-fly.
[Debugger](/debugging/debugger.html): View the code, add breakpoints, labels, watch values, and much more. A separate debugger window exists for each supported CPU.
[Debug Log](/debugging/debuglog.html): Displays a log of various emulation-related events (uninitialized memory reads, SGB packets, etc.)
[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 access counters for all memory types.
[Performance Profiler](/debugging/performanceprofiler.html): Profiles the CPU's execution to help find bottlenecks in code.
[PPU Viewers](/debugging/ppuviewers.html): Tools to display tiles, tilemaps, sprites and palettes.
[Register Viewer](/debugging/registerviewer.html): Displays register/state information for most chips in the SNES/cartridge.
[Script Window](/debugging/scriptwindow.html): Allows the execution of Lua scripts, which can communicate with the emulation via an API.
[Trace Logger](/debugging/tracelogger.html): View or log to a file the execution trace of any of the supported CPUs.
Additionally, some other smaller features are available from the main debugger window. e.g:
- [Import labels from CA65/CC65/bass/RGBDS](/debugging/debuggerintegration.html)
- Save any modification done to ROM via the [Assembler](/debugging/assembler.html) or the [Memory Viewer](/debugging/memorytools.html#memory-viewer) as a new `.sfc` file, or as an `.ips` patch file

View File

@ -0,0 +1,139 @@
---
title: Getting Started
weight: 1
chapter: false
---
## System Requirements ##
### Windows ###
* Windows 7, 8, 8.1 or 10
* DirectX 11
* .NET Framework 4.5+
### Linux ###
* glibc 2.24+
* Mono 5.18+
* SDL 2
## Installation ##
<div class="imgBox right"><div>
<img src="/images/ConfigWizard.png" />
<span>Configuration Wizard</span>
</div></div>
There is no installer for Mesen-S -- run the Mesen-S.exe application and a first-run configuration wizard will be shown.
**Data Storage Location**: This section of the wizard allows you to select where you prefer to keep the emulator's files.
**Input Mappings**: Select which input types you want to use to play games. There are built-in presets for:
* Xbox controllers
* PS4 controllers
* WASD keyboard layout
* Arrow keyboard layout
You can select multiple presets at once, but only a single keyboard layout.
**Create a shortcut on my desktop**: Check this option if you want to add a Mesen-S shortcut to your desktop.
## Using Mesen-S ##
<div class="imgBox right"><div>
<img src="/images/GameMenu.png" />
<span>Game Menu</span>
</div></div>
The default configuration should work out of the box and allow you to get right into playing games.
To load a game, use the **<kbd>File&rarr;Open</kbd>** command and select any supported file (or drag and drop a file):
* `.sfc`: SNES games
* `.gb` / `.gbc`: Game Boy and Game Boy Color games
* `.bs`: BS-X / Satellaview games
* `.spc`: SPC sound tracks
Additionally, `.zip` and `.7z` archives containing ROMs can be loaded directly.
Once a game is loaded, you can pause, reset or stop the game via the `Game` menu.
### Firmware / BIOS files ###
Some games require a firmware file (sometimes called a BIOS). Whenever a game that requires a firmware file is loaded, the emulator will automatically prompt you for the file. All firmware files are saved in the `Firmware` folder.
The following firmware files are used:
* **BS-X/Satellaview**: For BS-X/Satellaview games, the BS-X cartridge's firmware is required. It is stored under the name `BS-X.bin`.
* **DSP**: This family of enhancement chips is used in a fairly large number of games, and several variations of the chips exist, each requiring their own firmware files. The split file format used by bsnes/higan is also supported, e.g: `dsp1.data.rom` and `dsp1.program.rom`.
* `dsp1.rom`: DSP-1
* `dsp1b.rom`: DSP-1b
* `dsp2.rom`: DSP-2
* `dsp3.rom`: DSP-3
* `dsp4.rom`: DSP-4
* `st010.rom`: ST010
* `st011.rom`: ST011
* **Game Boy**: For Game Boy and Game Boy Color games, the boot roms are optional. When the files are not found, the open source GB/GBC boot roms written by LIJI32 (SameBoy author) will be used instead.
* `dmg_boot.bin` (256 bytes): Game Boy Boot ROM
* `cgb_boot.bin` (2304 bytes): Game Boy Color Boot ROM
* **Super Game Boy**: SGB emulation requires the SGB's ROM. Several versions exist based on region, and a different SGB2 ROM is also required for the SGB2.
* `SGB1.sfc` (256 kb): Super Game Boy
* `SGB2.sfc` (512 kb): Super Game Boy 2
* `sgb_boot.bin` (256 bytes): Super Game Boy CPU Boot ROM (optional)
* `sgb2_boot.bin` (256 bytes): Super Game Boy 2 CPU Boot ROM (optional)
<div class="clear"></div>
### Game Boy Emulation ###
Alongside Super Game Boy support, Mesen-S can also emulate regular Game Boy and Game Boy Color games, without running them through the Super Game Boy.
To control which Game Boy model is used when loading `.gb` and `.gbc` files, use the `Model` dropdown in the [Game Boy options](/configuration/gameboy.html).
All [debugging tools](/debugging.html) also support Game Boy and Game Boy Color games.
### SPC Player ###
<div class="imgBox"><div>
<img src="/images/SpcPlayer.png" />
<span>SPC Player</span>
</div></div>
SPC files are used to store music from SNES games. These can be loaded like any other type of ROM.
When loading SPC files, the UI will display information about the track, artist, etc. while the track is playing.
<div class="clear"></div>
### Game Selection Screen ###
<div class="imgBox"><div>
<img src="/images/GameSelectionScreen.png" />
<span>Game Selection Screen</span>
</div></div>
The game selection screen is shown when no game is currently loaded -- it will display the last games you've played, along with a screenshot of the game at the point where you left off playing. The number of games shown depends on the window's size.
You can use this screen via the key bindings for player 1 - e.g press the d-pad to change selection, and the `A` button to start the game. You can also navigate the screen with your mouse -- use the arrows on each side of the screen to change game, and click on the game's screenshot to start playing.
<div class="clear"></div>
### Shortcut Keys ###
Mesen-S has a number of shortcut keys that you may find useful. All [shortcut keys](/configuration/preferences.html#shortcut-keys) can be customized in the [preferences](/configuration/preferences.html).
* <kbd>**Ctrl-O**</kbd>: Open a file
* <kbd>**Ctrl-R**</kbd>: Reset the game
* <kbd>**Escape**</kbd>: Pause/resume the game
* <kbd>**Alt-1 to Alt-6**</kbd>: Change the video scale.
* <kbd>**F1 to F7**</kbd>: Load save state in the corresponding slot.
* <kbd>**Shift-F1 to Shift-F7**</kbd>: Save a save state in the corresponding slot.
* <kbd>**Ctrl-S**</kbd>: Manually save a save state to a file.
* <kbd>**Ctrl-L**</kbd>: Manually load a save state from a file.
* <kbd>**Tab**</kbd>: Hold the tab key to fast forward the emulation (defaults to 300% speed)
* <kbd>**Backspace**</kbd>: Hold the backspace key to rewind the emulation, frame-by-frame.
{{% notice tip %}}
If you load a state, reset or power cycle by mistake, you can use the rewind feature to undo the action.
{{% /notice %}}
<div class="clear"></div>

View File

@ -0,0 +1,142 @@
---
title: Tools
weight: 3
chapter: false
---
<div class="imgBox right"><div>
<img src="/images/ToolsMenu.png" />
<span>Tools Menu</span>
</div></div>
## Netplay ##
### Hosting a game ###
<div class="imgBox"><div>
<img src="/images/NetplayHost.png" />
<span>Server Configuration</span>
</div></div>
**Server name**: This name will be shown to clients when they connect.
**Port**: The port used for the communication. Mesen-S will attempt to automatically port-forward this port on your router when you start the server -- if this fails, you will have to manually forward the port on your router to allow people outside of your LAN to connect to your server.
**Password** (optional): Any password entered here will need to be entered by clients when they try to connect -- can be left blank.
<div class="clear"></div>
### Connecting to a server ###
<div class="imgBox"><div>
<img src="/images/NetplayConnect.png" />
<span>Connect to...</span>
</div></div>
**Host**: The host name of the server you want to connect to. This is usually an IP address but can also be a domain name.
**Port**: The port to connect to -- this must match the `Port` value used by the server's host.
**Password** (optional): Enter the password the host has set for the server here -- can be left blank.
Once you are connected to a server, you can select your controller via the **<kbd>Tools&rarr;Netplay&rarr;Select Controller</kbd>** menu.
## Movies ##
<div class="imgBox"><div>
<img src="/images/MovieRecordingOptions.png" />
<span>Movie Recording Options</span>
</div></div>
`Movies` are files that can be created by Mesen-S and played back within Mesen-S itself. They are essentially a recording of the events that occurred during recording. To record an actual video file, see [Video Recorder](#video-recorder).
When you start recording, a configuration dialog is shown that allows you to select a number of options.
* **Save to**: The location where the movie will be saved. Press the **Browse** button to change it.
* **Record from**: Selects where the recording should start:
* **Power on**: This will reset the game and start recording from the start. Your save data (.sav files) will be excluded from the movie file - after the reset, you will start the game as if it had never been run yet.
* **Power on, with save data**: This will reset the game and start recording from the start. Your save data (.sav files, etc.) will be included in the movie file.
* **Current state**: This will start recording from the current state -- in this case, the movie file will contain a save state.
* **Author**: The movie's author (optional) - this will be saved in the movie file.
* **Description**: A description of the movie's content (optional) - this will be saved in the movie file.
To play a movie file, select it via the **<kbd>Tools&rarr;Movies&rarr;Play</kbd>** command.
## Cheats ##
<div class="imgBox"><div>
<img src="/images/CheatList.png" />
<span>Cheats Window</span>
</div></div>
Mesen-S supports cheats in Game Genie and Pro Action Replay formats.
It is also possible to import cheats from the built-in [Cheat Database](#cheat-database).
**To add a new cheat code**, click the `Add Cheat` button.
**To edit a cheat code**, double-click on it in the list.
**To delete a cheat code**, select it from the list and click the `Delete` button.
**To import cheats**, click the `Cheat Database` button.
**To disable a specific cheat**, uncheck it from the list.
**To disable all cheats**, check the `Disable all cheats` option.
<div class="clear"></div>
### Adding/Editing Cheats ###
<div class="imgBox"><div>
<img src="/images/EditCheat.png" />
<span>Edit Cheat</span>
</div></div>
You must give each cheat a name, which will be used to display it in the cheats list.
The `Codes` section lets you enter the actual cheat codes, in either Game Genie or Pro Action Replay format.
<div class="clear"></div>
### Cheat Database ###
<div class="imgBox"><div>
<img src="/images/CheatDbImport.png" />
<span>Import cheats from the built-in cheat database</span>
</div></div>
To import from the cheats database, click `Cheat Database`.
In the next dialog, select the game for which you want to import cheats. You can type in the `Search` bar at the top to filter the game list. Once you've selected a game, press OK -- this will import all cheats for that game into the cheats list. You can then manually enable any cheat you want to use.
By default, the game that is currently loaded will be selected for you. Having no game selected when the dialog opens indicates that there are no built-in cheats available for the game that is currently running.
## Sound Recorder ##
The sound recorder allows you to record uncompressed `.wav` files. The `.wav` file will use the exact same output settings as Mesen-S' [audio options](/configuration/audio.html) -- this means the sample rate will match the current sample rate, and that any sound modification (volume, panning, equalizer or effects) will also be applied to the `.wav` files.
To start recording, use the **<kbd>Tools&rarr;Sound Recorder&rarr;Record</kbd>** command.
To stop an on-going recording, use the **<kbd>Tools&rarr;Sound Recorder&rarr;Stop Recording</kbd>** command.
## Video Recorder ##
<div class="imgBox"><div>
<img src="/images/VideoRecording.png" />
<span>Video Recorder</span>
</div></div>
Much like the sound recorder, the video recorder allows you to record `.avi` files.
Before you start a recording, you can select where to save the `.avi` file and which video codec to use. All video codecs are lossless codecs -- the only reason to reduce the compression level to a lower level is to improve performance in the event your computer is having a hard time recording the video and running the emulation at its normal speed at the same time.
To start recording, use the **<kbd>Tools&rarr;Video Recorder&rarr;Record</kbd>** command.
To stop an on-going recording, use the **<kbd>Tools&rarr;Video Recorder&rarr;Stop Recording</kbd>** command.
## Log Window ##
<div class="imgBox"><div>
<img src="/images/LogWindow.png" />
<span>Log Window</span>
</div></div>
The Log Window displays various information -- mostly about the roms you load.
It is also sometimes used as a way to log errors or warnings.

331
Docs/static/css/custom.css Normal file
View File

@ -0,0 +1,331 @@
.blue { color: blue; }
.red { color: red; }
.green { color: green; }
.magenta { color: magenta; }
.gray { color: gray; }
a {
font-weight: 400;
}
@media (min-height: 700px) {
.donateButton {
text-align: center;
}
}
.donateButton {
width:100%;
margin-bottom: 10px;
}
#footer {
padding: 10px 15px 0 15px;
}
#search-by {
color: #fff !important;
}
#search-by::-moz-placeholder {
color: #eee !important;
opacity: 1 !important;
}
#search-by::-webkit-input-placeholder {
color: #eee !important;
opacity: 1 !important;
}
nav#TableOfContents {
max-height: initial;
}
.toc {
border: 1px solid #999;
background-color: #FCFCFC;
color: black;
display: inline-block;
position: relative;
overflow: hidden;
}
.toc > div {
position: relative;
left: -10px;
}
nav > ul > li:only-child,
nav > ul > li:only-child > ul > li:only-child,
nav > ul > li:only-child > ul > li:only-child > ul > li:only-child {
display: inline;
}
ul > li > ul:only-child {
position: relative;
left: -40px;
background-color: #FCFCFC;
}
.progress ul > li > ul:only-child {
left: 0px;
}
.toc > div[data-level="3"] {
position: relative;
left: -80px;
}
h2 {
clear: both;
font-size: 2rem;
border-bottom: 1px solid #DDD;
}
h3{
font-size: 1.5rem;
border-bottom: 1px solid #DDD;
}
h4{
font-size: 1.20rem;
border-bottom: 1px solid #DDD;
}
ul {
margin-top: 0.5rem;
margin-bottom: 0.75rem;
}
p {
margin-bottom: 0.5rem;
}
pre {
background-color: #F6F6F6;
border: 1px solid #DDD;
padding: 2px;
margin-top: 0 !important;
}
code + span.copy-to-clipboard {
display: none;
}
pre code {
color: #666;
}
.hljs {
background-color: #F6F6F6;
color: #666;
}
.hljs-subst, .hljs-variable, .hljs-template-tag, .hljs-template-variable{
color: #6a9e97
}
.hljs-attribute, .hljs-code, .hljs-selector-id {
color: #92649b
}
.hljs-comment {
color: #369635;
}
.hljs-title, .hljs-name {
color: #92649b;
}
pre .copy-to-clipboard {
background-color: #E9E9E9;
}
pre .copy-to-clipboard:hover {
background-color: #FFF;
}
.clear {
clear: both;
}
.imgBox {
clear:both;
float:right;
padding-left: 10px;
background: white;
z-index: 1;
position: relative;
}
.imgBox > div {
padding:5px;
border:1px solid #aaa;
background-color:#F9F9F9;
}
.imgBox > div img {
margin:0 !important;
border:1px solid #DDD;
}
.imgBox.inline {
float:none;
text-align: center;
}
.imgBox.inline > div {
display: inline-block;
}
@media (max-width: 1700px) {
.imgBox {
float:none;
text-align: center;
}
.imgBox > div {
display: inline-block;
}
}
section#shortcuts > h3 {
font-weight: bold !important;
color: #DDD !important;
}
.imgBox.right {
float:right;
}
.imgBox.right > div {
display:block;
}
@media (max-width: 1000px) {
#body #breadcrumbs {
width: 100%;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.3rem;
}
h4 {
font-size: 1.1rem;
}
.imgBox.right {
float:none;
text-align: center;
}
.imgBox.right > div {
display: inline-block;
}
}
.bmc-button img{
width: 27px !important;
margin-bottom: 1px !important;
box-shadow: none !important;
border: none !important;
vertical-align: middle !important;
}
.bmc-button{
line-height: 36px !important;
height:37px !important;
text-decoration: none !important;
display:inline-flex !important;
color:#000000 !important;
background-color:#FFDD00 !important;
border-radius: 3px !important;
border: 1px solid transparent !important;
padding: 0px 9px !important;
font-size: 17px !important;
letter-spacing:-0.08px !important;
box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;
-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
margin: 0 auto !important;
-webkit-box-sizing: border-box !important;
box-sizing: border-box !important;
-o-transition: 0.3s all linear !important;
-webkit-transition: 0.3s all linear !important;
-moz-transition: 0.3s all linear !important;
-ms-transition: 0.3s all linear !important;
transition: 0.3s all linear !important;
}
.bmc-button:hover, .bmc-button:active, .bmc-button:focus {
-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
text-decoration: none !important;
box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
opacity: 0.85 !important;
color:#000000 !important;
}
@media (max-height: 700px) {
.bmc-button{
line-height: 22px !important;
height:25px !important;
padding: 0 4px 0 0 !important;
}
}
nav#sidebar > div.highlightable {
display: flex;
width: 100%;
flex-direction: column;
}
nav#sidebar > div.highlightable > ul.topics {
flex: 0 0 auto;
}
nav#sidebar > div.highlightable > section#shortcuts {
flex: 0 0 auto;
}
nav#sidebar > div.highlightable > section#footer {
flex: 0 0 auto;
}
div#menuspacer {
flex: 1 0 auto;
}
nav#sidebar {
display: flex;
flex-direction: column;
}
div#header-wrapper {
flex: 0 0 auto;
background: #682103 !important;
border-color: #682103 !important;
}
#sidebar .searchbox {
background: #682103 !important;
border-color: #923404 !important;
}
#sidebar .searchbox *,
#sidebar a {
color: #e2ad26 !important;
}
a {
color: #b74005 !important;
}
#sidebar {
background: #333 !important;
}
nav#sidebar > div.highlightable {
flex: 1 0 auto;
}
@supports (-ms-ime-align: auto) {
nav#sidebar,
section#body {
transition: none;
}
}
code {
white-space: normal;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,71 @@
<svg width="25" height="22" viewBox="0 0 25 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Group</title>
<desc>Created using Figma</desc>
<g id="Canvas" transform="translate(-5180 -696)">
<g id="Group">
<g id="Combined Shape">
<use xlink:href="#path0_fill" transform="translate(5201.49 697.468)" fill="#FFFFFF"/>
</g>
<g id="Logo">
<g id="Fill 1">
<use xlink:href="#path1_fill" transform="translate(5188.19 700.863)" fill="#FF9100"/>
</g>
<g id="Fill 2">
<use xlink:href="#path2_fill" transform="translate(5188.19 700.863)" fill="#FFDD00"/>
</g>
<g id="Fill 3">
<use xlink:href="#path3_fill" transform="translate(5186.75 699.413)" fill="#FFFFFF"/>
</g>
<g id="Stroke 4">
<use xlink:href="#path4_stroke" transform="translate(5186.75 699.413)"/>
</g>
<g id="Fill 6">
<use xlink:href="#path5_fill" transform="translate(5188.24 697.056)" fill="#FFFFFF"/>
</g>
<g id="Group 11">
<g id="Stroke 7">
<use xlink:href="#path6_stroke" transform="translate(5188.24 697.056)" fill="#050505"/>
</g>
<g id="Stroke 9">
<use xlink:href="#path7_stroke" transform="translate(5187.29 700.863)"/>
</g>
</g>
<g id="Fill 12">
<use xlink:href="#path8_fill" transform="translate(5187.07 705.304)" fill="#FFFFFF"/>
</g>
<g id="Stroke 13">
<use xlink:href="#path9_stroke" transform="translate(5187.07 705.304)"/>
</g>
</g>
<g id="Oval" opacity="0.2">
<mask id="mask0_outline_ins">
<use xlink:href="#path10_fill" fill="white" transform="translate(5180.65 701.166)"/>
</mask>
<g mask="url(#mask0_outline_ins)">
<use xlink:href="#path11_stroke_2x" transform="translate(5180.65 701.166)" fill="#FFFFFF"/>
</g>
</g>
<g id="Oval" opacity="0.2">
<use xlink:href="#path12_fill" transform="translate(5200.84 707.692)" fill="#FFFFFF"/>
</g>
<g id="Oval">
<use xlink:href="#path12_fill" transform="translate(5184.56 712.696)" fill="#FFFFFF"/>
</g>
</g>
</g>
<defs>
<path id="path0_fill" fill-rule="evenodd" d="M 1.11914 0.172241C 1.02246 0.272827 0.962891 0.409363 0.962891 0.559753L 0.962891 0.962952L 0.55957 0.962952C 0.250488 0.962952 0 1.21356 0 1.52277C 0 1.83191 0.250488 2.08252 0.55957 2.08252L 0.962891 2.08252L 0.962891 2.48566C 0.962891 2.7948 1.21338 3.04547 1.52246 3.04547C 1.83203 3.04547 2.08252 2.7948 2.08252 2.48566L 2.08252 2.08252L 2.48584 2.08252C 2.79492 2.08252 3.04541 1.83191 3.04541 1.52277C 3.04541 1.21356 2.79492 0.962952 2.48584 0.962952L 2.08252 0.962952L 2.08252 0.559753C 2.08252 0.25061 1.83203 0 1.52246 0C 1.36377 0 1.2207 0.06604 1.11914 0.172241Z"/>
<path id="path1_fill" fill-rule="evenodd" d="M 5.02978 0.0305451L 0 0L 2.46998 15.7258L 3.00889 15.7258L 7.94885 15.7258L 8.48776 15.7258L 10.9577 0L 5.02978 0.0305451Z"/>
<path id="path2_fill" fill-rule="evenodd" d="M 5.02978 0.0305451L 0 0L 2.46998 15.7258L 3.00889 15.7258L 6.69141 15.7258L 7.23031 15.7258L 9.7003 0L 5.02978 0.0305451Z"/>
<path id="path3_fill" fill-rule="evenodd" d="M 0 1.45021L 12.9786 1.45021L 12.9786 0L 0 0L 0 1.45021Z"/>
<path id="path4_stroke" d="M 0 1.45021L -0.440282 1.45021L -0.440282 1.8905L 0 1.8905L 0 1.45021ZM 12.9786 1.45021L 12.9786 1.8905L 13.4189 1.8905L 13.4189 1.45021L 12.9786 1.45021ZM 12.9786 0L 13.4189 0L 13.4189 -0.440282L 12.9786 -0.440282L 12.9786 0ZM 0 0L 0 -0.440282L -0.440282 -0.440282L -0.440282 0L 0 0ZM 0 1.8905L 12.9786 1.8905L 12.9786 1.00993L 0 1.00993L 0 1.8905ZM 13.4189 1.45021L 13.4189 0L 12.5384 0L 12.5384 1.45021L 13.4189 1.45021ZM 12.9786 -0.440282L 0 -0.440282L 0 0.440282L 12.9786 0.440282L 12.9786 -0.440282ZM -0.440282 0L -0.440282 1.45021L 0.440282 1.45021L 0.440282 0L -0.440282 0Z"/>
<path id="path5_fill" fill-rule="evenodd" d="M 8.98176 0L 5.88305 0L 4.04179 0L 0.943084 0L 0 2.17532L 4.04179 2.17532L 5.88305 2.17532L 9.92484 2.17532L 8.98176 0Z"/>
<path id="path6_stroke" d="M 8.98176 0L 9.38571 -0.175129L 9.27076 -0.440282L 8.98176 -0.440282L 8.98176 0ZM 0.943084 0L 0.943084 -0.440282L 0.654085 -0.440282L 0.539131 -0.175129L 0.943084 0ZM 0 2.17532L -0.403953 2.00019L -0.670758 2.6156L 0 2.6156L 0 2.17532ZM 9.92484 2.17532L 9.92484 2.6156L 10.5956 2.6156L 10.3288 2.00019L 9.92484 2.17532ZM 8.98176 -0.440282L 5.88305 -0.440282L 5.88305 0.440282L 8.98176 0.440282L 8.98176 -0.440282ZM 5.88305 -0.440282L 4.04179 -0.440282L 4.04179 0.440282L 5.88305 0.440282L 5.88305 -0.440282ZM 4.04179 -0.440282L 0.943084 -0.440282L 0.943084 0.440282L 4.04179 0.440282L 4.04179 -0.440282ZM 0.539131 -0.175129L -0.403953 2.00019L 0.403953 2.35045L 1.34704 0.175129L 0.539131 -0.175129ZM 0 2.6156L 4.04179 2.6156L 4.04179 1.73504L 0 1.73504L 0 2.6156ZM 4.04179 2.6156L 5.88305 2.6156L 5.88305 1.73504L 4.04179 1.73504L 4.04179 2.6156ZM 5.88305 2.6156L 9.92484 2.6156L 9.92484 1.73504L 5.88305 1.73504L 5.88305 2.6156ZM 10.3288 2.00019L 9.38571 -0.175129L 8.5778 0.175129L 9.52089 2.35045L 10.3288 2.00019Z"/>
<path id="path7_stroke" d="M 5.92796 0.0305451L 5.92569 0.470845L 5.93023 0.470821L 5.92796 0.0305451ZM 0 0L 0.00226862 -0.440276L -0.515251 -0.442943L -0.43495 0.0683159L 0 0ZM 2.46998 15.7258L 2.03503 15.7941L 2.09346 16.166L 2.46998 16.166L 2.46998 15.7258ZM 9.38594 15.7258L 9.38594 16.166L 9.76246 16.166L 9.82089 15.7941L 9.38594 15.7258ZM 11.8559 0L 12.2909 0.0683159L 12.3712 -0.442943L 11.8537 -0.440276L 11.8559 0ZM 5.93023 -0.409731L 0.00226862 -0.440276L -0.00226862 0.440276L 5.92569 0.470821L 5.93023 -0.409731ZM -0.43495 0.0683159L 2.03503 15.7941L 2.90493 15.6574L 0.43495 -0.0683159L -0.43495 0.0683159ZM 2.46998 16.166L 3.00889 16.166L 3.00889 15.2855L 2.46998 15.2855L 2.46998 16.166ZM 3.00889 16.166L 8.84703 16.166L 8.84703 15.2855L 3.00889 15.2855L 3.00889 16.166ZM 8.84703 16.166L 9.38594 16.166L 9.38594 15.2855L 8.84703 15.2855L 8.84703 16.166ZM 9.82089 15.7941L 12.2909 0.0683159L 11.421 -0.0683159L 8.95099 15.6574L 9.82089 15.7941ZM 11.8537 -0.440276L 5.92569 -0.409731L 5.93023 0.470821L 11.8582 0.440276L 11.8537 -0.440276Z"/>
<path id="path8_fill" fill-rule="evenodd" d="M 12.2601 0L 6.34287 0L 5.91723 0L 0 0L 1.10682 6.25405L 6.13005 6.19953L 11.1533 6.25405L 12.2601 0Z"/>
<path id="path9_stroke" d="M 12.2601 0L 12.6936 0.0767275L 12.7851 -0.440282L 12.2601 -0.440282L 12.2601 0ZM 0 0L 0 -0.440282L -0.525044 -0.440282L -0.433545 0.0767275L 0 0ZM 1.10682 6.25405L 0.673277 6.33077L 0.73833 6.69835L 1.1116 6.6943L 1.10682 6.25405ZM 6.13005 6.19953L 6.13483 5.75917L 6.12527 5.75927L 6.13005 6.19953ZM 11.1533 6.25405L 11.1485 6.6943L 11.5218 6.69835L 11.5868 6.33077L 11.1533 6.25405ZM 12.2601 -0.440282L 6.34287 -0.440282L 6.34287 0.440282L 12.2601 0.440282L 12.2601 -0.440282ZM 6.34287 -0.440282L 5.91723 -0.440282L 5.91723 0.440282L 6.34287 0.440282L 6.34287 -0.440282ZM 5.91723 -0.440282L 0 -0.440282L 0 0.440282L 5.91723 0.440282L 5.91723 -0.440282ZM -0.433545 0.0767275L 0.673277 6.33077L 1.54037 6.17732L 0.433545 -0.0767275L -0.433545 0.0767275ZM 1.1116 6.6943L 6.13483 6.63978L 6.12527 5.75927L 1.10204 5.81379L 1.1116 6.6943ZM 6.12527 6.63978L 11.1485 6.6943L 11.1581 5.81379L 6.13483 5.75927L 6.12527 6.63978ZM 11.5868 6.33077L 12.6936 0.0767275L 11.8266 -0.0767275L 10.7197 6.17732L 11.5868 6.33077Z"/>
<path id="path10_fill" fill-rule="evenodd" d="M 1.845 3.69804C 2.86397 3.69804 3.69001 2.87021 3.69001 1.84902C 3.69001 0.827835 2.86397 0 1.845 0C 0.826036 0 0 0.827835 0 1.84902C 0 2.87021 0.826036 3.69804 1.845 3.69804Z"/>
<path id="path11_stroke_2x" d="M 1.845 5.11673C 3.6504 5.11673 5.10869 3.65082 5.10869 1.84902L 2.27132 1.84902C 2.27132 2.0896 2.07754 2.27936 1.845 2.27936L 1.845 5.11673ZM 5.10869 1.84902C 5.10869 0.0472286 3.6504 -1.41869 1.845 -1.41869L 1.845 1.41869C 2.07754 1.41869 2.27132 1.60844 2.27132 1.84902L 5.10869 1.84902ZM 1.845 -1.41869C 0.0396073 -1.41869 -1.41869 0.0472286 -1.41869 1.84902L 1.41869 1.84902C 1.41869 1.60844 1.61246 1.41869 1.845 1.41869L 1.845 -1.41869ZM -1.41869 1.84902C -1.41869 3.65082 0.0396073 5.11673 1.845 5.11673L 1.845 2.27936C 1.61246 2.27936 1.41869 2.0896 1.41869 1.84902L -1.41869 1.84902Z"/>
<path id="path12_fill" fill-rule="evenodd" d="M 0.868237 1.74026C 1.34775 1.74026 1.73647 1.35069 1.73647 0.870128C 1.73647 0.38957 1.34775 0 0.868237 0C 0.388723 0 0 0.38957 0 0.870128C 0 1.35069 0.388723 1.74026 0.868237 1.74026Z"/>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show More