Lua: loopwarapper
[lsnes.git] / manual.txt
blobcc4722029be8e8ab0ff0b2a0e8832984c9ba0509
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
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. Lua (if Lua support is needed).
41   • Version 5.1.X or 5.2X.
43 13. G++ 4.6 (bsnes doesn't seem to like 4.7, status for gambatte 
44   is unknown).
46 3 Building
48 • Copy bsnes sources (the bsnes subdirectory) to subdirectory 
49   'bsnes' (for bsnes core).
51 • Copy gambatte sources to subdirectory 'gambatte' (for gambatte 
52   core).
54 • Patch the bsnes sources with included patches (directory 
55   'bsnes-patches/<version>', bsnes core)
57 • Patch the gambatte sources with included patches (directory 
58   'gambatte-patches/<version>', gambatte core)
60 • Edit options.build (or copy of that file)
62 • Run make (passing 'OPTIONS=<filename>' if using something else 
63   than options.build).
65 4 Command line options
67 4.1 ROM options
69 4.1.1 --rom=<file> (lsnes/SDL, lsnes-avidump)
71 Load <file> as ROM.
73 4.2 Session options
75 4.2.1 --pause
77 Start paused
79 4.2.2 <filename> (lsnes/SDL, lsnes-avidump, movieinfo)
81 Load <filename> as movie or savestate file. All other session 
82 options are ignored.
84 4.2.3 --port1=<device> (lsnes/SDL, bsnes core only)
86 Set type of port1. Valid values are:
88 • none: No device connected
90 • gamepad: One gamepad (the default)
92 • multitap: Four gamepads (warning: makes most games refuse to 
93   start)
95 • mouse: Mouse.
97 4.2.4 --port2=<type> (lsnes/SDL, bsnes core only)
99 Set type of port2. Valid values are:
101 • none: No device connected (the default)
103 • gamepad: One gamepad
105 • multitap: Four gamepads.
107 • mouse: Mouse
109 • superscope: Super Scope
111 • justifier: One justifier
113 • justifiers: Two justifiers
115 4.2.5 --gamename=<name> (lsnes/SDL)
117 Set the name of game to <name>. Default is blank.
119 4.2.6 --author=<name> (lsnes/SDL)
121 Add author with full name of <name> (no nickname).
123 4.2.7 --author=|<name> (lsnes/SDL)
125 Add author with nickname of <name> (no full name).
127 4.2.8 --author=<fullname>|<nickname> (lsnes/SDL)
129 Add author with full name of <fullname> and nickname of 
130 <nickname>.
132 4.2.9 --rtc-second=<value> (lsnes/SDL)
134 Set RTC second (0 is 1st January 1970 00:00:00Z). Default is 
135 1,000,000,000.
137 4.2.10 --rtc-subsecond=<value> (lsnes/SDL)
139 Set RTC subsecond. Range is 0-. Unit is CPU cycle. Default is 0.
141 4.2.11 --anchor-savestate=<file> (lsnes/SDL)
143 Set the anchor savestate file.
145 4.3 Misc. options:
147 4.3.1 --run=<file> (lsnes/SDL)
149 After running main RC file, run this file. If multiple are 
150 specified, these execute in order specified.
152 4.4 dump options (lsnes-dumpavi only)
154 4.4.1 --dumper=<dumper>
156 Set the dumper to use (required). Use 'list' for listing of known 
157 dumpers.
159 4.4.2 --mode=<mode>
161 Set the mode to use (required for dumpers with multiple modes, 
162 forbidden otherwise). Use 'list' for known modes.
164 4.4.3 --prefix=<prefix>
166 Set dump prefix. Default is “avidump”.
168 4.4.4 --option=<name>=<value>
170 Set option <name> to value <value>.
172 4.4.5 --length=<length>
174 Set number of frames to dump. Mandatory.
176 4.4.6 --lua=<script>
178 Run specified lua script (lsnes-dumpavi does not have 
179 initialization files).
181 4.4.7 --load-library=<library>
183 Load the specified shared object / dynamic library / dynamic link 
184 library.
186 5 Startup file lsnes.rc
188 Upon startup, lsnes (lsnes/SDL only) executes file lsnes.rc as 
189 commands. This file is located in:
191 • Windows: %APPDATA%\lsnes\lsnes.rc (if %APPDATA% exists)
193 • Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME 
194   exists)
196 • Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
198 • All: ./lsnes.rc (fallback default).
200 If leading directories do not exist, attempt to create them is 
201 made.
203 6 Internal commands
205 • Commands beginning with '*' invoke the corresponding command 
206   without alias expansion.
208 • If command starts with '+' (after possible '*'), the command is 
209   executed as-is when button is pressed, and when button is 
210   released, it is executed with '+' replaced by '-'.
212 • Commands without '+' execute only on negative edge (release).
214 6.1 Settings:
216 Settings control various aspects of emulator behaviour.
218 6.1.1 set-setting <setting> <value>
220 Sets setting <setting> to value <value> (may be empty).
222 6.1.2 unset-setting <setting>
224 Try to unset setting <setting> (not all settings can be unset).
226 6.1.3 get-setting <setting>
228 Read value of setting <setting>
230 6.1.4 show-settings
232 Print names and values of all settings.
234 6.2 Keybindings
236 Keybindings bind commands or aliases to keys (or pseudo-keys). 
238 Notes:
240 • Do not bind edge active (+/-) commands to keys with modifiers, 
241   that won't work right!
243 • Names of keys and modifiers are platform-dependent.
245 • Be careful before binding pseudo-keys (such as joystick axes, 
246   buttons or hats) with modifiers. That may or may not work 
247   right.
249 6.2.1 bind-key [<mod>/<modmask>] <key> <command>
251 Bind <command> to key <key> (activating if modifiers in <modmask> 
252 (comma-seperated list) are set as <mod> (comma-seperated list).
254 The names of keys and modifiers are platform-dependent.
256 6.2.2 unbind-key [<mod>/<modmask>] <key>
258 Unbind command from <key> (with specified <mod> and <modmask>).
260 6.2.3 set-axis <axis> [disabled | axis | axis-inverse | 
261   pressure0- | pressure0+ | pressure-0 | pressure-+ | pressure+0 
262   | pressure+-] [minus=<val>] [zero=<val>] [plus=<val>] 
263   [tolerance=<val>]
265 Set axis parameters for axis <axis>.
267 • disabled: Disable axis
269 • axis: Normal axis
271 • axis-inverse: Inverse axis
273 • pressure0-: Pressure sensitive. Released at 0, pressed at -.
275 • pressure0+: Pressure sensitive. Released at 0, pressed at +.
277 • pressure-0: Pressure sensitive. Released at -, pressed at 0.
279 • pressure-+: Pressure sensitive. Released at -, pressed at +.
281 • pressure+0: Pressure sensitive. Released at +, pressed at 0.
283 • pressure+-: Pressure sensitive. Released at +, pressed at -.
285 • minus=<val>: Calibration at extreme minus position 
286   (-32768-32767)
288 • zero=<val>: Calibration at neutral position (-32768-32767)
290 • plus=<val>: Calibration at extreme plus position (-32768-32767)
292 • tolerance=<value>: Center band tolerance (0<x<1). The smaller 
293   the value, the more sensitive the control is.
295 6.2.4 show-bindings
297 Print all key bindings in effect.
299 6.3 Aliases
301 Aliases bind command to sequence of commands. After alias has 
302 been defined, it replaces the command it shadows.
304 Notes:
306 • You can't alias command to itself.
308 • Aliases starting with +/- are edge active just like ordinary 
309   commands starting with +/-.
311 • One command can be aliased to multiple commands.
313 6.3.1 alias-command <command> <expansion>
315 Append <expansion> to alias <command>. If alias does not already 
316 exist, it is created.
318 6.3.2 unalias-command <command>
320 Clear alias expansion for <command>.
322 6.3.3 show-aliases
324 Print all aliases and their expansions in effect.
326 6.4 run-script <script>
328 Run <script> as if commands were entered on the command line.
330 6.5 Video dumping
332 Following commands control video dumping:
334 6.5.1 start-dump <dumper> [<mode>] <prefix/filename>
336 Start dumping using dumper <dumper>. If mode is present or not 
337 and if prefix or filename is present depends on the dumper and 
338 dumper mode.
340 The following dumpers are available:
342 • INTERNAL-AVI-CSCD: Internal CSCD in .avi dumper.
344   – Mode: uncompressed/pcm: Uncompressed video, PCM audio. Takes 
345     prefix.
347   – Mode: cscd/pcm: CSCD video, PCM audio. Takes prefix.
349 • INTERNAL-JMD: Internal .jmd dumper.
351   – Does not take mode.
353   – Takes a filename.
355 • INTERNAL-RAW: Internal RAW dumper.
357   – Does not take mode.
359   – Takes a prefix.
361   – Sound is big-endian signed 16-bit, usually at 32040.5Hz.
363   – Video is always upscaled to double resolution (512x448 / 512 
364     x 478).
366   – Video framerate is usually 322445/6448 fps for PAL and 
367     10738636/178683 fps for NTSC.
369 • INTERNAL-SDMP: Internal SDMP dumper.
371   – Mode 'ms': Multi-segment. Takes prefix.
373   – Mode 'ss': Single-segment. Takes filename.
375 6.5.2 end-dump <dumper>
377 End dumping using <dumper>
379 6.5.3 show-dumpers [<dumper>]
381 Show the list of dumpers or list of modes for <dumper>
383 6.6 Memory manipulation
385 <address> may be decimal or hexadecimal (prefixed with '0x'). 
386 <value> can be hexadecimal (prefixed with '0x'), unsigned or 
387 signed (prefixed with '-') decimal.
389 The available element <sizes> are:
391 • byte: 1 byte
393 • word: 2 bytes
395 • dword: 4 bytes
397 • qword: 8 bytes
399 When reading RAM and ROM, multi-byte reads/writes are big-endian. 
400 When dealing with DSP memory, multi-byte reads/writes are 
401 native-endian (do not use operand sizes exceeding DSP bitness, 
402 except dword is OK for 24-bit memory).
404 6.6.1 read-<size> <address>
406 Read the value of byte in <address>.
408 6.6.2 read-s<size> <address>
410 Read the value of signed byte in <address>.
412 6.6.3 write-<size> <address> <value>
414 Write <value> to byte in address <address>.
416 6.6.4 search-memory reset
418 Reset the memory search
420 6.6.5 search-memory count
422 Print number of candidates remaining
424 6.6.6 search-memory print
426 Print all candidates remaining
428 6.6.7 search-memory <usflag><sizeflag><op>
430 Searches memory for addresses satisfying criteria.
432 <usflag> can be:
434 • u: unsigned
436 • s: signed
438 <sizeflag> can be:
440 • b: byte
442 • w: word
444 • d: dword
446 • q: qword
448 <op> can be:
450 • lt: < previous value.
452 • le: <= previous value.
454 • eq: = previous value.
456 • ne: != previous value.
458 • ge: >= previous value.
460 • gt: > previous value.
462 6.6.8 search-memory <sizeflag> <value>
464 Searches for addresses that currently have value <value>. 
465 <sizeflag> is as in previous command.
467 6.7 Main commands
469 These commands are not available in lsnesrc, but are available 
470 after ROM has been loaded.
472 6.7.1 quit-emulator [/y]
474 Quits the emulator (asking for confirmation). If /y is given, no 
475 confirmation is asked.
477 6.7.2 pause-emulator
479 Toggle paused/unpaused
481 6.7.3 +advance-frame 
483 Advance frame. If the button is still held after configurable 
484 timeout expires, game unpauses for the duration frame advance is 
485 held.
487 6.7.4 +advance-poll 
489 Advance subframe. If the button is still held after configurable 
490 timeout expires, game unpauses for the duration frame advance is 
491 held.
493 6.7.5 advance-skiplag 
495 Skip to first poll in frame after current.
497 6.7.6 reset 
499 Reset the SNES after this frame.
501 6.7.7 load <filename> 
503 Load savestate <filename> in current mode.
505 6.7.8 load-state <filename> 
507 Load savestate <filename> in readwrite mode.
509 6.7.9 load-readonly <filename> 
511 Load savestate <filename> in readonly mode.
513 6.7.10 load-preserve <filename> 
515 Load savestate <filename> in readonly mode, preserving current 
516 events.
518 6.7.11 load-movie <filename> 
520 Load savestate <filename>, ignoring save part in readonly mode.
522 6.7.12 save-state <filename> 
524 Save system state to <filename> as soon as possible.
526 6.7.13 save-movie <filename> 
528 Save movie to <filename>.
530 6.7.14 set-rwmode 
532 Set read-write mode.
534 6.7.15 set-romode 
536 Set read-only mode
538 6.7.16 toggle-rwmode 
540 Toggle between read-only and read-write modes.
542 6.7.17 set-gamename <name> 
544 Set name of the game to <name>
546 6.7.18 get-gamename 
548 Print the name of the game.
550 6.7.19 add-author <author> 
552 Adds new author <author>. If <author> does not contain '|' it is 
553 full name. If it contains '|', '|' splits the full name and 
554 nickname.
556 6.7.20 edit-author <num> <author> 
558 Edit the author in slot <num> (0-based) to be <author> (see 
559 add-author for format)
561 6.7.21 remove-author <num> 
563 Remove author in slot <num>
565 6.7.22 print-authors 
567 Print authors.
569 6.7.23 test-1, test-2, test-3
571 Internal test commands. Don't use.
573 6.7.24 take-screenshot <filename> 
575 Save screenshot to <filename>.
577 6.7.25 +controller<num><button>
579 Press button <button> on controller <num> (1-8). The following 
580 button names are known:
582 • left
584 • right
586 • up
588 • down
590 • A
592 • B
594 • X
596 • Y
598 • L
600 • R
602 • select
604 • start
606 • trigger
608 • cursor
610 • pause
612 • turbo
614 6.7.26 controllerh<num><button>
616 Hold/unhold button <button> on controller <num> (1-8). See 
617 +controller for button names.
619 6.7.27 controllerf<num><button>
621 Hold/unhold button <button> on controller <num> (1-8) for the 
622 next frame. See +controller for button names.
624 Cauntion: Does not work properly if outside frame advance.
626 6.7.28 autofire (<pattern>|-)...
628 Set autofire pattern. Each parameter is comma-separated list of 
629 button names (in form of 1start, 1A, 2B, etc..) to hold on that 
630 frame. After reaching the end of pattern, the pattern restarts 
631 from the beginning.
633 6.7.29 repaint
635 Force a repaint.
637 6.8 Save jukebox 
639 6.8.1 cycle-jukebox-backward
641 Cycle save jukebox backwards.
643 6.8.2 cycle-jukebox-forward
645 Cycle save jukebox forwards
647 6.8.3 load-jukebox
649 Do load from jukebox (current mode).
651 6.8.4 save-jukebox
653 Do state save to jukebox.
655 6.9 Lua 
657 Only available if lua support is compiled in.
659 6.9.1 evaluate-lua <luacode>
661 Run Lua code <luacode> using built-in Lua interpretter.
663 6.9.2 run-lua <script>
665 Run specified lua file using built-in Lua interpretter.
667 6.9.3 reset-lua
669 Clear the Lua VM state and restore to factory defaults.
671 6.10 Memory watch
673 6.10.1 add-watch <name> <expression>
675 Adds new watch (or modifies old one).
677 6.10.2 remove-watch <name>
679 Remove a watch.
681 6.11 Sound 
683 6.11.1 enable-sound <on/off> 
685 Enable/Disable sound.
687 6.11.2 set-sound-device <device> 
689 Set sound device to <device>
691 6.11.3 show-sound-status 
693 Show status of sound system.
695 6.11.4 show-sound-devices
697 Show all available devices.
699 6.11.5 set-volume <multiplier>
701 Set the volume multiplier to <multiplier>. 1 is normal volume, 
702 and higher numbers are louder.
704 6.11.6 set-volume <multiplier>%
706 Set the volume multiplier to <multiplier> percent. 100 is normal 
707 volume, and higher numbers are louder.
709 6.11.7 set-volume <multiplier>dB
711 Set the volume multiplier to <multiplier> dB. 0 is normal volume, 
712 and higher numbers are louder. The value may be negative.
714 6.12 Misc.
716 6.12.1 reload-rom [<file>]
718 Reloads the main ROM image from <file>.
720 6.12.2 edit-subtitle <firstframe> <length> [<text>]
722 Edit or delete a subtitle.
724 6.12.3 list-subtitle
726 List subtitles.
728 6.13 SDL Platform commands 
730 The following are valid on SDL platform.
732 6.13.1 identify-key
734 Asks to press a key and then identifies that (pseudo-)key.
736 6.13.2 toggle-console 
738 Toggle between windowed/fullscreen console.
740 6.13.3 scroll-fullup 
742 Scroll messages window as far back as it goes.
744 6.13.4 scroll-fulldown 
746 Scroll messages window as far forward as it goes.
748 6.13.5 scroll-up 
750 Scroll messages window back one screenful.
752 6.13.6 scroll-down 
754 Scroll messages window forward one screenful.
756 6.13.7 prompt-command <command>
758 Enter command prompt, with prompt prepopulated with specified 
759 command.
761 7 Settings
763 7.1 Core settings
765 7.1.1 firmwarepath
767 Set where bsnes looks for firmware files. Default is “.”.
769 7.1.2 target
771 Set the target . Numeric, range is 0.001 to “infinite”. Default 
772 is native framerate.
774 7.1.3 savecompression
776 Set save compression level (integer 0-9). Default is 7 (0 is no 
777 compression).
779 7.1.4 advance-timeout
781 Set the frame advance timeout in milliseconds. Numeric integer, 
782 range is 0-999999999. Default is 500.
784 7.2 AVI dumper settings
786 7.2.1 avi-large
788 AVI dumper: Always dump at 512x448 or 512x478 regardless of what 
789 the console outputs.
791 7.2.2 avi-left-border
793 AVI dumper: Set the default left border thickness (unless lua 
794 overrides) for dumps. Range 0-8191. Default is 0.
796 7.2.3 avi-right-border
798 AVI dumper: Set the default right border thickness (unless lua 
799 overrides) for dumps. Range 0-8191. Default is 0.
801 7.2.4 avi-top-border
803 AVI dumper: Set the default top border thickness (unless lua 
804 overrides) for dumps. Range 0-8191. Default is 0.
806 7.2.5 avi-bottom-border
808 AVI dumper: Set the default bottom border thickness (unless lua 
809 overrides) for dumps. Range 0-8191. Default is 0.
811 7.2.6 avi-maxframes
813 AVI dumper: Maximum number of frames per dump segment (0 => 
814 unlimited). Range 0-999999999. Default is 0.
816 7.2.7 avi-compresison
818 AVI dumper: Compression level (0-18).
820 • Compression levels 10 and above are not compatible with stock 
821   CSCD codec.
823 • Recomended level is 7.
825 7.2.8 avi-soundrate
827 AVI dumper: Set method of determining the sound rate.
829 • 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 
830   64, 88.2, 96, 128, 176.4 and 192 kHz.
832 • 1: Round down to nearest integer.
834 • 2: Round up to nearest ingeter.
836 7.3 JMD options
838 7.3.1 jmd-copression
840 JMD dumper: Compression level (0-9).
842 7.4 SDL platform settings
844 7.4.1 autorepeat-first-delay
846 Sets the delay for first character in typematic autorepeat.
848 7.4.2 autorepeat-subsequent-delay
850 Sets the delay for subsequent characters in typematic autorepeat.
852 8 Lua functions
854 8.1 Core (in main table)
856 8.1.1 print
858 Print line to message console.
860 8.1.2 exec(string command)
862 Run command as it was entered on the command line
864 8.1.3 utime()
866 Returns two values. First is time since some epoch in seconds, 
867 the second is microseconds mod 10^6 since that epoch.
869 8.1.4 emulator_ready()
871 Returns true if emulator has finished booting, false if not 
872 (on_startup() will be issued later).
874 8.1.5 set_idle_timeout(number timeout)
876 Set number of microseconds to block idle for. After this timeout 
877 has expired, on_idle() will be called once.
879 8.1.6 set_timer_timeout(number timeout)
881 Set number of microseconds to block timer for. After this timeout 
882 has expired, on_timer() will be called once.
884 8.1.7 bus_address(number snesaddr)
886 Returns virtual address corresponding to specified address on 
887 SNES bus.
889 8.1.8 loopwrapper(function fun, ...)
891 Calls function fun with function and specified arguments. The 
892 function passed suspends execution until the function returned is 
893 called. Handy for linear flow control among multiple invocations 
894 of a hook. Example code:
896 on_paint = loopwrapper(function(wait)
898   while true do
900     gui.text(0, 0, “Test!”);
902     wait();
904   end
906 end);
908 8.2 Table bit:
910 Bitwise logical functions and related.
912 8.2.1 bit.none(number...) / bit.bnot(number...)
914 48-bit bitwise NOT / NONE function (set bits that are set in none 
915 of the arguments).
917 8.2.2 bit.any(number...) / bit.bor(number...)
919 48-bit bitwise OR / ANY function (set bits that are set in any of 
920 the arguments).
922 8.2.3 bit.all(number...) / bit.band(number...)
924 48-bit bitwise AND / ALL function (set bits that are set in all 
925 of the arguments).
927 8.2.4 bit.parity(number...) / bit.bxor(number...)
929 48-bit bitwise XOR / PARITY function (set bits that are set in 
930 odd number of the arguments).
932 8.2.5 bit.lrotate(number base[, number amount[, number bits]])
934 Rotate bits-bit (max 48, default 48) number left by amount 
935 (default 1) places.
937 8.2.6 bit.rrotate(number base[, number amount[, number bits]])
939 Rotate bits-bit (max 48, default 48) number right by amount 
940 (default 1) places.
942 8.2.7 bit.lshift(number base[, number amount[, number bits]])
944 Shift bits-bit (max 48, default 48) number left by amount 
945 (default 1) places. The new bits are filled with zeroes.
947 8.2.8 bit.lrshift(number base[, number amount[, number bits]])
949 Shift bits-bit (max 48, default 48) number logically right by 
950 amount (default 1) places. The new bits are filled with zeroes.
952 8.2.9 bit.arshift(number base[, number amount[, number bits]])
954 Shift bits-bit (max 48, default 48) number arithmetically right 
955 by amount (default 1) places. The new bits are shifted in with 
956 copy of the high bit.
958 8.2.10 bit.extract(number base[, number bit0[, number bit1,...]])
960 Returns number that has bit0-th bit as bit 0, bit1-th bit as 1 
961 and so on.
963 Notes: 
965 • Bit numbers up to 51 should work reliably (then things start 
966   falling apart due to double precision issues).
968 • There are two special bit positions, true and false, standing 
969   for always set bit and always clear bit.
971 8.2.11 bit.value([number bit1[, number bit2,...]])
973 Returns bitwise OR of 1 left shifted by bit1 places, 1 left 
974 shifted by bit2 places and so on. As special value, nil argument 
975 is no-op.
977 8.3 Table gui:
979 Most of these functions can only be called in on_paint and 
980 on_video callbacks. Exceptions are noted.
982 Colors are 32-bit. Bits 0-7 are the blue component, bits 8-15 are 
983 the green component, bits 16-23 are the red component, bits 24-31 
984 are alpha component (0 is fully opaque, 255 is almost 
985 transparent). -1 is the fully transparent color. Alpha values 
986 greater than 127 do work.
988 Origin of coordinates is at top left corner of game display area. 
989 Left and top gaps correspond to negative coordinates.
991 8.3.1 gui.resolution()
993 Returns 2-tuple (hresolution, vresolution).
995 8.3.2 gui.<class>_gap(number gap)
997 Set the <class> (left, right, top, bottom) gap to specified value 
998 (max gap is 8191).
1000 8.3.3 gui.text(number x, number y, string text[, number fgc[, 
1001   number bgc]])
1003 Draw specified text on the GUI (each character cell is 8 or 16 
1004 wide and 16 high). Parameters:
1006 • x: X-coordinate to start the drawing from (and x-coordinate at 
1007   begining of the lines).
1009 • y: Y-coordinate to start the drawing from.
1011 • text: The text to draw.
1013 • fgc: Text color (default is 0xFFFFFF (white))
1015 • bgc: Background color (default is -1 (transparent))
1017 8.3.4 gui.textH(number x, number y, string text[, number fgc[, 
1018   number bgc]])
1020 Like gui.text, but draw using double-width.
1022 8.3.5 gui.textV(number x, number y, string text[, number fgc[, 
1023   number bgc]])
1025 Like gui.text, but draw using double-height.
1027 8.3.6 gui.textHV(number x, number y, string text[, number fgc[, 
1028   number bgc]])
1030 Like gui.text, but draw using double-width/double-height.
1032 8.3.7 gui.rectangle(number x, number y, number width, number 
1033   height[, number thickness[, number outline[, number fill]]])
1035 Draw rectangle on the GUI. Parameters:
1037 • x: X-coordinate of left edge.
1039 • y: Y-coordinate of upper edge.
1041 • width: Width of rectangle.
1043 • height: Height of rectangle.
1045 • thickness: Thickness of outline (default is 1).
1047 • outline: Color of outline (default is 0xFFFFFF (white))
1049 • fill: Color of fill (default is -1 (transparent))
1051 8.3.8 gui.box(number x, number y, number width, number height[, 
1052   number thickness[, number outline1[,number outline2[, number 
1053   fill]]]])
1055 Draw rectangle with 3D effect on the GUI. Parameters:
1057 • x: X-coordinate of left edge.
1059 • y: Y-coordinate of upper edge.
1061 • width: Width of rectangle.
1063 • height: Height of rectangle.
1065 • thickness: Thickness of outline (default is 1).
1067 • outline1: First color of outline (default is 0xFFFFFF (white))
1069 • outline2: First color of outline (default is 0x808080 (dark 
1070   gray))
1072 • fill: Color of fill (default is 0xC0C0C0 (light grayy))
1074 8.3.9 gui.pixel(number x, number y[, number color])
1076 Draw one pixel on the GUI. Parameters:
1078 • x: X-coordinate of the pixel
1080 • y: Y-coordinate of the pixel
1082 • color: Color of the pixel (default is 0xFFFFFF (white))
1084 8.3.10 gui.crosshair(number x, number y[, number length[, number 
1085   color]])
1087 Draw a crosshair. Parameters:
1089 • x: X-coordinate of the crosshair
1091 • y: Y-coordinate of the crosshair
1093 • length: Length of the crosshair lines (default 10).
1095 • color: Color of the crosshair (default is 0xFFFFFF (white))
1097 8.3.11 gui.line(number x1, number y1, number x2, number y2[, 
1098   number color])
1100 Draw a thin line. Parameters:
1102 • x1: X-coordinate of one end.
1104 • y1: Y-coordinate of one end.
1106 • x2: X-coordinate of the other end.
1108 • y2: Y-coordinate of the other end.
1110 • color: Color of the line (default is 0xFFFFFF (white)).
1112 8.3.12 gui.circle(number x, number y, number r[, number thick[, 
1113   number border[, number fil]]])
1115 Draw a circle. Parameters.
1117 • x: X-coordinate of the center
1119 • y: Y-coordinate of the center
1121 • r: The radius of the circle
1123 • thick: Border thickness
1125 • border: Border color (default is 0xFFFFFF (white))
1127 • fill: Fill color (default is -1 (transparent)).
1129 8.3.13 gui.bitmap_draw(number x, number y, bitmap bitmap, palette 
1130   palette)
1132 Draw a bitmap on screen with specified palette. Parameters:
1134 • x: X-coordinate of left edge.
1136 • y: Y-coordinate of top edge.
1138 • bitmap: The bitmap to draw
1140 • palette: The palette to draw the bitmap using.
1142 8.3.14 gui.bitmap_draw(number x, number y, dbitmap bitmap)
1144 Draw a bitmap on screen. Parameters:
1146 • x: X-coordinate of left edge.
1148 • y: Y-coordinate of top edge.
1150 • bitmap: The bitmap to draw
1152 8.3.15 gui.palette_new()
1154 Returns a new palette (initially all transparent). Can be used 
1155 anywhere.
1157 8.3.16 gui.bitmap_new(number w, number h, boolean direct[, bool 
1158   icolor])
1160 Returns a new bitmap/dbitmap. Can be used anywhere. Parameters:
1162 • w: The width of new bitmap
1164 • h: The height of new bitmap
1166 • direct: If true, the returned bitmap is dbitmap, otherwise 
1167   bitmap.
1169 • icolor: Initital fill color (defaults to 0 on BITMAP, -1 on 
1170   DBITMAP)
1172 8.3.17 gui.bitmap_load(string file)
1174 Returns loaded bitmap/dbitmap (if bitmap, the second return value 
1175 is palette for bitmap). Can be used anywhere. Parameters:
1177 • file: The name of file to load.
1179 8.3.18 gui.palette_set(palette palette, number index, number 
1180   color)
1182 Sets color in palette. Can be used anywhere. Parameters:
1184 • palette: The palette to manipulate
1186 • index: Index of color (0-65535).
1188 • color: The color value.
1190 8.3.19 gui.bitmap_pset(bitmap/dbitmap bitmap, number x, number y, 
1191   number color)
1193 Sets specified pixel in bitmap. Can be used anywhere. Parameters:
1195 • bitmap: The bitmap to manipulate
1197 • x: The x-coordinate of the pixel.
1199 • y: The y-coordinate of the pixel.
1201 • color: If bitmap is a bitmap, color index (0-65535). Otherwise 
1202   color value.
1204 8.3.20 gui.bitmap_size(bitmap/dbitmap bitmap)
1206 Get size of bitmap. Can be used anywhere. Parameters:
1208 • bitmap: The bitmap to query.
1210 The first return is the width, the second is the height.
1212 8.3.21 gui.bitmap_blit(bitmap/dbitmap dest, number dx, number dy, 
1213   bitmap/dbitmap src, number sx, number sy, number w, number h[, 
1214   number ck])
1216 Blit a part of bitmap to another. Can be used anywhere. 
1217 Parameters:
1219 • dest: Destination to blit to.
1221 • dx: left edge of target
1223 • dy: Top edge of target
1225 • src: The source to blit from. Must be of the same type as 
1226   destination.
1228 • sx: left edge of source
1230 • sy: Top edge of source
1232 • w: Width of region
1234 • h: Height of region.
1236 • ck: Color key. Pixels of this color are not blitted.
1238   – If bitmaps are bitmaps, this is color index of colorkey. 
1239     Values outside range 0-65535 cause no key to be used as 
1240     colorkey.
1242   – If bitmaps are dbitmaps, this color value of colorkey.
1244   – May be absent or nil for no colorkey blit.
1246 8.3.22 gui.repaint()
1248 Request on_repaint() to happen as soon as possible. Can be used 
1249 anywhere.
1251 8.3.23 gui.subframe_update(boolean on)
1253 Request subframe updates (calling on_paint() on subframes) to 
1254 happen (on=true) or not happen (on=false). Can be used anywhere.
1256 8.3.24 gui.screenshot(string filename)
1258 Write PNG screenshot of the current frame (no drawings) to 
1259 specified file. Can be used anywhere.
1261 8.3.25 gui.color(number r, number g, number b[, number a])
1263 Returns color (in notation Lua scripts use) corresponding to 
1264 color (r,g,b), each component in scale 0-255. If a is specified, 
1265 that is alpha (0 is fully transparent, 256(sic) is fully opaque). 
1266 The default alpha is 256.
1268 8.3.26 gui.status(string name, string value)
1270 Set status field “L[<name>]” to <value> in status area. Can be 
1271 used anywhere.
1273 8.3.27 gui.rainbow(number step, number steps[, number color])
1275 Perform hue rotation of color <color> (default bright red), by 
1276 <step> steps. The number of steps per full rotation is given by 
1277 absolute value of <steps>.
1279 If <steps> is negative, the rotation will be counterclockwise.
1281 8.4 table input
1283 Input handling. Only available in on_input callback.
1285 8.4.1 input.get(number controller, number index)
1287 Read the specified index (0-11) from specified controller (0-7). 
1288 Notes:
1290 • Uses physical controller numbering. Gamepad in port 2 is 
1291   controller 4, not 1!
1293 8.4.2 input.set(number controller, number index, number value)
1295 Write the specified index (0-11) from specified controller (0-7), 
1296 storing value. Notes:
1298 • Uses physical controller numbering. Gamepad in port 2 is 
1299   controller 4, not 1!
1301 8.4.3 input.geta(number controller)
1303 Get input state for entiere controller. Returns 13 return values.
1305 • 1st return value: Bitmask: bit i is set if i:th index is 
1306   nonzero
1308 • 2nd-13th return value: value of i:th index.
1310 8.4.4 input.seta(number controller, number bitmask, number 
1311   args...)
1313 Set state for entiere controller. args is up to 12 values for 
1314 indices (overriding values in bitmask if specified).
1316 8.4.5 input.controllertype(number controller)
1318 Get the type of controller as string. Valid values are:
1320 • gamepad
1322 • mouse
1324 • justifier
1326 • superscope
1328 8.4.6 input.reset([number cycles])
1330 Execute reset. If cycles is greater than zero, do delayed reset. 
1331 0 (or no value) causes immediate reset.
1333 • Only available with subframe flag false.
1335 8.4.7 input.raw()
1337 Returns table of tables of all available keys and axes. The first 
1338 table is indexed by key name (platform-dependent!), and the inner 
1339 table has the following fields:
1341 • last_rawval: Last reported raw value for control.
1343 • ktype: Type of key (disabled, key, mouse, axis, axis-inverse, 
1344   hat, pressure-m0, pressure-mp, pressure-0m, pressure-0p, 
1345   pressure-pm, pressure-p0).
1347 • cal_left: Minimum calibration value. Only meaningful with axis 
1348   and pressure types.
1350 • cal_center: Center calibration value. Only meaningful with axis 
1351   and pressure types.
1353 • cal_right: Maximum calibration value. Only meaningful with axis 
1354   and pressure types.
1356 • cal_tolerance: Dead zone tolerance. Only meaningful with axis 
1357   and pressure types.
1359 8.4.8 input.keyhook(key, state)
1361 Requests that keyhook events to be sent for key (state=true) or 
1362 not sent (state=false).
1364 8.5 Table subtitle
1366 Subtitle handling
1368 8.5.1 subtitle.byindex(number i)
1370 Read the frame and length of ith subtitle. Returns nothing if not 
1371 present.
1373 8.5.2 subtitle.set(number f, number l, string txt)
1375 Set the text of subtitle.
1377 8.5.3 subtitle.get(number f, number l)
1379 Get the text of subtitle.
1381 8.5.4 subtitle.delete(number f, number l)
1383 Delete specified subtitle.
1385 8.6 Table hostmemory
1387 Host memory handling (extra memory saved to savestates). Host 
1388 memory starts empty.
1390 8.6.1 hostmemory.read(number address)
1392 Reads hostmemory slot address. Slot numbers out of range return 
1393 false instead of numeric.
1395 8.6.2 hostmemory.write(number address, number value)
1397 Writes hostmemory slot with 0-255. Slot numbers out of range 
1398 cause extension of host memory slot space.
1400 8.6.3 hostmemory.readbyte(number address)
1402 Read unsigned byte (1 element) from given address. Slots out of 
1403 range return false.
1405 8.6.4 hostmemory.writebyte(number address, number value)
1407 Write unsigned byte (1 element) to given slot. Slot numbers out 
1408 of range cause extension.
1410 8.6.5 hostmemory.readsbyte(number address)
1412 Read signed byte (1 element) from given address. Slots out of 
1413 range return false.
1415 8.6.6 hostmemory.writesbyte(number address, number value)
1417 Write signed byte (1 element) to given slot. Slot numbers out of 
1418 range cause extension.
1420 8.6.7 hostmemory.readword(number address)
1422 Read unsigned word (2 elements) from given address. Slots out of 
1423 range return false.
1425 8.6.8 hostmemory.writeword(number address, number value)
1427 Write unsigned word (2 elements) to given slot. Slot numbers out 
1428 of range cause extension.
1430 8.6.9 hostmemory.readsword(number address)
1432 Read signed word (2 elements) from given address. Slots out of 
1433 range return false.
1435 8.6.10 hostmemory.writesword(number address, number value)
1437 Write signed word (2 elements) to given slot. Slot numbers out of 
1438 range cause extension.
1440 8.6.11 hostmemory.readdword(number address)
1442 Read unsigned doubleword (4 elements) from given address. Slots 
1443 out of range return false.
1445 8.6.12 hostmemory.writedword(number address, number value)
1447 Write unsigned doubleword (4 elements) to given slot. Slot 
1448 numbers out of range cause extension.
1450 8.6.13 hostmemory.readsdword(number address)
1452 Read signed doubleword (4 elements) from given address. Slots out 
1453 of range return false.
1455 8.6.14 hostmemory.writesdword(number address, number value)
1457 Write signed doubleword (4 elements) to given slot. Slot numbers 
1458 out of range cause extension.
1460 8.6.15 hostmemory.readqword(number address)
1462 Read unsigned quadword (8 elements) from given address. Slots out 
1463 of range return false.
1465 8.6.16 hostmemory.writeqword(number address, number value)
1467 Write unsigned quadword (4 elements) to given slot. Slot numbers 
1468 out of range cause extension.
1470 8.6.17 hostmemory.readsqword(number address)
1472 Read signed quadword (8 elements) from given address. Slots out 
1473 of range return false.
1475 8.6.18 hostmemory.writesqword(number address, number value)
1477 Write signed quadword (8 elements) to given slot. Slot numbers 
1478 out of range cause extension.
1480 8.7 Table movie
1482 Movie handling
1484 8.7.1 movie.currentframe()
1486 Return number of current frame.
1488 8.7.2 movie.framecount()
1490 Return number of frames in movie.
1492 8.7.3 movie.readonly()
1494 Return true if in readonly mode, false if in readwrite.
1496 8.7.4 movie.set_readwrite()
1498 Set readwrite mode (does not cause on_readwrite callback).
1500 8.7.5 movie.frame_subframes(number frame)
1502 Count number of subframes in specified frame (frame numbers are 
1503 1-based) and return that.
1505 8.7.6 movie.read_subframe(number frame, number subframe)
1507 Read specifed subframe in specified frame and return data as 
1508 array (100 elements, numbered 0-99 currently).
1510 8.7.7 movie.unsafe_rewind([UNSAFEREWIND state])
1512 Start setting point for unsafe rewind or jump to point of unsafe 
1513 rewind.
1515 • If called without argument, causes emulator to start process of 
1516   setting unsafe rewind point. When this has finished, callback 
1517   on_set_rewind occurs, passing the rewind state to lua script.
1519 • If called with argument, causes emulator rewind to passed 
1520   rewind point as soon as possible. Readwrite mode is implicitly 
1521   activated.
1523 The following warnings apply to unsafe rewinding:
1525 • There are no safety checks against misuse (that's what “unsafe” 
1526   comes from)!
1528 • Only call rewind from timeline rewind point was set from.
1530 • Only call rewind from after the rewind point was set.
1532 8.8 Table settings
1534 Routines for settings manipulation
1536 8.8.1 settings.get(string name)
1538 Get value of setting. If setting is blank, returns false. If 
1539 setting value can't be obtained, returns (nil, error message).
1541 8.8.2 settings.set(string name, string value)
1543 Set value of setting. If setting can't be set, returns (nil, 
1544 error message).
1546 8.8.3 settings.is_set(string name)
1548 Returns if setting is set. If setting does not exist, returns 
1549 (nil, error message).
1551 8.8.4 settings.blank(string name)
1553 Blanks a setting and returns true. If setting can't be blanked, 
1554 returns (nil, error message).
1556 8.9 Table memory
1558 Contains various functions for managing memory
1560 8.9.1 memory.vma_count()
1562 Returns the number of VMAs
1564 8.9.2 memory.read_vma(number index)
1566 Reads the specified VMA (indices start from zero). Trying to read 
1567 invalid VMA gives nil. The read VMA is table with the following 
1568 fields:
1570 • region_name (string): The readable name of the VMA
1572 • baseaddr (number): Base address of the VMA
1574 • lastaddr (number): Last address in the VMA.
1576 • size (number): The size of VMA in bytes.
1578 • readonly (boolean): True of the VMA corresponds to ROM.
1580 • iospace (boolean): True if the VMA is I/O space.
1582 • native_endian (boolean): True if the VMA has native endian as 
1583   opposed to little endian.
1585 8.9.3 memory.find_vma(number address)
1587 Finds the VMA containing specified address. Returns table in the 
1588 same format as read_vma or nil if not found.
1590 8.9.4 memory.readbyte(number address)
1592 Reads the specified address as unsigned byte and returns the 
1593 result.
1595 8.9.5 memory.readsbyte(number address)
1597 Reads the specified address as signed byte and returns the 
1598 result.
1600 8.9.6 memory.writebyte(number address, number value)
1602 Writes the specified value (negative values undergo 2's 
1603 complement) to specified address (as a byte).
1605 8.9.7 memory.readword(number address)
1607 Reads the specified address as unsigned word and returns the 
1608 result.
1610 8.9.8 memory.readsword(number address)
1612 Reads the specified address as signed word and returns the 
1613 result.
1615 8.9.9 memory.writeword(number address, number value)
1617 Writes the specified value (negative values undergo 2's 
1618 complement) to specified address (as a word).
1620 8.9.10 memory.readdword(number address)
1622 Reads the specified address as unsigned doubleword and returns 
1623 the result.
1625 8.9.11 memory.readsdword(number address)
1627 Reads the specified address as signed doubleword and returns the 
1628 result.
1630 8.9.12 memory.writedword(number address, number value)
1632 Writes the specified value (negative values undergo 2's 
1633 complement) to specified address (as a doubleword).
1635 8.9.13 memory.readqword(number address)
1637 Reads the specified address as unsigned quadword and returns the 
1638 result.
1640 8.9.14 memory.readsqword(number address)
1642 Reads the specified address as signed quadword and returns the 
1643 result.
1645 8.9.15 memory.writeqword(number address, number value)
1647 Writes the specified value (negative values undergo 2's 
1648 complement) to specified address (as a quadword).
1650 8.9.16 memory.hash_region(number base, number size)
1652 Hash specified number of bytes starting from specified address 
1653 and return the SHA-256.
1655 8.10 Table _SYSTEM
1657 Contains copy of global variables from time of Lua 
1658 initialization. Non-writeable.
1660 8.11 Callbacks
1662 Various callbacks to Lua that can occur.
1664 8.11.1 Callback: on_paint(bool not_synth)
1666 Called when screen is being painted. Any gui.* calls requiring 
1667 graphic context draw on the screen.
1669 not_synth is true if this hook is being called in response to 
1670 received frame, false otherwise.
1672 8.11.2 Callback: on_video()
1674 Called when video dump frame is being painted. Any gui.* calls 
1675 requiring graphic context draw on the video.
1677 8.11.3 Callback: on_frame_emulated()
1679 Called when emulating frame has completed and 
1680 on_paint()/on_video() calls are about to be issued.
1682 8.11.4 Callback: on_frame()
1684 Called on each starting whole frame.
1686 8.11.5 Callback: on_startup()
1688 Called when the emulator is starting (lsnes.rc and --run files 
1689 has been run).
1691 8.11.6 Callback: on_rewind()
1693 Called when rewind movie to beginning has completed.
1695 8.11.7 Callback: on_pre_load(string name)
1697 Called just before savestate/movie load occurs (note: loads are 
1698 always delayed, so this occurs even when load was initiated by 
1699 lua).
1701 8.11.8 Callback: on_err_load(string name)
1703 Called if loadstate goes wrong.
1705 8.11.9 Callback: on_post_load(string name, boolean was_savestate)
1707 Called on successful loadstate. was_savestate gives if this was a 
1708 savestate or a movie.
1710 8.11.10 Callback: on_pre_save(string name, boolean is_savestate)
1712 Called just before savestate save occurs (note: movie saves are 
1713 synchronous and won't trigger these callbacks if called from 
1714 Lua).
1716 8.11.11 Callback: on_err_save(string name)
1718 Called if savestate goes wrong.
1720 8.11.12 Callback: on_post_save(string name, boolean is_savestate)
1722 Called on successful savaestate. is_savestate gives if this was a 
1723 savestate or a movie.
1725 8.11.13 Callback: on_quit()
1727 Called when emulator is shutting down.
1729 8.11.14 Callback: on_input(boolean subframe)
1731 Called when emulator is just sending input to bsnes core. 
1732 Warning: This is called even in readonly mode, but the results 
1733 are ignored.
1735 8.11.15 Callback: on_reset()
1737 Called when SNES is reset.
1739 8.11.16 Callback: on_readwrite()
1741 Called when moving into readwrite mode as result of “set-rwmode” 
1742 command (note: moving to rwmode by Lua won't trigger this, as per 
1743 recursive entry protection).
1745 8.11.17 Callback: on_snoop(number port, number controller, number 
1746   index, number value)
1748 Called each time bsnes asks for input. The value is the final 
1749 value to be sent to bsnes core (readonly mode, autohold and 
1750 autofire have been taken into account). Might be useful when 
1751 translating movies to format suitable for console verification. 
1752 Note: There is no way to modify the value to be sent.
1754 8.11.18 Callback: on_keyhook(string keyname, table state)
1756 Sent when key that has keyhook events requested changes state. 
1757 Keyname is name of the key (group) and state is the state (same 
1758 kind as table values in input.raw).
1760 8.11.19 Callback: on_idle()
1762 Called when requested by set_idle_timeout(), the timeout has 
1763 expired and emulator is waiting.
1765 8.11.20 Callback: on_timer()
1767 Called when requested by set_idle_timeout() and the timeout has 
1768 expired (regardless if emulator is waiting).
1770 8.11.21 Callback: on_set_rewind(UNSAFEREWIND r)
1772 Called when unsafe rewind object has been constructed.
1774 8.11.22 Callback: on_pre_rewind() 
1776 Called just before unsafe rewind is about to occur.
1778 8.11.23 Callback: on_post_rewind() 
1780 Called just after unsafe rewind has occured.
1782 9 Memory watch expression syntax
1784 Memory watch expressions are in RPN (Reverse Polish Notation). At 
1785 the end of expression, the top entry on stack is taken as the 
1786 final result.
1788 Notations:
1790 • Evaluation order is strictly left to right.
1792 • a is the entry on top of stack
1794 • b is the entry immediately below top of stack
1796 • ; separates values to be pushed (no intermediate pop).
1798 • After end of element, all used stack slots are popped and all 
1799   results are pushed.
1801 • When pushing multiple values, the pushes occur in order shown.
1803 The following operators are available:
1805 • + : a + b
1807 • - : a - b
1809 • * : a * b
1811 • / : a / b
1813 • % : a % b
1815 • a : atan(a)
1817 • b : read_signed_byte(a)
1819 • c : cos(a)
1821 • d : read_signed_dword(a)
1823 • i : quotent(a / b)
1825 • p :\pi
1828 • q : read_signed_qword(a)
1830 • r : sqrt(a)
1832 • s : sin(a)
1834 • t : tan(a)
1836 • u : a; a
1838 • w : read_signed_word(a)
1840 • A : atan2(a, b)
1842 • B : read_unsigned_byte(a)
1844 • C<number>z : Push number <number> to stack.
1846 • D : read_unsigned_dword(a)
1848 • C0x<number>z : Push number <number> (hexadecimal) to stack.
1850 • Q : read_unsigned_qword(a)
1852 • R<digit> : round a to <digit> digits.
1854 • W : read_unsigned_word(a)
1856 9.1 Example:
1858 C0x007e0878zWC0x007e002czW-
1860 1. Push value 0x7e0878 on top of stack (C0x007e0878z).
1862 2. Pop the value on top of stack (0x7e0878), read word value at 
1863   that address and push the result,call it x1 (W).
1865 3. Push value 0x7e002c on top of stack (C0x007e002cz).
1867 4. Pop the value on top of stack (0x7e002c), read word value at 
1868   that address and push the result,call it x2 (W).
1870 5. Pop the two top numbers on stack, x1 and x2, substract x1 from 
1871   x2 and push x2 - x1 (-).
1873 6. Since the expression ends, the final memory watch result is 
1874   the top one on stack, which is x2 - x1.
1876 10 Modifier and key names:
1878 10.1 SDL Platform
1880 10.1.1 Modifier names
1882 Following modifier names are known:
1884 • ctrl, lctrl, rctrl: Control keys
1886 • alt, lalt, ralt: ALT keys.
1888 • shift, lshift, rshift: Shift keys.
1890 • meta, lmeta, rmeta: Meta keys.
1892 • num, caps: Numlock/Capslock (these are sticky!)
1894 • mode: Mode select.
1896 10.1.2 Key names
1898 Following key names are known:
1900 • backspace, tab, clear, return, pause, escape, space, exclaim, 
1901   quotedbl, hash, dollar, ampersand, quote, leftparen, 
1902   rightparen, asterisk, plus, comma, minus, period, slash, 0, 1, 
1903   2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals, 
1904   greater, question, at, leftbracket, backslash, rightbracket, 
1905   caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, 
1906   l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, 
1907   world_1, world_2, world_3, world_4, world_5, world_6, world_7, 
1908   world_8, world_9, world_10, world_11, world_12, world_13, 
1909   world_14, world_15, world_16, world_17, world_18, world_19, 
1910   world_20, world_21, world_22, world_23, world_24, world_25, 
1911   world_26, world_27, world_28, world_29, world_30, world_31, 
1912   world_32, world_33, world_34, world_35, world_36, world_37, 
1913   world_38, world_39, world_40, world_41, world_42, world_43, 
1914   world_44, world_45, world_46, world_47, world_48, world_49, 
1915   world_50, world_51, world_52, world_53, world_54, world_55, 
1916   world_56, world_57, world_58, world_59, world_60, world_61, 
1917   world_62, world_63, world_64, world_65, world_66, world_67, 
1918   world_68, world_69, world_70, world_71, world_72, world_73, 
1919   world_74, world_75, world_76, world_77, world_78, world_79, 
1920   world_80, world_81, world_82, world_83, world_84, world_85, 
1921   world_86, world_87, world_88, world_89, world_90, world_91, 
1922   world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, 
1923   kp4, kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, 
1924   kp_multiply, kp_minus, kp_plus, kp_enter, kp_equals, up, down, 
1925   right, left, insert, home, end, pageup, pagedown, f1, f2, f3, 
1926   f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, numlock, 
1927   capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt, lalt, 
1928   rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, 
1929   sysreq, break, menu, power, euro, undo
1931 • Names of form 'key<n>' where <n> is 0-255 are interpretted as 
1932   key having hardware-dependent scan code of <n> (useful to bind 
1933   those keys that don't have symbolic names).
1935 10.1.3 Joystick pseudo-keys:
1937 • joystick<num>button<button>: Joystick <num> (0-based) button 
1938   <button> (0-based).
1940 • joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> 
1941   (0-based) up.
1943 • joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> 
1944   (0-based) left.
1946 • joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> 
1947   (0-based) down.
1949 • joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> 
1950   (0-based) right.
1952 • joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> 
1953   negative position (axis modes axis and axis_inverse).
1955 • joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> 
1956   positive position (axis modes axis and axis_inverse).
1958 • joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> 
1959   pressure (axis modes pressure_*).
1961 10.1.4 Special buttons:
1963 • Escape: Enter/Exit Command mode, cancel modal dialogs.
1965 • Return (also KPEnter): Execute command, ok modal dialog.
1967 • Pgup/Up (also KP8/9 if no num lock, CTRL+P; command mode): 
1968   Previous command in command history
1970 • Pgdn/Down(also KP2/3 if no num lock, CTRL+N; command mode): 
1971   Next command in command history
1973 • Home (also KP7 if no num lock, CTRL+A; command mode): Beginning 
1974   of command.
1976 • End (also KP1 if no num lock, CTRL+E; command mode): End of 
1977   command.
1979 • Left (also KP4 if no num lock, CTRL+B; command mode): Move 
1980   cursor left.
1982 • Right (also KP6 if no num lock, CTRL+F; command mode): Move 
1983   cursor right.
1985 • Delete (also KP. if no num lock; command mode): Delete 
1986   character to right of cursor.
1988 • Insert (also KP0 if no num lock; command mode): Toggle between 
1989   insert / overwrite modes.
1991 • Backspace (command mode): Delete character to left of cursor.
1993 • CTRL+LEFT (also ALT+B; command mode): Previous word.
1995 • CTRL+RIGHT (also ALT+F; command mode): Next word.
1997 • ALT+D (also CTRL+W; command mode): Delete word.
1999 • LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump 
2000   corrupted!).
2002 10.2 wxWidgets platform
2004 10.2.1 Modifier names:
2006 Following modifier names are known:
2008 • alt
2010 • ctrl
2012 • shift 
2014 • meta
2016 • cmd (Mac OS X only)
2018 10.2.2 Key names:
2020 Following key names are known:
2022 • back, tab, return, escape, space, exclaim, quotedbl, hash, 
2023   dollar, percent, ampersand, quote, leftparen, rightparen, 
2024   asterisk, plus, comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 
2025   6, 7, 8, 9, colon, semicolon, less, equals, greater, question, 
2026   at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, 
2027   u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret, 
2028   underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, 
2029   n, o, p, q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, 
2030   rightcurly, tilde, delete, start, lbutton, rbutton, cancel, 
2031   mbutton, clear, shift, alt, control, menu, pause, capital, end, 
2032   home, lefT, up, right, down, select, print, execute, snapshot, 
2033   insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, 
2034   numpad5, numpad6, numpad7, numpad8, numpad9, multiply, add, 
2035   separator, subtract, decimal, divide, f1, f2, f3, f4, f5, f6, 
2036   f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, 
2037   f20, f21, f22, f23, f24, numlock, scroll, pageup, pagedown, 
2038   numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2, 
2039   numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, 
2040   numpad_right, numpad_down, numpad_pageup, numpad_pagedown, 
2041   numpad_end, numpad_begin, numpad_insert, numpad_delete, 
2042   numpad_equal, numpad_multiply, numpad_add, numpad_separator, 
2043   numpad_subtract, numpad_decimal, numpad_divide, windows_left, 
2044   windows_right, windows_menu, command, special1, special2, 
2045   special3, special4, special5, special6, special7, special8, 
2046   special9, special10, special11, special12, special13, 
2047   special14, special15, special16, special17, special18, 
2048   special19, special20
2050 11 Movie file format
2052 Movie file is .zip archive in itself, normal ZIP archive tools 
2053 work on it (note: If you recompress it, do not use compression 
2054 methods other than store and deflate and especially do not use 
2055 encryption of any kind).
2057 11.1 Detecting clean start/SRAM/Savestate
2059 • If file has member “savestate” it is savestate, otherwise:
2061 • If file has members with names starting “moviesram.” it is 
2062   movie starting from SRAM, otherwise:
2064 • It is movie starting from clear state.
2066 11.2 Member: gametype
2068 Type of game ROM and region (as one line). Valid values are:
2071 +--------------+---------------------+--------+
2072 |    Value     |       System        | Region |
2073 +--------------+---------------------+--------+
2074 +--------------+---------------------+--------+
2075 |  snes_pal    |     Super NES       |  PAL   |
2076 +--------------+---------------------+--------+
2077 |   sgb_pal    |   Super Game Boy    |  PAL   |
2078 +--------------+---------------------+--------+
2079 |  snes_ntsc   |     Super NES       |  NTSC  |
2080 +--------------+---------------------+--------+
2081 |  sgb_ntsc    |   Super Game Boy    |  NTSC  |
2082 +--------------+---------------------+--------+
2083 |     bsx      | BS-X (non-slotted)  |  NTSC  |
2084 +--------------+---------------------+--------+
2085 | bsxslotted   |   BS-X (slotted)    |  NTSC  |
2086 +--------------+---------------------+--------+
2087 | sufamiturbo  |    Sufami Turbo     |  NTSC  |
2088 +--------------+---------------------+--------+
2091 Frame rates are:
2094 +---------+-----------------+
2095 | Region  | Framerate (fps) |
2096 +---------+-----------------+
2097 +---------+-----------------+
2098 |  PAL    |   322445/6448   |
2099 +---------+-----------------+
2100 |  NTSC   | 10738636/178683 |
2101 +---------+-----------------+
2104 11.3 Member: port1
2106 Contains type of port #1 (as one line). Valid values are 'none', 
2107 'gamepad', 'multitap' and 'mouse'. If not present, defaults to 
2108 'gamepad'.
2110 11.4 Member: port2
2112 Contains type of port #2 (as one line). Valid values are 'none', 
2113 'gamepad', 'multitap', 'mouse', 'superscope', 'justifier' and 
2114 'justifiers'. If not present, defaults to 'none'.
2116 11.5 Member: gamename
2118 Contains name of the game (as one line).
2120 11.6 Member: authors
2122 Contains authors, one per line. Part before '|' is the full name, 
2123 part after is the nickname.
2125 11.7 Member: systemid
2127 Always “lsnes-rr1” (one line). Used to reject other saves.
2129 11.8 Member: controlsversion
2131 Always “0” (one line). Used to identify what controls are there.
2133 11.9 Member: “coreversion”
2135 Contains bsnes core version number (as one line).
2137 11.10 Member: projectid
2139 Contains project ID (as one line). Used to identify if two movies 
2140 are part of the same project.
2142 11.11 Member: {rom,slota,slotb}{,xml}.sha256
2144 Contains SHA-256 of said ROM or ROM mapping file (as one line). 
2145 Absent if corresponding file is absent.
2147 11.12 Member: moviesram.<name>
2149 Raw binary startup SRAM of kind <name>. Only present in 
2150 savestates and movies starting from SRAM.
2152 11.13 Member: saveframe
2154 Contains frame number (as one line) of frame movie was saved on. 
2155 Only present in savestates.
2157 11.14 Member: lagcounter
2159 Current value of lag counter (as one line). Only present in 
2160 savestates.
2162 11.15 Member: pollcounters
2164 Contains poll counters (currently 100 of them), one per line. 
2165 Each line is raw poll count if DRDY is set for it. Otherwise it 
2166 is negative poll count minus one. Only present in savestates.
2168 11.16 Member: hostmemory
2170 Raw binary dump of host memory. Only present in savestates.
2172 11.17 Member: savestate
2174 The raw binary savestate itself. Savestate detection uses this 
2175 file, only present in savestates.
2177 11.18 Member: screenshot
2179 Screenshot of current frame. Only present in savestates. First 2 
2180 bytes are big-endian width of image, rest are 24-bit RGB image 
2181 data. Height of image is inferred from the width and size of 
2182 data.
2184 11.19 Member: sram.<name>
2186 Raw binary SRAM of kind <name> at time of savestate. Only present 
2187 in savestates.
2189 11.20 Member: input
2191 The actual input track, one line per subframe (blank lines are 
2192 skipped).
2194 • If the first byte of each line is '.', ' ', <tab> or '|', then 
2195   the line is part of same frame as previous, otherwise it starts 
2196   a new frame.
2198 • First subframe must start a new frame.
2200 Length of movie in frames is number of lines in input file that 
2201 start a new frame.
2203 11.21 Member: subtitles
2205 Subtitle track. Optional.
2207 • Each line is in form <firstframe> <numframes> <text>.
2209 • Linefeed is encoded as \n, backslash is encoded as \\.
2211 11.22 Member: rerecords
2213 Contains textual base-10 rerecord count (as one line; emulator 
2214 just writes this, it doesn't read it) + 1.
2216 11.23 Member: rrdata
2218 This member stores set of load IDs. There is one load ID per 
2219 rerecord (plus one corresponding to start of project).
2221 • This member constists of concatenation of records
2223 • Each record is 2-36 bytes long and can represent 1-16,843,009 
2224   consequtive IDs.
2226 • IDs are interpretted as 256-bit big-endian integers with 
2227   warparound.
2229 • Initial predicted ID is all zeroes.
2231 Format of each record is:
2233 • 1 byte: Opcode byte. Bits 0-4 are prefix length (prefixlen), 
2234   bits 5-6 are count length (countlen). Bit 7 is unused.
2236 • 32-prefixlen bytes of ID.
2238 • countlen bytes of big-endian count (count).
2240 Records are processed as follows:
2242 • To form the first ID encoded by record, take the first 
2243   prefixlen bytes predicted ID and append the read ID value to 
2244   it. The result is the first ID encoded.
2246 • If countlen is 0, record encodes 1 ID.
2248 • If countlen is 1, record encodes 2+count IDs.
2250 • If countlen is 2, record encodes 258+count IDs.
2252 • If countlen is 3, record encodes 65794+count IDs.
2254 • The new predicted ID is the next ID after last one encoded by 
2255   the record.
2257 The number of rerecords + 1 is equal to the sum of number of IDs 
2258 encoded by all records.
2260 11.24 Member: starttime.second
2262 Movie starting time, second part. Epoch is Unix epoch. Default is 
2263 1,000,000,000.
2265 11.25 Member: starttime.subsecond
2267 Movie starting time, subsecond part. Unit is CPU clocks. Default 
2268 is 0.
2270 11.26 Member: savetime.second
2272 Movie saving time, second part. Default is starttime.second. Only 
2273 present in savestates.
2275 11.27 Member: savetime.subsecond
2277 Movie saving time, subsecond part. Default is 
2278 starttime.subsecond. Only present in savestates.
2280 12 Known ROM extensions
2282 • SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, 
2283   dx2, mgd, mgh.
2285 • DMG cartridge ROMs: dmg, gb.
2287 • GBC cartridge ROMs: cgb, gbc.
2289 13 Gamepack files
2291 • The first line must be: “[GAMEPACK FILE]”.
2293 • There is one needed line: “type <systype>”. This sets system 
2294   type to <systype>. The following system types are valid:
2296   – snes (SNES)
2298   – bsx (BS-X non-slotted)
2300   – bsxslotted (BS-X slotted)
2302   – sufamiturbo (Sufami Turbo)
2304   – sgb (Super Game Boy)
2306   – dmg (Game Boy)
2308   – gbc (Game Boy Color)
2310   – gbc_gba (Game Boy Color with GBA initial register values)
2312 • Optionally a region can be specified: “region <region>”. The 
2313   following values are valid:
2315   – autodetect (Autodetect region: snes and sgb only)
2317   – ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2319   – pal (PAL: snes, sgb)
2321   – world (World: dmg, gbc, gbc_gba)
2323 • ROM images are loaded as: “rom <type> <file>”. The following 
2324   types are valid:
2326   – rom (Cartridge ROM in snes, dmg, gbc, gbc_gba. BIOS in bsx, 
2327     bsxslotted, sufamiturbo)
2329   – bsx (Cartridge ROM in bsx, bsxslotted)
2331   – slot-a (Cartridge ROM in sufamiturbo)
2333   – slot-b (Cartridge ROM in sufamiturbo)
2335 • ROM markup can be loaded as: “xml <type> <file>”. The types 
2336   valid are the same as for ROMs.
2338 • Patches can be loaded as “patch[<offset>] <type> <file>”. The 
2339   types are the same as for ROMs.
2341   – Offset is given in form [+-]<number>. Usually offset is 
2342     either +0 or -512.
2344   – Default offset is +0.
2346 13.1 Example:
2348 [GAMEPACK FILE]
2350 type snes
2352 rom rom speedygonzales.sfc
2354 patch-512 rom sonicthehedgehog.ips
2356 13.2 Example 2:
2358 [GAMEPACK FILE]
2360 type sgb
2362 rom rom supergameboy.sfc
2364 rom dmg megamanV.dmg
2366 14 Quick'n'dirty encode guide
2368 1. Start the emulator and load the ROM and movie file.
2370 2. Set large AVI option 'set-setting avi-large on'
2372 3. Enable dumping 'dump-avi tmpdump' 
2374 4. Unpause and let it run until you want to end dumping.
2376 5. Close the emulator (closing the window is the easiest way). Or 
2377   use 'end-avi'.
2379 6. For each tmpdump*.avi file created, on command prompt, do 
2380   'x264 --crf 10 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2382 7. Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2384 8. Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + 
2385   tmpdump_0000001.mkv + tmpdump_0000002.mkv' (list every 
2386   tmpdump_<numbers>.mkv, with + in between).
2388 9. Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'. Now 
2389   final.mkv contains quick'n'dirty encode.
2391 15 Axis configurations for some gamepad types:
2393 15.1 XBox360 controller:
2395 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be 
2396 set to pressure-+.
2398 set-axis joystick0axis2 pressure-+
2400 set-axis joystick0axis5 pressure-+
2402 • This is needed for SDL only. EVDEV sets those types correctly.
2404 15.2 PS3 “sixaxis” controller:
2406 Axes 8-19 should be disabled.
2408 set-axis joystick0axis8 disabled
2410 set-axis joystick0axis9 disabled
2412 set-axis joystick0axis10 disabled
2414 set-axis joystick0axis11 disabled
2416 set-axis joystick0axis12 disabled
2418 set-axis joystick0axis13 disabled
2420 set-axis joystick0axis14 disabled
2422 set-axis joystick0axis15 disabled
2424 set-axis joystick0axis16 disabled
2426 set-axis joystick0axis17 disabled
2428 set-axis joystick0axis18 disabled
2430 set-axis joystick0axis19 disabled
2432 16 Errata:
2434 16.1 Problems from BSNES core:
2436 • The whole pending save stuff.
2438 • Lack of layer hiding.
2440 • It is slow (especially accuracy).
2442 • Firmwares can't be loaded from ZIP archives.
2444 16.2 Other problems:
2446 • Modifiers don't work with pseudo-keys (SDL, EVDEV).
2448 • Audio for last dumped frame is not itself dumped.
2450 • Audio in UI is pretty bad in quality if game doesn't run at 
2451   full speed.
2453 • No menus, command based interface (SDL).
2455 • Long commands don't scroll.
2457 17 Changelog:
2459 17.1 rr0-beta1
2461 • Fix -Wall warnings
2463 • Fix dumper video corruption with levels 10-18.
2465 17.2 rr0-beta2
2467 • Autofire
2469 • Lots of code cleanups
2471 • Lua interface to settings
2473 • Allow specifying AVI borders without Lua
2475 • Fix scaling if vscale > 1 and originx > 0 (left border exists)
2477 • on_snoop lua callback
2479 • Faster movie loading and saving.
2481 17.3 rr0-beta3
2483 • Joystick support
2485 17.4 rr0-beta4
2487 • Fix multi-buttons
2489 • Save jukebox functionality.
2491 17.5 rr0-beta5
2493 • Try to fix some nasty failing movie load edge cases
2495 • Allow specifying scripts to run on command line.
2497 17.6 rr0-beta6
2499 • Major source code reorganization.
2501 • Backup savestates before overwriting.
2503 • Don't crash if loading initial state fails.
2505 17.7 rr0-beta7
2507 • Fix firmware lookup
2509 • Fix author name parsing
2511 • Fix rerecord counting
2513 • (SDL) Print messages to console if SDL is uninitialized
2515 • Add movieinfo program
2517 • Fix loading movies starting from SRAM.
2519 17.8 rr0-beta8
2521 • Add support for unattended dumping
2523 • Fix compiling for Win32
2525 • Don't lock up if sound can't be initialized
2527 • Strip trailing CR from commands
2529 • Don't try to do dubious things in global ctors (fix crash on 
2530   startup)
2532 17.9 rr0-beta9
2534 • Small documentation tweaking
2536 • Fix make clean
2538 • Fix major bug in modifier matching
2540 17.10 rr0-beta10
2542 • Lots of documentation fixes
2544 • Use dedicated callbacks for event backcomm., not commands.
2546 • Ensure that the watchdog is not hit when executing delayed 
2547   reset.
2549 • Remove errant tab from joystick message.
2551 17.11 rr0-beta11
2553 • Make autofire operate in absolute time, not linear time
2555 • Reinitialize controls when resuming from loadstate
2557 • Some more code cleanups
2559 • If Lua allocator fails, call OOM_panic()
2561 • Byte/word/dword/qword sized host memory write/read functions.
2563 • Dump at correct framerate if dumping interlaced NTSC 
2564   (height=448).
2566 17.12 rr0-beta12
2568 • Actually include the complete source code
2570 • Keep track of RTC
2572 17.13 rr0-beta13
2574 • Document {save,start}time.{,sub}second.
2576 • Intercept time() from bsnes core.
2578 17.14 rr0-beta14
2580 • Allow disabling time() interception (allow build on Mac OS X)
2582 • Use SDLMain on Mac OS X (make SDL not crash)
2584 • Disable delayed resets (just plain too buggy for now).
2586 • Code cleanups
2588 • Use 16-bit for graphics/video instead of 32-bit.
2590 • gui.rectangle/gui.pixel
2592 • gui.crosshair
2594 • New CSCD writer implementation.
2596 17.15 rr0-beta15
2598 • Fix interaction of * and +.
2600 • Manual improvements
2602 • Use gettimeofday()/usleep(), these seem portable enough.
2604 • Move joystick axis manipulation to keymapper code.
2606 • Changes to how read-only works.
2608 • Refactor controller input code.
2610 17.16 rr0-beta16
2612 • Fix mouseclick scale compensation.
2614 • Draw area boundaries correctly in SDL code.
2616 • gui.screenshot.
2618 • Fix CSCD output (buffer overrun and race condition).
2620 17.17 rr0-beta17
2622 • JMD dumping support.
2624 • Allow unattended dumping to JMD.
2626 • Move to BSNES v083.
2628 • Switch back to 32-bit colors.
2630 • Add Lua function gui.color.
2632 • Use some new C++11 features in GCC 4.6.
2634 • Be prepared for core frequency changes.
2636 • Pass colors in one chunk from Lua.
2638 17.18 rr0-beta18
2640 • New lua functions gui.line(), gui.status() and gui.circle(), 
2641   memory.vma_count(), memory.read_vma() and memory.find_vma().
2643 • Numerious documentation fixups
2645 • RTC time format changed
2647 • Reformat flags display
2649 • Allow lua package name to be overridden
2651 • SDUMP (high-quality dumping).
2653 • Split platform support to plugins.
2655 • Make all sound plugins support basic sound commands
2657 • Support portaudio for sound.
2659 • Allow disable Lua/SDL searching.
2661 • Upconvert colors when copying lcscreen to screen.
2663 • Reorganize source tree.
2665 • Evdev joystick support.
2667 • Refactor more code into generic window code.
2669 17.19 rr0-beta19
2671 • Refactor message handling.
2673 • Rework makefile
2675 • Documentation fixes
2677 • Finish pending saves before load/quit.
2679 • Wxwidgets graphics plugin.
2681 17.20 rr0-beta20
2683 • Get rid of win32-crap.[ch]pp.
2685 • Move files around a lot.
2687 • Get rid of need for host C++ compiler.
2689 • Bsnes v084 core.
2691 • Refactor inter-component communication.
2693 • Fix zero luma.
2695 • Fix crash on multiline aliases.
2697 • Load/Save settings in wxwidgets gui.
2699 17.21 rr0-beta21
2701 • Patch problems in bsnes core
2703 • SNES is little-endian, not big-endian!
2705 • Fix memory corruption in lcscreen::load()
2707 17.22 rr0-beta22
2709 • Fix interpretting repeat counts in rrdata loading.
2711 • New lua callback: on_frame()
2713 • Remove calls to runtosave() that aren't supposed to be there
2715 • Lua function: movie.read_rtc()
2717 • Ignore src/fonts/font.cpp
2719 • Fix more bsnes core problems
2721 • Control bsnes random seeding
2723 • Pause-on-end
2725 • Some bsnes core debugging features (state dump and state hash)
2727 • Fix titlebar version number (no, the last version wasn't 
2728   'lsnes-0-beta21', it was 'lsnes rr0-beta21').
2730 17.23 rr0-beta23
2732 • Fix memory corruption due to macro/field mixup
2734 • search-memory update
2736 • Allow direct-mapped framebuffer
2738 • SDL: Use SDL_ANYFORMAT if possible
2740 • SDMP2SOX: 2s delay modes.
2742 • Wxwidgets: Cleanups
2744 • Use sed -E, not sed -r. Fixes building on Mac OS X.
2746 • Wxwidgets: Save jukebox on exit
2748 • Fix RTC if using load-movie on savestate.
2750 • Fix crash related to full console mode.
2752 17.24 rr0-beta24
2754 • Wxwidgets: Allow bringing application to foreground on Mac OS 
2755   X.
2757 • Wxwidgets: Allow compiling on Mac OS X.
2759 • Use movie compare instead of movie hashing (faster save/load).
2761 • Lua: _SYSTEM table.
2763 17.25 rr0-beta25
2765 • sdmp2sox: Pad soundtrack if using -l or -L.
2767 • sdmp2sox: Fix NTSC overscan.
2769 • sdmp2sox: Add AR correction mode.
2771 • call lua_close() when exiting.
2773 • Fix zip_writer bug causing warnings from info-zip and error 
2774   from advzip.
2776 17.26 rr0-beta26
2778 • Fix IPS patching code (use bsnes core IPS patcher).
2780 • Implement BPS patching (using bsnes core IPS patcher).
2782 • Add feature to load headered ROMs.
2784 17.27 rr0-beta27
2786 • Show command names when showing keybindings
2788 17.28 rr0
2790 • Fix pause-on-end to be actually controllable
2792 • SDL: Poll all events in queue, not just first one (fixes 
2793   slowness in command typing)
2795 • Wxwidgets: Fix ROM loading.
2797 17.29 rr1-beta0
2799 • Lua: Add gui.textH, gui.textV, gui.textHV
2801 • Fix text colors on SDL on Mac OS X
2803 • Mode 'F' for finished in readonly mode.
2805 • Fix some WS errors.
2807 • Reliably pause after skip poll
2809 • Split UI and core into their own threads
2811 17.30 rr1-beta1
2813 • Remove leftover dummy SRAM slot
2815 • Fix controller numbers.
2817 17.31 rr1-beta2
2819 • Fix lsnes-dumpavi after interface change.
2821 • Also give BSNES patches for v085.
2823 • Pack movie data in memory.
2825 17.32 rr1-beta3
2827 • Fix framecount/length given when loading movies.
2829 • Controller command memory leak fixes.
2831 • Don't leak palette if freeing screen object.
2833 17.33 rr1-beta4
2835 • Detect revisions.
2837 • Wxwidgets: Allow controlling dumper from the menu.
2839 17.34 rr1-beta5
2841 • Rewrite parts of manual
2843 • Lua: Make it work with Lua 5.2.
2845 17.35 rr1-beta6
2847 • Win32: Fix compile errors.
2849 17.36 rr1-beta7
2851 • Refactor controller input code.
2853 • Fix crash when using command line on SDL / Mac OS X.
2855 17.37 rr1-beta8
2857 • Delete core/coroutine (obsolete)
2859 • Lag input display by one frame.
2861 • Rewind movie to beginning function.
2863 • Fix wrong frame number reported to Lua when repainting after 
2864   loadstate
2866 • Support UI editing of jukebox
2868 • Wxwidgets: Save settings on exit.
2870 • Support ${project} for filenames
2872 • SDL: Fix command history
2874 17.38 rr1-beta9
2876 • Fix some order-of-global-ctor bugs.
2878 17.39 rr1-beta10
2880 • Fix crashes when quitting on Win32.
2882 17.40 rr1-beta11
2884 • EVDEV: Queue keypresses from joystick, don't send directly
2886 • Wxwidgets: Load-Preserve that actually works.
2888 17.41 rr1-beta12
2890 • Wxwidgets: GUI for memory search.
2892 • Warn about using synchronous queue in UI callback.
2894 17.42 rr1-beta13
2896 • Remember last saved file for each ROM
2898 • Support MT dumping via boost.
2900 • Lua: input.raw
2902 • Lua: input.keyhook
2904 • Make mouse be ordinary input instead of special-casing
2906 • SDL: Don't screw up commands with NUL codepoints.
2908 17.43 rr1-beta14
2910 • Merge status panel and main window
2912 • True movie slot support (the rest of it)
2914 • SDL: Fix compilation error
2916 • Elminate cross calls in dump menu code.
2918 17.44 rr1-beta15
2920 • Cancel pending saves command
2922 • Wxwidgets: Code refactoring
2924 • Wxwidgets: Fix system -> reset
2926 • Wxwidgets: Read watch expressions in the right thread
2928 17.45 rr1-beta16
2930 • Wxwidgets: Don't prompt for member when running Lua script (Lua 
2931   doesn't support that).
2933 • Wxwidgets: 128 -> 1024 Autohold slots (in case more are 
2934   needed).
2936 • Don't append trailing '-' to prefix when saving movie.
2938 • Fix ROM/savestate handling (don't let user mismatch ROM and 
2939   savestates).
2941 17.46 rr1
2943 • Document memory watch syntax.
2945 17.47 rr1-delta1
2947 • Fix unattended dumping (lsnes-dumpavi)
2949 • Support RAW dumping
2951 • Use adv_dumper instead of the old interface in lsnes-dumpavi 
2952   (changes syntax)
2954 • Add option to control sample rate preturbation in AVI dumper
2956 17.48 rr1-delta2
2958 • Wxwidgets: Fix dumper submodes
2960 • Set core controller types before loadstate
2962 17.49 rr1-delta2epsilon1
2964 • Fix compiling with bsnes v086.
2966 17.50 rr1-delta3
2968 • Don't prompt before quitting
2970 • Start unpaused, preserve pause/unpause over load.
2972 • Try to autodetect if ROM is headered.
2974 • Wxwidgets: Only bring up ROM patching screen if specifically 
2975   requested.
2977 • Allow configuring some hotkeys.
2979 17.51 rr1-delta4
2981 • Lots of code cleanups
2983 • Fix JMD compression (JMD dumping was broken)
2985 • Don't crash if Lua C function throws an exception.
2987 • Support bitmap drawing in Lua.
2989 • Fix bsnes v085/v086 patches.
2991 • Improve stability on win32.
2993 17.52 rr1-delta4epsilon1
2995 • Don't corrupt movie if movie length is integer multiple of 
2996   frames per page.
2998 17.53 rr1-delta5
3000 • New Lua hooks: on_rewind, on_frame_emulated, on_idle, on_timer
3002 • New Lua functions: emulator_ready(), utime(), 
3003   set_idle_timeout(), set_timer_timeout(), bit.extract(), 
3004   bit.value(), input.geta(), input.seta() and 
3005   input.controllertype()
3007 • Wxwidgets: Fix internal focus lost (hotkeys stop working)
3009 • Wxwidgets: Fix broken modifiers
3011 • on_paint has parameter now.
3013 • Optional initital fill for bitmaps
3015 • Fix palette changing.
3017 • Optimize rendering a bit.
3019 • Bsnes v087 support.
3021 17.54 rr1-delta5epsilon1
3023 • Movieinfo: Fix display of port #2 type.
3025 • Call on_input() after loadstate.
3027 17.55 rr1-delta5epsilon2
3029 • Fix writing port2 data to movie.
3031 • Fix SRAM handling with Bsnes v087.
3033 17.56 rr1-delta6
3035 • Library loading support
3037 • Built-in TSCC encoder
3039 • Hi-color (256T colors) dumping.
3041 • Dump over TCP/IP(v6)
3043 • Hidable status panel
3045 • Turbo toggle/hold
3047 • Adjustable sound volume
3049 • Screen scaling
3051 • Allow DnD into filename boxes
3053 • Configurable paths
3055 • Portaudio: Fix speaker popping at start
3057 • Lots of UI changes
3059 • Speed adjustment menu
3061 • Win32 joystick support
3063 • Lua: gui.rainbow and gui.box
3065 • Split key lists into classes (the key list was large!)
3067 • More save slots support
3069 • Wxwidgets (wxJoystick) joystick support
3071 17.57 rr1-delta7
3073 • Lots of internal joystick refactoring
3075 • Evdev: Add mapping for BTN_TOOL_QUINTTAP
3077 • Wxwidgets: Settings mode (open settings without ROM)
3079 • Wxwidgets: Prompt key to use option
3081 • Wxwidgets: Fix crash if key goes away underneath
3083 • Wxwidgets: Fix mouse position in presence of scaling
3085 • AVI dumper: Mode 4 (high-quality resampling to common rate 
3086   using SRC)
3088 • Wxwidgets: Redesign hotkeys dialog to avoid tree control (tree 
3089   control doesn't seem to work well on WinXP)
3091 • Start paused option.
3093 17.58 rr1-delta7epsilon1
3095 • AVI: ZMBV support
3097 • lsnes-dumpavi: Start Lua before starting dumper
3099 • AVI: Fix secondary audio in mode 4.
3101 17.59 rr1-delta7epsilon2
3103 • AVI: Refactor ZMBV a bit.
3105 • Fix error reading analog values from movie file
3107 17.60 rr1-delta8
3109 • Delayed reset support
3111 • Lua: memory.hash_region
3113 17.61 rr1-delta8epsilon1
3115 • Rework the build system
3117 • Typing input support
3119 • Fix building with bsnes v086 and v087.
3121 • SDL: Save settings on exit
3123 • SDL: Command to enter command line mode with given command.
3125 • SDL: More advanced command editing.
3127 17.62 rr1-delta9
3129 • wxMSW: Fix the “arrow keys and enter don't work” problem
3131 • MSU-1 support
3133 • Show mode changes due to rewinding.
3135 • Unsafe rewind support
3137 • Fix directory transversal.
3139 17.63 rr1-delta10
3141 • AVI: Sound mode 5 (48kHz high-quality)
3143 • Lua: Reset Lua VM
3145 • Map the SNES bus into address space
3147 • Fix loading memory watch files with CRLF line endings
3149 17.64 rr1-delta10epsilon1
3151 • Map bsnes internal state into memory space
3153 • Fix the “click on panel wedges the emulator” for real.
3155 • DnD movies/saves on the main window.
3157 17.65 rr1-delta11
3159 • Split core bindings into own module.
3161 • Remember invalid settings
3163 • Support for modified Gambatte core for GB/GBC emulation.
3165 • Reload/swap ROM function
3167 17.66 rr1-delta11epsilon1
3169 • Fix step poll function
3171 17.67 rr1-delta12
3173 • Non-insane savestate anchoring
3175 17.68 rr1-delta13
3177 • More Memory search methods
3179 • Preserve movie if loading in RO mode.
3181 • Fix a obscure case in timeline check
3183 • Revamp the entiere ROM loading code
3185 • Support DnD on ROMs
3187 • Revamp menu layout
3189 • Standalone hotkey config dialog
3191 • Show bindings in more user-friendly format
3193 17.69 rr1-delta13epsilon1
3195 • Pipedec support
3197 • Fix uninitialized variables in bsnes v085
3199 17.70 rr1-delta14
3201 • Merge gambatte core into mainline (from its own branch)
3203 • Wxwidgets: Show expected dump file formats
3205 • Memory watch: Data typing
3207 • lsnes internal MMIO area.
3209 • Wxwidgets: New memory watch editor
3211 • Hexadecimal memory watches
3213 • Wxwidgets: Monospaced panel
3215 • Wxwidgets: Split memory watches in panel
3217 • Wxwidgets: Disable VMAs in memory search
3219 • lsnes-dumpavi: Fix speed bug
3221 • Movie subtitle support
3223 • Fix rerecord count reporting
3225 • Don't trash movie when loading in readonly mode.