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.
74 \begin_layout Enumerate
75 bsnes libsnes (for bsnes SNES core)
79 \begin_layout Enumerate
80 v084-v087 (v084 or v085 for delayreset support)
83 \begin_layout Enumerate
84 accuracy or compatiblity core with debugger enabled.
87 \begin_layout Enumerate
88 Patched version (using included 7 patches)
92 \begin_layout Enumerate
93 gambatte (for gambatte core)
97 \begin_layout Enumerate
98 SVN r320, r358 or r364
101 \begin_layout Enumerate
102 Patched with included patches
106 \begin_layout Enumerate
110 \begin_layout Enumerate
114 \begin_layout Enumerate
118 \begin_layout Enumerate
119 boost_thread (if native std::thread is not available)
122 \begin_layout Enumerate
126 \begin_layout Enumerate
127 sdlmain (SDL only, part of SDL)
130 \begin_layout Enumerate
131 boost_conversion (this is header-only library)
134 \begin_layout Enumerate
135 libswscale (wxwidgets graphics only)
138 \begin_layout Enumerate
139 Portaudio (portaudio sound only)
142 \begin_layout Enumerate
143 libao (libao sound only)
146 \begin_layout Enumerate
147 Lua version 5.1.X or 5.2.X
150 \begin_layout Enumerate
154 \begin_layout Enumerate
155 libopus (optional, for commentary track tool)
158 \begin_layout Section
162 \begin_layout Itemize
163 Copy bsnes sources (the bsnes subdirectory) to subdirectory 'bsnes' (for
167 \begin_layout Itemize
168 Copy gambatte sources to subdirectory 'gambatte' (for gambatte core).
171 \begin_layout Itemize
172 Patch the bsnes sources with included patches (directory 'bsnes-patches/<version
176 \begin_layout Itemize
177 Patch the gambatte sources with included patches (directory 'gambatte-patches/<v
178 ersion>', gambatte core)
181 \begin_layout Itemize
182 Edit options.build (or copy of that file)
185 \begin_layout Itemize
186 Run make (passing 'OPTIONS=<filename>' if using something else than options.build
190 \begin_layout Section
194 \begin_layout Subsection
198 \begin_layout Subsubsection
202 \begin_layout Standard
206 \begin_layout Subsubsection
210 \begin_layout Standard
214 \begin_layout Subsubsection
218 \begin_layout Standard
219 Load <file> as movie or savestate file on startup.
222 \begin_layout Subsubsection
226 \begin_layout Standard
227 Instead of starting the emulator, only display the settings.
230 \begin_layout Subsubsection
234 \begin_layout Standard
235 Instead of starting the emulator, display the plugin manager (useful to
236 disable some plugin that causes emulator to crash on startup)
239 \begin_layout Subsubsection
243 \begin_layout Standard
244 Run this Lua file on startup
247 \begin_layout Subsection
248 dump options (lsnes-dumpavi only)
251 \begin_layout Subsubsection
255 \begin_layout Standard
260 \begin_layout Subsubsection
264 \begin_layout Standard
265 Load <filename> as movie or savestate file on startup.
269 \begin_layout Subsubsection
273 \begin_layout Standard
274 Set the dumper to use (required).
275 Use 'list' for listing of known dumpers.
278 \begin_layout Subsubsection
279 --firmware-path=<path>
282 \begin_layout Standard
283 Set path to look for firmware.
286 \begin_layout Subsubsection
290 \begin_layout Standard
291 Set the mode to use (required for dumpers with multiple modes, forbidden
293 Use 'list' for known modes.
296 \begin_layout Subsubsection
300 \begin_layout Standard
303 \begin_inset Quotes eld
307 \begin_inset Quotes erd
313 \begin_layout Subsubsection
314 --option=<name>=<value>
317 \begin_layout Standard
318 Set option <name> to value <value>.
321 \begin_layout Subsubsection
325 \begin_layout Standard
326 Set number of frames to dump.
327 Mandatory, unless --overdump-length is specified.
330 \begin_layout Subsubsection
331 --overdump-length=<length>
334 \begin_layout Standard
335 Set number of frames to dump after movie end.
336 Mutually exclusive with --length.
339 \begin_layout Subsubsection
343 \begin_layout Standard
344 Run specified lua script (lsnes-dumpavi does not have initialization files).
347 \begin_layout Subsubsection
348 --load-library=<library>
351 \begin_layout Standard
352 Load the specified shared object / dynamic library / dynamic link library.
355 \begin_layout Subsection
356 lsnes settings directory
359 \begin_layout Standard
360 The lsnes settings directory is (in order of decreasing perference):
363 \begin_layout Itemize
366 lsnes (if %APPDATA% exists)
369 \begin_layout Itemize
370 Unix: $XDG_CONFIG_HOME/lsnes (if $XDG_CONFIG_HOME exists)
373 \begin_layout Itemize
374 Unix: $HOME/.config/lsnes (if $HOME exists)
377 \begin_layout Itemize
382 \begin_layout Standard
383 If leading directories do not exist, attempt to create them is made.
386 \begin_layout Section
390 \begin_layout Itemize
391 Commands beginning with '*' invoke the corresponding command without alias
395 \begin_layout Itemize
396 If command starts with '+' (after possible '*'), the command is executed
397 as-is when button is pressed, and when button is released, it is executed
398 with '+' replaced by '-'.
401 \begin_layout Itemize
402 Commands without '+' execute only on negative edge (release).
405 \begin_layout Subsection
409 \begin_layout Standard
410 Run <script> as if commands were entered on the command line.
413 \begin_layout Subsection
417 \begin_layout Standard
418 <address> may be decimal or hexadecimal (prefixed with '0x').
419 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
423 \begin_layout Standard
424 The available element <sizes> are:
427 \begin_layout Itemize
431 \begin_layout Itemize
435 \begin_layout Itemize
439 \begin_layout Itemize
443 \begin_layout Itemize
447 \begin_layout Itemize
448 float: 4 bytes (floating-point)
451 \begin_layout Itemize
452 double: 8 bytes (floating-point)
455 \begin_layout Standard
456 When reading RAM and ROM, multi-byte reads/writes are big-endian.
457 When dealing with DSP memory, multi-byte reads/writes are native-endian
458 (do not use operand sizes exceeding DSP bitness, except dword is OK for
462 \begin_layout Subsubsection
463 read-<size> <address>
466 \begin_layout Standard
467 Read the value of byte in <address>.
470 \begin_layout Subsubsection
471 read-s<size> <address>
474 \begin_layout Standard
475 Read the value of signed byte in <address>.
478 \begin_layout Subsubsection
479 write-<size> <address> <value>
482 \begin_layout Standard
483 Write <value> to byte in address <address>.
486 \begin_layout Subsection
490 \begin_layout Standard
491 These commands are not available in lsnesrc, but are available after ROM
495 \begin_layout Subsubsection
499 \begin_layout Standard
503 \begin_layout Subsubsection
507 \begin_layout Standard
508 Toggle paused/unpaused
511 \begin_layout Subsubsection
515 \begin_layout Standard
517 If the button is still held after configurable timeout expires, game unpauses
518 for the duration frame advance is held.
521 \begin_layout Subsubsection
525 \begin_layout Standard
527 If the button is still held after configurable timeout expires, game unpauses
528 for the duration frame advance is held.
531 \begin_layout Subsubsection
535 \begin_layout Standard
536 Skip to first poll in frame after current.
539 \begin_layout Subsubsection
543 \begin_layout Standard
544 Reset the SNES after this frame.
547 \begin_layout Subsubsection
551 \begin_layout Standard
552 Load savestate <filename> in current mode.
555 \begin_layout Subsubsection
556 load-state <filename>
559 \begin_layout Standard
560 Load savestate <filename> in readwrite mode.
563 \begin_layout Subsubsection
564 load-readonly <filename>
567 \begin_layout Standard
568 Load savestate <filename> in readonly mode.
571 \begin_layout Subsubsection
572 load-preserve <filename>
575 \begin_layout Standard
576 Load savestate <filename> in readonly mode, preserving current events.
579 \begin_layout Subsubsection
580 load-movie <filename>
583 \begin_layout Standard
584 Load savestate <filename>, ignoring save part in readonly mode.
587 \begin_layout Subsubsection
588 save-state <filename>
591 \begin_layout Standard
592 Save system state to <filename> as soon as possible.
595 \begin_layout Subsubsection
596 save-movie <filename>
599 \begin_layout Standard
600 Save movie to <filename>.
603 \begin_layout Subsubsection
607 \begin_layout Standard
611 \begin_layout Subsubsection
615 \begin_layout Standard
619 \begin_layout Subsubsection
623 \begin_layout Standard
624 Toggle between read-only and read-write modes.
627 \begin_layout Subsubsection
628 test-1, test-2, test-3
631 \begin_layout Standard
632 Internal test commands.
636 \begin_layout Subsubsection
637 take-screenshot <filename>
640 \begin_layout Standard
641 Save screenshot to <filename>.
644 \begin_layout Subsubsection
645 +controller <class>-<#>-<button>
648 \begin_layout Standard
649 Press button <button> on controller <num> of class <class>.
652 \begin_layout Itemize
653 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
654 ext0, ext1, ext2, ext3
657 \begin_layout Itemize
661 \begin_layout Itemize
662 Class 'superscope': trigger, cursor, turbo, pause
665 \begin_layout Itemize
666 Class 'justifier': trigger, start
669 \begin_layout Itemize
670 Class 'gb': A, B, select, start, up, down, left, right
673 \begin_layout Subsubsection
674 hold-controller <class>-<#>-<button>
677 \begin_layout Standard
678 Hold/unhold button <button> on controller <num> of class <class>.
681 \begin_layout Subsubsection
682 type-controller <class>-<#>-<button>
685 \begin_layout Standard
686 Hold/unhold button <button> on controller <num> of class <class> for the
688 See +controller for button names.
691 \begin_layout Standard
692 Cauntion: Does not work properly if outside frame advance.
695 \begin_layout Subsubsection
696 +autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
699 \begin_layout Standard
701 If duty is not specified, defaults to 1.
702 If <cyclelen> is not specified, defaults to 2.
705 \begin_layout Subsubsection
706 -autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
709 \begin_layout Standard
713 \begin_layout Subsubsection
714 autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
717 \begin_layout Standard
719 If autofire is turned on, specified cycle is used.
722 \begin_layout Subsubsection
723 designate-position <class>-<#>-analog<n>
726 \begin_layout Standard
727 Designate position for analog pair.
728 <n> is only there if there are multiple axis pairs.
731 \begin_layout Subsubsection
735 \begin_layout Standard
739 \begin_layout Subsubsection
743 \begin_layout Standard
744 Toggle pause on end flag.
747 \begin_layout Subsubsection
751 \begin_layout Standard
752 Set pause on end flag.
755 \begin_layout Subsubsection
759 \begin_layout Standard
760 Clear pause on end flag.
763 \begin_layout Subsubsection
764 action <action> [<parameters>]
767 \begin_layout Standard
768 Run specified core action.
771 \begin_layout Subsection
775 \begin_layout Subsubsection
776 cycle-jukebox-backward
779 \begin_layout Standard
780 Cycle save jukebox backwards.
783 \begin_layout Subsubsection
784 cycle-jukebox-forward
787 \begin_layout Standard
788 Cycle save jukebox forwards
791 \begin_layout Subsubsection
792 set-jukebox-slot <slot>
795 \begin_layout Standard
796 Set current jukebox slot
799 \begin_layout Subsubsection
803 \begin_layout Standard
804 Do load from jukebox (current mode).
807 \begin_layout Subsubsection
811 \begin_layout Standard
812 Do state save to jukebox.
815 \begin_layout Subsection
819 \begin_layout Subsubsection
820 evaluate-lua <luacode>
823 \begin_layout Standard
824 Run Lua code <luacode> using built-in Lua interpretter.
827 \begin_layout Subsubsection
831 \begin_layout Standard
832 Synonym for evaluate-lua.
835 \begin_layout Subsubsection
839 \begin_layout Standard
840 Run specified lua file using built-in Lua interpretter.
843 \begin_layout Subsubsection
847 \begin_layout Standard
848 Clear the Lua VM state and restore to factory defaults.
851 \begin_layout Subsection
855 \begin_layout Subsubsection
856 add-watch <name> <expression>
859 \begin_layout Standard
860 Adds new watch (or modifies old one).
863 \begin_layout Subsubsection
867 \begin_layout Standard
871 \begin_layout Subsection
875 \begin_layout Subsubsection
876 enable-sound <on/off>
879 \begin_layout Standard
880 Enable/Disable sound.
883 \begin_layout Subsection
887 \begin_layout Subsubsection
891 \begin_layout Standard
892 Reloads the main ROM image from <file>.
895 \begin_layout Subsubsection
899 \begin_layout Standard
900 Tangent for recording voice for commentary track.
901 While pressed, record a stream.
904 \begin_layout Subsubsection
905 advance-subframe-timeout
908 \begin_layout Standard
909 Subframe advance timeout in milliseconds.
913 \begin_layout Section
917 \begin_layout Subsection
921 \begin_layout Subsection
925 \begin_layout Subsubsection
929 \begin_layout Standard
930 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
934 \begin_layout Subsubsection
938 \begin_layout Standard
939 AVI dumper: Set the default left border thickness (unless lua overrides)
945 \begin_layout Subsubsection
949 \begin_layout Standard
950 AVI dumper: Set the default right border thickness (unless lua overrides)
956 \begin_layout Subsubsection
960 \begin_layout Standard
961 AVI dumper: Set the default top border thickness (unless lua overrides)
967 \begin_layout Subsubsection
971 \begin_layout Standard
972 AVI dumper: Set the default bottom border thickness (unless lua overrides)
978 \begin_layout Subsubsection
982 \begin_layout Standard
983 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
988 \begin_layout Subsubsection
992 \begin_layout Standard
993 AVI dumper: Compression level (0-18).
996 \begin_layout Itemize
997 Compression levels 10 and above are not compatible with stock CSCD codec.
1000 \begin_layout Itemize
1001 Recomended level is 7.
1004 \begin_layout Subsubsection
1008 \begin_layout Standard
1009 AVI dumper: Set method of determining the sound rate.
1012 \begin_layout Itemize
1013 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1014 128, 176.4 and 192 kHz.
1017 \begin_layout Itemize
1018 1: Round down to nearest integer.
1021 \begin_layout Itemize
1022 2: Round up to nearest ingeter.
1025 \begin_layout Itemize
1026 3: Multiply by denominator.
1029 \begin_layout Itemize
1030 4: High quality 44.1kHz (SRC needed).
1033 \begin_layout Itemize
1034 5: High quality 48kHz (SRC needed).
1037 \begin_layout Subsection
1041 \begin_layout Subsubsection
1045 \begin_layout Standard
1046 JMD dumper: Compression level (0-9).
1049 \begin_layout Section
1053 \begin_layout Itemize
1054 The editor edits in-memory movie.
1057 \begin_layout Itemize
1058 Because past can't be edited and readwrite mode doesn't allow future, editing
1066 \begin_layout Itemize
1067 Keyboard triggers the normal hotkeys and bindings.
1070 \begin_layout Subsection
1074 \begin_layout Itemize
1075 Clicking on cell in future (indicated by lack of redish background) toggles
1076 it (if it is a button) or prompts for a value (if it is an axis)
1079 \begin_layout Itemize
1080 Dragging vertically toggles sequence of buttons or changes a sequence of
1084 \begin_layout Subsection
1085 Right button actions
1088 \begin_layout Standard
1089 The right mouse button pops up a context-sensitive menu:
1092 \begin_layout Itemize
1093 Toggle <something>: Toggle this button
1096 \begin_layout Itemize
1097 Change <something>: Change this axis value
1100 \begin_layout Itemize
1101 Insert frame after: Insert a frame after this frame
1104 \begin_layout Itemize
1105 Append frame: Append a frame to movie
1108 \begin_layout Itemize
1109 Append frames: Append specified number of frames to movie
1112 \begin_layout Itemize
1113 Delete frame: Delete this frame
1116 \begin_layout Itemize
1117 Delete subframe: Delete this subframe
1120 \begin_layout Itemize
1121 Truncate movie: Delete this subframe and everything after it.
1124 \begin_layout Itemize
1125 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1128 \begin_layout Itemize
1129 Scroll to current frame: Scroll the display to current position
1132 \begin_layout Itemize
1133 Run to frame: Prompts for frame and runs the emulation to that frame.
1136 \begin_layout Itemize
1137 Change number of lines visible: Change the height of the movie display (1
1141 \begin_layout Itemize
1142 Lock scroll to playback: While playing back or rewinding movies, the display
1143 will follow if enabled.
1146 \begin_layout Section
1147 Memory watch expression syntax
1150 \begin_layout Standard
1151 Memory watch expressions are in RPN (Reverse Polish Notation).
1152 At the end of expression, the top entry on stack is taken as the final
1156 \begin_layout Standard
1160 \begin_layout Itemize
1161 Evaluation order is strictly left to right.
1164 \begin_layout Itemize
1165 a is the entry on top of stack
1168 \begin_layout Itemize
1169 b is the entry immediately below top of stack
1172 \begin_layout Itemize
1173 ; separates values to be pushed (no intermediate pop).
1176 \begin_layout Itemize
1177 After end of element, all used stack slots are popped and all results are
1181 \begin_layout Itemize
1182 When pushing multiple values, the pushes occur in order shown.
1185 \begin_layout Standard
1186 The following operators are available:
1189 \begin_layout Itemize
1193 \begin_layout Itemize
1197 \begin_layout Itemize
1201 \begin_layout Itemize
1205 \begin_layout Itemize
1209 \begin_layout Itemize
1213 \begin_layout Itemize
1214 b : read_signed_byte(a)
1217 \begin_layout Itemize
1221 \begin_layout Itemize
1222 d : read_signed_dword(a)
1225 \begin_layout Itemize
1229 \begin_layout Itemize
1233 \begin_layout Itemize
1234 o: read_signed_hword(a)
1237 \begin_layout Itemize
1239 \begin_inset Formula $\pi$
1245 \begin_layout Itemize
1246 q : read_signed_qword(a)
1249 \begin_layout Itemize
1253 \begin_layout Itemize
1257 \begin_layout Itemize
1261 \begin_layout Itemize
1265 \begin_layout Itemize
1266 w : read_signed_word(a)
1269 \begin_layout Itemize
1273 \begin_layout Itemize
1274 B : read_unsigned_byte(a)
1277 \begin_layout Itemize
1278 C<number>z : Push number <number> to stack.
1281 \begin_layout Itemize
1282 D : read_unsigned_dword(a)
1285 \begin_layout Itemize
1286 C0x<number>z : Push number <number> (hexadecimal) to stack.
1289 \begin_layout Itemize
1293 \begin_layout Itemize
1294 H<digit> : Set hexadecimal mode with specified number of digits (use A-G
1298 \begin_layout Itemize
1299 O: read_unsigned_hword(a)
1302 \begin_layout Itemize
1303 Q : read_unsigned_qword(a)
1306 \begin_layout Itemize
1307 R<digit> : round a to <digit> digits.
1310 \begin_layout Itemize
1311 W : read_unsigned_word(a)
1314 \begin_layout Subsection
1318 \begin_layout Standard
1319 C0x007e0878zWC0x007e002czW-
1322 \begin_layout Enumerate
1323 Push value 0x7e0878 on top of stack (C0x007e0878z).
1326 \begin_layout Enumerate
1327 Pop the value on top of stack (0x7e0878), read word value at that address
1328 and push the result,call it x1 (W).
1331 \begin_layout Enumerate
1332 Push value 0x7e002c on top of stack (C0x007e002cz).
1335 \begin_layout Enumerate
1336 Pop the value on top of stack (0x7e002c), read word value at that address
1337 and push the result,call it x2 (W).
1340 \begin_layout Enumerate
1341 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
1345 \begin_layout Enumerate
1346 Since the expression ends, the final memory watch result is the top one
1347 on stack, which is x2 - x1.
1350 \begin_layout Section
1351 Modifier and key names:
1354 \begin_layout Subsection
1358 \begin_layout Subsubsection
1362 \begin_layout Standard
1363 Following modifier names are known:
1366 \begin_layout Itemize
1370 \begin_layout Itemize
1374 \begin_layout Itemize
1378 \begin_layout Itemize
1382 \begin_layout Itemize
1386 \begin_layout Subsubsection
1390 \begin_layout Standard
1391 Following key names are known:
1394 \begin_layout Itemize
1395 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1396 ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1397 period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1398 greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1399 q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1400 underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1401 q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1402 start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1403 pause, capital, end, home, lefT, up, right, down, select, print, execute,
1404 snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1405 numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1406 decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1407 f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1408 pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1409 numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1410 numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1411 numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1412 numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1413 windows_right, windows_menu, command, special1, special2, special3, special4,
1414 special5, special6, special7, special8, special9, special10, special11,
1415 special12, special13, special14, special15, special16, special17, special18,
1416 special19, special20
1419 \begin_layout Section
1423 \begin_layout Standard
1424 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1425 (note: If you recompress it, do not use compression methods other than
1426 store and deflate and especially do not use encryption of any kind).
1429 \begin_layout Subsection
1430 Detecting clean start/SRAM/Savestate
1433 \begin_layout Itemize
1435 \begin_inset Quotes eld
1439 \begin_inset Quotes erd
1442 it is savestate, otherwise:
1445 \begin_layout Itemize
1446 If file has members with names starting
1447 \begin_inset Quotes eld
1451 \begin_inset Quotes erd
1454 it is movie starting from SRAM, otherwise:
1457 \begin_layout Itemize
1458 It is movie starting from clear state.
1461 \begin_layout Subsection
1465 \begin_layout Standard
1466 Type of game ROM and region (as one line).
1470 \begin_layout Standard
1471 \begin_inset Tabular
1472 <lyxtabular version="3" rows="8" columns="3">
1473 <features tabularvalignment="middle">
1474 <column alignment="center" valignment="top" width="0">
1475 <column alignment="center" valignment="top" width="0">
1476 <column alignment="center" valignment="top" width="0">
1478 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1481 \begin_layout Plain Layout
1487 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1490 \begin_layout Plain Layout
1496 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1499 \begin_layout Plain Layout
1507 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1510 \begin_layout Plain Layout
1516 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1519 \begin_layout Plain Layout
1525 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1528 \begin_layout Plain Layout
1536 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1539 \begin_layout Plain Layout
1545 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1548 \begin_layout Plain Layout
1554 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1557 \begin_layout Plain Layout
1565 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1568 \begin_layout Plain Layout
1574 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1577 \begin_layout Plain Layout
1583 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1586 \begin_layout Plain Layout
1594 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1597 \begin_layout Plain Layout
1603 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1606 \begin_layout Plain Layout
1612 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1615 \begin_layout Plain Layout
1623 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1626 \begin_layout Plain Layout
1632 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1635 \begin_layout Plain Layout
1641 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1644 \begin_layout Plain Layout
1652 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1655 \begin_layout Plain Layout
1661 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1664 \begin_layout Plain Layout
1670 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1673 \begin_layout Plain Layout
1681 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1684 \begin_layout Plain Layout
1690 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1693 \begin_layout Plain Layout
1699 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1702 \begin_layout Plain Layout
1716 \begin_layout Standard
1720 \begin_layout Standard
1721 \begin_inset Tabular
1722 <lyxtabular version="3" rows="3" columns="2">
1723 <features tabularvalignment="middle">
1724 <column alignment="center" valignment="top" width="0">
1725 <column alignment="center" valignment="top" width="0">
1727 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1730 \begin_layout Plain Layout
1736 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1739 \begin_layout Plain Layout
1747 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1750 \begin_layout Plain Layout
1756 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1759 \begin_layout Plain Layout
1767 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1770 \begin_layout Plain Layout
1776 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1779 \begin_layout Plain Layout
1793 \begin_layout Subsection
1797 \begin_layout Standard
1798 Contains type of port #1 (as one line).
1799 Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1800 If not present, defaults to 'gamepad'.
1803 \begin_layout Subsection
1807 \begin_layout Standard
1808 Contains type of port #2 (as one line).
1809 Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1810 'justifier' and 'justifiers'.
1811 If not present, defaults to 'none'.
1814 \begin_layout Subsection
1818 \begin_layout Standard
1819 Contains name of the game (as one line).
1822 \begin_layout Subsection
1826 \begin_layout Standard
1827 Contains authors, one per line.
1828 Part before '|' is the full name, part after is the nickname.
1831 \begin_layout Subsection
1835 \begin_layout Standard
1837 \begin_inset Quotes eld
1841 \begin_inset Quotes erd
1845 Used to reject other saves.
1848 \begin_layout Subsection
1849 Member: controlsversion
1852 \begin_layout Standard
1854 \begin_inset Quotes eld
1858 \begin_inset Quotes erd
1862 Used to identify what controls are there.
1865 \begin_layout Subsection
1867 \begin_inset Quotes eld
1871 \begin_inset Quotes erd
1877 \begin_layout Standard
1878 Contains bsnes core version number (as one line).
1881 \begin_layout Subsection
1885 \begin_layout Standard
1886 Contains project ID (as one line).
1887 Used to identify if two movies are part of the same project.
1890 \begin_layout Subsection
1891 Member: {rom,slota,slotb}{,xml}.sha256
1894 \begin_layout Standard
1895 Contains SHA-256 of said ROM or ROM mapping file (as one line).
1896 Absent if corresponding file is absent.
1899 \begin_layout Subsection
1900 Member: moviesram.<name>
1903 \begin_layout Standard
1904 Raw binary startup SRAM of kind <name>.
1905 Only present in savestates and movies starting from SRAM.
1908 \begin_layout Subsection
1912 \begin_layout Standard
1913 Contains frame number (as one line) of frame movie was saved on.
1914 Only present in savestates.
1917 \begin_layout Subsection
1921 \begin_layout Standard
1922 Current value of lag counter (as one line).
1923 Only present in savestates.
1926 \begin_layout Subsection
1927 Member: pollcounters
1930 \begin_layout Standard
1931 Contains poll counters (currently 100 of them), one per line.
1932 Each line is raw poll count if DRDY is set for it.
1933 Otherwise it is negative poll count minus one.
1934 Only present in savestates.
1937 \begin_layout Subsection
1941 \begin_layout Standard
1942 Raw binary dump of host memory.
1943 Only present in savestates.
1946 \begin_layout Subsection
1950 \begin_layout Standard
1951 The raw binary savestate itself.
1952 Savestate detection uses this file, only present in savestates.
1955 \begin_layout Subsection
1959 \begin_layout Standard
1960 Screenshot of current frame.
1961 Only present in savestates.
1962 First 2 bytes are big-endian width of image, rest are 24-bit RGB image
1964 Height of image is inferred from the width and size of data.
1967 \begin_layout Subsection
1971 \begin_layout Standard
1972 Raw binary SRAM of kind <name> at time of savestate.
1973 Only present in savestates.
1976 \begin_layout Subsection
1980 \begin_layout Standard
1981 The actual input track, one line per subframe (blank lines are skipped).
1984 \begin_layout Itemize
1985 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
1986 part of same frame as previous, otherwise it starts a new frame.
1989 \begin_layout Itemize
1990 First subframe must start a new frame.
1993 \begin_layout Standard
1994 Length of movie in frames is number of lines in input file that start a
1998 \begin_layout Subsection
2002 \begin_layout Standard
2007 \begin_layout Itemize
2008 Each line is in form <firstframe> <numframes> <text>.
2011 \begin_layout Itemize
2012 Linefeed is encoded as
2014 n, backslash is encoded as
2021 \begin_layout Subsection
2025 \begin_layout Standard
2026 Contains textual base-10 rerecord count (as one line; emulator just writes
2027 this, it doesn't read it) + 1.
2030 \begin_layout Subsection
2034 \begin_layout Standard
2035 This member stores set of load IDs.
2036 There is one load ID per rerecord (plus one corresponding to start of project).
2039 \begin_layout Itemize
2040 This member constists of concatenation of records
2043 \begin_layout Itemize
2044 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2048 \begin_layout Itemize
2049 IDs are interpretted as 256-bit big-endian integers with warparound.
2052 \begin_layout Itemize
2053 Initial predicted ID is all zeroes.
2056 \begin_layout Standard
2057 Format of each record is:
2060 \begin_layout Itemize
2061 1 byte: Opcode byte.
2062 Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2066 \begin_layout Itemize
2067 32-prefixlen bytes of ID.
2070 \begin_layout Itemize
2071 countlen bytes of big-endian count (count).
2074 \begin_layout Standard
2075 Records are processed as follows:
2078 \begin_layout Itemize
2079 To form the first ID encoded by record, take the first prefixlen bytes predicted
2080 ID and append the read ID value to it.
2081 The result is the first ID encoded.
2084 \begin_layout Itemize
2085 If countlen is 0, record encodes 1 ID.
2088 \begin_layout Itemize
2089 If countlen is 1, record encodes 2+count IDs.
2092 \begin_layout Itemize
2093 If countlen is 2, record encodes 258+count IDs.
2096 \begin_layout Itemize
2097 If countlen is 3, record encodes 65794+count IDs.
2100 \begin_layout Itemize
2101 The new predicted ID is the next ID after last one encoded by the record.
2104 \begin_layout Standard
2105 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2109 \begin_layout Subsection
2110 Member: starttime.second
2113 \begin_layout Standard
2114 Movie starting time, second part.
2115 Epoch is Unix epoch.
2116 Default is 1,000,000,000.
2119 \begin_layout Subsection
2120 Member: starttime.subsecond
2123 \begin_layout Standard
2124 Movie starting time, subsecond part.
2129 \begin_layout Subsection
2130 Member: savetime.second
2133 \begin_layout Standard
2134 Movie saving time, second part.
2135 Default is starttime.second.
2136 Only present in savestates.
2139 \begin_layout Subsection
2140 Member: savetime.subsecond
2143 \begin_layout Standard
2144 Movie saving time, subsecond part.
2145 Default is starttime.subsecond.
2146 Only present in savestates.
2149 \begin_layout Section
2150 lsvs file format (commentary tracks)
2153 \begin_layout Subsection
2157 \begin_layout Itemize
2158 Each cluster is 8kB (8192 bytes) in size.
2161 \begin_layout Itemize
2162 Cluster n starts at offset 8192*n in file.
2165 \begin_layout Itemize
2166 The following clusters are system special:
2170 \begin_layout Itemize
2171 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2174 \begin_layout Itemize
2175 Cluster 1 (superblock)
2179 \begin_layout Subsection
2183 \begin_layout Itemize
2184 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2188 \begin_layout Itemize
2189 This cluster table consists of 2048 4-byte big-endian integers.
2192 \begin_layout Itemize
2193 Each entry describes a cluster in 16MB supercluster, in order.
2196 \begin_layout Itemize
2197 The valid values for entries are:
2201 \begin_layout Itemize
2202 0x00000000: Free cluster
2205 \begin_layout Itemize
2206 0x00000001: Last cluster in chain.
2209 \begin_layout Itemize
2210 0xFFFFFFFF: System cluster (cluster tables and superblock)
2213 \begin_layout Itemize
2214 (anything else): Number of next cluster in chain.
2215 Must not be multiple of 2048.
2219 \begin_layout Itemize
2220 Due to limitations of the format, there can be at most 2097052 superclusters,
2221 giving maximum file size of 16TB.
2224 \begin_layout Subsection
2228 \begin_layout Itemize
2229 The stream table chain always starts in cluster 2.
2232 \begin_layout Itemize
2233 Otherwise, it follows normal chaining.
2236 \begin_layout Itemize
2237 The stream table consists of 16-byte entries:
2241 \begin_layout Itemize
2242 The first 8 bytes of entry give big-endian beginning position of stream
2243 in units of 1/48000 s.
2246 \begin_layout Itemize
2247 The next 4 bytes of entry give big-endian beginning cluster for control
2249 0 here marks the entry as not present.
2252 \begin_layout Itemize
2253 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2257 \begin_layout Itemize
2258 Stream table clusters are normal clusters, following normal chaining.
2261 \begin_layout Itemize
2262 The stream begnning position is not guarenteed unique.
2263 There can be multiple streams with the same starting position in the file.
2266 \begin_layout Subsection
2270 \begin_layout Itemize
2271 The stream control data consists of entries 4 bytes each:
2275 \begin_layout Itemize
2276 The first 2 bytes of entry gives big-endian length of packet
2279 \begin_layout Itemize
2280 The next byte of entry gives audio length of packet in units of 1/400 s.
2283 \begin_layout Itemize
2284 The last byte is control byte.
2288 \begin_layout Itemize
2289 0 means this entry is not present and the control data ends.
2292 \begin_layout Itemize
2293 1 is valid control entry.
2298 \begin_layout Itemize
2299 The stream control data can also end by running into end of the readable
2304 \begin_layout Itemize
2305 This happens if there happens to be exact multiple of 2048 packets in stream
2306 and number of packets is nonzero.
2310 \begin_layout Itemize
2311 These clusters follow normal chaining.
2314 \begin_layout Subsection
2318 \begin_layout Itemize
2319 Stream codec data consists of raw Opus data packets packed back to back
2320 with nothing in between.
2323 \begin_layout Itemize
2324 Warning: Due to internal limitations, this data must reside in the first
2325 65536 superclusters (that is, the first 1TB of the file).
2328 \begin_layout Subsection
2332 \begin_layout Itemize
2333 The superblock is stored in cluster 1.
2337 \begin_layout Itemize
2338 The first 11 bytes are
2339 \begin_inset Quotes eld
2343 \begin_inset Quotes erd
2349 \begin_layout Itemize
2350 The rest are unused.
2353 \begin_layout Itemize
2354 This cluster 1 is marked as system special.
2357 \begin_layout Section
2358 Known ROM extensions
2361 \begin_layout Itemize
2362 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2365 \begin_layout Itemize
2366 DMG cartridge ROMs: dmg, gb.
2369 \begin_layout Itemize
2370 GBC cartridge ROMs: cgb, gbc.
2373 \begin_layout Section
2377 \begin_layout Itemize
2378 The first line must be:
2379 \begin_inset Quotes eld
2383 \begin_inset Quotes erd
2389 \begin_layout Itemize
2390 There is one needed line:
2391 \begin_inset Quotes eld
2395 \begin_inset Quotes erd
2399 This sets system type to <systype>.
2400 The following system types are valid:
2404 \begin_layout Itemize
2408 \begin_layout Itemize
2409 bsx (BS-X non-slotted)
2412 \begin_layout Itemize
2413 bsxslotted (BS-X slotted)
2416 \begin_layout Itemize
2417 sufamiturbo (Sufami Turbo)
2420 \begin_layout Itemize
2421 sgb (Super Game Boy)
2424 \begin_layout Itemize
2428 \begin_layout Itemize
2429 gbc (Game Boy Color)
2432 \begin_layout Itemize
2433 gbc_gba (Game Boy Color with GBA initial register values)
2437 \begin_layout Itemize
2438 Optionally a region can be specified:
2439 \begin_inset Quotes eld
2443 \begin_inset Quotes erd
2447 The following values are valid:
2451 \begin_layout Itemize
2452 autodetect (Autodetect region: snes and sgb only)
2455 \begin_layout Itemize
2456 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2459 \begin_layout Itemize
2460 pal (PAL: snes, sgb)
2463 \begin_layout Itemize
2464 world (World: dmg, gbc, gbc_gba)
2468 \begin_layout Itemize
2469 ROM images are loaded as:
2470 \begin_inset Quotes eld
2474 \begin_inset Quotes erd
2478 The following types are valid:
2482 \begin_layout Itemize
2483 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2484 BIOS in bsx, bsxslotted, sufamiturbo)
2487 \begin_layout Itemize
2488 bsx (Cartridge ROM in bsx, bsxslotted)
2491 \begin_layout Itemize
2492 slot-a (Cartridge ROM in sufamiturbo)
2495 \begin_layout Itemize
2496 slot-b (Cartridge ROM in sufamiturbo)
2500 \begin_layout Itemize
2501 ROM markup can be loaded as:
2502 \begin_inset Quotes eld
2506 \begin_inset Quotes erd
2510 The types valid are the same as for ROMs.
2513 \begin_layout Itemize
2514 Patches can be loaded as
2515 \begin_inset Quotes eld
2518 patch[<offset>] <type> <file>
2519 \begin_inset Quotes erd
2523 The types are the same as for ROMs.
2527 \begin_layout Itemize
2528 Offset is given in form [+-]<number>.
2529 Usually offset is either +0 or -512.
2532 \begin_layout Itemize
2533 Default offset is +0.
2537 \begin_layout Subsection
2541 \begin_layout LyX-Code
2545 \begin_layout LyX-Code
2549 \begin_layout LyX-Code
2550 rom rom speedygonzales.sfc
2553 \begin_layout LyX-Code
2554 patch-512 rom sonicthehedgehog.ips
2557 \begin_layout Subsection
2561 \begin_layout LyX-Code
2565 \begin_layout LyX-Code
2569 \begin_layout LyX-Code
2570 rom rom supergameboy.sfc
2573 \begin_layout LyX-Code
2574 rom dmg megamanV.dmg
2577 \begin_layout Section
2578 Quick'n'dirty encode guide
2581 \begin_layout Enumerate
2582 Start the emulator and load the ROM and movie file.
2585 \begin_layout Enumerate
2586 Set large AVI option 'set-setting avi-large on'
2589 \begin_layout Enumerate
2590 Enable dumping 'dump-avi tmpdump'
2593 \begin_layout Enumerate
2594 Unpause and let it run until you want to end dumping.
2597 \begin_layout Enumerate
2598 Close the emulator (closing the window is the easiest way).
2602 \begin_layout Enumerate
2603 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2604 -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2607 \begin_layout Enumerate
2608 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2611 \begin_layout Enumerate
2612 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2613 + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2616 \begin_layout Enumerate
2617 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2618 Now final.mkv contains quick'n'dirty encode.
2621 \begin_layout Section
2622 Axis configurations for some gamepad types:
2625 \begin_layout Subsection
2629 \begin_layout Standard
2630 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2633 \begin_layout LyX-Code
2634 set-axis joystick0axis2 pressure-+
2637 \begin_layout LyX-Code
2638 set-axis joystick0axis5 pressure-+
2641 \begin_layout Itemize
2642 This is needed for SDL only.
2643 EVDEV sets those types correctly.
2646 \begin_layout Subsection
2648 \begin_inset Quotes eld
2652 \begin_inset Quotes erd
2658 \begin_layout Standard
2659 Axes 8-19 should be disabled.
2662 \begin_layout LyX-Code
2663 set-axis joystick0axis8 disabled
2666 \begin_layout LyX-Code
2667 set-axis joystick0axis9 disabled
2670 \begin_layout LyX-Code
2671 set-axis joystick0axis10 disabled
2674 \begin_layout LyX-Code
2675 set-axis joystick0axis11 disabled
2678 \begin_layout LyX-Code
2679 set-axis joystick0axis12 disabled
2682 \begin_layout LyX-Code
2683 set-axis joystick0axis13 disabled
2686 \begin_layout LyX-Code
2687 set-axis joystick0axis14 disabled
2690 \begin_layout LyX-Code
2691 set-axis joystick0axis15 disabled
2694 \begin_layout LyX-Code
2695 set-axis joystick0axis16 disabled
2698 \begin_layout LyX-Code
2699 set-axis joystick0axis17 disabled
2702 \begin_layout LyX-Code
2703 set-axis joystick0axis18 disabled
2706 \begin_layout LyX-Code
2707 set-axis joystick0axis19 disabled
2710 \begin_layout Section
2714 \begin_layout Subsection
2715 Problems from BSNES core:
2718 \begin_layout Itemize
2719 The whole pending save stuff.
2722 \begin_layout Itemize
2723 It is slow (especially accuracy).
2726 \begin_layout Itemize
2727 Firmwares can't be loaded from ZIP archives.
2730 \begin_layout Subsection
2734 \begin_layout Itemize
2735 Modifiers don't work with pseudo-keys.
2738 \begin_layout Itemize
2739 Audio for last dumped frame is not itself dumped.
2742 \begin_layout Itemize
2743 Audio in UI is pretty bad in quality if game doesn't run at full speed.