loadlib refactoring, add program modules
[lsnes.git] / manual.lyx
blob9517836276e6a12b3bedb3699a16458152974cbb
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 set-jukebox-slot <slot>
784 \end_layout
786 \begin_layout Standard
787 Set current jukebox slot
788 \end_layout
790 \begin_layout Subsubsection
791 load-jukebox
792 \end_layout
794 \begin_layout Standard
795 Do load from jukebox (current mode).
796 \end_layout
798 \begin_layout Subsubsection
799 save-jukebox
800 \end_layout
802 \begin_layout Standard
803 Do state save to jukebox.
804 \end_layout
806 \begin_layout Subsection
807 Lua 
808 \end_layout
810 \begin_layout Subsubsection
811 evaluate-lua <luacode>
812 \end_layout
814 \begin_layout Standard
815 Run Lua code <luacode> using built-in Lua interpretter.
816 \end_layout
818 \begin_layout Subsubsection
819 L <luacode>
820 \end_layout
822 \begin_layout Standard
823 Synonym for evaluate-lua.
824 \end_layout
826 \begin_layout Subsubsection
827 run-lua <script>
828 \end_layout
830 \begin_layout Standard
831 Run specified lua file using built-in Lua interpretter.
832 \end_layout
834 \begin_layout Subsubsection
835 reset-lua
836 \end_layout
838 \begin_layout Standard
839 Clear the Lua VM state and restore to factory defaults.
840 \end_layout
842 \begin_layout Subsection
843 Memory watch
844 \end_layout
846 \begin_layout Subsubsection
847 add-watch <name> <expression>
848 \end_layout
850 \begin_layout Standard
851 Adds new watch (or modifies old one).
852 \end_layout
854 \begin_layout Subsubsection
855 remove-watch <name>
856 \end_layout
858 \begin_layout Standard
859 Remove a watch.
860 \end_layout
862 \begin_layout Subsection
863 Sound 
864 \end_layout
866 \begin_layout Subsubsection
867 enable-sound <on/off> 
868 \end_layout
870 \begin_layout Standard
871 Enable/Disable sound.
872 \end_layout
874 \begin_layout Subsection
875 Misc.
876 \end_layout
878 \begin_layout Subsubsection
879 reload-rom [<file>]
880 \end_layout
882 \begin_layout Standard
883 Reloads the main ROM image from <file>.
884 \end_layout
886 \begin_layout Subsubsection
887 +tangent
888 \end_layout
890 \begin_layout Standard
891 Tangent for recording voice for commentary track.
892  While pressed, record a stream.
893 \end_layout
895 \begin_layout Subsubsection
896 advance-subframe-timeout
897 \end_layout
899 \begin_layout Standard
900 Subframe advance timeout in milliseconds.
901  Default is 100.
902 \end_layout
904 \begin_layout Section
905 Settings
906 \end_layout
908 \begin_layout Subsection
909 Core settings
910 \end_layout
912 \begin_layout Subsection
913 AVI dumper settings
914 \end_layout
916 \begin_layout Subsubsection
917 avi-large
918 \end_layout
920 \begin_layout Standard
921 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
922  outputs.
923 \end_layout
925 \begin_layout Subsubsection
926 avi-left-border
927 \end_layout
929 \begin_layout Standard
930 AVI dumper: Set the default left border thickness (unless lua overrides)
931  for dumps.
932  Range 0-8191.
933  Default is 0.
934 \end_layout
936 \begin_layout Subsubsection
937 avi-right-border
938 \end_layout
940 \begin_layout Standard
941 AVI dumper: Set the default right border thickness (unless lua overrides)
942  for dumps.
943  Range 0-8191.
944  Default is 0.
945 \end_layout
947 \begin_layout Subsubsection
948 avi-top-border
949 \end_layout
951 \begin_layout Standard
952 AVI dumper: Set the default top border thickness (unless lua overrides)
953  for dumps.
954  Range 0-8191.
955  Default is 0.
956 \end_layout
958 \begin_layout Subsubsection
959 avi-bottom-border
960 \end_layout
962 \begin_layout Standard
963 AVI dumper: Set the default bottom border thickness (unless lua overrides)
964  for dumps.
965  Range 0-8191.
966  Default is 0.
967 \end_layout
969 \begin_layout Subsubsection
970 avi-maxframes
971 \end_layout
973 \begin_layout Standard
974 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
975  Range 0-999999999.
976  Default is 0.
977 \end_layout
979 \begin_layout Subsubsection
980 avi-compresison
981 \end_layout
983 \begin_layout Standard
984 AVI dumper: Compression level (0-18).
985 \end_layout
987 \begin_layout Itemize
988 Compression levels 10 and above are not compatible with stock CSCD codec.
989 \end_layout
991 \begin_layout Itemize
992 Recomended level is 7.
993 \end_layout
995 \begin_layout Subsubsection
996 avi-soundrate
997 \end_layout
999 \begin_layout Standard
1000 AVI dumper: Set method of determining the sound rate.
1001 \end_layout
1003 \begin_layout Itemize
1004 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1005  128, 176.4 and 192 kHz.
1006 \end_layout
1008 \begin_layout Itemize
1009 1: Round down to nearest integer.
1010 \end_layout
1012 \begin_layout Itemize
1013 2: Round up to nearest ingeter.
1014 \end_layout
1016 \begin_layout Itemize
1017 3: Multiply by denominator.
1018 \end_layout
1020 \begin_layout Itemize
1021 4: High quality 44.1kHz (SRC needed).
1022 \end_layout
1024 \begin_layout Itemize
1025 5: High quality 48kHz (SRC needed).
1026 \end_layout
1028 \begin_layout Subsection
1029 JMD options
1030 \end_layout
1032 \begin_layout Subsubsection
1033 jmd-compression
1034 \end_layout
1036 \begin_layout Standard
1037 JMD dumper: Compression level (0-9).
1038 \end_layout
1040 \begin_layout Section
1041 Movie editor
1042 \end_layout
1044 \begin_layout Itemize
1045 The editor edits in-memory movie.
1046 \end_layout
1048 \begin_layout Itemize
1049 Because past can't be edited and readwrite mode doesn't allow future, editing
1050  only works in 
1051 \emph on
1052 read only
1053 \emph default
1054  mode.
1055 \end_layout
1057 \begin_layout Itemize
1058 Keyboard triggers the normal hotkeys and bindings.
1059 \end_layout
1061 \begin_layout Subsection
1062 Left button actions
1063 \end_layout
1065 \begin_layout Itemize
1066 Clicking on cell in future (indicated by lack of redish background) toggles
1067  it (if it is a button) or prompts for a value (if it is an axis)
1068 \end_layout
1070 \begin_layout Itemize
1071 Dragging vertically toggles sequence of buttons or changes a sequence of
1072  axis values.
1073 \end_layout
1075 \begin_layout Subsection
1076 Right button actions
1077 \end_layout
1079 \begin_layout Standard
1080 The right mouse button pops up a context-sensitive menu:
1081 \end_layout
1083 \begin_layout Itemize
1084 Toggle <something>: Toggle this button
1085 \end_layout
1087 \begin_layout Itemize
1088 Change <something>: Change this axis value
1089 \end_layout
1091 \begin_layout Itemize
1092 Insert frame after: Insert a frame after this frame
1093 \end_layout
1095 \begin_layout Itemize
1096 Append frame: Append a frame to movie
1097 \end_layout
1099 \begin_layout Itemize
1100 Append frames: Append specified number of frames to movie
1101 \end_layout
1103 \begin_layout Itemize
1104 Delete frame: Delete this frame
1105 \end_layout
1107 \begin_layout Itemize
1108 Delete subframe: Delete this subframe
1109 \end_layout
1111 \begin_layout Itemize
1112 Truncate movie: Delete this subframe and everything after it.
1113 \end_layout
1115 \begin_layout Itemize
1116 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1117 \end_layout
1119 \begin_layout Itemize
1120 Scroll to current frame: Scroll the display to current position
1121 \end_layout
1123 \begin_layout Itemize
1124 Run to frame: Prompts for frame and runs the emulation to that frame.
1125 \end_layout
1127 \begin_layout Itemize
1128 Change number of lines visible: Change the height of the movie display (1
1129  to 255).
1130 \end_layout
1132 \begin_layout Itemize
1133 Lock scroll to playback: While playing back or rewinding movies, the display
1134  will follow if enabled.
1135 \end_layout
1137 \begin_layout Section
1138 Memory watch expression syntax
1139 \end_layout
1141 \begin_layout Standard
1142 Memory watch expressions are in RPN (Reverse Polish Notation).
1143  At the end of expression, the top entry on stack is taken as the final
1144  result.
1145 \end_layout
1147 \begin_layout Standard
1148 Notations:
1149 \end_layout
1151 \begin_layout Itemize
1152 Evaluation order is strictly left to right.
1153 \end_layout
1155 \begin_layout Itemize
1156 a is the entry on top of stack
1157 \end_layout
1159 \begin_layout Itemize
1160 b is the entry immediately below top of stack
1161 \end_layout
1163 \begin_layout Itemize
1164 ; separates values to be pushed (no intermediate pop).
1165 \end_layout
1167 \begin_layout Itemize
1168 After end of element, all used stack slots are popped and all results are
1169  pushed.
1170 \end_layout
1172 \begin_layout Itemize
1173 When pushing multiple values, the pushes occur in order shown.
1174 \end_layout
1176 \begin_layout Standard
1177 The following operators are available:
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 / b
1194 \end_layout
1196 \begin_layout Itemize
1197 % : a % b
1198 \end_layout
1200 \begin_layout Itemize
1201 a : atan(a)
1202 \end_layout
1204 \begin_layout Itemize
1205 b : read_signed_byte(a)
1206 \end_layout
1208 \begin_layout Itemize
1209 c : cos(a)
1210 \end_layout
1212 \begin_layout Itemize
1213 d : read_signed_dword(a)
1214 \end_layout
1216 \begin_layout Itemize
1217 f: read_float(a)
1218 \end_layout
1220 \begin_layout Itemize
1221 i : quotent(a / b)
1222 \end_layout
1224 \begin_layout Itemize
1225 o: read_signed_hword(a)
1226 \end_layout
1228 \begin_layout Itemize
1229 p :
1230 \begin_inset Formula $\pi$
1231 \end_inset
1234 \end_layout
1236 \begin_layout Itemize
1237 q : read_signed_qword(a)
1238 \end_layout
1240 \begin_layout Itemize
1241 r : sqrt(a)
1242 \end_layout
1244 \begin_layout Itemize
1245 s : sin(a)
1246 \end_layout
1248 \begin_layout Itemize
1249 t : tan(a)
1250 \end_layout
1252 \begin_layout Itemize
1253 u : a; a
1254 \end_layout
1256 \begin_layout Itemize
1257 w : read_signed_word(a)
1258 \end_layout
1260 \begin_layout Itemize
1261 A : atan2(a, b)
1262 \end_layout
1264 \begin_layout Itemize
1265 B : read_unsigned_byte(a)
1266 \end_layout
1268 \begin_layout Itemize
1269 C<number>z : Push number <number> to stack.
1270 \end_layout
1272 \begin_layout Itemize
1273 D : read_unsigned_dword(a)
1274 \end_layout
1276 \begin_layout Itemize
1277 C0x<number>z : Push number <number> (hexadecimal) to stack.
1278 \end_layout
1280 \begin_layout Itemize
1281 F: read_double(a)
1282 \end_layout
1284 \begin_layout Itemize
1285 H<digit> : Set hexadecimal mode with specified number of digits (use A-G
1286  for 10-16 digits).
1287 \end_layout
1289 \begin_layout Itemize
1290 O: read_unsigned_hword(a)
1291 \end_layout
1293 \begin_layout Itemize
1294 Q : read_unsigned_qword(a)
1295 \end_layout
1297 \begin_layout Itemize
1298 R<digit> : round a to <digit> digits.
1299 \end_layout
1301 \begin_layout Itemize
1302 W : read_unsigned_word(a)
1303 \end_layout
1305 \begin_layout Subsection
1306 Example:
1307 \end_layout
1309 \begin_layout Standard
1310 C0x007e0878zWC0x007e002czW-
1311 \end_layout
1313 \begin_layout Enumerate
1314 Push value 0x7e0878 on top of stack (C0x007e0878z).
1315 \end_layout
1317 \begin_layout Enumerate
1318 Pop the value on top of stack (0x7e0878), read word value at that address
1319  and push the result,call it x1 (W).
1320 \end_layout
1322 \begin_layout Enumerate
1323 Push value 0x7e002c on top of stack (C0x007e002cz).
1324 \end_layout
1326 \begin_layout Enumerate
1327 Pop the value on top of stack (0x7e002c), read word value at that address
1328  and push the result,call it x2 (W).
1329 \end_layout
1331 \begin_layout Enumerate
1332 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
1333  x2 - x1 (-).
1334 \end_layout
1336 \begin_layout Enumerate
1337 Since the expression ends, the final memory watch result is the top one
1338  on stack, which is x2 - x1.
1339 \end_layout
1341 \begin_layout Section
1342 Modifier and key names:
1343 \end_layout
1345 \begin_layout Subsection
1346 wxWidgets platform
1347 \end_layout
1349 \begin_layout Subsubsection
1350 Modifier names:
1351 \end_layout
1353 \begin_layout Standard
1354 Following modifier names are known:
1355 \end_layout
1357 \begin_layout Itemize
1359 \end_layout
1361 \begin_layout Itemize
1362 ctrl
1363 \end_layout
1365 \begin_layout Itemize
1366 shift 
1367 \end_layout
1369 \begin_layout Itemize
1370 meta
1371 \end_layout
1373 \begin_layout Itemize
1374 cmd (Mac OS X only)
1375 \end_layout
1377 \begin_layout Subsubsection
1378 Key names:
1379 \end_layout
1381 \begin_layout Standard
1382 Following key names are known:
1383 \end_layout
1385 \begin_layout Itemize
1386 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1387  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1388  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1389  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1390  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1391  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1392  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1393  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1394  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1395  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1396  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1397  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1398  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1399  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1400  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1401  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1402  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1403  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1404  windows_right, windows_menu, command, special1, special2, special3, special4,
1405  special5, special6, special7, special8, special9, special10, special11,
1406  special12, special13, special14, special15, special16, special17, special18,
1407  special19, special20
1408 \end_layout
1410 \begin_layout Section
1411 Movie file format
1412 \end_layout
1414 \begin_layout Standard
1415 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1416  (note: If you recompress it, do not use compression methods other than
1417  store and deflate and especially do not use encryption of any kind).
1418 \end_layout
1420 \begin_layout Subsection
1421 Detecting clean start/SRAM/Savestate
1422 \end_layout
1424 \begin_layout Itemize
1425 If file has member 
1426 \begin_inset Quotes eld
1427 \end_inset
1429 savestate
1430 \begin_inset Quotes erd
1431 \end_inset
1433  it is savestate, otherwise:
1434 \end_layout
1436 \begin_layout Itemize
1437 If file has members with names starting 
1438 \begin_inset Quotes eld
1439 \end_inset
1441 moviesram.
1442 \begin_inset Quotes erd
1443 \end_inset
1445  it is movie starting from SRAM, otherwise:
1446 \end_layout
1448 \begin_layout Itemize
1449 It is movie starting from clear state.
1450 \end_layout
1452 \begin_layout Subsection
1453 Member: gametype
1454 \end_layout
1456 \begin_layout Standard
1457 Type of game ROM and region (as one line).
1458  Valid values are:
1459 \end_layout
1461 \begin_layout Standard
1462 \begin_inset Tabular
1463 <lyxtabular version="3" rows="8" columns="3">
1464 <features tabularvalignment="middle">
1465 <column alignment="center" valignment="top" width="0">
1466 <column alignment="center" valignment="top" width="0">
1467 <column alignment="center" valignment="top" width="0">
1468 <row>
1469 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1470 \begin_inset Text
1472 \begin_layout Plain Layout
1473 Value
1474 \end_layout
1476 \end_inset
1477 </cell>
1478 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1479 \begin_inset Text
1481 \begin_layout Plain Layout
1482 System
1483 \end_layout
1485 \end_inset
1486 </cell>
1487 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1488 \begin_inset Text
1490 \begin_layout Plain Layout
1491 Region
1492 \end_layout
1494 \end_inset
1495 </cell>
1496 </row>
1497 <row>
1498 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1499 \begin_inset Text
1501 \begin_layout Plain Layout
1502 snes_pal
1503 \end_layout
1505 \end_inset
1506 </cell>
1507 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1508 \begin_inset Text
1510 \begin_layout Plain Layout
1511 Super NES
1512 \end_layout
1514 \end_inset
1515 </cell>
1516 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1517 \begin_inset Text
1519 \begin_layout Plain Layout
1521 \end_layout
1523 \end_inset
1524 </cell>
1525 </row>
1526 <row>
1527 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1528 \begin_inset Text
1530 \begin_layout Plain Layout
1531 sgb_pal
1532 \end_layout
1534 \end_inset
1535 </cell>
1536 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1537 \begin_inset Text
1539 \begin_layout Plain Layout
1540 Super Game Boy
1541 \end_layout
1543 \end_inset
1544 </cell>
1545 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1546 \begin_inset Text
1548 \begin_layout Plain Layout
1550 \end_layout
1552 \end_inset
1553 </cell>
1554 </row>
1555 <row>
1556 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1557 \begin_inset Text
1559 \begin_layout Plain Layout
1560 snes_ntsc
1561 \end_layout
1563 \end_inset
1564 </cell>
1565 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1566 \begin_inset Text
1568 \begin_layout Plain Layout
1569 Super NES
1570 \end_layout
1572 \end_inset
1573 </cell>
1574 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1575 \begin_inset Text
1577 \begin_layout Plain Layout
1578 NTSC
1579 \end_layout
1581 \end_inset
1582 </cell>
1583 </row>
1584 <row>
1585 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1586 \begin_inset Text
1588 \begin_layout Plain Layout
1589 sgb_ntsc
1590 \end_layout
1592 \end_inset
1593 </cell>
1594 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1595 \begin_inset Text
1597 \begin_layout Plain Layout
1598 Super Game Boy
1599 \end_layout
1601 \end_inset
1602 </cell>
1603 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1604 \begin_inset Text
1606 \begin_layout Plain Layout
1607 NTSC
1608 \end_layout
1610 \end_inset
1611 </cell>
1612 </row>
1613 <row>
1614 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1615 \begin_inset Text
1617 \begin_layout Plain Layout
1619 \end_layout
1621 \end_inset
1622 </cell>
1623 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1624 \begin_inset Text
1626 \begin_layout Plain Layout
1627 BS-X (non-slotted)
1628 \end_layout
1630 \end_inset
1631 </cell>
1632 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1633 \begin_inset Text
1635 \begin_layout Plain Layout
1636 NTSC
1637 \end_layout
1639 \end_inset
1640 </cell>
1641 </row>
1642 <row>
1643 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1644 \begin_inset Text
1646 \begin_layout Plain Layout
1647 bsxslotted
1648 \end_layout
1650 \end_inset
1651 </cell>
1652 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1653 \begin_inset Text
1655 \begin_layout Plain Layout
1656 BS-X (slotted)
1657 \end_layout
1659 \end_inset
1660 </cell>
1661 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1662 \begin_inset Text
1664 \begin_layout Plain Layout
1665 NTSC
1666 \end_layout
1668 \end_inset
1669 </cell>
1670 </row>
1671 <row>
1672 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1673 \begin_inset Text
1675 \begin_layout Plain Layout
1676 sufamiturbo
1677 \end_layout
1679 \end_inset
1680 </cell>
1681 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1682 \begin_inset Text
1684 \begin_layout Plain Layout
1685 Sufami Turbo
1686 \end_layout
1688 \end_inset
1689 </cell>
1690 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1691 \begin_inset Text
1693 \begin_layout Plain Layout
1694 NTSC
1695 \end_layout
1697 \end_inset
1698 </cell>
1699 </row>
1700 </lyxtabular>
1702 \end_inset
1705 \end_layout
1707 \begin_layout Standard
1708 Frame rates are:
1709 \end_layout
1711 \begin_layout Standard
1712 \begin_inset Tabular
1713 <lyxtabular version="3" rows="3" columns="2">
1714 <features tabularvalignment="middle">
1715 <column alignment="center" valignment="top" width="0">
1716 <column alignment="center" valignment="top" width="0">
1717 <row>
1718 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1719 \begin_inset Text
1721 \begin_layout Plain Layout
1722 Region
1723 \end_layout
1725 \end_inset
1726 </cell>
1727 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1728 \begin_inset Text
1730 \begin_layout Plain Layout
1731 Framerate (fps)
1732 \end_layout
1734 \end_inset
1735 </cell>
1736 </row>
1737 <row>
1738 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1739 \begin_inset Text
1741 \begin_layout Plain Layout
1743 \end_layout
1745 \end_inset
1746 </cell>
1747 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1748 \begin_inset Text
1750 \begin_layout Plain Layout
1751 322445/6448
1752 \end_layout
1754 \end_inset
1755 </cell>
1756 </row>
1757 <row>
1758 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1759 \begin_inset Text
1761 \begin_layout Plain Layout
1762 NTSC
1763 \end_layout
1765 \end_inset
1766 </cell>
1767 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1768 \begin_inset Text
1770 \begin_layout Plain Layout
1771 10738636/178683
1772 \end_layout
1774 \end_inset
1775 </cell>
1776 </row>
1777 </lyxtabular>
1779 \end_inset
1782 \end_layout
1784 \begin_layout Subsection
1785 Member: port1
1786 \end_layout
1788 \begin_layout Standard
1789 Contains type of port #1 (as one line).
1790  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1791  If not present, defaults to 'gamepad'.
1792 \end_layout
1794 \begin_layout Subsection
1795 Member: port2
1796 \end_layout
1798 \begin_layout Standard
1799 Contains type of port #2 (as one line).
1800  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1801  'justifier' and 'justifiers'.
1802  If not present, defaults to 'none'.
1803 \end_layout
1805 \begin_layout Subsection
1806 Member: gamename
1807 \end_layout
1809 \begin_layout Standard
1810 Contains name of the game (as one line).
1811 \end_layout
1813 \begin_layout Subsection
1814 Member: authors
1815 \end_layout
1817 \begin_layout Standard
1818 Contains authors, one per line.
1819  Part before '|' is the full name, part after is the nickname.
1820 \end_layout
1822 \begin_layout Subsection
1823 Member: systemid
1824 \end_layout
1826 \begin_layout Standard
1827 Always 
1828 \begin_inset Quotes eld
1829 \end_inset
1831 lsnes-rr1
1832 \begin_inset Quotes erd
1833 \end_inset
1835  (one line).
1836  Used to reject other saves.
1837 \end_layout
1839 \begin_layout Subsection
1840 Member: controlsversion
1841 \end_layout
1843 \begin_layout Standard
1844 Always 
1845 \begin_inset Quotes eld
1846 \end_inset
1849 \begin_inset Quotes erd
1850 \end_inset
1852  (one line).
1853  Used to identify what controls are there.
1854 \end_layout
1856 \begin_layout Subsection
1857 Member: 
1858 \begin_inset Quotes eld
1859 \end_inset
1861 coreversion
1862 \begin_inset Quotes erd
1863 \end_inset
1866 \end_layout
1868 \begin_layout Standard
1869 Contains bsnes core version number (as one line).
1870 \end_layout
1872 \begin_layout Subsection
1873 Member: projectid
1874 \end_layout
1876 \begin_layout Standard
1877 Contains project ID (as one line).
1878  Used to identify if two movies are part of the same project.
1879 \end_layout
1881 \begin_layout Subsection
1882 Member: {rom,slota,slotb}{,xml}.sha256
1883 \end_layout
1885 \begin_layout Standard
1886 Contains SHA-256 of said ROM or ROM mapping file (as one line).
1887  Absent if corresponding file is absent.
1888 \end_layout
1890 \begin_layout Subsection
1891 Member: moviesram.<name>
1892 \end_layout
1894 \begin_layout Standard
1895 Raw binary startup SRAM of kind <name>.
1896  Only present in savestates and movies starting from SRAM.
1897 \end_layout
1899 \begin_layout Subsection
1900 Member: saveframe
1901 \end_layout
1903 \begin_layout Standard
1904 Contains frame number (as one line) of frame movie was saved on.
1905  Only present in savestates.
1906 \end_layout
1908 \begin_layout Subsection
1909 Member: lagcounter
1910 \end_layout
1912 \begin_layout Standard
1913 Current value of lag counter (as one line).
1914  Only present in savestates.
1915 \end_layout
1917 \begin_layout Subsection
1918 Member: pollcounters
1919 \end_layout
1921 \begin_layout Standard
1922 Contains poll counters (currently 100 of them), one per line.
1923  Each line is raw poll count if DRDY is set for it.
1924  Otherwise it is negative poll count minus one.
1925  Only present in savestates.
1926 \end_layout
1928 \begin_layout Subsection
1929 Member: hostmemory
1930 \end_layout
1932 \begin_layout Standard
1933 Raw binary dump of host memory.
1934  Only present in savestates.
1935 \end_layout
1937 \begin_layout Subsection
1938 Member: savestate
1939 \end_layout
1941 \begin_layout Standard
1942 The raw binary savestate itself.
1943  Savestate detection uses this file, only present in savestates.
1944 \end_layout
1946 \begin_layout Subsection
1947 Member: screenshot
1948 \end_layout
1950 \begin_layout Standard
1951 Screenshot of current frame.
1952  Only present in savestates.
1953  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
1954  data.
1955  Height of image is inferred from the width and size of data.
1956 \end_layout
1958 \begin_layout Subsection
1959 Member: sram.<name>
1960 \end_layout
1962 \begin_layout Standard
1963 Raw binary SRAM of kind <name> at time of savestate.
1964  Only present in savestates.
1965 \end_layout
1967 \begin_layout Subsection
1968 Member: input
1969 \end_layout
1971 \begin_layout Standard
1972 The actual input track, one line per subframe (blank lines are skipped).
1973 \end_layout
1975 \begin_layout Itemize
1976 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
1977  part of same frame as previous, otherwise it starts a new frame.
1978 \end_layout
1980 \begin_layout Itemize
1981 First subframe must start a new frame.
1982 \end_layout
1984 \begin_layout Standard
1985 Length of movie in frames is number of lines in input file that start a
1986  new frame.
1987 \end_layout
1989 \begin_layout Subsection
1990 Member: subtitles
1991 \end_layout
1993 \begin_layout Standard
1994 Subtitle track.
1995  Optional.
1996 \end_layout
1998 \begin_layout Itemize
1999 Each line is in form <firstframe> <numframes> <text>.
2000 \end_layout
2002 \begin_layout Itemize
2003 Linefeed is encoded as 
2004 \backslash
2005 n, backslash is encoded as 
2006 \backslash
2008 \backslash
2010 \end_layout
2012 \begin_layout Subsection
2013 Member: rerecords
2014 \end_layout
2016 \begin_layout Standard
2017 Contains textual base-10 rerecord count (as one line; emulator just writes
2018  this, it doesn't read it) + 1.
2019 \end_layout
2021 \begin_layout Subsection
2022 Member: rrdata
2023 \end_layout
2025 \begin_layout Standard
2026 This member stores set of load IDs.
2027  There is one load ID per rerecord (plus one corresponding to start of project).
2028 \end_layout
2030 \begin_layout Itemize
2031 This member constists of concatenation of records
2032 \end_layout
2034 \begin_layout Itemize
2035 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2036  IDs.
2037 \end_layout
2039 \begin_layout Itemize
2040 IDs are interpretted as 256-bit big-endian integers with warparound.
2041 \end_layout
2043 \begin_layout Itemize
2044 Initial predicted ID is all zeroes.
2045 \end_layout
2047 \begin_layout Standard
2048 Format of each record is:
2049 \end_layout
2051 \begin_layout Itemize
2052 1 byte: Opcode byte.
2053  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2054  Bit 7 is unused.
2055 \end_layout
2057 \begin_layout Itemize
2058 32-prefixlen bytes of ID.
2059 \end_layout
2061 \begin_layout Itemize
2062 countlen bytes of big-endian count (count).
2063 \end_layout
2065 \begin_layout Standard
2066 Records are processed as follows:
2067 \end_layout
2069 \begin_layout Itemize
2070 To form the first ID encoded by record, take the first prefixlen bytes predicted
2071  ID and append the read ID value to it.
2072  The result is the first ID encoded.
2073 \end_layout
2075 \begin_layout Itemize
2076 If countlen is 0, record encodes 1 ID.
2077 \end_layout
2079 \begin_layout Itemize
2080 If countlen is 1, record encodes 2+count IDs.
2081 \end_layout
2083 \begin_layout Itemize
2084 If countlen is 2, record encodes 258+count IDs.
2085 \end_layout
2087 \begin_layout Itemize
2088 If countlen is 3, record encodes 65794+count IDs.
2089 \end_layout
2091 \begin_layout Itemize
2092 The new predicted ID is the next ID after last one encoded by the record.
2093 \end_layout
2095 \begin_layout Standard
2096 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2097  by all records.
2098 \end_layout
2100 \begin_layout Subsection
2101 Member: starttime.second
2102 \end_layout
2104 \begin_layout Standard
2105 Movie starting time, second part.
2106  Epoch is Unix epoch.
2107  Default is 1,000,000,000.
2108 \end_layout
2110 \begin_layout Subsection
2111 Member: starttime.subsecond
2112 \end_layout
2114 \begin_layout Standard
2115 Movie starting time, subsecond part.
2116  Unit is CPU clocks.
2117  Default is 0.
2118 \end_layout
2120 \begin_layout Subsection
2121 Member: savetime.second
2122 \end_layout
2124 \begin_layout Standard
2125 Movie saving time, second part.
2126  Default is starttime.second.
2127  Only present in savestates.
2128 \end_layout
2130 \begin_layout Subsection
2131 Member: savetime.subsecond
2132 \end_layout
2134 \begin_layout Standard
2135 Movie saving time, subsecond part.
2136  Default is starttime.subsecond.
2137  Only present in savestates.
2138 \end_layout
2140 \begin_layout Section
2141 lsvs file format (commentary tracks)
2142 \end_layout
2144 \begin_layout Subsection
2145 Clusters
2146 \end_layout
2148 \begin_layout Itemize
2149 Each cluster is 8kB (8192 bytes) in size.
2150 \end_layout
2152 \begin_layout Itemize
2153 Cluster n starts at offset 8192*n in file.
2154 \end_layout
2156 \begin_layout Itemize
2157 The following clusters are system special:
2158 \end_layout
2160 \begin_deeper
2161 \begin_layout Itemize
2162 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2163 \end_layout
2165 \begin_layout Itemize
2166 Cluster 1 (superblock)
2167 \end_layout
2169 \end_deeper
2170 \begin_layout Subsection
2171 Cluster tables
2172 \end_layout
2174 \begin_layout Itemize
2175 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2176  last 11 bits of n).
2177 \end_layout
2179 \begin_layout Itemize
2180 This cluster table consists of 2048 4-byte big-endian integers.
2181 \end_layout
2183 \begin_layout Itemize
2184 Each entry describes a cluster in 16MB supercluster, in order.
2185 \end_layout
2187 \begin_layout Itemize
2188 The valid values for entries are:
2189 \end_layout
2191 \begin_deeper
2192 \begin_layout Itemize
2193 0x00000000: Free cluster
2194 \end_layout
2196 \begin_layout Itemize
2197 0x00000001: Last cluster in chain.
2198 \end_layout
2200 \begin_layout Itemize
2201 0xFFFFFFFF: System cluster (cluster tables and superblock)
2202 \end_layout
2204 \begin_layout Itemize
2205 (anything else): Number of next cluster in chain.
2206  Must not be multiple of 2048.
2207 \end_layout
2209 \end_deeper
2210 \begin_layout Itemize
2211 Due to limitations of the format, there can be at most 2097052 superclusters,
2212  giving maximum file size of 16TB.
2213 \end_layout
2215 \begin_layout Subsection
2216 Stream table
2217 \end_layout
2219 \begin_layout Itemize
2220 The stream table chain always starts in cluster 2.
2221 \end_layout
2223 \begin_layout Itemize
2224 Otherwise, it follows normal chaining.
2225 \end_layout
2227 \begin_layout Itemize
2228 The stream table consists of 16-byte entries:
2229 \end_layout
2231 \begin_deeper
2232 \begin_layout Itemize
2233 The first 8 bytes of entry give big-endian beginning position of stream
2234  in units of 1/48000 s.
2235 \end_layout
2237 \begin_layout Itemize
2238 The next 4 bytes of entry give big-endian beginning cluster for control
2239  data.
2240  0 here marks the entry as not present.
2241 \end_layout
2243 \begin_layout Itemize
2244 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2245 \end_layout
2247 \end_deeper
2248 \begin_layout Itemize
2249 Stream table clusters are normal clusters, following normal chaining.
2250 \end_layout
2252 \begin_layout Itemize
2253 The stream begnning position is not guarenteed unique.
2254  There can be multiple streams with the same starting position in the file.
2255 \end_layout
2257 \begin_layout Subsection
2258 Stream control data
2259 \end_layout
2261 \begin_layout Itemize
2262 The stream control data consists of entries 4 bytes each:
2263 \end_layout
2265 \begin_deeper
2266 \begin_layout Itemize
2267 The first 2 bytes of entry gives big-endian length of packet
2268 \end_layout
2270 \begin_layout Itemize
2271 The next byte of entry gives audio length of packet in units of 1/400 s.
2272 \end_layout
2274 \begin_layout Itemize
2275 The last byte is control byte.
2276 \end_layout
2278 \begin_deeper
2279 \begin_layout Itemize
2280 0 means this entry is not present and the control data ends.
2281 \end_layout
2283 \begin_layout Itemize
2284 1 is valid control entry.
2285 \end_layout
2287 \end_deeper
2288 \end_deeper
2289 \begin_layout Itemize
2290 The stream control data can also end by running into end of the readable
2291  chain.
2292 \end_layout
2294 \begin_deeper
2295 \begin_layout Itemize
2296 This happens if there happens to be exact multiple of 2048 packets in stream
2297  and number of packets is nonzero.
2298 \end_layout
2300 \end_deeper
2301 \begin_layout Itemize
2302 These clusters follow normal chaining.
2303 \end_layout
2305 \begin_layout Subsection
2306 Stream codec data
2307 \end_layout
2309 \begin_layout Itemize
2310 Stream codec data consists of raw Opus data packets packed back to back
2311  with nothing in between.
2312 \end_layout
2314 \begin_layout Itemize
2315 Warning: Due to internal limitations, this data must reside in the first
2316  65536 superclusters (that is, the first 1TB of the file).
2317 \end_layout
2319 \begin_layout Subsection
2320 Superblock
2321 \end_layout
2323 \begin_layout Itemize
2324 The superblock is stored in cluster 1.
2326 \end_layout
2328 \begin_layout Itemize
2329 The first 11 bytes are 
2330 \begin_inset Quotes eld
2331 \end_inset
2333 sefs-magic
2334 \begin_inset Quotes erd
2335 \end_inset
2337 <NUL>.
2338 \end_layout
2340 \begin_layout Itemize
2341 The rest are unused.
2342 \end_layout
2344 \begin_layout Itemize
2345 This cluster 1 is marked as system special.
2346 \end_layout
2348 \begin_layout Section
2349 Known ROM extensions
2350 \end_layout
2352 \begin_layout Itemize
2353 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2354 \end_layout
2356 \begin_layout Itemize
2357 DMG cartridge ROMs: dmg, gb.
2358 \end_layout
2360 \begin_layout Itemize
2361 GBC cartridge ROMs: cgb, gbc.
2362 \end_layout
2364 \begin_layout Section
2365 Gamepack files
2366 \end_layout
2368 \begin_layout Itemize
2369 The first line must be: 
2370 \begin_inset Quotes eld
2371 \end_inset
2373 [GAMEPACK FILE]
2374 \begin_inset Quotes erd
2375 \end_inset
2378 \end_layout
2380 \begin_layout Itemize
2381 There is one needed line: 
2382 \begin_inset Quotes eld
2383 \end_inset
2385 type <systype>
2386 \begin_inset Quotes erd
2387 \end_inset
2390  This sets system type to <systype>.
2391  The following system types are valid:
2392 \end_layout
2394 \begin_deeper
2395 \begin_layout Itemize
2396 snes (SNES)
2397 \end_layout
2399 \begin_layout Itemize
2400 bsx (BS-X non-slotted)
2401 \end_layout
2403 \begin_layout Itemize
2404 bsxslotted (BS-X slotted)
2405 \end_layout
2407 \begin_layout Itemize
2408 sufamiturbo (Sufami Turbo)
2409 \end_layout
2411 \begin_layout Itemize
2412 sgb (Super Game Boy)
2413 \end_layout
2415 \begin_layout Itemize
2416 dmg (Game Boy)
2417 \end_layout
2419 \begin_layout Itemize
2420 gbc (Game Boy Color)
2421 \end_layout
2423 \begin_layout Itemize
2424 gbc_gba (Game Boy Color with GBA initial register values)
2425 \end_layout
2427 \end_deeper
2428 \begin_layout Itemize
2429 Optionally a region can be specified: 
2430 \begin_inset Quotes eld
2431 \end_inset
2433 region <region>
2434 \begin_inset Quotes erd
2435 \end_inset
2438  The following values are valid:
2439 \end_layout
2441 \begin_deeper
2442 \begin_layout Itemize
2443 autodetect (Autodetect region: snes and sgb only)
2444 \end_layout
2446 \begin_layout Itemize
2447 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2448 \end_layout
2450 \begin_layout Itemize
2451 pal (PAL: snes, sgb)
2452 \end_layout
2454 \begin_layout Itemize
2455 world (World: dmg, gbc, gbc_gba)
2456 \end_layout
2458 \end_deeper
2459 \begin_layout Itemize
2460 ROM images are loaded as: 
2461 \begin_inset Quotes eld
2462 \end_inset
2464 rom <type> <file>
2465 \begin_inset Quotes erd
2466 \end_inset
2469  The following types are valid:
2470 \end_layout
2472 \begin_deeper
2473 \begin_layout Itemize
2474 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2475  BIOS in bsx, bsxslotted, sufamiturbo)
2476 \end_layout
2478 \begin_layout Itemize
2479 bsx (Cartridge ROM in bsx, bsxslotted)
2480 \end_layout
2482 \begin_layout Itemize
2483 slot-a (Cartridge ROM in sufamiturbo)
2484 \end_layout
2486 \begin_layout Itemize
2487 slot-b (Cartridge ROM in sufamiturbo)
2488 \end_layout
2490 \end_deeper
2491 \begin_layout Itemize
2492 ROM markup can be loaded as: 
2493 \begin_inset Quotes eld
2494 \end_inset
2496 xml <type> <file>
2497 \begin_inset Quotes erd
2498 \end_inset
2501  The types valid are the same as for ROMs.
2502 \end_layout
2504 \begin_layout Itemize
2505 Patches can be loaded as 
2506 \begin_inset Quotes eld
2507 \end_inset
2509 patch[<offset>] <type> <file>
2510 \begin_inset Quotes erd
2511 \end_inset
2514  The types are the same as for ROMs.
2515 \end_layout
2517 \begin_deeper
2518 \begin_layout Itemize
2519 Offset is given in form [+-]<number>.
2520  Usually offset is either +0 or -512.
2521 \end_layout
2523 \begin_layout Itemize
2524 Default offset is +0.
2525 \end_layout
2527 \end_deeper
2528 \begin_layout Subsection
2529 Example:
2530 \end_layout
2532 \begin_layout LyX-Code
2533 [GAMEPACK FILE]
2534 \end_layout
2536 \begin_layout LyX-Code
2537 type snes
2538 \end_layout
2540 \begin_layout LyX-Code
2541 rom rom speedygonzales.sfc
2542 \end_layout
2544 \begin_layout LyX-Code
2545 patch-512 rom sonicthehedgehog.ips
2546 \end_layout
2548 \begin_layout Subsection
2549 Example 2:
2550 \end_layout
2552 \begin_layout LyX-Code
2553 [GAMEPACK FILE]
2554 \end_layout
2556 \begin_layout LyX-Code
2557 type sgb
2558 \end_layout
2560 \begin_layout LyX-Code
2561 rom rom supergameboy.sfc
2562 \end_layout
2564 \begin_layout LyX-Code
2565 rom dmg megamanV.dmg
2566 \end_layout
2568 \begin_layout Section
2569 Quick'n'dirty encode guide
2570 \end_layout
2572 \begin_layout Enumerate
2573 Start the emulator and load the ROM and movie file.
2574 \end_layout
2576 \begin_layout Enumerate
2577 Set large AVI option 'set-setting avi-large on'
2578 \end_layout
2580 \begin_layout Enumerate
2581 Enable dumping 'dump-avi tmpdump' 
2582 \end_layout
2584 \begin_layout Enumerate
2585 Unpause and let it run until you want to end dumping.
2586 \end_layout
2588 \begin_layout Enumerate
2589 Close the emulator (closing the window is the easiest way).
2590  Or use 'end-avi'.
2591 \end_layout
2593 \begin_layout Enumerate
2594 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2595  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2596 \end_layout
2598 \begin_layout Enumerate
2599 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2600 \end_layout
2602 \begin_layout Enumerate
2603 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2604  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2605 \end_layout
2607 \begin_layout Enumerate
2608 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2609  Now final.mkv contains quick'n'dirty encode.
2610 \end_layout
2612 \begin_layout Section
2613 Axis configurations for some gamepad types:
2614 \end_layout
2616 \begin_layout Subsection
2617 XBox360 controller:
2618 \end_layout
2620 \begin_layout Standard
2621 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2622 \end_layout
2624 \begin_layout LyX-Code
2625 set-axis joystick0axis2 pressure-+
2626 \end_layout
2628 \begin_layout LyX-Code
2629 set-axis joystick0axis5 pressure-+
2630 \end_layout
2632 \begin_layout Itemize
2633 This is needed for SDL only.
2634  EVDEV sets those types correctly.
2635 \end_layout
2637 \begin_layout Subsection
2638 PS3 
2639 \begin_inset Quotes eld
2640 \end_inset
2642 sixaxis
2643 \begin_inset Quotes erd
2644 \end_inset
2646  controller:
2647 \end_layout
2649 \begin_layout Standard
2650 Axes 8-19 should be disabled.
2651 \end_layout
2653 \begin_layout LyX-Code
2654 set-axis joystick0axis8 disabled
2655 \end_layout
2657 \begin_layout LyX-Code
2658 set-axis joystick0axis9 disabled
2659 \end_layout
2661 \begin_layout LyX-Code
2662 set-axis joystick0axis10 disabled
2663 \end_layout
2665 \begin_layout LyX-Code
2666 set-axis joystick0axis11 disabled
2667 \end_layout
2669 \begin_layout LyX-Code
2670 set-axis joystick0axis12 disabled
2671 \end_layout
2673 \begin_layout LyX-Code
2674 set-axis joystick0axis13 disabled
2675 \end_layout
2677 \begin_layout LyX-Code
2678 set-axis joystick0axis14 disabled
2679 \end_layout
2681 \begin_layout LyX-Code
2682 set-axis joystick0axis15 disabled
2683 \end_layout
2685 \begin_layout LyX-Code
2686 set-axis joystick0axis16 disabled
2687 \end_layout
2689 \begin_layout LyX-Code
2690 set-axis joystick0axis17 disabled
2691 \end_layout
2693 \begin_layout LyX-Code
2694 set-axis joystick0axis18 disabled
2695 \end_layout
2697 \begin_layout LyX-Code
2698 set-axis joystick0axis19 disabled
2699 \end_layout
2701 \begin_layout Section
2702 Errata:
2703 \end_layout
2705 \begin_layout Subsection
2706 Problems from BSNES core:
2707 \end_layout
2709 \begin_layout Itemize
2710 The whole pending save stuff.
2711 \end_layout
2713 \begin_layout Itemize
2714 It is slow (especially accuracy).
2715 \end_layout
2717 \begin_layout Itemize
2718 Firmwares can't be loaded from ZIP archives.
2719 \end_layout
2721 \begin_layout Subsection
2722 Other problems:
2723 \end_layout
2725 \begin_layout Itemize
2726 Modifiers don't work with pseudo-keys.
2727 \end_layout
2729 \begin_layout Itemize
2730 Audio for last dumped frame is not itself dumped.
2731 \end_layout
2733 \begin_layout Itemize
2734 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2735 \end_layout
2737 \end_body
2738 \end_document