lsnes rr1-Δ17ε4
[lsnes.git] / manual.txt
blob3cee0accfa80f29c314d855b48976d879c3cd211
1 1 Introduction
3 lsnes is SNES rerecording emulator based on bsnes core.
5 2 Dependencies
7 1. bsnes libsnes (for bsnes SNES core)
9   (a) v084-v087 (v084 or v085 for delayreset support)
11   (b) accuracy or compatiblity core with debugger enabled.
13   (c) Patched version (using included 7 patches)
15 2. gambatte (for gambatte core)
17   (a) SVN r320, r358 or r364
19   (b) Patched with included patches
21 3. Zlib
23 4. boost_iostreams
25 5. boost_filesystem
27 6. boost_thread (if native std::thread is not available)
29 7. libsdl (SDL only)
31 8. sdlmain (SDL only, part of SDL)
33 9. boost_conversion (this is header-only library)
35 10. libswscale (wxwidgets graphics only)
37 11. Portaudio (portaudio sound only)
39 12. libao (libao sound only)
41 13. Lua (if Lua support is needed) version 5.1.X or 5.2.X
43 14. G++ 4.6 or 4.7
45 15. libopus (optional, for commentary track tool)
47 3 Building
49 • Copy bsnes sources (the bsnes subdirectory) to subdirectory 
50   'bsnes' (for bsnes core).
52 • Copy gambatte sources to subdirectory 'gambatte' (for gambatte 
53   core).
55 • Patch the bsnes sources with included patches (directory 
56   'bsnes-patches/<version>', bsnes core)
58 • Patch the gambatte sources with included patches (directory 
59   'gambatte-patches/<version>', gambatte core)
61 • Edit options.build (or copy of that file)
63 • Run make (passing 'OPTIONS=<filename>' if using something else 
64   than options.build).
66 4 Command line options
68 4.1 ROM options
70 4.1.1 --rom=<file> (lsnes/SDL, lsnes/wxwidgets, lsnes-avidump)
72 Load <file> as ROM.
74 4.1.2 <file> (lsnes/wxwidgets)
76 Load <file> as ROM.
78 4.2 Session options
80 4.2.1 --pause
82 Start paused
84 4.2.2 <filename> (lsnes/SDL, lsnes-avidump, movieinfo)
86 Load <filename> as movie or savestate file. All other session 
87 options are ignored.
89 4.2.3 --port1=<device> (lsnes/SDL, bsnes core only)
91 Set type of port1. Valid values are:
93 • none: No device connected
95 • gamepad: One gamepad (the default)
97 • multitap: Four gamepads (warning: makes most games refuse to 
98   start)
100 • mouse: Mouse.
102 4.2.4 --port2=<type> (lsnes/SDL, bsnes core only)
104 Set type of port2. Valid values are:
106 • none: No device connected (the default)
108 • gamepad: One gamepad
110 • multitap: Four gamepads.
112 • mouse: Mouse
114 • superscope: Super Scope
116 • justifier: One justifier
118 • justifiers: Two justifiers
120 4.2.5 --gamename=<name> (lsnes/SDL)
122 Set the name of game to <name>. Default is blank.
124 4.2.6 --author=<name> (lsnes/SDL)
126 Add author with full name of <name> (no nickname).
128 4.2.7 --author=|<name> (lsnes/SDL)
130 Add author with nickname of <name> (no full name).
132 4.2.8 --author=<fullname>|<nickname> (lsnes/SDL)
134 Add author with full name of <fullname> and nickname of 
135 <nickname>.
137 4.2.9 --rtc-second=<value> (lsnes/SDL)
139 Set RTC second (0 is 1st January 1970 00:00:00Z). Default is 
140 1,000,000,000.
142 4.2.10 --rtc-subsecond=<value> (lsnes/SDL)
144 Set RTC subsecond. Range is 0-. Unit is CPU cycle. Default is 0.
146 4.2.11 --anchor-savestate=<file> (lsnes/SDL)
148 Set the anchor savestate file.
150 4.2.12 --load=<file> (lsnes/wxwidgets)
152 After loading the ROM, load <file> as savestate/movie.
154 4.3 Misc. options:
156 4.3.1 --run=<file> (lsnes/SDL)
158 After running main RC file, run this file. If multiple are 
159 specified, these execute in order specified.
161 4.3.2 --lua=<file> (lsnes/wxwidgets)
163 Run this Lua file on startup
165 4.4 dump options (lsnes-dumpavi only)
167 4.4.1 --dumper=<dumper>
169 Set the dumper to use (required). Use 'list' for listing of known 
170 dumpers.
172 4.4.2 --mode=<mode>
174 Set the mode to use (required for dumpers with multiple modes, 
175 forbidden otherwise). Use 'list' for known modes.
177 4.4.3 --prefix=<prefix>
179 Set dump prefix. Default is “avidump”.
181 4.4.4 --option=<name>=<value>
183 Set option <name> to value <value>.
185 4.4.5 --length=<length>
187 Set number of frames to dump. Mandatory.
189 4.4.6 --lua=<script>
191 Run specified lua script (lsnes-dumpavi does not have 
192 initialization files).
194 4.4.7 --load-library=<library>
196 Load the specified shared object / dynamic library / dynamic link 
197 library.
199 5 Startup file lsnes.rc
201 Upon startup, lsnes (lsnes/SDL only) executes file lsnes.rc as 
202 commands. This file is located in:
204 • Windows: %APPDATA%\lsnes\lsnes.rc (if %APPDATA% exists)
206 • Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME 
207   exists)
209 • Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
211 • All: ./lsnes.rc (fallback default).
213 If leading directories do not exist, attempt to create them is 
214 made.
216 6 Internal commands
218 • Commands beginning with '*' invoke the corresponding command 
219   without alias expansion.
221 • If command starts with '+' (after possible '*'), the command is 
222   executed as-is when button is pressed, and when button is 
223   released, it is executed with '+' replaced by '-'.
225 • Commands without '+' execute only on negative edge (release).
227 6.1 Settings:
229 Settings control various aspects of emulator behaviour.
231 6.1.1 set-setting <setting> <value>
233 Sets setting <setting> to value <value> (may be empty).
235 6.1.2 unset-setting <setting>
237 Try to unset setting <setting> (not all settings can be unset).
239 6.1.3 get-setting <setting>
241 Read value of setting <setting>
243 6.1.4 show-settings
245 Print names and values of all settings.
247 6.2 Keybindings
249 Keybindings bind commands or aliases to keys (or pseudo-keys). 
251 Notes:
253 • Do not bind edge active (+/-) commands to keys with modifiers, 
254   that won't work right!
256 • Names of keys and modifiers are platform-dependent.
258 • Be careful before binding pseudo-keys (such as joystick axes, 
259   buttons or hats) with modifiers. That may or may not work 
260   right.
262 6.2.1 bind-key [<mod>/<modmask>] <key> <command>
264 Bind <command> to key <key> (activating if modifiers in <modmask> 
265 (comma-seperated list) are set as <mod> (comma-seperated list).
267 The names of keys and modifiers are platform-dependent.
269 6.2.2 unbind-key [<mod>/<modmask>] <key>
271 Unbind command from <key> (with specified <mod> and <modmask>).
273 6.2.3 set-axis <axis> [disabled | axis | axis-inverse | 
274   pressure0- | pressure0+ | pressure-0 | pressure-+ | pressure+0 
275   | pressure+-] [minus=<val>] [zero=<val>] [plus=<val>] 
276   [tolerance=<val>]
278 Set axis parameters for axis <axis>.
280 • disabled: Disable axis
282 • axis: Normal axis
284 • axis-inverse: Inverse axis
286 • pressure0-: Pressure sensitive. Released at 0, pressed at -.
288 • pressure0+: Pressure sensitive. Released at 0, pressed at +.
290 • pressure-0: Pressure sensitive. Released at -, pressed at 0.
292 • pressure-+: Pressure sensitive. Released at -, pressed at +.
294 • pressure+0: Pressure sensitive. Released at +, pressed at 0.
296 • pressure+-: Pressure sensitive. Released at +, pressed at -.
298 • minus=<val>: Calibration at extreme minus position 
299   (-32768-32767)
301 • zero=<val>: Calibration at neutral position (-32768-32767)
303 • plus=<val>: Calibration at extreme plus position (-32768-32767)
305 • tolerance=<value>: Center band tolerance (0<x<1). The smaller 
306   the value, the more sensitive the control is.
308 6.2.4 show-bindings
310 Print all key bindings in effect.
312 6.3 Aliases
314 Aliases bind command to sequence of commands. After alias has 
315 been defined, it replaces the command it shadows.
317 Notes:
319 • You can't alias command to itself.
321 • Aliases starting with +/- are edge active just like ordinary 
322   commands starting with +/-.
324 • One command can be aliased to multiple commands.
326 6.3.1 alias-command <command> <expansion>
328 Append <expansion> to alias <command>. If alias does not already 
329 exist, it is created.
331 6.3.2 unalias-command <command>
333 Clear alias expansion for <command>.
335 6.3.3 show-aliases
337 Print all aliases and their expansions in effect.
339 6.4 run-script <script>
341 Run <script> as if commands were entered on the command line.
343 6.5 Video dumping
345 Following commands control video dumping:
347 6.5.1 start-dump <dumper> [<mode>] <prefix/filename>
349 Start dumping using dumper <dumper>. If mode is present or not 
350 and if prefix or filename is present depends on the dumper and 
351 dumper mode.
353 The following dumpers are available:
355 • INTERNAL-AVI-CSCD: Internal CSCD in .avi dumper.
357   – Mode: uncompressed/pcm: Uncompressed video, PCM audio. Takes 
358     prefix.
360   – Mode: cscd/pcm: CSCD video, PCM audio. Takes prefix.
362 • INTERNAL-JMD: Internal .jmd dumper.
364   – Does not take mode.
366   – Takes a filename.
368 • INTERNAL-RAW: Internal RAW dumper.
370   – Does not take mode.
372   – Takes a prefix.
374   – Sound is big-endian signed 16-bit, usually at 32040.5Hz.
376   – Video is always upscaled to double resolution (512x448 / 512 
377     x 478).
379   – Video framerate is usually 322445/6448 fps for PAL and 
380     10738636/178683 fps for NTSC.
382 • INTERNAL-SDMP: Internal SDMP dumper.
384   – Mode 'ms': Multi-segment. Takes prefix.
386   – Mode 'ss': Single-segment. Takes filename.
388 6.5.2 end-dump <dumper>
390 End dumping using <dumper>
392 6.5.3 show-dumpers [<dumper>]
394 Show the list of dumpers or list of modes for <dumper>
396 6.6 Memory manipulation
398 <address> may be decimal or hexadecimal (prefixed with '0x'). 
399 <value> can be hexadecimal (prefixed with '0x'), unsigned or 
400 signed (prefixed with '-') decimal.
402 The available element <sizes> are:
404 • byte: 1 byte
406 • word: 2 bytes
408 • dword: 4 bytes
410 • qword: 8 bytes
412 When reading RAM and ROM, multi-byte reads/writes are big-endian. 
413 When dealing with DSP memory, multi-byte reads/writes are 
414 native-endian (do not use operand sizes exceeding DSP bitness, 
415 except dword is OK for 24-bit memory).
417 6.6.1 read-<size> <address>
419 Read the value of byte in <address>.
421 6.6.2 read-s<size> <address>
423 Read the value of signed byte in <address>.
425 6.6.3 write-<size> <address> <value>
427 Write <value> to byte in address <address>.
429 6.6.4 search-memory reset
431 Reset the memory search
433 6.6.5 search-memory count
435 Print number of candidates remaining
437 6.6.6 search-memory print
439 Print all candidates remaining
441 6.6.7 search-memory <usflag><sizeflag><op>
443 Searches memory for addresses satisfying criteria.
445 <usflag> can be:
447 • u: unsigned
449 • s: signed
451 <sizeflag> can be:
453 • b: byte
455 • w: word
457 • d: dword
459 • q: qword
461 <op> can be:
463 • lt: < previous value.
465 • le: <= previous value.
467 • eq: = previous value.
469 • ne: != previous value.
471 • ge: >= previous value.
473 • gt: > previous value.
475 6.6.8 search-memory <sizeflag> <value>
477 Searches for addresses that currently have value <value>. 
478 <sizeflag> is as in previous command.
480 6.7 Main commands
482 These commands are not available in lsnesrc, but are available 
483 after ROM has been loaded.
485 6.7.1 quit-emulator [/y]
487 Quits the emulator (asking for confirmation). If /y is given, no 
488 confirmation is asked.
490 6.7.2 pause-emulator
492 Toggle paused/unpaused
494 6.7.3 +advance-frame 
496 Advance frame. If the button is still held after configurable 
497 timeout expires, game unpauses for the duration frame advance is 
498 held.
500 6.7.4 +advance-poll 
502 Advance subframe. If the button is still held after configurable 
503 timeout expires, game unpauses for the duration frame advance is 
504 held.
506 6.7.5 advance-skiplag 
508 Skip to first poll in frame after current.
510 6.7.6 reset 
512 Reset the SNES after this frame.
514 6.7.7 load <filename> 
516 Load savestate <filename> in current mode.
518 6.7.8 load-state <filename> 
520 Load savestate <filename> in readwrite mode.
522 6.7.9 load-readonly <filename> 
524 Load savestate <filename> in readonly mode.
526 6.7.10 load-preserve <filename> 
528 Load savestate <filename> in readonly mode, preserving current 
529 events.
531 6.7.11 load-movie <filename> 
533 Load savestate <filename>, ignoring save part in readonly mode.
535 6.7.12 save-state <filename> 
537 Save system state to <filename> as soon as possible.
539 6.7.13 save-movie <filename> 
541 Save movie to <filename>.
543 6.7.14 set-rwmode 
545 Set read-write mode.
547 6.7.15 set-romode 
549 Set read-only mode
551 6.7.16 toggle-rwmode 
553 Toggle between read-only and read-write modes.
555 6.7.17 set-gamename <name> 
557 Set name of the game to <name>
559 6.7.18 get-gamename 
561 Print the name of the game.
563 6.7.19 add-author <author> 
565 Adds new author <author>. If <author> does not contain '|' it is 
566 full name. If it contains '|', '|' splits the full name and 
567 nickname.
569 6.7.20 edit-author <num> <author> 
571 Edit the author in slot <num> (0-based) to be <author> (see 
572 add-author for format)
574 6.7.21 remove-author <num> 
576 Remove author in slot <num>
578 6.7.22 print-authors 
580 Print authors.
582 6.7.23 test-1, test-2, test-3
584 Internal test commands. Don't use.
586 6.7.24 take-screenshot <filename> 
588 Save screenshot to <filename>.
590 6.7.25 +controller<num><button>
592 Press button <button> on controller <num> (1-8). The following 
593 button names are known:
595 • left
597 • right
599 • up
601 • down
603 • A
605 • B
607 • X
609 • Y
611 • L
613 • R
615 • select
617 • start
619 • trigger
621 • cursor
623 • pause
625 • turbo
627 6.7.26 controllerh<num><button>
629 Hold/unhold button <button> on controller <num> (1-8). See 
630 +controller for button names.
632 6.7.27 controllerf<num><button>
634 Hold/unhold button <button> on controller <num> (1-8) for the 
635 next frame. See +controller for button names.
637 Cauntion: Does not work properly if outside frame advance.
639 6.7.28 autofire (<pattern>|-)...
641 Set autofire pattern. Each parameter is comma-separated list of 
642 button names (in form of 1start, 1A, 2B, etc..) to hold on that 
643 frame. After reaching the end of pattern, the pattern restarts 
644 from the beginning.
646 6.7.29 repaint
648 Force a repaint.
650 6.8 Save jukebox 
652 6.8.1 cycle-jukebox-backward
654 Cycle save jukebox backwards.
656 6.8.2 cycle-jukebox-forward
658 Cycle save jukebox forwards
660 6.8.3 load-jukebox
662 Do load from jukebox (current mode).
664 6.8.4 save-jukebox
666 Do state save to jukebox.
668 6.9 Lua 
670 Only available if lua support is compiled in.
672 6.9.1 evaluate-lua <luacode>
674 Run Lua code <luacode> using built-in Lua interpretter.
676 6.9.2 run-lua <script>
678 Run specified lua file using built-in Lua interpretter.
680 6.9.3 reset-lua
682 Clear the Lua VM state and restore to factory defaults.
684 6.10 Memory watch
686 6.10.1 add-watch <name> <expression>
688 Adds new watch (or modifies old one).
690 6.10.2 remove-watch <name>
692 Remove a watch.
694 6.11 Sound 
696 6.11.1 enable-sound <on/off> 
698 Enable/Disable sound.
700 6.11.2 set-sound-device <device> 
702 Set sound device to <device>
704 6.11.3 show-sound-status 
706 Show status of sound system.
708 6.11.4 show-sound-devices
710 Show all available devices.
712 6.11.5 set-volume <multiplier>
714 Set the volume multiplier to <multiplier>. 1 is normal volume, 
715 and higher numbers are louder.
717 6.11.6 set-volume <multiplier>%
719 Set the volume multiplier to <multiplier> percent. 100 is normal 
720 volume, and higher numbers are louder.
722 6.11.7 set-volume <multiplier>dB
724 Set the volume multiplier to <multiplier> dB. 0 is normal volume, 
725 and higher numbers are louder. The value may be negative.
727 6.12 Misc.
729 6.12.1 reload-rom [<file>]
731 Reloads the main ROM image from <file>.
733 6.12.2 edit-subtitle <firstframe> <length> [<text>]
735 Edit or delete a subtitle.
737 6.12.3 list-subtitle
739 List subtitles.
741 6.13 Commentary track
743 6.13.1 list-streams
745 List streams
747 6.13.2 play-stream <id>
749 Play stream <id>.
751 6.13.3 delete-stream <id>
753 Delete stream <id>
755 6.13.4 change-timebase <id> <newbase>
757 Change time base of <id> to <newbase>. The time base can be given 
758 as samples (integer) or second (postfix with s).
760 6.13.5 import-stream-opus <timebase> <file>
762 Import opus stream from <file>, placing it at <timebase>. This 
763 operation is lossless.
765 6.13.6 import-stream-pcm <timebase> <file>
767 Import PCM (.sox, 1ch@48kHz) stream from <file>, placing it at 
768 <timebase>.
770 6.13.7 export-stream-opus <id> <file>
772 Export stream <id> as opus stream to <file>. This operation is 
773 lossless.
775 6.13.8 export-stream-pcm <id> <file>
777 Export stream <id> as PCM (.sox) stream to <file>. 
779 6.13.9 export-superstream <file>
781 Export the entiere superstream as PCM (.sox) stream to <file>.
783 6.13.10 load-collection <file>
785 Load collection (if there is existing collection, unload it) from 
786 <file>
788 6.13.11 unload-collection
790 Unload collection.
792 6.13.12 +tangent
794 Tangent for recording voice for commentary track. While pressed, 
795 record a stream.
797 6.14 SDL Platform commands 
799 The following are valid on SDL platform.
801 6.14.1 identify-key
803 Asks to press a key and then identifies that (pseudo-)key.
805 6.14.2 toggle-console 
807 Toggle between windowed/fullscreen console.
809 6.14.3 scroll-fullup 
811 Scroll messages window as far back as it goes.
813 6.14.4 scroll-fulldown 
815 Scroll messages window as far forward as it goes.
817 6.14.5 scroll-up 
819 Scroll messages window back one screenful.
821 6.14.6 scroll-down 
823 Scroll messages window forward one screenful.
825 6.14.7 prompt-command <command>
827 Enter command prompt, with prompt prepopulated with specified 
828 command.
830 7 Settings
832 7.1 Core settings
834 7.1.1 firmwarepath
836 Set where bsnes looks for firmware files. Default is “.”.
838 7.1.2 target
840 Set the target . Numeric, range is 0.001 to “infinite”. Default 
841 is native framerate.
843 7.1.3 savecompression
845 Set save compression level (integer 0-9). Default is 7 (0 is no 
846 compression).
848 7.1.4 advance-timeout
850 Set the frame advance timeout in milliseconds. Numeric integer, 
851 range is 0-999999999. Default is 500.
853 7.1.5 advance-subframe-timeout
855 Subframe advance timeout in milliseconds. Default is 100.
857 7.1.6 save-every-frame (bsnes only)
859 If true, simulate saving on each frame. Trades off emulation 
860 accuracy for sync stability. Also needed if the movie assumes 
861 saving on each frame for rewind.
863 7.2 AVI dumper settings
865 7.2.1 avi-large
867 AVI dumper: Always dump at 512x448 or 512x478 regardless of what 
868 the console outputs.
870 7.2.2 avi-left-border
872 AVI dumper: Set the default left border thickness (unless lua 
873 overrides) for dumps. Range 0-8191. Default is 0.
875 7.2.3 avi-right-border
877 AVI dumper: Set the default right border thickness (unless lua 
878 overrides) for dumps. Range 0-8191. Default is 0.
880 7.2.4 avi-top-border
882 AVI dumper: Set the default top border thickness (unless lua 
883 overrides) for dumps. Range 0-8191. Default is 0.
885 7.2.5 avi-bottom-border
887 AVI dumper: Set the default bottom border thickness (unless lua 
888 overrides) for dumps. Range 0-8191. Default is 0.
890 7.2.6 avi-maxframes
892 AVI dumper: Maximum number of frames per dump segment (0 => 
893 unlimited). Range 0-999999999. Default is 0.
895 7.2.7 avi-compresison
897 AVI dumper: Compression level (0-18).
899 • Compression levels 10 and above are not compatible with stock 
900   CSCD codec.
902 • Recomended level is 7.
904 7.2.8 avi-soundrate
906 AVI dumper: Set method of determining the sound rate.
908 • 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 
909   64, 88.2, 96, 128, 176.4 and 192 kHz.
911 • 1: Round down to nearest integer.
913 • 2: Round up to nearest ingeter.
915 7.3 JMD options
917 7.3.1 jmd-copression
919 JMD dumper: Compression level (0-9).
921 7.4 SDL platform settings
923 7.4.1 autorepeat-first-delay
925 Sets the delay for first character in typematic autorepeat.
927 7.4.2 autorepeat-subsequent-delay
929 Sets the delay for subsequent characters in typematic autorepeat.
931 8 Lua functions
933 8.1 Core (in main table)
935 8.1.1 print
937 Print line to message console.
939 8.1.2 exec(string command)
941 Run command as it was entered on the command line
943 8.1.3 utime()
945 Returns two values. First is time since some epoch in seconds, 
946 the second is microseconds mod 10^6 since that epoch.
948 8.1.4 emulator_ready()
950 Returns true if emulator has finished booting, false if not 
951 (on_startup() will be issued later).
953 8.1.5 set_idle_timeout(number timeout)
955 Set number of microseconds to block idle for. After this timeout 
956 has expired, on_idle() will be called once.
958 8.1.6 set_timer_timeout(number timeout)
960 Set number of microseconds to block timer for. After this timeout 
961 has expired, on_timer() will be called once.
963 8.1.7 bus_address(number snesaddr)
965 Returns virtual address corresponding to specified address on 
966 SNES bus.
968 8.1.8 loopwrapper(function fun, ...)
970 Calls function fun with function and specified arguments. The 
971 function passed suspends execution until the function returned is 
972 called. Handy for linear flow control among multiple invocations 
973 of a hook. Example code:
975 on_paint = loopwrapper(function(wait)
977   while true do
979     gui.text(0, 0, “Test!”);
981     wait();
983   end
985 end);
987 8.1.9 list_bindings([string cmd])
989 Get table of all keybindings, indexed by keyspec 
990 (modifiers|mask/key). If command is specified, the table is 
991 limited to that command.
993 8.1.10 get_alias(string aname)
995 Get expansion of given alias.
997 8.1.11 set_alias(string aname, string value)
999 Set expansion of given alias.
1001 8.1.12 create_ibind(string name, string cmd)
1003 Return object representing inverse binding with specified name 
1004 and specified command.
1006 • To create press/release commands, use aliases +foo and -foo .
1008 • Keep the returned object around.
1010 8.2 Table bit:
1012 Bitwise logical functions and related.
1014 8.2.1 bit.none(number...) / bit.bnot(number...)
1016 48-bit bitwise NOT / NONE function (set bits that are set in none 
1017 of the arguments).
1019 8.2.2 bit.any(number...) / bit.bor(number...)
1021 48-bit bitwise OR / ANY function (set bits that are set in any of 
1022 the arguments).
1024 8.2.3 bit.all(number...) / bit.band(number...)
1026 48-bit bitwise AND / ALL function (set bits that are set in all 
1027 of the arguments).
1029 8.2.4 bit.parity(number...) / bit.bxor(number...)
1031 48-bit bitwise XOR / PARITY function (set bits that are set in 
1032 odd number of the arguments).
1034 8.2.5 bit.lrotate(number base[, number amount[, number bits]])
1036 Rotate bits-bit (max 48, default 48) number left by amount 
1037 (default 1) places.
1039 8.2.6 bit.rrotate(number base[, number amount[, number bits]])
1041 Rotate bits-bit (max 48, default 48) number right by amount 
1042 (default 1) places.
1044 8.2.7 bit.lshift(number base[, number amount[, number bits]])
1046 Shift bits-bit (max 48, default 48) number left by amount 
1047 (default 1) places. The new bits are filled with zeroes.
1049 8.2.8 bit.lrshift(number base[, number amount[, number bits]])
1051 Shift bits-bit (max 48, default 48) number logically right by 
1052 amount (default 1) places. The new bits are filled with zeroes.
1054 8.2.9 bit.arshift(number base[, number amount[, number bits]])
1056 Shift bits-bit (max 48, default 48) number arithmetically right 
1057 by amount (default 1) places. The new bits are shifted in with 
1058 copy of the high bit.
1060 8.2.10 bit.extract(number base[, number bit0[, number bit1,...]])
1062 Returns number that has bit0-th bit as bit 0, bit1-th bit as 1 
1063 and so on.
1065 Notes: 
1067 • Bit numbers up to 51 should work reliably (then things start 
1068   falling apart due to double precision issues).
1070 • There are two special bit positions, true and false, standing 
1071   for always set bit and always clear bit.
1073 8.2.11 bit.value([number bit1[, number bit2,...]])
1075 Returns bitwise OR of 1 left shifted by bit1 places, 1 left 
1076 shifted by bit2 places and so on. As special value, nil argument 
1077 is no-op.
1079 8.2.12 bit.test_any(number a, number b)
1081 Is there a common set bit in a and b?
1083 8.2.13 bit.test_all(number a, number b)
1085 Are all set bits in b also set in a?
1087 8.2.14 bit.popcount(number a)
1089 Population count of a.
1091 8.2.15 bit.clshift(number a, number b, [number amount,[number 
1092   bits]])
1094 Does chained left shift on a, b by amount positions, assuming 
1095 numbers to be of specified number of bits.
1097 8.2.16 bit.crshift(number a, number b, [number amount,[number 
1098   bits]])
1100 Does chained right shift on a, b by amount positions, assuming 
1101 numbers to be of specified number of bits.
1103 8.2.17 bit.flagdecode(number a, number bits, [string on, [string 
1104   off]])
1106 Return string of length bits where ith character is ith character 
1107 of on if bit i is on, otherwise ith character of off. Out of 
1108 range reads give last character, or '*'/'-' if empty.
1110 8.2.18 bit.rflagdecode(number a, number bits, [string on, [string 
1111   off]])
1113 Like bit.flagdecode, but outputs the string in the opposite order 
1114 (most significant bit first).
1116 8.3 Table gui:
1118 Most of these functions can only be called in on_paint and 
1119 on_video callbacks. Exceptions are noted.
1121 Colors are 32-bit. Bits 0-7 are the blue component, bits 8-15 are 
1122 the green component, bits 16-23 are the red component, bits 24-31 
1123 are alpha component (0 is fully opaque, 255 is almost 
1124 transparent). -1 is the fully transparent color. Alpha values 
1125 greater than 127 do work.
1127 Origin of coordinates is at top left corner of game display area. 
1128 Left and top gaps correspond to negative coordinates.
1130 8.3.1 gui.resolution()
1132 Returns 2-tuple (hresolution, vresolution).
1134 8.3.2 gui.<class>_gap(number gap)
1136 Set the <class> (left, right, top, bottom) gap to specified value 
1137 (max gap is 8191). If successful, old gap is returned.
1139 8.3.3 gui.delta_<class>_gap(number gap)
1141 Increase the <class> (left, right, top, bottom) gap by specified 
1142 value (max gap is 8191) and return the old gap (returns nothing 
1143 on error).
1145 8.3.4 gui.text(number x, number y, string text[, number fgc[, 
1146   number bgc]])
1148 Draw specified text on the GUI (each character cell is 8 or 16 
1149 wide and 16 high). Parameters:
1151 • x: X-coordinate to start the drawing from (and x-coordinate at 
1152   begining of the lines).
1154 • y: Y-coordinate to start the drawing from.
1156 • text: The text to draw.
1158 • fgc: Text color (default is 0xFFFFFF (white))
1160 • bgc: Background color (default is -1 (transparent))
1162 8.3.5 gui.textH(number x, number y, string text[, number fgc[, 
1163   number bgc]])
1165 Like gui.text, but draw using double-width.
1167 8.3.6 gui.textV(number x, number y, string text[, number fgc[, 
1168   number bgc]])
1170 Like gui.text, but draw using double-height.
1172 8.3.7 gui.textHV(number x, number y, string text[, number fgc[, 
1173   number bgc]])
1175 Like gui.text, but draw using double-width/double-height.
1177 8.3.8 gui.rectangle(number x, number y, number width, number 
1178   height[, number thickness[, number outline[, number fill]]])
1180 Draw rectangle on the GUI. Parameters:
1182 • x: X-coordinate of left edge.
1184 • y: Y-coordinate of upper edge.
1186 • width: Width of rectangle.
1188 • height: Height of rectangle.
1190 • thickness: Thickness of outline (default is 1).
1192 • outline: Color of outline (default is 0xFFFFFF (white))
1194 • fill: Color of fill (default is -1 (transparent))
1196 8.3.9 gui.box(number x, number y, number width, number height[, 
1197   number thickness[, number outline1[,number outline2[, number 
1198   fill]]]])
1200 Draw rectangle with 3D effect on the GUI. Parameters:
1202 • x: X-coordinate of left edge.
1204 • y: Y-coordinate of upper edge.
1206 • width: Width of rectangle.
1208 • height: Height of rectangle.
1210 • thickness: Thickness of outline (default is 1).
1212 • outline1: First color of outline (default is 0xFFFFFF (white))
1214 • outline2: First color of outline (default is 0x808080 (dark 
1215   gray))
1217 • fill: Color of fill (default is 0xC0C0C0 (light grayy))
1219 8.3.10 gui.pixel(number x, number y[, number color])
1221 Draw one pixel on the GUI. Parameters:
1223 • x: X-coordinate of the pixel
1225 • y: Y-coordinate of the pixel
1227 • color: Color of the pixel (default is 0xFFFFFF (white))
1229 8.3.11 gui.crosshair(number x, number y[, number length[, number 
1230   color]])
1232 Draw a crosshair. Parameters:
1234 • x: X-coordinate of the crosshair
1236 • y: Y-coordinate of the crosshair
1238 • length: Length of the crosshair lines (default 10).
1240 • color: Color of the crosshair (default is 0xFFFFFF (white))
1242 8.3.12 gui.line(number x1, number y1, number x2, number y2[, 
1243   number color])
1245 Draw a thin line. Parameters:
1247 • x1: X-coordinate of one end.
1249 • y1: Y-coordinate of one end.
1251 • x2: X-coordinate of the other end.
1253 • y2: Y-coordinate of the other end.
1255 • color: Color of the line (default is 0xFFFFFF (white)).
1257 8.3.13 gui.circle(number x, number y, number r[, number thick[, 
1258   number border[, number fil]]])
1260 Draw a circle. Parameters.
1262 • x: X-coordinate of the center
1264 • y: Y-coordinate of the center
1266 • r: The radius of the circle
1268 • thick: Border thickness
1270 • border: Border color (default is 0xFFFFFF (white))
1272 • fill: Fill color (default is -1 (transparent)).
1274 8.3.14 gui.bitmap_draw(number x, number y, bitmap bitmap, palette 
1275   palette)
1277 Draw a bitmap on screen with specified palette. Parameters:
1279 • x: X-coordinate of left edge.
1281 • y: Y-coordinate of top edge.
1283 • bitmap: The bitmap to draw
1285 • palette: The palette to draw the bitmap using.
1287 8.3.15 gui.bitmap_draw(number x, number y, dbitmap bitmap)
1289 Draw a bitmap on screen. Parameters:
1291 • x: X-coordinate of left edge.
1293 • y: Y-coordinate of top edge.
1295 • bitmap: The bitmap to draw
1297 8.3.16 gui.palette_new()
1299 Returns a new palette (initially all transparent). Can be used 
1300 anywhere.
1302 8.3.17 gui.bitmap_new(number w, number h, boolean direct[, bool 
1303   icolor])
1305 Returns a new bitmap/dbitmap. Can be used anywhere. Parameters:
1307 • w: The width of new bitmap
1309 • h: The height of new bitmap
1311 • direct: If true, the returned bitmap is dbitmap, otherwise 
1312   bitmap.
1314 • icolor: Initital fill color (defaults to 0 on BITMAP, -1 on 
1315   DBITMAP)
1317 8.3.18 gui.bitmap_load(string file)
1319 Returns loaded bitmap/dbitmap (if bitmap, the second return value 
1320 is palette for bitmap). Can be used anywhere. Parameters:
1322 • file: The name of file to load.
1324 8.3.19 gui.palette_set(palette palette, number index, number 
1325   color)
1327 Sets color in palette. Can be used anywhere. Parameters:
1329 • palette: The palette to manipulate
1331 • index: Index of color (0-65535).
1333 • color: The color value.
1335 8.3.20 gui.bitmap_pset(bitmap/dbitmap bitmap, number x, number y, 
1336   number color)
1338 Sets specified pixel in bitmap. Can be used anywhere. Parameters:
1340 • bitmap: The bitmap to manipulate
1342 • x: The x-coordinate of the pixel.
1344 • y: The y-coordinate of the pixel.
1346 • color: If bitmap is a bitmap, color index (0-65535). Otherwise 
1347   color value.
1349 8.3.21 gui.bitmap_size(bitmap/dbitmap bitmap)
1351 Get size of bitmap. Can be used anywhere. Parameters:
1353 • bitmap: The bitmap to query.
1355 The first return is the width, the second is the height.
1357 8.3.22 gui.bitmap_blit(bitmap/dbitmap dest, number dx, number dy, 
1358   bitmap/dbitmap src, number sx, number sy, number w, number h[, 
1359   number ck])
1361 Blit a part of bitmap to another. Can be used anywhere. 
1362 Parameters:
1364 • dest: Destination to blit to.
1366 • dx: left edge of target
1368 • dy: Top edge of target
1370 • src: The source to blit from. Must be of the same type as 
1371   destination.
1373 • sx: left edge of source
1375 • sy: Top edge of source
1377 • w: Width of region
1379 • h: Height of region.
1381 • ck: Color key. Pixels of this color are not blitted.
1383   – If bitmaps are bitmaps, this is color index of colorkey. 
1384     Values outside range 0-65535 cause no key to be used as 
1385     colorkey.
1387   – If bitmaps are dbitmaps, this color value of colorkey.
1389   – May be absent or nil for no colorkey blit.
1391 8.3.23 gui.repaint()
1393 Request on_repaint() to happen as soon as possible. Can be used 
1394 anywhere.
1396 8.3.24 gui.subframe_update(boolean on)
1398 Request subframe updates (calling on_paint() on subframes) to 
1399 happen (on=true) or not happen (on=false). Can be used anywhere.
1401 8.3.25 gui.screenshot(string filename)
1403 Write PNG screenshot of the current frame (no drawings) to 
1404 specified file. Can be used anywhere.
1406 8.3.26 gui.color(number r, number g, number b[, number a])
1408 Returns color (in notation Lua scripts use) corresponding to 
1409 color (r,g,b), each component in scale 0-255. If a is specified, 
1410 that is alpha (0 is fully transparent, 256(sic) is fully opaque). 
1411 The default alpha is 256.
1413 8.3.27 gui.status(string name, string value)
1415 Set status field “L[<name>]” to <value> in status area. Can be 
1416 used anywhere.
1418 8.3.28 gui.rainbow(number step, number steps[, number color])
1420 Perform hue rotation of color <color> (default bright red), by 
1421 <step> steps. The number of steps per full rotation is given by 
1422 absolute value of <steps>.
1424 If <steps> is negative, the rotation will be counterclockwise.
1426 8.3.29 gui.screenshot(string filename)
1428 Saves a screenshot into specified file.
1430 8.3.30 gui.loadfont(string filename)
1432 Loads font from specified file (CUSTOMFONT object).
1434 8.3.31 CUSTOMFONT(number x, number y, string text[, number fgc[, 
1435   number bgc[, number hlc]]])
1437 Draw string with custom font to screen. The parameters are the 
1438 same as in gui.text, except hlc is the halo color (default is no 
1439 halo). 
1441 8.4 table input
1443 Input handling. Only available in on_input callback.
1445 8.4.1 input.get(number controller, number index)
1447 Read the specified index (0-11) from specified controller (0-7). 
1448 Notes:
1450 • Uses physical controller numbering. Gamepad in port 2 is 
1451   controller 4, not 1!
1453 8.4.2 input.set(number controller, number index, number value)
1455 Write the specified index (0-11) from specified controller (0-7), 
1456 storing value. Notes:
1458 • Uses physical controller numbering. Gamepad in port 2 is 
1459   controller 4, not 1!
1461 8.4.3 input.get2(number port, number controller, number index)
1463 Read the specified input tuple.
1465 • Port 0 is system port.
1467 8.4.4 input.set2(number port, number controller, number index, 
1468   number value)
1470 Write the specified input tuple.
1472 • Port 0 is system port.
1474 8.4.5 input.lcid_to_pcid2(number lcid)
1476 Look up physical pcid pair (port, controller) corresponding to 
1477 specified logical controller (1-based). Returns nothing if 
1478 controller does not exist.
1480 8.4.6 input.port_type(number port)
1482 Return type of specified port.
1484 8.4.7 input.controller_info(number port, number controller)
1486 Get controller info for specified controller. If controller does 
1487 not exist, returns nil. Otherwise returns a table with following 
1488 fields:
1490 • type (string): Type of the controller.
1492 • class (string): Class of the controller.
1494 • classnum (number): Number of the controller within its class 
1495   (1-based)
1497 • lcid (number): Logical controller number of the controller.
1499 • button_count (number): Number of buttons on controller
1501 • buttons (array): Array of following info about each button:
1503   – type (string): Type of button. Currently one of “null”, “
1504     button”, “axis”, “raxis”.
1506   – name (string): Name of button.
1508   – symbol (string): Symbol of button. Only present for type “
1509     button”.
1511   – hidden (boolean): True if hidden button. 
1513 8.4.8 input.veto_button()
1515 Signals that the button event should be vetoed. Only valid in 
1516 on_button callback.
1518 8.4.9 input.geta(number controller)
1520 Get input state for entiere controller. Returns 13 return values.
1522 • 1st return value: Bitmask: bit i is set if i:th index is 
1523   nonzero
1525 • 2nd-13th return value: value of i:th index.
1527 8.4.10 input.seta(number controller, number bitmask, number 
1528   args...)
1530 Set state for entiere controller. args is up to 12 values for 
1531 indices (overriding values in bitmask if specified).
1533 8.4.11 input.controllertype(number controller)
1535 Get the type of controller as string. Valid values are:
1537 • gamepad
1539 • mouse
1541 • justifier
1543 • superscope
1545 8.4.12 input.reset([number cycles])
1547 Execute reset. If cycles is greater than zero, do delayed reset. 
1548 0 (or no value) causes immediate reset.
1550 • Only available with subframe flag false.
1552 8.4.13 input.raw()
1554 Returns table of tables of all available keys and axes. The first 
1555 table is indexed by key name (platform-dependent!), and the inner 
1556 table has the following fields:
1558 • last_rawval: Last reported raw value for control.
1560 • ktype: Type of key (disabled, key, mouse, axis, axis-inverse, 
1561   hat, pressure-m0, pressure-mp, pressure-0m, pressure-0p, 
1562   pressure-pm, pressure-p0).
1564 • cal_left: Minimum calibration value. Only meaningful with axis 
1565   and pressure types.
1567 • cal_center: Center calibration value. Only meaningful with axis 
1568   and pressure types.
1570 • cal_right: Maximum calibration value. Only meaningful with axis 
1571   and pressure types.
1573 • cal_tolerance: Dead zone tolerance. Only meaningful with axis 
1574   and pressure types.
1576 8.4.14 input.keyhook(string key, boolean state)
1578 Requests that keyhook events to be sent for key (state=true) or 
1579 not sent (state=false).
1581 8.4.15 input.joyget(number controller)
1583 Returns table for current controls for specified controller. The 
1584 names of fields vary by controller type.
1586 • The buttons have the same name as those are referred to in 
1587   other contexts in the emulator
1589 • The analog axes are “xaxis” and “yaxis”.
1591 8.4.16 input.joyset(number controller, table controls)
1593 Set the the state of specified controller to values specified in 
1594 specified table.
1596 • nil does not change value
1598 • true/false (buttons) and integers (axes) force value.
1600 • string (button) inverts the input.
1602 8.4.17 input.lcid_to_pcid(number controller)
1604 Return the physical index, physical port and controller number in 
1605 port for specified (1-based) logical controller.
1607 8.5 Table subtitle
1609 Subtitle handling
1611 8.5.1 subtitle.byindex(number i)
1613 Read the frame and length of ith subtitle. Returns nothing if not 
1614 present.
1616 8.5.2 subtitle.set(number f, number l, string txt)
1618 Set the text of subtitle.
1620 8.5.3 subtitle.get(number f, number l)
1622 Get the text of subtitle.
1624 8.5.4 subtitle.delete(number f, number l)
1626 Delete specified subtitle.
1628 8.6 Table hostmemory
1630 Host memory handling (extra memory saved to savestates). Host 
1631 memory starts empty.
1633 8.6.1 hostmemory.read(number address)
1635 Reads hostmemory slot address. Slot numbers out of range return 
1636 false instead of numeric.
1638 8.6.2 hostmemory.write(number address, number value)
1640 Writes hostmemory slot with 0-255. Slot numbers out of range 
1641 cause extension of host memory slot space.
1643 8.6.3 hostmemory.readbyte(number address)
1645 Read unsigned byte (1 element) from given address. Slots out of 
1646 range return false.
1648 8.6.4 hostmemory.writebyte(number address, number value)
1650 Write unsigned byte (1 element) to given slot. Slot numbers out 
1651 of range cause extension.
1653 8.6.5 hostmemory.readsbyte(number address)
1655 Read signed byte (1 element) from given address. Slots out of 
1656 range return false.
1658 8.6.6 hostmemory.writesbyte(number address, number value)
1660 Write signed byte (1 element) to given slot. Slot numbers out of 
1661 range cause extension.
1663 8.6.7 hostmemory.readword(number address)
1665 Read unsigned word (2 elements) from given address. Slots out of 
1666 range return false.
1668 8.6.8 hostmemory.writeword(number address, number value)
1670 Write unsigned word (2 elements) to given slot. Slot numbers out 
1671 of range cause extension.
1673 8.6.9 hostmemory.readsword(number address)
1675 Read signed word (2 elements) from given address. Slots out of 
1676 range return false.
1678 8.6.10 hostmemory.writesword(number address, number value)
1680 Write signed word (2 elements) to given slot. Slot numbers out of 
1681 range cause extension.
1683 8.6.11 hostmemory.readdword(number address)
1685 Read unsigned doubleword (4 elements) from given address. Slots 
1686 out of range return false.
1688 8.6.12 hostmemory.writedword(number address, number value)
1690 Write unsigned doubleword (4 elements) to given slot. Slot 
1691 numbers out of range cause extension.
1693 8.6.13 hostmemory.readsdword(number address)
1695 Read signed doubleword (4 elements) from given address. Slots out 
1696 of range return false.
1698 8.6.14 hostmemory.writesdword(number address, number value)
1700 Write signed doubleword (4 elements) to given slot. Slot numbers 
1701 out of range cause extension.
1703 8.6.15 hostmemory.readqword(number address)
1705 Read unsigned quadword (8 elements) from given address. Slots out 
1706 of range return false.
1708 8.6.16 hostmemory.writeqword(number address, number value)
1710 Write unsigned quadword (4 elements) to given slot. Slot numbers 
1711 out of range cause extension.
1713 8.6.17 hostmemory.readsqword(number address)
1715 Read signed quadword (8 elements) from given address. Slots out 
1716 of range return false.
1718 8.6.18 hostmemory.writesqword(number address, number value)
1720 Write signed quadword (8 elements) to given slot. Slot numbers 
1721 out of range cause extension.
1723 8.7 Table movie
1725 Movie handling
1727 8.7.1 movie.currentframe()
1729 Return number of current frame.
1731 8.7.2 movie.framecount()
1733 Return number of frames in movie.
1735 8.7.3 movie.readonly()
1737 Return true if in readonly mode, false if in readwrite.
1739 8.7.4 movie.rerecords()
1741 Returns the current value of rerecord count.
1743 8.7.5 movie.set_readwrite()
1745 Set readwrite mode (does not cause on_readwrite callback).
1747 8.7.6 movie.frame_subframes(number frame)
1749 Count number of subframes in specified frame (frame numbers are 
1750 1-based) and return that.
1752 8.7.7 movie.read_subframes(number frame, number subframe)
1754 Read specifed subframe in specified frame and return data as 
1755 array (100 elements, numbered 0-99 currently).
1757 8.7.8 movie.read_rtc()
1759 Returns the current value of the RTC as a pair (second, 
1760 subsecond).
1762 8.7.9 movie.unsafe_rewind([UNSAFEREWIND state])
1764 Start setting point for unsafe rewind or jump to point of unsafe 
1765 rewind.
1767 • If called without argument, causes emulator to start process of 
1768   setting unsafe rewind point. When this has finished, callback 
1769   on_set_rewind occurs, passing the rewind state to lua script.
1771 • If called with argument, causes emulator rewind to passed 
1772   rewind point as soon as possible. Readwrite mode is implicitly 
1773   activated.
1775 The following warnings apply to unsafe rewinding:
1777 • There are no safety checks against misuse (that's what “unsafe” 
1778   comes from)!
1780 • Only call rewind from timeline rewind point was set from.
1782 • Only call rewind from after the rewind point was set.
1784 8.8 Table settings
1786 Routines for settings manipulation
1788 8.8.1 settings.get(string name)
1790 Get value of setting. If setting is blank, returns false. If 
1791 setting value can't be obtained, returns (nil, error message).
1793 8.8.2 settings.set(string name, string value)
1795 Set value of setting. If setting can't be set, returns (nil, 
1796 error message).
1798 8.8.3 settings.is_set(string name)
1800 Returns if setting is set. If setting does not exist, returns 
1801 (nil, error message).
1803 8.8.4 settings.blank(string name)
1805 Blanks a setting and returns true. If setting can't be blanked, 
1806 returns (nil, error message).
1808 8.9 Table memory
1810 Contains various functions for managing memory
1812 8.9.1 memory.vma_count()
1814 Returns the number of VMAs
1816 8.9.2 memory.read_vma(number index)
1818 Reads the specified VMA (indices start from zero). Trying to read 
1819 invalid VMA gives nil. The read VMA is table with the following 
1820 fields:
1822 • region_name (string): The readable name of the VMA
1824 • baseaddr (number): Base address of the VMA
1826 • lastaddr (number): Last address in the VMA.
1828 • size (number): The size of VMA in bytes.
1830 • readonly (boolean): True of the VMA corresponds to ROM.
1832 • iospace (boolean): True if the VMA is I/O space.
1834 • native_endian (boolean): True if the VMA has native endian as 
1835   opposed to little endian.
1837 8.9.3 memory.find_vma(number address)
1839 Finds the VMA containing specified address. Returns table in the 
1840 same format as read_vma or nil if not found.
1842 8.9.4 memory.readbyte(number address)
1844 Reads the specified address as unsigned byte and returns the 
1845 result.
1847 8.9.5 memory.readsbyte(number address)
1849 Reads the specified address as signed byte and returns the 
1850 result.
1852 8.9.6 memory.writebyte(number address, number value)
1854 Writes the specified value (negative values undergo 2's 
1855 complement) to specified address (as a byte).
1857 8.9.7 memory.readword(number address)
1859 Reads the specified address as unsigned word and returns the 
1860 result.
1862 8.9.8 memory.readsword(number address)
1864 Reads the specified address as signed word and returns the 
1865 result.
1867 8.9.9 memory.writeword(number address, number value)
1869 Writes the specified value (negative values undergo 2's 
1870 complement) to specified address (as a word).
1872 8.9.10 memory.readdword(number address)
1874 Reads the specified address as unsigned doubleword and returns 
1875 the result.
1877 8.9.11 memory.readsdword(number address)
1879 Reads the specified address as signed doubleword and returns the 
1880 result.
1882 8.9.12 memory.writedword(number address, number value)
1884 Writes the specified value (negative values undergo 2's 
1885 complement) to specified address (as a doubleword).
1887 8.9.13 memory.readqword(number address)
1889 Reads the specified address as unsigned quadword and returns the 
1890 result.
1892 8.9.14 memory.readsqword(number address)
1894 Reads the specified address as signed quadword and returns the 
1895 result.
1897 8.9.15 memory.writeqword(number address, number value)
1899 Writes the specified value (negative values undergo 2's 
1900 complement) to specified address (as a quadword).
1902 8.9.16 memory.hash_region(number base, number size)
1904 Hash specified number of bytes starting from specified address 
1905 and return the SHA-256.
1907 8.9.17 memory.hash_state()
1909 Hash the current system state. Mainly useful for debugging 
1910 savestates.
1912 8.9.18 memory.readregion(number base, number size)
1914 Read a region of memory.
1916 • Warning: If the region crosses VMA boundary, the results are 
1917   undefined.
1919 8.9.19 memory.map<type>([number base, number size])
1921 Returns a table mapping specified memory aperture for read/write. 
1922 If parameters are omitted, entiere map space is the aperture.
1924 • Type may be one of: byte, sbyte, word, sword, dword, sdword, 
1925   qword or sqword.
1927 8.9.20 memory.writeregion(number base, number size, table data)
1929 Write a region of memory.
1931 • Warning: If the region crosses VMA boundary, the results are 
1932   undefined.
1934 8.9.21 memory.map_structure()
1936 Returns a new mapping structure (MMAP_STRUCT)
1938 8.9.22 MMAP_STRUCT(string key, number address, string type)
1940 Bind key in mmap structure to specified address with specified 
1941 type.
1943 • Type may be one of: byte, sbyte, word, sword, dword, sdword, 
1944   qword or sqword.
1946 8.9.23 memory.read_expr(string expr)
1948 Evaluate specified watch expression and return result
1950 8.10 Table subtitle
1952 Contains functions for manipulating subtitles.
1954 8.10.1 subtitle.byindex(number index)
1956 Get (basetime, length) pair of specified subtitle index or 
1957 nothing if index isn't valid.
1959 8.10.2 subtitle.get(number basetime, number length)
1961 Read the specified subtitle. Returns “” if the subtitle does not 
1962 exist.
1964 8.10.3 subtitle.set(number basetime, number length, string 
1965   content)
1967 Set the specified subtitle.
1969 8.10.4 subtitle.deltete(number basetime, number length)
1971 Delete the specified subtitle.
1973 8.11 Table _SYSTEM
1975 Contains copy of global variables from time of Lua 
1976 initialization. Non-writeable.
1978 8.12 Callbacks
1980 Various callbacks to Lua that can occur.
1982 8.12.1 Callback: on_paint(bool not_synth)
1984 Called when screen is being painted. Any gui.* calls requiring 
1985 graphic context draw on the screen.
1987 not_synth is true if this hook is being called in response to 
1988 received frame, false otherwise.
1990 8.12.2 Callback: on_video()
1992 Called when video dump frame is being painted. Any gui.* calls 
1993 requiring graphic context draw on the video.
1995 8.12.3 Callback: on_frame_emulated()
1997 Called when emulating frame has completed and 
1998 on_paint()/on_video() calls are about to be issued.
2000 8.12.4 Callback: on_frame()
2002 Called on each starting whole frame.
2004 8.12.5 Callback: on_startup()
2006 Called when the emulator is starting (lsnes.rc and --run files 
2007 has been run).
2009 8.12.6 Callback: on_rewind()
2011 Called when rewind movie to beginning has completed.
2013 8.12.7 Callback: on_pre_load(string name)
2015 Called just before savestate/movie load occurs (note: loads are 
2016 always delayed, so this occurs even when load was initiated by 
2017 lua).
2019 8.12.8 Callback: on_err_load(string name)
2021 Called if loadstate goes wrong.
2023 8.12.9 Callback: on_post_load(string name, boolean was_savestate)
2025 Called on successful loadstate. was_savestate gives if this was a 
2026 savestate or a movie.
2028 8.12.10 Callback: on_pre_save(string name, boolean is_savestate)
2030 Called just before savestate save occurs (note: movie saves are 
2031 synchronous and won't trigger these callbacks if called from 
2032 Lua).
2034 8.12.11 Callback: on_err_save(string name)
2036 Called if savestate goes wrong.
2038 8.12.12 Callback: on_post_save(string name, boolean is_savestate)
2040 Called on successful savaestate. is_savestate gives if this was a 
2041 savestate or a movie.
2043 8.12.13 Callback: on_quit()
2045 Called when emulator is shutting down.
2047 8.12.14 Callback: on_input(boolean subframe)
2049 Called when emulator is just sending input to bsnes core. 
2050 Warning: This is called even in readonly mode, but the results 
2051 are ignored.
2053 8.12.15 Callback: on_reset()
2055 Called when SNES is reset.
2057 8.12.16 Callback: on_readwrite()
2059 Called when moving into readwrite mode as result of “set-rwmode” 
2060 command (note: moving to rwmode by Lua won't trigger this, as per 
2061 recursive entry protection).
2063 8.12.17 Callback: on_snoop(number port, number controller, number 
2064   index, number value)
2066 Called each time bsnes asks for input. The value is the final 
2067 value to be sent to bsnes core (readonly mode, autohold and 
2068 autofire have been taken into account). Might be useful when 
2069 translating movies to format suitable for console verification. 
2070 Note: There is no way to modify the value to be sent.
2072 • Not called if callback on_snoop2 is defined.
2074 8.12.18 Callback: on_snoop2(number port, number controller, 
2075   number index, number value)
2077 Like on_snoop, but reserves port 0 for system, having first user 
2078 port be port 1.
2080 8.12.19 Callback: on_keyhook(string keyname, table state)
2082 Sent when key that has keyhook events requested changes state. 
2083 Keyname is name of the key (group) and state is the state (same 
2084 kind as table values in input.raw).
2086 8.12.20 Callback: on_idle()
2088 Called when requested by set_idle_timeout(), the timeout has 
2089 expired and emulator is waiting.
2091 8.12.21 Callback: on_timer()
2093 Called when requested by set_idle_timeout() and the timeout has 
2094 expired (regardless if emulator is waiting).
2096 8.12.22 Callback: on_set_rewind(UNSAFEREWIND r)
2098 Called when unsafe rewind object has been constructed.
2100 8.12.23 Callback: on_pre_rewind() 
2102 Called just before unsafe rewind is about to occur.
2104 8.12.24 Callback: on_post_rewind() 
2106 Called just after unsafe rewind has occured.
2108 8.12.25 Callback: on_button(number port, number controller, 
2109   number index, string type)
2111 Called on controller button press, with following parameters:
2113 • port: Port number (0 is system)
2115 • controller: Controller within port
2117 • index: Index of button.
2119 • type: Type of event, one of:
2121   – “pressed”: Button was pressed.
2123   – “released”: Button was released.
2125   – “hold”: Held.
2127   – “unhold”: Released from hold.
2129   – “type”: Typing input on button.
2131   – “untype”: Typing input undone.
2133   – “analog”: Analog action on axis.
2135 9 Movie editor
2137 • The editor edits in-memory movie.
2139 • Because past can't be edited and readwrite mode doesn't allow 
2140   future, editing only works in read only mode.
2142 • Keyboard triggers the normal hotkeys and bindings.
2144 9.1 Left button actions
2146 • Clicking on cell in future (indicated by lack of redish 
2147   background) toggles it (if it is a button) or prompts for a 
2148   value (if it is an axis)
2150 • Dragging vertically toggles sequence of buttons or changes a 
2151   sequence of axis values.
2153 9.2 Right button actions
2155 The right mouse button pops up a context-sensitive menu:
2157 • Toggle <something>: Toggle this button
2159 • Change <something>: Change this axis value
2161 • Insert frame after: Insert a frame after this frame
2163 • Append frame: Append a frame to movie
2165 • Append frames: Append specified number of frames to movie
2167 • Delete frame: Delete this frame
2169 • Delete subframe: Delete this subframe
2171 • Truncate movie: Delete this subframe and everything after it.
2173 • Scroll to frame: Prompt for a frame and scroll the display to 
2174   that frame.
2176 • Scroll to current frame: Scroll the display to current position
2178 • Run to frame: Prompts for frame and runs the emulation to that 
2179   frame.
2181 • Change number of lines visible: Change the height of the movie 
2182   display (1 to 255).
2184 • Lock scroll to playback: While playing back or rewinding 
2185   movies, the display will follow if enabled.
2187 10 Memory watch expression syntax
2189 Memory watch expressions are in RPN (Reverse Polish Notation). At 
2190 the end of expression, the top entry on stack is taken as the 
2191 final result.
2193 Notations:
2195 • Evaluation order is strictly left to right.
2197 • a is the entry on top of stack
2199 • b is the entry immediately below top of stack
2201 • ; separates values to be pushed (no intermediate pop).
2203 • After end of element, all used stack slots are popped and all 
2204   results are pushed.
2206 • When pushing multiple values, the pushes occur in order shown.
2208 The following operators are available:
2210 • + : a + b
2212 • - : a - b
2214 • * : a * b
2216 • / : a / b
2218 • % : a % b
2220 • a : atan(a)
2222 • b : read_signed_byte(a)
2224 • c : cos(a)
2226 • d : read_signed_dword(a)
2228 • i : quotent(a / b)
2230 • p :\pi
2233 • q : read_signed_qword(a)
2235 • r : sqrt(a)
2237 • s : sin(a)
2239 • t : tan(a)
2241 • u : a; a
2243 • w : read_signed_word(a)
2245 • A : atan2(a, b)
2247 • B : read_unsigned_byte(a)
2249 • C<number>z : Push number <number> to stack.
2251 • D : read_unsigned_dword(a)
2253 • C0x<number>z : Push number <number> (hexadecimal) to stack.
2255 • H<digit> : Set hexadecimal mode with specified number of digits 
2256   (use A-G for 10-16 digits).
2258 • Q : read_unsigned_qword(a)
2260 • R<digit> : round a to <digit> digits.
2262 • W : read_unsigned_word(a)
2264 10.1 Example:
2266 C0x007e0878zWC0x007e002czW-
2268 1. Push value 0x7e0878 on top of stack (C0x007e0878z).
2270 2. Pop the value on top of stack (0x7e0878), read word value at 
2271   that address and push the result,call it x1 (W).
2273 3. Push value 0x7e002c on top of stack (C0x007e002cz).
2275 4. Pop the value on top of stack (0x7e002c), read word value at 
2276   that address and push the result,call it x2 (W).
2278 5. Pop the two top numbers on stack, x1 and x2, substract x1 from 
2279   x2 and push x2 - x1 (-).
2281 6. Since the expression ends, the final memory watch result is 
2282   the top one on stack, which is x2 - x1.
2284 11 Modifier and key names:
2286 11.1 SDL Platform
2288 11.1.1 Modifier names
2290 Following modifier names are known:
2292 • ctrl, lctrl, rctrl: Control keys
2294 • alt, lalt, ralt: ALT keys.
2296 • shift, lshift, rshift: Shift keys.
2298 • meta, lmeta, rmeta: Meta keys.
2300 • num, caps: Numlock/Capslock (these are sticky!)
2302 • mode: Mode select.
2304 11.1.2 Key names
2306 Following key names are known:
2308 • backspace, tab, clear, return, pause, escape, space, exclaim, 
2309   quotedbl, hash, dollar, ampersand, quote, leftparen, 
2310   rightparen, asterisk, plus, comma, minus, period, slash, 0, 1, 
2311   2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals, 
2312   greater, question, at, leftbracket, backslash, rightbracket, 
2313   caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, 
2314   l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, 
2315   world_1, world_2, world_3, world_4, world_5, world_6, world_7, 
2316   world_8, world_9, world_10, world_11, world_12, world_13, 
2317   world_14, world_15, world_16, world_17, world_18, world_19, 
2318   world_20, world_21, world_22, world_23, world_24, world_25, 
2319   world_26, world_27, world_28, world_29, world_30, world_31, 
2320   world_32, world_33, world_34, world_35, world_36, world_37, 
2321   world_38, world_39, world_40, world_41, world_42, world_43, 
2322   world_44, world_45, world_46, world_47, world_48, world_49, 
2323   world_50, world_51, world_52, world_53, world_54, world_55, 
2324   world_56, world_57, world_58, world_59, world_60, world_61, 
2325   world_62, world_63, world_64, world_65, world_66, world_67, 
2326   world_68, world_69, world_70, world_71, world_72, world_73, 
2327   world_74, world_75, world_76, world_77, world_78, world_79, 
2328   world_80, world_81, world_82, world_83, world_84, world_85, 
2329   world_86, world_87, world_88, world_89, world_90, world_91, 
2330   world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, 
2331   kp4, kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, 
2332   kp_multiply, kp_minus, kp_plus, kp_enter, kp_equals, up, down, 
2333   right, left, insert, home, end, pageup, pagedown, f1, f2, f3, 
2334   f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, numlock, 
2335   capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt, lalt, 
2336   rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, 
2337   sysreq, break, menu, power, euro, undo
2339 • Names of form 'key<n>' where <n> is 0-255 are interpretted as 
2340   key having hardware-dependent scan code of <n> (useful to bind 
2341   those keys that don't have symbolic names).
2343 11.1.3 Joystick pseudo-keys:
2345 • joystick<num>button<button>: Joystick <num> (0-based) button 
2346   <button> (0-based).
2348 • joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> 
2349   (0-based) up.
2351 • joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> 
2352   (0-based) left.
2354 • joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> 
2355   (0-based) down.
2357 • joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> 
2358   (0-based) right.
2360 • joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> 
2361   negative position (axis modes axis and axis_inverse).
2363 • joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> 
2364   positive position (axis modes axis and axis_inverse).
2366 • joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> 
2367   pressure (axis modes pressure_*).
2369 11.1.4 Special buttons:
2371 • Escape: Enter/Exit Command mode, cancel modal dialogs.
2373 • Return (also KPEnter): Execute command, ok modal dialog.
2375 • Pgup/Up (also KP8/9 if no num lock, CTRL+P; command mode): 
2376   Previous command in command history
2378 • Pgdn/Down(also KP2/3 if no num lock, CTRL+N; command mode): 
2379   Next command in command history
2381 • Home (also KP7 if no num lock, CTRL+A; command mode): Beginning 
2382   of command.
2384 • End (also KP1 if no num lock, CTRL+E; command mode): End of 
2385   command.
2387 • Left (also KP4 if no num lock, CTRL+B; command mode): Move 
2388   cursor left.
2390 • Right (also KP6 if no num lock, CTRL+F; command mode): Move 
2391   cursor right.
2393 • Delete (also KP. if no num lock; command mode): Delete 
2394   character to right of cursor.
2396 • Insert (also KP0 if no num lock; command mode): Toggle between 
2397   insert / overwrite modes.
2399 • Backspace (command mode): Delete character to left of cursor.
2401 • CTRL+LEFT (also ALT+B; command mode): Previous word.
2403 • CTRL+RIGHT (also ALT+F; command mode): Next word.
2405 • ALT+D (also CTRL+W; command mode): Delete word.
2407 • LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump 
2408   corrupted!).
2410 11.2 wxWidgets platform
2412 11.2.1 Modifier names:
2414 Following modifier names are known:
2416 • alt
2418 • ctrl
2420 • shift 
2422 • meta
2424 • cmd (Mac OS X only)
2426 11.2.2 Key names:
2428 Following key names are known:
2430 • back, tab, return, escape, space, exclaim, quotedbl, hash, 
2431   dollar, percent, ampersand, quote, leftparen, rightparen, 
2432   asterisk, plus, comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 
2433   6, 7, 8, 9, colon, semicolon, less, equals, greater, question, 
2434   at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, 
2435   u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret, 
2436   underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, 
2437   n, o, p, q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, 
2438   rightcurly, tilde, delete, start, lbutton, rbutton, cancel, 
2439   mbutton, clear, shift, alt, control, menu, pause, capital, end, 
2440   home, lefT, up, right, down, select, print, execute, snapshot, 
2441   insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, 
2442   numpad5, numpad6, numpad7, numpad8, numpad9, multiply, add, 
2443   separator, subtract, decimal, divide, f1, f2, f3, f4, f5, f6, 
2444   f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, 
2445   f20, f21, f22, f23, f24, numlock, scroll, pageup, pagedown, 
2446   numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2, 
2447   numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, 
2448   numpad_right, numpad_down, numpad_pageup, numpad_pagedown, 
2449   numpad_end, numpad_begin, numpad_insert, numpad_delete, 
2450   numpad_equal, numpad_multiply, numpad_add, numpad_separator, 
2451   numpad_subtract, numpad_decimal, numpad_divide, windows_left, 
2452   windows_right, windows_menu, command, special1, special2, 
2453   special3, special4, special5, special6, special7, special8, 
2454   special9, special10, special11, special12, special13, 
2455   special14, special15, special16, special17, special18, 
2456   special19, special20
2458 12 Movie file format
2460 Movie file is .zip archive in itself, normal ZIP archive tools 
2461 work on it (note: If you recompress it, do not use compression 
2462 methods other than store and deflate and especially do not use 
2463 encryption of any kind).
2465 12.1 Detecting clean start/SRAM/Savestate
2467 • If file has member “savestate” it is savestate, otherwise:
2469 • If file has members with names starting “moviesram.” it is 
2470   movie starting from SRAM, otherwise:
2472 • It is movie starting from clear state.
2474 12.2 Member: gametype
2476 Type of game ROM and region (as one line). Valid values are:
2479 +--------------+---------------------+--------+
2480 |    Value     |       System        | Region |
2481 +--------------+---------------------+--------+
2482 +--------------+---------------------+--------+
2483 |  snes_pal    |     Super NES       |  PAL   |
2484 +--------------+---------------------+--------+
2485 |   sgb_pal    |   Super Game Boy    |  PAL   |
2486 +--------------+---------------------+--------+
2487 |  snes_ntsc   |     Super NES       |  NTSC  |
2488 +--------------+---------------------+--------+
2489 |  sgb_ntsc    |   Super Game Boy    |  NTSC  |
2490 +--------------+---------------------+--------+
2491 |     bsx      | BS-X (non-slotted)  |  NTSC  |
2492 +--------------+---------------------+--------+
2493 | bsxslotted   |   BS-X (slotted)    |  NTSC  |
2494 +--------------+---------------------+--------+
2495 | sufamiturbo  |    Sufami Turbo     |  NTSC  |
2496 +--------------+---------------------+--------+
2499 Frame rates are:
2502 +---------+-----------------+
2503 | Region  | Framerate (fps) |
2504 +---------+-----------------+
2505 +---------+-----------------+
2506 |  PAL    |   322445/6448   |
2507 +---------+-----------------+
2508 |  NTSC   | 10738636/178683 |
2509 +---------+-----------------+
2512 12.3 Member: port1
2514 Contains type of port #1 (as one line). Valid values are 'none', 
2515 'gamepad', 'multitap' and 'mouse'. If not present, defaults to 
2516 'gamepad'.
2518 12.4 Member: port2
2520 Contains type of port #2 (as one line). Valid values are 'none', 
2521 'gamepad', 'multitap', 'mouse', 'superscope', 'justifier' and 
2522 'justifiers'. If not present, defaults to 'none'.
2524 12.5 Member: gamename
2526 Contains name of the game (as one line).
2528 12.6 Member: authors
2530 Contains authors, one per line. Part before '|' is the full name, 
2531 part after is the nickname.
2533 12.7 Member: systemid
2535 Always “lsnes-rr1” (one line). Used to reject other saves.
2537 12.8 Member: controlsversion
2539 Always “0” (one line). Used to identify what controls are there.
2541 12.9 Member: “coreversion”
2543 Contains bsnes core version number (as one line).
2545 12.10 Member: projectid
2547 Contains project ID (as one line). Used to identify if two movies 
2548 are part of the same project.
2550 12.11 Member: {rom,slota,slotb}{,xml}.sha256
2552 Contains SHA-256 of said ROM or ROM mapping file (as one line). 
2553 Absent if corresponding file is absent.
2555 12.12 Member: moviesram.<name>
2557 Raw binary startup SRAM of kind <name>. Only present in 
2558 savestates and movies starting from SRAM.
2560 12.13 Member: saveframe
2562 Contains frame number (as one line) of frame movie was saved on. 
2563 Only present in savestates.
2565 12.14 Member: lagcounter
2567 Current value of lag counter (as one line). Only present in 
2568 savestates.
2570 12.15 Member: pollcounters
2572 Contains poll counters (currently 100 of them), one per line. 
2573 Each line is raw poll count if DRDY is set for it. Otherwise it 
2574 is negative poll count minus one. Only present in savestates.
2576 12.16 Member: hostmemory
2578 Raw binary dump of host memory. Only present in savestates.
2580 12.17 Member: savestate
2582 The raw binary savestate itself. Savestate detection uses this 
2583 file, only present in savestates.
2585 12.18 Member: screenshot
2587 Screenshot of current frame. Only present in savestates. First 2 
2588 bytes are big-endian width of image, rest are 24-bit RGB image 
2589 data. Height of image is inferred from the width and size of 
2590 data.
2592 12.19 Member: sram.<name>
2594 Raw binary SRAM of kind <name> at time of savestate. Only present 
2595 in savestates.
2597 12.20 Member: input
2599 The actual input track, one line per subframe (blank lines are 
2600 skipped).
2602 • If the first byte of each line is '.', ' ', <tab> or '|', then 
2603   the line is part of same frame as previous, otherwise it starts 
2604   a new frame.
2606 • First subframe must start a new frame.
2608 Length of movie in frames is number of lines in input file that 
2609 start a new frame.
2611 12.21 Member: subtitles
2613 Subtitle track. Optional.
2615 • Each line is in form <firstframe> <numframes> <text>.
2617 • Linefeed is encoded as \n, backslash is encoded as \\.
2619 12.22 Member: rerecords
2621 Contains textual base-10 rerecord count (as one line; emulator 
2622 just writes this, it doesn't read it) + 1.
2624 12.23 Member: rrdata
2626 This member stores set of load IDs. There is one load ID per 
2627 rerecord (plus one corresponding to start of project).
2629 • This member constists of concatenation of records
2631 • Each record is 2-36 bytes long and can represent 1-16,843,009 
2632   consequtive IDs.
2634 • IDs are interpretted as 256-bit big-endian integers with 
2635   warparound.
2637 • Initial predicted ID is all zeroes.
2639 Format of each record is:
2641 • 1 byte: Opcode byte. Bits 0-4 are prefix length (prefixlen), 
2642   bits 5-6 are count length (countlen). Bit 7 is unused.
2644 • 32-prefixlen bytes of ID.
2646 • countlen bytes of big-endian count (count).
2648 Records are processed as follows:
2650 • To form the first ID encoded by record, take the first 
2651   prefixlen bytes predicted ID and append the read ID value to 
2652   it. The result is the first ID encoded.
2654 • If countlen is 0, record encodes 1 ID.
2656 • If countlen is 1, record encodes 2+count IDs.
2658 • If countlen is 2, record encodes 258+count IDs.
2660 • If countlen is 3, record encodes 65794+count IDs.
2662 • The new predicted ID is the next ID after last one encoded by 
2663   the record.
2665 The number of rerecords + 1 is equal to the sum of number of IDs 
2666 encoded by all records.
2668 12.24 Member: starttime.second
2670 Movie starting time, second part. Epoch is Unix epoch. Default is 
2671 1,000,000,000.
2673 12.25 Member: starttime.subsecond
2675 Movie starting time, subsecond part. Unit is CPU clocks. Default 
2676 is 0.
2678 12.26 Member: savetime.second
2680 Movie saving time, second part. Default is starttime.second. Only 
2681 present in savestates.
2683 12.27 Member: savetime.subsecond
2685 Movie saving time, subsecond part. Default is 
2686 starttime.subsecond. Only present in savestates.
2688 13 lsvs file format (commentary tracks)
2690 13.1 Clusters
2692 • Each cluster is 8kB (8192 bytes) in size.
2694 • Cluster n starts at offset 8192*n in file.
2696 • The following clusters are system special:
2698   – Cluster 0 and all clusters with number multiple of 2048 
2699     (cluster tables)
2701   – Cluster 1 (superblock)
2703 13.2 Cluster tables
2705 • The cluster table describing cluster n is stored in cluster n & 
2706   ~0x7FF (zero last 11 bits of n).
2708 • This cluster table consists of 2048 4-byte big-endian integers.
2710 • Each entry describes a cluster in 16MB supercluster, in order.
2712 • The valid values for entries are:
2714   – 0x00000000: Free cluster
2716   – 0x00000001: Last cluster in chain.
2718   – 0xFFFFFFFF: System cluster (cluster tables and superblock)
2720   – (anything else): Number of next cluster in chain. Must not be 
2721     multiple of 2048.
2723 • Due to limitations of the format, there can be at most 2097052 
2724   superclusters, giving maximum file size of 16TB.
2726 13.3 Stream table
2728 • The stream table chain always starts in cluster 2.
2730 • Otherwise, it follows normal chaining.
2732 • The stream table consists of 16-byte entries:
2734   – The first 8 bytes of entry give big-endian beginning position 
2735     of stream in units of 1/48000 s.
2737   – The next 4 bytes of entry give big-endian beginning cluster 
2738     for control data. 0 here marks the entry as not present.
2740   – The last 4 bytes of entry give big-endian beginning cluster 
2741     for codec data.
2743 • Stream table clusters are normal clusters, following normal 
2744   chaining.
2746 • The stream begnning position is not guarenteed unique. There 
2747   can be multiple streams with the same starting position in the 
2748   file.
2750 13.4 Stream control data
2752 • The stream control data consists of entries 4 bytes each:
2754   – The first 2 bytes of entry gives big-endian length of packet
2756   – The next byte of entry gives audio length of packet in units 
2757     of 1/400 s.
2759   – The last byte is control byte.
2761     ∗ 0 means this entry is not present and the control data 
2762       ends.
2764     ∗ 1 is valid control entry.
2766 • The stream control data can also end by running into end of the 
2767   readable chain.
2769   – This happens if there happens to be exact multiple of 2048 
2770     packets in stream and number of packets is nonzero.
2772 • These clusters follow normal chaining.
2774 13.5 Stream codec data
2776 • Stream codec data consists of raw Opus data packets packed back 
2777   to back with nothing in between.
2779 • Warning: Due to internal limitations, this data must reside in 
2780   the first 65536 superclusters (that is, the first 1TB of the 
2781   file).
2783 13.6 Superblock
2785 • The superblock is stored in cluster 1. 
2787 • The first 11 bytes are “sefs-magic”<NUL>.
2789 • The rest are unused.
2791 • This cluster 1 is marked as system special.
2793 14 Known ROM extensions
2795 • SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, 
2796   dx2, mgd, mgh.
2798 • DMG cartridge ROMs: dmg, gb.
2800 • GBC cartridge ROMs: cgb, gbc.
2802 15 Gamepack files
2804 • The first line must be: “[GAMEPACK FILE]”.
2806 • There is one needed line: “type <systype>”. This sets system 
2807   type to <systype>. The following system types are valid:
2809   – snes (SNES)
2811   – bsx (BS-X non-slotted)
2813   – bsxslotted (BS-X slotted)
2815   – sufamiturbo (Sufami Turbo)
2817   – sgb (Super Game Boy)
2819   – dmg (Game Boy)
2821   – gbc (Game Boy Color)
2823   – gbc_gba (Game Boy Color with GBA initial register values)
2825 • Optionally a region can be specified: “region <region>”. The 
2826   following values are valid:
2828   – autodetect (Autodetect region: snes and sgb only)
2830   – ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2832   – pal (PAL: snes, sgb)
2834   – world (World: dmg, gbc, gbc_gba)
2836 • ROM images are loaded as: “rom <type> <file>”. The following 
2837   types are valid:
2839   – rom (Cartridge ROM in snes, dmg, gbc, gbc_gba. BIOS in bsx, 
2840     bsxslotted, sufamiturbo)
2842   – bsx (Cartridge ROM in bsx, bsxslotted)
2844   – slot-a (Cartridge ROM in sufamiturbo)
2846   – slot-b (Cartridge ROM in sufamiturbo)
2848 • ROM markup can be loaded as: “xml <type> <file>”. The types 
2849   valid are the same as for ROMs.
2851 • Patches can be loaded as “patch[<offset>] <type> <file>”. The 
2852   types are the same as for ROMs.
2854   – Offset is given in form [+-]<number>. Usually offset is 
2855     either +0 or -512.
2857   – Default offset is +0.
2859 15.1 Example:
2861 [GAMEPACK FILE]
2863 type snes
2865 rom rom speedygonzales.sfc
2867 patch-512 rom sonicthehedgehog.ips
2869 15.2 Example 2:
2871 [GAMEPACK FILE]
2873 type sgb
2875 rom rom supergameboy.sfc
2877 rom dmg megamanV.dmg
2879 16 Quick'n'dirty encode guide
2881 1. Start the emulator and load the ROM and movie file.
2883 2. Set large AVI option 'set-setting avi-large on'
2885 3. Enable dumping 'dump-avi tmpdump' 
2887 4. Unpause and let it run until you want to end dumping.
2889 5. Close the emulator (closing the window is the easiest way). Or 
2890   use 'end-avi'.
2892 6. For each tmpdump*.avi file created, on command prompt, do 
2893   'x264 --crf 10 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2895 7. Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2897 8. Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + 
2898   tmpdump_0000001.mkv + tmpdump_0000002.mkv' (list every 
2899   tmpdump_<numbers>.mkv, with + in between).
2901 9. Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'. Now 
2902   final.mkv contains quick'n'dirty encode.
2904 17 Axis configurations for some gamepad types:
2906 17.1 XBox360 controller:
2908 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be 
2909 set to pressure-+.
2911 set-axis joystick0axis2 pressure-+
2913 set-axis joystick0axis5 pressure-+
2915 • This is needed for SDL only. EVDEV sets those types correctly.
2917 17.2 PS3 “sixaxis” controller:
2919 Axes 8-19 should be disabled.
2921 set-axis joystick0axis8 disabled
2923 set-axis joystick0axis9 disabled
2925 set-axis joystick0axis10 disabled
2927 set-axis joystick0axis11 disabled
2929 set-axis joystick0axis12 disabled
2931 set-axis joystick0axis13 disabled
2933 set-axis joystick0axis14 disabled
2935 set-axis joystick0axis15 disabled
2937 set-axis joystick0axis16 disabled
2939 set-axis joystick0axis17 disabled
2941 set-axis joystick0axis18 disabled
2943 set-axis joystick0axis19 disabled
2945 18 Errata:
2947 18.1 Problems from BSNES core:
2949 • The whole pending save stuff.
2951 • Lack of layer hiding.
2953 • It is slow (especially accuracy).
2955 • Firmwares can't be loaded from ZIP archives.
2957 18.2 Other problems:
2959 • Modifiers don't work with pseudo-keys (SDL, EVDEV).
2961 • Audio for last dumped frame is not itself dumped.
2963 • Audio in UI is pretty bad in quality if game doesn't run at 
2964   full speed.
2966 • No menus, command based interface (SDL).
2968 • Long commands don't scroll.
2970 19 Changelog:
2972 19.1 rr0-beta1
2974 • Fix -Wall warnings
2976 • Fix dumper video corruption with levels 10-18.
2978 19.2 rr0-beta2
2980 • Autofire
2982 • Lots of code cleanups
2984 • Lua interface to settings
2986 • Allow specifying AVI borders without Lua
2988 • Fix scaling if vscale > 1 and originx > 0 (left border exists)
2990 • on_snoop lua callback
2992 • Faster movie loading and saving.
2994 19.3 rr0-beta3
2996 • Joystick support
2998 19.4 rr0-beta4
3000 • Fix multi-buttons
3002 • Save jukebox functionality.
3004 19.5 rr0-beta5
3006 • Try to fix some nasty failing movie load edge cases
3008 • Allow specifying scripts to run on command line.
3010 19.6 rr0-beta6
3012 • Major source code reorganization.
3014 • Backup savestates before overwriting.
3016 • Don't crash if loading initial state fails.
3018 19.7 rr0-beta7
3020 • Fix firmware lookup
3022 • Fix author name parsing
3024 • Fix rerecord counting
3026 • (SDL) Print messages to console if SDL is uninitialized
3028 • Add movieinfo program
3030 • Fix loading movies starting from SRAM.
3032 19.8 rr0-beta8
3034 • Add support for unattended dumping
3036 • Fix compiling for Win32
3038 • Don't lock up if sound can't be initialized
3040 • Strip trailing CR from commands
3042 • Don't try to do dubious things in global ctors (fix crash on 
3043   startup)
3045 19.9 rr0-beta9
3047 • Small documentation tweaking
3049 • Fix make clean
3051 • Fix major bug in modifier matching
3053 19.10 rr0-beta10
3055 • Lots of documentation fixes
3057 • Use dedicated callbacks for event backcomm., not commands.
3059 • Ensure that the watchdog is not hit when executing delayed 
3060   reset.
3062 • Remove errant tab from joystick message.
3064 19.11 rr0-beta11
3066 • Make autofire operate in absolute time, not linear time
3068 • Reinitialize controls when resuming from loadstate
3070 • Some more code cleanups
3072 • If Lua allocator fails, call OOM_panic()
3074 • Byte/word/dword/qword sized host memory write/read functions.
3076 • Dump at correct framerate if dumping interlaced NTSC 
3077   (height=448).
3079 19.12 rr0-beta12
3081 • Actually include the complete source code
3083 • Keep track of RTC
3085 19.13 rr0-beta13
3087 • Document {save,start}time.{,sub}second.
3089 • Intercept time() from bsnes core.
3091 19.14 rr0-beta14
3093 • Allow disabling time() interception (allow build on Mac OS X)
3095 • Use SDLMain on Mac OS X (make SDL not crash)
3097 • Disable delayed resets (just plain too buggy for now).
3099 • Code cleanups
3101 • Use 16-bit for graphics/video instead of 32-bit.
3103 • gui.rectangle/gui.pixel
3105 • gui.crosshair
3107 • New CSCD writer implementation.
3109 19.15 rr0-beta15
3111 • Fix interaction of * and +.
3113 • Manual improvements
3115 • Use gettimeofday()/usleep(), these seem portable enough.
3117 • Move joystick axis manipulation to keymapper code.
3119 • Changes to how read-only works.
3121 • Refactor controller input code.
3123 19.16 rr0-beta16
3125 • Fix mouseclick scale compensation.
3127 • Draw area boundaries correctly in SDL code.
3129 • gui.screenshot.
3131 • Fix CSCD output (buffer overrun and race condition).
3133 19.17 rr0-beta17
3135 • JMD dumping support.
3137 • Allow unattended dumping to JMD.
3139 • Move to BSNES v083.
3141 • Switch back to 32-bit colors.
3143 • Add Lua function gui.color.
3145 • Use some new C++11 features in GCC 4.6.
3147 • Be prepared for core frequency changes.
3149 • Pass colors in one chunk from Lua.
3151 19.18 rr0-beta18
3153 • New lua functions gui.line(), gui.status() and gui.circle(), 
3154   memory.vma_count(), memory.read_vma() and memory.find_vma().
3156 • Numerious documentation fixups
3158 • RTC time format changed
3160 • Reformat flags display
3162 • Allow lua package name to be overridden
3164 • SDUMP (high-quality dumping).
3166 • Split platform support to plugins.
3168 • Make all sound plugins support basic sound commands
3170 • Support portaudio for sound.
3172 • Allow disable Lua/SDL searching.
3174 • Upconvert colors when copying lcscreen to screen.
3176 • Reorganize source tree.
3178 • Evdev joystick support.
3180 • Refactor more code into generic window code.
3182 19.19 rr0-beta19
3184 • Refactor message handling.
3186 • Rework makefile
3188 • Documentation fixes
3190 • Finish pending saves before load/quit.
3192 • Wxwidgets graphics plugin.
3194 19.20 rr0-beta20
3196 • Get rid of win32-crap.[ch]pp.
3198 • Move files around a lot.
3200 • Get rid of need for host C++ compiler.
3202 • Bsnes v084 core.
3204 • Refactor inter-component communication.
3206 • Fix zero luma.
3208 • Fix crash on multiline aliases.
3210 • Load/Save settings in wxwidgets gui.
3212 19.21 rr0-beta21
3214 • Patch problems in bsnes core
3216 • SNES is little-endian, not big-endian!
3218 • Fix memory corruption in lcscreen::load()
3220 19.22 rr0-beta22
3222 • Fix interpretting repeat counts in rrdata loading.
3224 • New lua callback: on_frame()
3226 • Remove calls to runtosave() that aren't supposed to be there
3228 • Lua function: movie.read_rtc()
3230 • Ignore src/fonts/font.cpp
3232 • Fix more bsnes core problems
3234 • Control bsnes random seeding
3236 • Pause-on-end
3238 • Some bsnes core debugging features (state dump and state hash)
3240 • Fix titlebar version number (no, the last version wasn't 
3241   'lsnes-0-beta21', it was 'lsnes rr0-beta21').
3243 19.23 rr0-beta23
3245 • Fix memory corruption due to macro/field mixup
3247 • search-memory update
3249 • Allow direct-mapped framebuffer
3251 • SDL: Use SDL_ANYFORMAT if possible
3253 • SDMP2SOX: 2s delay modes.
3255 • Wxwidgets: Cleanups
3257 • Use sed -E, not sed -r. Fixes building on Mac OS X.
3259 • Wxwidgets: Save jukebox on exit
3261 • Fix RTC if using load-movie on savestate.
3263 • Fix crash related to full console mode.
3265 19.24 rr0-beta24
3267 • Wxwidgets: Allow bringing application to foreground on Mac OS 
3268   X.
3270 • Wxwidgets: Allow compiling on Mac OS X.
3272 • Use movie compare instead of movie hashing (faster save/load).
3274 • Lua: _SYSTEM table.
3276 19.25 rr0-beta25
3278 • sdmp2sox: Pad soundtrack if using -l or -L.
3280 • sdmp2sox: Fix NTSC overscan.
3282 • sdmp2sox: Add AR correction mode.
3284 • call lua_close() when exiting.
3286 • Fix zip_writer bug causing warnings from info-zip and error 
3287   from advzip.
3289 19.26 rr0-beta26
3291 • Fix IPS patching code (use bsnes core IPS patcher).
3293 • Implement BPS patching (using bsnes core IPS patcher).
3295 • Add feature to load headered ROMs.
3297 19.27 rr0-beta27
3299 • Show command names when showing keybindings
3301 19.28 rr0
3303 • Fix pause-on-end to be actually controllable
3305 • SDL: Poll all events in queue, not just first one (fixes 
3306   slowness in command typing)
3308 • Wxwidgets: Fix ROM loading.
3310 19.29 rr1-beta0
3312 • Lua: Add gui.textH, gui.textV, gui.textHV
3314 • Fix text colors on SDL on Mac OS X
3316 • Mode 'F' for finished in readonly mode.
3318 • Fix some WS errors.
3320 • Reliably pause after skip poll
3322 • Split UI and core into their own threads
3324 19.30 rr1-beta1
3326 • Remove leftover dummy SRAM slot
3328 • Fix controller numbers.
3330 19.31 rr1-beta2
3332 • Fix lsnes-dumpavi after interface change.
3334 • Also give BSNES patches for v085.
3336 • Pack movie data in memory.
3338 19.32 rr1-beta3
3340 • Fix framecount/length given when loading movies.
3342 • Controller command memory leak fixes.
3344 • Don't leak palette if freeing screen object.
3346 19.33 rr1-beta4
3348 • Detect revisions.
3350 • Wxwidgets: Allow controlling dumper from the menu.
3352 19.34 rr1-beta5
3354 • Rewrite parts of manual
3356 • Lua: Make it work with Lua 5.2.
3358 19.35 rr1-beta6
3360 • Win32: Fix compile errors.
3362 19.36 rr1-beta7
3364 • Refactor controller input code.
3366 • Fix crash when using command line on SDL / Mac OS X.
3368 19.37 rr1-beta8
3370 • Delete core/coroutine (obsolete)
3372 • Lag input display by one frame.
3374 • Rewind movie to beginning function.
3376 • Fix wrong frame number reported to Lua when repainting after 
3377   loadstate
3379 • Support UI editing of jukebox
3381 • Wxwidgets: Save settings on exit.
3383 • Support ${project} for filenames
3385 • SDL: Fix command history
3387 19.38 rr1-beta9
3389 • Fix some order-of-global-ctor bugs.
3391 19.39 rr1-beta10
3393 • Fix crashes when quitting on Win32.
3395 19.40 rr1-beta11
3397 • EVDEV: Queue keypresses from joystick, don't send directly
3399 • Wxwidgets: Load-Preserve that actually works.
3401 19.41 rr1-beta12
3403 • Wxwidgets: GUI for memory search.
3405 • Warn about using synchronous queue in UI callback.
3407 19.42 rr1-beta13
3409 • Remember last saved file for each ROM
3411 • Support MT dumping via boost.
3413 • Lua: input.raw
3415 • Lua: input.keyhook
3417 • Make mouse be ordinary input instead of special-casing
3419 • SDL: Don't screw up commands with NUL codepoints.
3421 19.43 rr1-beta14
3423 • Merge status panel and main window
3425 • True movie slot support (the rest of it)
3427 • SDL: Fix compilation error
3429 • Elminate cross calls in dump menu code.
3431 19.44 rr1-beta15
3433 • Cancel pending saves command
3435 • Wxwidgets: Code refactoring
3437 • Wxwidgets: Fix system -> reset
3439 • Wxwidgets: Read watch expressions in the right thread
3441 19.45 rr1-beta16
3443 • Wxwidgets: Don't prompt for member when running Lua script (Lua 
3444   doesn't support that).
3446 • Wxwidgets: 128 -> 1024 Autohold slots (in case more are 
3447   needed).
3449 • Don't append trailing '-' to prefix when saving movie.
3451 • Fix ROM/savestate handling (don't let user mismatch ROM and 
3452   savestates).
3454 19.46 rr1
3456 • Document memory watch syntax.
3458 19.47 rr1-delta1
3460 • Fix unattended dumping (lsnes-dumpavi)
3462 • Support RAW dumping
3464 • Use adv_dumper instead of the old interface in lsnes-dumpavi 
3465   (changes syntax)
3467 • Add option to control sample rate preturbation in AVI dumper
3469 19.48 rr1-delta2
3471 • Wxwidgets: Fix dumper submodes
3473 • Set core controller types before loadstate
3475 19.49 rr1-delta2epsilon1
3477 • Fix compiling with bsnes v086.
3479 19.50 rr1-delta3
3481 • Don't prompt before quitting
3483 • Start unpaused, preserve pause/unpause over load.
3485 • Try to autodetect if ROM is headered.
3487 • Wxwidgets: Only bring up ROM patching screen if specifically 
3488   requested.
3490 • Allow configuring some hotkeys.
3492 19.51 rr1-delta4
3494 • Lots of code cleanups
3496 • Fix JMD compression (JMD dumping was broken)
3498 • Don't crash if Lua C function throws an exception.
3500 • Support bitmap drawing in Lua.
3502 • Fix bsnes v085/v086 patches.
3504 • Improve stability on win32.
3506 19.52 rr1-delta4epsilon1
3508 • Don't corrupt movie if movie length is integer multiple of 
3509   frames per page.
3511 19.53 rr1-delta5
3513 • New Lua hooks: on_rewind, on_frame_emulated, on_idle, on_timer
3515 • New Lua functions: emulator_ready(), utime(), 
3516   set_idle_timeout(), set_timer_timeout(), bit.extract(), 
3517   bit.value(), input.geta(), input.seta() and 
3518   input.controllertype()
3520 • Wxwidgets: Fix internal focus lost (hotkeys stop working)
3522 • Wxwidgets: Fix broken modifiers
3524 • on_paint has parameter now.
3526 • Optional initital fill for bitmaps
3528 • Fix palette changing.
3530 • Optimize rendering a bit.
3532 • Bsnes v087 support.
3534 19.54 rr1-delta5epsilon1
3536 • Movieinfo: Fix display of port #2 type.
3538 • Call on_input() after loadstate.
3540 19.55 rr1-delta5epsilon2
3542 • Fix writing port2 data to movie.
3544 • Fix SRAM handling with Bsnes v087.
3546 19.56 rr1-delta6
3548 • Library loading support
3550 • Built-in TSCC encoder
3552 • Hi-color (256T colors) dumping.
3554 • Dump over TCP/IP(v6)
3556 • Hidable status panel
3558 • Turbo toggle/hold
3560 • Adjustable sound volume
3562 • Screen scaling
3564 • Allow DnD into filename boxes
3566 • Configurable paths
3568 • Portaudio: Fix speaker popping at start
3570 • Lots of UI changes
3572 • Speed adjustment menu
3574 • Win32 joystick support
3576 • Lua: gui.rainbow and gui.box
3578 • Split key lists into classes (the key list was large!)
3580 • More save slots support
3582 • Wxwidgets (wxJoystick) joystick support
3584 19.57 rr1-delta7
3586 • Lots of internal joystick refactoring
3588 • Evdev: Add mapping for BTN_TOOL_QUINTTAP
3590 • Wxwidgets: Settings mode (open settings without ROM)
3592 • Wxwidgets: Prompt key to use option
3594 • Wxwidgets: Fix crash if key goes away underneath
3596 • Wxwidgets: Fix mouse position in presence of scaling
3598 • AVI dumper: Mode 4 (high-quality resampling to common rate 
3599   using SRC)
3601 • Wxwidgets: Redesign hotkeys dialog to avoid tree control (tree 
3602   control doesn't seem to work well on WinXP)
3604 • Start paused option.
3606 19.58 rr1-delta7epsilon1
3608 • AVI: ZMBV support
3610 • lsnes-dumpavi: Start Lua before starting dumper
3612 • AVI: Fix secondary audio in mode 4.
3614 19.59 rr1-delta7epsilon2
3616 • AVI: Refactor ZMBV a bit.
3618 • Fix error reading analog values from movie file
3620 19.60 rr1-delta8
3622 • Delayed reset support
3624 • Lua: memory.hash_region
3626 19.61 rr1-delta8epsilon1
3628 • Rework the build system
3630 • Typing input support
3632 • Fix building with bsnes v086 and v087.
3634 • SDL: Save settings on exit
3636 • SDL: Command to enter command line mode with given command.
3638 • SDL: More advanced command editing.
3640 19.62 rr1-delta9
3642 • wxMSW: Fix the “arrow keys and enter don't work” problem
3644 • MSU-1 support
3646 • Show mode changes due to rewinding.
3648 • Unsafe rewind support
3650 • Fix directory transversal.
3652 19.63 rr1-delta10
3654 • AVI: Sound mode 5 (48kHz high-quality)
3656 • Lua: Reset Lua VM
3658 • Map the SNES bus into address space
3660 • Fix loading memory watch files with CRLF line endings
3662 19.64 rr1-delta10epsilon1
3664 • Map bsnes internal state into memory space
3666 • Fix the “click on panel wedges the emulator” for real.
3668 • DnD movies/saves on the main window.
3670 19.65 rr1-delta11
3672 • Split core bindings into own module.
3674 • Remember invalid settings
3676 • Support for modified Gambatte core for GB/GBC emulation.
3678 • Reload/swap ROM function
3680 19.66 rr1-delta11epsilon1
3682 • Fix step poll function
3684 19.67 rr1-delta12
3686 • Non-insane savestate anchoring
3688 19.68 rr1-delta13
3690 • More Memory search methods
3692 • Preserve movie if loading in RO mode.
3694 • Fix a obscure case in timeline check
3696 • Revamp the entiere ROM loading code
3698 • Support DnD on ROMs
3700 • Revamp menu layout
3702 • Standalone hotkey config dialog
3704 • Show bindings in more user-friendly format
3706 19.69 rr1-delta13epsilon1
3708 • Pipedec support
3710 • Fix uninitialized variables in bsnes v085
3712 19.70 rr1-delta14
3714 • Merge gambatte core into mainline (from its own branch)
3716 • Wxwidgets: Show expected dump file formats
3718 • Memory watch: Data typing
3720 • lsnes internal MMIO area.
3722 • Wxwidgets: New memory watch editor
3724 • Hexadecimal memory watches
3726 • Wxwidgets: Monospaced panel
3728 • Wxwidgets: Split memory watches in panel
3730 • Wxwidgets: Disable VMAs in memory search
3732 • lsnes-dumpavi: Fix speed bug
3734 • Movie subtitle support
3736 • Fix rerecord count reporting
3738 • Don't trash movie when loading in readonly mode.
3740 19.71 rr1-delta14epsilon1
3742 • Wxwidgets: Fix crashes on closing settings dialogs on Mac OS X.
3744 • Fix build on Mac OS X.
3746 • Lua: loopwrapper
3748 • Wxwidgets: Hidable messages window
3750 • Lua: input.joyset
3752 • Bsnes: Support inconsistent saves
3754 • Bsnes: Allow simulating saving every frame
3756 • Fix desync if savestate is loaded in readonly mode in certain 
3757   conditions.
3759 • Wxwidgets: Fix save dialogs on Mac OS X.
3761 • Wxwidgets: Fix insane status width on Win32.
3763 • Wxwidgets: Fix autohold processing to be faster.
3765 • Wxwidgets: Allow loading ROMs and movies from commandline.
3767 19.72 rr1-delta15
3769 • Be a bit smarter with --load
3771 • Rewrote higher-level parts of audio system
3773 • Tool to build commentary tracks
3775 • Lua: input.joyget
3777 • Gambatte: Add support for SVN358
3779 • Use builtin font when rendering status panel.
3781 • Option to detach memory watch to its own window.
3783 • Recent ROMs/Movies menu
3785 • Libao support
3787 • Useful lag counter for SNES games that autopoll
3789 • Fix buffer overflow in gambatte sound output
3791 19.73 rr1-delta15epsilon1
3793 • Don't blow up on wxGTK if the window is hidden somehow
3795 • Support simultaneous drop of ROM and movie.
3797 • Gambatte: Don't save spurious SRAMs.
3799 • Make SGB ROMs actually usable.
3801 • Fix so that saved movies appear in recent movies.
3803 • Don't open multiple commentary editors at once.
3805 19.74 rr1-delta15epsilon2
3807 • Lua: memory.readregion/memory.writeregion
3809 • Lua: memory.map{,s}{byte,word,dword,qword}
3811 • Lua: memory.map_structure
3813 • Lua: Fix bus_address for gambatte
3815 • Fix features dependent of bsnes debugger
3817 • Cleanup bsnes debugger logic
3819 • Fix resets in presence of save every frame
3821 19.75 rr1-delta15epsilon3
3823 • Lua: input.lcid_to_pcid
3825 • Fix off-by-one bug with slot hashes
3827 • Fix crashes on certain memory watch expressions
3829 • Lua: memory.read_expr
3831 • Lua: Fix memory.read_expr on nil argument
3833 • Fix the code to compile on G++ 4.7
3835 • Change button_id to be a function pointer field, not a virtual 
3836   method
3838 • Add bsnes patches to fix libsnes to compile on GCC 4.7
3840 • Gambatte: Always use legacy lag counting
3842 • Memory commands: Memory addresses are up to 16 hex digits, not 
3843   up to 8
3845 • Fix analog controllers
3847 • Fix autohold menus
3849 • Fix button symbols in input display
3851 • Compensate for nuts bsnes superscope/justifier handling
3853 • Lua: Fix bit.extract boolean handling
3855 19.76 rr1-delta16
3857 • Stop at movie end: Don't off-by-one
3859 • Fix crash closing lsnes with voice playback active.
3861 • Import/Export OggOpus for commentary tracks
3863 • 16-button controllers.
3865 • Don't show nonexistent controllers in input display
3867 • Set voice record/playback volume from UI
3869 • Patches for gambatte SVN364.
3871 • Load markup (if exists) even without gamepack file.
3873 • Screen rotation & flipping
3875 • Lua: Some new bit functions
3877 • Auto-refresh voice streams on change.
3879 • Auto-refresh subtitles on change & new subtitle editor.
3881 • Fix music volume adjustment.
3883 19.77 rr1-delta16epsilon1
3885 • Wxwidgets: Fix memory watch rendering.
3887 • Wxwidgets: Allow setting voice stream gain.
3889 • Wxwidgets: VU meters and volume adjustment.
3891 • Lua: Custom fonts support.
3893 • Lua: Fix methods stopping working when resetting Lua.
3895 • Fix loading standard-format movies in preserve (readonly) mode.
3897 19.78 rr1-delta17
3899 • Primitive movie editor
3901 • Fix VU meter with no sound device.
3903 • Fix various undefined return values.
3905 • Show rates in VU meter window.
3907 19.79 rr1-delta17epsilon1
3909 • Commentary tool: Set nominal bit rate and limit max bit rate.
3911 • Lua: Unconditionally reload host memory on loadstate
3913 • Lua: Query bindings, manipulate aliases, create inverse 
3914   bindings
3916 • Lua: Fix crashes with resetting VM while some types of paint 
3917   requests are in flight.
3919 • Lua: gui.text: Clip the text properly instead of corrupting 
3920   memory in some cases.
3922 • Save screenshot header reliably
3924 • Lua: Backport input.get2 and input.set2
3926 • Lua: New controller info functions.
3928 • Movie editor: Fix reset delay counters to be the right way 
3929   around.
3931 • Lua: on_snoop2
3933 • Lua: on_button and input.veto_button.
3935 19.80 rr1-delta17epsilon2
3937 • Fix saving PNG screenshots on Win32.
3939 • Movie editor: Sweep axis.
3941 • Load selected slot in ro/rw/preserve/movie mode.
3943 • input.joyset: Preserve and invert user input.
3945 • Allow immediate saving at point of save (transfer saves).
3947 • Wxwidgets: Filter filenames in dialogs, autoappend extensions.
3949 • data/verysmall.font: Add missing glyph 70 (“F”).
3951 • Lua: Allow painting custom fonts with halo.
3953 • Fix memory value search to work on byte types.
3955 19.81 rr1-delta17epsilon3
3957 • Fix status panel (and movie editor) flicker
3959 • Show effects of Lua in input display
3961 • Offer lsmv.backup as file filter too for load lsmv
3963 • Allow slowing down subframe advance 
3965 • Display current save slot information
3967 • Add snes9x fonts
3969 • Fix hotkeys stopping working after X-ing settings dialog
3971 • Movie editor: Fix bug if extending finished movie
3973 • Cap current_frame_first_subframe to movie size when recounting 
3974   movie
3976 • Movie editor: Interpret ctrl+click as right click