lsnes/manual.lyx
2011-10-22 15:15:18 +03:00

4127 lines
80 KiB
Text

#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
Command line options
\end_layout
\begin_layout Itemize
Syntax: lsnes.exe <rom-options> <misc-options> (<new-session-options>|<filename>)
\end_layout
\begin_layout Itemize
Syntax: lsnes-avidump <dump-options> <misc-options> <rom-options> <filename>
\end_layout
\begin_layout Itemize
Syntax: movieinfo.exe <filename>
\end_layout
\begin_layout Subsection
ROM options
\end_layout
\begin_layout Standard
These options control loading the ROM.
\end_layout
\begin_layout Subsubsection
--rom=<file>
\end_layout
\begin_layout Standard
Load <file> (SFC file format) as main SNES cartridge ROM.
This is the game ROM for SNES and cartridge BIOS for other types.
Required option.
\end_layout
\begin_layout Subsubsection
--rom-xml=<file>
\end_layout
\begin_layout Standard
Set the mapping XML file for main cartridge ROM.
If not specified, defaults are used.
\end_layout
\begin_layout Subsubsection
--bsx=<file>
\end_layout
\begin_layout Standard
Load <file> (BS file format) as BS-X non-slotted flash memory.
Also sets system type to BS-X non-slotted (not compatible with --bsxslotted=<fi
le>, --dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
\end_layout
\begin_layout Subsubsection
--bsx-xml=<file>
\end_layout
\begin_layout Standard
Set mapping XML file for BS-X non-slotted flash memory.
If not specified, defaults are used.
Only can be used together with --bsx=<file>.
\end_layout
\begin_layout Subsubsection
--bsxslotted=<file>
\end_layout
\begin_layout Standard
Load <file> (BS file format) as BS-X slotted flash memory.
Also sets system type to BS-X slotted (not compatible with --bsx=<file>,
--dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
\end_layout
\begin_layout Subsubsection
--bsxslotted-xml=<file>
\end_layout
\begin_layout Standard
Set mapping XML file for BS-X slotted flash memory.
If not specified, defaults are used.
Only can be used together with --bsxslotted=<file>.
\end_layout
\begin_layout Subsubsection
--dmg=<file>
\end_layout
\begin_layout Standard
Load <file> (GB file format) as Game Boy ROM.
Also sets system type to SGB (not compatible with --bsx=<file>, --bsxslotted=<f
ile>, --slot-a=<file> nor --slot-b=<file>).
\end_layout
\begin_layout Subsubsection
--dmg-xml=<file>
\end_layout
\begin_layout Standard
Set mapping XML file for Game Boy ROM.
If not specified, defaults are used.
Only can be used together with --dmg=<file>.
\end_layout
\begin_layout Subsubsection
--slot-a=<file>
\end_layout
\begin_layout Standard
Load <file> (ST file format) as Sufami turbo cartridge A ROM.
Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
--bsxslotted=<file> nor --dmg=<file>).
\end_layout
\begin_layout Subsubsection
--slot-a-xml=<file>
\end_layout
\begin_layout Standard
Set mapping XML file for Sufami turbo cartridge A ROM.
If not specified, defaults are used.
Only can be used together with --slot-a=<file>.
\end_layout
\begin_layout Subsubsection
--slot-b=<file>
\end_layout
\begin_layout Standard
Load <file> (ST file format) as Sufami turbo cartridge B ROM.
Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
--bsxslotted=<file> nor --dmg=<file>).
\end_layout
\begin_layout Subsubsection
--slot-b-xml=<file>
\end_layout
\begin_layout Standard
Set mapping XML file for Sufami turbo cartridge B ROM.
If not specified, defaults are used.
Only can be used together with --slot-b=<file>.
\end_layout
\begin_layout Subsubsection
--ips-rom=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to main cartridge ROM.
Requires --rom=<file>.
\end_layout
\begin_layout Subsubsection
--ips-rom-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to main cartridge ROM mapping XML.
Requires --rom-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-bsx=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to BS-X non-slotted flash.
Requires --bsx=<file>.
\end_layout
\begin_layout Subsubsection
--ips-bsx-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to BS-X non-slotted flash mapping XML.
Requires --bsx-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-bsxslotted=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to BS-X slotted flash.
Requires --bsxslotted=<file>.
\end_layout
\begin_layout Subsubsection
--ips-bsxslotted-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to BS-X slotted flash mapping XML.
Requires --bsxslotted-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-dmg=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Game Boy ROM.
Requires --dmg=<file>.
\end_layout
\begin_layout Subsubsection
--ips-dmg-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Game Boy ROM mapping XML.
Requires --dmg-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-slot-a=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Sufami turbo cartridge A ROM.
Requires --slot-a=<file>.
\end_layout
\begin_layout Subsubsection
--ips-slot-a-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Sufami turbo cartridge A ROM mapping XML.
Requires --slot-a-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-slot-b=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Sufami turbo cartridge B ROM.
Requires --slot-b=<file>.
\end_layout
\begin_layout Subsubsection
--ips-slot-b-xml=<file>
\end_layout
\begin_layout Standard
Apply IPS patch <file> to Sufami turbo cartridge B ROM mapping XML.
Requires --slot-b-xml=<file>.
\end_layout
\begin_layout Subsubsection
--ips-offset=<offset>
\end_layout
\begin_layout Standard
Set IPS apply offset to <offset> (can be negative).
IPS apply offset is added to all addresses inside IPS file before applying.
If the resulting address is negative, write is ignored (with a warning).
If resulting address exceeds ROM size, the ROM is extended.
\end_layout
\begin_layout Subsubsection
--pal
\end_layout
\begin_layout Standard
Force ROM to be considered PAL-only (warning: Will cause error if used on
anything except SNES and SGB).
\end_layout
\begin_layout Subsubsection
--ntsc
\end_layout
\begin_layout Standard
Force ROM to be considered NTSC-only (default for everything except SNES
and SGB).
\end_layout
\begin_layout Subsection
New session options (lsnes.exe only)
\end_layout
\begin_layout Standard
If filename is not specified, new session is started.
These options control the properties of new session:
\end_layout
\begin_layout Subsubsection
--port1=<type>
\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>
\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>
\end_layout
\begin_layout Standard
Set the name of game to <name>
\end_layout
\begin_layout Subsubsection
--author=<name>
\end_layout
\begin_layout Standard
Add author with full name of <name> (no nickname).
\end_layout
\begin_layout Subsubsection
--author=|<name>
\end_layout
\begin_layout Standard
Add author with nickname of <name> (no full name).
\end_layout
\begin_layout Subsubsection
--author=<fullname>|<nickname>
\end_layout
\begin_layout Standard
Add author with full name of <fullname> and nickname of <nickname>.
\end_layout
\begin_layout Subsubsection
--rtc-second=<value>
\end_layout
\begin_layout Standard
Set RTC second (0 is 1st January 1970 00:00:00Z).
\end_layout
\begin_layout Subsubsection
--rtc-subsecond=<value>
\end_layout
\begin_layout Standard
Set RTC subsecond.
Range is 0-3,462,619,485,019.
\end_layout
\begin_layout Subsection
<filename>
\end_layout
\begin_layout Standard
If filename is specified on command line, it is loaded as initial state
(instead of constructing one).
Mandatory for lsnes-avidump.exe and movieinfo.exe.
\end_layout
\begin_layout Subsection
Misc.
options
\end_layout
\begin_layout Subsubsection
--run=<file> (lsnes.exe only)
\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-avidump.exe 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-avidump.exe 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 Section
Startup file lsnes.rc
\end_layout
\begin_layout Standard
Upon startup, lsnes (lsnes.exe 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
Game 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 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 Subsection
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
AVI Video dumping
\end_layout
\begin_layout Standard
Following commands control AVI video dumping:
\end_layout
\begin_layout Subsubsection
dump-avi <level> <prefix>
\end_layout
\begin_layout Standard
Dump AVI video to prefix <prefix> at level <level> (0-18).
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
Levels 10-18 are not compatible with AVISource.
\end_layout
\begin_layout Itemize
Recomended level is 7 if decoded by AVISource.
\end_layout
\begin_layout Itemize
Recomended level is 16 if decoded by ffmpeg, mencoder or FFMpegSource.
\end_layout
\begin_layout Itemize
Dumps of low-res PAL games are 256x239 (with all the consequences odd height
carries).
\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 Subsection
JMD video dumping
\end_layout
\begin_layout Standard
Following commands control JMD video dumping:
\end_layout
\begin_layout Subsubsection
dump-jmd <level> <file>
\end_layout
\begin_layout Standard
Dump JMD video to file <file> at level <level> (0-9).
\end_layout
\begin_layout Subsubsection
end-jmd
\end_layout
\begin_layout Standard
End the current JMD 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
eval-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
SDL Platform commands
\end_layout
\begin_layout Standard
The following are valid on SDL platform.
\end_layout
\begin_layout Subsubsection
enable-sound on
\end_layout
\begin_layout Standard
Enable sounds in GUI (has no effect on video dumping).
\end_layout
\begin_layout Subsubsection
enable-sound off
\end_layout
\begin_layout Standard
Disable sounds in GUI (has no effect on video dumping).
\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 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
none(number...) / 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
any(number...) / 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
all(number...) / 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
parity(number...) / 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
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
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
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
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
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.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 Subsection
table input
\end_layout
\begin_layout Standard
Input handling.
Only available in on_input callback.
\end_layout
\begin_layout Subsection
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 Subsection
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 Subsection
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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_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 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 Standard
In addition, following pseudo-keys are known (note: these do not work in
conjunction with modifers):
\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 Subsubsection
Watchdog timer:
\end_layout
\begin_layout Standard
If emulator does not reach internal polling loop in 15 seconds after leaving
it or 15 seconds after starting, the emulator instantly bombs out.
\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: moviestate
\end_layout
\begin_layout Standard
Raw binary movie state data.
Only present in savestates.
\end_layout
\begin_layout Standard
for version 0:
\end_layout
\begin_layout Itemize
32 bytes: SHA-256 of project ID.
\end_layout
\begin_layout Itemize
8 bytes: Big-endian current frame.
\end_layout
\begin_layout Itemize
100x4 bytes: Poll counters for each control (bit31 of each is
\begin_inset Quotes eld
\end_inset
data ready
\begin_inset Quotes erd
\end_inset
bit), big-endian.
\end_layout
\begin_layout Itemize
8 bytes: Big-endian lag frame count.
\end_layout
\begin_layout Itemize
32 bytes: SHA-256 of past input
\end_layout
\begin_layout Itemize
32 bytes: SHA-256 of previous.
\end_layout
\begin_layout Itemize
(total of 512 bytes)
\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 big-endian 15-bit
image data (5 bits per channel*pixel, the MSB is unused).
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 1/3,462,619,485,020 s.
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
Compiling:
\end_layout
\begin_layout Subsection
Building BSNES
\end_layout
\begin_layout Standard
make ui=ui-libsnes profile=accuracy
\end_layout
\begin_layout Subsection
Prerequisite libraries:
\end_layout
\begin_layout Itemize
zlib
\end_layout
\begin_layout Itemize
SDL (SDL platform)
\end_layout
\begin_layout Itemize
SDLmain (Windows/Mac OS X only; Note you may have to extract the object
out of archive)
\end_layout
\begin_layout Itemize
boost_iostreams
\end_layout
\begin_layout Itemize
boost_filesystem
\end_layout
\begin_layout Itemize
boost conversion (header only)
\end_layout
\begin_layout Subsection
Compile options to make:
\end_layout
\begin_layout Subsubsection
BSNES_PATH=<path>
\end_layout
\begin_layout Standard
Set path to BSNES bsnes directory to <path>.
\end_layout
\begin_layout Subsubsection
NO_THREADS=1
\end_layout
\begin_layout Standard
Don't use threads on Linux.
\end_layout
\begin_layout Subsubsection
USE_THREADS=1
\end_layout
\begin_layout Standard
Try to use threads even on non-Linux systems.
\end_layout
\begin_layout Subsubsection
CC=<compiler>
\end_layout
\begin_layout Standard
Target C++ compiler to use.
Defaults to g++-4.5.
\end_layout
\begin_layout Standard
Note: If crosscompiling, this has to be crosscompiler.
\end_layout
\begin_layout Subsubsection
HOSTCC=<compiler>
\end_layout
\begin_layout Standard
Host C++ compiler to use.
Defaults to the same as CC.
\end_layout
\begin_layout Standard
Note: If crosscompiling, that has to be host compiler (the files produced
will be run in the build process!)
\end_layout
\begin_layout Subsubsection
BSNES_IS_COMPAT=1
\end_layout
\begin_layout Standard
Assume BSNES uses compatiblity core instead of accuracy core.
\end_layout
\begin_layout Subsubsection
NO_LUA=1
\end_layout
\begin_layout Standard
Don't compile in Lua support.
\end_layout
\begin_layout Subsubsection
NO_TIME_INTERCEPT=1
\end_layout
\begin_layout Standard
Disable time() interception.
Prevents recording games using RTC but allows building on some platforms,
notably Mac OS X.
\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
If dumping PAL, set bottom border to 2 'set-setting avi-bottom-border 2'
\end_layout
\begin_layout Enumerate
Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are
\begin_inset Quotes eld
\end_inset
use only if you know what you are doing.
\begin_inset Quotes erd
\end_inset
.
In this case, these can be safely used because of how x264 internally works.
\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)
\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 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
Delay resets are slow.
\end_layout
\begin_layout Itemize
RTC is not emulated in sync-stable manner.
\end_layout
\begin_layout Itemize
Lack of layer hiding.
\end_layout
\begin_layout Itemize
It is slow.
\end_layout
\begin_layout Itemize
Firmwares can't be loaded from ZIP archives.
\end_layout
\begin_layout Itemize
Manual polls can be corrupted if savestate occurs during those.
\end_layout
\begin_layout Subsection
Other problems:
\end_layout
\begin_layout Itemize
Modifiers don't work with pseudo-keys (SDL).
\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.
\end_layout
\begin_layout Itemize
UI itself is 30fps max.
\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 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
\end_body
\end_document