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 '+', the command is executed as-is when button is
586 pressed, and when button is released, it is executed with '+' replaced
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 Subsubsection
683 \begin_layout Standard
684 Print all key bindings in effect.
687 \begin_layout Subsection
691 \begin_layout Standard
692 Aliases bind command to sequence of commands.
693 After alias has been defined, it replaces the command it shadows.
696 \begin_layout Standard
700 \begin_layout Itemize
701 You can't alias command to itself.
704 \begin_layout Itemize
705 Aliases starting with +/- are edge active just like ordinary commands starting
709 \begin_layout Itemize
710 One command can be aliased to multiple commands.
713 \begin_layout Subsubsection
714 alias-command <command> <expansion>
717 \begin_layout Standard
718 Append <expansion> to alias <command>.
719 If alias does not already exist, it is created.
722 \begin_layout Subsubsection
723 unalias-command <command>
726 \begin_layout Standard
727 Clear alias expansion for <command>.
730 \begin_layout Subsubsection
734 \begin_layout Standard
735 Print all aliases and their expansions in effect.
738 \begin_layout Subsection
742 \begin_layout Standard
743 Run <script> as if commands were entered on the command line.
746 \begin_layout Subsection
750 \begin_layout Standard
751 Following commands control AVI video dumping:
754 \begin_layout Subsubsection
755 dump-avi <level> <prefix>
758 \begin_layout Standard
759 Dump AVI video to prefix <prefix> at level <level> (0-18).
763 \begin_layout Itemize
764 The codec is Camstudio Codec in gzip mode.
767 \begin_layout Itemize
768 Encoder and muxer are internal, available on all platforms.
771 \begin_layout Itemize
772 Audio enable/disable and framerate has no effect.
775 \begin_layout Itemize
776 Levels 10-18 are not compatible with AVISource.
779 \begin_layout Itemize
780 Recomended level is 7 if decoded by AVISource.
783 \begin_layout Itemize
784 Recomended level is 16 if decoded by ffmpeg, mencoder or FFMpegSource.
787 \begin_layout Itemize
788 Dumps of low-res PAL games are 256x239 (with all the consequences odd height
792 \begin_layout Itemize
793 The audio dumped to .avi is low-quality version.
794 The high-quality version is dumped to .sox file.
797 \begin_layout Subsubsection
801 \begin_layout Standard
802 End current AVI video dump (closing the emulator also closes the dump).
805 \begin_layout Subsection
809 \begin_layout Standard
810 <address> may be decimal or hexadecimal (prefixed with '0x').
811 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
815 \begin_layout Standard
816 The available element <sizes> are:
819 \begin_layout Itemize
823 \begin_layout Itemize
827 \begin_layout Itemize
831 \begin_layout Itemize
835 \begin_layout Standard
836 When reading RAM and ROM, multi-byte reads/writes are big-endian.
837 When dealing with DSP memory, multi-byte reads/writes are native-endian
838 (do not use operand sizes exceeding DSP bitness, except dword is OK for
842 \begin_layout Subsubsection
843 read-<size> <address>
846 \begin_layout Standard
847 Read the value of byte in <address>.
850 \begin_layout Subsubsection
851 read-s<size> <address>
854 \begin_layout Standard
855 Read the value of signed byte in <address>.
858 \begin_layout Subsubsection
859 write-<size> <address> <value>
862 \begin_layout Standard
863 Write <value> to byte in address <address>.
866 \begin_layout Subsubsection
870 \begin_layout Standard
871 Reset the memory search
874 \begin_layout Subsubsection
878 \begin_layout Standard
879 Print number of candidates remaining
882 \begin_layout Subsubsection
886 \begin_layout Standard
887 Print all candidates remaining
890 \begin_layout Subsubsection
891 search-memory <usflag><sizeflag><op>
894 \begin_layout Standard
895 Searches memory for addresses satisfying criteria.
898 \begin_layout Standard
902 \begin_layout Itemize
906 \begin_layout Itemize
910 \begin_layout Standard
914 \begin_layout Itemize
918 \begin_layout Itemize
922 \begin_layout Itemize
926 \begin_layout Itemize
930 \begin_layout Standard
934 \begin_layout Itemize
935 lt: < previous value.
938 \begin_layout Itemize
939 le: <= previous value.
942 \begin_layout Itemize
943 eq: = previous value.
946 \begin_layout Itemize
947 ne: != previous value.
950 \begin_layout Itemize
951 ge: >= previous value.
954 \begin_layout Itemize
955 gt: > previous value.
958 \begin_layout Subsubsection
959 search-memory <sizeflag> <value>
962 \begin_layout Standard
963 Searches for addresses that currently have value <value>.
964 <sizeflag> is as in previous command.
967 \begin_layout Subsection
971 \begin_layout Standard
972 These commands are not available in lsnesrc, but are available after ROM
976 \begin_layout Subsubsection
980 \begin_layout Standard
981 Quits the emulator (asking for confirmation).
982 If /y is given, no confirmation is asked.
985 \begin_layout Subsubsection
989 \begin_layout Standard
990 Toggle paused/unpaused
993 \begin_layout Subsubsection
997 \begin_layout Standard
999 If the button is still held after configurable timeout expires, game unpauses
1000 for the duration frame advance is held.
1003 \begin_layout Subsubsection
1007 \begin_layout Standard
1009 If the button is still held after configurable timeout expires, game unpauses
1010 for the duration frame advance is held.
1013 \begin_layout Subsubsection
1017 \begin_layout Standard
1018 Skip to first poll in frame after current.
1021 \begin_layout Subsubsection
1025 \begin_layout Standard
1026 Reset the SNES after this frame.
1029 \begin_layout Subsubsection
1030 load-state <filename>
1033 \begin_layout Standard
1034 Load savestate <filename> in readwrite mode.
1037 \begin_layout Subsubsection
1038 load-readonly <filename>
1041 \begin_layout Standard
1042 Load savestate <filename> in readonly mode.
1045 \begin_layout Subsubsection
1046 load-preserve <filename>
1049 \begin_layout Standard
1050 Load savestate <filename> in readonly mode, preserving current events.
1053 \begin_layout Subsubsection
1054 load-movie <filename>
1057 \begin_layout Standard
1058 Load savestate <filename>, ignoring save part in readonly mode.
1061 \begin_layout Subsubsection
1062 save-state <filename>
1065 \begin_layout Standard
1066 Save system state to <filename> as soon as possible.
1069 \begin_layout Subsubsection
1070 save-movie <filename>
1073 \begin_layout Standard
1074 Save movie to <filename>.
1077 \begin_layout Subsubsection
1081 \begin_layout Standard
1082 Set read-write mode.
1085 \begin_layout Subsubsection
1089 \begin_layout Standard
1090 Set name of the game to <name>
1093 \begin_layout Subsubsection
1097 \begin_layout Standard
1098 Print the name of the game.
1101 \begin_layout Subsubsection
1105 \begin_layout Standard
1106 Adds new author <author>.
1107 If <author> does not contain '|' it is full name.
1108 If it contains '|', '|' splits the full name and nickname.
1111 \begin_layout Subsubsection
1112 edit-author <num> <author>
1115 \begin_layout Standard
1116 Edit the author in slot <num> (0-based) to be <author> (see add-author for
1120 \begin_layout Subsubsection
1124 \begin_layout Standard
1125 Remove author in slot <num>
1128 \begin_layout Subsubsection
1132 \begin_layout Standard
1136 \begin_layout Subsubsection
1137 test-1, test-2, test-3
1140 \begin_layout Standard
1141 Internal test commands.
1145 \begin_layout Subsubsection
1146 take-screenshot <filename>
1149 \begin_layout Standard
1150 Save screenshot to <filename>.
1153 \begin_layout Subsubsection
1154 +controller<num><button>
1157 \begin_layout Standard
1158 Press button <button> on controller <num> (1-8).
1159 The following button names are known:
1162 \begin_layout Itemize
1166 \begin_layout Itemize
1170 \begin_layout Itemize
1174 \begin_layout Itemize
1178 \begin_layout Itemize
1182 \begin_layout Itemize
1186 \begin_layout Itemize
1190 \begin_layout Itemize
1194 \begin_layout Itemize
1198 \begin_layout Itemize
1202 \begin_layout Itemize
1206 \begin_layout Itemize
1210 \begin_layout Itemize
1214 \begin_layout Itemize
1218 \begin_layout Itemize
1222 \begin_layout Itemize
1226 \begin_layout Subsubsection
1227 controllerh<num><button>
1230 \begin_layout Standard
1231 Hold/unhold button <button> on controller <num> (1-8).
1232 See +controller for button names.
1235 \begin_layout Subsubsection
1236 autofire (<pattern>|-)...
1239 \begin_layout Standard
1240 Set autofire pattern.
1241 Each parameter is comma-separated list of button names (in form of 1start,
1242 1A, 2B, etc..) to hold on that frame.
1243 After reaching the end of pattern, the pattern restarts from the beginning.
1246 \begin_layout Subsubsection
1250 \begin_layout Standard
1254 \begin_layout Subsection
1258 \begin_layout Subsubsection
1259 cycle-jukebox-backward
1262 \begin_layout Standard
1263 Cycle save jukebox backwards.
1266 \begin_layout Subsubsection
1267 cycle-jukebox-forward
1270 \begin_layout Standard
1271 Cycle save jukebox forwards
1274 \begin_layout Subsubsection
1275 add-jukebox-save <filename>
1278 \begin_layout Standard
1279 Add <filename> to jukebox saves.
1282 \begin_layout Subsubsection
1286 \begin_layout Standard
1287 Do R/W load from jukebox.
1290 \begin_layout Subsubsection
1294 \begin_layout Standard
1295 Do state save to jukebox.
1298 \begin_layout Subsection
1302 \begin_layout Standard
1303 Only available if lua support is compiled in.
1306 \begin_layout Subsubsection
1310 \begin_layout Standard
1311 Run Lua code <luacode> using built-in Lua interpretter.
1314 \begin_layout Subsubsection
1318 \begin_layout Standard
1319 Run specified lua file using built-in Lua interpretter.
1322 \begin_layout Subsection
1326 \begin_layout Subsubsection
1327 add-watch <name> <expression>
1330 \begin_layout Standard
1331 Adds new watch (or modifies old one).
1334 \begin_layout Subsubsection
1338 \begin_layout Standard
1342 \begin_layout Subsection
1343 SDL Platform commands
1346 \begin_layout Standard
1347 The following are valid on SDL platform.
1350 \begin_layout Subsubsection
1354 \begin_layout Standard
1355 Enable sounds in GUI (has no effect on video dumping).
1358 \begin_layout Subsubsection
1362 \begin_layout Standard
1363 Disable sounds in GUI (has no effect on video dumping).
1366 \begin_layout Subsubsection
1370 \begin_layout Standard
1371 Asks to press a key and then identifies that (pseudo-)key.
1374 \begin_layout Subsubsection
1378 \begin_layout Standard
1379 Toggle between windowed/fullscreen console.
1382 \begin_layout Subsubsection
1386 \begin_layout Standard
1387 Scroll messages window as far back as it goes.
1390 \begin_layout Subsubsection
1394 \begin_layout Standard
1395 Scroll messages window as far forward as it goes.
1398 \begin_layout Subsubsection
1402 \begin_layout Standard
1403 Scroll messages window back one screenful.
1406 \begin_layout Subsubsection
1410 \begin_layout Standard
1411 Scroll messages window forward one screenful.
1414 \begin_layout Subsubsection
1415 axismode <axis> <mode>
1418 \begin_layout Standard
1419 Set joystick axis mode.
1421 \begin_inset Quotes eld
1424 joystick<num>axis<axis>
1425 \begin_inset Quotes erd
1430 \begin_inset Quotes eld
1434 \begin_inset Quotes erd
1441 \begin_layout Itemize
1442 axis: Normal axis mode
1445 \begin_layout Itemize
1446 axis_inverse: Inverse axis mode.
1449 \begin_layout Itemize
1450 pressure_0m: Pressure sensitive.
1451 Released at 0, pressed at full negative.
1454 \begin_layout Itemize
1455 pressure_0p: Pressure sensitive.
1456 Released at 0, pressed at full positive.
1459 \begin_layout Itemize
1460 pressure_m0: Pressure sensitive.
1461 Released at full negative, pressed at 0.
1464 \begin_layout Itemize
1465 pressure_mp: Pressure sensitive.
1466 Released at full negative, pressed at full positive.
1468 XBox360 Pad axes 2 and 5.
1471 \begin_layout Itemize
1472 pressure_p0: Pressure sensitive.
1473 Released at full positive, pressed at 0.
1476 \begin_layout Itemize
1477 pressure_pm: Pressure sensitive.
1478 Released at full positive, pressed at full negative.
1481 \begin_layout Itemize
1482 disabled: Disable the axis.
1483 On PS3 controller, axes 8-19 should be disabled since those controls are
1484 digital buttons as well.
1487 \begin_layout Section
1491 \begin_layout Subsection
1495 \begin_layout Subsubsection
1499 \begin_layout Standard
1500 Set where bsnes looks for firmware files.
1502 \begin_inset Quotes eld
1506 \begin_inset Quotes erd
1512 \begin_layout Subsubsection
1516 \begin_layout Standard
1518 Numeric, range is 0.001 to
1519 \begin_inset Quotes eld
1523 \begin_inset Quotes erd
1527 Default is native framerate.
1530 \begin_layout Subsubsection
1534 \begin_layout Standard
1535 Set save compression level (integer 0-9).
1536 Default is 7 (0 is no compression).
1539 \begin_layout Subsubsection
1543 \begin_layout Standard
1544 Set the frame advance timeout in milliseconds.
1545 Numeric integer, range is 0-999999999.
1549 \begin_layout Subsection
1553 \begin_layout Subsubsection
1557 \begin_layout Standard
1558 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1562 \begin_layout Subsubsection
1566 \begin_layout Standard
1567 AVI dumper: Set the default left border thickness (unless lua overrides)
1573 \begin_layout Subsubsection
1577 \begin_layout Standard
1578 AVI dumper: Set the default right border thickness (unless lua overrides)
1584 \begin_layout Subsubsection
1588 \begin_layout Standard
1589 AVI dumper: Set the default top border thickness (unless lua overrides)
1595 \begin_layout Subsubsection
1599 \begin_layout Standard
1600 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1606 \begin_layout Subsubsection
1610 \begin_layout Standard
1611 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1616 \begin_layout Subsection
1617 SDL platform settings
1620 \begin_layout Subsubsection
1621 autorepeat-first-delay
1624 \begin_layout Standard
1625 Sets the delay for first character in typematic autorepeat.
1628 \begin_layout Subsubsection
1629 autorepeat-subsequent-delay
1632 \begin_layout Standard
1633 Sets the delay for subsequent characters in typematic autorepeat.
1636 \begin_layout Section
1640 \begin_layout Subsection
1641 Core (in main table)
1644 \begin_layout Subsubsection
1648 \begin_layout Standard
1649 Print line to message console.
1652 \begin_layout Subsubsection
1653 exec(string command)
1656 \begin_layout Standard
1657 Run command as it was entered on the command line
1660 \begin_layout Subsection
1664 \begin_layout Standard
1665 Bitwise logical functions and related.
1668 \begin_layout Subsubsection
1669 none(number...) / bnot(number...)
1672 \begin_layout Standard
1673 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1677 \begin_layout Subsubsection
1678 any(number...) / bor(number...)
1681 \begin_layout Standard
1682 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1685 \begin_layout Subsubsection
1686 all(number...) / band(number...)
1689 \begin_layout Standard
1690 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1694 \begin_layout Subsubsection
1695 parity(number...) / bxor(number...)
1698 \begin_layout Standard
1699 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1703 \begin_layout Subsubsection
1704 lrotate(number base[, number amount[, number bits]])
1707 \begin_layout Standard
1708 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1711 \begin_layout Subsubsection
1712 rrotate(number base[, number amount[, number bits]])
1715 \begin_layout Standard
1716 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1720 \begin_layout Subsubsection
1721 lshift(number base[, number amount[, number bits]])
1724 \begin_layout Standard
1725 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1726 The new bits are filled with zeroes.
1729 \begin_layout Subsubsection
1730 lrshift(number base[, number amount[, number bits]])
1733 \begin_layout Standard
1734 Shift bits-bit (max 48, default 48) number logically right by amount (default
1736 The new bits are filled with zeroes.
1739 \begin_layout Subsubsection
1740 arshift(number base[, number amount[, number bits]])
1743 \begin_layout Standard
1744 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1746 The new bits are shifted in with copy of the high bit.
1749 \begin_layout Subsection
1753 \begin_layout Standard
1754 Most of these functions can only be called in on_paint and on_video callbacks.
1755 Exceptions are noted.
1758 \begin_layout Subsubsection
1762 \begin_layout Standard
1763 Returns 2-tuple (hresolution, vresolution).
1766 \begin_layout Subsubsection
1767 gui.<class>_gap(number gap)
1770 \begin_layout Standard
1771 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1775 \begin_layout Subsubsection
1776 gui.text(number x, number y, string text[, number fgc[, number fga[, number
1777 bgc[, number bga]]]])
1780 \begin_layout Standard
1781 Draw text on the GUI.
1782 Font size is 8 (or 16) by 16.
1786 \begin_layout Itemize
1787 Coordinate origin is at top-left of the game area.
1788 Left and top gaps have negative coordinates.
1791 \begin_layout Itemize
1792 Use gui.resolution() to discover how to layout colors.
1795 \begin_layout Itemize
1796 Alpha range is 0(transparent)-32(opaque).
1799 \begin_layout Itemize
1800 Only available in on_paint() and on_video() callbacks.
1803 \begin_layout Itemize
1804 Colors are 15 bits (1024 * r + 32 * g + b).
1807 \begin_layout Subsubsection
1808 gui.rectangle(number x, number y, number width, number height[, number thickness[
1809 , number outline[, number outlinealpha[, number fill[, number fillalpha]]]]])
1812 \begin_layout Standard
1813 Draw rectangle on the GUI.
1814 All notes of gui.text apply.
1817 \begin_layout Subsubsection
1818 gui.pixel(number x, number y[, number color[, number alpha]])
1821 \begin_layout Standard
1822 Draw one pixel on the GUI.
1823 All notes of gui.text apply.
1826 \begin_layout Subsubsection
1830 \begin_layout Standard
1831 Request on_repaint() to happen as soon as possible.
1832 Can be used anywhere.
1835 \begin_layout Subsubsection
1836 gui.subframe_update(boolean on)
1839 \begin_layout Standard
1840 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
1841 or not happen (on=false).
1842 Can be used anywhere.
1845 \begin_layout Subsection
1849 \begin_layout Standard
1851 Only available in on_input callback.
1854 \begin_layout Subsection
1855 get(number controller, number index)
1858 \begin_layout Standard
1859 Read the specified index (0-11) from specified controller (0-7).
1863 \begin_layout Itemize
1864 Uses physical controller numbering.
1865 Gamepad in port 2 is controller 4, not 1!
1868 \begin_layout Subsection
1869 set(number controller, number index, number value)
1872 \begin_layout Standard
1873 Write the specified index (0-11) from specified controller (0-7), storing
1878 \begin_layout Itemize
1879 Uses physical controller numbering.
1880 Gamepad in port 2 is controller 4, not 1!
1883 \begin_layout Subsection
1884 reset([number cycles])
1887 \begin_layout Standard
1889 If cycles is greater than zero, do delayed reset.
1890 0 (or no value) causes immediate reset.
1893 \begin_layout Itemize
1894 Only available with subframe flag false.
1897 \begin_layout Subsection
1901 \begin_layout Standard
1902 Host memory handling (extra memory saved to savestates).
1903 Host memory starts empty.
1906 \begin_layout Subsubsection
1907 read(number address)
1910 \begin_layout Standard
1911 Reads hostmemory slot address.
1912 Slot numbers out of range return false instead of numeric.
1915 \begin_layout Subsubsection
1916 write(number address, number value)
1919 \begin_layout Standard
1920 Writes hostmemory slot with 0-255.
1921 Slot numbers out of range cause extension of host memory slot space.
1924 \begin_layout Subsubsection
1925 readbyte(number address)
1928 \begin_layout Standard
1929 Read unsigned byte (1 element) from given address.
1930 Slots out of range return false.
1933 \begin_layout Subsubsection
1934 writebyte(number address, number value)
1937 \begin_layout Standard
1938 Write unsigned byte (1 element) to given slot.
1939 Slot numbers out of range cause extension.
1942 \begin_layout Subsubsection
1943 readsbyte(number address)
1946 \begin_layout Standard
1947 Read signed byte (1 element) from given address.
1948 Slots out of range return false.
1951 \begin_layout Subsubsection
1952 writesbyte(number address, number value)
1955 \begin_layout Standard
1956 Write signed byte (1 element) to given slot.
1957 Slot numbers out of range cause extension.
1960 \begin_layout Subsubsection
1961 readword(number address)
1964 \begin_layout Standard
1965 Read unsigned word (2 elements) from given address.
1966 Slots out of range return false.
1969 \begin_layout Subsubsection
1970 writeword(number address, number value)
1973 \begin_layout Standard
1974 Write unsigned word (2 elements) to given slot.
1975 Slot numbers out of range cause extension.
1978 \begin_layout Subsubsection
1979 readsword(number address)
1982 \begin_layout Standard
1983 Read signed word (2 elements) from given address.
1984 Slots out of range return false.
1987 \begin_layout Subsubsection
1988 writesword(number address, number value)
1991 \begin_layout Standard
1992 Write signed word (2 elements) to given slot.
1993 Slot numbers out of range cause extension.
1996 \begin_layout Subsubsection
1997 readdword(number address)
2000 \begin_layout Standard
2001 Read unsigned doubleword (4 elements) from given address.
2002 Slots out of range return false.
2005 \begin_layout Subsubsection
2006 writedword(number address, number value)
2009 \begin_layout Standard
2010 Write unsigned doubleword (4 elements) to given slot.
2011 Slot numbers out of range cause extension.
2014 \begin_layout Subsubsection
2015 readsdword(number address)
2018 \begin_layout Standard
2019 Read signed doubleword (4 elements) from given address.
2020 Slots out of range return false.
2023 \begin_layout Subsubsection
2024 writesdword(number address, number value)
2027 \begin_layout Standard
2028 Write signed doubleword (4 elements) to given slot.
2029 Slot numbers out of range cause extension.
2032 \begin_layout Subsubsection
2033 readqword(number address)
2036 \begin_layout Standard
2037 Read unsigned quadword (8 elements) from given address.
2038 Slots out of range return false.
2041 \begin_layout Subsubsection
2042 writeqword(number address, number value)
2045 \begin_layout Standard
2046 Write unsigned quadword (4 elements) to given slot.
2047 Slot numbers out of range cause extension.
2050 \begin_layout Subsubsection
2051 readsqword(number address)
2054 \begin_layout Standard
2055 Read signed quadword (8 elements) from given address.
2056 Slots out of range return false.
2059 \begin_layout Subsubsection
2060 writesqword(number address, number value)
2063 \begin_layout Standard
2064 Write signed quadword (8 elements) to given slot.
2065 Slot numbers out of range cause extension.
2068 \begin_layout Subsection
2072 \begin_layout Standard
2076 \begin_layout Subsubsection
2077 movie.currentframe()
2080 \begin_layout Standard
2081 Return number of current frame.
2084 \begin_layout Subsubsection
2088 \begin_layout Standard
2089 Return number of frames in movie.
2092 \begin_layout Subsubsection
2096 \begin_layout Standard
2097 Return true if in readonly mode, false if in readwrite.
2100 \begin_layout Subsubsection
2101 movie.set_readwrite()
2104 \begin_layout Standard
2105 Set readwrite mode (does not cause on_readwrite callback).
2108 \begin_layout Subsubsection
2109 movie.frame_subframes(number frame)
2112 \begin_layout Standard
2113 Count number of subframes in specified frame (frame numbers are 1-based)
2117 \begin_layout Subsubsection
2118 movie.read_subframe(number frame, number subframe)
2121 \begin_layout Standard
2122 Read specifed subframe in specified frame and return data as array (100
2123 elements, numbered 0-99 currently).
2126 \begin_layout Subsection
2130 \begin_layout Standard
2131 Routines for settings manipulation
2134 \begin_layout Subsubsection
2138 \begin_layout Standard
2139 Get value of setting.
2140 If setting is blank, returns false.
2141 If setting value can't be obtained, returns (nil, error message).
2144 \begin_layout Subsubsection
2145 set(string name, string value)
2148 \begin_layout Standard
2149 Set value of setting.
2150 If setting can't be set, returns (nil, error message).
2153 \begin_layout Subsubsection
2157 \begin_layout Standard
2158 Returns if setting is set.
2159 If setting does not exist, returns (nil, error message).
2162 \begin_layout Subsubsection
2166 \begin_layout Standard
2167 Blanks a setting and returns true.
2168 If setting can't be blanked, returns (nil, error message).
2171 \begin_layout Subsection
2175 \begin_layout Standard
2176 Various callbacks to Lua that can occur.
2179 \begin_layout Subsubsection
2180 Callback: on_paint()
2183 \begin_layout Standard
2184 Called when screen is being painted.
2185 Any gui.* calls requiring graphic context draw on the screen.
2188 \begin_layout Subsubsection
2189 Callback: on_video()
2192 \begin_layout Standard
2193 Called when video dump frame is being painted.
2194 Any gui.* calls requiring graphic context draw on the video.
2197 \begin_layout Subsubsection
2198 Callback: on_startup()
2201 \begin_layout Standard
2202 Called when the emulator is starting (lsnes.rc and --run files has been run).
2205 \begin_layout Subsubsection
2206 Callback: on_pre_load(string name)
2209 \begin_layout Standard
2210 Called just before savestate/movie load occurs (note: loads are always delayed,
2211 so this occurs even when load was initiated by lua).
2214 \begin_layout Subsubsection
2215 Callback: on_err_load(string name)
2218 \begin_layout Standard
2219 Called if loadstate goes wrong.
2222 \begin_layout Subsubsection
2223 Callback: on_post_load(string name, boolean was_savestate)
2226 \begin_layout Standard
2227 Called on successful loadstate.
2228 was_savestate gives if this was a savestate or a movie.
2231 \begin_layout Subsubsection
2232 Callback: on_pre_save(string name, boolean is_savestate)
2235 \begin_layout Standard
2236 Called just before savestate save occurs (note: movie saves are synchronous
2237 and won't trigger these callbacks if called from Lua).
2240 \begin_layout Subsubsection
2241 Callback: on_err_save(string name)
2244 \begin_layout Standard
2245 Called if savestate goes wrong.
2248 \begin_layout Subsubsection
2249 Callback: on_post_save(string name, boolean is_savestate)
2252 \begin_layout Standard
2253 Called on successful savaestate.
2254 is_savestate gives if this was a savestate or a movie.
2257 \begin_layout Subsubsection
2261 \begin_layout Standard
2262 Called when emulator is shutting down.
2265 \begin_layout Subsubsection
2266 Callback: on_input(boolean subframe)
2269 \begin_layout Standard
2270 Called when emulator is just sending input to bsnes core.
2271 Warning: This is called even in readonly mode, but the results are ignored.
2274 \begin_layout Subsubsection
2275 Callback: on_reset()
2278 \begin_layout Standard
2279 Called when SNES is reset.
2282 \begin_layout Subsubsection
2283 Callback: on_readwrite()
2286 \begin_layout Standard
2287 Called when moving into readwrite mode as result of
2288 \begin_inset Quotes eld
2292 \begin_inset Quotes erd
2295 command (note: moving to rwmode by Lua won't trigger this, as per recursive
2299 \begin_layout Subsubsection
2300 Callback: on_snoop(number port, number controller, number index, number
2304 \begin_layout Standard
2305 Called each time bsnes asks for input.
2306 The value is the final value to be sent to bsnes core (readonly mode, autohold
2307 and autofire have been taken into account).
2308 Might be useful when translating movies to format suitable for console
2310 Note: There is no way to modify the value to be sent.
2313 \begin_layout Section
2314 Modifier and key names:
2317 \begin_layout Subsection
2321 \begin_layout Subsubsection
2325 \begin_layout Standard
2326 Following modifier names are known:
2329 \begin_layout Itemize
2330 ctrl, lctrl, rctrl: Control keys
2333 \begin_layout Itemize
2334 alt, lalt, ralt: ALT keys.
2337 \begin_layout Itemize
2338 shift, lshift, rshift: Shift keys.
2341 \begin_layout Itemize
2342 meta, lmeta, rmeta: Meta keys.
2345 \begin_layout Itemize
2346 num, caps: Numlock/Capslock (these are sticky!)
2349 \begin_layout Itemize
2353 \begin_layout Subsubsection
2357 \begin_layout Standard
2358 Following key names are known:
2361 \begin_layout Itemize
2362 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
2363 hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
2364 comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
2365 less, equals, greater, question, at, leftbracket, backslash, rightbracket,
2366 caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
2367 o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
2368 world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
2369 world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
2370 world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
2371 world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
2372 world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
2373 world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
2374 world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
2375 world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
2376 world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
2377 world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
2378 world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
2379 world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
2380 kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
2381 kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
2382 pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
2383 f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
2384 lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
2385 break, menu, power, euro, undo
2388 \begin_layout Itemize
2389 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
2390 hardware-dependent scan code of <n> (useful to bind those keys that don't
2391 have symbolic names).
2394 \begin_layout Standard
2395 In addition, following pseudo-keys are known (note: these do not work in
2396 conjunction with modifers):
2399 \begin_layout Itemize
2400 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
2403 \begin_layout Itemize
2404 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
2407 \begin_layout Itemize
2408 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
2411 \begin_layout Itemize
2412 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
2415 \begin_layout Itemize
2416 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
2419 \begin_layout Itemize
2420 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
2421 position (axis modes axis and axis_inverse).
2424 \begin_layout Itemize
2425 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
2426 position (axis modes axis and axis_inverse).
2429 \begin_layout Itemize
2430 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
2434 \begin_layout Subsubsection
2438 \begin_layout Itemize
2439 Escape: Enter/Exit Command mode, cancel modal dialogs.
2442 \begin_layout Itemize
2443 Return (also KPEnter): Execute command, ok modal dialog.
2446 \begin_layout Itemize
2447 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
2451 \begin_layout Itemize
2452 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
2456 \begin_layout Itemize
2457 Home (also KP7 if no num lock; command mode): Beginning of command.
2460 \begin_layout Itemize
2461 End (also KP1 if no num lock; command mode): End of command.
2464 \begin_layout Itemize
2465 Left (also KP4 if no num lock; command mode): Move cursor left.
2468 \begin_layout Itemize
2469 Right (also KP6 if no num lock; command mode): Move cursor right.
2472 \begin_layout Itemize
2474 if no num lock; command mode): Delete character to right of cursor.
2477 \begin_layout Itemize
2478 Insert (also KP0 if no num lock; command mode): Toggle between insert /
2482 \begin_layout Itemize
2483 Backspace (command mode): Delete character to left of cursor.
2486 \begin_layout Itemize
2487 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
2490 \begin_layout Subsubsection
2494 \begin_layout Standard
2495 If emulator does not reach internal polling loop in 15 seconds after leaving
2496 it or 15 seconds after starting, the emulator instantly bombs out.
2499 \begin_layout Section
2503 \begin_layout Standard
2504 Movie file is .zip archive in itself, normal ZIP archive tools work on it
2505 (note: If you recompress it, do not use compression methods other than
2506 store and deflate and especially do not use encryption of any kind).
2509 \begin_layout Subsection
2510 Detecting clean start/SRAM/Savestate
2513 \begin_layout Itemize
2515 \begin_inset Quotes eld
2519 \begin_inset Quotes erd
2522 it is savestate, otherwise:
2525 \begin_layout Itemize
2526 If file has members with names starting
2527 \begin_inset Quotes eld
2531 \begin_inset Quotes erd
2534 it is movie starting from SRAM, otherwise:
2537 \begin_layout Itemize
2538 It is movie starting from clear state.
2541 \begin_layout Subsection
2545 \begin_layout Standard
2546 Type of game ROM and region (as one line).
2550 \begin_layout Standard
2551 \begin_inset Tabular
2552 <lyxtabular version="3" rows="8" columns="3">
2553 <features tabularvalignment="middle">
2554 <column alignment="center" valignment="top" width="0">
2555 <column alignment="center" valignment="top" width="0">
2556 <column alignment="center" valignment="top" width="0">
2558 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2561 \begin_layout Plain Layout
2567 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2570 \begin_layout Plain Layout
2576 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2579 \begin_layout Plain Layout
2587 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2590 \begin_layout Plain Layout
2596 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2599 \begin_layout Plain Layout
2605 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2608 \begin_layout Plain Layout
2616 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2619 \begin_layout Plain Layout
2625 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2628 \begin_layout Plain Layout
2634 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2637 \begin_layout Plain Layout
2645 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2648 \begin_layout Plain Layout
2654 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2657 \begin_layout Plain Layout
2663 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2666 \begin_layout Plain Layout
2674 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2677 \begin_layout Plain Layout
2683 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2686 \begin_layout Plain Layout
2692 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2695 \begin_layout Plain Layout
2703 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2706 \begin_layout Plain Layout
2712 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2715 \begin_layout Plain Layout
2721 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2724 \begin_layout Plain Layout
2732 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2735 \begin_layout Plain Layout
2741 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2744 \begin_layout Plain Layout
2750 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2753 \begin_layout Plain Layout
2761 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2764 \begin_layout Plain Layout
2770 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2773 \begin_layout Plain Layout
2779 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2782 \begin_layout Plain Layout
2796 \begin_layout Standard
2800 \begin_layout Standard
2801 \begin_inset Tabular
2802 <lyxtabular version="3" rows="3" columns="2">
2803 <features tabularvalignment="middle">
2804 <column alignment="center" valignment="top" width="0">
2805 <column alignment="center" valignment="top" width="0">
2807 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2810 \begin_layout Plain Layout
2816 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2819 \begin_layout Plain Layout
2827 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2830 \begin_layout Plain Layout
2836 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2839 \begin_layout Plain Layout
2847 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2850 \begin_layout Plain Layout
2856 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2859 \begin_layout Plain Layout
2873 \begin_layout Subsection
2877 \begin_layout Standard
2878 Contains type of port #1 (as one line).
2879 Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
2880 If not present, defaults to 'gamepad'.
2883 \begin_layout Subsection
2887 \begin_layout Standard
2888 Contains type of port #2 (as one line).
2889 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
2890 'justifier' and 'justifiers'.
2891 If not present, defaults to 'none'.
2894 \begin_layout Subsection
2898 \begin_layout Standard
2899 Contains name of the game (as one line).
2902 \begin_layout Subsection
2906 \begin_layout Standard
2907 Contains authors, one per line.
2908 Part before '|' is the full name, part after is the nickname.
2911 \begin_layout Subsection
2915 \begin_layout Standard
2917 \begin_inset Quotes eld
2921 \begin_inset Quotes erd
2925 Used to reject other saves.
2928 \begin_layout Subsection
2929 Member: controlsversion
2932 \begin_layout Standard
2934 \begin_inset Quotes eld
2938 \begin_inset Quotes erd
2942 Used to identify what controls are there.
2945 \begin_layout Subsection
2947 \begin_inset Quotes eld
2951 \begin_inset Quotes erd
2957 \begin_layout Standard
2958 Contains bsnes core version number (as one line).
2961 \begin_layout Subsection
2965 \begin_layout Standard
2966 Contains project ID (as one line).
2967 Used to identify if two movies are part of the same project.
2970 \begin_layout Subsection
2971 Member: {rom,slota,slotb}{,xml}.sha256
2974 \begin_layout Standard
2975 Contains SHA-256 of said ROM or ROM mapping file (as one line).
2976 Absent if corresponding file is absent.
2979 \begin_layout Subsection
2980 Member: moviesram.<name>
2983 \begin_layout Standard
2984 Raw binary startup SRAM of kind <name>.
2985 Only present in savestates and movies starting from SRAM.
2988 \begin_layout Subsection
2992 \begin_layout Standard
2993 Raw binary movie state data.
2994 Only present in savestates.
2997 \begin_layout Standard
3001 \begin_layout Itemize
3002 32 bytes: SHA-256 of project ID.
3005 \begin_layout Itemize
3006 8 bytes: Big-endian current frame.
3009 \begin_layout Itemize
3010 100x4 bytes: Poll counters for each control (bit31 of each is
3011 \begin_inset Quotes eld
3015 \begin_inset Quotes erd
3021 \begin_layout Itemize
3022 8 bytes: Big-endian lag frame count.
3025 \begin_layout Itemize
3026 32 bytes: SHA-256 of past input
3029 \begin_layout Itemize
3030 32 bytes: SHA-256 of previous.
3033 \begin_layout Itemize
3034 (total of 512 bytes)
3037 \begin_layout Subsection
3041 \begin_layout Standard
3042 Raw binary dump of host memory.
3043 Only present in savestates.
3046 \begin_layout Subsection
3050 \begin_layout Standard
3051 The raw binary savestate itself.
3052 Savestate detection uses this file, only present in savestates.
3055 \begin_layout Subsection
3059 \begin_layout Standard
3060 Screenshot of current frame.
3061 Only present in savestates.
3062 First 2 bytes are big-endian width of image, rest are big-endian 15-bit
3063 image data (5 bits per channel*pixel, the MSB is unused).
3064 Height of image is inferred from the width and size of data.
3067 \begin_layout Subsection
3071 \begin_layout Standard
3072 Raw binary SRAM of kind <name> at time of savestate.
3073 Only present in savestates.
3076 \begin_layout Subsection
3080 \begin_layout Standard
3081 The actual input track, one line per subframe (blank lines are skipped).
3084 \begin_layout Itemize
3085 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
3086 part of same frame as previous, otherwise it starts a new frame.
3089 \begin_layout Itemize
3090 First subframe must start a new frame.
3093 \begin_layout Standard
3094 Length of movie in frames is number of lines in input file that start a
3098 \begin_layout Subsection
3102 \begin_layout Standard
3103 Contains textual base-10 rerecord count (as one line; emulator just writes
3104 this, it doesn't read it) + 1.
3107 \begin_layout Subsection
3111 \begin_layout Standard
3112 This member stores set of load IDs.
3113 There is one load ID per rerecord (plus one corresponding to start of project).
3116 \begin_layout Itemize
3117 This member constists of concatenation of records
3120 \begin_layout Itemize
3121 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
3125 \begin_layout Itemize
3126 IDs are interpretted as 256-bit big-endian integers with warparound.
3129 \begin_layout Itemize
3130 Initial predicted ID is all zeroes.
3133 \begin_layout Standard
3134 Format of each record is:
3137 \begin_layout Itemize
3138 1 byte: Opcode byte.
3139 Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
3143 \begin_layout Itemize
3144 32-prefixlen bytes of ID.
3147 \begin_layout Itemize
3148 countlen bytes of big-endian count (count).
3151 \begin_layout Standard
3152 Records are processed as follows:
3155 \begin_layout Itemize
3156 To form the first ID encoded by record, take the first prefixlen bytes predicted
3157 ID and append the read ID value to it.
3158 The result is the first ID encoded.
3161 \begin_layout Itemize
3162 If countlen is 0, record encodes 1 ID.
3165 \begin_layout Itemize
3166 If countlen is 1, record encodes 2+count IDs.
3169 \begin_layout Itemize
3170 If countlen is 2, record encodes 258+count IDs.
3173 \begin_layout Itemize
3174 If countlen is 3, record encodes 65794+count IDs.
3177 \begin_layout Itemize
3178 The new predicted ID is the next ID after last one encoded by the record.
3181 \begin_layout Standard
3182 The number of rerecords + 1 is equal to the sum of number of IDs encoded
3186 \begin_layout Subsection
3187 Member: starttime.second
3190 \begin_layout Standard
3191 Movie starting time, second part.
3192 Epoch is Unix epoch.
3193 Default is 1,000,000,000.
3196 \begin_layout Subsection
3197 Member: starttime.subsecond
3200 \begin_layout Standard
3201 Movie starting time, subsecond part.
3202 Unit is 1/3,462,619,485,020 s.
3206 \begin_layout Subsection
3207 Member: savetime.second
3210 \begin_layout Standard
3211 Movie saving time, second part.
3212 Default is starttime.second.
3213 Only present in savestates.
3216 \begin_layout Subsection
3217 Member: savetime.subsecond
3220 \begin_layout Standard
3221 Movie saving time, subsecond part.
3222 Default is starttime.subsecond.
3223 Only present in savestates.
3226 \begin_layout Section
3230 \begin_layout Subsection
3234 \begin_layout Standard
3235 make ui=ui-libsnes options=debugger profile=accuracy
3238 \begin_layout Itemize
3239 Yes, debugger is needed.
3242 \begin_layout Subsection
3243 Prerequisite libraries:
3246 \begin_layout Itemize
3250 \begin_layout Itemize
3254 \begin_layout Itemize
3255 SDLmain (Windows only; Note you may have to extract the object out of archive)
3258 \begin_layout Itemize
3262 \begin_layout Itemize
3266 \begin_layout Itemize
3267 boost conversion (header only)
3270 \begin_layout Subsection
3271 Compile options to make:
3274 \begin_layout Subsubsection
3278 \begin_layout Standard
3279 Set path to BSNES bsnes directory to <path>.
3282 \begin_layout Subsubsection
3286 \begin_layout Standard
3287 Don't use threads on Linux.
3290 \begin_layout Subsubsection
3294 \begin_layout Standard
3295 Try to use threads even on non-Linux systems.
3298 \begin_layout Subsubsection
3302 \begin_layout Standard
3303 Target C++ compiler to use.
3304 Defaults to g++-4.5.
3307 \begin_layout Standard
3308 Note: If crosscompiling, this has to be crosscompiler.
3311 \begin_layout Subsubsection
3315 \begin_layout Standard
3316 Host C++ compiler to use.
3317 Defaults to the same as CC.
3320 \begin_layout Standard
3321 Note: If crosscompiling, that has to be host compiler (the files produced
3322 will be run in the build process!)
3325 \begin_layout Subsubsection
3329 \begin_layout Standard
3330 Assume BSNES uses compatiblity core instead of accuracy core.
3333 \begin_layout Subsubsection
3337 \begin_layout Standard
3338 Don't compile in Lua support.
3341 \begin_layout Subsubsection
3345 \begin_layout Standard
3346 Disable time() interception.
3347 Prevents recording games using RTC but allows building on some platforms,
3351 \begin_layout Section
3352 Quick'n'dirty encode guide
3355 \begin_layout Enumerate
3356 Start the emulator and load the movie file.
3359 \begin_layout Enumerate
3360 Set large AVI option 'set-setting avi-large on'
3363 \begin_layout Enumerate
3364 If dumping PAL, set bottom border to 2 'set-setting avi-bottom-border 2'
3367 \begin_layout Enumerate
3368 Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are
3369 \begin_inset Quotes eld
3372 use only if you know what you are doing.
3373 \begin_inset Quotes erd
3377 In this case, these can be safely used because of how x264 internally works.
3380 \begin_layout Enumerate
3381 Unpause and let it run until you want to end dumping.
3384 \begin_layout Enumerate
3385 Close the emulator (closing the window is the easiest way)
3388 \begin_layout Enumerate
3389 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
3390 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
3393 \begin_layout Enumerate
3394 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
3397 \begin_layout Enumerate
3398 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
3399 + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
3402 \begin_layout Enumerate
3403 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
3404 Now final.mkv contains quick'n'dirty encode.
3407 \begin_layout Section
3411 \begin_layout Subsection
3412 Problems from BSNES core:
3415 \begin_layout Itemize
3416 The whole pending save stuff.
3419 \begin_layout Itemize
3420 Delay resets are slow.
3423 \begin_layout Itemize
3424 RTC is not emulated in sync-stable manner.
3427 \begin_layout Itemize
3428 Lack of layer hiding.
3431 \begin_layout Itemize
3435 \begin_layout Itemize
3436 Firmwares can't be loaded from ZIP archives.
3439 \begin_layout Itemize
3440 Manual polls can be corrupted if savestate occurs during those.
3443 \begin_layout Subsection
3447 \begin_layout Itemize
3448 Modifiers don't work with pseudo-keys (SDL).
3451 \begin_layout Itemize
3452 Audio for last dumped frame is not itself dumped.
3455 \begin_layout Itemize
3456 Audio in UI is pretty bad in quality.
3459 \begin_layout Itemize
3460 UI itself is 30fps max.
3463 \begin_layout Itemize
3464 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
3467 \begin_layout Itemize
3468 No menus, command based interface (SDL).
3471 \begin_layout Itemize
3472 Long commands don't scroll.
3475 \begin_layout Section
3479 \begin_layout Subsection
3483 \begin_layout Itemize
3487 \begin_layout Itemize
3488 Fix dumper video corruption with levels 10-18.
3491 \begin_layout Subsection
3495 \begin_layout Itemize
3499 \begin_layout Itemize
3500 Lots of code cleanups
3503 \begin_layout Itemize
3504 Lua interface to settings
3507 \begin_layout Itemize
3508 Allow specifying AVI borders without Lua
3511 \begin_layout Itemize
3512 Fix scaling if vscale > 1 and originx > 0 (left border exists)
3515 \begin_layout Itemize
3516 on_snoop lua callback
3519 \begin_layout Itemize
3520 Faster movie loading and saving.
3523 \begin_layout Subsection
3527 \begin_layout Itemize
3531 \begin_layout Subsection
3535 \begin_layout Itemize
3539 \begin_layout Itemize
3540 Save jukebox functionality.
3543 \begin_layout Subsection
3547 \begin_layout Itemize
3548 Try to fix some nasty failing movie load edge cases
3551 \begin_layout Itemize
3552 Allow specifying scripts to run on command line.
3555 \begin_layout Subsection
3559 \begin_layout Itemize
3560 Major source code reorganization.
3563 \begin_layout Itemize
3564 Backup savestates before overwriting.
3567 \begin_layout Itemize
3568 Don't crash if loading initial state fails.
3571 \begin_layout Subsection
3575 \begin_layout Itemize
3579 \begin_layout Itemize
3580 Fix author name parsing
3583 \begin_layout Itemize
3584 Fix rerecord counting
3587 \begin_layout Itemize
3588 (SDL) Print messages to console if SDL is uninitialized
3591 \begin_layout Itemize
3592 Add movieinfo program
3595 \begin_layout Itemize
3596 Fix loading movies starting from SRAM.
3599 \begin_layout Subsection
3603 \begin_layout Itemize
3604 Add support for unattended dumping
3607 \begin_layout Itemize
3608 Fix compiling for Win32
3611 \begin_layout Itemize
3612 Don't lock up if sound can't be initialized
3615 \begin_layout Itemize
3616 Strip trailing CR from commands
3619 \begin_layout Itemize
3620 Don't try to do dubious things in global ctors (fix crash on startup)
3623 \begin_layout Subsection
3627 \begin_layout Itemize
3628 Small documentation tweaking
3631 \begin_layout Itemize
3635 \begin_layout Itemize
3636 Fix major bug in modifier matching
3639 \begin_layout Subsection
3643 \begin_layout Itemize
3644 Lots of documentation fixes
3647 \begin_layout Itemize
3648 Use dedicated callbacks for event backcomm., not commands.
3651 \begin_layout Itemize
3652 Ensure that the watchdog is not hit when executing delayed reset.
3655 \begin_layout Itemize
3656 Remove errant tab from joystick message.
3659 \begin_layout Subsection
3663 \begin_layout Itemize
3664 Make autofire operate in absolute time, not linear time
3667 \begin_layout Itemize
3668 Reinitialize controls when resuming from loadstate
3671 \begin_layout Itemize
3672 Some more code cleanups
3675 \begin_layout Itemize
3676 If Lua allocator fails, call OOM_panic()
3679 \begin_layout Itemize
3680 Byte/word/dword/qword sized host memory write/read functions.
3683 \begin_layout Itemize
3684 Dump at correct framerate if dumping interlaced NTSC (height=448).
3687 \begin_layout Subsection
3691 \begin_layout Itemize
3692 Actually include the complete source code
3695 \begin_layout Itemize
3699 \begin_layout Subsection
3703 \begin_layout Itemize
3704 Document {save,start}time.{,sub}second.
3707 \begin_layout Itemize
3708 Intercept time() from bsnes core.