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 Subsection
70 \begin_layout Standard
71 These options control loading the ROM.
72 <kind> can be one of following:
80 bsx: BS-X flash ROM in non-slotted mode.
84 bsxslotted: BS-X flash ROM in slotted mode.
92 slot-a: Sufami Turbo Slot A.
96 slot-b: Sufami Turbo Slot B.
99 \begin_layout Subsubsection
103 \begin_layout Standard
104 Set the <file> to use as ROM of <kind>.
107 \begin_layout Subsubsection
111 \begin_layout Standard
112 Apply IPS patch <file> to ROM of <kind>
115 \begin_layout Subsubsection
119 \begin_layout Standard
120 Set the <file> to use as ROM mapping for <kind>.
121 If no mapping file is specified, defaults are used.
124 \begin_layout Subsubsection
125 --ips-<kind>-xml=<file>
128 \begin_layout Standard
129 Apply IPS patch <file> to ROM mapping for <kind>.
132 \begin_layout Subsubsection
133 --ips-offset=<offset>
136 \begin_layout Standard
137 Set IPS apply offset to <offset> (can be negative).
138 In practicular, <offset> of -512 might be handy for applying headered IPS
142 \begin_layout Subsubsection
146 \begin_layout Standard
147 Force ROM to be considered PAL-only (warning: Will cause error if used on
148 anything except SNES and SGB).
151 \begin_layout Subsubsection
155 \begin_layout Standard
156 Force ROM to be considered NTSC-only (default for everything except SNES
160 \begin_layout Subsection
164 \begin_layout Standard
165 If filename is not specified, new session is started.
166 These options control properties of that:
169 \begin_layout Subsubsection
173 \begin_layout Standard
174 Set type of port1 (default is 'gamepad').
175 Valid values are 'none', 'gamepad', 'multitap' (warning: makes most games
176 refuse to start) and 'mouse'.
179 \begin_layout Subsubsection
183 \begin_layout Standard
184 Set type of port2 (default is 'none').
185 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
186 'justifier' and 'justifiers'.
189 \begin_layout Subsubsection
193 \begin_layout Standard
194 Set the name of game to <name>
197 \begin_layout Subsubsection
201 \begin_layout Standard
202 Add author with full name of <name> (no nickname).
205 \begin_layout Subsubsection
209 \begin_layout Standard
210 Add author with nickname of <name> (no full name).
213 \begin_layout Subsubsection
214 --author=<fullname>|<nickname>
217 \begin_layout Standard
218 Add author with full name of <fullname> and nickname of <nickname>.
221 \begin_layout Subsection
225 \begin_layout Standard
226 If filename is specified on command line, it is loaded as initial state
227 (instead of constructing one).
230 \begin_layout Section
231 Startup file lsnes.rc
234 \begin_layout Standard
235 Upon startup, lsnes executes file lsnes.rc as commands.
236 This file is located in:
239 \begin_layout Itemize
244 lsnes.rc (if %APPDATA% exists)
247 \begin_layout Itemize
248 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
251 \begin_layout Itemize
252 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
255 \begin_layout Itemize
256 All: ./lsnes.rc (fallback default).
259 \begin_layout Standard
260 If leading directories do not exist, attempt to create them is made.
263 \begin_layout Section
264 Game internal commands
267 \begin_layout Itemize
268 Commands beginning with '*' invoke the corresponding command without alias
272 \begin_layout Itemize
273 If command starts with '+', the command is executed as-is when button is
274 pressed, and when button is released, it is executed with '+' replaced
278 \begin_layout Subsection
282 \begin_layout Standard
283 Settings control various aspects of emulator behaviour.
286 \begin_layout Subsubsection
287 set-setting <setting> <value>
290 \begin_layout Standard
291 Sets setting <setting> to value <value> (may be empty).
294 \begin_layout Subsubsection
295 unset-setting <setting>
298 \begin_layout Standard
299 Try to unset setting <setting> (not all settings can be unset).
302 \begin_layout Subsubsection
303 get-setting <setting>
306 \begin_layout Standard
307 Read value of setting <setting>
310 \begin_layout Subsubsection
314 \begin_layout Standard
315 Print names and values of all settings.
318 \begin_layout Subsection
322 \begin_layout Standard
323 Keybindings bind commands or aliases to keys (or pseudo-keys).
327 \begin_layout Standard
331 \begin_layout Itemize
332 Do not bind edge active (+/-) commands to keys with modifiers, that won't
336 \begin_layout Itemize
337 Names of keys and modifiers are platform-dependent.
340 \begin_layout Subsubsection
341 bind-key [<mod>/<modmask>] <key> <command>
344 \begin_layout Standard
345 Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
346 ed list) are set as <mod> (comma-seperated list).
350 \begin_layout Subsubsection
351 unbind-key [<mod>/<modmask>] <key>
354 \begin_layout Standard
355 Unbind command from <key> (with specified <mod> and <modmask>).
358 \begin_layout Subsubsection
362 \begin_layout Standard
363 Print all key bindings in effect.
366 \begin_layout Subsection
370 \begin_layout Standard
371 Aliases bind command to sequence of commands.
372 After alias has been defined, it replaces the command it shadows.
375 \begin_layout Standard
379 \begin_layout Itemize
380 You can't alias command to itself.
383 \begin_layout Itemize
384 Aliases starting with +/- are edge active just like ordinary commands starting
388 \begin_layout Itemize
389 One command can be aliased to multiple commands.
392 \begin_layout Subsubsection
393 alias-command <command> <expansion>
396 \begin_layout Standard
397 Append <expansion> to alias <command>.
400 \begin_layout Subsubsection
401 unalias-command <command>
404 \begin_layout Standard
405 Clear alias expansion for <command>.
408 \begin_layout Subsubsection
412 \begin_layout Standard
413 Print all aliases and their expansions in effect.
416 \begin_layout Subsection
420 \begin_layout Standard
421 Run <script> as if commands were entered on command line.
424 \begin_layout Subsection
428 \begin_layout Standard
429 Following commands control video dumping:
432 \begin_layout Subsubsection
433 dump-video <level> <prefix>
436 \begin_layout Standard
437 Dump video to prefix <prefix> at level <level> (0-18).
440 \begin_layout Itemize
441 The codec is Camstudio Codec.
444 \begin_layout Itemize
445 Audio enable/disable and framerate has no effect.
448 \begin_layout Itemize
449 Warning: Levels 10-18 are not compatible with AVISource (and don't seem
450 to be compatible with some ffmpeg versions either).
453 \begin_layout Itemize
454 Recomended level is 7.
457 \begin_layout Subsubsection
461 \begin_layout Standard
462 End current video dump.
465 \begin_layout Subsection
469 \begin_layout Standard
470 <address> may be decimal or hexadecimal (prefixed with '0x').
471 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
475 \begin_layout Standard
476 The available element <sizes> are:
479 \begin_layout Itemize
483 \begin_layout Itemize
487 \begin_layout Itemize
491 \begin_layout Itemize
495 \begin_layout Standard
496 When reading RAM and ROM, multi-byte reads/writes are big-endian.
497 When dealing with DSP memory, multi-byte reads/writes are native-endian
498 (do not use operand sizes exceeding DSP bitness, except dword is OK for
502 \begin_layout Subsubsection
503 read-<size> <address>
506 \begin_layout Standard
507 Read the value of byte in <address>.
510 \begin_layout Subsubsection
511 read-s<size> <address>
514 \begin_layout Standard
515 Read the value of signed byte in <address>.
518 \begin_layout Subsubsection
519 write-<size> <address> <value>
522 \begin_layout Standard
523 Write <value> to byte in address <address>.
526 \begin_layout Subsubsection
530 \begin_layout Standard
531 Reset the memory search
534 \begin_layout Subsubsection
538 \begin_layout Standard
539 Print number of candidates remaining
542 \begin_layout Subsubsection
546 \begin_layout Standard
547 Print all candidates remaining
550 \begin_layout Subsubsection
551 search-memory <usflag><sizeflag><op>
554 \begin_layout Standard
555 Searches memory for addresses satisfying criteria.
558 \begin_layout Standard
562 \begin_layout Itemize
566 \begin_layout Itemize
570 \begin_layout Standard
574 \begin_layout Itemize
578 \begin_layout Itemize
582 \begin_layout Itemize
586 \begin_layout Itemize
590 \begin_layout Standard
594 \begin_layout Itemize
595 lt: < previous value.
598 \begin_layout Itemize
599 le: <= previous value.
602 \begin_layout Itemize
603 eq: = previous value.
606 \begin_layout Itemize
607 ne: != previous value.
610 \begin_layout Itemize
611 ge: >= previous value.
614 \begin_layout Itemize
615 gt: > previous value.
618 \begin_layout Subsubsection
619 search-memory <sizeflag> <value>
622 \begin_layout Standard
623 Searches for addresses that currently have value <value>.
624 <sizeflag> is as in previous command.
627 \begin_layout Subsection
631 \begin_layout Standard
632 These commands are not available in lsnesrc, but are available after ROM
636 \begin_layout Subsubsection
640 \begin_layout Standard
641 Quits the emulator (asking for confirmation).
642 If /y is given, no confirmation is asked.
645 \begin_layout Subsubsection
649 \begin_layout Standard
650 Toggle paused/unpaused
653 \begin_layout Subsubsection
657 \begin_layout Standard
659 If the button is still held after configurable timeout expires, game unpauses
660 for the duration frame advance is held.
663 \begin_layout Subsubsection
667 \begin_layout Standard
669 If the button is still held after configurable timeout expires, game unpauses
670 for the duration frame advance is held.
673 \begin_layout Subsubsection
677 \begin_layout Standard
678 Skip to first poll in frame after current.
681 \begin_layout Subsubsection
685 \begin_layout Standard
686 Reset the SNES after this frame.
689 \begin_layout Subsubsection
690 load-state <filename>
693 \begin_layout Standard
694 Load savestate <filename> in readwrite mode.
697 \begin_layout Subsubsection
698 load-readonly <filename>
701 \begin_layout Standard
702 Load savestate <filename> in readonly mode.
705 \begin_layout Subsubsection
706 load-preserve <filename>
709 \begin_layout Standard
710 Load savestate <filename> in readonly mode, preserving current events.
713 \begin_layout Subsubsection
714 load-movie <filename>
717 \begin_layout Standard
718 Load savestate <filename>, ignoring save part in readonly mode.
721 \begin_layout Subsubsection
722 save-state <filename>
725 \begin_layout Standard
726 Save system state to <filename> as soon as possible.
729 \begin_layout Subsubsection
730 save-movie <filename>
733 \begin_layout Standard
734 Save movie to <filename>.
737 \begin_layout Subsubsection
741 \begin_layout Standard
745 \begin_layout Subsubsection
749 \begin_layout Standard
750 Set name of the game to <name>
753 \begin_layout Subsubsection
757 \begin_layout Standard
758 Print the name of the game.
761 \begin_layout Subsubsection
765 \begin_layout Standard
766 Adds new author <author>.
767 If <author> does not contain '|' it is full name.
768 If it contains '|', '|' splits the full name and nickname.
771 \begin_layout Subsubsection
772 edit-author <num> <author>
775 \begin_layout Standard
776 Edit the author in slot <num> (0-based) to be <author> (see add-author for
780 \begin_layout Subsubsection
784 \begin_layout Standard
785 Remove author in slot <num>
788 \begin_layout Subsubsection
792 \begin_layout Standard
796 \begin_layout Subsubsection
797 test-1, test-2, test-3
800 \begin_layout Standard
801 Internal test commands
804 \begin_layout Subsubsection
805 take-screenshot <filename>
808 \begin_layout Standard
809 Save screenshot to <filename>.
812 \begin_layout Subsubsection
813 +controller<num><button>
816 \begin_layout Standard
817 Press button <button> on controller <num> (1-8).
818 The following button names are known:
821 \begin_layout Itemize
825 \begin_layout Itemize
829 \begin_layout Itemize
833 \begin_layout Itemize
837 \begin_layout Itemize
841 \begin_layout Itemize
845 \begin_layout Itemize
849 \begin_layout Itemize
853 \begin_layout Itemize
857 \begin_layout Itemize
861 \begin_layout Itemize
865 \begin_layout Itemize
869 \begin_layout Itemize
873 \begin_layout Itemize
877 \begin_layout Itemize
881 \begin_layout Itemize
885 \begin_layout Subsubsection
886 controllerh<num><button>
889 \begin_layout Standard
890 Hold/unhold button <button> on controller <num> (1-8).
891 See +controller for button names.
894 \begin_layout Subsubsection
898 \begin_layout Standard
902 \begin_layout Subsection
906 \begin_layout Standard
907 Only available if lua support is compiled in.
910 \begin_layout Subsubsection
914 \begin_layout Standard
915 Run Lua code <luacode> using built-in Lua interpretter.
918 \begin_layout Subsubsection
922 \begin_layout Standard
923 Run specified lua file using built-in Lua interpretter.
926 \begin_layout Subsection
930 \begin_layout Subsubsection
931 add-watch <name> <expression>
934 \begin_layout Standard
935 Adds new watch (or modifies old one).
938 \begin_layout Subsubsection
942 \begin_layout Standard
946 \begin_layout Section
950 \begin_layout Subsection
954 \begin_layout Standard
955 Set where bsnes looks for firmware files.
957 \begin_inset Quotes eld
961 \begin_inset Quotes erd
967 \begin_layout Subsection
971 \begin_layout Standard
973 Numeric, range is 0.001 to
974 \begin_inset Quotes eld
978 \begin_inset Quotes erd
982 Default is native framerate.
985 \begin_layout Subsection
989 \begin_layout Standard
990 Set save compression level (integer 0-9).
991 Default is 7 (0 is no compression).
994 \begin_layout Subsection
998 \begin_layout Standard
999 Set the frame advance timeout in milliseconds.
1000 Numeric integer, range is 0-999999999.
1004 \begin_layout Section
1008 \begin_layout Subsection
1012 \begin_layout Standard
1013 Print line to message console.
1016 \begin_layout Subsection
1017 bit.none(number...) / bit.bnot(number...)
1020 \begin_layout Standard
1021 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1025 \begin_layout Subsection
1026 bit.any(number...) / bit.bor(number...)
1029 \begin_layout Standard
1030 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1033 \begin_layout Subsection
1034 bit.all(number...) / bit.band(number...)
1037 \begin_layout Standard
1038 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1042 \begin_layout Subsection
1043 bit.parity(number...) / bit.bxor(number...)
1046 \begin_layout Standard
1047 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1051 \begin_layout Subsection
1052 bit.lrotate(number base[, number amount[, number bits]])
1055 \begin_layout Standard
1056 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1059 \begin_layout Subsection
1060 bit.rrotate(number base[, number amount[, number bits]])
1063 \begin_layout Standard
1064 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1068 \begin_layout Subsection
1069 bit.lshift(number base[, number amount[, number bits]])
1072 \begin_layout Standard
1073 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1074 The new bits are filled with zeroes.
1077 \begin_layout Subsection
1078 bit.lrshift(number base[, number amount[, number bits]])
1081 \begin_layout Standard
1082 Shift bits-bit (max 48, default 48) number logically right by amount (default
1084 The new bits are filled with zeroes.
1087 \begin_layout Subsection
1088 bit.arshift(number base[, number amount[, number bits]])
1091 \begin_layout Standard
1092 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1094 The new bits are shifted in with copy of the high bit.
1097 \begin_layout Subsection
1101 \begin_layout Standard
1102 Returns 5-tuple (hresolution, vresolution, rshift, gshift, bshift).
1103 Only available in on_paint() and on_video() callbacks.
1106 \begin_layout Subsection
1107 gui.<class>_gap(number gap)
1110 \begin_layout Standard
1111 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1113 Only available in on_paint() and on_video() callbacks.
1116 \begin_layout Subsection
1117 gui.text(number x, number y, string text[, number fgc[, number fga[, number
1118 bgc[, number bga]]]])
1121 \begin_layout Standard
1122 Draw text on the GUI.
1123 Font size is 8(or 16) by 16.
1127 \begin_layout Itemize
1128 Coordinate origin is at top-left of the game area.
1129 Left and top gaps have negative coordinates.
1132 \begin_layout Itemize
1133 Use gui.resolution() to discover how to layout colors.
1136 \begin_layout Itemize
1137 Alpha range is 0(transparent)-256(opaque).
1140 \begin_layout Itemize
1141 Only available in on_paint() and on_video() callbacks.
1144 \begin_layout Subsection
1148 \begin_layout Standard
1149 Request on_repaint() to happen as soon as possible.
1152 \begin_layout Subsection
1153 gui.subframe_update(boolean on)
1156 \begin_layout Standard
1157 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
1158 or not happen (on=false).
1161 \begin_layout Subsection
1162 input.get(number controller, number index)
1165 \begin_layout Standard
1166 Read the specified index (0-11) from specified controller (0-7).
1170 \begin_layout Itemize
1171 Uses physical controller numbering.
1172 Gamepad in port 2 is controller 4, not 1!
1175 \begin_layout Itemize
1176 Only available in on_input callback.
1179 \begin_layout Subsection
1180 input.set(number controller, number index, number value)
1183 \begin_layout Standard
1184 Write the specified index (0-11) from specified controller (0-7), storing
1189 \begin_layout Itemize
1190 Uses physical controller numbering.
1191 Gamepad in port 2 is controller 4, not 1!
1194 \begin_layout Itemize
1195 Only available in on_input callback.
1198 \begin_layout Subsection
1199 input.reset([number cycles])
1202 \begin_layout Standard
1204 If cycles is greater than zero, do delayed reset.
1207 \begin_layout Itemize
1208 Only available in on_input callback with subframe flag false.
1211 \begin_layout Subsection
1212 hostmemory.read(number address)
1215 \begin_layout Standard
1216 Reads hostmemory slot address.
1217 Slot numbers out of range return false instead of numeric.
1220 \begin_layout Subsection
1221 hostmemory.write(number address, number value)
1224 \begin_layout Standard
1225 Writes hostmemory slot with 0-255.
1226 Slot numbers out of range cause extension of host memory slot space.
1229 \begin_layout Subsection
1230 movie.currentframe()
1233 \begin_layout Standard
1234 Return number of current frame.
1237 \begin_layout Subsection
1241 \begin_layout Standard
1242 Return number of frames in movie.
1245 \begin_layout Subsection
1249 \begin_layout Standard
1250 Return true if in readonly mode, false if in readwrite.
1253 \begin_layout Subsection
1254 movie.set_readwrite()
1257 \begin_layout Standard
1258 Set readwrite mode (does not cause on_readwrite callback).
1261 \begin_layout Subsection
1262 movie.frame_subframes(number frame)
1265 \begin_layout Standard
1266 Count number of subframes in specified frame (frame numbers are 1-based)
1270 \begin_layout Subsection
1271 movie.read_subframe(number frame, number subframe)
1274 \begin_layout Standard
1275 Read specifed subframe in specified frame and return data as array (100
1276 elements, numbered 0-99 currently).
1279 \begin_layout Subsection
1280 Callback: on_paint()
1283 \begin_layout Standard
1284 Called when screen is being painted.
1285 Any gui.* calls requiring graphic context draw on the screen.
1288 \begin_layout Subsection
1289 Callback: on_video()
1292 \begin_layout Standard
1293 Called when video dump frame is being painted.
1294 Any gui.* calls requiring graphic context draw on the video.
1297 \begin_layout Subsection
1298 Callback: on_startup()
1301 \begin_layout Standard
1302 Called when the emulator is starting (lsnes.rc has been run).
1305 \begin_layout Subsection
1306 Callback: on_pre_load(string name)
1309 \begin_layout Standard
1310 Called just before savestate/movie load occurs (note: loads are always delayed,
1311 so this occurs even when load was initiated by lua).
1314 \begin_layout Subsection
1315 Callback: on_err_load(string name)
1318 \begin_layout Standard
1319 Called if loadstate goes wrong.
1322 \begin_layout Subsection
1323 Callback: on_post_load(string name, boolean was_savestate)
1326 \begin_layout Standard
1327 Called on successful loadstate.
1328 was_savestate gives if this was a savestate or a movie.
1331 \begin_layout Subsection
1332 Callback: on_pre_save(string name, boolean is_savestate)
1335 \begin_layout Standard
1336 Called just before savestate save occurs (note: movie saves are synchronous
1337 and won't trigger these callbacks if called from Lua).
1340 \begin_layout Subsection
1341 Callback: on_err_save(string name)
1344 \begin_layout Standard
1345 Called if savestate goes wrong.
1348 \begin_layout Subsection
1349 Callback: on_post_save(string name, boolean is_savestate)
1352 \begin_layout Standard
1353 Called on successful savaestate.
1354 is_savestate gives if this was a savestate or a movie.
1357 \begin_layout Subsection
1361 \begin_layout Standard
1362 Called when emulator is shutting down.
1365 \begin_layout Subsection
1366 Callback: on_input(boolean subframe)
1369 \begin_layout Standard
1370 Called when emulator is just sending input to bsnes core.
1371 Warning: This is called even in readonly mode, but the results are ignored.
1374 \begin_layout Subsection
1375 Callback: on_reset()
1378 \begin_layout Standard
1379 Called when SNES is reset.
1382 \begin_layout Subsection
1383 Callback: on_readwrite()
1386 \begin_layout Standard
1387 Called when moving into readwrite mode as result of
1388 \begin_inset Quotes eld
1392 \begin_inset Quotes erd
1395 command (note: moving to rwmode by Lua won't trigger this, as per recursive
1399 \begin_layout Section
1403 \begin_layout Subsection
1404 Platform-specific commands:
1407 \begin_layout Subsubsection
1411 \begin_layout Standard
1412 Enable sounds in GUI (has no effect on video dumping).
1415 \begin_layout Subsubsection
1419 \begin_layout Standard
1420 Disable sounds in GUI (has no effect on video dumping).
1423 \begin_layout Subsubsection
1427 \begin_layout Standard
1428 Asks to press a key and then identifies that key.
1431 \begin_layout Subsubsection
1432 set-autorepeat <delay> <repeat>
1435 \begin_layout Standard
1436 Set keyboard autorepeat.
1437 <delay> is before first autorepeat, <repeat> is between autorepeats.
1441 \begin_layout Subsubsection
1445 \begin_layout Standard
1446 Toggle between windowed/fullscreen console.
1449 \begin_layout Subsubsection
1453 \begin_layout Standard
1454 Scroll messages window as far back as it goes.
1457 \begin_layout Subsubsection
1461 \begin_layout Standard
1462 Scroll messages window as far forward as it goes.
1465 \begin_layout Subsubsection
1469 \begin_layout Standard
1470 Scroll messages window back one screenful.
1473 \begin_layout Subsubsection
1477 \begin_layout Standard
1478 Scroll messages window forward one screenful.
1481 \begin_layout Subsection
1485 \begin_layout Standard
1486 Following modifier names are known:
1489 \begin_layout Itemize
1490 ctrl, lctrl, rctrl: Control keys
1493 \begin_layout Itemize
1494 alt, lalt, ralt: ALT keys.
1497 \begin_layout Itemize
1498 shift, lshift, rshift: Shift keys.
1501 \begin_layout Itemize
1502 meta, lmeta, rmeta: Meta keys.
1505 \begin_layout Itemize
1506 num, caps: Numlock/Capslock (these are sticky!)
1509 \begin_layout Itemize
1513 \begin_layout Subsection
1517 \begin_layout Standard
1518 Following key names are known:
1521 \begin_layout Itemize
1522 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
1523 hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
1524 comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
1525 less, equals, greater, question, at, leftbracket, backslash, rightbracket,
1526 caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
1527 o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
1528 world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
1529 world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
1530 world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
1531 world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
1532 world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
1533 world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
1534 world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
1535 world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
1536 world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
1537 world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
1538 world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
1539 world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
1540 kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
1541 kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
1542 pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
1543 f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
1544 lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
1545 break, menu, power, euro, undo
1548 \begin_layout Itemize
1549 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
1550 hardware-dependent scan code of <n> (useful to bind those keys that don't
1551 have symbolic names).
1554 \begin_layout Standard
1555 In addition, following pseudo-keys are known (note: these do not work yet,
1556 and especially do not work in conjunction with modifers):
1559 \begin_layout Itemize
1560 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
1563 \begin_layout Itemize
1564 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
1567 \begin_layout Itemize
1568 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
1571 \begin_layout Itemize
1572 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
1575 \begin_layout Itemize
1576 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
1579 \begin_layout Itemize
1580 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
1584 \begin_layout Itemize
1585 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
1589 \begin_layout Subsection
1593 \begin_layout Itemize
1594 Escape: Enter/Exit Command mode, cancel modal dialogs.
1597 \begin_layout Itemize
1598 Return (also KPEnter): Execute command, ok modal dialog.
1601 \begin_layout Itemize
1602 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
1606 \begin_layout Itemize
1607 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
1611 \begin_layout Itemize
1612 Home (also KP7 if no num lock; command mode): Beginning of command.
1615 \begin_layout Itemize
1616 End (also KP1 if no num lock; command mode): End of command.
1619 \begin_layout Itemize
1620 Left (also KP4 if no num lock; command mode): Move cursor left.
1623 \begin_layout Itemize
1624 Right (also KP6 if no num lock; command mode): Move cursor right.
1627 \begin_layout Itemize
1629 if no num lock; command mode): Delete character to right of cursor.
1632 \begin_layout Itemize
1633 Insert (also KP0 if no num lock; command mode): Toggle between insert /
1637 \begin_layout Itemize
1638 Backspace (command mode): Delete character to left of cursor.
1641 \begin_layout Itemize
1642 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
1645 \begin_layout Subsection
1649 \begin_layout Standard
1650 If emulator does not reach internal polling loop in 15 seconds after leaving
1651 it or 15 seconds after starting, the emulator instantly bombs out.
1654 \begin_layout Section
1658 \begin_layout Standard
1659 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1660 (note: If you recompress it, do not use compression methods other than
1661 store and deflate and especially do not use encryption of any kind).
1664 \begin_layout Subsection
1665 Detecting clean start/SRAM/Savestate
1668 \begin_layout Itemize
1670 \begin_inset Quotes eld
1674 \begin_inset Quotes erd
1677 it is savestate, otherwise:
1680 \begin_layout Itemize
1681 If file has members with names starting
1682 \begin_inset Quotes eld
1686 \begin_inset Quotes erd
1689 it is movie starting from SRAM, otherwise:
1692 \begin_layout Itemize
1693 It is movie starting from clear state.
1696 \begin_layout Subsection
1700 \begin_layout Standard
1701 Type of game ROM and region.
1705 \begin_layout Standard
1706 \begin_inset Tabular
1707 <lyxtabular version="3" rows="8" columns="3">
1708 <features tabularvalignment="middle">
1709 <column alignment="center" valignment="top" width="0">
1710 <column alignment="center" valignment="top" width="0">
1711 <column alignment="center" valignment="top" width="0">
1713 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1716 \begin_layout Plain Layout
1722 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1725 \begin_layout Plain Layout
1731 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1734 \begin_layout Plain Layout
1742 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1745 \begin_layout Plain Layout
1751 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1754 \begin_layout Plain Layout
1760 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1763 \begin_layout Plain Layout
1771 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1774 \begin_layout Plain Layout
1780 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1783 \begin_layout Plain Layout
1789 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1792 \begin_layout Plain Layout
1800 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1803 \begin_layout Plain Layout
1809 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1812 \begin_layout Plain Layout
1818 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1821 \begin_layout Plain Layout
1829 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1832 \begin_layout Plain Layout
1838 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1841 \begin_layout Plain Layout
1847 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1850 \begin_layout Plain Layout
1858 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1861 \begin_layout Plain Layout
1867 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1870 \begin_layout Plain Layout
1876 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1879 \begin_layout Plain Layout
1887 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1890 \begin_layout Plain Layout
1896 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1899 \begin_layout Plain Layout
1905 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1908 \begin_layout Plain Layout
1916 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1919 \begin_layout Plain Layout
1925 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1928 \begin_layout Plain Layout
1934 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1937 \begin_layout Plain Layout
1951 \begin_layout Standard
1955 \begin_layout Standard
1956 \begin_inset Tabular
1957 <lyxtabular version="3" rows="3" columns="2">
1958 <features tabularvalignment="middle">
1959 <column alignment="center" valignment="top" width="0">
1960 <column alignment="center" valignment="top" width="0">
1962 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1965 \begin_layout Plain Layout
1971 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1974 \begin_layout Plain Layout
1982 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1985 \begin_layout Plain Layout
1991 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1994 \begin_layout Plain Layout
2002 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2005 \begin_layout Plain Layout
2011 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2014 \begin_layout Plain Layout
2028 \begin_layout Subsection
2032 \begin_layout Standard
2033 Contains type of port #1.
2034 Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
2035 If not present, defaults to 'gamepad'.
2038 \begin_layout Subsection
2042 \begin_layout Standard
2043 Contains type of port #2.
2044 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
2045 'justifier' and 'justifiers'.
2046 If not present, defaults to 'none'.
2049 \begin_layout Subsection
2053 \begin_layout Standard
2054 Contains name of the game.
2057 \begin_layout Subsection
2061 \begin_layout Standard
2062 Contains authors, one per line.
2063 Part before '|' is the full name, part after is the nickname.
2066 \begin_layout Subsection
2070 \begin_layout Standard
2072 \begin_inset Quotes eld
2076 \begin_inset Quotes erd
2080 Used to reject other saves.
2083 \begin_layout Subsection
2084 Member: controlsversion
2087 \begin_layout Standard
2089 \begin_inset Quotes eld
2093 \begin_inset Quotes erd
2097 Used to identify what controls are there.
2100 \begin_layout Subsection
2102 \begin_inset Quotes eld
2106 \begin_inset Quotes erd
2112 \begin_layout Standard
2113 Contains bsnes core version number.
2116 \begin_layout Subsection
2120 \begin_layout Standard
2121 Contains project ID.
2122 Used to identify if two movies are part of the same project.
2125 \begin_layout Subsection
2126 Member: {rom,slota,slotb}{,xml}.sha256
2129 \begin_layout Standard
2130 Contains SHA-256 of said ROM or ROM mapping file.
2131 Absent if corresponding file is absent.
2134 \begin_layout Subsection
2135 Member: moviesram.<name>
2138 \begin_layout Standard
2139 Raw binary startup SRAM of kind <name>.
2140 Only present in savestates and movies starting from SRAM.
2143 \begin_layout Subsection
2147 \begin_layout Standard
2148 Raw binary movie state data.
2149 Only present in savestates.
2152 \begin_layout Standard
2156 \begin_layout Itemize
2157 32 bytes: SHA-256 of project ID.
2160 \begin_layout Itemize
2161 8 bytes: Big-endian current frame.
2164 \begin_layout Itemize
2165 100x4 bytes: Poll counters for each control (bit31 of each is
2166 \begin_inset Quotes eld
2170 \begin_inset Quotes erd
2176 \begin_layout Itemize
2177 8 bytes: Big-endian lag frame count.
2180 \begin_layout Itemize
2181 32 bytes: SHA-256 of past input
2184 \begin_layout Itemize
2185 32 bytes: SHA-256 of previous.
2188 \begin_layout Subsection
2192 \begin_layout Standard
2193 Raw binary dump of host memory.
2194 Only present in savestates.
2197 \begin_layout Subsection
2201 \begin_layout Standard
2202 The savestate itself.
2203 Savestate detection uses this file, only present in savestates.
2206 \begin_layout Subsection
2210 \begin_layout Standard
2211 Screenshot of current frame.
2212 Only present in savestates.
2215 \begin_layout Subsection
2219 \begin_layout Standard
2220 Raw binary SRAM of kind <name> at time of savestate.
2221 Only present in savestates.
2224 \begin_layout Subsection
2228 \begin_layout Standard
2229 The actual input track, one line per subframe (blank lines are skipped).
2232 \begin_layout Itemize
2233 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
2234 part of same frame as previous, otherwise it starts a new frame.
2237 \begin_layout Itemize
2238 First subframe must start a new frame.
2241 \begin_layout Standard
2242 Length of movie in frames is number of lines in input file that start a
2246 \begin_layout Subsection
2250 \begin_layout Standard
2251 Contains textual base-10 rerecord count (emulator just writes this, it doesn't
2255 \begin_layout Subsection
2259 \begin_layout Standard
2260 This member stores set of load IDs.
2261 There is one load ID per rerecord (plus one corresponding to start of project).
2264 \begin_layout Itemize
2265 This member constists of concatenation of records
2268 \begin_layout Itemize
2269 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2273 \begin_layout Itemize
2274 IDs are interpretted as 256-bit big-endian integers with warparound.
2277 \begin_layout Itemize
2278 Initial predicted ID is all zeroes.
2281 \begin_layout Standard
2282 Format of each record is:
2285 \begin_layout Itemize
2286 1 byte: Opcode byte.
2287 Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2291 \begin_layout Itemize
2292 32-prefixlen bytes of ID.
2295 \begin_layout Itemize
2296 countlen bytes of big-endian count (count).
2299 \begin_layout Standard
2300 Records are processed as follows:
2303 \begin_layout Itemize
2304 To form the first ID encoded by record, take the first prefixlen bytes predicted
2305 ID and append the read ID value to it.
2306 The result is the first ID encoded.
2309 \begin_layout Itemize
2310 If countlen is 0, record encodes 1 ID.
2313 \begin_layout Itemize
2314 If countlen is 1, record encodes 2+count IDs.
2317 \begin_layout Itemize
2318 If countlen is 2, record encodes 258+count IDs.
2321 \begin_layout Itemize
2322 If countlen is 3, record encodes 65794+count IDs.
2325 \begin_layout Itemize
2326 The new predicted ID is the next ID after last one encoded by the record.
2329 \begin_layout Standard
2330 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2334 \begin_layout Section
2338 \begin_layout Subsection
2342 \begin_layout Standard
2343 make ui=ui-libsnes options=debugger profile=accuracy
2346 \begin_layout Itemize
2347 Yes, debugger is needed.
2350 \begin_layout Subsection
2351 Prerequisite libraries:
2354 \begin_layout Itemize
2358 \begin_layout Itemize
2362 \begin_layout Itemize
2366 \begin_layout Itemize
2370 \begin_layout Itemize
2374 \begin_layout Subsection
2375 Compile options to make:
2378 \begin_layout Subsubsection
2382 \begin_layout Standard
2383 Set path to BSNES bsnes directory to <path>.
2386 \begin_layout Subsubsection
2390 \begin_layout Standard
2391 Don't use threads (makes dumping slower, but threads probably only work
2395 \begin_layout Subsubsection
2399 \begin_layout Standard
2400 (cross) C++ compiler to use.
2404 \begin_layout Subsubsection
2408 \begin_layout Standard
2409 (host) C++ compiler to use.
2410 Defaults to the same as CC.
2413 \begin_layout Subsubsection
2417 \begin_layout Standard
2418 Assume BSNES uses compatiblity core instead of accuracy core.
2421 \begin_layout Subsubsection
2425 \begin_layout Standard
2426 Don't compile in Lua support.
2429 \begin_layout Section
2433 \begin_layout Subsection
2434 Problems from BSNES core:
2437 \begin_layout Itemize
2438 The whole pending save stuff.
2441 \begin_layout Itemize
2442 Delay resets are slow.
2445 \begin_layout Itemize
2446 RTC is not emulated in sync-stable manner.
2449 \begin_layout Itemize
2450 Lack of layer hiding.
2453 \begin_layout Itemize
2457 \begin_layout Itemize
2458 Firmwares can't be loaded from ZIP archives.
2461 \begin_layout Itemize
2462 Manual polls can be corrupted if savestate occurs during those.
2465 \begin_layout Subsection
2469 \begin_layout Itemize
2470 Make it build on Windows (and build binaries).
2471 Not todo for rr0-β0.
2474 \begin_layout Subsection
2478 \begin_layout Itemize
2479 Audio for last dumped frame is not itself dumped.
2482 \begin_layout Itemize
2483 Audio in UI is pretty bad in quality.
2486 \begin_layout Itemize
2487 UI itself is 30fps max.
2490 \begin_layout Itemize
2491 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
2494 \begin_layout Itemize
2495 No menus, command based interface (SDL).
2498 \begin_layout Itemize
2499 Long commands don't scroll.
2502 \begin_layout Itemize
2506 \begin_layout Itemize
2507 Joysticks don't work.