Fix status panel (and movie editor) flicker
[lsnes.git] / manual.txt
blob31494513f5d317c91050104d2f147d203fed8574
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 allow-inconsistent-saves (bsnes only)
855 If true, save without synchronization. Makes games seriously 
856 unstable.
858 7.1.6 save-every-frame (bsnes only)
860 If true, simulate saving on each frame. Trades off emulation 
861 accuracy for sync stability. Also needed if the movie assumes 
862 saving on each frame for rewind.
864 7.2 AVI dumper settings
866 7.2.1 avi-large
868 AVI dumper: Always dump at 512x448 or 512x478 regardless of what 
869 the console outputs.
871 7.2.2 avi-left-border
873 AVI dumper: Set the default left border thickness (unless lua 
874 overrides) for dumps. Range 0-8191. Default is 0.
876 7.2.3 avi-right-border
878 AVI dumper: Set the default right border thickness (unless lua 
879 overrides) for dumps. Range 0-8191. Default is 0.
881 7.2.4 avi-top-border
883 AVI dumper: Set the default top border thickness (unless lua 
884 overrides) for dumps. Range 0-8191. Default is 0.
886 7.2.5 avi-bottom-border
888 AVI dumper: Set the default bottom border thickness (unless lua 
889 overrides) for dumps. Range 0-8191. Default is 0.
891 7.2.6 avi-maxframes
893 AVI dumper: Maximum number of frames per dump segment (0 => 
894 unlimited). Range 0-999999999. Default is 0.
896 7.2.7 avi-compresison
898 AVI dumper: Compression level (0-18).
900 • Compression levels 10 and above are not compatible with stock 
901   CSCD codec.
903 • Recomended level is 7.
905 7.2.8 avi-soundrate
907 AVI dumper: Set method of determining the sound rate.
909 • 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 
910   64, 88.2, 96, 128, 176.4 and 192 kHz.
912 • 1: Round down to nearest integer.
914 • 2: Round up to nearest ingeter.
916 7.3 JMD options
918 7.3.1 jmd-copression
920 JMD dumper: Compression level (0-9).
922 7.4 SDL platform settings
924 7.4.1 autorepeat-first-delay
926 Sets the delay for first character in typematic autorepeat.
928 7.4.2 autorepeat-subsequent-delay
930 Sets the delay for subsequent characters in typematic autorepeat.
932 8 Lua functions
934 8.1 Core (in main table)
936 8.1.1 print
938 Print line to message console.
940 8.1.2 exec(string command)
942 Run command as it was entered on the command line
944 8.1.3 utime()
946 Returns two values. First is time since some epoch in seconds, 
947 the second is microseconds mod 10^6 since that epoch.
949 8.1.4 emulator_ready()
951 Returns true if emulator has finished booting, false if not 
952 (on_startup() will be issued later).
954 8.1.5 set_idle_timeout(number timeout)
956 Set number of microseconds to block idle for. After this timeout 
957 has expired, on_idle() will be called once.
959 8.1.6 set_timer_timeout(number timeout)
961 Set number of microseconds to block timer for. After this timeout 
962 has expired, on_timer() will be called once.
964 8.1.7 bus_address(number snesaddr)
966 Returns virtual address corresponding to specified address on 
967 SNES bus.
969 8.1.8 loopwrapper(function fun, ...)
971 Calls function fun with function and specified arguments. The 
972 function passed suspends execution until the function returned is 
973 called. Handy for linear flow control among multiple invocations 
974 of a hook. Example code:
976 on_paint = loopwrapper(function(wait)
978   while true do
980     gui.text(0, 0, “Test!”);
982     wait();
984   end
986 end);
988 8.1.9 list_bindings([string cmd])
990 Get table of all keybindings, indexed by keyspec 
991 (modifiers|mask/key). If command is specified, the table is 
992 limited to that command.
994 8.1.10 get_alias(string aname)
996 Get expansion of given alias.
998 8.1.11 set_alias(string aname, string value)
1000 Set expansion of given alias.
1002 8.1.12 create_ibind(string name, string cmd)
1004 Return object representing inverse binding with specified name 
1005 and specified command.
1007 • To create press/release commands, use aliases +foo and -foo .
1009 • Keep the returned object around.
1011 8.2 Table bit:
1013 Bitwise logical functions and related.
1015 8.2.1 bit.none(number...) / bit.bnot(number...)
1017 48-bit bitwise NOT / NONE function (set bits that are set in none 
1018 of the arguments).
1020 8.2.2 bit.any(number...) / bit.bor(number...)
1022 48-bit bitwise OR / ANY function (set bits that are set in any of 
1023 the arguments).
1025 8.2.3 bit.all(number...) / bit.band(number...)
1027 48-bit bitwise AND / ALL function (set bits that are set in all 
1028 of the arguments).
1030 8.2.4 bit.parity(number...) / bit.bxor(number...)
1032 48-bit bitwise XOR / PARITY function (set bits that are set in 
1033 odd number of the arguments).
1035 8.2.5 bit.lrotate(number base[, number amount[, number bits]])
1037 Rotate bits-bit (max 48, default 48) number left by amount 
1038 (default 1) places.
1040 8.2.6 bit.rrotate(number base[, number amount[, number bits]])
1042 Rotate bits-bit (max 48, default 48) number right by amount 
1043 (default 1) places.
1045 8.2.7 bit.lshift(number base[, number amount[, number bits]])
1047 Shift bits-bit (max 48, default 48) number left by amount 
1048 (default 1) places. The new bits are filled with zeroes.
1050 8.2.8 bit.lrshift(number base[, number amount[, number bits]])
1052 Shift bits-bit (max 48, default 48) number logically right by 
1053 amount (default 1) places. The new bits are filled with zeroes.
1055 8.2.9 bit.arshift(number base[, number amount[, number bits]])
1057 Shift bits-bit (max 48, default 48) number arithmetically right 
1058 by amount (default 1) places. The new bits are shifted in with 
1059 copy of the high bit.
1061 8.2.10 bit.extract(number base[, number bit0[, number bit1,...]])
1063 Returns number that has bit0-th bit as bit 0, bit1-th bit as 1 
1064 and so on.
1066 Notes: 
1068 • Bit numbers up to 51 should work reliably (then things start 
1069   falling apart due to double precision issues).
1071 • There are two special bit positions, true and false, standing 
1072   for always set bit and always clear bit.
1074 8.2.11 bit.value([number bit1[, number bit2,...]])
1076 Returns bitwise OR of 1 left shifted by bit1 places, 1 left 
1077 shifted by bit2 places and so on. As special value, nil argument 
1078 is no-op.
1080 8.2.12 bit.test_any(number a, number b)
1082 Is there a common set bit in a and b?
1084 8.2.13 bit.test_all(number a, number b)
1086 Are all set bits in b also set in a?
1088 8.2.14 bit.popcount(number a)
1090 Population count of a.
1092 8.2.15 bit.clshift(number a, number b, [number amount,[number 
1093   bits]])
1095 Does chained left shift on a, b by amount positions, assuming 
1096 numbers to be of specified number of bits.
1098 8.2.16 bit.crshift(number a, number b, [number amount,[number 
1099   bits]])
1101 Does chained right shift on a, b by amount positions, assuming 
1102 numbers to be of specified number of bits.
1104 8.2.17 bit.flagdecode(number a, number bits, [string on, [string 
1105   off]])
1107 Return string of length bits where ith character is ith character 
1108 of on if bit i is on, otherwise ith character of off. Out of 
1109 range reads give last character, or '*'/'-' if empty.
1111 8.2.18 bit.rflagdecode(number a, number bits, [string on, [string 
1112   off]])
1114 Like bit.flagdecode, but outputs the string in the opposite order 
1115 (most significant bit first).
1117 8.3 Table gui:
1119 Most of these functions can only be called in on_paint and 
1120 on_video callbacks. Exceptions are noted.
1122 Colors are 32-bit. Bits 0-7 are the blue component, bits 8-15 are 
1123 the green component, bits 16-23 are the red component, bits 24-31 
1124 are alpha component (0 is fully opaque, 255 is almost 
1125 transparent). -1 is the fully transparent color. Alpha values 
1126 greater than 127 do work.
1128 Origin of coordinates is at top left corner of game display area. 
1129 Left and top gaps correspond to negative coordinates.
1131 8.3.1 gui.resolution()
1133 Returns 2-tuple (hresolution, vresolution).
1135 8.3.2 gui.<class>_gap(number gap)
1137 Set the <class> (left, right, top, bottom) gap to specified value 
1138 (max gap is 8191).
1140 8.3.3 gui.text(number x, number y, string text[, number fgc[, 
1141   number bgc]])
1143 Draw specified text on the GUI (each character cell is 8 or 16 
1144 wide and 16 high). Parameters:
1146 • x: X-coordinate to start the drawing from (and x-coordinate at 
1147   begining of the lines).
1149 • y: Y-coordinate to start the drawing from.
1151 • text: The text to draw.
1153 • fgc: Text color (default is 0xFFFFFF (white))
1155 • bgc: Background color (default is -1 (transparent))
1157 8.3.4 gui.textH(number x, number y, string text[, number fgc[, 
1158   number bgc]])
1160 Like gui.text, but draw using double-width.
1162 8.3.5 gui.textV(number x, number y, string text[, number fgc[, 
1163   number bgc]])
1165 Like gui.text, but draw using double-height.
1167 8.3.6 gui.textHV(number x, number y, string text[, number fgc[, 
1168   number bgc]])
1170 Like gui.text, but draw using double-width/double-height.
1172 8.3.7 gui.rectangle(number x, number y, number width, number 
1173   height[, number thickness[, number outline[, number fill]]])
1175 Draw rectangle on the GUI. Parameters:
1177 • x: X-coordinate of left edge.
1179 • y: Y-coordinate of upper edge.
1181 • width: Width of rectangle.
1183 • height: Height of rectangle.
1185 • thickness: Thickness of outline (default is 1).
1187 • outline: Color of outline (default is 0xFFFFFF (white))
1189 • fill: Color of fill (default is -1 (transparent))
1191 8.3.8 gui.box(number x, number y, number width, number height[, 
1192   number thickness[, number outline1[,number outline2[, number 
1193   fill]]]])
1195 Draw rectangle with 3D effect on the GUI. Parameters:
1197 • x: X-coordinate of left edge.
1199 • y: Y-coordinate of upper edge.
1201 • width: Width of rectangle.
1203 • height: Height of rectangle.
1205 • thickness: Thickness of outline (default is 1).
1207 • outline1: First color of outline (default is 0xFFFFFF (white))
1209 • outline2: First color of outline (default is 0x808080 (dark 
1210   gray))
1212 • fill: Color of fill (default is 0xC0C0C0 (light grayy))
1214 8.3.9 gui.pixel(number x, number y[, number color])
1216 Draw one pixel on the GUI. Parameters:
1218 • x: X-coordinate of the pixel
1220 • y: Y-coordinate of the pixel
1222 • color: Color of the pixel (default is 0xFFFFFF (white))
1224 8.3.10 gui.crosshair(number x, number y[, number length[, number 
1225   color]])
1227 Draw a crosshair. Parameters:
1229 • x: X-coordinate of the crosshair
1231 • y: Y-coordinate of the crosshair
1233 • length: Length of the crosshair lines (default 10).
1235 • color: Color of the crosshair (default is 0xFFFFFF (white))
1237 8.3.11 gui.line(number x1, number y1, number x2, number y2[, 
1238   number color])
1240 Draw a thin line. Parameters:
1242 • x1: X-coordinate of one end.
1244 • y1: Y-coordinate of one end.
1246 • x2: X-coordinate of the other end.
1248 • y2: Y-coordinate of the other end.
1250 • color: Color of the line (default is 0xFFFFFF (white)).
1252 8.3.12 gui.circle(number x, number y, number r[, number thick[, 
1253   number border[, number fil]]])
1255 Draw a circle. Parameters.
1257 • x: X-coordinate of the center
1259 • y: Y-coordinate of the center
1261 • r: The radius of the circle
1263 • thick: Border thickness
1265 • border: Border color (default is 0xFFFFFF (white))
1267 • fill: Fill color (default is -1 (transparent)).
1269 8.3.13 gui.bitmap_draw(number x, number y, bitmap bitmap, palette 
1270   palette)
1272 Draw a bitmap on screen with specified palette. Parameters:
1274 • x: X-coordinate of left edge.
1276 • y: Y-coordinate of top edge.
1278 • bitmap: The bitmap to draw
1280 • palette: The palette to draw the bitmap using.
1282 8.3.14 gui.bitmap_draw(number x, number y, dbitmap bitmap)
1284 Draw a bitmap on screen. Parameters:
1286 • x: X-coordinate of left edge.
1288 • y: Y-coordinate of top edge.
1290 • bitmap: The bitmap to draw
1292 8.3.15 gui.palette_new()
1294 Returns a new palette (initially all transparent). Can be used 
1295 anywhere.
1297 8.3.16 gui.bitmap_new(number w, number h, boolean direct[, bool 
1298   icolor])
1300 Returns a new bitmap/dbitmap. Can be used anywhere. Parameters:
1302 • w: The width of new bitmap
1304 • h: The height of new bitmap
1306 • direct: If true, the returned bitmap is dbitmap, otherwise 
1307   bitmap.
1309 • icolor: Initital fill color (defaults to 0 on BITMAP, -1 on 
1310   DBITMAP)
1312 8.3.17 gui.bitmap_load(string file)
1314 Returns loaded bitmap/dbitmap (if bitmap, the second return value 
1315 is palette for bitmap). Can be used anywhere. Parameters:
1317 • file: The name of file to load.
1319 8.3.18 gui.palette_set(palette palette, number index, number 
1320   color)
1322 Sets color in palette. Can be used anywhere. Parameters:
1324 • palette: The palette to manipulate
1326 • index: Index of color (0-65535).
1328 • color: The color value.
1330 8.3.19 gui.bitmap_pset(bitmap/dbitmap bitmap, number x, number y, 
1331   number color)
1333 Sets specified pixel in bitmap. Can be used anywhere. Parameters:
1335 • bitmap: The bitmap to manipulate
1337 • x: The x-coordinate of the pixel.
1339 • y: The y-coordinate of the pixel.
1341 • color: If bitmap is a bitmap, color index (0-65535). Otherwise 
1342   color value.
1344 8.3.20 gui.bitmap_size(bitmap/dbitmap bitmap)
1346 Get size of bitmap. Can be used anywhere. Parameters:
1348 • bitmap: The bitmap to query.
1350 The first return is the width, the second is the height.
1352 8.3.21 gui.bitmap_blit(bitmap/dbitmap dest, number dx, number dy, 
1353   bitmap/dbitmap src, number sx, number sy, number w, number h[, 
1354   number ck])
1356 Blit a part of bitmap to another. Can be used anywhere. 
1357 Parameters:
1359 • dest: Destination to blit to.
1361 • dx: left edge of target
1363 • dy: Top edge of target
1365 • src: The source to blit from. Must be of the same type as 
1366   destination.
1368 • sx: left edge of source
1370 • sy: Top edge of source
1372 • w: Width of region
1374 • h: Height of region.
1376 • ck: Color key. Pixels of this color are not blitted.
1378   – If bitmaps are bitmaps, this is color index of colorkey. 
1379     Values outside range 0-65535 cause no key to be used as 
1380     colorkey.
1382   – If bitmaps are dbitmaps, this color value of colorkey.
1384   – May be absent or nil for no colorkey blit.
1386 8.3.22 gui.repaint()
1388 Request on_repaint() to happen as soon as possible. Can be used 
1389 anywhere.
1391 8.3.23 gui.subframe_update(boolean on)
1393 Request subframe updates (calling on_paint() on subframes) to 
1394 happen (on=true) or not happen (on=false). Can be used anywhere.
1396 8.3.24 gui.screenshot(string filename)
1398 Write PNG screenshot of the current frame (no drawings) to 
1399 specified file. Can be used anywhere.
1401 8.3.25 gui.color(number r, number g, number b[, number a])
1403 Returns color (in notation Lua scripts use) corresponding to 
1404 color (r,g,b), each component in scale 0-255. If a is specified, 
1405 that is alpha (0 is fully transparent, 256(sic) is fully opaque). 
1406 The default alpha is 256.
1408 8.3.26 gui.status(string name, string value)
1410 Set status field “L[<name>]” to <value> in status area. Can be 
1411 used anywhere.
1413 8.3.27 gui.rainbow(number step, number steps[, number color])
1415 Perform hue rotation of color <color> (default bright red), by 
1416 <step> steps. The number of steps per full rotation is given by 
1417 absolute value of <steps>.
1419 If <steps> is negative, the rotation will be counterclockwise.
1421 8.3.28 gui.screenshot(string filename)
1423 Saves a screenshot into specified file.
1425 8.3.29 gui.loadfont(string filename)
1427 Loads font from specified file (CUSTOMFONT object).
1429 8.3.30 CUSTOMFONT(number x, number y, string text[, number fgc[, 
1430   number bgc[, number hlc]]])
1432 Draw string with custom font to screen. The parameters are the 
1433 same as in gui.text, except hlc is the halo color (default is no 
1434 halo). 
1436 8.4 table input
1438 Input handling. Only available in on_input callback.
1440 8.4.1 input.get(number controller, number index)
1442 Read the specified index (0-11) from specified controller (0-7). 
1443 Notes:
1445 • Uses physical controller numbering. Gamepad in port 2 is 
1446   controller 4, not 1!
1448 8.4.2 input.set(number controller, number index, number value)
1450 Write the specified index (0-11) from specified controller (0-7), 
1451 storing value. Notes:
1453 • Uses physical controller numbering. Gamepad in port 2 is 
1454   controller 4, not 1!
1456 8.4.3 input.get2(number port, number controller, number index)
1458 Read the specified input tuple.
1460 • Port 0 is system port.
1462 8.4.4 input.set2(number port, number controller, number index, 
1463   number value)
1465 Write the specified input tuple.
1467 • Port 0 is system port.
1469 8.4.5 input.lcid_to_pcid2(number lcid)
1471 Look up physical pcid pair (port, controller) corresponding to 
1472 specified logical controller (1-based). Returns nothing if 
1473 controller does not exist.
1475 8.4.6 input.port_type(number port)
1477 Return type of specified port.
1479 8.4.7 input.controller_info(number port, number controller)
1481 Get controller info for specified controller. If controller does 
1482 not exist, returns nil. Otherwise returns a table with following 
1483 fields:
1485 • type (string): Type of the controller.
1487 • class (string): Class of the controller.
1489 • classnum (number): Number of the controller within its class 
1490   (1-based)
1492 • lcid (number): Logical controller number of the controller.
1494 • button_count (number): Number of buttons on controller
1496 • buttons (array): Array of following info about each button:
1498   – type (string): Type of button. Currently one of “null”, “
1499     button”, “axis”, “raxis”.
1501   – name (string): Name of button.
1503   – symbol (string): Symbol of button. Only present for type “
1504     button”.
1506   – hidden (boolean): True if hidden button. 
1508 8.4.8 input.veto_button()
1510 Signals that the button event should be vetoed. Only valid in 
1511 on_button callback.
1513 8.4.9 input.geta(number controller)
1515 Get input state for entiere controller. Returns 13 return values.
1517 • 1st return value: Bitmask: bit i is set if i:th index is 
1518   nonzero
1520 • 2nd-13th return value: value of i:th index.
1522 8.4.10 input.seta(number controller, number bitmask, number 
1523   args...)
1525 Set state for entiere controller. args is up to 12 values for 
1526 indices (overriding values in bitmask if specified).
1528 8.4.11 input.controllertype(number controller)
1530 Get the type of controller as string. Valid values are:
1532 • gamepad
1534 • mouse
1536 • justifier
1538 • superscope
1540 8.4.12 input.reset([number cycles])
1542 Execute reset. If cycles is greater than zero, do delayed reset. 
1543 0 (or no value) causes immediate reset.
1545 • Only available with subframe flag false.
1547 8.4.13 input.raw()
1549 Returns table of tables of all available keys and axes. The first 
1550 table is indexed by key name (platform-dependent!), and the inner 
1551 table has the following fields:
1553 • last_rawval: Last reported raw value for control.
1555 • ktype: Type of key (disabled, key, mouse, axis, axis-inverse, 
1556   hat, pressure-m0, pressure-mp, pressure-0m, pressure-0p, 
1557   pressure-pm, pressure-p0).
1559 • cal_left: Minimum calibration value. Only meaningful with axis 
1560   and pressure types.
1562 • cal_center: Center calibration value. Only meaningful with axis 
1563   and pressure types.
1565 • cal_right: Maximum calibration value. Only meaningful with axis 
1566   and pressure types.
1568 • cal_tolerance: Dead zone tolerance. Only meaningful with axis 
1569   and pressure types.
1571 8.4.14 input.keyhook(string key, boolean state)
1573 Requests that keyhook events to be sent for key (state=true) or 
1574 not sent (state=false).
1576 8.4.15 input.joyget(number controller)
1578 Returns table for current controls for specified controller. The 
1579 names of fields vary by controller type.
1581 • The buttons have the same name as those are referred to in 
1582   other contexts in the emulator
1584 • The analog axes are “xaxis” and “yaxis”.
1586 8.4.16 input.joyset(number controller, table controls)
1588 Set the the state of specified controller to values specified in 
1589 specified table.
1591 • nil does not change value
1593 • true/false (buttons) and integers (axes) force value.
1595 • string (button) inverts the input.
1597 8.4.17 input.lcid_to_pcid(number controller)
1599 Return the physical index, physical port and controller number in 
1600 port for specified (1-based) logical controller.
1602 8.5 Table subtitle
1604 Subtitle handling
1606 8.5.1 subtitle.byindex(number i)
1608 Read the frame and length of ith subtitle. Returns nothing if not 
1609 present.
1611 8.5.2 subtitle.set(number f, number l, string txt)
1613 Set the text of subtitle.
1615 8.5.3 subtitle.get(number f, number l)
1617 Get the text of subtitle.
1619 8.5.4 subtitle.delete(number f, number l)
1621 Delete specified subtitle.
1623 8.6 Table hostmemory
1625 Host memory handling (extra memory saved to savestates). Host 
1626 memory starts empty.
1628 8.6.1 hostmemory.read(number address)
1630 Reads hostmemory slot address. Slot numbers out of range return 
1631 false instead of numeric.
1633 8.6.2 hostmemory.write(number address, number value)
1635 Writes hostmemory slot with 0-255. Slot numbers out of range 
1636 cause extension of host memory slot space.
1638 8.6.3 hostmemory.readbyte(number address)
1640 Read unsigned byte (1 element) from given address. Slots out of 
1641 range return false.
1643 8.6.4 hostmemory.writebyte(number address, number value)
1645 Write unsigned byte (1 element) to given slot. Slot numbers out 
1646 of range cause extension.
1648 8.6.5 hostmemory.readsbyte(number address)
1650 Read signed byte (1 element) from given address. Slots out of 
1651 range return false.
1653 8.6.6 hostmemory.writesbyte(number address, number value)
1655 Write signed byte (1 element) to given slot. Slot numbers out of 
1656 range cause extension.
1658 8.6.7 hostmemory.readword(number address)
1660 Read unsigned word (2 elements) from given address. Slots out of 
1661 range return false.
1663 8.6.8 hostmemory.writeword(number address, number value)
1665 Write unsigned word (2 elements) to given slot. Slot numbers out 
1666 of range cause extension.
1668 8.6.9 hostmemory.readsword(number address)
1670 Read signed word (2 elements) from given address. Slots out of 
1671 range return false.
1673 8.6.10 hostmemory.writesword(number address, number value)
1675 Write signed word (2 elements) to given slot. Slot numbers out of 
1676 range cause extension.
1678 8.6.11 hostmemory.readdword(number address)
1680 Read unsigned doubleword (4 elements) from given address. Slots 
1681 out of range return false.
1683 8.6.12 hostmemory.writedword(number address, number value)
1685 Write unsigned doubleword (4 elements) to given slot. Slot 
1686 numbers out of range cause extension.
1688 8.6.13 hostmemory.readsdword(number address)
1690 Read signed doubleword (4 elements) from given address. Slots out 
1691 of range return false.
1693 8.6.14 hostmemory.writesdword(number address, number value)
1695 Write signed doubleword (4 elements) to given slot. Slot numbers 
1696 out of range cause extension.
1698 8.6.15 hostmemory.readqword(number address)
1700 Read unsigned quadword (8 elements) from given address. Slots out 
1701 of range return false.
1703 8.6.16 hostmemory.writeqword(number address, number value)
1705 Write unsigned quadword (4 elements) to given slot. Slot numbers 
1706 out of range cause extension.
1708 8.6.17 hostmemory.readsqword(number address)
1710 Read signed quadword (8 elements) from given address. Slots out 
1711 of range return false.
1713 8.6.18 hostmemory.writesqword(number address, number value)
1715 Write signed quadword (8 elements) to given slot. Slot numbers 
1716 out of range cause extension.
1718 8.7 Table movie
1720 Movie handling
1722 8.7.1 movie.currentframe()
1724 Return number of current frame.
1726 8.7.2 movie.framecount()
1728 Return number of frames in movie.
1730 8.7.3 movie.readonly()
1732 Return true if in readonly mode, false if in readwrite.
1734 8.7.4 movie.rerecords()
1736 Returns the current value of rerecord count.
1738 8.7.5 movie.set_readwrite()
1740 Set readwrite mode (does not cause on_readwrite callback).
1742 8.7.6 movie.frame_subframes(number frame)
1744 Count number of subframes in specified frame (frame numbers are 
1745 1-based) and return that.
1747 8.7.7 movie.read_subframes(number frame, number subframe)
1749 Read specifed subframe in specified frame and return data as 
1750 array (100 elements, numbered 0-99 currently).
1752 8.7.8 movie.read_rtc()
1754 Returns the current value of the RTC as a pair (second, 
1755 subsecond).
1757 8.7.9 movie.unsafe_rewind([UNSAFEREWIND state])
1759 Start setting point for unsafe rewind or jump to point of unsafe 
1760 rewind.
1762 • If called without argument, causes emulator to start process of 
1763   setting unsafe rewind point. When this has finished, callback 
1764   on_set_rewind occurs, passing the rewind state to lua script.
1766 • If called with argument, causes emulator rewind to passed 
1767   rewind point as soon as possible. Readwrite mode is implicitly 
1768   activated.
1770 The following warnings apply to unsafe rewinding:
1772 • There are no safety checks against misuse (that's what “unsafe” 
1773   comes from)!
1775 • Only call rewind from timeline rewind point was set from.
1777 • Only call rewind from after the rewind point was set.
1779 8.8 Table settings
1781 Routines for settings manipulation
1783 8.8.1 settings.get(string name)
1785 Get value of setting. If setting is blank, returns false. If 
1786 setting value can't be obtained, returns (nil, error message).
1788 8.8.2 settings.set(string name, string value)
1790 Set value of setting. If setting can't be set, returns (nil, 
1791 error message).
1793 8.8.3 settings.is_set(string name)
1795 Returns if setting is set. If setting does not exist, returns 
1796 (nil, error message).
1798 8.8.4 settings.blank(string name)
1800 Blanks a setting and returns true. If setting can't be blanked, 
1801 returns (nil, error message).
1803 8.9 Table memory
1805 Contains various functions for managing memory
1807 8.9.1 memory.vma_count()
1809 Returns the number of VMAs
1811 8.9.2 memory.read_vma(number index)
1813 Reads the specified VMA (indices start from zero). Trying to read 
1814 invalid VMA gives nil. The read VMA is table with the following 
1815 fields:
1817 • region_name (string): The readable name of the VMA
1819 • baseaddr (number): Base address of the VMA
1821 • lastaddr (number): Last address in the VMA.
1823 • size (number): The size of VMA in bytes.
1825 • readonly (boolean): True of the VMA corresponds to ROM.
1827 • iospace (boolean): True if the VMA is I/O space.
1829 • native_endian (boolean): True if the VMA has native endian as 
1830   opposed to little endian.
1832 8.9.3 memory.find_vma(number address)
1834 Finds the VMA containing specified address. Returns table in the 
1835 same format as read_vma or nil if not found.
1837 8.9.4 memory.readbyte(number address)
1839 Reads the specified address as unsigned byte and returns the 
1840 result.
1842 8.9.5 memory.readsbyte(number address)
1844 Reads the specified address as signed byte and returns the 
1845 result.
1847 8.9.6 memory.writebyte(number address, number value)
1849 Writes the specified value (negative values undergo 2's 
1850 complement) to specified address (as a byte).
1852 8.9.7 memory.readword(number address)
1854 Reads the specified address as unsigned word and returns the 
1855 result.
1857 8.9.8 memory.readsword(number address)
1859 Reads the specified address as signed word and returns the 
1860 result.
1862 8.9.9 memory.writeword(number address, number value)
1864 Writes the specified value (negative values undergo 2's 
1865 complement) to specified address (as a word).
1867 8.9.10 memory.readdword(number address)
1869 Reads the specified address as unsigned doubleword and returns 
1870 the result.
1872 8.9.11 memory.readsdword(number address)
1874 Reads the specified address as signed doubleword and returns the 
1875 result.
1877 8.9.12 memory.writedword(number address, number value)
1879 Writes the specified value (negative values undergo 2's 
1880 complement) to specified address (as a doubleword).
1882 8.9.13 memory.readqword(number address)
1884 Reads the specified address as unsigned quadword and returns the 
1885 result.
1887 8.9.14 memory.readsqword(number address)
1889 Reads the specified address as signed quadword and returns the 
1890 result.
1892 8.9.15 memory.writeqword(number address, number value)
1894 Writes the specified value (negative values undergo 2's 
1895 complement) to specified address (as a quadword).
1897 8.9.16 memory.hash_region(number base, number size)
1899 Hash specified number of bytes starting from specified address 
1900 and return the SHA-256.
1902 8.9.17 memory.hash_state()
1904 Hash the current system state. Mainly useful for debugging 
1905 savestates.
1907 8.9.18 memory.readregion(number base, number size)
1909 Read a region of memory.
1911 • Warning: If the region crosses VMA boundary, the results are 
1912   undefined.
1914 8.9.19 memory.map<type>([number base, number size])
1916 Returns a table mapping specified memory aperture for read/write. 
1917 If parameters are omitted, entiere map space is the aperture.
1919 • Type may be one of: byte, sbyte, word, sword, dword, sdword, 
1920   qword or sqword.
1922 8.9.20 memory.writeregion(number base, number size, table data)
1924 Write a region of memory.
1926 • Warning: If the region crosses VMA boundary, the results are 
1927   undefined.
1929 8.9.21 memory.map_structure()
1931 Returns a new mapping structure (MMAP_STRUCT)
1933 8.9.22 MMAP_STRUCT(string key, number address, string type)
1935 Bind key in mmap structure to specified address with specified 
1936 type.
1938 • Type may be one of: byte, sbyte, word, sword, dword, sdword, 
1939   qword or sqword.
1941 8.9.23 memory.read_expr(string expr)
1943 Evaluate specified watch expression and return result
1945 8.10 Table subtitle
1947 Contains functions for manipulating subtitles.
1949 8.10.1 subtitle.byindex(number index)
1951 Get (basetime, length) pair of specified subtitle index or 
1952 nothing if index isn't valid.
1954 8.10.2 subtitle.get(number basetime, number length)
1956 Read the specified subtitle. Returns “” if the subtitle does not 
1957 exist.
1959 8.10.3 subtitle.set(number basetime, number length, string 
1960   content)
1962 Set the specified subtitle.
1964 8.10.4 subtitle.deltete(number basetime, number length)
1966 Delete the specified subtitle.
1968 8.11 Table _SYSTEM
1970 Contains copy of global variables from time of Lua 
1971 initialization. Non-writeable.
1973 8.12 Callbacks
1975 Various callbacks to Lua that can occur.
1977 8.12.1 Callback: on_paint(bool not_synth)
1979 Called when screen is being painted. Any gui.* calls requiring 
1980 graphic context draw on the screen.
1982 not_synth is true if this hook is being called in response to 
1983 received frame, false otherwise.
1985 8.12.2 Callback: on_video()
1987 Called when video dump frame is being painted. Any gui.* calls 
1988 requiring graphic context draw on the video.
1990 8.12.3 Callback: on_frame_emulated()
1992 Called when emulating frame has completed and 
1993 on_paint()/on_video() calls are about to be issued.
1995 8.12.4 Callback: on_frame()
1997 Called on each starting whole frame.
1999 8.12.5 Callback: on_startup()
2001 Called when the emulator is starting (lsnes.rc and --run files 
2002 has been run).
2004 8.12.6 Callback: on_rewind()
2006 Called when rewind movie to beginning has completed.
2008 8.12.7 Callback: on_pre_load(string name)
2010 Called just before savestate/movie load occurs (note: loads are 
2011 always delayed, so this occurs even when load was initiated by 
2012 lua).
2014 8.12.8 Callback: on_err_load(string name)
2016 Called if loadstate goes wrong.
2018 8.12.9 Callback: on_post_load(string name, boolean was_savestate)
2020 Called on successful loadstate. was_savestate gives if this was a 
2021 savestate or a movie.
2023 8.12.10 Callback: on_pre_save(string name, boolean is_savestate)
2025 Called just before savestate save occurs (note: movie saves are 
2026 synchronous and won't trigger these callbacks if called from 
2027 Lua).
2029 8.12.11 Callback: on_err_save(string name)
2031 Called if savestate goes wrong.
2033 8.12.12 Callback: on_post_save(string name, boolean is_savestate)
2035 Called on successful savaestate. is_savestate gives if this was a 
2036 savestate or a movie.
2038 8.12.13 Callback: on_quit()
2040 Called when emulator is shutting down.
2042 8.12.14 Callback: on_input(boolean subframe)
2044 Called when emulator is just sending input to bsnes core. 
2045 Warning: This is called even in readonly mode, but the results 
2046 are ignored.
2048 8.12.15 Callback: on_reset()
2050 Called when SNES is reset.
2052 8.12.16 Callback: on_readwrite()
2054 Called when moving into readwrite mode as result of “set-rwmode” 
2055 command (note: moving to rwmode by Lua won't trigger this, as per 
2056 recursive entry protection).
2058 8.12.17 Callback: on_snoop(number port, number controller, number 
2059   index, number value)
2061 Called each time bsnes asks for input. The value is the final 
2062 value to be sent to bsnes core (readonly mode, autohold and 
2063 autofire have been taken into account). Might be useful when 
2064 translating movies to format suitable for console verification. 
2065 Note: There is no way to modify the value to be sent.
2067 • Not called if callback on_snoop2 is defined.
2069 8.12.18 Callback: on_snoop2(number port, number controller, 
2070   number index, number value)
2072 Like on_snoop, but reserves port 0 for system, having first user 
2073 port be port 1.
2075 8.12.19 Callback: on_keyhook(string keyname, table state)
2077 Sent when key that has keyhook events requested changes state. 
2078 Keyname is name of the key (group) and state is the state (same 
2079 kind as table values in input.raw).
2081 8.12.20 Callback: on_idle()
2083 Called when requested by set_idle_timeout(), the timeout has 
2084 expired and emulator is waiting.
2086 8.12.21 Callback: on_timer()
2088 Called when requested by set_idle_timeout() and the timeout has 
2089 expired (regardless if emulator is waiting).
2091 8.12.22 Callback: on_set_rewind(UNSAFEREWIND r)
2093 Called when unsafe rewind object has been constructed.
2095 8.12.23 Callback: on_pre_rewind() 
2097 Called just before unsafe rewind is about to occur.
2099 8.12.24 Callback: on_post_rewind() 
2101 Called just after unsafe rewind has occured.
2103 8.12.25 Callback: on_button(number port, number controller, 
2104   number index, string type)
2106 Called on controller button press, with following parameters:
2108 • port: Port number (0 is system)
2110 • controller: Controller within port
2112 • index: Index of button.
2114 • type: Type of event, one of:
2116   – “pressed”: Button was pressed.
2118   – “released”: Button was released.
2120   – “hold”: Held.
2122   – “unhold”: Released from hold.
2124   – “type”: Typing input on button.
2126   – “untype”: Typing input undone.
2128   – “analog”: Analog action on axis.
2130 9 Movie editor
2132 • The editor edits in-memory movie.
2134 • Because past can't be edited and readwrite mode doesn't allow 
2135   future, editing only works in read only mode.
2137 • Keyboard triggers the normal hotkeys and bindings.
2139 9.1 Left button actions
2141 • Clicking on cell in future (indicated by lack of redish 
2142   background) toggles it (if it is a button) or prompts for a 
2143   value (if it is an axis)
2145 • Dragging vertically toggles sequence of buttons or changes a 
2146   sequence of axis values.
2148 9.2 Right button actions
2150 The right mouse button pops up a context-sensitive menu:
2152 • Toggle <something>: Toggle this button
2154 • Change <something>: Change this axis value
2156 • Insert frame after: Insert a frame after this frame
2158 • Append frame: Append a frame to movie
2160 • Append frames: Append specified number of frames to movie
2162 • Delete frame: Delete this frame
2164 • Delete subframe: Delete this subframe
2166 • Truncate movie: Delete this subframe and everything after it.
2168 • Scroll to frame: Prompt for a frame and scroll the display to 
2169   that frame.
2171 • Scroll to current frame: Scroll the display to current position
2173 • Run to frame: Prompts for frame and runs the emulation to that 
2174   frame.
2176 • Change number of lines visible: Change the height of the movie 
2177   display (1 to 255).
2179 • Lock scroll to playback: While playing back or rewinding 
2180   movies, the display will follow if enabled.
2182 10 Memory watch expression syntax
2184 Memory watch expressions are in RPN (Reverse Polish Notation). At 
2185 the end of expression, the top entry on stack is taken as the 
2186 final result.
2188 Notations:
2190 • Evaluation order is strictly left to right.
2192 • a is the entry on top of stack
2194 • b is the entry immediately below top of stack
2196 • ; separates values to be pushed (no intermediate pop).
2198 • After end of element, all used stack slots are popped and all 
2199   results are pushed.
2201 • When pushing multiple values, the pushes occur in order shown.
2203 The following operators are available:
2205 • + : a + b
2207 • - : a - b
2209 • * : a * b
2211 • / : a / b
2213 • % : a % b
2215 • a : atan(a)
2217 • b : read_signed_byte(a)
2219 • c : cos(a)
2221 • d : read_signed_dword(a)
2223 • i : quotent(a / b)
2225 • p :\pi
2228 • q : read_signed_qword(a)
2230 • r : sqrt(a)
2232 • s : sin(a)
2234 • t : tan(a)
2236 • u : a; a
2238 • w : read_signed_word(a)
2240 • A : atan2(a, b)
2242 • B : read_unsigned_byte(a)
2244 • C<number>z : Push number <number> to stack.
2246 • D : read_unsigned_dword(a)
2248 • C0x<number>z : Push number <number> (hexadecimal) to stack.
2250 • H<digit> : Set hexadecimal mode with specified number of digits 
2251   (use A-G for 10-16 digits).
2253 • Q : read_unsigned_qword(a)
2255 • R<digit> : round a to <digit> digits.
2257 • W : read_unsigned_word(a)
2259 10.1 Example:
2261 C0x007e0878zWC0x007e002czW-
2263 1. Push value 0x7e0878 on top of stack (C0x007e0878z).
2265 2. Pop the value on top of stack (0x7e0878), read word value at 
2266   that address and push the result,call it x1 (W).
2268 3. Push value 0x7e002c on top of stack (C0x007e002cz).
2270 4. Pop the value on top of stack (0x7e002c), read word value at 
2271   that address and push the result,call it x2 (W).
2273 5. Pop the two top numbers on stack, x1 and x2, substract x1 from 
2274   x2 and push x2 - x1 (-).
2276 6. Since the expression ends, the final memory watch result is 
2277   the top one on stack, which is x2 - x1.
2279 11 Modifier and key names:
2281 11.1 SDL Platform
2283 11.1.1 Modifier names
2285 Following modifier names are known:
2287 • ctrl, lctrl, rctrl: Control keys
2289 • alt, lalt, ralt: ALT keys.
2291 • shift, lshift, rshift: Shift keys.
2293 • meta, lmeta, rmeta: Meta keys.
2295 • num, caps: Numlock/Capslock (these are sticky!)
2297 • mode: Mode select.
2299 11.1.2 Key names
2301 Following key names are known:
2303 • backspace, tab, clear, return, pause, escape, space, exclaim, 
2304   quotedbl, hash, dollar, ampersand, quote, leftparen, 
2305   rightparen, asterisk, plus, comma, minus, period, slash, 0, 1, 
2306   2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals, 
2307   greater, question, at, leftbracket, backslash, rightbracket, 
2308   caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, 
2309   l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, 
2310   world_1, world_2, world_3, world_4, world_5, world_6, world_7, 
2311   world_8, world_9, world_10, world_11, world_12, world_13, 
2312   world_14, world_15, world_16, world_17, world_18, world_19, 
2313   world_20, world_21, world_22, world_23, world_24, world_25, 
2314   world_26, world_27, world_28, world_29, world_30, world_31, 
2315   world_32, world_33, world_34, world_35, world_36, world_37, 
2316   world_38, world_39, world_40, world_41, world_42, world_43, 
2317   world_44, world_45, world_46, world_47, world_48, world_49, 
2318   world_50, world_51, world_52, world_53, world_54, world_55, 
2319   world_56, world_57, world_58, world_59, world_60, world_61, 
2320   world_62, world_63, world_64, world_65, world_66, world_67, 
2321   world_68, world_69, world_70, world_71, world_72, world_73, 
2322   world_74, world_75, world_76, world_77, world_78, world_79, 
2323   world_80, world_81, world_82, world_83, world_84, world_85, 
2324   world_86, world_87, world_88, world_89, world_90, world_91, 
2325   world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, 
2326   kp4, kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, 
2327   kp_multiply, kp_minus, kp_plus, kp_enter, kp_equals, up, down, 
2328   right, left, insert, home, end, pageup, pagedown, f1, f2, f3, 
2329   f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, numlock, 
2330   capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt, lalt, 
2331   rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, 
2332   sysreq, break, menu, power, euro, undo
2334 • Names of form 'key<n>' where <n> is 0-255 are interpretted as 
2335   key having hardware-dependent scan code of <n> (useful to bind 
2336   those keys that don't have symbolic names).
2338 11.1.3 Joystick pseudo-keys:
2340 • joystick<num>button<button>: Joystick <num> (0-based) button 
2341   <button> (0-based).
2343 • joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> 
2344   (0-based) up.
2346 • joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> 
2347   (0-based) left.
2349 • joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> 
2350   (0-based) down.
2352 • joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> 
2353   (0-based) right.
2355 • joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> 
2356   negative position (axis modes axis and axis_inverse).
2358 • joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> 
2359   positive position (axis modes axis and axis_inverse).
2361 • joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> 
2362   pressure (axis modes pressure_*).
2364 11.1.4 Special buttons:
2366 • Escape: Enter/Exit Command mode, cancel modal dialogs.
2368 • Return (also KPEnter): Execute command, ok modal dialog.
2370 • Pgup/Up (also KP8/9 if no num lock, CTRL+P; command mode): 
2371   Previous command in command history
2373 • Pgdn/Down(also KP2/3 if no num lock, CTRL+N; command mode): 
2374   Next command in command history
2376 • Home (also KP7 if no num lock, CTRL+A; command mode): Beginning 
2377   of command.
2379 • End (also KP1 if no num lock, CTRL+E; command mode): End of 
2380   command.
2382 • Left (also KP4 if no num lock, CTRL+B; command mode): Move 
2383   cursor left.
2385 • Right (also KP6 if no num lock, CTRL+F; command mode): Move 
2386   cursor right.
2388 • Delete (also KP. if no num lock; command mode): Delete 
2389   character to right of cursor.
2391 • Insert (also KP0 if no num lock; command mode): Toggle between 
2392   insert / overwrite modes.
2394 • Backspace (command mode): Delete character to left of cursor.
2396 • CTRL+LEFT (also ALT+B; command mode): Previous word.
2398 • CTRL+RIGHT (also ALT+F; command mode): Next word.
2400 • ALT+D (also CTRL+W; command mode): Delete word.
2402 • LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump 
2403   corrupted!).
2405 11.2 wxWidgets platform
2407 11.2.1 Modifier names:
2409 Following modifier names are known:
2411 • alt
2413 • ctrl
2415 • shift 
2417 • meta
2419 • cmd (Mac OS X only)
2421 11.2.2 Key names:
2423 Following key names are known:
2425 • back, tab, return, escape, space, exclaim, quotedbl, hash, 
2426   dollar, percent, ampersand, quote, leftparen, rightparen, 
2427   asterisk, plus, comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 
2428   6, 7, 8, 9, colon, semicolon, less, equals, greater, question, 
2429   at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, 
2430   u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret, 
2431   underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, 
2432   n, o, p, q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, 
2433   rightcurly, tilde, delete, start, lbutton, rbutton, cancel, 
2434   mbutton, clear, shift, alt, control, menu, pause, capital, end, 
2435   home, lefT, up, right, down, select, print, execute, snapshot, 
2436   insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, 
2437   numpad5, numpad6, numpad7, numpad8, numpad9, multiply, add, 
2438   separator, subtract, decimal, divide, f1, f2, f3, f4, f5, f6, 
2439   f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, 
2440   f20, f21, f22, f23, f24, numlock, scroll, pageup, pagedown, 
2441   numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2, 
2442   numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, 
2443   numpad_right, numpad_down, numpad_pageup, numpad_pagedown, 
2444   numpad_end, numpad_begin, numpad_insert, numpad_delete, 
2445   numpad_equal, numpad_multiply, numpad_add, numpad_separator, 
2446   numpad_subtract, numpad_decimal, numpad_divide, windows_left, 
2447   windows_right, windows_menu, command, special1, special2, 
2448   special3, special4, special5, special6, special7, special8, 
2449   special9, special10, special11, special12, special13, 
2450   special14, special15, special16, special17, special18, 
2451   special19, special20
2453 12 Movie file format
2455 Movie file is .zip archive in itself, normal ZIP archive tools 
2456 work on it (note: If you recompress it, do not use compression 
2457 methods other than store and deflate and especially do not use 
2458 encryption of any kind).
2460 12.1 Detecting clean start/SRAM/Savestate
2462 • If file has member “savestate” it is savestate, otherwise:
2464 • If file has members with names starting “moviesram.” it is 
2465   movie starting from SRAM, otherwise:
2467 • It is movie starting from clear state.
2469 12.2 Member: gametype
2471 Type of game ROM and region (as one line). Valid values are:
2474 +--------------+---------------------+--------+
2475 |    Value     |       System        | Region |
2476 +--------------+---------------------+--------+
2477 +--------------+---------------------+--------+
2478 |  snes_pal    |     Super NES       |  PAL   |
2479 +--------------+---------------------+--------+
2480 |   sgb_pal    |   Super Game Boy    |  PAL   |
2481 +--------------+---------------------+--------+
2482 |  snes_ntsc   |     Super NES       |  NTSC  |
2483 +--------------+---------------------+--------+
2484 |  sgb_ntsc    |   Super Game Boy    |  NTSC  |
2485 +--------------+---------------------+--------+
2486 |     bsx      | BS-X (non-slotted)  |  NTSC  |
2487 +--------------+---------------------+--------+
2488 | bsxslotted   |   BS-X (slotted)    |  NTSC  |
2489 +--------------+---------------------+--------+
2490 | sufamiturbo  |    Sufami Turbo     |  NTSC  |
2491 +--------------+---------------------+--------+
2494 Frame rates are:
2497 +---------+-----------------+
2498 | Region  | Framerate (fps) |
2499 +---------+-----------------+
2500 +---------+-----------------+
2501 |  PAL    |   322445/6448   |
2502 +---------+-----------------+
2503 |  NTSC   | 10738636/178683 |
2504 +---------+-----------------+
2507 12.3 Member: port1
2509 Contains type of port #1 (as one line). Valid values are 'none', 
2510 'gamepad', 'multitap' and 'mouse'. If not present, defaults to 
2511 'gamepad'.
2513 12.4 Member: port2
2515 Contains type of port #2 (as one line). Valid values are 'none', 
2516 'gamepad', 'multitap', 'mouse', 'superscope', 'justifier' and 
2517 'justifiers'. If not present, defaults to 'none'.
2519 12.5 Member: gamename
2521 Contains name of the game (as one line).
2523 12.6 Member: authors
2525 Contains authors, one per line. Part before '|' is the full name, 
2526 part after is the nickname.
2528 12.7 Member: systemid
2530 Always “lsnes-rr1” (one line). Used to reject other saves.
2532 12.8 Member: controlsversion
2534 Always “0” (one line). Used to identify what controls are there.
2536 12.9 Member: “coreversion”
2538 Contains bsnes core version number (as one line).
2540 12.10 Member: projectid
2542 Contains project ID (as one line). Used to identify if two movies 
2543 are part of the same project.
2545 12.11 Member: {rom,slota,slotb}{,xml}.sha256
2547 Contains SHA-256 of said ROM or ROM mapping file (as one line). 
2548 Absent if corresponding file is absent.
2550 12.12 Member: moviesram.<name>
2552 Raw binary startup SRAM of kind <name>. Only present in 
2553 savestates and movies starting from SRAM.
2555 12.13 Member: saveframe
2557 Contains frame number (as one line) of frame movie was saved on. 
2558 Only present in savestates.
2560 12.14 Member: lagcounter
2562 Current value of lag counter (as one line). Only present in 
2563 savestates.
2565 12.15 Member: pollcounters
2567 Contains poll counters (currently 100 of them), one per line. 
2568 Each line is raw poll count if DRDY is set for it. Otherwise it 
2569 is negative poll count minus one. Only present in savestates.
2571 12.16 Member: hostmemory
2573 Raw binary dump of host memory. Only present in savestates.
2575 12.17 Member: savestate
2577 The raw binary savestate itself. Savestate detection uses this 
2578 file, only present in savestates.
2580 12.18 Member: screenshot
2582 Screenshot of current frame. Only present in savestates. First 2 
2583 bytes are big-endian width of image, rest are 24-bit RGB image 
2584 data. Height of image is inferred from the width and size of 
2585 data.
2587 12.19 Member: sram.<name>
2589 Raw binary SRAM of kind <name> at time of savestate. Only present 
2590 in savestates.
2592 12.20 Member: input
2594 The actual input track, one line per subframe (blank lines are 
2595 skipped).
2597 • If the first byte of each line is '.', ' ', <tab> or '|', then 
2598   the line is part of same frame as previous, otherwise it starts 
2599   a new frame.
2601 • First subframe must start a new frame.
2603 Length of movie in frames is number of lines in input file that 
2604 start a new frame.
2606 12.21 Member: subtitles
2608 Subtitle track. Optional.
2610 • Each line is in form <firstframe> <numframes> <text>.
2612 • Linefeed is encoded as \n, backslash is encoded as \\.
2614 12.22 Member: rerecords
2616 Contains textual base-10 rerecord count (as one line; emulator 
2617 just writes this, it doesn't read it) + 1.
2619 12.23 Member: rrdata
2621 This member stores set of load IDs. There is one load ID per 
2622 rerecord (plus one corresponding to start of project).
2624 • This member constists of concatenation of records
2626 • Each record is 2-36 bytes long and can represent 1-16,843,009 
2627   consequtive IDs.
2629 • IDs are interpretted as 256-bit big-endian integers with 
2630   warparound.
2632 • Initial predicted ID is all zeroes.
2634 Format of each record is:
2636 • 1 byte: Opcode byte. Bits 0-4 are prefix length (prefixlen), 
2637   bits 5-6 are count length (countlen). Bit 7 is unused.
2639 • 32-prefixlen bytes of ID.
2641 • countlen bytes of big-endian count (count).
2643 Records are processed as follows:
2645 • To form the first ID encoded by record, take the first 
2646   prefixlen bytes predicted ID and append the read ID value to 
2647   it. The result is the first ID encoded.
2649 • If countlen is 0, record encodes 1 ID.
2651 • If countlen is 1, record encodes 2+count IDs.
2653 • If countlen is 2, record encodes 258+count IDs.
2655 • If countlen is 3, record encodes 65794+count IDs.
2657 • The new predicted ID is the next ID after last one encoded by 
2658   the record.
2660 The number of rerecords + 1 is equal to the sum of number of IDs 
2661 encoded by all records.
2663 12.24 Member: starttime.second
2665 Movie starting time, second part. Epoch is Unix epoch. Default is 
2666 1,000,000,000.
2668 12.25 Member: starttime.subsecond
2670 Movie starting time, subsecond part. Unit is CPU clocks. Default 
2671 is 0.
2673 12.26 Member: savetime.second
2675 Movie saving time, second part. Default is starttime.second. Only 
2676 present in savestates.
2678 12.27 Member: savetime.subsecond
2680 Movie saving time, subsecond part. Default is 
2681 starttime.subsecond. Only present in savestates.
2683 13 lsvs file format (commentary tracks)
2685 13.1 Clusters
2687 • Each cluster is 8kB (8192 bytes) in size.
2689 • Cluster n starts at offset 8192*n in file.
2691 • The following clusters are system special:
2693   – Cluster 0 and all clusters with number multiple of 2048 
2694     (cluster tables)
2696   – Cluster 1 (superblock)
2698 13.2 Cluster tables
2700 • The cluster table describing cluster n is stored in cluster n & 
2701   ~0x7FF (zero last 11 bits of n).
2703 • This cluster table consists of 2048 4-byte big-endian integers.
2705 • Each entry describes a cluster in 16MB supercluster, in order.
2707 • The valid values for entries are:
2709   – 0x00000000: Free cluster
2711   – 0x00000001: Last cluster in chain.
2713   – 0xFFFFFFFF: System cluster (cluster tables and superblock)
2715   – (anything else): Number of next cluster in chain. Must not be 
2716     multiple of 2048.
2718 • Due to limitations of the format, there can be at most 2097052 
2719   superclusters, giving maximum file size of 16TB.
2721 13.3 Stream table
2723 • The stream table chain always starts in cluster 2.
2725 • Otherwise, it follows normal chaining.
2727 • The stream table consists of 16-byte entries:
2729   – The first 8 bytes of entry give big-endian beginning position 
2730     of stream in units of 1/48000 s.
2732   – The next 4 bytes of entry give big-endian beginning cluster 
2733     for control data. 0 here marks the entry as not present.
2735   – The last 4 bytes of entry give big-endian beginning cluster 
2736     for codec data.
2738 • Stream table clusters are normal clusters, following normal 
2739   chaining.
2741 • The stream begnning position is not guarenteed unique. There 
2742   can be multiple streams with the same starting position in the 
2743   file.
2745 13.4 Stream control data
2747 • The stream control data consists of entries 4 bytes each:
2749   – The first 2 bytes of entry gives big-endian length of packet
2751   – The next byte of entry gives audio length of packet in units 
2752     of 1/400 s.
2754   – The last byte is control byte.
2756     ∗ 0 means this entry is not present and the control data 
2757       ends.
2759     ∗ 1 is valid control entry.
2761 • The stream control data can also end by running into end of the 
2762   readable chain.
2764   – This happens if there happens to be exact multiple of 2048 
2765     packets in stream and number of packets is nonzero.
2767 • These clusters follow normal chaining.
2769 13.5 Stream codec data
2771 • Stream codec data consists of raw Opus data packets packed back 
2772   to back with nothing in between.
2774 • Warning: Due to internal limitations, this data must reside in 
2775   the first 65536 superclusters (that is, the first 1TB of the 
2776   file).
2778 13.6 Superblock
2780 • The superblock is stored in cluster 1. 
2782 • The first 11 bytes are “sefs-magic”<NUL>.
2784 • The rest are unused.
2786 • This cluster 1 is marked as system special.
2788 14 Known ROM extensions
2790 • SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, 
2791   dx2, mgd, mgh.
2793 • DMG cartridge ROMs: dmg, gb.
2795 • GBC cartridge ROMs: cgb, gbc.
2797 15 Gamepack files
2799 • The first line must be: “[GAMEPACK FILE]”.
2801 • There is one needed line: “type <systype>”. This sets system 
2802   type to <systype>. The following system types are valid:
2804   – snes (SNES)
2806   – bsx (BS-X non-slotted)
2808   – bsxslotted (BS-X slotted)
2810   – sufamiturbo (Sufami Turbo)
2812   – sgb (Super Game Boy)
2814   – dmg (Game Boy)
2816   – gbc (Game Boy Color)
2818   – gbc_gba (Game Boy Color with GBA initial register values)
2820 • Optionally a region can be specified: “region <region>”. The 
2821   following values are valid:
2823   – autodetect (Autodetect region: snes and sgb only)
2825   – ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2827   – pal (PAL: snes, sgb)
2829   – world (World: dmg, gbc, gbc_gba)
2831 • ROM images are loaded as: “rom <type> <file>”. The following 
2832   types are valid:
2834   – rom (Cartridge ROM in snes, dmg, gbc, gbc_gba. BIOS in bsx, 
2835     bsxslotted, sufamiturbo)
2837   – bsx (Cartridge ROM in bsx, bsxslotted)
2839   – slot-a (Cartridge ROM in sufamiturbo)
2841   – slot-b (Cartridge ROM in sufamiturbo)
2843 • ROM markup can be loaded as: “xml <type> <file>”. The types 
2844   valid are the same as for ROMs.
2846 • Patches can be loaded as “patch[<offset>] <type> <file>”. The 
2847   types are the same as for ROMs.
2849   – Offset is given in form [+-]<number>. Usually offset is 
2850     either +0 or -512.
2852   – Default offset is +0.
2854 15.1 Example:
2856 [GAMEPACK FILE]
2858 type snes
2860 rom rom speedygonzales.sfc
2862 patch-512 rom sonicthehedgehog.ips
2864 15.2 Example 2:
2866 [GAMEPACK FILE]
2868 type sgb
2870 rom rom supergameboy.sfc
2872 rom dmg megamanV.dmg
2874 16 Quick'n'dirty encode guide
2876 1. Start the emulator and load the ROM and movie file.
2878 2. Set large AVI option 'set-setting avi-large on'
2880 3. Enable dumping 'dump-avi tmpdump' 
2882 4. Unpause and let it run until you want to end dumping.
2884 5. Close the emulator (closing the window is the easiest way). Or 
2885   use 'end-avi'.
2887 6. For each tmpdump*.avi file created, on command prompt, do 
2888   'x264 --crf 10 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2890 7. Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2892 8. Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + 
2893   tmpdump_0000001.mkv + tmpdump_0000002.mkv' (list every 
2894   tmpdump_<numbers>.mkv, with + in between).
2896 9. Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'. Now 
2897   final.mkv contains quick'n'dirty encode.
2899 17 Axis configurations for some gamepad types:
2901 17.1 XBox360 controller:
2903 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be 
2904 set to pressure-+.
2906 set-axis joystick0axis2 pressure-+
2908 set-axis joystick0axis5 pressure-+
2910 • This is needed for SDL only. EVDEV sets those types correctly.
2912 17.2 PS3 “sixaxis” controller:
2914 Axes 8-19 should be disabled.
2916 set-axis joystick0axis8 disabled
2918 set-axis joystick0axis9 disabled
2920 set-axis joystick0axis10 disabled
2922 set-axis joystick0axis11 disabled
2924 set-axis joystick0axis12 disabled
2926 set-axis joystick0axis13 disabled
2928 set-axis joystick0axis14 disabled
2930 set-axis joystick0axis15 disabled
2932 set-axis joystick0axis16 disabled
2934 set-axis joystick0axis17 disabled
2936 set-axis joystick0axis18 disabled
2938 set-axis joystick0axis19 disabled
2940 18 Errata:
2942 18.1 Problems from BSNES core:
2944 • The whole pending save stuff.
2946 • Lack of layer hiding.
2948 • It is slow (especially accuracy).
2950 • Firmwares can't be loaded from ZIP archives.
2952 18.2 Other problems:
2954 • Modifiers don't work with pseudo-keys (SDL, EVDEV).
2956 • Audio for last dumped frame is not itself dumped.
2958 • Audio in UI is pretty bad in quality if game doesn't run at 
2959   full speed.
2961 • No menus, command based interface (SDL).
2963 • Long commands don't scroll.
2965 19 Changelog:
2967 19.1 rr0-beta1
2969 • Fix -Wall warnings
2971 • Fix dumper video corruption with levels 10-18.
2973 19.2 rr0-beta2
2975 • Autofire
2977 • Lots of code cleanups
2979 • Lua interface to settings
2981 • Allow specifying AVI borders without Lua
2983 • Fix scaling if vscale > 1 and originx > 0 (left border exists)
2985 • on_snoop lua callback
2987 • Faster movie loading and saving.
2989 19.3 rr0-beta3
2991 • Joystick support
2993 19.4 rr0-beta4
2995 • Fix multi-buttons
2997 • Save jukebox functionality.
2999 19.5 rr0-beta5
3001 • Try to fix some nasty failing movie load edge cases
3003 • Allow specifying scripts to run on command line.
3005 19.6 rr0-beta6
3007 • Major source code reorganization.
3009 • Backup savestates before overwriting.
3011 • Don't crash if loading initial state fails.
3013 19.7 rr0-beta7
3015 • Fix firmware lookup
3017 • Fix author name parsing
3019 • Fix rerecord counting
3021 • (SDL) Print messages to console if SDL is uninitialized
3023 • Add movieinfo program
3025 • Fix loading movies starting from SRAM.
3027 19.8 rr0-beta8
3029 • Add support for unattended dumping
3031 • Fix compiling for Win32
3033 • Don't lock up if sound can't be initialized
3035 • Strip trailing CR from commands
3037 • Don't try to do dubious things in global ctors (fix crash on 
3038   startup)
3040 19.9 rr0-beta9
3042 • Small documentation tweaking
3044 • Fix make clean
3046 • Fix major bug in modifier matching
3048 19.10 rr0-beta10
3050 • Lots of documentation fixes
3052 • Use dedicated callbacks for event backcomm., not commands.
3054 • Ensure that the watchdog is not hit when executing delayed 
3055   reset.
3057 • Remove errant tab from joystick message.
3059 19.11 rr0-beta11
3061 • Make autofire operate in absolute time, not linear time
3063 • Reinitialize controls when resuming from loadstate
3065 • Some more code cleanups
3067 • If Lua allocator fails, call OOM_panic()
3069 • Byte/word/dword/qword sized host memory write/read functions.
3071 • Dump at correct framerate if dumping interlaced NTSC 
3072   (height=448).
3074 19.12 rr0-beta12
3076 • Actually include the complete source code
3078 • Keep track of RTC
3080 19.13 rr0-beta13
3082 • Document {save,start}time.{,sub}second.
3084 • Intercept time() from bsnes core.
3086 19.14 rr0-beta14
3088 • Allow disabling time() interception (allow build on Mac OS X)
3090 • Use SDLMain on Mac OS X (make SDL not crash)
3092 • Disable delayed resets (just plain too buggy for now).
3094 • Code cleanups
3096 • Use 16-bit for graphics/video instead of 32-bit.
3098 • gui.rectangle/gui.pixel
3100 • gui.crosshair
3102 • New CSCD writer implementation.
3104 19.15 rr0-beta15
3106 • Fix interaction of * and +.
3108 • Manual improvements
3110 • Use gettimeofday()/usleep(), these seem portable enough.
3112 • Move joystick axis manipulation to keymapper code.
3114 • Changes to how read-only works.
3116 • Refactor controller input code.
3118 19.16 rr0-beta16
3120 • Fix mouseclick scale compensation.
3122 • Draw area boundaries correctly in SDL code.
3124 • gui.screenshot.
3126 • Fix CSCD output (buffer overrun and race condition).
3128 19.17 rr0-beta17
3130 • JMD dumping support.
3132 • Allow unattended dumping to JMD.
3134 • Move to BSNES v083.
3136 • Switch back to 32-bit colors.
3138 • Add Lua function gui.color.
3140 • Use some new C++11 features in GCC 4.6.
3142 • Be prepared for core frequency changes.
3144 • Pass colors in one chunk from Lua.
3146 19.18 rr0-beta18
3148 • New lua functions gui.line(), gui.status() and gui.circle(), 
3149   memory.vma_count(), memory.read_vma() and memory.find_vma().
3151 • Numerious documentation fixups
3153 • RTC time format changed
3155 • Reformat flags display
3157 • Allow lua package name to be overridden
3159 • SDUMP (high-quality dumping).
3161 • Split platform support to plugins.
3163 • Make all sound plugins support basic sound commands
3165 • Support portaudio for sound.
3167 • Allow disable Lua/SDL searching.
3169 • Upconvert colors when copying lcscreen to screen.
3171 • Reorganize source tree.
3173 • Evdev joystick support.
3175 • Refactor more code into generic window code.
3177 19.19 rr0-beta19
3179 • Refactor message handling.
3181 • Rework makefile
3183 • Documentation fixes
3185 • Finish pending saves before load/quit.
3187 • Wxwidgets graphics plugin.
3189 19.20 rr0-beta20
3191 • Get rid of win32-crap.[ch]pp.
3193 • Move files around a lot.
3195 • Get rid of need for host C++ compiler.
3197 • Bsnes v084 core.
3199 • Refactor inter-component communication.
3201 • Fix zero luma.
3203 • Fix crash on multiline aliases.
3205 • Load/Save settings in wxwidgets gui.
3207 19.21 rr0-beta21
3209 • Patch problems in bsnes core
3211 • SNES is little-endian, not big-endian!
3213 • Fix memory corruption in lcscreen::load()
3215 19.22 rr0-beta22
3217 • Fix interpretting repeat counts in rrdata loading.
3219 • New lua callback: on_frame()
3221 • Remove calls to runtosave() that aren't supposed to be there
3223 • Lua function: movie.read_rtc()
3225 • Ignore src/fonts/font.cpp
3227 • Fix more bsnes core problems
3229 • Control bsnes random seeding
3231 • Pause-on-end
3233 • Some bsnes core debugging features (state dump and state hash)
3235 • Fix titlebar version number (no, the last version wasn't 
3236   'lsnes-0-beta21', it was 'lsnes rr0-beta21').
3238 19.23 rr0-beta23
3240 • Fix memory corruption due to macro/field mixup
3242 • search-memory update
3244 • Allow direct-mapped framebuffer
3246 • SDL: Use SDL_ANYFORMAT if possible
3248 • SDMP2SOX: 2s delay modes.
3250 • Wxwidgets: Cleanups
3252 • Use sed -E, not sed -r. Fixes building on Mac OS X.
3254 • Wxwidgets: Save jukebox on exit
3256 • Fix RTC if using load-movie on savestate.
3258 • Fix crash related to full console mode.
3260 19.24 rr0-beta24
3262 • Wxwidgets: Allow bringing application to foreground on Mac OS 
3263   X.
3265 • Wxwidgets: Allow compiling on Mac OS X.
3267 • Use movie compare instead of movie hashing (faster save/load).
3269 • Lua: _SYSTEM table.
3271 19.25 rr0-beta25
3273 • sdmp2sox: Pad soundtrack if using -l or -L.
3275 • sdmp2sox: Fix NTSC overscan.
3277 • sdmp2sox: Add AR correction mode.
3279 • call lua_close() when exiting.
3281 • Fix zip_writer bug causing warnings from info-zip and error 
3282   from advzip.
3284 19.26 rr0-beta26
3286 • Fix IPS patching code (use bsnes core IPS patcher).
3288 • Implement BPS patching (using bsnes core IPS patcher).
3290 • Add feature to load headered ROMs.
3292 19.27 rr0-beta27
3294 • Show command names when showing keybindings
3296 19.28 rr0
3298 • Fix pause-on-end to be actually controllable
3300 • SDL: Poll all events in queue, not just first one (fixes 
3301   slowness in command typing)
3303 • Wxwidgets: Fix ROM loading.
3305 19.29 rr1-beta0
3307 • Lua: Add gui.textH, gui.textV, gui.textHV
3309 • Fix text colors on SDL on Mac OS X
3311 • Mode 'F' for finished in readonly mode.
3313 • Fix some WS errors.
3315 • Reliably pause after skip poll
3317 • Split UI and core into their own threads
3319 19.30 rr1-beta1
3321 • Remove leftover dummy SRAM slot
3323 • Fix controller numbers.
3325 19.31 rr1-beta2
3327 • Fix lsnes-dumpavi after interface change.
3329 • Also give BSNES patches for v085.
3331 • Pack movie data in memory.
3333 19.32 rr1-beta3
3335 • Fix framecount/length given when loading movies.
3337 • Controller command memory leak fixes.
3339 • Don't leak palette if freeing screen object.
3341 19.33 rr1-beta4
3343 • Detect revisions.
3345 • Wxwidgets: Allow controlling dumper from the menu.
3347 19.34 rr1-beta5
3349 • Rewrite parts of manual
3351 • Lua: Make it work with Lua 5.2.
3353 19.35 rr1-beta6
3355 • Win32: Fix compile errors.
3357 19.36 rr1-beta7
3359 • Refactor controller input code.
3361 • Fix crash when using command line on SDL / Mac OS X.
3363 19.37 rr1-beta8
3365 • Delete core/coroutine (obsolete)
3367 • Lag input display by one frame.
3369 • Rewind movie to beginning function.
3371 • Fix wrong frame number reported to Lua when repainting after 
3372   loadstate
3374 • Support UI editing of jukebox
3376 • Wxwidgets: Save settings on exit.
3378 • Support ${project} for filenames
3380 • SDL: Fix command history
3382 19.38 rr1-beta9
3384 • Fix some order-of-global-ctor bugs.
3386 19.39 rr1-beta10
3388 • Fix crashes when quitting on Win32.
3390 19.40 rr1-beta11
3392 • EVDEV: Queue keypresses from joystick, don't send directly
3394 • Wxwidgets: Load-Preserve that actually works.
3396 19.41 rr1-beta12
3398 • Wxwidgets: GUI for memory search.
3400 • Warn about using synchronous queue in UI callback.
3402 19.42 rr1-beta13
3404 • Remember last saved file for each ROM
3406 • Support MT dumping via boost.
3408 • Lua: input.raw
3410 • Lua: input.keyhook
3412 • Make mouse be ordinary input instead of special-casing
3414 • SDL: Don't screw up commands with NUL codepoints.
3416 19.43 rr1-beta14
3418 • Merge status panel and main window
3420 • True movie slot support (the rest of it)
3422 • SDL: Fix compilation error
3424 • Elminate cross calls in dump menu code.
3426 19.44 rr1-beta15
3428 • Cancel pending saves command
3430 • Wxwidgets: Code refactoring
3432 • Wxwidgets: Fix system -> reset
3434 • Wxwidgets: Read watch expressions in the right thread
3436 19.45 rr1-beta16
3438 • Wxwidgets: Don't prompt for member when running Lua script (Lua 
3439   doesn't support that).
3441 • Wxwidgets: 128 -> 1024 Autohold slots (in case more are 
3442   needed).
3444 • Don't append trailing '-' to prefix when saving movie.
3446 • Fix ROM/savestate handling (don't let user mismatch ROM and 
3447   savestates).
3449 19.46 rr1
3451 • Document memory watch syntax.
3453 19.47 rr1-delta1
3455 • Fix unattended dumping (lsnes-dumpavi)
3457 • Support RAW dumping
3459 • Use adv_dumper instead of the old interface in lsnes-dumpavi 
3460   (changes syntax)
3462 • Add option to control sample rate preturbation in AVI dumper
3464 19.48 rr1-delta2
3466 • Wxwidgets: Fix dumper submodes
3468 • Set core controller types before loadstate
3470 19.49 rr1-delta2epsilon1
3472 • Fix compiling with bsnes v086.
3474 19.50 rr1-delta3
3476 • Don't prompt before quitting
3478 • Start unpaused, preserve pause/unpause over load.
3480 • Try to autodetect if ROM is headered.
3482 • Wxwidgets: Only bring up ROM patching screen if specifically 
3483   requested.
3485 • Allow configuring some hotkeys.
3487 19.51 rr1-delta4
3489 • Lots of code cleanups
3491 • Fix JMD compression (JMD dumping was broken)
3493 • Don't crash if Lua C function throws an exception.
3495 • Support bitmap drawing in Lua.
3497 • Fix bsnes v085/v086 patches.
3499 • Improve stability on win32.
3501 19.52 rr1-delta4epsilon1
3503 • Don't corrupt movie if movie length is integer multiple of 
3504   frames per page.
3506 19.53 rr1-delta5
3508 • New Lua hooks: on_rewind, on_frame_emulated, on_idle, on_timer
3510 • New Lua functions: emulator_ready(), utime(), 
3511   set_idle_timeout(), set_timer_timeout(), bit.extract(), 
3512   bit.value(), input.geta(), input.seta() and 
3513   input.controllertype()
3515 • Wxwidgets: Fix internal focus lost (hotkeys stop working)
3517 • Wxwidgets: Fix broken modifiers
3519 • on_paint has parameter now.
3521 • Optional initital fill for bitmaps
3523 • Fix palette changing.
3525 • Optimize rendering a bit.
3527 • Bsnes v087 support.
3529 19.54 rr1-delta5epsilon1
3531 • Movieinfo: Fix display of port #2 type.
3533 • Call on_input() after loadstate.
3535 19.55 rr1-delta5epsilon2
3537 • Fix writing port2 data to movie.
3539 • Fix SRAM handling with Bsnes v087.
3541 19.56 rr1-delta6
3543 • Library loading support
3545 • Built-in TSCC encoder
3547 • Hi-color (256T colors) dumping.
3549 • Dump over TCP/IP(v6)
3551 • Hidable status panel
3553 • Turbo toggle/hold
3555 • Adjustable sound volume
3557 • Screen scaling
3559 • Allow DnD into filename boxes
3561 • Configurable paths
3563 • Portaudio: Fix speaker popping at start
3565 • Lots of UI changes
3567 • Speed adjustment menu
3569 • Win32 joystick support
3571 • Lua: gui.rainbow and gui.box
3573 • Split key lists into classes (the key list was large!)
3575 • More save slots support
3577 • Wxwidgets (wxJoystick) joystick support
3579 19.57 rr1-delta7
3581 • Lots of internal joystick refactoring
3583 • Evdev: Add mapping for BTN_TOOL_QUINTTAP
3585 • Wxwidgets: Settings mode (open settings without ROM)
3587 • Wxwidgets: Prompt key to use option
3589 • Wxwidgets: Fix crash if key goes away underneath
3591 • Wxwidgets: Fix mouse position in presence of scaling
3593 • AVI dumper: Mode 4 (high-quality resampling to common rate 
3594   using SRC)
3596 • Wxwidgets: Redesign hotkeys dialog to avoid tree control (tree 
3597   control doesn't seem to work well on WinXP)
3599 • Start paused option.
3601 19.58 rr1-delta7epsilon1
3603 • AVI: ZMBV support
3605 • lsnes-dumpavi: Start Lua before starting dumper
3607 • AVI: Fix secondary audio in mode 4.
3609 19.59 rr1-delta7epsilon2
3611 • AVI: Refactor ZMBV a bit.
3613 • Fix error reading analog values from movie file
3615 19.60 rr1-delta8
3617 • Delayed reset support
3619 • Lua: memory.hash_region
3621 19.61 rr1-delta8epsilon1
3623 • Rework the build system
3625 • Typing input support
3627 • Fix building with bsnes v086 and v087.
3629 • SDL: Save settings on exit
3631 • SDL: Command to enter command line mode with given command.
3633 • SDL: More advanced command editing.
3635 19.62 rr1-delta9
3637 • wxMSW: Fix the “arrow keys and enter don't work” problem
3639 • MSU-1 support
3641 • Show mode changes due to rewinding.
3643 • Unsafe rewind support
3645 • Fix directory transversal.
3647 19.63 rr1-delta10
3649 • AVI: Sound mode 5 (48kHz high-quality)
3651 • Lua: Reset Lua VM
3653 • Map the SNES bus into address space
3655 • Fix loading memory watch files with CRLF line endings
3657 19.64 rr1-delta10epsilon1
3659 • Map bsnes internal state into memory space
3661 • Fix the “click on panel wedges the emulator” for real.
3663 • DnD movies/saves on the main window.
3665 19.65 rr1-delta11
3667 • Split core bindings into own module.
3669 • Remember invalid settings
3671 • Support for modified Gambatte core for GB/GBC emulation.
3673 • Reload/swap ROM function
3675 19.66 rr1-delta11epsilon1
3677 • Fix step poll function
3679 19.67 rr1-delta12
3681 • Non-insane savestate anchoring
3683 19.68 rr1-delta13
3685 • More Memory search methods
3687 • Preserve movie if loading in RO mode.
3689 • Fix a obscure case in timeline check
3691 • Revamp the entiere ROM loading code
3693 • Support DnD on ROMs
3695 • Revamp menu layout
3697 • Standalone hotkey config dialog
3699 • Show bindings in more user-friendly format
3701 19.69 rr1-delta13epsilon1
3703 • Pipedec support
3705 • Fix uninitialized variables in bsnes v085
3707 19.70 rr1-delta14
3709 • Merge gambatte core into mainline (from its own branch)
3711 • Wxwidgets: Show expected dump file formats
3713 • Memory watch: Data typing
3715 • lsnes internal MMIO area.
3717 • Wxwidgets: New memory watch editor
3719 • Hexadecimal memory watches
3721 • Wxwidgets: Monospaced panel
3723 • Wxwidgets: Split memory watches in panel
3725 • Wxwidgets: Disable VMAs in memory search
3727 • lsnes-dumpavi: Fix speed bug
3729 • Movie subtitle support
3731 • Fix rerecord count reporting
3733 • Don't trash movie when loading in readonly mode.
3735 19.71 rr1-delta14epsilon1
3737 • Wxwidgets: Fix crashes on closing settings dialogs on Mac OS X.
3739 • Fix build on Mac OS X.
3741 • Lua: loopwrapper
3743 • Wxwidgets: Hidable messages window
3745 • Lua: input.joyset
3747 • Bsnes: Support inconsistent saves
3749 • Bsnes: Allow simulating saving every frame
3751 • Fix desync if savestate is loaded in readonly mode in certain 
3752   conditions.
3754 • Wxwidgets: Fix save dialogs on Mac OS X.
3756 • Wxwidgets: Fix insane status width on Win32.
3758 • Wxwidgets: Fix autohold processing to be faster.
3760 • Wxwidgets: Allow loading ROMs and movies from commandline.
3762 19.72 rr1-delta15
3764 • Be a bit smarter with --load
3766 • Rewrote higher-level parts of audio system
3768 • Tool to build commentary tracks
3770 • Lua: input.joyget
3772 • Gambatte: Add support for SVN358
3774 • Use builtin font when rendering status panel.
3776 • Option to detach memory watch to its own window.
3778 • Recent ROMs/Movies menu
3780 • Libao support
3782 • Useful lag counter for SNES games that autopoll
3784 • Fix buffer overflow in gambatte sound output
3786 19.73 rr1-delta15epsilon1
3788 • Don't blow up on wxGTK if the window is hidden somehow
3790 • Support simultaneous drop of ROM and movie.
3792 • Gambatte: Don't save spurious SRAMs.
3794 • Make SGB ROMs actually usable.
3796 • Fix so that saved movies appear in recent movies.
3798 • Don't open multiple commentary editors at once.
3800 19.74 rr1-delta15epsilon2
3802 • Lua: memory.readregion/memory.writeregion
3804 • Lua: memory.map{,s}{byte,word,dword,qword}
3806 • Lua: memory.map_structure
3808 • Lua: Fix bus_address for gambatte
3810 • Fix features dependent of bsnes debugger
3812 • Cleanup bsnes debugger logic
3814 • Fix resets in presence of save every frame
3816 19.75 rr1-delta15epsilon3
3818 • Lua: input.lcid_to_pcid
3820 • Fix off-by-one bug with slot hashes
3822 • Fix crashes on certain memory watch expressions
3824 • Lua: memory.read_expr
3826 • Lua: Fix memory.read_expr on nil argument
3828 • Fix the code to compile on G++ 4.7
3830 • Change button_id to be a function pointer field, not a virtual 
3831   method
3833 • Add bsnes patches to fix libsnes to compile on GCC 4.7
3835 • Gambatte: Always use legacy lag counting
3837 • Memory commands: Memory addresses are up to 16 hex digits, not 
3838   up to 8
3840 • Fix analog controllers
3842 • Fix autohold menus
3844 • Fix button symbols in input display
3846 • Compensate for nuts bsnes superscope/justifier handling
3848 • Lua: Fix bit.extract boolean handling
3850 19.76 rr1-delta16
3852 • Stop at movie end: Don't off-by-one
3854 • Fix crash closing lsnes with voice playback active.
3856 • Import/Export OggOpus for commentary tracks
3858 • 16-button controllers.
3860 • Don't show nonexistent controllers in input display
3862 • Set voice record/playback volume from UI
3864 • Patches for gambatte SVN364.
3866 • Load markup (if exists) even without gamepack file.
3868 • Screen rotation & flipping
3870 • Lua: Some new bit functions
3872 • Auto-refresh voice streams on change.
3874 • Auto-refresh subtitles on change & new subtitle editor.
3876 • Fix music volume adjustment.
3878 19.77 rr1-delta16epsilon1
3880 • Wxwidgets: Fix memory watch rendering.
3882 • Wxwidgets: Allow setting voice stream gain.
3884 • Wxwidgets: VU meters and volume adjustment.
3886 • Lua: Custom fonts support.
3888 • Lua: Fix methods stopping working when resetting Lua.
3890 • Fix loading standard-format movies in preserve (readonly) mode.
3892 19.78 rr1-delta17
3894 • Primitive movie editor
3896 • Fix VU meter with no sound device.
3898 • Fix various undefined return values.
3900 • Show rates in VU meter window.
3902 19.79 rr1-delta17epsilon1
3904 • Commentary tool: Set nominal bit rate and limit max bit rate.
3906 • Lua: Unconditionally reload host memory on loadstate
3908 • Lua: Query bindings, manipulate aliases, create inverse 
3909   bindings
3911 • Lua: Fix crashes with resetting VM while some types of paint 
3912   requests are in flight.
3914 • Lua: gui.text: Clip the text properly instead of corrupting 
3915   memory in some cases.
3917 • Save screenshot header reliably
3919 • Lua: Backport input.get2 and input.set2
3921 • Lua: New controller info functions.
3923 • Movie editor: Fix reset delay counters to be the right way 
3924   around.
3926 • Lua: on_snoop2
3928 • Lua: on_button and input.veto_button.
3930 19.80 rr1-delta17epsilon2
3932 • Fix saving PNG screenshots on Win32.
3934 • Movie editor: Sweep axis.
3936 • Load selected slot in ro/rw/preserve/movie mode.
3938 • input.joyset: Preserve and invert user input.
3940 • Allow immediate saving at point of save (transfer saves).
3942 • Wxwidgets: Filter filenames in dialogs, autoappend extensions.
3944 • data/verysmall.font: Add missing glyph 70 (“F”).
3946 • Lua: Allow painting custom fonts with halo.
3948 • Fix memory value search to work on byte types.