1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
6 \use_default_options true
7 \maintain_unincluded_children false
9 \language_package default
14 \font_typewriter default
15 \font_default_family default
16 \use_non_tex_fonts false
23 \default_output_format default
25 \bibtex_command default
26 \index_command default
27 \paperfontsize default
38 \paperorientation portrait
47 \paragraph_separation indent
48 \paragraph_indentation default
49 \quotes_language english
52 \paperpagestyle default
53 \tracking_changes false
66 \begin_layout Standard
67 lsnes is SNES rerecording emulator based on bsnes core.
75 Syntax: lsnes.exe <rom-options> <misc-options> (<new-session-options>|<filename>)
79 Syntax: lsnes-avidump <dump-options> <misc-options> <rom-options> <filename>
83 Syntax: movieinfo.exe <filename>
86 \begin_layout Subsection
90 \begin_layout Standard
91 These options control loading the ROM.
94 \begin_layout Subsubsection
98 \begin_layout Standard
99 Load <file> (SFC file format) as main SNES cartridge ROM.
100 This is the game ROM for SNES and cartridge BIOS for other types.
104 \begin_layout Subsubsection
108 \begin_layout Standard
109 Set the mapping XML file for main cartridge ROM.
110 If not specified, defaults are used.
113 \begin_layout Subsubsection
117 \begin_layout Standard
118 Load <file> (BS file format) as BS-X non-slotted flash memory.
119 Also sets system type to BS-X non-slotted (not compatible with --bsxslotted=<fi
120 le>, --dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
123 \begin_layout Subsubsection
127 \begin_layout Standard
128 Set mapping XML file for BS-X non-slotted flash memory.
129 If not specified, defaults are used.
130 Only can be used together with --bsx=<file>.
133 \begin_layout Subsubsection
137 \begin_layout Standard
138 Load <file> (BS file format) as BS-X slotted flash memory.
139 Also sets system type to BS-X slotted (not compatible with --bsx=<file>,
140 --dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
143 \begin_layout Subsubsection
144 --bsxslotted-xml=<file>
147 \begin_layout Standard
148 Set mapping XML file for BS-X slotted flash memory.
149 If not specified, defaults are used.
150 Only can be used together with --bsxslotted=<file>.
153 \begin_layout Subsubsection
157 \begin_layout Standard
158 Load <file> (GB file format) as Game Boy ROM.
159 Also sets system type to SGB (not compatible with --bsx=<file>, --bsxslotted=<f
160 ile>, --slot-a=<file> nor --slot-b=<file>).
163 \begin_layout Subsubsection
167 \begin_layout Standard
168 Set mapping XML file for Game Boy ROM.
169 If not specified, defaults are used.
170 Only can be used together with --dmg=<file>.
173 \begin_layout Subsubsection
177 \begin_layout Standard
178 Load <file> (ST file format) as Sufami turbo cartridge A ROM.
179 Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
180 --bsxslotted=<file> nor --dmg=<file>).
183 \begin_layout Subsubsection
187 \begin_layout Standard
188 Set mapping XML file for Sufami turbo cartridge A ROM.
189 If not specified, defaults are used.
190 Only can be used together with --slot-a=<file>.
193 \begin_layout Subsubsection
197 \begin_layout Standard
198 Load <file> (ST file format) as Sufami turbo cartridge B ROM.
199 Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
200 --bsxslotted=<file> nor --dmg=<file>).
203 \begin_layout Subsubsection
207 \begin_layout Standard
208 Set mapping XML file for Sufami turbo cartridge B ROM.
209 If not specified, defaults are used.
210 Only can be used together with --slot-b=<file>.
213 \begin_layout Subsubsection
217 \begin_layout Standard
218 Apply IPS patch <file> to main cartridge ROM.
219 Requires --rom=<file>.
222 \begin_layout Subsubsection
226 \begin_layout Standard
227 Apply IPS patch <file> to main cartridge ROM mapping XML.
228 Requires --rom-xml=<file>.
231 \begin_layout Subsubsection
235 \begin_layout Standard
236 Apply IPS patch <file> to BS-X non-slotted flash.
237 Requires --bsx=<file>.
240 \begin_layout Subsubsection
244 \begin_layout Standard
245 Apply IPS patch <file> to BS-X non-slotted flash mapping XML.
246 Requires --bsx-xml=<file>.
249 \begin_layout Subsubsection
250 --ips-bsxslotted=<file>
253 \begin_layout Standard
254 Apply IPS patch <file> to BS-X slotted flash.
255 Requires --bsxslotted=<file>.
258 \begin_layout Subsubsection
259 --ips-bsxslotted-xml=<file>
262 \begin_layout Standard
263 Apply IPS patch <file> to BS-X slotted flash mapping XML.
264 Requires --bsxslotted-xml=<file>.
267 \begin_layout Subsubsection
271 \begin_layout Standard
272 Apply IPS patch <file> to Game Boy ROM.
273 Requires --dmg=<file>.
276 \begin_layout Subsubsection
280 \begin_layout Standard
281 Apply IPS patch <file> to Game Boy ROM mapping XML.
282 Requires --dmg-xml=<file>.
285 \begin_layout Subsubsection
289 \begin_layout Standard
290 Apply IPS patch <file> to Sufami turbo cartridge A ROM.
291 Requires --slot-a=<file>.
294 \begin_layout Subsubsection
295 --ips-slot-a-xml=<file>
298 \begin_layout Standard
299 Apply IPS patch <file> to Sufami turbo cartridge A ROM mapping XML.
300 Requires --slot-a-xml=<file>.
303 \begin_layout Subsubsection
307 \begin_layout Standard
308 Apply IPS patch <file> to Sufami turbo cartridge B ROM.
309 Requires --slot-b=<file>.
312 \begin_layout Subsubsection
313 --ips-slot-b-xml=<file>
316 \begin_layout Standard
317 Apply IPS patch <file> to Sufami turbo cartridge B ROM mapping XML.
318 Requires --slot-b-xml=<file>.
321 \begin_layout Subsubsection
322 --ips-offset=<offset>
325 \begin_layout Standard
326 Set IPS apply offset to <offset> (can be negative).
327 IPS apply offset is added to all addresses inside IPS file before applying.
328 If the resulting address is negative, write is ignored (with a warning).
329 If resulting address exceeds ROM size, the ROM is extended.
332 \begin_layout Subsubsection
336 \begin_layout Standard
337 Force ROM to be considered PAL-only (warning: Will cause error if used on
338 anything except SNES and SGB).
341 \begin_layout Subsubsection
345 \begin_layout Standard
346 Force ROM to be considered NTSC-only (default for everything except SNES
350 \begin_layout Subsection
351 New session options (lsnes.exe only)
354 \begin_layout Standard
355 If filename is not specified, new session is started.
356 These options control the properties of new session:
359 \begin_layout Subsubsection
363 \begin_layout Standard
368 \begin_layout Itemize
369 none: No device connected
372 \begin_layout Itemize
373 gamepad: One gamepad (the default)
376 \begin_layout Itemize
377 multitap: Four gamepads (warning: makes most games refuse to start)
380 \begin_layout Itemize
384 \begin_layout Subsubsection
388 \begin_layout Standard
393 \begin_layout Itemize
394 none: No device connected (the default)
397 \begin_layout Itemize
401 \begin_layout Itemize
402 multitap: Four gamepads.
405 \begin_layout Itemize
409 \begin_layout Itemize
410 superscope: Super Scope
413 \begin_layout Itemize
414 justifier: One justifier
417 \begin_layout Itemize
418 justifiers: Two justifiers
421 \begin_layout Subsubsection
425 \begin_layout Standard
426 Set the name of game to <name>
429 \begin_layout Subsubsection
433 \begin_layout Standard
434 Add author with full name of <name> (no nickname).
437 \begin_layout Subsubsection
441 \begin_layout Standard
442 Add author with nickname of <name> (no full name).
445 \begin_layout Subsubsection
446 --author=<fullname>|<nickname>
449 \begin_layout Standard
450 Add author with full name of <fullname> and nickname of <nickname>.
453 \begin_layout Subsubsection
457 \begin_layout Standard
458 Set RTC second (0 is 1st January 1970 00:00:00Z).
461 \begin_layout Subsubsection
462 --rtc-subsecond=<value>
465 \begin_layout Standard
467 Range is 0-3,462,619,485,019.
470 \begin_layout Subsection
474 \begin_layout Standard
475 If filename is specified on command line, it is loaded as initial state
476 (instead of constructing one).
477 Mandatory for lsnes-avidump.exe and movieinfo.exe.
480 \begin_layout Subsection
485 \begin_layout Subsubsection
486 --run=<file> (lsnes.exe only)
489 \begin_layout Standard
490 After running main RC file, run this file.
491 If multiple are specified, these execute in order specified.
494 \begin_layout Subsection
495 dump options (lsnes-avidump.exe only)
498 \begin_layout Subsubsection
502 \begin_layout Standard
505 \begin_inset Quotes eld
509 \begin_inset Quotes erd
515 \begin_layout Subsubsection
519 \begin_layout Standard
520 Set compression level (0-18).
524 \begin_layout Subsubsection
528 \begin_layout Standard
529 Set number of frames to dump.
533 \begin_layout Subsubsection
537 \begin_layout Standard
538 Run specified lua script (lsnes-avidump.exe does not have initialization
542 \begin_layout Section
543 Startup file lsnes.rc
546 \begin_layout Standard
547 Upon startup, lsnes (lsnes.exe only) executes file lsnes.rc as commands.
548 This file is located in:
551 \begin_layout Itemize
556 lsnes.rc (if %APPDATA% exists)
559 \begin_layout Itemize
560 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
563 \begin_layout Itemize
564 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
567 \begin_layout Itemize
568 All: ./lsnes.rc (fallback default).
571 \begin_layout Standard
572 If leading directories do not exist, attempt to create them is made.
575 \begin_layout Section
576 Game internal commands
579 \begin_layout Itemize
580 Commands beginning with '*' invoke the corresponding command without alias
584 \begin_layout Itemize
585 If command starts with '+' (after possible '*'), the command is executed
586 as-is when button is pressed, and when button is released, it is executed
587 with '+' replaced by '-'.
590 \begin_layout Subsection
594 \begin_layout Standard
595 Settings control various aspects of emulator behaviour.
598 \begin_layout Subsubsection
599 set-setting <setting> <value>
602 \begin_layout Standard
603 Sets setting <setting> to value <value> (may be empty).
606 \begin_layout Subsubsection
607 unset-setting <setting>
610 \begin_layout Standard
611 Try to unset setting <setting> (not all settings can be unset).
614 \begin_layout Subsubsection
615 get-setting <setting>
618 \begin_layout Standard
619 Read value of setting <setting>
622 \begin_layout Subsubsection
626 \begin_layout Standard
627 Print names and values of all settings.
630 \begin_layout Subsection
634 \begin_layout Standard
635 Keybindings bind commands or aliases to keys (or pseudo-keys).
639 \begin_layout Standard
643 \begin_layout Itemize
644 Do not bind edge active (+/-) commands to keys with modifiers, that won't
648 \begin_layout Itemize
649 Names of keys and modifiers are platform-dependent.
652 \begin_layout Itemize
653 Be careful before binding pseudo-keys (such as joystick axes, buttons or
654 hats) with modifiers.
655 That may or may not work right.
658 \begin_layout Subsubsection
659 bind-key [<mod>/<modmask>] <key> <command>
662 \begin_layout Standard
663 Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
664 ed list) are set as <mod> (comma-seperated list).
667 \begin_layout Standard
668 The names of keys and modifiers are platform-dependent.
671 \begin_layout Subsubsection
672 unbind-key [<mod>/<modmask>] <key>
675 \begin_layout Standard
676 Unbind command from <key> (with specified <mod> and <modmask>).
679 \begin_layout Subsection
680 set-axis <axis> [disabled | axis | axis-inverse | pressure0- | pressure0+
681 | pressure-0 | pressure-+ | pressure+0 | pressure+-] [minus=<val>] [zero=<val>]
682 [plus=<val>] [tolerance=<val>]
685 \begin_layout Standard
686 Set axis parameters for axis <axis>.
689 \begin_layout Itemize
690 disabled: Disable axis
693 \begin_layout Itemize
697 \begin_layout Itemize
698 axis-inverse: Inverse axis
701 \begin_layout Itemize
702 pressure0-: Pressure sensitive.
703 Released at 0, pressed at -.
706 \begin_layout Itemize
707 pressure0+: Pressure sensitive.
708 Released at 0, pressed at +.
711 \begin_layout Itemize
712 pressure-0: Pressure sensitive.
713 Released at -, pressed at 0.
716 \begin_layout Itemize
717 pressure-+: Pressure sensitive.
718 Released at -, pressed at +.
721 \begin_layout Itemize
722 pressure+0: Pressure sensitive.
723 Released at +, pressed at 0.
726 \begin_layout Itemize
727 pressure+-: Pressure sensitive.
728 Released at +, pressed at -.
731 \begin_layout Itemize
732 minus=<val>: Calibration at extreme minus position (-32768-32767)
735 \begin_layout Itemize
736 zero=<val>: Calibration at neutral position (-32768-32767)
739 \begin_layout Itemize
740 plus=<val>: Calibration at extreme plus position (-32768-32767)
743 \begin_layout Itemize
744 tolerance=<value>: Center band tolerance (0<x<1).
745 The smaller the value, the more sensitive the control is.
748 \begin_layout Subsubsection
752 \begin_layout Standard
753 Print all key bindings in effect.
756 \begin_layout Subsection
760 \begin_layout Standard
761 Aliases bind command to sequence of commands.
762 After alias has been defined, it replaces the command it shadows.
765 \begin_layout Standard
769 \begin_layout Itemize
770 You can't alias command to itself.
773 \begin_layout Itemize
774 Aliases starting with +/- are edge active just like ordinary commands starting
778 \begin_layout Itemize
779 One command can be aliased to multiple commands.
782 \begin_layout Subsubsection
783 alias-command <command> <expansion>
786 \begin_layout Standard
787 Append <expansion> to alias <command>.
788 If alias does not already exist, it is created.
791 \begin_layout Subsubsection
792 unalias-command <command>
795 \begin_layout Standard
796 Clear alias expansion for <command>.
799 \begin_layout Subsubsection
803 \begin_layout Standard
804 Print all aliases and their expansions in effect.
807 \begin_layout Subsection
811 \begin_layout Standard
812 Run <script> as if commands were entered on the command line.
815 \begin_layout Subsection
819 \begin_layout Standard
820 Following commands control AVI video dumping:
823 \begin_layout Subsubsection
824 dump-avi <level> <prefix>
827 \begin_layout Standard
828 Dump AVI video to prefix <prefix> at level <level> (0-18).
832 \begin_layout Itemize
833 The codec is Camstudio Codec in gzip mode.
836 \begin_layout Itemize
837 Encoder and muxer are internal, available on all platforms.
840 \begin_layout Itemize
841 Audio enable/disable and framerate has no effect.
844 \begin_layout Itemize
845 Levels 10-18 are not compatible with AVISource.
848 \begin_layout Itemize
849 Recomended level is 7 if decoded by AVISource.
852 \begin_layout Itemize
853 Recomended level is 16 if decoded by ffmpeg, mencoder or FFMpegSource.
856 \begin_layout Itemize
857 Dumps of low-res PAL games are 256x239 (with all the consequences odd height
861 \begin_layout Itemize
862 The audio dumped to .avi is low-quality version.
863 The high-quality version is dumped to .sox file.
866 \begin_layout Subsubsection
870 \begin_layout Standard
871 End current AVI video dump (closing the emulator also closes the dump).
874 \begin_layout Subsection
878 \begin_layout Standard
879 <address> may be decimal or hexadecimal (prefixed with '0x').
880 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
884 \begin_layout Standard
885 The available element <sizes> are:
888 \begin_layout Itemize
892 \begin_layout Itemize
896 \begin_layout Itemize
900 \begin_layout Itemize
904 \begin_layout Standard
905 When reading RAM and ROM, multi-byte reads/writes are big-endian.
906 When dealing with DSP memory, multi-byte reads/writes are native-endian
907 (do not use operand sizes exceeding DSP bitness, except dword is OK for
911 \begin_layout Subsubsection
912 read-<size> <address>
915 \begin_layout Standard
916 Read the value of byte in <address>.
919 \begin_layout Subsubsection
920 read-s<size> <address>
923 \begin_layout Standard
924 Read the value of signed byte in <address>.
927 \begin_layout Subsubsection
928 write-<size> <address> <value>
931 \begin_layout Standard
932 Write <value> to byte in address <address>.
935 \begin_layout Subsubsection
939 \begin_layout Standard
940 Reset the memory search
943 \begin_layout Subsubsection
947 \begin_layout Standard
948 Print number of candidates remaining
951 \begin_layout Subsubsection
955 \begin_layout Standard
956 Print all candidates remaining
959 \begin_layout Subsubsection
960 search-memory <usflag><sizeflag><op>
963 \begin_layout Standard
964 Searches memory for addresses satisfying criteria.
967 \begin_layout Standard
971 \begin_layout Itemize
975 \begin_layout Itemize
979 \begin_layout Standard
983 \begin_layout Itemize
987 \begin_layout Itemize
991 \begin_layout Itemize
995 \begin_layout Itemize
999 \begin_layout Standard
1003 \begin_layout Itemize
1004 lt: < previous value.
1007 \begin_layout Itemize
1008 le: <= previous value.
1011 \begin_layout Itemize
1012 eq: = previous value.
1015 \begin_layout Itemize
1016 ne: != previous value.
1019 \begin_layout Itemize
1020 ge: >= previous value.
1023 \begin_layout Itemize
1024 gt: > previous value.
1027 \begin_layout Subsubsection
1028 search-memory <sizeflag> <value>
1031 \begin_layout Standard
1032 Searches for addresses that currently have value <value>.
1033 <sizeflag> is as in previous command.
1036 \begin_layout Subsection
1040 \begin_layout Standard
1041 These commands are not available in lsnesrc, but are available after ROM
1045 \begin_layout Subsubsection
1049 \begin_layout Standard
1050 Quits the emulator (asking for confirmation).
1051 If /y is given, no confirmation is asked.
1054 \begin_layout Subsubsection
1058 \begin_layout Standard
1059 Toggle paused/unpaused
1062 \begin_layout Subsubsection
1066 \begin_layout Standard
1068 If the button is still held after configurable timeout expires, game unpauses
1069 for the duration frame advance is held.
1072 \begin_layout Subsubsection
1076 \begin_layout Standard
1078 If the button is still held after configurable timeout expires, game unpauses
1079 for the duration frame advance is held.
1082 \begin_layout Subsubsection
1086 \begin_layout Standard
1087 Skip to first poll in frame after current.
1090 \begin_layout Subsubsection
1094 \begin_layout Standard
1095 Reset the SNES after this frame.
1098 \begin_layout Subsubsection
1102 \begin_layout Standard
1103 Load savestate <filename> in current mode.
1106 \begin_layout Subsubsection
1107 load-state <filename>
1110 \begin_layout Standard
1111 Load savestate <filename> in readwrite mode.
1114 \begin_layout Subsubsection
1115 load-readonly <filename>
1118 \begin_layout Standard
1119 Load savestate <filename> in readonly mode.
1122 \begin_layout Subsubsection
1123 load-preserve <filename>
1126 \begin_layout Standard
1127 Load savestate <filename> in readonly mode, preserving current events.
1130 \begin_layout Subsubsection
1131 load-movie <filename>
1134 \begin_layout Standard
1135 Load savestate <filename>, ignoring save part in readonly mode.
1138 \begin_layout Subsubsection
1139 save-state <filename>
1142 \begin_layout Standard
1143 Save system state to <filename> as soon as possible.
1146 \begin_layout Subsubsection
1147 save-movie <filename>
1150 \begin_layout Standard
1151 Save movie to <filename>.
1154 \begin_layout Subsubsection
1158 \begin_layout Standard
1159 Set read-write mode.
1162 \begin_layout Subsubsection
1166 \begin_layout Standard
1170 \begin_layout Subsubsection
1174 \begin_layout Standard
1175 Toggle between read-only and read-write modes.
1178 \begin_layout Subsubsection
1182 \begin_layout Standard
1183 Set name of the game to <name>
1186 \begin_layout Subsubsection
1190 \begin_layout Standard
1191 Print the name of the game.
1194 \begin_layout Subsubsection
1198 \begin_layout Standard
1199 Adds new author <author>.
1200 If <author> does not contain '|' it is full name.
1201 If it contains '|', '|' splits the full name and nickname.
1204 \begin_layout Subsubsection
1205 edit-author <num> <author>
1208 \begin_layout Standard
1209 Edit the author in slot <num> (0-based) to be <author> (see add-author for
1213 \begin_layout Subsubsection
1217 \begin_layout Standard
1218 Remove author in slot <num>
1221 \begin_layout Subsubsection
1225 \begin_layout Standard
1229 \begin_layout Subsubsection
1230 test-1, test-2, test-3
1233 \begin_layout Standard
1234 Internal test commands.
1238 \begin_layout Subsubsection
1239 take-screenshot <filename>
1242 \begin_layout Standard
1243 Save screenshot to <filename>.
1246 \begin_layout Subsubsection
1247 +controller<num><button>
1250 \begin_layout Standard
1251 Press button <button> on controller <num> (1-8).
1252 The following button names are known:
1255 \begin_layout Itemize
1259 \begin_layout Itemize
1263 \begin_layout Itemize
1267 \begin_layout Itemize
1271 \begin_layout Itemize
1275 \begin_layout Itemize
1279 \begin_layout Itemize
1283 \begin_layout Itemize
1287 \begin_layout Itemize
1291 \begin_layout Itemize
1295 \begin_layout Itemize
1299 \begin_layout Itemize
1303 \begin_layout Itemize
1307 \begin_layout Itemize
1311 \begin_layout Itemize
1315 \begin_layout Itemize
1319 \begin_layout Subsubsection
1320 controllerh<num><button>
1323 \begin_layout Standard
1324 Hold/unhold button <button> on controller <num> (1-8).
1325 See +controller for button names.
1328 \begin_layout Subsubsection
1329 autofire (<pattern>|-)...
1332 \begin_layout Standard
1333 Set autofire pattern.
1334 Each parameter is comma-separated list of button names (in form of 1start,
1335 1A, 2B, etc..) to hold on that frame.
1336 After reaching the end of pattern, the pattern restarts from the beginning.
1339 \begin_layout Subsubsection
1343 \begin_layout Standard
1347 \begin_layout Subsection
1351 \begin_layout Subsubsection
1352 cycle-jukebox-backward
1355 \begin_layout Standard
1356 Cycle save jukebox backwards.
1359 \begin_layout Subsubsection
1360 cycle-jukebox-forward
1363 \begin_layout Standard
1364 Cycle save jukebox forwards
1367 \begin_layout Subsubsection
1368 add-jukebox-save <filename>
1371 \begin_layout Standard
1372 Add <filename> to jukebox saves.
1375 \begin_layout Subsubsection
1379 \begin_layout Standard
1380 Do load from jukebox (current mode).
1383 \begin_layout Subsubsection
1387 \begin_layout Standard
1388 Do state save to jukebox.
1391 \begin_layout Subsection
1395 \begin_layout Standard
1396 Only available if lua support is compiled in.
1399 \begin_layout Subsubsection
1403 \begin_layout Standard
1404 Run Lua code <luacode> using built-in Lua interpretter.
1407 \begin_layout Subsubsection
1411 \begin_layout Standard
1412 Run specified lua file using built-in Lua interpretter.
1415 \begin_layout Subsection
1419 \begin_layout Subsubsection
1420 add-watch <name> <expression>
1423 \begin_layout Standard
1424 Adds new watch (or modifies old one).
1427 \begin_layout Subsubsection
1431 \begin_layout Standard
1435 \begin_layout Subsection
1436 SDL Platform commands
1439 \begin_layout Standard
1440 The following are valid on SDL platform.
1443 \begin_layout Subsubsection
1447 \begin_layout Standard
1448 Enable sounds in GUI (has no effect on video dumping).
1451 \begin_layout Subsubsection
1455 \begin_layout Standard
1456 Disable sounds in GUI (has no effect on video dumping).
1459 \begin_layout Subsubsection
1463 \begin_layout Standard
1464 Asks to press a key and then identifies that (pseudo-)key.
1467 \begin_layout Subsubsection
1471 \begin_layout Standard
1472 Toggle between windowed/fullscreen console.
1475 \begin_layout Subsubsection
1479 \begin_layout Standard
1480 Scroll messages window as far back as it goes.
1483 \begin_layout Subsubsection
1487 \begin_layout Standard
1488 Scroll messages window as far forward as it goes.
1491 \begin_layout Subsubsection
1495 \begin_layout Standard
1496 Scroll messages window back one screenful.
1499 \begin_layout Subsubsection
1503 \begin_layout Standard
1504 Scroll messages window forward one screenful.
1507 \begin_layout Section
1511 \begin_layout Subsection
1515 \begin_layout Subsubsection
1519 \begin_layout Standard
1520 Set where bsnes looks for firmware files.
1522 \begin_inset Quotes eld
1526 \begin_inset Quotes erd
1532 \begin_layout Subsubsection
1536 \begin_layout Standard
1538 Numeric, range is 0.001 to
1539 \begin_inset Quotes eld
1543 \begin_inset Quotes erd
1547 Default is native framerate.
1550 \begin_layout Subsubsection
1554 \begin_layout Standard
1555 Set save compression level (integer 0-9).
1556 Default is 7 (0 is no compression).
1559 \begin_layout Subsubsection
1563 \begin_layout Standard
1564 Set the frame advance timeout in milliseconds.
1565 Numeric integer, range is 0-999999999.
1569 \begin_layout Subsection
1573 \begin_layout Subsubsection
1577 \begin_layout Standard
1578 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1582 \begin_layout Subsubsection
1586 \begin_layout Standard
1587 AVI dumper: Set the default left border thickness (unless lua overrides)
1593 \begin_layout Subsubsection
1597 \begin_layout Standard
1598 AVI dumper: Set the default right border thickness (unless lua overrides)
1604 \begin_layout Subsubsection
1608 \begin_layout Standard
1609 AVI dumper: Set the default top border thickness (unless lua overrides)
1615 \begin_layout Subsubsection
1619 \begin_layout Standard
1620 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1626 \begin_layout Subsubsection
1630 \begin_layout Standard
1631 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1636 \begin_layout Subsection
1637 SDL platform settings
1640 \begin_layout Subsubsection
1641 autorepeat-first-delay
1644 \begin_layout Standard
1645 Sets the delay for first character in typematic autorepeat.
1648 \begin_layout Subsubsection
1649 autorepeat-subsequent-delay
1652 \begin_layout Standard
1653 Sets the delay for subsequent characters in typematic autorepeat.
1656 \begin_layout Section
1660 \begin_layout Subsection
1661 Core (in main table)
1664 \begin_layout Subsubsection
1668 \begin_layout Standard
1669 Print line to message console.
1672 \begin_layout Subsubsection
1673 exec(string command)
1676 \begin_layout Standard
1677 Run command as it was entered on the command line
1680 \begin_layout Subsection
1684 \begin_layout Standard
1685 Bitwise logical functions and related.
1688 \begin_layout Subsubsection
1689 none(number...) / bnot(number...)
1692 \begin_layout Standard
1693 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1697 \begin_layout Subsubsection
1698 any(number...) / bor(number...)
1701 \begin_layout Standard
1702 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1705 \begin_layout Subsubsection
1706 all(number...) / band(number...)
1709 \begin_layout Standard
1710 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1714 \begin_layout Subsubsection
1715 parity(number...) / bxor(number...)
1718 \begin_layout Standard
1719 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1723 \begin_layout Subsubsection
1724 lrotate(number base[, number amount[, number bits]])
1727 \begin_layout Standard
1728 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1731 \begin_layout Subsubsection
1732 rrotate(number base[, number amount[, number bits]])
1735 \begin_layout Standard
1736 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1740 \begin_layout Subsubsection
1741 lshift(number base[, number amount[, number bits]])
1744 \begin_layout Standard
1745 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1746 The new bits are filled with zeroes.
1749 \begin_layout Subsubsection
1750 lrshift(number base[, number amount[, number bits]])
1753 \begin_layout Standard
1754 Shift bits-bit (max 48, default 48) number logically right by amount (default
1756 The new bits are filled with zeroes.
1759 \begin_layout Subsubsection
1760 arshift(number base[, number amount[, number bits]])
1763 \begin_layout Standard
1764 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1766 The new bits are shifted in with copy of the high bit.
1769 \begin_layout Subsection
1773 \begin_layout Standard
1774 Most of these functions can only be called in on_paint and on_video callbacks.
1775 Exceptions are noted.
1778 \begin_layout Standard
1780 Each red, green and blue values are in range 0-31 and the final color value
1782 Alpha range is 0 (fully transparent) to 32 (sic! fully opaque).
1785 \begin_layout Standard
1786 Origin of coordinates is at top left corner of game display area.
1787 Left and top gaps correspond to negative coordinates.
1790 \begin_layout Subsubsection
1794 \begin_layout Standard
1795 Returns 2-tuple (hresolution, vresolution).
1798 \begin_layout Subsubsection
1799 gui.<class>_gap(number gap)
1802 \begin_layout Standard
1803 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1807 \begin_layout Subsubsection
1808 gui.text(number x, number y, string text[, number fgc[, number fga[, number
1809 bgc[, number bga]]]])
1812 \begin_layout Standard
1813 Draw specified text on the GUI (each character cell is 8 or 16 wide and
1818 \begin_layout Itemize
1819 x: X-coordinate to start the drawing from (and x-coordinate at begining
1823 \begin_layout Itemize
1824 y: Y-coordinate to start the drawing from.
1827 \begin_layout Itemize
1828 text: The text to draw.
1831 \begin_layout Itemize
1832 fgc: Text color (default is 0x7FFF (white))
1835 \begin_layout Itemize
1836 fga: Text alpha (default is 32 (opaque))
1839 \begin_layout Itemize
1840 bgc: Background color (default is 0 (black))
1843 \begin_layout Itemize
1844 bga: Background alpha (default is 0 (transparent))
1847 \begin_layout Subsubsection
1848 gui.rectangle(number x, number y, number width, number height[, number thickness[
1849 , number outline[, number outlinealpha[, number fill[, number fillalpha]]]]])
1852 \begin_layout Standard
1853 Draw rectangle on the GUI.
1857 \begin_layout Itemize
1858 x: X-coordinate of left edge.
1861 \begin_layout Itemize
1862 y: Y-coordinate of upper edge.
1865 \begin_layout Itemize
1866 width: Width of rectangle.
1869 \begin_layout Itemize
1870 height: Height of rectangle.
1873 \begin_layout Itemize
1874 thickness: Thickness of outline (default is 1).
1877 \begin_layout Itemize
1878 outline: Color of outline (default is 0x7FFF (white))
1881 \begin_layout Itemize
1882 outlinealpha: Outline alpha (default is 32 (opaque))
1885 \begin_layout Itemize
1886 fill: Color of fil (default is 0 (black))
1889 \begin_layout Itemize
1890 fillalpha: Fill alpha (default is 0 (transparent))
1893 \begin_layout Subsubsection
1894 gui.pixel(number x, number y[, number color[, number alpha]])
1897 \begin_layout Standard
1898 Draw one pixel on the GUI.
1902 \begin_layout Itemize
1903 x: X-coordinate of the pixel
1906 \begin_layout Itemize
1907 y: Y-coordinate of the pixel
1910 \begin_layout Itemize
1911 color: Color of the pixel (default is 0x7FFF (white))
1914 \begin_layout Itemize
1915 alpha: Alpha for the pixel (default is 32 (opaque))
1918 \begin_layout Subsubsection
1919 gui.crosshair(number x, number y[, number length[, number color[, number
1923 \begin_layout Standard
1928 \begin_layout Itemize
1929 x: X-coordinate of the crosshair
1932 \begin_layout Itemize
1933 y: Y-coordinate of the crosshair
1936 \begin_layout Itemize
1937 length: Length of the crosshair lines (default 10).
1940 \begin_layout Itemize
1941 color: Color of the crosshair (default is 0x7FFF (white))
1944 \begin_layout Itemize
1945 alpha: Alpha for the crosshair (default is 32 (opaque))
1948 \begin_layout Subsubsection
1952 \begin_layout Standard
1953 Request on_repaint() to happen as soon as possible.
1954 Can be used anywhere.
1957 \begin_layout Subsubsection
1958 gui.subframe_update(boolean on)
1961 \begin_layout Standard
1962 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
1963 or not happen (on=false).
1964 Can be used anywhere.
1967 \begin_layout Subsection
1971 \begin_layout Standard
1973 Only available in on_input callback.
1976 \begin_layout Subsection
1977 get(number controller, number index)
1980 \begin_layout Standard
1981 Read the specified index (0-11) from specified controller (0-7).
1985 \begin_layout Itemize
1986 Uses physical controller numbering.
1987 Gamepad in port 2 is controller 4, not 1!
1990 \begin_layout Subsection
1991 set(number controller, number index, number value)
1994 \begin_layout Standard
1995 Write the specified index (0-11) from specified controller (0-7), storing
2000 \begin_layout Itemize
2001 Uses physical controller numbering.
2002 Gamepad in port 2 is controller 4, not 1!
2005 \begin_layout Subsection
2006 reset([number cycles])
2009 \begin_layout Standard
2011 If cycles is greater than zero, do delayed reset.
2012 0 (or no value) causes immediate reset.
2015 \begin_layout Itemize
2016 Only available with subframe flag false.
2019 \begin_layout Subsection
2023 \begin_layout Standard
2024 Host memory handling (extra memory saved to savestates).
2025 Host memory starts empty.
2028 \begin_layout Subsubsection
2029 read(number address)
2032 \begin_layout Standard
2033 Reads hostmemory slot address.
2034 Slot numbers out of range return false instead of numeric.
2037 \begin_layout Subsubsection
2038 write(number address, number value)
2041 \begin_layout Standard
2042 Writes hostmemory slot with 0-255.
2043 Slot numbers out of range cause extension of host memory slot space.
2046 \begin_layout Subsubsection
2047 readbyte(number address)
2050 \begin_layout Standard
2051 Read unsigned byte (1 element) from given address.
2052 Slots out of range return false.
2055 \begin_layout Subsubsection
2056 writebyte(number address, number value)
2059 \begin_layout Standard
2060 Write unsigned byte (1 element) to given slot.
2061 Slot numbers out of range cause extension.
2064 \begin_layout Subsubsection
2065 readsbyte(number address)
2068 \begin_layout Standard
2069 Read signed byte (1 element) from given address.
2070 Slots out of range return false.
2073 \begin_layout Subsubsection
2074 writesbyte(number address, number value)
2077 \begin_layout Standard
2078 Write signed byte (1 element) to given slot.
2079 Slot numbers out of range cause extension.
2082 \begin_layout Subsubsection
2083 readword(number address)
2086 \begin_layout Standard
2087 Read unsigned word (2 elements) from given address.
2088 Slots out of range return false.
2091 \begin_layout Subsubsection
2092 writeword(number address, number value)
2095 \begin_layout Standard
2096 Write unsigned word (2 elements) to given slot.
2097 Slot numbers out of range cause extension.
2100 \begin_layout Subsubsection
2101 readsword(number address)
2104 \begin_layout Standard
2105 Read signed word (2 elements) from given address.
2106 Slots out of range return false.
2109 \begin_layout Subsubsection
2110 writesword(number address, number value)
2113 \begin_layout Standard
2114 Write signed word (2 elements) to given slot.
2115 Slot numbers out of range cause extension.
2118 \begin_layout Subsubsection
2119 readdword(number address)
2122 \begin_layout Standard
2123 Read unsigned doubleword (4 elements) from given address.
2124 Slots out of range return false.
2127 \begin_layout Subsubsection
2128 writedword(number address, number value)
2131 \begin_layout Standard
2132 Write unsigned doubleword (4 elements) to given slot.
2133 Slot numbers out of range cause extension.
2136 \begin_layout Subsubsection
2137 readsdword(number address)
2140 \begin_layout Standard
2141 Read signed doubleword (4 elements) from given address.
2142 Slots out of range return false.
2145 \begin_layout Subsubsection
2146 writesdword(number address, number value)
2149 \begin_layout Standard
2150 Write signed doubleword (4 elements) to given slot.
2151 Slot numbers out of range cause extension.
2154 \begin_layout Subsubsection
2155 readqword(number address)
2158 \begin_layout Standard
2159 Read unsigned quadword (8 elements) from given address.
2160 Slots out of range return false.
2163 \begin_layout Subsubsection
2164 writeqword(number address, number value)
2167 \begin_layout Standard
2168 Write unsigned quadword (4 elements) to given slot.
2169 Slot numbers out of range cause extension.
2172 \begin_layout Subsubsection
2173 readsqword(number address)
2176 \begin_layout Standard
2177 Read signed quadword (8 elements) from given address.
2178 Slots out of range return false.
2181 \begin_layout Subsubsection
2182 writesqword(number address, number value)
2185 \begin_layout Standard
2186 Write signed quadword (8 elements) to given slot.
2187 Slot numbers out of range cause extension.
2190 \begin_layout Subsection
2194 \begin_layout Standard
2198 \begin_layout Subsubsection
2199 movie.currentframe()
2202 \begin_layout Standard
2203 Return number of current frame.
2206 \begin_layout Subsubsection
2210 \begin_layout Standard
2211 Return number of frames in movie.
2214 \begin_layout Subsubsection
2218 \begin_layout Standard
2219 Return true if in readonly mode, false if in readwrite.
2222 \begin_layout Subsubsection
2223 movie.set_readwrite()
2226 \begin_layout Standard
2227 Set readwrite mode (does not cause on_readwrite callback).
2230 \begin_layout Subsubsection
2231 movie.frame_subframes(number frame)
2234 \begin_layout Standard
2235 Count number of subframes in specified frame (frame numbers are 1-based)
2239 \begin_layout Subsubsection
2240 movie.read_subframe(number frame, number subframe)
2243 \begin_layout Standard
2244 Read specifed subframe in specified frame and return data as array (100
2245 elements, numbered 0-99 currently).
2248 \begin_layout Subsection
2252 \begin_layout Standard
2253 Routines for settings manipulation
2256 \begin_layout Subsubsection
2260 \begin_layout Standard
2261 Get value of setting.
2262 If setting is blank, returns false.
2263 If setting value can't be obtained, returns (nil, error message).
2266 \begin_layout Subsubsection
2267 set(string name, string value)
2270 \begin_layout Standard
2271 Set value of setting.
2272 If setting can't be set, returns (nil, error message).
2275 \begin_layout Subsubsection
2279 \begin_layout Standard
2280 Returns if setting is set.
2281 If setting does not exist, returns (nil, error message).
2284 \begin_layout Subsubsection
2288 \begin_layout Standard
2289 Blanks a setting and returns true.
2290 If setting can't be blanked, returns (nil, error message).
2293 \begin_layout Subsection
2297 \begin_layout Standard
2298 Various callbacks to Lua that can occur.
2301 \begin_layout Subsubsection
2302 Callback: on_paint()
2305 \begin_layout Standard
2306 Called when screen is being painted.
2307 Any gui.* calls requiring graphic context draw on the screen.
2310 \begin_layout Subsubsection
2311 Callback: on_video()
2314 \begin_layout Standard
2315 Called when video dump frame is being painted.
2316 Any gui.* calls requiring graphic context draw on the video.
2319 \begin_layout Subsubsection
2320 Callback: on_startup()
2323 \begin_layout Standard
2324 Called when the emulator is starting (lsnes.rc and --run files has been run).
2327 \begin_layout Subsubsection
2328 Callback: on_pre_load(string name)
2331 \begin_layout Standard
2332 Called just before savestate/movie load occurs (note: loads are always delayed,
2333 so this occurs even when load was initiated by lua).
2336 \begin_layout Subsubsection
2337 Callback: on_err_load(string name)
2340 \begin_layout Standard
2341 Called if loadstate goes wrong.
2344 \begin_layout Subsubsection
2345 Callback: on_post_load(string name, boolean was_savestate)
2348 \begin_layout Standard
2349 Called on successful loadstate.
2350 was_savestate gives if this was a savestate or a movie.
2353 \begin_layout Subsubsection
2354 Callback: on_pre_save(string name, boolean is_savestate)
2357 \begin_layout Standard
2358 Called just before savestate save occurs (note: movie saves are synchronous
2359 and won't trigger these callbacks if called from Lua).
2362 \begin_layout Subsubsection
2363 Callback: on_err_save(string name)
2366 \begin_layout Standard
2367 Called if savestate goes wrong.
2370 \begin_layout Subsubsection
2371 Callback: on_post_save(string name, boolean is_savestate)
2374 \begin_layout Standard
2375 Called on successful savaestate.
2376 is_savestate gives if this was a savestate or a movie.
2379 \begin_layout Subsubsection
2383 \begin_layout Standard
2384 Called when emulator is shutting down.
2387 \begin_layout Subsubsection
2388 Callback: on_input(boolean subframe)
2391 \begin_layout Standard
2392 Called when emulator is just sending input to bsnes core.
2393 Warning: This is called even in readonly mode, but the results are ignored.
2396 \begin_layout Subsubsection
2397 Callback: on_reset()
2400 \begin_layout Standard
2401 Called when SNES is reset.
2404 \begin_layout Subsubsection
2405 Callback: on_readwrite()
2408 \begin_layout Standard
2409 Called when moving into readwrite mode as result of
2410 \begin_inset Quotes eld
2414 \begin_inset Quotes erd
2417 command (note: moving to rwmode by Lua won't trigger this, as per recursive
2421 \begin_layout Subsubsection
2422 Callback: on_snoop(number port, number controller, number index, number
2426 \begin_layout Standard
2427 Called each time bsnes asks for input.
2428 The value is the final value to be sent to bsnes core (readonly mode, autohold
2429 and autofire have been taken into account).
2430 Might be useful when translating movies to format suitable for console
2432 Note: There is no way to modify the value to be sent.
2435 \begin_layout Section
2436 Modifier and key names:
2439 \begin_layout Subsection
2443 \begin_layout Subsubsection
2447 \begin_layout Standard
2448 Following modifier names are known:
2451 \begin_layout Itemize
2452 ctrl, lctrl, rctrl: Control keys
2455 \begin_layout Itemize
2456 alt, lalt, ralt: ALT keys.
2459 \begin_layout Itemize
2460 shift, lshift, rshift: Shift keys.
2463 \begin_layout Itemize
2464 meta, lmeta, rmeta: Meta keys.
2467 \begin_layout Itemize
2468 num, caps: Numlock/Capslock (these are sticky!)
2471 \begin_layout Itemize
2475 \begin_layout Subsubsection
2479 \begin_layout Standard
2480 Following key names are known:
2483 \begin_layout Itemize
2484 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
2485 hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
2486 comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
2487 less, equals, greater, question, at, leftbracket, backslash, rightbracket,
2488 caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
2489 o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
2490 world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
2491 world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
2492 world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
2493 world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
2494 world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
2495 world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
2496 world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
2497 world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
2498 world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
2499 world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
2500 world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
2501 world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
2502 kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
2503 kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
2504 pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
2505 f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
2506 lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
2507 break, menu, power, euro, undo
2510 \begin_layout Itemize
2511 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
2512 hardware-dependent scan code of <n> (useful to bind those keys that don't
2513 have symbolic names).
2516 \begin_layout Standard
2517 In addition, following pseudo-keys are known (note: these do not work in
2518 conjunction with modifers):
2521 \begin_layout Itemize
2522 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
2525 \begin_layout Itemize
2526 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
2529 \begin_layout Itemize
2530 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
2533 \begin_layout Itemize
2534 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
2537 \begin_layout Itemize
2538 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
2541 \begin_layout Itemize
2542 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
2543 position (axis modes axis and axis_inverse).
2546 \begin_layout Itemize
2547 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
2548 position (axis modes axis and axis_inverse).
2551 \begin_layout Itemize
2552 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
2556 \begin_layout Subsubsection
2560 \begin_layout Itemize
2561 Escape: Enter/Exit Command mode, cancel modal dialogs.
2564 \begin_layout Itemize
2565 Return (also KPEnter): Execute command, ok modal dialog.
2568 \begin_layout Itemize
2569 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
2573 \begin_layout Itemize
2574 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
2578 \begin_layout Itemize
2579 Home (also KP7 if no num lock; command mode): Beginning of command.
2582 \begin_layout Itemize
2583 End (also KP1 if no num lock; command mode): End of command.
2586 \begin_layout Itemize
2587 Left (also KP4 if no num lock; command mode): Move cursor left.
2590 \begin_layout Itemize
2591 Right (also KP6 if no num lock; command mode): Move cursor right.
2594 \begin_layout Itemize
2596 if no num lock; command mode): Delete character to right of cursor.
2599 \begin_layout Itemize
2600 Insert (also KP0 if no num lock; command mode): Toggle between insert /
2604 \begin_layout Itemize
2605 Backspace (command mode): Delete character to left of cursor.
2608 \begin_layout Itemize
2609 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
2612 \begin_layout Subsubsection
2616 \begin_layout Standard
2617 If emulator does not reach internal polling loop in 15 seconds after leaving
2618 it or 15 seconds after starting, the emulator instantly bombs out.
2621 \begin_layout Section
2625 \begin_layout Standard
2626 Movie file is .zip archive in itself, normal ZIP archive tools work on it
2627 (note: If you recompress it, do not use compression methods other than
2628 store and deflate and especially do not use encryption of any kind).
2631 \begin_layout Subsection
2632 Detecting clean start/SRAM/Savestate
2635 \begin_layout Itemize
2637 \begin_inset Quotes eld
2641 \begin_inset Quotes erd
2644 it is savestate, otherwise:
2647 \begin_layout Itemize
2648 If file has members with names starting
2649 \begin_inset Quotes eld
2653 \begin_inset Quotes erd
2656 it is movie starting from SRAM, otherwise:
2659 \begin_layout Itemize
2660 It is movie starting from clear state.
2663 \begin_layout Subsection
2667 \begin_layout Standard
2668 Type of game ROM and region (as one line).
2672 \begin_layout Standard
2673 \begin_inset Tabular
2674 <lyxtabular version="3" rows="8" columns="3">
2675 <features tabularvalignment="middle">
2676 <column alignment="center" valignment="top" width="0">
2677 <column alignment="center" valignment="top" width="0">
2678 <column alignment="center" valignment="top" width="0">
2680 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2683 \begin_layout Plain Layout
2689 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2692 \begin_layout Plain Layout
2698 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2701 \begin_layout Plain Layout
2709 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2712 \begin_layout Plain Layout
2718 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2721 \begin_layout Plain Layout
2727 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2730 \begin_layout Plain Layout
2738 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2741 \begin_layout Plain Layout
2747 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2750 \begin_layout Plain Layout
2756 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2759 \begin_layout Plain Layout
2767 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2770 \begin_layout Plain Layout
2776 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2779 \begin_layout Plain Layout
2785 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2788 \begin_layout Plain Layout
2796 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2799 \begin_layout Plain Layout
2805 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2808 \begin_layout Plain Layout
2814 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2817 \begin_layout Plain Layout
2825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2828 \begin_layout Plain Layout
2834 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2837 \begin_layout Plain Layout
2843 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2846 \begin_layout Plain Layout
2854 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2857 \begin_layout Plain Layout
2863 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2866 \begin_layout Plain Layout
2872 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2875 \begin_layout Plain Layout
2883 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2886 \begin_layout Plain Layout
2892 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2895 \begin_layout Plain Layout
2901 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2904 \begin_layout Plain Layout
2918 \begin_layout Standard
2922 \begin_layout Standard
2923 \begin_inset Tabular
2924 <lyxtabular version="3" rows="3" columns="2">
2925 <features tabularvalignment="middle">
2926 <column alignment="center" valignment="top" width="0">
2927 <column alignment="center" valignment="top" width="0">
2929 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2932 \begin_layout Plain Layout
2938 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2941 \begin_layout Plain Layout
2949 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2952 \begin_layout Plain Layout
2958 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2961 \begin_layout Plain Layout
2969 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2972 \begin_layout Plain Layout
2978 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2981 \begin_layout Plain Layout
2995 \begin_layout Subsection
2999 \begin_layout Standard
3000 Contains type of port #1 (as one line).
3001 Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
3002 If not present, defaults to 'gamepad'.
3005 \begin_layout Subsection
3009 \begin_layout Standard
3010 Contains type of port #2 (as one line).
3011 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
3012 'justifier' and 'justifiers'.
3013 If not present, defaults to 'none'.
3016 \begin_layout Subsection
3020 \begin_layout Standard
3021 Contains name of the game (as one line).
3024 \begin_layout Subsection
3028 \begin_layout Standard
3029 Contains authors, one per line.
3030 Part before '|' is the full name, part after is the nickname.
3033 \begin_layout Subsection
3037 \begin_layout Standard
3039 \begin_inset Quotes eld
3043 \begin_inset Quotes erd
3047 Used to reject other saves.
3050 \begin_layout Subsection
3051 Member: controlsversion
3054 \begin_layout Standard
3056 \begin_inset Quotes eld
3060 \begin_inset Quotes erd
3064 Used to identify what controls are there.
3067 \begin_layout Subsection
3069 \begin_inset Quotes eld
3073 \begin_inset Quotes erd
3079 \begin_layout Standard
3080 Contains bsnes core version number (as one line).
3083 \begin_layout Subsection
3087 \begin_layout Standard
3088 Contains project ID (as one line).
3089 Used to identify if two movies are part of the same project.
3092 \begin_layout Subsection
3093 Member: {rom,slota,slotb}{,xml}.sha256
3096 \begin_layout Standard
3097 Contains SHA-256 of said ROM or ROM mapping file (as one line).
3098 Absent if corresponding file is absent.
3101 \begin_layout Subsection
3102 Member: moviesram.<name>
3105 \begin_layout Standard
3106 Raw binary startup SRAM of kind <name>.
3107 Only present in savestates and movies starting from SRAM.
3110 \begin_layout Subsection
3114 \begin_layout Standard
3115 Raw binary movie state data.
3116 Only present in savestates.
3119 \begin_layout Standard
3123 \begin_layout Itemize
3124 32 bytes: SHA-256 of project ID.
3127 \begin_layout Itemize
3128 8 bytes: Big-endian current frame.
3131 \begin_layout Itemize
3132 100x4 bytes: Poll counters for each control (bit31 of each is
3133 \begin_inset Quotes eld
3137 \begin_inset Quotes erd
3143 \begin_layout Itemize
3144 8 bytes: Big-endian lag frame count.
3147 \begin_layout Itemize
3148 32 bytes: SHA-256 of past input
3151 \begin_layout Itemize
3152 32 bytes: SHA-256 of previous.
3155 \begin_layout Itemize
3156 (total of 512 bytes)
3159 \begin_layout Subsection
3163 \begin_layout Standard
3164 Raw binary dump of host memory.
3165 Only present in savestates.
3168 \begin_layout Subsection
3172 \begin_layout Standard
3173 The raw binary savestate itself.
3174 Savestate detection uses this file, only present in savestates.
3177 \begin_layout Subsection
3181 \begin_layout Standard
3182 Screenshot of current frame.
3183 Only present in savestates.
3184 First 2 bytes are big-endian width of image, rest are big-endian 15-bit
3185 image data (5 bits per channel*pixel, the MSB is unused).
3186 Height of image is inferred from the width and size of data.
3189 \begin_layout Subsection
3193 \begin_layout Standard
3194 Raw binary SRAM of kind <name> at time of savestate.
3195 Only present in savestates.
3198 \begin_layout Subsection
3202 \begin_layout Standard
3203 The actual input track, one line per subframe (blank lines are skipped).
3206 \begin_layout Itemize
3207 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
3208 part of same frame as previous, otherwise it starts a new frame.
3211 \begin_layout Itemize
3212 First subframe must start a new frame.
3215 \begin_layout Standard
3216 Length of movie in frames is number of lines in input file that start a
3220 \begin_layout Subsection
3224 \begin_layout Standard
3225 Contains textual base-10 rerecord count (as one line; emulator just writes
3226 this, it doesn't read it) + 1.
3229 \begin_layout Subsection
3233 \begin_layout Standard
3234 This member stores set of load IDs.
3235 There is one load ID per rerecord (plus one corresponding to start of project).
3238 \begin_layout Itemize
3239 This member constists of concatenation of records
3242 \begin_layout Itemize
3243 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
3247 \begin_layout Itemize
3248 IDs are interpretted as 256-bit big-endian integers with warparound.
3251 \begin_layout Itemize
3252 Initial predicted ID is all zeroes.
3255 \begin_layout Standard
3256 Format of each record is:
3259 \begin_layout Itemize
3260 1 byte: Opcode byte.
3261 Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
3265 \begin_layout Itemize
3266 32-prefixlen bytes of ID.
3269 \begin_layout Itemize
3270 countlen bytes of big-endian count (count).
3273 \begin_layout Standard
3274 Records are processed as follows:
3277 \begin_layout Itemize
3278 To form the first ID encoded by record, take the first prefixlen bytes predicted
3279 ID and append the read ID value to it.
3280 The result is the first ID encoded.
3283 \begin_layout Itemize
3284 If countlen is 0, record encodes 1 ID.
3287 \begin_layout Itemize
3288 If countlen is 1, record encodes 2+count IDs.
3291 \begin_layout Itemize
3292 If countlen is 2, record encodes 258+count IDs.
3295 \begin_layout Itemize
3296 If countlen is 3, record encodes 65794+count IDs.
3299 \begin_layout Itemize
3300 The new predicted ID is the next ID after last one encoded by the record.
3303 \begin_layout Standard
3304 The number of rerecords + 1 is equal to the sum of number of IDs encoded
3308 \begin_layout Subsection
3309 Member: starttime.second
3312 \begin_layout Standard
3313 Movie starting time, second part.
3314 Epoch is Unix epoch.
3315 Default is 1,000,000,000.
3318 \begin_layout Subsection
3319 Member: starttime.subsecond
3322 \begin_layout Standard
3323 Movie starting time, subsecond part.
3324 Unit is 1/3,462,619,485,020 s.
3328 \begin_layout Subsection
3329 Member: savetime.second
3332 \begin_layout Standard
3333 Movie saving time, second part.
3334 Default is starttime.second.
3335 Only present in savestates.
3338 \begin_layout Subsection
3339 Member: savetime.subsecond
3342 \begin_layout Standard
3343 Movie saving time, subsecond part.
3344 Default is starttime.subsecond.
3345 Only present in savestates.
3348 \begin_layout Section
3352 \begin_layout Subsection
3356 \begin_layout Standard
3357 make ui=ui-libsnes profile=accuracy
3360 \begin_layout Subsection
3361 Prerequisite libraries:
3364 \begin_layout Itemize
3368 \begin_layout Itemize
3372 \begin_layout Itemize
3373 SDLmain (Windows/Mac OS X only; Note you may have to extract the object
3377 \begin_layout Itemize
3381 \begin_layout Itemize
3385 \begin_layout Itemize
3386 boost conversion (header only)
3389 \begin_layout Subsection
3390 Compile options to make:
3393 \begin_layout Subsubsection
3397 \begin_layout Standard
3398 Set path to BSNES bsnes directory to <path>.
3401 \begin_layout Subsubsection
3405 \begin_layout Standard
3406 Don't use threads on Linux.
3409 \begin_layout Subsubsection
3413 \begin_layout Standard
3414 Try to use threads even on non-Linux systems.
3417 \begin_layout Subsubsection
3421 \begin_layout Standard
3422 Target C++ compiler to use.
3423 Defaults to g++-4.5.
3426 \begin_layout Standard
3427 Note: If crosscompiling, this has to be crosscompiler.
3430 \begin_layout Subsubsection
3434 \begin_layout Standard
3435 Host C++ compiler to use.
3436 Defaults to the same as CC.
3439 \begin_layout Standard
3440 Note: If crosscompiling, that has to be host compiler (the files produced
3441 will be run in the build process!)
3444 \begin_layout Subsubsection
3448 \begin_layout Standard
3449 Assume BSNES uses compatiblity core instead of accuracy core.
3452 \begin_layout Subsubsection
3456 \begin_layout Standard
3457 Don't compile in Lua support.
3460 \begin_layout Subsubsection
3464 \begin_layout Standard
3465 Disable time() interception.
3466 Prevents recording games using RTC but allows building on some platforms,
3470 \begin_layout Section
3471 Quick'n'dirty encode guide
3474 \begin_layout Enumerate
3475 Start the emulator and load the movie file.
3478 \begin_layout Enumerate
3479 Set large AVI option 'set-setting avi-large on'
3482 \begin_layout Enumerate
3483 If dumping PAL, set bottom border to 2 'set-setting avi-bottom-border 2'
3486 \begin_layout Enumerate
3487 Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are
3488 \begin_inset Quotes eld
3491 use only if you know what you are doing.
3492 \begin_inset Quotes erd
3496 In this case, these can be safely used because of how x264 internally works.
3499 \begin_layout Enumerate
3500 Unpause and let it run until you want to end dumping.
3503 \begin_layout Enumerate
3504 Close the emulator (closing the window is the easiest way)
3507 \begin_layout Enumerate
3508 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
3509 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
3512 \begin_layout Enumerate
3513 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
3516 \begin_layout Enumerate
3517 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
3518 + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
3521 \begin_layout Enumerate
3522 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
3523 Now final.mkv contains quick'n'dirty encode.
3526 \begin_layout Section
3527 Axis configurations for some gamepad types:
3530 \begin_layout Subsection
3534 \begin_layout Standard
3535 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
3538 \begin_layout LyX-Code
3539 set-axis joystick0axis2 pressure-+
3542 \begin_layout LyX-Code
3543 set-axis joystick0axis5 pressure-+
3546 \begin_layout Subsection
3548 \begin_inset Quotes eld
3552 \begin_inset Quotes erd
3558 \begin_layout Standard
3559 Axes 8-19 should be disabled.
3562 \begin_layout LyX-Code
3563 set-axis joystick0axis8 disabled
3566 \begin_layout LyX-Code
3567 set-axis joystick0axis9 disabled
3570 \begin_layout LyX-Code
3571 set-axis joystick0axis10 disabled
3574 \begin_layout LyX-Code
3575 set-axis joystick0axis11 disabled
3578 \begin_layout LyX-Code
3579 set-axis joystick0axis12 disabled
3582 \begin_layout LyX-Code
3583 set-axis joystick0axis13 disabled
3586 \begin_layout LyX-Code
3587 set-axis joystick0axis14 disabled
3590 \begin_layout LyX-Code
3591 set-axis joystick0axis15 disabled
3594 \begin_layout LyX-Code
3595 set-axis joystick0axis16 disabled
3598 \begin_layout LyX-Code
3599 set-axis joystick0axis17 disabled
3602 \begin_layout LyX-Code
3603 set-axis joystick0axis18 disabled
3606 \begin_layout LyX-Code
3607 set-axis joystick0axis19 disabled
3610 \begin_layout Section
3614 \begin_layout Subsection
3615 Problems from BSNES core:
3618 \begin_layout Itemize
3619 The whole pending save stuff.
3622 \begin_layout Itemize
3623 Delay resets are slow.
3626 \begin_layout Itemize
3627 RTC is not emulated in sync-stable manner.
3630 \begin_layout Itemize
3631 Lack of layer hiding.
3634 \begin_layout Itemize
3638 \begin_layout Itemize
3639 Firmwares can't be loaded from ZIP archives.
3642 \begin_layout Itemize
3643 Manual polls can be corrupted if savestate occurs during those.
3646 \begin_layout Subsection
3650 \begin_layout Itemize
3651 Modifiers don't work with pseudo-keys (SDL).
3654 \begin_layout Itemize
3655 Audio for last dumped frame is not itself dumped.
3658 \begin_layout Itemize
3659 Audio in UI is pretty bad in quality.
3662 \begin_layout Itemize
3663 UI itself is 30fps max.
3666 \begin_layout Itemize
3667 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
3670 \begin_layout Itemize
3671 No menus, command based interface (SDL).
3674 \begin_layout Itemize
3675 Long commands don't scroll.
3678 \begin_layout Section
3682 \begin_layout Subsection
3686 \begin_layout Itemize
3690 \begin_layout Itemize
3691 Fix dumper video corruption with levels 10-18.
3694 \begin_layout Subsection
3698 \begin_layout Itemize
3702 \begin_layout Itemize
3703 Lots of code cleanups
3706 \begin_layout Itemize
3707 Lua interface to settings
3710 \begin_layout Itemize
3711 Allow specifying AVI borders without Lua
3714 \begin_layout Itemize
3715 Fix scaling if vscale > 1 and originx > 0 (left border exists)
3718 \begin_layout Itemize
3719 on_snoop lua callback
3722 \begin_layout Itemize
3723 Faster movie loading and saving.
3726 \begin_layout Subsection
3730 \begin_layout Itemize
3734 \begin_layout Subsection
3738 \begin_layout Itemize
3742 \begin_layout Itemize
3743 Save jukebox functionality.
3746 \begin_layout Subsection
3750 \begin_layout Itemize
3751 Try to fix some nasty failing movie load edge cases
3754 \begin_layout Itemize
3755 Allow specifying scripts to run on command line.
3758 \begin_layout Subsection
3762 \begin_layout Itemize
3763 Major source code reorganization.
3766 \begin_layout Itemize
3767 Backup savestates before overwriting.
3770 \begin_layout Itemize
3771 Don't crash if loading initial state fails.
3774 \begin_layout Subsection
3778 \begin_layout Itemize
3782 \begin_layout Itemize
3783 Fix author name parsing
3786 \begin_layout Itemize
3787 Fix rerecord counting
3790 \begin_layout Itemize
3791 (SDL) Print messages to console if SDL is uninitialized
3794 \begin_layout Itemize
3795 Add movieinfo program
3798 \begin_layout Itemize
3799 Fix loading movies starting from SRAM.
3802 \begin_layout Subsection
3806 \begin_layout Itemize
3807 Add support for unattended dumping
3810 \begin_layout Itemize
3811 Fix compiling for Win32
3814 \begin_layout Itemize
3815 Don't lock up if sound can't be initialized
3818 \begin_layout Itemize
3819 Strip trailing CR from commands
3822 \begin_layout Itemize
3823 Don't try to do dubious things in global ctors (fix crash on startup)
3826 \begin_layout Subsection
3830 \begin_layout Itemize
3831 Small documentation tweaking
3834 \begin_layout Itemize
3838 \begin_layout Itemize
3839 Fix major bug in modifier matching
3842 \begin_layout Subsection
3846 \begin_layout Itemize
3847 Lots of documentation fixes
3850 \begin_layout Itemize
3851 Use dedicated callbacks for event backcomm., not commands.
3854 \begin_layout Itemize
3855 Ensure that the watchdog is not hit when executing delayed reset.
3858 \begin_layout Itemize
3859 Remove errant tab from joystick message.
3862 \begin_layout Subsection
3866 \begin_layout Itemize
3867 Make autofire operate in absolute time, not linear time
3870 \begin_layout Itemize
3871 Reinitialize controls when resuming from loadstate
3874 \begin_layout Itemize
3875 Some more code cleanups
3878 \begin_layout Itemize
3879 If Lua allocator fails, call OOM_panic()
3882 \begin_layout Itemize
3883 Byte/word/dword/qword sized host memory write/read functions.
3886 \begin_layout Itemize
3887 Dump at correct framerate if dumping interlaced NTSC (height=448).
3890 \begin_layout Subsection
3894 \begin_layout Itemize
3895 Actually include the complete source code
3898 \begin_layout Itemize
3902 \begin_layout Subsection
3906 \begin_layout Itemize
3907 Document {save,start}time.{,sub}second.
3910 \begin_layout Itemize
3911 Intercept time() from bsnes core.
3914 \begin_layout Subsection
3918 \begin_layout Itemize
3919 Allow disabling time() interception (allow build on Mac OS X)
3922 \begin_layout Itemize
3923 Use SDLMain on Mac OS X (make SDL not crash)
3926 \begin_layout Itemize
3927 Disable delayed resets (just plain too buggy for now).
3930 \begin_layout Itemize
3934 \begin_layout Itemize
3935 Use 16-bit for graphics/video instead of 32-bit.
3938 \begin_layout Itemize
3939 gui.rectangle/gui.pixel
3942 \begin_layout Itemize
3946 \begin_layout Itemize
3947 New CSCD writer implementation.
3950 \begin_layout Subsection
3954 \begin_layout Itemize
3955 Fix interaction of * and +.
3958 \begin_layout Itemize
3962 \begin_layout Itemize
3963 Use gettimeofday()/usleep(), these seem portable enough.
3966 \begin_layout Itemize
3967 Move joystick axis manipulation to keymapper code.
3970 \begin_layout Itemize
3971 Changes to how read-only works.
3974 \begin_layout Itemize
3975 Refactor controller input code.