#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language finnish
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Hakusana
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Section
Introduction
\end_layout

\begin_layout Standard
lsnes is SNES rerecording emulator based on bsnes core.
\end_layout

\begin_layout Section
Dependencies
\end_layout

\begin_layout Enumerate
bsnes libsnes
\end_layout

\begin_deeper
\begin_layout Enumerate
v084 or 085
\end_layout

\begin_layout Enumerate
accuracy or compatiblity core.
\end_layout

\begin_layout Enumerate
Patched version (using included 6 patches)
\end_layout

\end_deeper
\begin_layout Enumerate
Zlib
\end_layout

\begin_layout Enumerate
boost_iostreams
\end_layout

\begin_layout Enumerate
boost_filesystem
\end_layout

\begin_layout Enumerate
boost_thread
\end_layout

\begin_layout Enumerate
libsdl (SDL only)
\end_layout

\begin_layout Enumerate
sdlmain (SDL only, part of SDL)
\end_layout

\begin_layout Enumerate
boost_conversion (this is header-only library)
\end_layout

\begin_layout Enumerate
libswscale (wxwidgets graphics only)
\end_layout

\begin_layout Enumerate
Portaudio (portaudio sound only)
\end_layout

\begin_layout Enumerate
std::thread and co (for threaded dumper only, not needed if std::thread
 is available)
\end_layout

\begin_layout Enumerate
Lua (if Lua support is needed).
\end_layout

\begin_layout Itemize
Version 5.1.X or 5.2X.
\end_layout

\begin_layout Section
Building
\end_layout

\begin_layout Standard
Building is via makefile, the following options are available:
\end_layout

\begin_layout Itemize
CROSS_PREFIX=<prefix>
\end_layout

\begin_deeper
\begin_layout Itemize
Prefix to apply to commands when building executables / object files for
 the target architecture.
 
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
CC=<name>
\end_layout

\begin_deeper
\begin_layout Itemize
Name of C++ compiler.
\end_layout

\begin_layout Itemize
CROSS_PREFIX is prepended if compiling for target architecture.
\end_layout

\begin_layout Itemize
This needs to be at least GCC 4.6.
\end_layout

\begin_layout Itemize
Set to 'g++-mp-4.6' if compiling on Mac OS X using GCC 4.6 from Macports.
\end_layout

\begin_layout Itemize
Default is 'g++'.
\end_layout

\end_deeper
\begin_layout Itemize
HOSTCC=<name>
\end_layout

\begin_deeper
\begin_layout Itemize
Name of host C++ compiler.
\end_layout

\begin_layout Itemize
Default is value of 'CC' option.
\end_layout

\end_deeper
\begin_layout Itemize
USER_HOSTCCFLAGS=<flags>:
\end_layout

\begin_deeper
\begin_layout Itemize
Compiler flags to pass when compiling/linking for host architecture.
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
USER_CFLAGS=<flags>
\end_layout

\begin_deeper
\begin_layout Itemize
Extra flags to pass when compiling for target architecture
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
USER_LDFLAGS=<flags>: 
\end_layout

\begin_deeper
\begin_layout Itemize
Extra flags to pass when linking for target architecture.
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
USER_PLATFORM_CFLAGS=<flags>
\end_layout

\begin_deeper
\begin_layout Itemize
Extra flags to pass when compiling files using platform-dependent code for
 target architecture.
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
USER_PLATFORM_LDFLAGS=<flags>
\end_layout

\begin_deeper
\begin_layout Itemize
Extra flags to pass when linking files using platform-dependent code for
 target architecture.
\end_layout

\begin_layout Itemize
Default is blank.
\end_layout

\end_deeper
\begin_layout Itemize
FONT_SRC=<file>
\end_layout

\begin_deeper
\begin_layout Itemize
Set the font file to use.
\end_layout

\begin_layout Itemize
Currently the valid values are:
\end_layout

\begin_deeper
\begin_layout Itemize
cp437.hex: Standard VGA font (256 characters).
\end_layout

\begin_layout Itemize
unifontfull-5.1.20080820.hex: GNU unifont (covers most of Unicode BMP)
\end_layout

\end_deeper
\begin_layout Itemize
Default is 'unifontfull-5.1.20080820.hex'
\end_layout

\end_deeper
\begin_layout Itemize
LUA=<package>
\end_layout

\begin_deeper
\begin_layout Itemize
Package to use for Lua support.
\end_layout

\begin_layout Itemize
Usually valid value is 'lua' or 'lua5.1'.
\end_layout

\begin_layout Itemize
Default is not to build Lua support.
\end_layout

\end_deeper
\begin_layout Itemize
THREADS=<value>
\end_layout

\begin_deeper
\begin_layout Itemize
Override platform default for dumper threading support.
\end_layout

\begin_layout Itemize
Threading is default on Linux.
\end_layout

\begin_layout Itemize
'YES' tries to use threading (std::thread).
\end_layout

\begin_layout Itemize
'BOOST' tries to use threading (boost::thread).
\end_layout

\begin_layout Itemize
'NO' disables threading.
\end_layout

\begin_layout Itemize
Note: This has absolutely nothing to do with platform threading.
\end_layout

\end_deeper
\begin_layout Itemize
BSNES_IS_COMPAT=<anything>
\end_layout

\begin_deeper
\begin_layout Itemize
Signals that BSNES core used is compatiblity core, not accuracy core.
\end_layout

\begin_layout Itemize
Default is to assume accuracy core.
\end_layout

\end_deeper
\begin_layout Itemize
JOYSTICK=<implementation>
\end_layout

\begin_deeper
\begin_layout Itemize
Set joystick implementation.
 Valid values are:
\end_layout

\begin_deeper
\begin_layout Itemize
SDL: Use SDL for joystick (requires SDL graphics)
\end_layout

\begin_layout Itemize
EVDEV: Use EVDEV for joystick (Linux only).
\end_layout

\begin_layout Itemize
DUMMY: Disable joystick support.
\end_layout

\end_deeper
\begin_layout Itemize
Default is SDL.
\end_layout

\end_deeper
\begin_layout Itemize
SOUND=<implementation>
\end_layout

\begin_deeper
\begin_layout Itemize
Set sound implementation.
 Valid values are:
\end_layout

\begin_deeper
\begin_layout Itemize
SDL: Use SDL for sound (requires SDL graphics)
\end_layout

\begin_layout Itemize
PORTAUDIO: Use Portaudio for sound.
\end_layout

\begin_layout Itemize
DUMMY: Disable sound support
\end_layout

\end_deeper
\begin_layout Itemize
Default is SDL.
\end_layout

\end_deeper
\begin_layout Itemize
GRAPHICS=<implementation>
\end_layout

\begin_deeper
\begin_layout Itemize
Set windowing library to use.
 Valid values are:
\end_layout

\begin_deeper
\begin_layout Itemize
SDL: Use SDL for graphics
\end_layout

\begin_layout Itemize
WXWIDGETS: Use wxWidgets for graphics.
\end_layout

\end_deeper
\begin_layout Itemize
Default is SDL.
\end_layout

\end_deeper
\begin_layout Section
Command line options
\end_layout

\begin_layout Subsection
ROM options
\end_layout

\begin_layout Standard
<kind> in the following can be one of:
\end_layout

\begin_layout Itemize
rom: Cartridge ROM (BIOS for special carts).
 This is required.
\end_layout

\begin_layout Itemize
bsx: BS-X (non-slotted) Game flash ROM.
\end_layout

\begin_layout Itemize
bsxslotted: BS-X (slotted) Game flash ROM.
\end_layout

\begin_layout Itemize
dmg: DMG game ROM
\end_layout

\begin_layout Itemize
slot-a: Sufami Turbo Slot A ROM
\end_layout

\begin_layout Itemize
slot-b: Sufami Turbo Slot B ROM
\end_layout

\begin_layout Subsubsection
--<kind>=<file> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Load <file> as specified ROM (SFC/BS/DMG/ST file format).
\end_layout

\begin_layout Subsubsection
--headered-<kind>=<file> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Load <file> as specified ROM, stripping first 512 bytes.
 Handy for loading SMC / FIG and such files.
\end_layout

\begin_layout Subsubsection
--<kind>-xml=<file> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Override hardware detection for ROM, reading the values from <file> (BSNES
 XML format).
\end_layout

\begin_layout Subsubsection
--ips-<kind>=<file> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Apply BPS/IPS patch <file> to ROM <kind>.
 If specified multiple times, the patches are applied in order.
\end_layout

\begin_layout Subsubsection
--ips-<kind>-xml=<file> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Apply BPS/IPS patch <file> to XML of ROM <kind>.
 If specified multiple times, the patches are applied in order.
\end_layout

\begin_layout Subsubsection
--ips-offset=<offset> (lsnes/SDL, lsnes-avidump)
\end_layout

\begin_layout Standard
Set offset to apply to IPS patches.
 May be negative.
 Handy for applying headered IPS patches (use offset of -512 for this).
 The offset must be 0 for BPS patches.
\end_layout

\begin_layout Subsubsection
--pal
\end_layout

\begin_layout Standard
Force ROM to be considered PAL-only.
\end_layout

\begin_layout Itemize
Only works on SNES and SGB ROMs (not BS-X or Sufami Turbo).
\end_layout

\begin_layout Itemize
Attempting to load NTSC movie file will error out.
\end_layout

\begin_layout Subsubsection
--ntsc
\end_layout

\begin_layout Standard
Force ROM to be considered NTSC-only.
\end_layout

\begin_layout Itemize
Attempting to load PAL movie file will error out.
\end_layout

\begin_layout Subsection
Session options
\end_layout

\begin_layout Subsubsection
<filename> (lsnes/SDL, lsnes-avidump, movieinfo)
\end_layout

\begin_layout Standard
Load <filename> as movie or savestate file.
 All other session options are ignored.
\end_layout

\begin_layout Subsubsection
--port1=<device> (lsnes/SDL)
\end_layout

\begin_layout Standard
Set type of port1.
 Valid values are:
\end_layout

\begin_layout Itemize
none: No device connected
\end_layout

\begin_layout Itemize
gamepad: One gamepad (the default)
\end_layout

\begin_layout Itemize
multitap: Four gamepads (warning: makes most games refuse to start)
\end_layout

\begin_layout Itemize
mouse: Mouse.
\end_layout

\begin_layout Subsubsection
--port2=<type> (lsnes/SDL)
\end_layout

\begin_layout Standard
Set type of port2.
 Valid values are:
\end_layout

\begin_layout Itemize
none: No device connected (the default)
\end_layout

\begin_layout Itemize
gamepad: One gamepad
\end_layout

\begin_layout Itemize
multitap: Four gamepads.
\end_layout

\begin_layout Itemize
mouse: Mouse
\end_layout

\begin_layout Itemize
superscope: Super Scope
\end_layout

\begin_layout Itemize
justifier: One justifier
\end_layout

\begin_layout Itemize
justifiers: Two justifiers
\end_layout

\begin_layout Subsubsection
--gamename=<name> (lsnes/SDL)
\end_layout

\begin_layout Standard
Set the name of game to <name>.
 Default is blank.
\end_layout

\begin_layout Subsubsection
--author=<name> (lsnes/SDL)
\end_layout

\begin_layout Standard
Add author with full name of <name> (no nickname).
\end_layout

\begin_layout Subsubsection
--author=|<name> (lsnes/SDL)
\end_layout

\begin_layout Standard
Add author with nickname of <name> (no full name).
\end_layout

\begin_layout Subsubsection
--author=<fullname>|<nickname> (lsnes/SDL)
\end_layout

\begin_layout Standard
Add author with full name of <fullname> and nickname of <nickname>.
\end_layout

\begin_layout Subsubsection
--rtc-second=<value> (lsnes/SDL)
\end_layout

\begin_layout Standard
Set RTC second (0 is 1st January 1970 00:00:00Z).
 Default is 1,000,000,000.
\end_layout

\begin_layout Subsubsection
--rtc-subsecond=<value> (lsnes/SDL)
\end_layout

\begin_layout Standard
Set RTC subsecond.
 Range is 0-.
 Unit is CPU cycle.
 Default is 0.
\end_layout

\begin_layout Subsection
Misc.
 options:
\end_layout

\begin_layout Subsubsection
--run=<file> (lsnes/SDL)
\end_layout

\begin_layout Standard
After running main RC file, run this file.
 If multiple are specified, these execute in order specified.
\end_layout

\begin_layout Subsection
dump options (lsnes-dumpavi only)
\end_layout

\begin_layout Subsubsection
--prefix=<prefix>
\end_layout

\begin_layout Standard
Set dump prefix.
 Default is 
\begin_inset Quotes eld
\end_inset

avidump
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsubsection
--level=<level>
\end_layout

\begin_layout Standard
Set compression level (0-18).
 Default is 7.
\end_layout

\begin_layout Subsubsection
--length=<length>
\end_layout

\begin_layout Standard
Set number of frames to dump.
 Mandatory.
\end_layout

\begin_layout Subsubsection
--lua=<script>
\end_layout

\begin_layout Standard
Run specified lua script (lsnes-dumpavi does not have initialization files).
\end_layout

\begin_layout Subsubsection
--jmd
\end_layout

\begin_layout Standard
Use JMD dumping instead of AVI dumping.
\end_layout

\begin_layout Subsubsection
--sdmp
\end_layout

\begin_layout Standard
Use SDMP dumping instead of AVI dumping.
\end_layout

\begin_layout Subsubsection
--ss
\end_layout

\begin_layout Standard
Dump in single segment (SDMP only).
\end_layout

\begin_layout Section
Startup file lsnes.rc
\end_layout

\begin_layout Standard
Upon startup, lsnes (lsnes/SDL only) executes file lsnes.rc as commands.
 This file is located in:
\end_layout

\begin_layout Itemize
Windows: %APPDATA%
\backslash
lsnes
\backslash
lsnes.rc (if %APPDATA% exists)
\end_layout

\begin_layout Itemize
Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
\end_layout

\begin_layout Itemize
Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
\end_layout

\begin_layout Itemize
All: ./lsnes.rc (fallback default).
\end_layout

\begin_layout Standard
If leading directories do not exist, attempt to create them is made.
\end_layout

\begin_layout Section
Internal commands
\end_layout

\begin_layout Itemize
Commands beginning with '*' invoke the corresponding command without alias
 expansion.
\end_layout

\begin_layout Itemize
If command starts with '+' (after possible '*'), the command is executed
 as-is when button is pressed, and when button is released, it is executed
 with '+' replaced by '-'.
\end_layout

\begin_layout Itemize
Commands without '+' execute only on negative edge (release).
\end_layout

\begin_layout Subsection
Settings:
\end_layout

\begin_layout Standard
Settings control various aspects of emulator behaviour.
\end_layout

\begin_layout Subsubsection
set-setting <setting> <value>
\end_layout

\begin_layout Standard
Sets setting <setting> to value <value> (may be empty).
\end_layout

\begin_layout Subsubsection
unset-setting <setting>
\end_layout

\begin_layout Standard
Try to unset setting <setting> (not all settings can be unset).
\end_layout

\begin_layout Subsubsection
get-setting <setting>
\end_layout

\begin_layout Standard
Read value of setting <setting>
\end_layout

\begin_layout Subsubsection
show-settings
\end_layout

\begin_layout Standard
Print names and values of all settings.
\end_layout

\begin_layout Subsection
Keybindings
\end_layout

\begin_layout Standard
Keybindings bind commands or aliases to keys (or pseudo-keys).
 
\end_layout

\begin_layout Standard
Notes:
\end_layout

\begin_layout Itemize
Do not bind edge active (+/-) commands to keys with modifiers, that won't
 work right!
\end_layout

\begin_layout Itemize
Names of keys and modifiers are platform-dependent.
\end_layout

\begin_layout Itemize
Be careful before binding pseudo-keys (such as joystick axes, buttons or
 hats) with modifiers.
 That may or may not work right.
\end_layout

\begin_layout Subsubsection
bind-key [<mod>/<modmask>] <key> <command>
\end_layout

\begin_layout Standard
Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
ed list) are set as <mod> (comma-seperated list).
\end_layout

\begin_layout Standard
The names of keys and modifiers are platform-dependent.
\end_layout

\begin_layout Subsubsection
unbind-key [<mod>/<modmask>] <key>
\end_layout

\begin_layout Standard
Unbind command from <key> (with specified <mod> and <modmask>).
\end_layout

\begin_layout Subsubsection
set-axis <axis> [disabled | axis | axis-inverse | pressure0- | pressure0+
 | pressure-0 | pressure-+ | pressure+0 | pressure+-] [minus=<val>] [zero=<val>]
 [plus=<val>] [tolerance=<val>]
\end_layout

\begin_layout Standard
Set axis parameters for axis <axis>.
\end_layout

\begin_layout Itemize
disabled: Disable axis
\end_layout

\begin_layout Itemize
axis: Normal axis
\end_layout

\begin_layout Itemize
axis-inverse: Inverse axis
\end_layout

\begin_layout Itemize
pressure0-: Pressure sensitive.
 Released at 0, pressed at -.
\end_layout

\begin_layout Itemize
pressure0+: Pressure sensitive.
 Released at 0, pressed at +.
\end_layout

\begin_layout Itemize
pressure-0: Pressure sensitive.
 Released at -, pressed at 0.
\end_layout

\begin_layout Itemize
pressure-+: Pressure sensitive.
 Released at -, pressed at +.
\end_layout

\begin_layout Itemize
pressure+0: Pressure sensitive.
 Released at +, pressed at 0.
\end_layout

\begin_layout Itemize
pressure+-: Pressure sensitive.
 Released at +, pressed at -.
\end_layout

\begin_layout Itemize
minus=<val>: Calibration at extreme minus position (-32768-32767)
\end_layout

\begin_layout Itemize
zero=<val>: Calibration at neutral position (-32768-32767)
\end_layout

\begin_layout Itemize
plus=<val>: Calibration at extreme plus position (-32768-32767)
\end_layout

\begin_layout Itemize
tolerance=<value>: Center band tolerance (0<x<1).
 The smaller the value, the more sensitive the control is.
\end_layout

\begin_layout Subsubsection
show-bindings
\end_layout

\begin_layout Standard
Print all key bindings in effect.
\end_layout

\begin_layout Subsection
Aliases
\end_layout

\begin_layout Standard
Aliases bind command to sequence of commands.
 After alias has been defined, it replaces the command it shadows.
\end_layout

\begin_layout Standard
Notes:
\end_layout

\begin_layout Itemize
You can't alias command to itself.
\end_layout

\begin_layout Itemize
Aliases starting with +/- are edge active just like ordinary commands starting
 with +/-.
\end_layout

\begin_layout Itemize
One command can be aliased to multiple commands.
\end_layout

\begin_layout Subsubsection
alias-command <command> <expansion>
\end_layout

\begin_layout Standard
Append <expansion> to alias <command>.
 If alias does not already exist, it is created.
\end_layout

\begin_layout Subsubsection
unalias-command <command>
\end_layout

\begin_layout Standard
Clear alias expansion for <command>.
\end_layout

\begin_layout Subsubsection
show-aliases
\end_layout

\begin_layout Standard
Print all aliases and their expansions in effect.
\end_layout

\begin_layout Subsection
run-script <script>
\end_layout

\begin_layout Standard
Run <script> as if commands were entered on the command line.
\end_layout

\begin_layout Subsection
Video dumping
\end_layout

\begin_layout Standard
Following commands control video dumping:
\end_layout

\begin_layout Subsubsection
dump-avi <prefix>
\end_layout

\begin_layout Standard
Dump AVI video to prefix <prefix> Notes:
\end_layout

\begin_layout Itemize
The codec is Camstudio Codec in gzip mode.
\end_layout

\begin_layout Itemize
Encoder and muxer are internal, available on all platforms.
\end_layout

\begin_layout Itemize
Audio enable/disable and framerate has no effect.
\end_layout

\begin_layout Itemize
The audio dumped to .avi is low-quality version.
 The high-quality version is dumped to .sox file.
\end_layout

\begin_layout Subsubsection
end-avi
\end_layout

\begin_layout Standard
End current AVI video dump (closing the emulator also closes the dump).
\end_layout

\begin_layout Subsubsection
dump-jmd <file>
\end_layout

\begin_layout Standard
Dump JMD video to file <file>.
\end_layout

\begin_layout Subsubsection
end-jmd
\end_layout

\begin_layout Standard
End the current JMD dump in progress.
\end_layout

\begin_layout Subsubsection
dump-sdmp <prefix>
\end_layout

\begin_layout Standard
Dump SDMP to <prefix>, splitting at 2GB.
\end_layout

\begin_layout Subsubsection
dump-sdmp-ss <file>
\end_layout

\begin_layout Standard
Dump SDMP to <file>, no splitting
\end_layout

\begin_layout Subsubsection
end-sdmp
\end_layout

\begin_layout Standard
End the current SDMP dump in progress.
\end_layout

\begin_layout Subsection
Memory manipulation
\end_layout

\begin_layout Standard
<address> may be decimal or hexadecimal (prefixed with '0x').
 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
 with '-') decimal.
\end_layout

\begin_layout Standard
The available element <sizes> are:
\end_layout

\begin_layout Itemize
byte: 1 byte
\end_layout

\begin_layout Itemize
word: 2 bytes
\end_layout

\begin_layout Itemize
dword: 4 bytes
\end_layout

\begin_layout Itemize
qword: 8 bytes
\end_layout

\begin_layout Standard
When reading RAM and ROM, multi-byte reads/writes are big-endian.
 When dealing with DSP memory, multi-byte reads/writes are native-endian
 (do not use operand sizes exceeding DSP bitness, except dword is OK for
 24-bit memory).
\end_layout

\begin_layout Subsubsection
read-<size> <address>
\end_layout

\begin_layout Standard
Read the value of byte in <address>.
\end_layout

\begin_layout Subsubsection
read-s<size> <address>
\end_layout

\begin_layout Standard
Read the value of signed byte in <address>.
\end_layout

\begin_layout Subsubsection
write-<size> <address> <value>
\end_layout

\begin_layout Standard
Write <value> to byte in address <address>.
\end_layout

\begin_layout Subsubsection
search-memory reset
\end_layout

\begin_layout Standard
Reset the memory search
\end_layout

\begin_layout Subsubsection
search-memory count
\end_layout

\begin_layout Standard
Print number of candidates remaining
\end_layout

\begin_layout Subsubsection
search-memory print
\end_layout

\begin_layout Standard
Print all candidates remaining
\end_layout

\begin_layout Subsubsection
search-memory <usflag><sizeflag><op>
\end_layout

\begin_layout Standard
Searches memory for addresses satisfying criteria.
\end_layout

\begin_layout Standard
<usflag> can be:
\end_layout

\begin_layout Itemize
u: unsigned
\end_layout

\begin_layout Itemize
s: signed
\end_layout

\begin_layout Standard
<sizeflag> can be:
\end_layout

\begin_layout Itemize
b: byte
\end_layout

\begin_layout Itemize
w: word
\end_layout

\begin_layout Itemize
d: dword
\end_layout

\begin_layout Itemize
q: qword
\end_layout

\begin_layout Standard
<op> can be:
\end_layout

\begin_layout Itemize
lt: < previous value.
\end_layout

\begin_layout Itemize
le: <= previous value.
\end_layout

\begin_layout Itemize
eq: = previous value.
\end_layout

\begin_layout Itemize
ne: != previous value.
\end_layout

\begin_layout Itemize
ge: >= previous value.
\end_layout

\begin_layout Itemize
gt: > previous value.
\end_layout

\begin_layout Subsubsection
search-memory <sizeflag> <value>
\end_layout

\begin_layout Standard
Searches for addresses that currently have value <value>.
 <sizeflag> is as in previous command.
\end_layout

\begin_layout Subsection
Main commands
\end_layout

\begin_layout Standard
These commands are not available in lsnesrc, but are available after ROM
 has been loaded.
\end_layout

\begin_layout Subsubsection
quit-emulator [/y]
\end_layout

\begin_layout Standard
Quits the emulator (asking for confirmation).
 If /y is given, no confirmation is asked.
\end_layout

\begin_layout Subsubsection
pause-emulator
\end_layout

\begin_layout Standard
Toggle paused/unpaused
\end_layout

\begin_layout Subsubsection
+advance-frame 
\end_layout

\begin_layout Standard
Advance frame.
 If the button is still held after configurable timeout expires, game unpauses
 for the duration frame advance is held.
\end_layout

\begin_layout Subsubsection
+advance-poll 
\end_layout

\begin_layout Standard
Advance subframe.
 If the button is still held after configurable timeout expires, game unpauses
 for the duration frame advance is held.
\end_layout

\begin_layout Subsubsection
advance-skiplag 
\end_layout

\begin_layout Standard
Skip to first poll in frame after current.
\end_layout

\begin_layout Subsubsection
reset 
\end_layout

\begin_layout Standard
Reset the SNES after this frame.
\end_layout

\begin_layout Subsubsection
load <filename> 
\end_layout

\begin_layout Standard
Load savestate <filename> in current mode.
\end_layout

\begin_layout Subsubsection
load-state <filename> 
\end_layout

\begin_layout Standard
Load savestate <filename> in readwrite mode.
\end_layout

\begin_layout Subsubsection
load-readonly <filename> 
\end_layout

\begin_layout Standard
Load savestate <filename> in readonly mode.
\end_layout

\begin_layout Subsubsection
load-preserve <filename> 
\end_layout

\begin_layout Standard
Load savestate <filename> in readonly mode, preserving current events.
\end_layout

\begin_layout Subsubsection
load-movie <filename> 
\end_layout

\begin_layout Standard
Load savestate <filename>, ignoring save part in readonly mode.
\end_layout

\begin_layout Subsubsection
save-state <filename> 
\end_layout

\begin_layout Standard
Save system state to <filename> as soon as possible.
\end_layout

\begin_layout Subsubsection
save-movie <filename> 
\end_layout

\begin_layout Standard
Save movie to <filename>.
\end_layout

\begin_layout Subsubsection
set-rwmode 
\end_layout

\begin_layout Standard
Set read-write mode.
\end_layout

\begin_layout Subsubsection
set-romode 
\end_layout

\begin_layout Standard
Set read-only mode
\end_layout

\begin_layout Subsubsection
toggle-rwmode 
\end_layout

\begin_layout Standard
Toggle between read-only and read-write modes.
\end_layout

\begin_layout Subsubsection
set-gamename <name> 
\end_layout

\begin_layout Standard
Set name of the game to <name>
\end_layout

\begin_layout Subsubsection
get-gamename 
\end_layout

\begin_layout Standard
Print the name of the game.
\end_layout

\begin_layout Subsubsection
add-author <author> 
\end_layout

\begin_layout Standard
Adds new author <author>.
 If <author> does not contain '|' it is full name.
 If it contains '|', '|' splits the full name and nickname.
\end_layout

\begin_layout Subsubsection
edit-author <num> <author> 
\end_layout

\begin_layout Standard
Edit the author in slot <num> (0-based) to be <author> (see add-author for
 format)
\end_layout

\begin_layout Subsubsection
remove-author <num> 
\end_layout

\begin_layout Standard
Remove author in slot <num>
\end_layout

\begin_layout Subsubsection
print-authors 
\end_layout

\begin_layout Standard
Print authors.
\end_layout

\begin_layout Subsubsection
test-1, test-2, test-3
\end_layout

\begin_layout Standard
Internal test commands.
 Don't use.
\end_layout

\begin_layout Subsubsection
take-screenshot <filename> 
\end_layout

\begin_layout Standard
Save screenshot to <filename>.
\end_layout

\begin_layout Subsubsection
+controller<num><button>
\end_layout

\begin_layout Standard
Press button <button> on controller <num> (1-8).
 The following button names are known:
\end_layout

\begin_layout Itemize
left
\end_layout

\begin_layout Itemize
right
\end_layout

\begin_layout Itemize
up
\end_layout

\begin_layout Itemize
down
\end_layout

\begin_layout Itemize
A
\end_layout

\begin_layout Itemize
B
\end_layout

\begin_layout Itemize
X
\end_layout

\begin_layout Itemize
Y
\end_layout

\begin_layout Itemize
L
\end_layout

\begin_layout Itemize
R
\end_layout

\begin_layout Itemize
select
\end_layout

\begin_layout Itemize
start
\end_layout

\begin_layout Itemize
trigger
\end_layout

\begin_layout Itemize
cursor
\end_layout

\begin_layout Itemize
pause
\end_layout

\begin_layout Itemize
turbo
\end_layout

\begin_layout Subsubsection
controllerh<num><button>
\end_layout

\begin_layout Standard
Hold/unhold button <button> on controller <num> (1-8).
 See +controller for button names.
\end_layout

\begin_layout Subsubsection
autofire (<pattern>|-)...
\end_layout

\begin_layout Standard
Set autofire pattern.
 Each parameter is comma-separated list of button names (in form of 1start,
 1A, 2B, etc..) to hold on that frame.
 After reaching the end of pattern, the pattern restarts from the beginning.
\end_layout

\begin_layout Subsubsection
repaint
\end_layout

\begin_layout Standard
Force a repaint.
\end_layout

\begin_layout Subsection
Save jukebox 
\end_layout

\begin_layout Subsubsection
cycle-jukebox-backward
\end_layout

\begin_layout Standard
Cycle save jukebox backwards.
\end_layout

\begin_layout Subsubsection
cycle-jukebox-forward
\end_layout

\begin_layout Standard
Cycle save jukebox forwards
\end_layout

\begin_layout Subsubsection
add-jukebox-save <filename>
\end_layout

\begin_layout Standard
Add <filename> to jukebox saves.
\end_layout

\begin_layout Subsubsection
load-jukebox
\end_layout

\begin_layout Standard
Do load from jukebox (current mode).
\end_layout

\begin_layout Subsubsection
save-jukebox
\end_layout

\begin_layout Standard
Do state save to jukebox.
\end_layout

\begin_layout Subsection
Lua 
\end_layout

\begin_layout Standard
Only available if lua support is compiled in.
\end_layout

\begin_layout Subsubsection
evaluate-lua <luacode>
\end_layout

\begin_layout Standard
Run Lua code <luacode> using built-in Lua interpretter.
\end_layout

\begin_layout Subsubsection
run-lua <script>
\end_layout

\begin_layout Standard
Run specified lua file using built-in Lua interpretter.
\end_layout

\begin_layout Subsection
Memory watch
\end_layout

\begin_layout Subsubsection
add-watch <name> <expression>
\end_layout

\begin_layout Standard
Adds new watch (or modifies old one).
\end_layout

\begin_layout Subsubsection
remove-watch <name>
\end_layout

\begin_layout Standard
Remove a watch.
\end_layout

\begin_layout Subsection
Sound 
\end_layout

\begin_layout Subsubsection
enable-sound <on/off> 
\end_layout

\begin_layout Standard
Enable/Disable sound.
\end_layout

\begin_layout Subsubsection
set-sound-device <device> 
\end_layout

\begin_layout Standard
Set sound device to <device>
\end_layout

\begin_layout Subsubsection
show-sound-status 
\end_layout

\begin_layout Standard
Show status of sound system.
\end_layout

\begin_layout Subsubsection
show-sound-devices
\end_layout

\begin_layout Standard
Show all available devices.
\end_layout

\begin_layout Subsection
SDL Platform commands 
\end_layout

\begin_layout Standard
The following are valid on SDL platform.
\end_layout

\begin_layout Subsubsection
identify-key
\end_layout

\begin_layout Standard
Asks to press a key and then identifies that (pseudo-)key.
\end_layout

\begin_layout Subsubsection
toggle-console 
\end_layout

\begin_layout Standard
Toggle between windowed/fullscreen console.
\end_layout

\begin_layout Subsubsection
scroll-fullup 
\end_layout

\begin_layout Standard
Scroll messages window as far back as it goes.
\end_layout

\begin_layout Subsubsection
scroll-fulldown 
\end_layout

\begin_layout Standard
Scroll messages window as far forward as it goes.
\end_layout

\begin_layout Subsubsection
scroll-up 
\end_layout

\begin_layout Standard
Scroll messages window back one screenful.
\end_layout

\begin_layout Subsubsection
scroll-down 
\end_layout

\begin_layout Standard
Scroll messages window forward one screenful.
\end_layout

\begin_layout Section
Settings
\end_layout

\begin_layout Subsection
Core settings
\end_layout

\begin_layout Subsubsection
firmwarepath
\end_layout

\begin_layout Standard
Set where bsnes looks for firmware files.
 Default is 
\begin_inset Quotes eld
\end_inset

.
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsubsection
targetfps
\end_layout

\begin_layout Standard
Set the target fps.
 Numeric, range is 0.001 to 
\begin_inset Quotes eld
\end_inset

infinite
\begin_inset Quotes erd
\end_inset

.
 Default is native framerate.
\end_layout

\begin_layout Subsubsection
savecompression
\end_layout

\begin_layout Standard
Set save compression level (integer 0-9).
 Default is 7 (0 is no compression).
\end_layout

\begin_layout Subsubsection
advance-timeout
\end_layout

\begin_layout Standard
Set the frame advance timeout in milliseconds.
 Numeric integer, range is 0-999999999.
 Default is 500.
\end_layout

\begin_layout Subsection
AVI dumper settings
\end_layout

\begin_layout Subsubsection
avi-large
\end_layout

\begin_layout Standard
AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
 outputs.
\end_layout

\begin_layout Subsubsection
avi-left-border
\end_layout

\begin_layout Standard
AVI dumper: Set the default left border thickness (unless lua overrides)
 for dumps.
 Range 0-8191.
 Default is 0.
\end_layout

\begin_layout Subsubsection
avi-right-border
\end_layout

\begin_layout Standard
AVI dumper: Set the default right border thickness (unless lua overrides)
 for dumps.
 Range 0-8191.
 Default is 0.
\end_layout

\begin_layout Subsubsection
avi-top-border
\end_layout

\begin_layout Standard
AVI dumper: Set the default top border thickness (unless lua overrides)
 for dumps.
 Range 0-8191.
 Default is 0.
\end_layout

\begin_layout Subsubsection
avi-bottom-border
\end_layout

\begin_layout Standard
AVI dumper: Set the default bottom border thickness (unless lua overrides)
 for dumps.
 Range 0-8191.
 Default is 0.
\end_layout

\begin_layout Subsubsection
avi-maxframes
\end_layout

\begin_layout Standard
AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
 Range 0-999999999.
 Default is 0.
\end_layout

\begin_layout Subsubsection
avi-compresison
\end_layout

\begin_layout Standard
AVI dumper: Compression level (0-18).
\end_layout

\begin_layout Itemize
Compression levels 10 and above are not compatible with stock CSCD codec.
\end_layout

\begin_layout Itemize
Recomended level is 7.
\end_layout

\begin_layout Subsection
JMD options
\end_layout

\begin_layout Subsubsection
jmd-copression
\end_layout

\begin_layout Standard
JMD dumper: Compression level (0-9).
\end_layout

\begin_layout Subsection
SDL platform settings
\end_layout

\begin_layout Subsubsection
autorepeat-first-delay
\end_layout

\begin_layout Standard
Sets the delay for first character in typematic autorepeat.
\end_layout

\begin_layout Subsubsection
autorepeat-subsequent-delay
\end_layout

\begin_layout Standard
Sets the delay for subsequent characters in typematic autorepeat.
\end_layout

\begin_layout Section
Lua functions
\end_layout

\begin_layout Subsection
Core (in main table)
\end_layout

\begin_layout Subsubsection
print
\end_layout

\begin_layout Standard
Print line to message console.
\end_layout

\begin_layout Subsubsection
exec(string command)
\end_layout

\begin_layout Standard
Run command as it was entered on the command line
\end_layout

\begin_layout Subsection
Table bit:
\end_layout

\begin_layout Standard
Bitwise logical functions and related.
\end_layout

\begin_layout Subsubsection
bit.none(number...) / bit.bnot(number...)
\end_layout

\begin_layout Standard
48-bit bitwise NOT / NONE function (set bits that are set in none of the
 arguments).
\end_layout

\begin_layout Subsubsection
bit.any(number...) / bit.bor(number...)
\end_layout

\begin_layout Standard
48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
\end_layout

\begin_layout Subsubsection
bit.all(number...) / bit.band(number...)
\end_layout

\begin_layout Standard
48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
).
\end_layout

\begin_layout Subsubsection
bit.parity(number...) / bit.bxor(number...)
\end_layout

\begin_layout Standard
48-bit bitwise XOR / PARITY function (set bits that are set in odd number
 of the arguments).
\end_layout

\begin_layout Subsubsection
bit.lrotate(number base[, number amount[, number bits]])
\end_layout

\begin_layout Standard
Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
\end_layout

\begin_layout Subsubsection
bit.rrotate(number base[, number amount[, number bits]])
\end_layout

\begin_layout Standard
Rotate bits-bit (max 48, default 48) number right by amount (default 1)
 places.
\end_layout

\begin_layout Subsubsection
bit.lshift(number base[, number amount[, number bits]])
\end_layout

\begin_layout Standard
Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
 The new bits are filled with zeroes.
\end_layout

\begin_layout Subsubsection
bit.lrshift(number base[, number amount[, number bits]])
\end_layout

\begin_layout Standard
Shift bits-bit (max 48, default 48) number logically right by amount (default
 1) places.
 The new bits are filled with zeroes.
\end_layout

\begin_layout Subsubsection
bit.arshift(number base[, number amount[, number bits]])
\end_layout

\begin_layout Standard
Shift bits-bit (max 48, default 48) number arithmetically right by amount
 (default 1) places.
 The new bits are shifted in with copy of the high bit.
\end_layout

\begin_layout Subsection
Table gui:
\end_layout

\begin_layout Standard
Most of these functions can only be called in on_paint and on_video callbacks.
 Exceptions are noted.
\end_layout

\begin_layout Standard
Colors are 32-bit.
 Bits 0-7 are the blue component, bits 8-15 are the green component, bits
 16-23 are the red component, bits 24-31 are alpha component (0 is fully
 opaque, 255 is almost transparent).
 -1 is the fully transparent color.
 Alpha values greater than 127 do work.
\end_layout

\begin_layout Standard
Origin of coordinates is at top left corner of game display area.
 Left and top gaps correspond to negative coordinates.
\end_layout

\begin_layout Subsubsection
gui.resolution()
\end_layout

\begin_layout Standard
Returns 2-tuple (hresolution, vresolution).
\end_layout

\begin_layout Subsubsection
gui.<class>_gap(number gap)
\end_layout

\begin_layout Standard
Set the <class> (left, right, top, bottom) gap to specified value (max gap
 is 8191).
\end_layout

\begin_layout Subsubsection
gui.text(number x, number y, string text[, number fgc[, number bgc]])
\end_layout

\begin_layout Standard
Draw specified text on the GUI (each character cell is 8 or 16 wide and
 16 high).
 Parameters:
\end_layout

\begin_layout Itemize
x: X-coordinate to start the drawing from (and x-coordinate at begining
 of the lines).
\end_layout

\begin_layout Itemize
y: Y-coordinate to start the drawing from.
\end_layout

\begin_layout Itemize
text: The text to draw.
\end_layout

\begin_layout Itemize
fgc: Text color (default is 0xFFFFFF (white))
\end_layout

\begin_layout Itemize
bgc: Background color (default is -1 (transparent))
\end_layout

\begin_layout Subsubsection
gui.textH(number x, number y, string text[, number fgc[, number bgc]])
\end_layout

\begin_layout Standard
Like gui.text, but draw using double-width.
\end_layout

\begin_layout Subsubsection
gui.textV(number x, number y, string text[, number fgc[, number bgc]])
\end_layout

\begin_layout Standard
Like gui.text, but draw using double-height.
\end_layout

\begin_layout Subsubsection
gui.textHV(number x, number y, string text[, number fgc[, number bgc]])
\end_layout

\begin_layout Standard
Like gui.text, but draw using double-width/double-height.
\end_layout

\begin_layout Subsubsection
gui.rectangle(number x, number y, number width, number height[, number thickness[
, number outline[, number fill]]])
\end_layout

\begin_layout Standard
Draw rectangle on the GUI.
 Parameters:
\end_layout

\begin_layout Itemize
x: X-coordinate of left edge.
\end_layout

\begin_layout Itemize
y: Y-coordinate of upper edge.
\end_layout

\begin_layout Itemize
width: Width of rectangle.
\end_layout

\begin_layout Itemize
height: Height of rectangle.
\end_layout

\begin_layout Itemize
thickness: Thickness of outline (default is 1).
\end_layout

\begin_layout Itemize
outline: Color of outline (default is 0xFFFFFF (white))
\end_layout

\begin_layout Itemize
fill: Color of fil (default is -1 (transparent))
\end_layout

\begin_layout Subsubsection
gui.pixel(number x, number y[, number color])
\end_layout

\begin_layout Standard
Draw one pixel on the GUI.
 Parameters:
\end_layout

\begin_layout Itemize
x: X-coordinate of the pixel
\end_layout

\begin_layout Itemize
y: Y-coordinate of the pixel
\end_layout

\begin_layout Itemize
color: Color of the pixel (default is 0xFFFFFF (white))
\end_layout

\begin_layout Subsubsection
gui.crosshair(number x, number y[, number length[, number color]])
\end_layout

\begin_layout Standard
Draw a crosshair.
 Parameters:
\end_layout

\begin_layout Itemize
x: X-coordinate of the crosshair
\end_layout

\begin_layout Itemize
y: Y-coordinate of the crosshair
\end_layout

\begin_layout Itemize
length: Length of the crosshair lines (default 10).
\end_layout

\begin_layout Itemize
color: Color of the crosshair (default is 0xFFFFFF (white))
\end_layout

\begin_layout Subsubsection
gui.line(number x1, number y1, number x2, number y2[, number color])
\end_layout

\begin_layout Standard
Draw a thin line.
 Parameters:
\end_layout

\begin_layout Itemize
x1: X-coordinate of one end.
\end_layout

\begin_layout Itemize
y1: Y-coordinate of one end.
\end_layout

\begin_layout Itemize
x2: X-coordinate of the other end.
\end_layout

\begin_layout Itemize
y2: Y-coordinate of the other end.
\end_layout

\begin_layout Itemize
color: Color of the line (default is 0xFFFFFF (white)).
\end_layout

\begin_layout Subsubsection
gui.circle(number x, number y, number r[, number thick[, number border[,
 number fil]]])
\end_layout

\begin_layout Standard
Draw a circle.
 Parameters.
\end_layout

\begin_layout Itemize
x: X-coordinate of the center
\end_layout

\begin_layout Itemize
y: Y-coordinate of the center
\end_layout

\begin_layout Itemize
r: The radius of the circle
\end_layout

\begin_layout Itemize
thick: Border thickness
\end_layout

\begin_layout Itemize
border: Border color (default is 0xFFFFFF (white))
\end_layout

\begin_layout Itemize
fill: Fill color (default is -1 (transparent)).
\end_layout

\begin_layout Subsubsection
gui.repaint()
\end_layout

\begin_layout Standard
Request on_repaint() to happen as soon as possible.
 Can be used anywhere.
\end_layout

\begin_layout Subsubsection
gui.subframe_update(boolean on)
\end_layout

\begin_layout Standard
Request subframe updates (calling on_paint() on subframes) to happen (on=true)
 or not happen (on=false).
 Can be used anywhere.
\end_layout

\begin_layout Subsubsection
gui.screenshot(string filename)
\end_layout

\begin_layout Standard
Write PNG screenshot of the current frame (no drawings) to specified file.
 Can be used anywhere.
\end_layout

\begin_layout Subsubsection
gui.color(number r, number g, number b[, number a])
\end_layout

\begin_layout Standard
Returns color (in notation Lua scripts use) corresponding to color (r,g,b),
 each component in scale 0-255.
 If a is specified, that is alpha (0 is fully transparent, 256(sic) is fully
 opaque).
 The default alpha is 256.
\end_layout

\begin_layout Subsubsection
gui.status(string name, string value)
\end_layout

\begin_layout Standard
Set status field 
\begin_inset Quotes eld
\end_inset

L[<name>]
\begin_inset Quotes erd
\end_inset

 to <value> in status area.
 Can be used anywhere.
\end_layout

\begin_layout Subsection
table input
\end_layout

\begin_layout Standard
Input handling.
 Only available in on_input callback.
\end_layout

\begin_layout Subsubsection
input.get(number controller, number index)
\end_layout

\begin_layout Standard
Read the specified index (0-11) from specified controller (0-7).
 Notes:
\end_layout

\begin_layout Itemize
Uses physical controller numbering.
 Gamepad in port 2 is controller 4, not 1!
\end_layout

\begin_layout Subsubsection
input.set(number controller, number index, number value)
\end_layout

\begin_layout Standard
Write the specified index (0-11) from specified controller (0-7), storing
 value.
 Notes:
\end_layout

\begin_layout Itemize
Uses physical controller numbering.
 Gamepad in port 2 is controller 4, not 1!
\end_layout

\begin_layout Subsubsection
input.reset([number cycles])
\end_layout

\begin_layout Standard
Execute reset.
 If cycles is greater than zero, do delayed reset.
 0 (or no value) causes immediate reset.
\end_layout

\begin_layout Itemize
Only available with subframe flag false.
\end_layout

\begin_layout Subsubsection
input.raw()
\end_layout

\begin_layout Standard
Returns table of tables of all available keys and axes.
 The first table is indexed by key name (platform-dependent!), and the inner
 table has the following fields:
\end_layout

\begin_layout Itemize
last_rawval: Last reported raw value for control.
\end_layout

\begin_layout Itemize
ktype: Type of key (disabled, key, mouse, axis, axis-inverse, hat, pressure-m0,
 pressure-mp, pressure-0m, pressure-0p, pressure-pm, pressure-p0).
\end_layout

\begin_layout Itemize
cal_left: Minimum calibration value.
 Only meaningful with axis and pressure types.
\end_layout

\begin_layout Itemize
cal_center: Center calibration value.
 Only meaningful with axis and pressure types.
\end_layout

\begin_layout Itemize
cal_right: Maximum calibration value.
 Only meaningful with axis and pressure types.
\end_layout

\begin_layout Itemize
cal_tolerance: Dead zone tolerance.
 Only meaningful with axis and pressure types.
\end_layout

\begin_layout Subsubsection
input.keyhook(key, state)
\end_layout

\begin_layout Standard
Requests that keyhook events to be sent for key (state=true) or not sent
 (state=false).
\end_layout

\begin_layout Subsection
Table hostmemory
\end_layout

\begin_layout Standard
Host memory handling (extra memory saved to savestates).
 Host memory starts empty.
\end_layout

\begin_layout Subsubsection
hostmemory.read(number address)
\end_layout

\begin_layout Standard
Reads hostmemory slot address.
 Slot numbers out of range return false instead of numeric.
\end_layout

\begin_layout Subsubsection
hostmemory.write(number address, number value)
\end_layout

\begin_layout Standard
Writes hostmemory slot with 0-255.
 Slot numbers out of range cause extension of host memory slot space.
\end_layout

\begin_layout Subsubsection
hostmemory.readbyte(number address)
\end_layout

\begin_layout Standard
Read unsigned byte (1 element) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writebyte(number address, number value)
\end_layout

\begin_layout Standard
Write unsigned byte (1 element) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readsbyte(number address)
\end_layout

\begin_layout Standard
Read signed byte (1 element) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writesbyte(number address, number value)
\end_layout

\begin_layout Standard
Write signed byte (1 element) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readword(number address)
\end_layout

\begin_layout Standard
Read unsigned word (2 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writeword(number address, number value)
\end_layout

\begin_layout Standard
Write unsigned word (2 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readsword(number address)
\end_layout

\begin_layout Standard
Read signed word (2 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writesword(number address, number value)
\end_layout

\begin_layout Standard
Write signed word (2 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readdword(number address)
\end_layout

\begin_layout Standard
Read unsigned doubleword (4 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writedword(number address, number value)
\end_layout

\begin_layout Standard
Write unsigned doubleword (4 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readsdword(number address)
\end_layout

\begin_layout Standard
Read signed doubleword (4 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writesdword(number address, number value)
\end_layout

\begin_layout Standard
Write signed doubleword (4 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readqword(number address)
\end_layout

\begin_layout Standard
Read unsigned quadword (8 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writeqword(number address, number value)
\end_layout

\begin_layout Standard
Write unsigned quadword (4 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsubsection
hostmemory.readsqword(number address)
\end_layout

\begin_layout Standard
Read signed quadword (8 elements) from given address.
 Slots out of range return false.
\end_layout

\begin_layout Subsubsection
hostmemory.writesqword(number address, number value)
\end_layout

\begin_layout Standard
Write signed quadword (8 elements) to given slot.
 Slot numbers out of range cause extension.
\end_layout

\begin_layout Subsection
Table movie
\end_layout

\begin_layout Standard
Movie handling
\end_layout

\begin_layout Subsubsection
movie.currentframe()
\end_layout

\begin_layout Standard
Return number of current frame.
\end_layout

\begin_layout Subsubsection
movie.framecount()
\end_layout

\begin_layout Standard
Return number of frames in movie.
\end_layout

\begin_layout Subsubsection
movie.readonly()
\end_layout

\begin_layout Standard
Return true if in readonly mode, false if in readwrite.
\end_layout

\begin_layout Subsubsection
movie.set_readwrite()
\end_layout

\begin_layout Standard
Set readwrite mode (does not cause on_readwrite callback).
\end_layout

\begin_layout Subsubsection
movie.frame_subframes(number frame)
\end_layout

\begin_layout Standard
Count number of subframes in specified frame (frame numbers are 1-based)
 and return that.
\end_layout

\begin_layout Subsubsection
movie.read_subframe(number frame, number subframe)
\end_layout

\begin_layout Standard
Read specifed subframe in specified frame and return data as array (100
 elements, numbered 0-99 currently).
\end_layout

\begin_layout Subsection
Table settings
\end_layout

\begin_layout Standard
Routines for settings manipulation
\end_layout

\begin_layout Subsubsection
settings.get(string name)
\end_layout

\begin_layout Standard
Get value of setting.
 If setting is blank, returns false.
 If setting value can't be obtained, returns (nil, error message).
\end_layout

\begin_layout Subsubsection
settings.set(string name, string value)
\end_layout

\begin_layout Standard
Set value of setting.
 If setting can't be set, returns (nil, error message).
\end_layout

\begin_layout Subsubsection
settings.is_set(string name)
\end_layout

\begin_layout Standard
Returns if setting is set.
 If setting does not exist, returns (nil, error message).
\end_layout

\begin_layout Subsubsection
settings.blank(string name)
\end_layout

\begin_layout Standard
Blanks a setting and returns true.
 If setting can't be blanked, returns (nil, error message).
\end_layout

\begin_layout Subsection
Table memory
\end_layout

\begin_layout Standard
Contains various functions for managing memory
\end_layout

\begin_layout Subsubsection
memory.vma_count()
\end_layout

\begin_layout Standard
Returns the number of VMAs
\end_layout

\begin_layout Subsubsection
memory.read_vma(number index)
\end_layout

\begin_layout Standard
Reads the specified VMA (indices start from zero).
 Trying to read invalid VMA gives nil.
 The read VMA is table with the following fields:
\end_layout

\begin_layout Itemize
region_name (string): The readable name of the VMA
\end_layout

\begin_layout Itemize
baseaddr (number): Base address of the VMA
\end_layout

\begin_layout Itemize
lastaddr (number): Last address in the VMA.
\end_layout

\begin_layout Itemize
size (number): The size of VMA in bytes.
\end_layout

\begin_layout Itemize
readonly (boolean): True of the VMA corresponds to ROM.
\end_layout

\begin_layout Itemize
native_endian (boolean): True if the VMA has native endian as opposed to
 little endian.
\end_layout

\begin_layout Subsubsection
memory.find_vma(number address)
\end_layout

\begin_layout Standard
Finds the VMA containing specified address.
 Returns table in the same format as read_vma or nil if not found.
\end_layout

\begin_layout Subsubsection
memory.readbyte(number address)
\end_layout

\begin_layout Standard
Reads the specified address as unsigned byte and returns the result.
\end_layout

\begin_layout Subsubsection
memory.readsbyte(number address)
\end_layout

\begin_layout Standard
Reads the specified address as signed byte and returns the result.
\end_layout

\begin_layout Subsubsection
memory.writebyte(number address, number value)
\end_layout

\begin_layout Standard
Writes the specified value (negative values undergo 2's complement) to specified
 address (as a byte).
\end_layout

\begin_layout Subsubsection
memory.readword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as unsigned word and returns the result.
\end_layout

\begin_layout Subsubsection
memory.readsword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as signed word and returns the result.
\end_layout

\begin_layout Subsubsection
memory.writeword(number address, number value)
\end_layout

\begin_layout Standard
Writes the specified value (negative values undergo 2's complement) to specified
 address (as a word).
\end_layout

\begin_layout Subsubsection
memory.readdword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as unsigned doubleword and returns the result.
\end_layout

\begin_layout Subsubsection
memory.readsdword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as signed doubleword and returns the result.
\end_layout

\begin_layout Subsubsection
memory.writedword(number address, number value)
\end_layout

\begin_layout Standard
Writes the specified value (negative values undergo 2's complement) to specified
 address (as a doubleword).
\end_layout

\begin_layout Subsubsection
memory.readqword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as unsigned quadword and returns the result.
\end_layout

\begin_layout Subsubsection
memory.readsqword(number address)
\end_layout

\begin_layout Standard
Reads the specified address as signed quadword and returns the result.
\end_layout

\begin_layout Subsubsection
memory.writeqword(number address, number value)
\end_layout

\begin_layout Standard
Writes the specified value (negative values undergo 2's complement) to specified
 address (as a quadword).
\end_layout

\begin_layout Subsection
Table _SYSTEM
\end_layout

\begin_layout Standard
Contains copy of global variables from time of Lua initialization.
 Non-writeable.
\end_layout

\begin_layout Subsection
Callbacks
\end_layout

\begin_layout Standard
Various callbacks to Lua that can occur.
\end_layout

\begin_layout Subsubsection
Callback: on_paint()
\end_layout

\begin_layout Standard
Called when screen is being painted.
 Any gui.* calls requiring graphic context draw on the screen.
\end_layout

\begin_layout Subsubsection
Callback: on_video()
\end_layout

\begin_layout Standard
Called when video dump frame is being painted.
 Any gui.* calls requiring graphic context draw on the video.
\end_layout

\begin_layout Subsubsection
Callback: on_frame()
\end_layout

\begin_layout Standard
Called on each starting whole frame.
\end_layout

\begin_layout Subsubsection
Callback: on_startup()
\end_layout

\begin_layout Standard
Called when the emulator is starting (lsnes.rc and --run files has been run).
\end_layout

\begin_layout Subsubsection
Callback: on_pre_load(string name)
\end_layout

\begin_layout Standard
Called just before savestate/movie load occurs (note: loads are always delayed,
 so this occurs even when load was initiated by lua).
\end_layout

\begin_layout Subsubsection
Callback: on_err_load(string name)
\end_layout

\begin_layout Standard
Called if loadstate goes wrong.
\end_layout

\begin_layout Subsubsection
Callback: on_post_load(string name, boolean was_savestate)
\end_layout

\begin_layout Standard
Called on successful loadstate.
 was_savestate gives if this was a savestate or a movie.
\end_layout

\begin_layout Subsubsection
Callback: on_pre_save(string name, boolean is_savestate)
\end_layout

\begin_layout Standard
Called just before savestate save occurs (note: movie saves are synchronous
 and won't trigger these callbacks if called from Lua).
\end_layout

\begin_layout Subsubsection
Callback: on_err_save(string name)
\end_layout

\begin_layout Standard
Called if savestate goes wrong.
\end_layout

\begin_layout Subsubsection
Callback: on_post_save(string name, boolean is_savestate)
\end_layout

\begin_layout Standard
Called on successful savaestate.
 is_savestate gives if this was a savestate or a movie.
\end_layout

\begin_layout Subsubsection
Callback: on_quit()
\end_layout

\begin_layout Standard
Called when emulator is shutting down.
\end_layout

\begin_layout Subsubsection
Callback: on_input(boolean subframe)
\end_layout

\begin_layout Standard
Called when emulator is just sending input to bsnes core.
 Warning: This is called even in readonly mode, but the results are ignored.
\end_layout

\begin_layout Subsubsection
Callback: on_reset()
\end_layout

\begin_layout Standard
Called when SNES is reset.
\end_layout

\begin_layout Subsubsection
Callback: on_readwrite()
\end_layout

\begin_layout Standard
Called when moving into readwrite mode as result of 
\begin_inset Quotes eld
\end_inset

set-rwmode
\begin_inset Quotes erd
\end_inset

 command (note: moving to rwmode by Lua won't trigger this, as per recursive
 entry protection).
\end_layout

\begin_layout Subsubsection
Callback: on_snoop(number port, number controller, number index, number
 value)
\end_layout

\begin_layout Standard
Called each time bsnes asks for input.
 The value is the final value to be sent to bsnes core (readonly mode, autohold
 and autofire have been taken into account).
 Might be useful when translating movies to format suitable for console
 verification.
 Note: There is no way to modify the value to be sent.
\end_layout

\begin_layout Subsubsection
Callback: on_keyhook(string keyname, table state)
\end_layout

\begin_layout Standard
Sent when key that has keyhook events requested changes state.
 Keyname is name of the key (group) and state is the state (same kind as
 table values in input.raw).
\end_layout

\begin_layout Section
Memory watch expression syntax
\end_layout

\begin_layout Standard
Memory watch expressions are in RPN (Reverse Polish Notation).
 At the end of expression, the top entry on stack is taken as the final
 result.
\end_layout

\begin_layout Standard
Notations:
\end_layout

\begin_layout Itemize
Evaluation order is strictly left to right.
\end_layout

\begin_layout Itemize
a is the entry on top of stack
\end_layout

\begin_layout Itemize
b is the entry immediately below top of stack
\end_layout

\begin_layout Itemize
; separates values to be pushed (no intermediate pop).
\end_layout

\begin_layout Itemize
After end of element, all used stack slots are popped and all results are
 pushed.
\end_layout

\begin_layout Itemize
When pushing multiple values, the pushes occur in order shown.
\end_layout

\begin_layout Standard
The following operators are available:
\end_layout

\begin_layout Itemize
+ : a + b
\end_layout

\begin_layout Itemize
- : a - b
\end_layout

\begin_layout Itemize
* : a * b
\end_layout

\begin_layout Itemize
/ : a / b
\end_layout

\begin_layout Itemize
% : a % b
\end_layout

\begin_layout Itemize
a : atan(a)
\end_layout

\begin_layout Itemize
b : read_signed_byte(a)
\end_layout

\begin_layout Itemize
c : cos(a)
\end_layout

\begin_layout Itemize
d : read_signed_dword(a)
\end_layout

\begin_layout Itemize
i : quotent(a / b)
\end_layout

\begin_layout Itemize
p :
\begin_inset Formula $\pi$
\end_inset


\end_layout

\begin_layout Itemize
q : read_signed_qword(a)
\end_layout

\begin_layout Itemize
r : sqrt(a)
\end_layout

\begin_layout Itemize
s : sin(a)
\end_layout

\begin_layout Itemize
t : tan(a)
\end_layout

\begin_layout Itemize
u : a; a
\end_layout

\begin_layout Itemize
w : read_signed_word(a)
\end_layout

\begin_layout Itemize
A : atan2(a, b)
\end_layout

\begin_layout Itemize
B : read_unsigned_byte(a)
\end_layout

\begin_layout Itemize
C<number>z : Push number <number> to stack.
\end_layout

\begin_layout Itemize
D : read_unsigned_dword(a)
\end_layout

\begin_layout Itemize
C0x<number>z : Push number <number> (hexadecimal) to stack.
\end_layout

\begin_layout Itemize
Q : read_unsigned_qword(a)
\end_layout

\begin_layout Itemize
R<digit> : round a to <digit> digits.
\end_layout

\begin_layout Itemize
W : read_unsigned_word(a)
\end_layout

\begin_layout Subsection
Example:
\end_layout

\begin_layout Standard
C0x007e0878zWC0x007e002czW-
\end_layout

\begin_layout Enumerate
Push value 0x7e0878 on top of stack (C0x007e0878z).
\end_layout

\begin_layout Enumerate
Pop the value on top of stack (0x7e0878), read word value at that address
 and push the result,call it x1 (W).
\end_layout

\begin_layout Enumerate
Push value 0x7e002c on top of stack (C0x007e002cz).
\end_layout

\begin_layout Enumerate
Pop the value on top of stack (0x7e002c), read word value at that address
 and push the result,call it x2 (W).
\end_layout

\begin_layout Enumerate
Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
 x2 - x1 (-).
\end_layout

\begin_layout Enumerate
Since the expression ends, the final memory watch result is the top one
 on stack, which is x2 - x1.
\end_layout

\begin_layout Section
Modifier and key names:
\end_layout

\begin_layout Subsection
SDL Platform
\end_layout

\begin_layout Subsubsection
Modifier names
\end_layout

\begin_layout Standard
Following modifier names are known:
\end_layout

\begin_layout Itemize
ctrl, lctrl, rctrl: Control keys
\end_layout

\begin_layout Itemize
alt, lalt, ralt: ALT keys.
\end_layout

\begin_layout Itemize
shift, lshift, rshift: Shift keys.
\end_layout

\begin_layout Itemize
meta, lmeta, rmeta: Meta keys.
\end_layout

\begin_layout Itemize
num, caps: Numlock/Capslock (these are sticky!)
\end_layout

\begin_layout Itemize
mode: Mode select.
\end_layout

\begin_layout Subsubsection
Key names
\end_layout

\begin_layout Standard
Following key names are known:
\end_layout

\begin_layout Itemize
backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
 hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
 comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
 less, equals, greater, question, at, leftbracket, backslash, rightbracket,
 caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
 o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
 world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
 world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
 world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
 world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
 world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
 world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
 world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
 world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
 world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
 world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
 world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
 world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
 kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
 kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
 pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
 f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
 lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
 break, menu, power, euro, undo
\end_layout

\begin_layout Itemize
Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
 hardware-dependent scan code of <n> (useful to bind those keys that don't
 have symbolic names).
\end_layout

\begin_layout Subsubsection
Joystick pseudo-keys:
\end_layout

\begin_layout Itemize
joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
\end_layout

\begin_layout Itemize
joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
\end_layout

\begin_layout Itemize
joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
\end_layout

\begin_layout Itemize
joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
\end_layout

\begin_layout Itemize
joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
\end_layout

\begin_layout Itemize
joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
 position (axis modes axis and axis_inverse).
\end_layout

\begin_layout Itemize
joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
 position (axis modes axis and axis_inverse).
\end_layout

\begin_layout Itemize
joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
 modes pressure_*).
\end_layout

\begin_layout Subsubsection
Special buttons:
\end_layout

\begin_layout Itemize
Escape: Enter/Exit Command mode, cancel modal dialogs.
\end_layout

\begin_layout Itemize
Return (also KPEnter): Execute command, ok modal dialog.
\end_layout

\begin_layout Itemize
Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
 history
\end_layout

\begin_layout Itemize
Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
 history
\end_layout

\begin_layout Itemize
Home (also KP7 if no num lock; command mode): Beginning of command.
\end_layout

\begin_layout Itemize
End (also KP1 if no num lock; command mode): End of command.
\end_layout

\begin_layout Itemize
Left (also KP4 if no num lock; command mode): Move cursor left.
\end_layout

\begin_layout Itemize
Right (also KP6 if no num lock; command mode): Move cursor right.
\end_layout

\begin_layout Itemize
Delete (also KP.
 if no num lock; command mode): Delete character to right of cursor.
\end_layout

\begin_layout Itemize
Insert (also KP0 if no num lock; command mode): Toggle between insert /
 overwrite modes.
\end_layout

\begin_layout Itemize
Backspace (command mode): Delete character to left of cursor.
\end_layout

\begin_layout Itemize
LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
\end_layout

\begin_layout Subsection
wxWidgets platform
\end_layout

\begin_layout Subsubsection
Modifier names:
\end_layout

\begin_layout Standard
Following modifier names are known:
\end_layout

\begin_layout Itemize
alt
\end_layout

\begin_layout Itemize
ctrl
\end_layout

\begin_layout Itemize
shift 
\end_layout

\begin_layout Itemize
meta
\end_layout

\begin_layout Itemize
cmd (Mac OS X only)
\end_layout

\begin_layout Subsubsection
Key names:
\end_layout

\begin_layout Standard
Following key names are known:
\end_layout

\begin_layout Itemize
back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
 ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
 period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
 greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
 q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
 underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
 q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
 start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
 pause, capital, end, home, lefT, up, right, down, select, print, execute,
 snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
 numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
 decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
 f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
 pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
 numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
 numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
 numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
 numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
 windows_right, windows_menu, command, special1, special2, special3, special4,
 special5, special6, special7, special8, special9, special10, special11,
 special12, special13, special14, special15, special16, special17, special18,
 special19, special20
\end_layout

\begin_layout Section
Movie file format
\end_layout

\begin_layout Standard
Movie file is .zip archive in itself, normal ZIP archive tools work on it
 (note: If you recompress it, do not use compression methods other than
 store and deflate and especially do not use encryption of any kind).
\end_layout

\begin_layout Subsection
Detecting clean start/SRAM/Savestate
\end_layout

\begin_layout Itemize
If file has member 
\begin_inset Quotes eld
\end_inset

savestate
\begin_inset Quotes erd
\end_inset

 it is savestate, otherwise:
\end_layout

\begin_layout Itemize
If file has members with names starting 
\begin_inset Quotes eld
\end_inset

moviesram.
\begin_inset Quotes erd
\end_inset

 it is movie starting from SRAM, otherwise:
\end_layout

\begin_layout Itemize
It is movie starting from clear state.
\end_layout

\begin_layout Subsection
Member: gametype
\end_layout

\begin_layout Standard
Type of game ROM and region (as one line).
 Valid values are:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="3">
<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Value
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
System
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Region
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
snes_pal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Super NES
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
PAL
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sgb_pal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Super Game Boy
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
PAL
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
snes_ntsc
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Super NES
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sgb_ntsc
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Super Game Boy
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
bsx
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
BS-X (non-slotted)
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
bsxslotted
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
BS-X (slotted)
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sufamiturbo
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sufami Turbo
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
Frame rates are:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="2">
<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Region
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Framerate (fps)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
PAL
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
322445/6448
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NTSC
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10738636/178683
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Member: port1
\end_layout

\begin_layout Standard
Contains type of port #1 (as one line).
 Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
 If not present, defaults to 'gamepad'.
\end_layout

\begin_layout Subsection
Member: port2
\end_layout

\begin_layout Standard
Contains type of port #2 (as one line).
 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
 'justifier' and 'justifiers'.
 If not present, defaults to 'none'.
\end_layout

\begin_layout Subsection
Member: gamename
\end_layout

\begin_layout Standard
Contains name of the game (as one line).
\end_layout

\begin_layout Subsection
Member: authors
\end_layout

\begin_layout Standard
Contains authors, one per line.
 Part before '|' is the full name, part after is the nickname.
\end_layout

\begin_layout Subsection
Member: systemid
\end_layout

\begin_layout Standard
Always 
\begin_inset Quotes eld
\end_inset

lsnes-rr1
\begin_inset Quotes erd
\end_inset

 (one line).
 Used to reject other saves.
\end_layout

\begin_layout Subsection
Member: controlsversion
\end_layout

\begin_layout Standard
Always 
\begin_inset Quotes eld
\end_inset

0
\begin_inset Quotes erd
\end_inset

 (one line).
 Used to identify what controls are there.
\end_layout

\begin_layout Subsection
Member: 
\begin_inset Quotes eld
\end_inset

coreversion
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
Contains bsnes core version number (as one line).
\end_layout

\begin_layout Subsection
Member: projectid
\end_layout

\begin_layout Standard
Contains project ID (as one line).
 Used to identify if two movies are part of the same project.
\end_layout

\begin_layout Subsection
Member: {rom,slota,slotb}{,xml}.sha256
\end_layout

\begin_layout Standard
Contains SHA-256 of said ROM or ROM mapping file (as one line).
 Absent if corresponding file is absent.
\end_layout

\begin_layout Subsection
Member: moviesram.<name>
\end_layout

\begin_layout Standard
Raw binary startup SRAM of kind <name>.
 Only present in savestates and movies starting from SRAM.
\end_layout

\begin_layout Subsection
Member: saveframe
\end_layout

\begin_layout Standard
Contains frame number (as one line) of frame movie was saved on.
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: lagcounter
\end_layout

\begin_layout Standard
Current value of lag counter (as one line).
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: pollcounters
\end_layout

\begin_layout Standard
Contains poll counters (currently 100 of them), one per line.
 Each line is raw poll count if DRDY is set for it.
 Otherwise it is negative poll count minus one.
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: hostmemory
\end_layout

\begin_layout Standard
Raw binary dump of host memory.
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: savestate
\end_layout

\begin_layout Standard
The raw binary savestate itself.
 Savestate detection uses this file, only present in savestates.
\end_layout

\begin_layout Subsection
Member: screenshot
\end_layout

\begin_layout Standard
Screenshot of current frame.
 Only present in savestates.
 First 2 bytes are big-endian width of image, rest are 24-bit RGB image
 data.
 Height of image is inferred from the width and size of data.
\end_layout

\begin_layout Subsection
Member: sram.<name>
\end_layout

\begin_layout Standard
Raw binary SRAM of kind <name> at time of savestate.
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: input
\end_layout

\begin_layout Standard
The actual input track, one line per subframe (blank lines are skipped).
\end_layout

\begin_layout Itemize
If the first byte of each line is '.', ' ', <tab> or '|', then the line is
 part of same frame as previous, otherwise it starts a new frame.
\end_layout

\begin_layout Itemize
First subframe must start a new frame.
\end_layout

\begin_layout Standard
Length of movie in frames is number of lines in input file that start a
 new frame.
\end_layout

\begin_layout Subsection
Member: rerecords
\end_layout

\begin_layout Standard
Contains textual base-10 rerecord count (as one line; emulator just writes
 this, it doesn't read it) + 1.
\end_layout

\begin_layout Subsection
Member: rrdata
\end_layout

\begin_layout Standard
This member stores set of load IDs.
 There is one load ID per rerecord (plus one corresponding to start of project).
\end_layout

\begin_layout Itemize
This member constists of concatenation of records
\end_layout

\begin_layout Itemize
Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
 IDs.
\end_layout

\begin_layout Itemize
IDs are interpretted as 256-bit big-endian integers with warparound.
\end_layout

\begin_layout Itemize
Initial predicted ID is all zeroes.
\end_layout

\begin_layout Standard
Format of each record is:
\end_layout

\begin_layout Itemize
1 byte: Opcode byte.
 Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
 Bit 7 is unused.
\end_layout

\begin_layout Itemize
32-prefixlen bytes of ID.
\end_layout

\begin_layout Itemize
countlen bytes of big-endian count (count).
\end_layout

\begin_layout Standard
Records are processed as follows:
\end_layout

\begin_layout Itemize
To form the first ID encoded by record, take the first prefixlen bytes predicted
 ID and append the read ID value to it.
 The result is the first ID encoded.
\end_layout

\begin_layout Itemize
If countlen is 0, record encodes 1 ID.
\end_layout

\begin_layout Itemize
If countlen is 1, record encodes 2+count IDs.
\end_layout

\begin_layout Itemize
If countlen is 2, record encodes 258+count IDs.
\end_layout

\begin_layout Itemize
If countlen is 3, record encodes 65794+count IDs.
\end_layout

\begin_layout Itemize
The new predicted ID is the next ID after last one encoded by the record.
\end_layout

\begin_layout Standard
The number of rerecords + 1 is equal to the sum of number of IDs encoded
 by all records.
\end_layout

\begin_layout Subsection
Member: starttime.second
\end_layout

\begin_layout Standard
Movie starting time, second part.
 Epoch is Unix epoch.
 Default is 1,000,000,000.
\end_layout

\begin_layout Subsection
Member: starttime.subsecond
\end_layout

\begin_layout Standard
Movie starting time, subsecond part.
 Unit is CPU clocks.
 Default is 0.
\end_layout

\begin_layout Subsection
Member: savetime.second
\end_layout

\begin_layout Standard
Movie saving time, second part.
 Default is starttime.second.
 Only present in savestates.
\end_layout

\begin_layout Subsection
Member: savetime.subsecond
\end_layout

\begin_layout Standard
Movie saving time, subsecond part.
 Default is starttime.subsecond.
 Only present in savestates.
\end_layout

\begin_layout Section
Quick'n'dirty encode guide
\end_layout

\begin_layout Enumerate
Start the emulator and load the movie file.
\end_layout

\begin_layout Enumerate
Set large AVI option 'set-setting avi-large on'
\end_layout

\begin_layout Enumerate
Enable dumping 'dump-avi tmpdump' 
\end_layout

\begin_layout Enumerate
Unpause and let it run until you want to end dumping.
\end_layout

\begin_layout Enumerate
Close the emulator (closing the window is the easiest way).
 Or use 'end-avi'.
\end_layout

\begin_layout Enumerate
For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
\end_layout

\begin_layout Enumerate
Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
\end_layout

\begin_layout Enumerate
Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
 + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
\end_layout

\begin_layout Enumerate
Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
 Now final.mkv contains quick'n'dirty encode.
\end_layout

\begin_layout Section
Axis configurations for some gamepad types:
\end_layout

\begin_layout Subsection
XBox360 controller:
\end_layout

\begin_layout Standard
Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis2 pressure-+
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis5 pressure-+
\end_layout

\begin_layout Itemize
This is needed for SDL only.
 EVDEV sets those types correctly.
\end_layout

\begin_layout Subsection
PS3 
\begin_inset Quotes eld
\end_inset

sixaxis
\begin_inset Quotes erd
\end_inset

 controller:
\end_layout

\begin_layout Standard
Axes 8-19 should be disabled.
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis8 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis9 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis10 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis11 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis12 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis13 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis14 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis15 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis16 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis17 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis18 disabled
\end_layout

\begin_layout LyX-Code
set-axis joystick0axis19 disabled
\end_layout

\begin_layout Section
Errata:
\end_layout

\begin_layout Subsection
Problems from BSNES core:
\end_layout

\begin_layout Itemize
The whole pending save stuff.
\end_layout

\begin_layout Itemize
Lack of layer hiding.
\end_layout

\begin_layout Itemize
It is slow (especially accuracy).
\end_layout

\begin_layout Itemize
Firmwares can't be loaded from ZIP archives.
\end_layout

\begin_layout Subsection
Other problems:
\end_layout

\begin_layout Itemize
Modifiers don't work with pseudo-keys (SDL, EVDEV).
\end_layout

\begin_layout Itemize
Audio for last dumped frame is not itself dumped.
\end_layout

\begin_layout Itemize
Audio in UI is pretty bad in quality if game doesn't run at full speed.
\end_layout

\begin_layout Itemize
AVI compression levels 10-18 are not compatible with AVISynth AVISource.
\end_layout

\begin_layout Itemize
No menus, command based interface (SDL).
\end_layout

\begin_layout Itemize
Long commands don't scroll.
\end_layout

\begin_layout Itemize
Wxwidgets UI is still buggy.
\end_layout

\begin_layout Section
Changelog:
\end_layout

\begin_layout Subsection
rr0-beta1
\end_layout

\begin_layout Itemize
Fix -Wall warnings
\end_layout

\begin_layout Itemize
Fix dumper video corruption with levels 10-18.
\end_layout

\begin_layout Subsection
rr0-beta2
\end_layout

\begin_layout Itemize
Autofire
\end_layout

\begin_layout Itemize
Lots of code cleanups
\end_layout

\begin_layout Itemize
Lua interface to settings
\end_layout

\begin_layout Itemize
Allow specifying AVI borders without Lua
\end_layout

\begin_layout Itemize
Fix scaling if vscale > 1 and originx > 0 (left border exists)
\end_layout

\begin_layout Itemize
on_snoop lua callback
\end_layout

\begin_layout Itemize
Faster movie loading and saving.
\end_layout

\begin_layout Subsection
rr0-beta3
\end_layout

\begin_layout Itemize
Joystick support
\end_layout

\begin_layout Subsection
rr0-beta4
\end_layout

\begin_layout Itemize
Fix multi-buttons
\end_layout

\begin_layout Itemize
Save jukebox functionality.
\end_layout

\begin_layout Subsection
rr0-beta5
\end_layout

\begin_layout Itemize
Try to fix some nasty failing movie load edge cases
\end_layout

\begin_layout Itemize
Allow specifying scripts to run on command line.
\end_layout

\begin_layout Subsection
rr0-beta6
\end_layout

\begin_layout Itemize
Major source code reorganization.
\end_layout

\begin_layout Itemize
Backup savestates before overwriting.
\end_layout

\begin_layout Itemize
Don't crash if loading initial state fails.
\end_layout

\begin_layout Subsection
rr0-beta7
\end_layout

\begin_layout Itemize
Fix firmware lookup
\end_layout

\begin_layout Itemize
Fix author name parsing
\end_layout

\begin_layout Itemize
Fix rerecord counting
\end_layout

\begin_layout Itemize
(SDL) Print messages to console if SDL is uninitialized
\end_layout

\begin_layout Itemize
Add movieinfo program
\end_layout

\begin_layout Itemize
Fix loading movies starting from SRAM.
\end_layout

\begin_layout Subsection
rr0-beta8
\end_layout

\begin_layout Itemize
Add support for unattended dumping
\end_layout

\begin_layout Itemize
Fix compiling for Win32
\end_layout

\begin_layout Itemize
Don't lock up if sound can't be initialized
\end_layout

\begin_layout Itemize
Strip trailing CR from commands
\end_layout

\begin_layout Itemize
Don't try to do dubious things in global ctors (fix crash on startup)
\end_layout

\begin_layout Subsection
rr0-beta9
\end_layout

\begin_layout Itemize
Small documentation tweaking
\end_layout

\begin_layout Itemize
Fix make clean
\end_layout

\begin_layout Itemize
Fix major bug in modifier matching
\end_layout

\begin_layout Subsection
rr0-beta10
\end_layout

\begin_layout Itemize
Lots of documentation fixes
\end_layout

\begin_layout Itemize
Use dedicated callbacks for event backcomm., not commands.
\end_layout

\begin_layout Itemize
Ensure that the watchdog is not hit when executing delayed reset.
\end_layout

\begin_layout Itemize
Remove errant tab from joystick message.
\end_layout

\begin_layout Subsection
rr0-beta11
\end_layout

\begin_layout Itemize
Make autofire operate in absolute time, not linear time
\end_layout

\begin_layout Itemize
Reinitialize controls when resuming from loadstate
\end_layout

\begin_layout Itemize
Some more code cleanups
\end_layout

\begin_layout Itemize
If Lua allocator fails, call OOM_panic()
\end_layout

\begin_layout Itemize
Byte/word/dword/qword sized host memory write/read functions.
\end_layout

\begin_layout Itemize
Dump at correct framerate if dumping interlaced NTSC (height=448).
\end_layout

\begin_layout Subsection
rr0-beta12
\end_layout

\begin_layout Itemize
Actually include the complete source code
\end_layout

\begin_layout Itemize
Keep track of RTC
\end_layout

\begin_layout Subsection
rr0-beta13
\end_layout

\begin_layout Itemize
Document {save,start}time.{,sub}second.
\end_layout

\begin_layout Itemize
Intercept time() from bsnes core.
\end_layout

\begin_layout Subsection
rr0-beta14
\end_layout

\begin_layout Itemize
Allow disabling time() interception (allow build on Mac OS X)
\end_layout

\begin_layout Itemize
Use SDLMain on Mac OS X (make SDL not crash)
\end_layout

\begin_layout Itemize
Disable delayed resets (just plain too buggy for now).
\end_layout

\begin_layout Itemize
Code cleanups
\end_layout

\begin_layout Itemize
Use 16-bit for graphics/video instead of 32-bit.
\end_layout

\begin_layout Itemize
gui.rectangle/gui.pixel
\end_layout

\begin_layout Itemize
gui.crosshair
\end_layout

\begin_layout Itemize
New CSCD writer implementation.
\end_layout

\begin_layout Subsection
rr0-beta15
\end_layout

\begin_layout Itemize
Fix interaction of * and +.
\end_layout

\begin_layout Itemize
Manual improvements
\end_layout

\begin_layout Itemize
Use gettimeofday()/usleep(), these seem portable enough.
\end_layout

\begin_layout Itemize
Move joystick axis manipulation to keymapper code.
\end_layout

\begin_layout Itemize
Changes to how read-only works.
\end_layout

\begin_layout Itemize
Refactor controller input code.
\end_layout

\begin_layout Subsection
rr0-beta16
\end_layout

\begin_layout Itemize
Fix mouseclick scale compensation.
\end_layout

\begin_layout Itemize
Draw area boundaries correctly in SDL code.
\end_layout

\begin_layout Itemize
gui.screenshot.
\end_layout

\begin_layout Itemize
Fix CSCD output (buffer overrun and race condition).
\end_layout

\begin_layout Subsection
rr0-beta17
\end_layout

\begin_layout Itemize
JMD dumping support.
\end_layout

\begin_layout Itemize
Allow unattended dumping to JMD.
\end_layout

\begin_layout Itemize
Move to BSNES v083.
\end_layout

\begin_layout Itemize
Switch back to 32-bit colors.
\end_layout

\begin_layout Itemize
Add Lua function gui.color.
\end_layout

\begin_layout Itemize
Use some new C++11 features in GCC 4.6.
\end_layout

\begin_layout Itemize
Be prepared for core frequency changes.
\end_layout

\begin_layout Itemize
Pass colors in one chunk from Lua.
\end_layout

\begin_layout Subsection
rr0-beta18
\end_layout

\begin_layout Itemize
New lua functions gui.line(), gui.status() and gui.circle(), memory.vma_count(),
 memory.read_vma() and memory.find_vma().
\end_layout

\begin_layout Itemize
Numerious documentation fixups
\end_layout

\begin_layout Itemize
RTC time format changed
\end_layout

\begin_layout Itemize
Reformat flags display
\end_layout

\begin_layout Itemize
Allow lua package name to be overridden
\end_layout

\begin_layout Itemize
SDUMP (high-quality dumping).
\end_layout

\begin_layout Itemize
Split platform support to plugins.
\end_layout

\begin_layout Itemize
Make all sound plugins support basic sound commands
\end_layout

\begin_layout Itemize
Support portaudio for sound.
\end_layout

\begin_layout Itemize
Allow disable Lua/SDL searching.
\end_layout

\begin_layout Itemize
Upconvert colors when copying lcscreen to screen.
\end_layout

\begin_layout Itemize
Reorganize source tree.
\end_layout

\begin_layout Itemize
Evdev joystick support.
\end_layout

\begin_layout Itemize
Refactor more code into generic window code.
\end_layout

\begin_layout Subsection
rr0-beta19
\end_layout

\begin_layout Itemize
Refactor message handling.
\end_layout

\begin_layout Itemize
Rework makefile
\end_layout

\begin_layout Itemize
Documentation fixes
\end_layout

\begin_layout Itemize
Finish pending saves before load/quit.
\end_layout

\begin_layout Itemize
Wxwidgets graphics plugin.
\end_layout

\begin_layout Subsection
rr0-beta20
\end_layout

\begin_layout Itemize
Get rid of win32-crap.[ch]pp.
\end_layout

\begin_layout Itemize
Move files around a lot.
\end_layout

\begin_layout Itemize
Get rid of need for host C++ compiler.
\end_layout

\begin_layout Itemize
Bsnes v084 core.
\end_layout

\begin_layout Itemize
Refactor inter-component communication.
\end_layout

\begin_layout Itemize
Fix zero luma.
\end_layout

\begin_layout Itemize
Fix crash on multiline aliases.
\end_layout

\begin_layout Itemize
Load/Save settings in wxwidgets gui.
\end_layout

\begin_layout Subsection
rr0-beta21
\end_layout

\begin_layout Itemize
Patch problems in bsnes core
\end_layout

\begin_layout Itemize
SNES is little-endian, not big-endian!
\end_layout

\begin_layout Itemize
Fix memory corruption in lcscreen::load()
\end_layout

\begin_layout Subsection
rr0-beta22
\end_layout

\begin_layout Itemize
Fix interpretting repeat counts in rrdata loading.
\end_layout

\begin_layout Itemize
New lua callback: on_frame()
\end_layout

\begin_layout Itemize
Remove calls to runtosave() that aren't supposed to be there
\end_layout

\begin_layout Itemize
Lua function: movie.read_rtc()
\end_layout

\begin_layout Itemize
Ignore src/fonts/font.cpp
\end_layout

\begin_layout Itemize
Fix more bsnes core problems
\end_layout

\begin_layout Itemize
Control bsnes random seeding
\end_layout

\begin_layout Itemize
Pause-on-end
\end_layout

\begin_layout Itemize
Some bsnes core debugging features (state dump and state hash)
\end_layout

\begin_layout Itemize
Fix titlebar version number (no, the last version wasn't 'lsnes-0-beta21',
 it was 'lsnes rr0-beta21').
\end_layout

\begin_layout Subsection
rr0-beta23
\end_layout

\begin_layout Itemize
Fix memory corruption due to macro/field mixup
\end_layout

\begin_layout Itemize
search-memory update
\end_layout

\begin_layout Itemize
Allow direct-mapped framebuffer
\end_layout

\begin_layout Itemize
SDL: Use SDL_ANYFORMAT if possible
\end_layout

\begin_layout Itemize
SDMP2SOX: 2s delay modes.
\end_layout

\begin_layout Itemize
Wxwidgets: Cleanups
\end_layout

\begin_layout Itemize
Use sed -E, not sed -r.
 Fixes building on Mac OS X.
\end_layout

\begin_layout Itemize
Wxwidgets: Save jukebox on exit
\end_layout

\begin_layout Itemize
Fix RTC if using load-movie on savestate.
\end_layout

\begin_layout Itemize
Fix crash related to full console mode.
\end_layout

\begin_layout Subsection
rr0-beta24
\end_layout

\begin_layout Itemize
Wxwidgets: Allow bringing application to foreground on Mac OS X.
\end_layout

\begin_layout Itemize
Wxwidgets: Allow compiling on Mac OS X.
\end_layout

\begin_layout Itemize
Use movie compare instead of movie hashing (faster save/load).
\end_layout

\begin_layout Itemize
Lua: _SYSTEM table.
\end_layout

\begin_layout Subsection
rr0-beta25
\end_layout

\begin_layout Itemize
sdmp2sox: Pad soundtrack if using -l or -L.
\end_layout

\begin_layout Itemize
sdmp2sox: Fix NTSC overscan.
\end_layout

\begin_layout Itemize
sdmp2sox: Add AR correction mode.
\end_layout

\begin_layout Itemize
call lua_close() when exiting.
\end_layout

\begin_layout Itemize
Fix zip_writer bug causing warnings from info-zip and error from advzip.
\end_layout

\begin_layout Subsection
rr0-beta26
\end_layout

\begin_layout Itemize
Fix IPS patching code (use bsnes core IPS patcher).
\end_layout

\begin_layout Itemize
Implement BPS patching (using bsnes core IPS patcher).
\end_layout

\begin_layout Itemize
Add feature to load headered ROMs.
\end_layout

\begin_layout Subsection
rr0-beta27
\end_layout

\begin_layout Itemize
Show command names when showing keybindings
\end_layout

\begin_layout Subsection
rr0
\end_layout

\begin_layout Itemize
Fix pause-on-end to be actually controllable
\end_layout

\begin_layout Itemize
SDL: Poll all events in queue, not just first one (fixes slowness in command
 typing)
\end_layout

\begin_layout Itemize
Wxwidgets: Fix ROM loading.
\end_layout

\begin_layout Subsection
rr1-beta0
\end_layout

\begin_layout Itemize
Lua: Add gui.textH, gui.textV, gui.textHV
\end_layout

\begin_layout Itemize
Fix text colors on SDL on Mac OS X
\end_layout

\begin_layout Itemize
Mode 'F' for finished in readonly mode.
\end_layout

\begin_layout Itemize
Fix some WS errors.
\end_layout

\begin_layout Itemize
Reliably pause after skip poll
\end_layout

\begin_layout Itemize
Split UI and core into their own threads
\end_layout

\begin_layout Subsection
rr1-beta1
\end_layout

\begin_layout Itemize
Remove leftover dummy SRAM slot
\end_layout

\begin_layout Itemize
Fix controller numbers.
\end_layout

\begin_layout Subsection
rr1-beta2
\end_layout

\begin_layout Itemize
Fix lsnes-dumpavi after interface change.
\end_layout

\begin_layout Itemize
Also give BSNES patches for v085.
\end_layout

\begin_layout Itemize
Pack movie data in memory.
\end_layout

\begin_layout Subsection
rr1-beta3
\end_layout

\begin_layout Itemize
Fix framecount/length given when loading movies.
\end_layout

\begin_layout Itemize
Controller command memory leak fixes.
\end_layout

\begin_layout Itemize
Don't leak palette if freeing screen object.
\end_layout

\begin_layout Subsection
rr1-beta4
\end_layout

\begin_layout Itemize
Detect revisions.
\end_layout

\begin_layout Itemize
Wxwidgets: Allow controlling dumper from the menu.
\end_layout

\begin_layout Subsection
rr1-beta5
\end_layout

\begin_layout Itemize
Rewrite parts of manual
\end_layout

\begin_layout Itemize
Lua: Make it work with Lua 5.2.
\end_layout

\begin_layout Subsection
rr1-beta6
\end_layout

\begin_layout Itemize
Win32: Fix compile errors.
\end_layout

\begin_layout Subsection
rr1-beta7
\end_layout

\begin_layout Itemize
Refactor controller input code.
\end_layout

\begin_layout Itemize
Fix crash when using command line on SDL / Mac OS X.
\end_layout

\begin_layout Subsection
rr1-beta8
\end_layout

\begin_layout Itemize
Delete core/coroutine (obsolete)
\end_layout

\begin_layout Itemize
Lag input display by one frame.
\end_layout

\begin_layout Itemize
Rewind movie to beginning function.
\end_layout

\begin_layout Itemize
Fix wrong frame number reported to Lua when repainting after loadstate
\end_layout

\begin_layout Itemize
Support UI editing of jukebox
\end_layout

\begin_layout Itemize
Wxwidgets: Save settings on exit.
\end_layout

\begin_layout Itemize
Support ${project} for filenames
\end_layout

\begin_layout Itemize
SDL: Fix command history
\end_layout

\begin_layout Subsection
rr1-beta9
\end_layout

\begin_layout Itemize
Fix some order-of-global-ctor bugs.
\end_layout

\begin_layout Subsection
rr1-beta10
\end_layout

\begin_layout Itemize
Fix crashes when quitting on Win32.
\end_layout

\begin_layout Subsection
rr1-beta11
\end_layout

\begin_layout Itemize
EVDEV: Queue keypresses from joystick, don't send directly
\end_layout

\begin_layout Itemize
Wxwidgets: Load-Preserve that actually works.
\end_layout

\begin_layout Subsection
rr1-beta12
\end_layout

\begin_layout Itemize
Wxwidgets: GUI for memory search.
\end_layout

\begin_layout Itemize
Warn about using synchronous queue in UI callback.
\end_layout

\begin_layout Subsection
rr1-beta13
\end_layout

\begin_layout Itemize
Remember last saved file for each ROM
\end_layout

\begin_layout Itemize
Support MT dumping via boost.
\end_layout

\begin_layout Itemize
Lua: input.raw
\end_layout

\begin_layout Itemize
Lua: input.keyhook
\end_layout

\begin_layout Itemize
Make mouse be ordinary input instead of special-casing
\end_layout

\begin_layout Itemize
SDL: Don't screw up commands with NUL codepoints.
\end_layout

\begin_layout Subsection
rr1-beta14
\end_layout

\begin_layout Itemize
Merge status panel and main window
\end_layout

\begin_layout Itemize
True movie slot support (the rest of it)
\end_layout

\begin_layout Itemize
SDL: Fix compilation error
\end_layout

\begin_layout Itemize
Elminate cross calls in dump menu code.
\end_layout

\begin_layout Subsection
rr1-beta15
\end_layout

\begin_layout Itemize
Cancel pending saves command
\end_layout

\begin_layout Itemize
Wxwidgets: Code refactoring
\end_layout

\begin_layout Itemize
Wxwidgets: Fix system -> reset
\end_layout

\begin_layout Itemize
Wxwidgets: Read watch expressions in the right thread
\end_layout

\begin_layout Subsection
rr1-beta16
\end_layout

\begin_layout Itemize
Wxwidgets: Don't prompt for member when running Lua script (Lua doesn't
 support that).
\end_layout

\begin_layout Itemize
Wxwidgets: 128 -> 1024 Autohold slots (in case more are needed).
\end_layout

\begin_layout Itemize
Don't append trailing '-' to prefix when saving movie.
\end_layout

\begin_layout Itemize
Fix ROM/savestate handling (don't let user mismatch ROM and savestates).
\end_layout

\begin_layout Subsection
rr1
\end_layout

\begin_layout Itemize
Document memory watch syntax.
\end_layout

\end_body
\end_document
