Support Multi-ROM projects
[lsnes.git] / manual.lyx
blobf3b2f8fda9180e0a34dc5637ca17854bb682b6b0
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass article
6 \use_default_options true
7 \maintain_unincluded_children false
8 \language finnish
9 \language_package default
10 \inputencoding auto
11 \fontencoding global
12 \font_roman default
13 \font_sans default
14 \font_typewriter default
15 \font_default_family default
16 \use_non_tex_fonts false
17 \font_sc false
18 \font_osf false
19 \font_sf_scale 100
20 \font_tt_scale 100
22 \graphics default
23 \default_output_format default
24 \output_sync 0
25 \bibtex_command default
26 \index_command default
27 \paperfontsize default
28 \use_hyperref false
29 \papersize default
30 \use_geometry false
31 \use_amsmath 1
32 \use_esint 1
33 \use_mhchem 1
34 \use_mathdots 1
35 \cite_engine basic
36 \use_bibtopic false
37 \use_indices false
38 \paperorientation portrait
39 \suppress_date false
40 \use_refstyle 1
41 \index Hakusana
42 \shortcut idx
43 \color #008000
44 \end_index
45 \secnumdepth 3
46 \tocdepth 3
47 \paragraph_separation indent
48 \paragraph_indentation default
49 \quotes_language english
50 \papercolumns 1
51 \papersides 1
52 \paperpagestyle default
53 \tracking_changes false
54 \output_changes false
55 \html_math_output 0
56 \html_css_as_file 0
57 \html_be_strict false
58 \end_header
60 \begin_body
62 \begin_layout Section
63 Introduction
64 \end_layout
66 \begin_layout Standard
67 lsnes is SNES rerecording emulator based on bsnes core.
68 \end_layout
70 \begin_layout Section
71 Dependencies
72 \end_layout
74 \begin_layout Enumerate
75 bsnes libsnes (for bsnes SNES core)
76 \end_layout
78 \begin_deeper
79 \begin_layout Enumerate
80 v084-v087 (v084 or v085 for delayreset support)
81 \end_layout
83 \begin_layout Enumerate
84 accuracy or compatiblity core with debugger enabled.
85 \end_layout
87 \begin_layout Enumerate
88 Patched version (using included 7 patches)
89 \end_layout
91 \end_deeper
92 \begin_layout Enumerate
93 gambatte (for gambatte core)
94 \end_layout
96 \begin_deeper
97 \begin_layout Enumerate
98 SVN r320, r358 or r364
99 \end_layout
101 \begin_layout Enumerate
102 Patched with included patches
103 \end_layout
105 \end_deeper
106 \begin_layout Enumerate
107 Zlib
108 \end_layout
110 \begin_layout Enumerate
111 boost_iostreams
112 \end_layout
114 \begin_layout Enumerate
115 boost_filesystem
116 \end_layout
118 \begin_layout Enumerate
119 boost_thread (if native std::thread is not available)
120 \end_layout
122 \begin_layout Enumerate
123 libsdl (SDL only)
124 \end_layout
126 \begin_layout Enumerate
127 sdlmain (SDL only, part of SDL)
128 \end_layout
130 \begin_layout Enumerate
131 boost_conversion (this is header-only library)
132 \end_layout
134 \begin_layout Enumerate
135 libswscale (wxwidgets graphics only)
136 \end_layout
138 \begin_layout Enumerate
139 Portaudio (portaudio sound only)
140 \end_layout
142 \begin_layout Enumerate
143 libao (libao sound only)
144 \end_layout
146 \begin_layout Enumerate
147 Lua version 5.1.X or 5.2.X
148 \end_layout
150 \begin_layout Enumerate
151 G++ 4.6 or 4.7
152 \end_layout
154 \begin_layout Enumerate
155 libopus (optional, for commentary track tool)
156 \end_layout
158 \begin_layout Section
159 Building
160 \end_layout
162 \begin_layout Itemize
163 Copy bsnes sources (the bsnes subdirectory) to subdirectory 'bsnes' (for
164  bsnes core).
165 \end_layout
167 \begin_layout Itemize
168 Copy gambatte sources to subdirectory 'gambatte' (for gambatte core).
169 \end_layout
171 \begin_layout Itemize
172 Patch the bsnes sources with included patches (directory 'bsnes-patches/<version
173 >', bsnes core)
174 \end_layout
176 \begin_layout Itemize
177 Patch the gambatte sources with included patches (directory 'gambatte-patches/<v
178 ersion>', gambatte core)
179 \end_layout
181 \begin_layout Itemize
182 Edit options.build (or copy of that file)
183 \end_layout
185 \begin_layout Itemize
186 Run make (passing 'OPTIONS=<filename>' if using something else than options.build
188 \end_layout
190 \begin_layout Section
191 Command line options
192 \end_layout
194 \begin_layout Subsection
195 Wxwidgets options
196 \end_layout
198 \begin_layout Subsubsection
199 --rom=<file>
200 \end_layout
202 \begin_layout Standard
203 Load <file> as ROM.
204 \end_layout
206 \begin_layout Subsubsection
207 <file>
208 \end_layout
210 \begin_layout Standard
211 Load <file> as ROM.
212 \end_layout
214 \begin_layout Subsubsection
215 --load=<file>
216 \end_layout
218 \begin_layout Standard
219 Load <file> as movie or savestate file on startup.
220 \end_layout
222 \begin_layout Subsubsection
223 --settings
224 \end_layout
226 \begin_layout Standard
227 Instead of starting the emulator, only display the settings.
228 \end_layout
230 \begin_layout Subsubsection
231 --lua=<file>
232 \end_layout
234 \begin_layout Standard
235 Run this Lua file on startup
236 \end_layout
238 \begin_layout Subsection
239 dump options (lsnes-dumpavi only)
240 \end_layout
242 \begin_layout Subsubsection
243 --rom=<file>
244 \end_layout
246 \begin_layout Standard
247 Load <file> as ROM.
248  Required.
249 \end_layout
251 \begin_layout Subsubsection
252 <filename>
253 \end_layout
255 \begin_layout Standard
256 Load <filename> as movie or savestate file on startup.
257  Required.
258 \end_layout
260 \begin_layout Subsubsection
261 --dumper=<dumper>
262 \end_layout
264 \begin_layout Standard
265 Set the dumper to use (required).
266  Use 'list' for listing of known dumpers.
267 \end_layout
269 \begin_layout Subsubsection
270 --firmware-path=<path>
271 \end_layout
273 \begin_layout Standard
274 Set path to look for firmware.
275 \end_layout
277 \begin_layout Subsubsection
278 --mode=<mode>
279 \end_layout
281 \begin_layout Standard
282 Set the mode to use (required for dumpers with multiple modes, forbidden
283  otherwise).
284  Use 'list' for known modes.
285 \end_layout
287 \begin_layout Subsubsection
288 --prefix=<prefix>
289 \end_layout
291 \begin_layout Standard
292 Set dump prefix.
293  Default is 
294 \begin_inset Quotes eld
295 \end_inset
297 avidump
298 \begin_inset Quotes erd
299 \end_inset
302 \end_layout
304 \begin_layout Subsubsection
305 --option=<name>=<value>
306 \end_layout
308 \begin_layout Standard
309 Set option <name> to value <value>.
310 \end_layout
312 \begin_layout Subsubsection
313 --length=<length>
314 \end_layout
316 \begin_layout Standard
317 Set number of frames to dump.
318  Mandatory, unless --overdump-length is specified.
319 \end_layout
321 \begin_layout Subsubsection
322 --overdump-length=<length>
323 \end_layout
325 \begin_layout Standard
326 Set number of frames to dump after movie end.
327  Mutually exclusive with --length.
328 \end_layout
330 \begin_layout Subsubsection
331 --lua=<script>
332 \end_layout
334 \begin_layout Standard
335 Run specified lua script (lsnes-dumpavi does not have initialization files).
336 \end_layout
338 \begin_layout Subsubsection
339 --load-library=<library>
340 \end_layout
342 \begin_layout Standard
343 Load the specified shared object / dynamic library / dynamic link library.
344 \end_layout
346 \begin_layout Subsection
347 lsnes settings directory
348 \end_layout
350 \begin_layout Standard
351 The lsnes settings directory is (in order of decreasing perference):
352 \end_layout
354 \begin_layout Itemize
355 Windows: %APPDATA%
356 \backslash
357 lsnes (if %APPDATA% exists)
358 \end_layout
360 \begin_layout Itemize
361 Unix: $XDG_CONFIG_HOME/lsnes (if $XDG_CONFIG_HOME exists)
362 \end_layout
364 \begin_layout Itemize
365 Unix: $HOME/.config/lsnes (if $HOME exists)
366 \end_layout
368 \begin_layout Itemize
369 All: .
370  (fallback default).
371 \end_layout
373 \begin_layout Standard
374 If leading directories do not exist, attempt to create them is made.
375 \end_layout
377 \begin_layout Section
378 Internal commands
379 \end_layout
381 \begin_layout Itemize
382 Commands beginning with '*' invoke the corresponding command without alias
383  expansion.
384 \end_layout
386 \begin_layout Itemize
387 If command starts with '+' (after possible '*'), the command is executed
388  as-is when button is pressed, and when button is released, it is executed
389  with '+' replaced by '-'.
390 \end_layout
392 \begin_layout Itemize
393 Commands without '+' execute only on negative edge (release).
394 \end_layout
396 \begin_layout Subsection
397 run-script <script>
398 \end_layout
400 \begin_layout Standard
401 Run <script> as if commands were entered on the command line.
402 \end_layout
404 \begin_layout Subsection
405 Memory manipulation
406 \end_layout
408 \begin_layout Standard
409 <address> may be decimal or hexadecimal (prefixed with '0x').
410  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
411  with '-') decimal.
412 \end_layout
414 \begin_layout Standard
415 The available element <sizes> are:
416 \end_layout
418 \begin_layout Itemize
419 byte: 1 byte
420 \end_layout
422 \begin_layout Itemize
423 word: 2 bytes
424 \end_layout
426 \begin_layout Itemize
427 hword: 3 bytes
428 \end_layout
430 \begin_layout Itemize
431 dword: 4 bytes
432 \end_layout
434 \begin_layout Itemize
435 qword: 8 bytes
436 \end_layout
438 \begin_layout Itemize
439 float: 4 bytes (floating-point)
440 \end_layout
442 \begin_layout Itemize
443 double: 8 bytes (floating-point)
444 \end_layout
446 \begin_layout Standard
447 When reading RAM and ROM, multi-byte reads/writes are big-endian.
448  When dealing with DSP memory, multi-byte reads/writes are native-endian
449  (do not use operand sizes exceeding DSP bitness, except dword is OK for
450  24-bit memory).
451 \end_layout
453 \begin_layout Subsubsection
454 read-<size> <address>
455 \end_layout
457 \begin_layout Standard
458 Read the value of byte in <address>.
459 \end_layout
461 \begin_layout Subsubsection
462 read-s<size> <address>
463 \end_layout
465 \begin_layout Standard
466 Read the value of signed byte in <address>.
467 \end_layout
469 \begin_layout Subsubsection
470 write-<size> <address> <value>
471 \end_layout
473 \begin_layout Standard
474 Write <value> to byte in address <address>.
475 \end_layout
477 \begin_layout Subsection
478 Main commands
479 \end_layout
481 \begin_layout Standard
482 These commands are not available in lsnesrc, but are available after ROM
483  has been loaded.
484 \end_layout
486 \begin_layout Subsubsection
487 quit-emulator
488 \end_layout
490 \begin_layout Standard
491 Quits the emulator.
492 \end_layout
494 \begin_layout Subsubsection
495 pause-emulator
496 \end_layout
498 \begin_layout Standard
499 Toggle paused/unpaused
500 \end_layout
502 \begin_layout Subsubsection
503 +advance-frame 
504 \end_layout
506 \begin_layout Standard
507 Advance frame.
508  If the button is still held after configurable timeout expires, game unpauses
509  for the duration frame advance is held.
510 \end_layout
512 \begin_layout Subsubsection
513 +advance-poll 
514 \end_layout
516 \begin_layout Standard
517 Advance subframe.
518  If the button is still held after configurable timeout expires, game unpauses
519  for the duration frame advance is held.
520 \end_layout
522 \begin_layout Subsubsection
523 advance-skiplag 
524 \end_layout
526 \begin_layout Standard
527 Skip to first poll in frame after current.
528 \end_layout
530 \begin_layout Subsubsection
531 reset 
532 \end_layout
534 \begin_layout Standard
535 Reset the SNES after this frame.
536 \end_layout
538 \begin_layout Subsubsection
539 load <filename> 
540 \end_layout
542 \begin_layout Standard
543 Load savestate <filename> in current mode.
544 \end_layout
546 \begin_layout Subsubsection
547 load-state <filename> 
548 \end_layout
550 \begin_layout Standard
551 Load savestate <filename> in readwrite mode.
552 \end_layout
554 \begin_layout Subsubsection
555 load-readonly <filename> 
556 \end_layout
558 \begin_layout Standard
559 Load savestate <filename> in readonly mode.
560 \end_layout
562 \begin_layout Subsubsection
563 load-preserve <filename> 
564 \end_layout
566 \begin_layout Standard
567 Load savestate <filename> in readonly mode, preserving current events.
568 \end_layout
570 \begin_layout Subsubsection
571 load-movie <filename> 
572 \end_layout
574 \begin_layout Standard
575 Load savestate <filename>, ignoring save part in readonly mode.
576 \end_layout
578 \begin_layout Subsubsection
579 save-state <filename> 
580 \end_layout
582 \begin_layout Standard
583 Save system state to <filename> as soon as possible.
584 \end_layout
586 \begin_layout Subsubsection
587 save-movie <filename> 
588 \end_layout
590 \begin_layout Standard
591 Save movie to <filename>.
592 \end_layout
594 \begin_layout Subsubsection
595 set-rwmode 
596 \end_layout
598 \begin_layout Standard
599 Set read-write mode.
600 \end_layout
602 \begin_layout Subsubsection
603 set-romode 
604 \end_layout
606 \begin_layout Standard
607 Set read-only mode
608 \end_layout
610 \begin_layout Subsubsection
611 toggle-rwmode 
612 \end_layout
614 \begin_layout Standard
615 Toggle between read-only and read-write modes.
616 \end_layout
618 \begin_layout Subsubsection
619 test-1, test-2, test-3
620 \end_layout
622 \begin_layout Standard
623 Internal test commands.
624  Don't use.
625 \end_layout
627 \begin_layout Subsubsection
628 take-screenshot <filename> 
629 \end_layout
631 \begin_layout Standard
632 Save screenshot to <filename>.
633 \end_layout
635 \begin_layout Subsubsection
636 +controller <class>-<#>-<button>
637 \end_layout
639 \begin_layout Standard
640 Press button <button> on controller <num> of class <class>.
641 \end_layout
643 \begin_layout Itemize
644 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
645  ext0, ext1, ext2, ext3
646 \end_layout
648 \begin_layout Itemize
649 Class 'mouse': L, R
650 \end_layout
652 \begin_layout Itemize
653 Class 'superscope': trigger, cursor, turbo, pause
654 \end_layout
656 \begin_layout Itemize
657 Class 'justifier': trigger, start
658 \end_layout
660 \begin_layout Itemize
661 Class 'gb': A, B, select, start, up, down, left, right
662 \end_layout
664 \begin_layout Subsubsection
665 hold-controller <class>-<#>-<button>
666 \end_layout
668 \begin_layout Standard
669 Hold/unhold button <button> on controller <num> of class <class>.
670 \end_layout
672 \begin_layout Subsubsection
673 type-controller <class>-<#>-<button>
674 \end_layout
676 \begin_layout Standard
677 Hold/unhold button <button> on controller <num> of class <class> for the
678  next frame.
679  See +controller for button names.
680 \end_layout
682 \begin_layout Standard
683 Cauntion: Does not work properly if outside frame advance.
684 \end_layout
686 \begin_layout Subsubsection
687 +autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
688 \end_layout
690 \begin_layout Standard
691 Start autofire.
692  If duty is not specified, defaults to 1.
693  If <cyclelen> is not specified, defaults to 2.
694 \end_layout
696 \begin_layout Subsubsection
697 -autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
698 \end_layout
700 \begin_layout Standard
701 End autofire.
702 \end_layout
704 \begin_layout Subsubsection
705 autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
706 \end_layout
708 \begin_layout Standard
709 Toggle autofire.
710  If autofire is turned on, specified cycle is used.
711 \end_layout
713 \begin_layout Subsubsection
714 designate-position <class>-<#>-analog<n>
715 \end_layout
717 \begin_layout Standard
718 Designate position for analog pair.
719  <n> is only there if there are multiple axis pairs.
720 \end_layout
722 \begin_layout Subsubsection
723 repaint
724 \end_layout
726 \begin_layout Standard
727 Force a repaint.
728 \end_layout
730 \begin_layout Subsubsection
731 toggle-pause-on-end
732 \end_layout
734 \begin_layout Standard
735 Toggle pause on end flag.
736 \end_layout
738 \begin_layout Subsubsection
739 set-pause-on-end
740 \end_layout
742 \begin_layout Standard
743 Set pause on end flag.
744 \end_layout
746 \begin_layout Subsubsection
747 clear-pause-on-end
748 \end_layout
750 \begin_layout Standard
751 Clear pause on end flag.
752 \end_layout
754 \begin_layout Subsubsection
755 action <action> [<parameters>]
756 \end_layout
758 \begin_layout Standard
759 Run specified core action.
760 \end_layout
762 \begin_layout Subsection
763 Save jukebox 
764 \end_layout
766 \begin_layout Subsubsection
767 cycle-jukebox-backward
768 \end_layout
770 \begin_layout Standard
771 Cycle save jukebox backwards.
772 \end_layout
774 \begin_layout Subsubsection
775 cycle-jukebox-forward
776 \end_layout
778 \begin_layout Standard
779 Cycle save jukebox forwards
780 \end_layout
782 \begin_layout Subsubsection
783 load-jukebox
784 \end_layout
786 \begin_layout Standard
787 Do load from jukebox (current mode).
788 \end_layout
790 \begin_layout Subsubsection
791 save-jukebox
792 \end_layout
794 \begin_layout Standard
795 Do state save to jukebox.
796 \end_layout
798 \begin_layout Subsection
799 Lua 
800 \end_layout
802 \begin_layout Subsubsection
803 evaluate-lua <luacode>
804 \end_layout
806 \begin_layout Standard
807 Run Lua code <luacode> using built-in Lua interpretter.
808 \end_layout
810 \begin_layout Subsubsection
811 L <luacode>
812 \end_layout
814 \begin_layout Standard
815 Synonym for evaluate-lua.
816 \end_layout
818 \begin_layout Subsubsection
819 run-lua <script>
820 \end_layout
822 \begin_layout Standard
823 Run specified lua file using built-in Lua interpretter.
824 \end_layout
826 \begin_layout Subsubsection
827 reset-lua
828 \end_layout
830 \begin_layout Standard
831 Clear the Lua VM state and restore to factory defaults.
832 \end_layout
834 \begin_layout Subsection
835 Memory watch
836 \end_layout
838 \begin_layout Subsubsection
839 add-watch <name> <expression>
840 \end_layout
842 \begin_layout Standard
843 Adds new watch (or modifies old one).
844 \end_layout
846 \begin_layout Subsubsection
847 remove-watch <name>
848 \end_layout
850 \begin_layout Standard
851 Remove a watch.
852 \end_layout
854 \begin_layout Subsection
855 Sound 
856 \end_layout
858 \begin_layout Subsubsection
859 enable-sound <on/off> 
860 \end_layout
862 \begin_layout Standard
863 Enable/Disable sound.
864 \end_layout
866 \begin_layout Subsection
867 Misc.
868 \end_layout
870 \begin_layout Subsubsection
871 reload-rom [<file>]
872 \end_layout
874 \begin_layout Standard
875 Reloads the main ROM image from <file>.
876 \end_layout
878 \begin_layout Subsubsection
879 +tangent
880 \end_layout
882 \begin_layout Standard
883 Tangent for recording voice for commentary track.
884  While pressed, record a stream.
885 \end_layout
887 \begin_layout Subsubsection
888 advance-subframe-timeout
889 \end_layout
891 \begin_layout Standard
892 Subframe advance timeout in milliseconds.
893  Default is 100.
894 \end_layout
896 \begin_layout Section
897 Settings
898 \end_layout
900 \begin_layout Subsection
901 Core settings
902 \end_layout
904 \begin_layout Subsection
905 AVI dumper settings
906 \end_layout
908 \begin_layout Subsubsection
909 avi-large
910 \end_layout
912 \begin_layout Standard
913 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
914  outputs.
915 \end_layout
917 \begin_layout Subsubsection
918 avi-left-border
919 \end_layout
921 \begin_layout Standard
922 AVI dumper: Set the default left border thickness (unless lua overrides)
923  for dumps.
924  Range 0-8191.
925  Default is 0.
926 \end_layout
928 \begin_layout Subsubsection
929 avi-right-border
930 \end_layout
932 \begin_layout Standard
933 AVI dumper: Set the default right border thickness (unless lua overrides)
934  for dumps.
935  Range 0-8191.
936  Default is 0.
937 \end_layout
939 \begin_layout Subsubsection
940 avi-top-border
941 \end_layout
943 \begin_layout Standard
944 AVI dumper: Set the default top border thickness (unless lua overrides)
945  for dumps.
946  Range 0-8191.
947  Default is 0.
948 \end_layout
950 \begin_layout Subsubsection
951 avi-bottom-border
952 \end_layout
954 \begin_layout Standard
955 AVI dumper: Set the default bottom border thickness (unless lua overrides)
956  for dumps.
957  Range 0-8191.
958  Default is 0.
959 \end_layout
961 \begin_layout Subsubsection
962 avi-maxframes
963 \end_layout
965 \begin_layout Standard
966 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
967  Range 0-999999999.
968  Default is 0.
969 \end_layout
971 \begin_layout Subsubsection
972 avi-compresison
973 \end_layout
975 \begin_layout Standard
976 AVI dumper: Compression level (0-18).
977 \end_layout
979 \begin_layout Itemize
980 Compression levels 10 and above are not compatible with stock CSCD codec.
981 \end_layout
983 \begin_layout Itemize
984 Recomended level is 7.
985 \end_layout
987 \begin_layout Subsubsection
988 avi-soundrate
989 \end_layout
991 \begin_layout Standard
992 AVI dumper: Set method of determining the sound rate.
993 \end_layout
995 \begin_layout Itemize
996 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
997  128, 176.4 and 192 kHz.
998 \end_layout
1000 \begin_layout Itemize
1001 1: Round down to nearest integer.
1002 \end_layout
1004 \begin_layout Itemize
1005 2: Round up to nearest ingeter.
1006 \end_layout
1008 \begin_layout Itemize
1009 3: Multiply by denominator.
1010 \end_layout
1012 \begin_layout Itemize
1013 4: High quality 44.1kHz (SRC needed).
1014 \end_layout
1016 \begin_layout Itemize
1017 5: High quality 48kHz (SRC needed).
1018 \end_layout
1020 \begin_layout Subsection
1021 JMD options
1022 \end_layout
1024 \begin_layout Subsubsection
1025 jmd-compression
1026 \end_layout
1028 \begin_layout Standard
1029 JMD dumper: Compression level (0-9).
1030 \end_layout
1032 \begin_layout Section
1033 Movie editor
1034 \end_layout
1036 \begin_layout Itemize
1037 The editor edits in-memory movie.
1038 \end_layout
1040 \begin_layout Itemize
1041 Because past can't be edited and readwrite mode doesn't allow future, editing
1042  only works in 
1043 \emph on
1044 read only
1045 \emph default
1046  mode.
1047 \end_layout
1049 \begin_layout Itemize
1050 Keyboard triggers the normal hotkeys and bindings.
1051 \end_layout
1053 \begin_layout Subsection
1054 Left button actions
1055 \end_layout
1057 \begin_layout Itemize
1058 Clicking on cell in future (indicated by lack of redish background) toggles
1059  it (if it is a button) or prompts for a value (if it is an axis)
1060 \end_layout
1062 \begin_layout Itemize
1063 Dragging vertically toggles sequence of buttons or changes a sequence of
1064  axis values.
1065 \end_layout
1067 \begin_layout Subsection
1068 Right button actions
1069 \end_layout
1071 \begin_layout Standard
1072 The right mouse button pops up a context-sensitive menu:
1073 \end_layout
1075 \begin_layout Itemize
1076 Toggle <something>: Toggle this button
1077 \end_layout
1079 \begin_layout Itemize
1080 Change <something>: Change this axis value
1081 \end_layout
1083 \begin_layout Itemize
1084 Insert frame after: Insert a frame after this frame
1085 \end_layout
1087 \begin_layout Itemize
1088 Append frame: Append a frame to movie
1089 \end_layout
1091 \begin_layout Itemize
1092 Append frames: Append specified number of frames to movie
1093 \end_layout
1095 \begin_layout Itemize
1096 Delete frame: Delete this frame
1097 \end_layout
1099 \begin_layout Itemize
1100 Delete subframe: Delete this subframe
1101 \end_layout
1103 \begin_layout Itemize
1104 Truncate movie: Delete this subframe and everything after it.
1105 \end_layout
1107 \begin_layout Itemize
1108 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1109 \end_layout
1111 \begin_layout Itemize
1112 Scroll to current frame: Scroll the display to current position
1113 \end_layout
1115 \begin_layout Itemize
1116 Run to frame: Prompts for frame and runs the emulation to that frame.
1117 \end_layout
1119 \begin_layout Itemize
1120 Change number of lines visible: Change the height of the movie display (1
1121  to 255).
1122 \end_layout
1124 \begin_layout Itemize
1125 Lock scroll to playback: While playing back or rewinding movies, the display
1126  will follow if enabled.
1127 \end_layout
1129 \begin_layout Section
1130 Memory watch expression syntax
1131 \end_layout
1133 \begin_layout Standard
1134 Memory watch expressions are in RPN (Reverse Polish Notation).
1135  At the end of expression, the top entry on stack is taken as the final
1136  result.
1137 \end_layout
1139 \begin_layout Standard
1140 Notations:
1141 \end_layout
1143 \begin_layout Itemize
1144 Evaluation order is strictly left to right.
1145 \end_layout
1147 \begin_layout Itemize
1148 a is the entry on top of stack
1149 \end_layout
1151 \begin_layout Itemize
1152 b is the entry immediately below top of stack
1153 \end_layout
1155 \begin_layout Itemize
1156 ; separates values to be pushed (no intermediate pop).
1157 \end_layout
1159 \begin_layout Itemize
1160 After end of element, all used stack slots are popped and all results are
1161  pushed.
1162 \end_layout
1164 \begin_layout Itemize
1165 When pushing multiple values, the pushes occur in order shown.
1166 \end_layout
1168 \begin_layout Standard
1169 The following operators are available:
1170 \end_layout
1172 \begin_layout Itemize
1173 + : a + b
1174 \end_layout
1176 \begin_layout Itemize
1177 - : a - b
1178 \end_layout
1180 \begin_layout Itemize
1181 * : a * b
1182 \end_layout
1184 \begin_layout Itemize
1185 / : a / b
1186 \end_layout
1188 \begin_layout Itemize
1189 % : a % b
1190 \end_layout
1192 \begin_layout Itemize
1193 a : atan(a)
1194 \end_layout
1196 \begin_layout Itemize
1197 b : read_signed_byte(a)
1198 \end_layout
1200 \begin_layout Itemize
1201 c : cos(a)
1202 \end_layout
1204 \begin_layout Itemize
1205 d : read_signed_dword(a)
1206 \end_layout
1208 \begin_layout Itemize
1209 f: read_float(a)
1210 \end_layout
1212 \begin_layout Itemize
1213 i : quotent(a / b)
1214 \end_layout
1216 \begin_layout Itemize
1217 o: read_signed_hword(a)
1218 \end_layout
1220 \begin_layout Itemize
1221 p :
1222 \begin_inset Formula $\pi$
1223 \end_inset
1226 \end_layout
1228 \begin_layout Itemize
1229 q : read_signed_qword(a)
1230 \end_layout
1232 \begin_layout Itemize
1233 r : sqrt(a)
1234 \end_layout
1236 \begin_layout Itemize
1237 s : sin(a)
1238 \end_layout
1240 \begin_layout Itemize
1241 t : tan(a)
1242 \end_layout
1244 \begin_layout Itemize
1245 u : a; a
1246 \end_layout
1248 \begin_layout Itemize
1249 w : read_signed_word(a)
1250 \end_layout
1252 \begin_layout Itemize
1253 A : atan2(a, b)
1254 \end_layout
1256 \begin_layout Itemize
1257 B : read_unsigned_byte(a)
1258 \end_layout
1260 \begin_layout Itemize
1261 C<number>z : Push number <number> to stack.
1262 \end_layout
1264 \begin_layout Itemize
1265 D : read_unsigned_dword(a)
1266 \end_layout
1268 \begin_layout Itemize
1269 C0x<number>z : Push number <number> (hexadecimal) to stack.
1270 \end_layout
1272 \begin_layout Itemize
1273 F: read_double(a)
1274 \end_layout
1276 \begin_layout Itemize
1277 H<digit> : Set hexadecimal mode with specified number of digits (use A-G
1278  for 10-16 digits).
1279 \end_layout
1281 \begin_layout Itemize
1282 O: read_unsigned_hword(a)
1283 \end_layout
1285 \begin_layout Itemize
1286 Q : read_unsigned_qword(a)
1287 \end_layout
1289 \begin_layout Itemize
1290 R<digit> : round a to <digit> digits.
1291 \end_layout
1293 \begin_layout Itemize
1294 W : read_unsigned_word(a)
1295 \end_layout
1297 \begin_layout Subsection
1298 Example:
1299 \end_layout
1301 \begin_layout Standard
1302 C0x007e0878zWC0x007e002czW-
1303 \end_layout
1305 \begin_layout Enumerate
1306 Push value 0x7e0878 on top of stack (C0x007e0878z).
1307 \end_layout
1309 \begin_layout Enumerate
1310 Pop the value on top of stack (0x7e0878), read word value at that address
1311  and push the result,call it x1 (W).
1312 \end_layout
1314 \begin_layout Enumerate
1315 Push value 0x7e002c on top of stack (C0x007e002cz).
1316 \end_layout
1318 \begin_layout Enumerate
1319 Pop the value on top of stack (0x7e002c), read word value at that address
1320  and push the result,call it x2 (W).
1321 \end_layout
1323 \begin_layout Enumerate
1324 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
1325  x2 - x1 (-).
1326 \end_layout
1328 \begin_layout Enumerate
1329 Since the expression ends, the final memory watch result is the top one
1330  on stack, which is x2 - x1.
1331 \end_layout
1333 \begin_layout Section
1334 Modifier and key names:
1335 \end_layout
1337 \begin_layout Subsection
1338 wxWidgets platform
1339 \end_layout
1341 \begin_layout Subsubsection
1342 Modifier names:
1343 \end_layout
1345 \begin_layout Standard
1346 Following modifier names are known:
1347 \end_layout
1349 \begin_layout Itemize
1351 \end_layout
1353 \begin_layout Itemize
1354 ctrl
1355 \end_layout
1357 \begin_layout Itemize
1358 shift 
1359 \end_layout
1361 \begin_layout Itemize
1362 meta
1363 \end_layout
1365 \begin_layout Itemize
1366 cmd (Mac OS X only)
1367 \end_layout
1369 \begin_layout Subsubsection
1370 Key names:
1371 \end_layout
1373 \begin_layout Standard
1374 Following key names are known:
1375 \end_layout
1377 \begin_layout Itemize
1378 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1379  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1380  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1381  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1382  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1383  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1384  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1385  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1386  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1387  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1388  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1389  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1390  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1391  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1392  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1393  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1394  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1395  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1396  windows_right, windows_menu, command, special1, special2, special3, special4,
1397  special5, special6, special7, special8, special9, special10, special11,
1398  special12, special13, special14, special15, special16, special17, special18,
1399  special19, special20
1400 \end_layout
1402 \begin_layout Section
1403 Movie file format
1404 \end_layout
1406 \begin_layout Standard
1407 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1408  (note: If you recompress it, do not use compression methods other than
1409  store and deflate and especially do not use encryption of any kind).
1410 \end_layout
1412 \begin_layout Subsection
1413 Detecting clean start/SRAM/Savestate
1414 \end_layout
1416 \begin_layout Itemize
1417 If file has member 
1418 \begin_inset Quotes eld
1419 \end_inset
1421 savestate
1422 \begin_inset Quotes erd
1423 \end_inset
1425  it is savestate, otherwise:
1426 \end_layout
1428 \begin_layout Itemize
1429 If file has members with names starting 
1430 \begin_inset Quotes eld
1431 \end_inset
1433 moviesram.
1434 \begin_inset Quotes erd
1435 \end_inset
1437  it is movie starting from SRAM, otherwise:
1438 \end_layout
1440 \begin_layout Itemize
1441 It is movie starting from clear state.
1442 \end_layout
1444 \begin_layout Subsection
1445 Member: gametype
1446 \end_layout
1448 \begin_layout Standard
1449 Type of game ROM and region (as one line).
1450  Valid values are:
1451 \end_layout
1453 \begin_layout Standard
1454 \begin_inset Tabular
1455 <lyxtabular version="3" rows="8" columns="3">
1456 <features tabularvalignment="middle">
1457 <column alignment="center" valignment="top" width="0">
1458 <column alignment="center" valignment="top" width="0">
1459 <column alignment="center" valignment="top" width="0">
1460 <row>
1461 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1462 \begin_inset Text
1464 \begin_layout Plain Layout
1465 Value
1466 \end_layout
1468 \end_inset
1469 </cell>
1470 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1471 \begin_inset Text
1473 \begin_layout Plain Layout
1474 System
1475 \end_layout
1477 \end_inset
1478 </cell>
1479 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1480 \begin_inset Text
1482 \begin_layout Plain Layout
1483 Region
1484 \end_layout
1486 \end_inset
1487 </cell>
1488 </row>
1489 <row>
1490 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1491 \begin_inset Text
1493 \begin_layout Plain Layout
1494 snes_pal
1495 \end_layout
1497 \end_inset
1498 </cell>
1499 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1500 \begin_inset Text
1502 \begin_layout Plain Layout
1503 Super NES
1504 \end_layout
1506 \end_inset
1507 </cell>
1508 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1509 \begin_inset Text
1511 \begin_layout Plain Layout
1513 \end_layout
1515 \end_inset
1516 </cell>
1517 </row>
1518 <row>
1519 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1520 \begin_inset Text
1522 \begin_layout Plain Layout
1523 sgb_pal
1524 \end_layout
1526 \end_inset
1527 </cell>
1528 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1529 \begin_inset Text
1531 \begin_layout Plain Layout
1532 Super Game Boy
1533 \end_layout
1535 \end_inset
1536 </cell>
1537 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1538 \begin_inset Text
1540 \begin_layout Plain Layout
1542 \end_layout
1544 \end_inset
1545 </cell>
1546 </row>
1547 <row>
1548 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1549 \begin_inset Text
1551 \begin_layout Plain Layout
1552 snes_ntsc
1553 \end_layout
1555 \end_inset
1556 </cell>
1557 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1558 \begin_inset Text
1560 \begin_layout Plain Layout
1561 Super NES
1562 \end_layout
1564 \end_inset
1565 </cell>
1566 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1567 \begin_inset Text
1569 \begin_layout Plain Layout
1570 NTSC
1571 \end_layout
1573 \end_inset
1574 </cell>
1575 </row>
1576 <row>
1577 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1578 \begin_inset Text
1580 \begin_layout Plain Layout
1581 sgb_ntsc
1582 \end_layout
1584 \end_inset
1585 </cell>
1586 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1587 \begin_inset Text
1589 \begin_layout Plain Layout
1590 Super Game Boy
1591 \end_layout
1593 \end_inset
1594 </cell>
1595 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1596 \begin_inset Text
1598 \begin_layout Plain Layout
1599 NTSC
1600 \end_layout
1602 \end_inset
1603 </cell>
1604 </row>
1605 <row>
1606 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1607 \begin_inset Text
1609 \begin_layout Plain Layout
1611 \end_layout
1613 \end_inset
1614 </cell>
1615 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1616 \begin_inset Text
1618 \begin_layout Plain Layout
1619 BS-X (non-slotted)
1620 \end_layout
1622 \end_inset
1623 </cell>
1624 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1625 \begin_inset Text
1627 \begin_layout Plain Layout
1628 NTSC
1629 \end_layout
1631 \end_inset
1632 </cell>
1633 </row>
1634 <row>
1635 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1636 \begin_inset Text
1638 \begin_layout Plain Layout
1639 bsxslotted
1640 \end_layout
1642 \end_inset
1643 </cell>
1644 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1645 \begin_inset Text
1647 \begin_layout Plain Layout
1648 BS-X (slotted)
1649 \end_layout
1651 \end_inset
1652 </cell>
1653 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1654 \begin_inset Text
1656 \begin_layout Plain Layout
1657 NTSC
1658 \end_layout
1660 \end_inset
1661 </cell>
1662 </row>
1663 <row>
1664 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1665 \begin_inset Text
1667 \begin_layout Plain Layout
1668 sufamiturbo
1669 \end_layout
1671 \end_inset
1672 </cell>
1673 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1674 \begin_inset Text
1676 \begin_layout Plain Layout
1677 Sufami Turbo
1678 \end_layout
1680 \end_inset
1681 </cell>
1682 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1683 \begin_inset Text
1685 \begin_layout Plain Layout
1686 NTSC
1687 \end_layout
1689 \end_inset
1690 </cell>
1691 </row>
1692 </lyxtabular>
1694 \end_inset
1697 \end_layout
1699 \begin_layout Standard
1700 Frame rates are:
1701 \end_layout
1703 \begin_layout Standard
1704 \begin_inset Tabular
1705 <lyxtabular version="3" rows="3" columns="2">
1706 <features tabularvalignment="middle">
1707 <column alignment="center" valignment="top" width="0">
1708 <column alignment="center" valignment="top" width="0">
1709 <row>
1710 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1711 \begin_inset Text
1713 \begin_layout Plain Layout
1714 Region
1715 \end_layout
1717 \end_inset
1718 </cell>
1719 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1720 \begin_inset Text
1722 \begin_layout Plain Layout
1723 Framerate (fps)
1724 \end_layout
1726 \end_inset
1727 </cell>
1728 </row>
1729 <row>
1730 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1731 \begin_inset Text
1733 \begin_layout Plain Layout
1735 \end_layout
1737 \end_inset
1738 </cell>
1739 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1740 \begin_inset Text
1742 \begin_layout Plain Layout
1743 322445/6448
1744 \end_layout
1746 \end_inset
1747 </cell>
1748 </row>
1749 <row>
1750 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1751 \begin_inset Text
1753 \begin_layout Plain Layout
1754 NTSC
1755 \end_layout
1757 \end_inset
1758 </cell>
1759 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1760 \begin_inset Text
1762 \begin_layout Plain Layout
1763 10738636/178683
1764 \end_layout
1766 \end_inset
1767 </cell>
1768 </row>
1769 </lyxtabular>
1771 \end_inset
1774 \end_layout
1776 \begin_layout Subsection
1777 Member: port1
1778 \end_layout
1780 \begin_layout Standard
1781 Contains type of port #1 (as one line).
1782  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1783  If not present, defaults to 'gamepad'.
1784 \end_layout
1786 \begin_layout Subsection
1787 Member: port2
1788 \end_layout
1790 \begin_layout Standard
1791 Contains type of port #2 (as one line).
1792  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1793  'justifier' and 'justifiers'.
1794  If not present, defaults to 'none'.
1795 \end_layout
1797 \begin_layout Subsection
1798 Member: gamename
1799 \end_layout
1801 \begin_layout Standard
1802 Contains name of the game (as one line).
1803 \end_layout
1805 \begin_layout Subsection
1806 Member: authors
1807 \end_layout
1809 \begin_layout Standard
1810 Contains authors, one per line.
1811  Part before '|' is the full name, part after is the nickname.
1812 \end_layout
1814 \begin_layout Subsection
1815 Member: systemid
1816 \end_layout
1818 \begin_layout Standard
1819 Always 
1820 \begin_inset Quotes eld
1821 \end_inset
1823 lsnes-rr1
1824 \begin_inset Quotes erd
1825 \end_inset
1827  (one line).
1828  Used to reject other saves.
1829 \end_layout
1831 \begin_layout Subsection
1832 Member: controlsversion
1833 \end_layout
1835 \begin_layout Standard
1836 Always 
1837 \begin_inset Quotes eld
1838 \end_inset
1841 \begin_inset Quotes erd
1842 \end_inset
1844  (one line).
1845  Used to identify what controls are there.
1846 \end_layout
1848 \begin_layout Subsection
1849 Member: 
1850 \begin_inset Quotes eld
1851 \end_inset
1853 coreversion
1854 \begin_inset Quotes erd
1855 \end_inset
1858 \end_layout
1860 \begin_layout Standard
1861 Contains bsnes core version number (as one line).
1862 \end_layout
1864 \begin_layout Subsection
1865 Member: projectid
1866 \end_layout
1868 \begin_layout Standard
1869 Contains project ID (as one line).
1870  Used to identify if two movies are part of the same project.
1871 \end_layout
1873 \begin_layout Subsection
1874 Member: {rom,slota,slotb}{,xml}.sha256
1875 \end_layout
1877 \begin_layout Standard
1878 Contains SHA-256 of said ROM or ROM mapping file (as one line).
1879  Absent if corresponding file is absent.
1880 \end_layout
1882 \begin_layout Subsection
1883 Member: moviesram.<name>
1884 \end_layout
1886 \begin_layout Standard
1887 Raw binary startup SRAM of kind <name>.
1888  Only present in savestates and movies starting from SRAM.
1889 \end_layout
1891 \begin_layout Subsection
1892 Member: saveframe
1893 \end_layout
1895 \begin_layout Standard
1896 Contains frame number (as one line) of frame movie was saved on.
1897  Only present in savestates.
1898 \end_layout
1900 \begin_layout Subsection
1901 Member: lagcounter
1902 \end_layout
1904 \begin_layout Standard
1905 Current value of lag counter (as one line).
1906  Only present in savestates.
1907 \end_layout
1909 \begin_layout Subsection
1910 Member: pollcounters
1911 \end_layout
1913 \begin_layout Standard
1914 Contains poll counters (currently 100 of them), one per line.
1915  Each line is raw poll count if DRDY is set for it.
1916  Otherwise it is negative poll count minus one.
1917  Only present in savestates.
1918 \end_layout
1920 \begin_layout Subsection
1921 Member: hostmemory
1922 \end_layout
1924 \begin_layout Standard
1925 Raw binary dump of host memory.
1926  Only present in savestates.
1927 \end_layout
1929 \begin_layout Subsection
1930 Member: savestate
1931 \end_layout
1933 \begin_layout Standard
1934 The raw binary savestate itself.
1935  Savestate detection uses this file, only present in savestates.
1936 \end_layout
1938 \begin_layout Subsection
1939 Member: screenshot
1940 \end_layout
1942 \begin_layout Standard
1943 Screenshot of current frame.
1944  Only present in savestates.
1945  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
1946  data.
1947  Height of image is inferred from the width and size of data.
1948 \end_layout
1950 \begin_layout Subsection
1951 Member: sram.<name>
1952 \end_layout
1954 \begin_layout Standard
1955 Raw binary SRAM of kind <name> at time of savestate.
1956  Only present in savestates.
1957 \end_layout
1959 \begin_layout Subsection
1960 Member: input
1961 \end_layout
1963 \begin_layout Standard
1964 The actual input track, one line per subframe (blank lines are skipped).
1965 \end_layout
1967 \begin_layout Itemize
1968 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
1969  part of same frame as previous, otherwise it starts a new frame.
1970 \end_layout
1972 \begin_layout Itemize
1973 First subframe must start a new frame.
1974 \end_layout
1976 \begin_layout Standard
1977 Length of movie in frames is number of lines in input file that start a
1978  new frame.
1979 \end_layout
1981 \begin_layout Subsection
1982 Member: subtitles
1983 \end_layout
1985 \begin_layout Standard
1986 Subtitle track.
1987  Optional.
1988 \end_layout
1990 \begin_layout Itemize
1991 Each line is in form <firstframe> <numframes> <text>.
1992 \end_layout
1994 \begin_layout Itemize
1995 Linefeed is encoded as 
1996 \backslash
1997 n, backslash is encoded as 
1998 \backslash
2000 \backslash
2002 \end_layout
2004 \begin_layout Subsection
2005 Member: rerecords
2006 \end_layout
2008 \begin_layout Standard
2009 Contains textual base-10 rerecord count (as one line; emulator just writes
2010  this, it doesn't read it) + 1.
2011 \end_layout
2013 \begin_layout Subsection
2014 Member: rrdata
2015 \end_layout
2017 \begin_layout Standard
2018 This member stores set of load IDs.
2019  There is one load ID per rerecord (plus one corresponding to start of project).
2020 \end_layout
2022 \begin_layout Itemize
2023 This member constists of concatenation of records
2024 \end_layout
2026 \begin_layout Itemize
2027 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2028  IDs.
2029 \end_layout
2031 \begin_layout Itemize
2032 IDs are interpretted as 256-bit big-endian integers with warparound.
2033 \end_layout
2035 \begin_layout Itemize
2036 Initial predicted ID is all zeroes.
2037 \end_layout
2039 \begin_layout Standard
2040 Format of each record is:
2041 \end_layout
2043 \begin_layout Itemize
2044 1 byte: Opcode byte.
2045  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2046  Bit 7 is unused.
2047 \end_layout
2049 \begin_layout Itemize
2050 32-prefixlen bytes of ID.
2051 \end_layout
2053 \begin_layout Itemize
2054 countlen bytes of big-endian count (count).
2055 \end_layout
2057 \begin_layout Standard
2058 Records are processed as follows:
2059 \end_layout
2061 \begin_layout Itemize
2062 To form the first ID encoded by record, take the first prefixlen bytes predicted
2063  ID and append the read ID value to it.
2064  The result is the first ID encoded.
2065 \end_layout
2067 \begin_layout Itemize
2068 If countlen is 0, record encodes 1 ID.
2069 \end_layout
2071 \begin_layout Itemize
2072 If countlen is 1, record encodes 2+count IDs.
2073 \end_layout
2075 \begin_layout Itemize
2076 If countlen is 2, record encodes 258+count IDs.
2077 \end_layout
2079 \begin_layout Itemize
2080 If countlen is 3, record encodes 65794+count IDs.
2081 \end_layout
2083 \begin_layout Itemize
2084 The new predicted ID is the next ID after last one encoded by the record.
2085 \end_layout
2087 \begin_layout Standard
2088 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2089  by all records.
2090 \end_layout
2092 \begin_layout Subsection
2093 Member: starttime.second
2094 \end_layout
2096 \begin_layout Standard
2097 Movie starting time, second part.
2098  Epoch is Unix epoch.
2099  Default is 1,000,000,000.
2100 \end_layout
2102 \begin_layout Subsection
2103 Member: starttime.subsecond
2104 \end_layout
2106 \begin_layout Standard
2107 Movie starting time, subsecond part.
2108  Unit is CPU clocks.
2109  Default is 0.
2110 \end_layout
2112 \begin_layout Subsection
2113 Member: savetime.second
2114 \end_layout
2116 \begin_layout Standard
2117 Movie saving time, second part.
2118  Default is starttime.second.
2119  Only present in savestates.
2120 \end_layout
2122 \begin_layout Subsection
2123 Member: savetime.subsecond
2124 \end_layout
2126 \begin_layout Standard
2127 Movie saving time, subsecond part.
2128  Default is starttime.subsecond.
2129  Only present in savestates.
2130 \end_layout
2132 \begin_layout Section
2133 lsvs file format (commentary tracks)
2134 \end_layout
2136 \begin_layout Subsection
2137 Clusters
2138 \end_layout
2140 \begin_layout Itemize
2141 Each cluster is 8kB (8192 bytes) in size.
2142 \end_layout
2144 \begin_layout Itemize
2145 Cluster n starts at offset 8192*n in file.
2146 \end_layout
2148 \begin_layout Itemize
2149 The following clusters are system special:
2150 \end_layout
2152 \begin_deeper
2153 \begin_layout Itemize
2154 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2155 \end_layout
2157 \begin_layout Itemize
2158 Cluster 1 (superblock)
2159 \end_layout
2161 \end_deeper
2162 \begin_layout Subsection
2163 Cluster tables
2164 \end_layout
2166 \begin_layout Itemize
2167 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2168  last 11 bits of n).
2169 \end_layout
2171 \begin_layout Itemize
2172 This cluster table consists of 2048 4-byte big-endian integers.
2173 \end_layout
2175 \begin_layout Itemize
2176 Each entry describes a cluster in 16MB supercluster, in order.
2177 \end_layout
2179 \begin_layout Itemize
2180 The valid values for entries are:
2181 \end_layout
2183 \begin_deeper
2184 \begin_layout Itemize
2185 0x00000000: Free cluster
2186 \end_layout
2188 \begin_layout Itemize
2189 0x00000001: Last cluster in chain.
2190 \end_layout
2192 \begin_layout Itemize
2193 0xFFFFFFFF: System cluster (cluster tables and superblock)
2194 \end_layout
2196 \begin_layout Itemize
2197 (anything else): Number of next cluster in chain.
2198  Must not be multiple of 2048.
2199 \end_layout
2201 \end_deeper
2202 \begin_layout Itemize
2203 Due to limitations of the format, there can be at most 2097052 superclusters,
2204  giving maximum file size of 16TB.
2205 \end_layout
2207 \begin_layout Subsection
2208 Stream table
2209 \end_layout
2211 \begin_layout Itemize
2212 The stream table chain always starts in cluster 2.
2213 \end_layout
2215 \begin_layout Itemize
2216 Otherwise, it follows normal chaining.
2217 \end_layout
2219 \begin_layout Itemize
2220 The stream table consists of 16-byte entries:
2221 \end_layout
2223 \begin_deeper
2224 \begin_layout Itemize
2225 The first 8 bytes of entry give big-endian beginning position of stream
2226  in units of 1/48000 s.
2227 \end_layout
2229 \begin_layout Itemize
2230 The next 4 bytes of entry give big-endian beginning cluster for control
2231  data.
2232  0 here marks the entry as not present.
2233 \end_layout
2235 \begin_layout Itemize
2236 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2237 \end_layout
2239 \end_deeper
2240 \begin_layout Itemize
2241 Stream table clusters are normal clusters, following normal chaining.
2242 \end_layout
2244 \begin_layout Itemize
2245 The stream begnning position is not guarenteed unique.
2246  There can be multiple streams with the same starting position in the file.
2247 \end_layout
2249 \begin_layout Subsection
2250 Stream control data
2251 \end_layout
2253 \begin_layout Itemize
2254 The stream control data consists of entries 4 bytes each:
2255 \end_layout
2257 \begin_deeper
2258 \begin_layout Itemize
2259 The first 2 bytes of entry gives big-endian length of packet
2260 \end_layout
2262 \begin_layout Itemize
2263 The next byte of entry gives audio length of packet in units of 1/400 s.
2264 \end_layout
2266 \begin_layout Itemize
2267 The last byte is control byte.
2268 \end_layout
2270 \begin_deeper
2271 \begin_layout Itemize
2272 0 means this entry is not present and the control data ends.
2273 \end_layout
2275 \begin_layout Itemize
2276 1 is valid control entry.
2277 \end_layout
2279 \end_deeper
2280 \end_deeper
2281 \begin_layout Itemize
2282 The stream control data can also end by running into end of the readable
2283  chain.
2284 \end_layout
2286 \begin_deeper
2287 \begin_layout Itemize
2288 This happens if there happens to be exact multiple of 2048 packets in stream
2289  and number of packets is nonzero.
2290 \end_layout
2292 \end_deeper
2293 \begin_layout Itemize
2294 These clusters follow normal chaining.
2295 \end_layout
2297 \begin_layout Subsection
2298 Stream codec data
2299 \end_layout
2301 \begin_layout Itemize
2302 Stream codec data consists of raw Opus data packets packed back to back
2303  with nothing in between.
2304 \end_layout
2306 \begin_layout Itemize
2307 Warning: Due to internal limitations, this data must reside in the first
2308  65536 superclusters (that is, the first 1TB of the file).
2309 \end_layout
2311 \begin_layout Subsection
2312 Superblock
2313 \end_layout
2315 \begin_layout Itemize
2316 The superblock is stored in cluster 1.
2318 \end_layout
2320 \begin_layout Itemize
2321 The first 11 bytes are 
2322 \begin_inset Quotes eld
2323 \end_inset
2325 sefs-magic
2326 \begin_inset Quotes erd
2327 \end_inset
2329 <NUL>.
2330 \end_layout
2332 \begin_layout Itemize
2333 The rest are unused.
2334 \end_layout
2336 \begin_layout Itemize
2337 This cluster 1 is marked as system special.
2338 \end_layout
2340 \begin_layout Section
2341 Known ROM extensions
2342 \end_layout
2344 \begin_layout Itemize
2345 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2346 \end_layout
2348 \begin_layout Itemize
2349 DMG cartridge ROMs: dmg, gb.
2350 \end_layout
2352 \begin_layout Itemize
2353 GBC cartridge ROMs: cgb, gbc.
2354 \end_layout
2356 \begin_layout Section
2357 Gamepack files
2358 \end_layout
2360 \begin_layout Itemize
2361 The first line must be: 
2362 \begin_inset Quotes eld
2363 \end_inset
2365 [GAMEPACK FILE]
2366 \begin_inset Quotes erd
2367 \end_inset
2370 \end_layout
2372 \begin_layout Itemize
2373 There is one needed line: 
2374 \begin_inset Quotes eld
2375 \end_inset
2377 type <systype>
2378 \begin_inset Quotes erd
2379 \end_inset
2382  This sets system type to <systype>.
2383  The following system types are valid:
2384 \end_layout
2386 \begin_deeper
2387 \begin_layout Itemize
2388 snes (SNES)
2389 \end_layout
2391 \begin_layout Itemize
2392 bsx (BS-X non-slotted)
2393 \end_layout
2395 \begin_layout Itemize
2396 bsxslotted (BS-X slotted)
2397 \end_layout
2399 \begin_layout Itemize
2400 sufamiturbo (Sufami Turbo)
2401 \end_layout
2403 \begin_layout Itemize
2404 sgb (Super Game Boy)
2405 \end_layout
2407 \begin_layout Itemize
2408 dmg (Game Boy)
2409 \end_layout
2411 \begin_layout Itemize
2412 gbc (Game Boy Color)
2413 \end_layout
2415 \begin_layout Itemize
2416 gbc_gba (Game Boy Color with GBA initial register values)
2417 \end_layout
2419 \end_deeper
2420 \begin_layout Itemize
2421 Optionally a region can be specified: 
2422 \begin_inset Quotes eld
2423 \end_inset
2425 region <region>
2426 \begin_inset Quotes erd
2427 \end_inset
2430  The following values are valid:
2431 \end_layout
2433 \begin_deeper
2434 \begin_layout Itemize
2435 autodetect (Autodetect region: snes and sgb only)
2436 \end_layout
2438 \begin_layout Itemize
2439 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2440 \end_layout
2442 \begin_layout Itemize
2443 pal (PAL: snes, sgb)
2444 \end_layout
2446 \begin_layout Itemize
2447 world (World: dmg, gbc, gbc_gba)
2448 \end_layout
2450 \end_deeper
2451 \begin_layout Itemize
2452 ROM images are loaded as: 
2453 \begin_inset Quotes eld
2454 \end_inset
2456 rom <type> <file>
2457 \begin_inset Quotes erd
2458 \end_inset
2461  The following types are valid:
2462 \end_layout
2464 \begin_deeper
2465 \begin_layout Itemize
2466 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2467  BIOS in bsx, bsxslotted, sufamiturbo)
2468 \end_layout
2470 \begin_layout Itemize
2471 bsx (Cartridge ROM in bsx, bsxslotted)
2472 \end_layout
2474 \begin_layout Itemize
2475 slot-a (Cartridge ROM in sufamiturbo)
2476 \end_layout
2478 \begin_layout Itemize
2479 slot-b (Cartridge ROM in sufamiturbo)
2480 \end_layout
2482 \end_deeper
2483 \begin_layout Itemize
2484 ROM markup can be loaded as: 
2485 \begin_inset Quotes eld
2486 \end_inset
2488 xml <type> <file>
2489 \begin_inset Quotes erd
2490 \end_inset
2493  The types valid are the same as for ROMs.
2494 \end_layout
2496 \begin_layout Itemize
2497 Patches can be loaded as 
2498 \begin_inset Quotes eld
2499 \end_inset
2501 patch[<offset>] <type> <file>
2502 \begin_inset Quotes erd
2503 \end_inset
2506  The types are the same as for ROMs.
2507 \end_layout
2509 \begin_deeper
2510 \begin_layout Itemize
2511 Offset is given in form [+-]<number>.
2512  Usually offset is either +0 or -512.
2513 \end_layout
2515 \begin_layout Itemize
2516 Default offset is +0.
2517 \end_layout
2519 \end_deeper
2520 \begin_layout Subsection
2521 Example:
2522 \end_layout
2524 \begin_layout LyX-Code
2525 [GAMEPACK FILE]
2526 \end_layout
2528 \begin_layout LyX-Code
2529 type snes
2530 \end_layout
2532 \begin_layout LyX-Code
2533 rom rom speedygonzales.sfc
2534 \end_layout
2536 \begin_layout LyX-Code
2537 patch-512 rom sonicthehedgehog.ips
2538 \end_layout
2540 \begin_layout Subsection
2541 Example 2:
2542 \end_layout
2544 \begin_layout LyX-Code
2545 [GAMEPACK FILE]
2546 \end_layout
2548 \begin_layout LyX-Code
2549 type sgb
2550 \end_layout
2552 \begin_layout LyX-Code
2553 rom rom supergameboy.sfc
2554 \end_layout
2556 \begin_layout LyX-Code
2557 rom dmg megamanV.dmg
2558 \end_layout
2560 \begin_layout Section
2561 Quick'n'dirty encode guide
2562 \end_layout
2564 \begin_layout Enumerate
2565 Start the emulator and load the ROM and movie file.
2566 \end_layout
2568 \begin_layout Enumerate
2569 Set large AVI option 'set-setting avi-large on'
2570 \end_layout
2572 \begin_layout Enumerate
2573 Enable dumping 'dump-avi tmpdump' 
2574 \end_layout
2576 \begin_layout Enumerate
2577 Unpause and let it run until you want to end dumping.
2578 \end_layout
2580 \begin_layout Enumerate
2581 Close the emulator (closing the window is the easiest way).
2582  Or use 'end-avi'.
2583 \end_layout
2585 \begin_layout Enumerate
2586 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2587  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2588 \end_layout
2590 \begin_layout Enumerate
2591 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2592 \end_layout
2594 \begin_layout Enumerate
2595 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2596  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2597 \end_layout
2599 \begin_layout Enumerate
2600 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2601  Now final.mkv contains quick'n'dirty encode.
2602 \end_layout
2604 \begin_layout Section
2605 Axis configurations for some gamepad types:
2606 \end_layout
2608 \begin_layout Subsection
2609 XBox360 controller:
2610 \end_layout
2612 \begin_layout Standard
2613 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2614 \end_layout
2616 \begin_layout LyX-Code
2617 set-axis joystick0axis2 pressure-+
2618 \end_layout
2620 \begin_layout LyX-Code
2621 set-axis joystick0axis5 pressure-+
2622 \end_layout
2624 \begin_layout Itemize
2625 This is needed for SDL only.
2626  EVDEV sets those types correctly.
2627 \end_layout
2629 \begin_layout Subsection
2630 PS3 
2631 \begin_inset Quotes eld
2632 \end_inset
2634 sixaxis
2635 \begin_inset Quotes erd
2636 \end_inset
2638  controller:
2639 \end_layout
2641 \begin_layout Standard
2642 Axes 8-19 should be disabled.
2643 \end_layout
2645 \begin_layout LyX-Code
2646 set-axis joystick0axis8 disabled
2647 \end_layout
2649 \begin_layout LyX-Code
2650 set-axis joystick0axis9 disabled
2651 \end_layout
2653 \begin_layout LyX-Code
2654 set-axis joystick0axis10 disabled
2655 \end_layout
2657 \begin_layout LyX-Code
2658 set-axis joystick0axis11 disabled
2659 \end_layout
2661 \begin_layout LyX-Code
2662 set-axis joystick0axis12 disabled
2663 \end_layout
2665 \begin_layout LyX-Code
2666 set-axis joystick0axis13 disabled
2667 \end_layout
2669 \begin_layout LyX-Code
2670 set-axis joystick0axis14 disabled
2671 \end_layout
2673 \begin_layout LyX-Code
2674 set-axis joystick0axis15 disabled
2675 \end_layout
2677 \begin_layout LyX-Code
2678 set-axis joystick0axis16 disabled
2679 \end_layout
2681 \begin_layout LyX-Code
2682 set-axis joystick0axis17 disabled
2683 \end_layout
2685 \begin_layout LyX-Code
2686 set-axis joystick0axis18 disabled
2687 \end_layout
2689 \begin_layout LyX-Code
2690 set-axis joystick0axis19 disabled
2691 \end_layout
2693 \begin_layout Section
2694 Errata:
2695 \end_layout
2697 \begin_layout Subsection
2698 Problems from BSNES core:
2699 \end_layout
2701 \begin_layout Itemize
2702 The whole pending save stuff.
2703 \end_layout
2705 \begin_layout Itemize
2706 It is slow (especially accuracy).
2707 \end_layout
2709 \begin_layout Itemize
2710 Firmwares can't be loaded from ZIP archives.
2711 \end_layout
2713 \begin_layout Subsection
2714 Other problems:
2715 \end_layout
2717 \begin_layout Itemize
2718 Modifiers don't work with pseudo-keys.
2719 \end_layout
2721 \begin_layout Itemize
2722 Audio for last dumped frame is not itself dumped.
2723 \end_layout
2725 \begin_layout Itemize
2726 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2727 \end_layout
2729 \end_body
2730 \end_document