lsnes rr2-β15
[lsnes.git] / manual.lyx
blobdb9d257dd4105207ffe629a15799726b9b262ad3
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 --pluginmanager
232 \end_layout
234 \begin_layout Standard
235 Instead of starting the emulator, display the plugin manager (useful to
236  disable some plugin that causes emulator to crash on startup)
237 \end_layout
239 \begin_layout Subsubsection
240 --lua=<file>
241 \end_layout
243 \begin_layout Standard
244 Run this Lua file on startup
245 \end_layout
247 \begin_layout Subsection
248 dump options (lsnes-dumpavi only)
249 \end_layout
251 \begin_layout Subsubsection
252 --rom=<file>
253 \end_layout
255 \begin_layout Standard
256 Load <file> as ROM.
257  Required.
258 \end_layout
260 \begin_layout Subsubsection
261 <filename>
262 \end_layout
264 \begin_layout Standard
265 Load <filename> as movie or savestate file on startup.
266  Required.
267 \end_layout
269 \begin_layout Subsubsection
270 --dumper=<dumper>
271 \end_layout
273 \begin_layout Standard
274 Set the dumper to use (required).
275  Use 'list' for listing of known dumpers.
276 \end_layout
278 \begin_layout Subsubsection
279 --firmware-path=<path>
280 \end_layout
282 \begin_layout Standard
283 Set path to look for firmware.
284 \end_layout
286 \begin_layout Subsubsection
287 --mode=<mode>
288 \end_layout
290 \begin_layout Standard
291 Set the mode to use (required for dumpers with multiple modes, forbidden
292  otherwise).
293  Use 'list' for known modes.
294 \end_layout
296 \begin_layout Subsubsection
297 --prefix=<prefix>
298 \end_layout
300 \begin_layout Standard
301 Set dump prefix.
302  Default is 
303 \begin_inset Quotes eld
304 \end_inset
306 avidump
307 \begin_inset Quotes erd
308 \end_inset
311 \end_layout
313 \begin_layout Subsubsection
314 --option=<name>=<value>
315 \end_layout
317 \begin_layout Standard
318 Set option <name> to value <value>.
319 \end_layout
321 \begin_layout Subsubsection
322 --length=<length>
323 \end_layout
325 \begin_layout Standard
326 Set number of frames to dump.
327  Mandatory, unless --overdump-length is specified.
328 \end_layout
330 \begin_layout Subsubsection
331 --overdump-length=<length>
332 \end_layout
334 \begin_layout Standard
335 Set number of frames to dump after movie end.
336  Mutually exclusive with --length.
337 \end_layout
339 \begin_layout Subsubsection
340 --lua=<script>
341 \end_layout
343 \begin_layout Standard
344 Run specified lua script (lsnes-dumpavi does not have initialization files).
345 \end_layout
347 \begin_layout Subsubsection
348 --load-library=<library>
349 \end_layout
351 \begin_layout Standard
352 Load the specified shared object / dynamic library / dynamic link library.
353 \end_layout
355 \begin_layout Subsection
356 lsnes settings directory
357 \end_layout
359 \begin_layout Standard
360 The lsnes settings directory is (in order of decreasing perference):
361 \end_layout
363 \begin_layout Itemize
364 Windows: %APPDATA%
365 \backslash
366 lsnes (if %APPDATA% exists)
367 \end_layout
369 \begin_layout Itemize
370 Unix: $XDG_CONFIG_HOME/lsnes (if $XDG_CONFIG_HOME exists)
371 \end_layout
373 \begin_layout Itemize
374 Unix: $HOME/.config/lsnes (if $HOME exists)
375 \end_layout
377 \begin_layout Itemize
378 All: .
379  (fallback default).
380 \end_layout
382 \begin_layout Standard
383 If leading directories do not exist, attempt to create them is made.
384 \end_layout
386 \begin_layout Section
387 Internal commands
388 \end_layout
390 \begin_layout Itemize
391 Commands beginning with '*' invoke the corresponding command without alias
392  expansion.
393 \end_layout
395 \begin_layout Itemize
396 If command starts with '+' (after possible '*'), the command is executed
397  as-is when button is pressed, and when button is released, it is executed
398  with '+' replaced by '-'.
399 \end_layout
401 \begin_layout Itemize
402 Commands without '+' execute only on negative edge (release).
403 \end_layout
405 \begin_layout Subsection
406 run-script <script>
407 \end_layout
409 \begin_layout Standard
410 Run <script> as if commands were entered on the command line.
411 \end_layout
413 \begin_layout Subsection
414 Memory manipulation
415 \end_layout
417 \begin_layout Standard
418 <address> may be decimal or hexadecimal (prefixed with '0x').
419  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
420  with '-') decimal.
421 \end_layout
423 \begin_layout Standard
424 The available element <sizes> are:
425 \end_layout
427 \begin_layout Itemize
428 byte: 1 byte
429 \end_layout
431 \begin_layout Itemize
432 word: 2 bytes
433 \end_layout
435 \begin_layout Itemize
436 hword: 3 bytes
437 \end_layout
439 \begin_layout Itemize
440 dword: 4 bytes
441 \end_layout
443 \begin_layout Itemize
444 qword: 8 bytes
445 \end_layout
447 \begin_layout Itemize
448 float: 4 bytes (floating-point)
449 \end_layout
451 \begin_layout Itemize
452 double: 8 bytes (floating-point)
453 \end_layout
455 \begin_layout Standard
456 When reading RAM and ROM, multi-byte reads/writes are big-endian.
457  When dealing with DSP memory, multi-byte reads/writes are native-endian
458  (do not use operand sizes exceeding DSP bitness, except dword is OK for
459  24-bit memory).
460 \end_layout
462 \begin_layout Subsubsection
463 read-<size> <address>
464 \end_layout
466 \begin_layout Standard
467 Read the value of byte in <address>.
468 \end_layout
470 \begin_layout Subsubsection
471 read-s<size> <address>
472 \end_layout
474 \begin_layout Standard
475 Read the value of signed byte in <address>.
476 \end_layout
478 \begin_layout Subsubsection
479 write-<size> <address> <value>
480 \end_layout
482 \begin_layout Standard
483 Write <value> to byte in address <address>.
484 \end_layout
486 \begin_layout Subsection
487 Main commands
488 \end_layout
490 \begin_layout Standard
491 These commands are not available in lsnesrc, but are available after ROM
492  has been loaded.
493 \end_layout
495 \begin_layout Subsubsection
496 quit-emulator
497 \end_layout
499 \begin_layout Standard
500 Quits the emulator.
501 \end_layout
503 \begin_layout Subsubsection
504 pause-emulator
505 \end_layout
507 \begin_layout Standard
508 Toggle paused/unpaused
509 \end_layout
511 \begin_layout Subsubsection
512 +advance-frame 
513 \end_layout
515 \begin_layout Standard
516 Advance frame.
517  If the button is still held after configurable timeout expires, game unpauses
518  for the duration frame advance is held.
519 \end_layout
521 \begin_layout Subsubsection
522 +advance-poll 
523 \end_layout
525 \begin_layout Standard
526 Advance subframe.
527  If the button is still held after configurable timeout expires, game unpauses
528  for the duration frame advance is held.
529 \end_layout
531 \begin_layout Subsubsection
532 advance-skiplag 
533 \end_layout
535 \begin_layout Standard
536 Skip to first poll in frame after current.
537 \end_layout
539 \begin_layout Subsubsection
540 reset 
541 \end_layout
543 \begin_layout Standard
544 Reset the SNES after this frame.
545 \end_layout
547 \begin_layout Subsubsection
548 load <filename> 
549 \end_layout
551 \begin_layout Standard
552 Load savestate <filename> in current mode.
553 \end_layout
555 \begin_layout Subsubsection
556 load-state <filename> 
557 \end_layout
559 \begin_layout Standard
560 Load savestate <filename> in readwrite mode.
561 \end_layout
563 \begin_layout Subsubsection
564 load-readonly <filename> 
565 \end_layout
567 \begin_layout Standard
568 Load savestate <filename> in readonly mode.
569 \end_layout
571 \begin_layout Subsubsection
572 load-preserve <filename> 
573 \end_layout
575 \begin_layout Standard
576 Load savestate <filename> in readonly mode, preserving current events.
577 \end_layout
579 \begin_layout Subsubsection
580 load-movie <filename> 
581 \end_layout
583 \begin_layout Standard
584 Load savestate <filename>, ignoring save part in readonly mode.
585 \end_layout
587 \begin_layout Subsubsection
588 save-state <filename> 
589 \end_layout
591 \begin_layout Standard
592 Save system state to <filename> as soon as possible.
593 \end_layout
595 \begin_layout Subsubsection
596 save-movie <filename> 
597 \end_layout
599 \begin_layout Standard
600 Save movie to <filename>.
601 \end_layout
603 \begin_layout Subsubsection
604 set-rwmode 
605 \end_layout
607 \begin_layout Standard
608 Set read-write mode.
609 \end_layout
611 \begin_layout Subsubsection
612 set-romode 
613 \end_layout
615 \begin_layout Standard
616 Set read-only mode
617 \end_layout
619 \begin_layout Subsubsection
620 toggle-rwmode 
621 \end_layout
623 \begin_layout Standard
624 Toggle between read-only and read-write modes.
625 \end_layout
627 \begin_layout Subsubsection
628 test-1, test-2, test-3
629 \end_layout
631 \begin_layout Standard
632 Internal test commands.
633  Don't use.
634 \end_layout
636 \begin_layout Subsubsection
637 take-screenshot <filename> 
638 \end_layout
640 \begin_layout Standard
641 Save screenshot to <filename>.
642 \end_layout
644 \begin_layout Subsubsection
645 +controller <class>-<#>-<button>
646 \end_layout
648 \begin_layout Standard
649 Press button <button> on controller <num> of class <class>.
650 \end_layout
652 \begin_layout Itemize
653 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
654  ext0, ext1, ext2, ext3
655 \end_layout
657 \begin_layout Itemize
658 Class 'mouse': L, R
659 \end_layout
661 \begin_layout Itemize
662 Class 'superscope': trigger, cursor, turbo, pause
663 \end_layout
665 \begin_layout Itemize
666 Class 'justifier': trigger, start
667 \end_layout
669 \begin_layout Itemize
670 Class 'gb': A, B, select, start, up, down, left, right
671 \end_layout
673 \begin_layout Subsubsection
674 hold-controller <class>-<#>-<button>
675 \end_layout
677 \begin_layout Standard
678 Hold/unhold button <button> on controller <num> of class <class>.
679 \end_layout
681 \begin_layout Subsubsection
682 type-controller <class>-<#>-<button>
683 \end_layout
685 \begin_layout Standard
686 Hold/unhold button <button> on controller <num> of class <class> for the
687  next frame.
688  See +controller for button names.
689 \end_layout
691 \begin_layout Standard
692 Cauntion: Does not work properly if outside frame advance.
693 \end_layout
695 \begin_layout Subsubsection
696 +autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
697 \end_layout
699 \begin_layout Standard
700 Start autofire.
701  If duty is not specified, defaults to 1.
702  If <cyclelen> is not specified, defaults to 2.
703 \end_layout
705 \begin_layout Subsubsection
706 -autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
707 \end_layout
709 \begin_layout Standard
710 End autofire.
711 \end_layout
713 \begin_layout Subsubsection
714 autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
715 \end_layout
717 \begin_layout Standard
718 Toggle autofire.
719  If autofire is turned on, specified cycle is used.
720 \end_layout
722 \begin_layout Subsubsection
723 designate-position <class>-<#>-analog<n>
724 \end_layout
726 \begin_layout Standard
727 Designate position for analog pair.
728  <n> is only there if there are multiple axis pairs.
729 \end_layout
731 \begin_layout Subsubsection
732 repaint
733 \end_layout
735 \begin_layout Standard
736 Force a repaint.
737 \end_layout
739 \begin_layout Subsubsection
740 toggle-pause-on-end
741 \end_layout
743 \begin_layout Standard
744 Toggle pause on end flag.
745 \end_layout
747 \begin_layout Subsubsection
748 set-pause-on-end
749 \end_layout
751 \begin_layout Standard
752 Set pause on end flag.
753 \end_layout
755 \begin_layout Subsubsection
756 clear-pause-on-end
757 \end_layout
759 \begin_layout Standard
760 Clear pause on end flag.
761 \end_layout
763 \begin_layout Subsubsection
764 action <action> [<parameters>]
765 \end_layout
767 \begin_layout Standard
768 Run specified core action.
769 \end_layout
771 \begin_layout Subsection
772 Save jukebox 
773 \end_layout
775 \begin_layout Subsubsection
776 cycle-jukebox-backward
777 \end_layout
779 \begin_layout Standard
780 Cycle save jukebox backwards.
781 \end_layout
783 \begin_layout Subsubsection
784 cycle-jukebox-forward
785 \end_layout
787 \begin_layout Standard
788 Cycle save jukebox forwards
789 \end_layout
791 \begin_layout Subsubsection
792 set-jukebox-slot <slot>
793 \end_layout
795 \begin_layout Standard
796 Set current jukebox slot
797 \end_layout
799 \begin_layout Subsubsection
800 load-jukebox
801 \end_layout
803 \begin_layout Standard
804 Do load from jukebox (current mode).
805 \end_layout
807 \begin_layout Subsubsection
808 save-jukebox
809 \end_layout
811 \begin_layout Standard
812 Do state save to jukebox.
813 \end_layout
815 \begin_layout Subsection
816 Lua 
817 \end_layout
819 \begin_layout Subsubsection
820 evaluate-lua <luacode>
821 \end_layout
823 \begin_layout Standard
824 Run Lua code <luacode> using built-in Lua interpretter.
825 \end_layout
827 \begin_layout Subsubsection
828 L <luacode>
829 \end_layout
831 \begin_layout Standard
832 Synonym for evaluate-lua.
833 \end_layout
835 \begin_layout Subsubsection
836 run-lua <script>
837 \end_layout
839 \begin_layout Standard
840 Run specified lua file using built-in Lua interpretter.
841 \end_layout
843 \begin_layout Subsubsection
844 reset-lua
845 \end_layout
847 \begin_layout Standard
848 Clear the Lua VM state and restore to factory defaults.
849 \end_layout
851 \begin_layout Subsection
852 Memory watch
853 \end_layout
855 \begin_layout Subsubsection
856 add-watch <name> <expression>
857 \end_layout
859 \begin_layout Standard
860 Adds new watch (or modifies old one).
861 \end_layout
863 \begin_layout Subsubsection
864 remove-watch <name>
865 \end_layout
867 \begin_layout Standard
868 Remove a watch.
869 \end_layout
871 \begin_layout Subsection
872 Sound 
873 \end_layout
875 \begin_layout Subsubsection
876 enable-sound <on/off> 
877 \end_layout
879 \begin_layout Standard
880 Enable/Disable sound.
881 \end_layout
883 \begin_layout Subsection
884 Misc.
885 \end_layout
887 \begin_layout Subsubsection
888 reload-rom [<file>]
889 \end_layout
891 \begin_layout Standard
892 Reloads the main ROM image from <file>.
893 \end_layout
895 \begin_layout Subsubsection
896 +tangent
897 \end_layout
899 \begin_layout Standard
900 Tangent for recording voice for commentary track.
901  While pressed, record a stream.
902 \end_layout
904 \begin_layout Subsubsection
905 advance-subframe-timeout
906 \end_layout
908 \begin_layout Standard
909 Subframe advance timeout in milliseconds.
910  Default is 100.
911 \end_layout
913 \begin_layout Section
914 Settings
915 \end_layout
917 \begin_layout Subsection
918 Core settings
919 \end_layout
921 \begin_layout Subsection
922 AVI dumper settings
923 \end_layout
925 \begin_layout Subsubsection
926 avi-large
927 \end_layout
929 \begin_layout Standard
930 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
931  outputs.
932 \end_layout
934 \begin_layout Subsubsection
935 avi-left-border
936 \end_layout
938 \begin_layout Standard
939 AVI dumper: Set the default left border thickness (unless lua overrides)
940  for dumps.
941  Range 0-8191.
942  Default is 0.
943 \end_layout
945 \begin_layout Subsubsection
946 avi-right-border
947 \end_layout
949 \begin_layout Standard
950 AVI dumper: Set the default right border thickness (unless lua overrides)
951  for dumps.
952  Range 0-8191.
953  Default is 0.
954 \end_layout
956 \begin_layout Subsubsection
957 avi-top-border
958 \end_layout
960 \begin_layout Standard
961 AVI dumper: Set the default top border thickness (unless lua overrides)
962  for dumps.
963  Range 0-8191.
964  Default is 0.
965 \end_layout
967 \begin_layout Subsubsection
968 avi-bottom-border
969 \end_layout
971 \begin_layout Standard
972 AVI dumper: Set the default bottom border thickness (unless lua overrides)
973  for dumps.
974  Range 0-8191.
975  Default is 0.
976 \end_layout
978 \begin_layout Subsubsection
979 avi-maxframes
980 \end_layout
982 \begin_layout Standard
983 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
984  Range 0-999999999.
985  Default is 0.
986 \end_layout
988 \begin_layout Subsubsection
989 avi-compresison
990 \end_layout
992 \begin_layout Standard
993 AVI dumper: Compression level (0-18).
994 \end_layout
996 \begin_layout Itemize
997 Compression levels 10 and above are not compatible with stock CSCD codec.
998 \end_layout
1000 \begin_layout Itemize
1001 Recomended level is 7.
1002 \end_layout
1004 \begin_layout Subsubsection
1005 avi-soundrate
1006 \end_layout
1008 \begin_layout Standard
1009 AVI dumper: Set method of determining the sound rate.
1010 \end_layout
1012 \begin_layout Itemize
1013 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1014  128, 176.4 and 192 kHz.
1015 \end_layout
1017 \begin_layout Itemize
1018 1: Round down to nearest integer.
1019 \end_layout
1021 \begin_layout Itemize
1022 2: Round up to nearest ingeter.
1023 \end_layout
1025 \begin_layout Itemize
1026 3: Multiply by denominator.
1027 \end_layout
1029 \begin_layout Itemize
1030 4: High quality 44.1kHz (SRC needed).
1031 \end_layout
1033 \begin_layout Itemize
1034 5: High quality 48kHz (SRC needed).
1035 \end_layout
1037 \begin_layout Subsection
1038 JMD options
1039 \end_layout
1041 \begin_layout Subsubsection
1042 jmd-compression
1043 \end_layout
1045 \begin_layout Standard
1046 JMD dumper: Compression level (0-9).
1047 \end_layout
1049 \begin_layout Section
1050 Movie editor
1051 \end_layout
1053 \begin_layout Itemize
1054 The editor edits in-memory movie.
1055 \end_layout
1057 \begin_layout Itemize
1058 Because past can't be edited and readwrite mode doesn't allow future, editing
1059  only works in 
1060 \emph on
1061 read only
1062 \emph default
1063  mode.
1064 \end_layout
1066 \begin_layout Itemize
1067 Keyboard triggers the normal hotkeys and bindings.
1068 \end_layout
1070 \begin_layout Subsection
1071 Left button actions
1072 \end_layout
1074 \begin_layout Itemize
1075 Clicking on cell in future (indicated by lack of redish background) toggles
1076  it (if it is a button) or prompts for a value (if it is an axis)
1077 \end_layout
1079 \begin_layout Itemize
1080 Dragging vertically toggles sequence of buttons or changes a sequence of
1081  axis values.
1082 \end_layout
1084 \begin_layout Subsection
1085 Right button actions
1086 \end_layout
1088 \begin_layout Standard
1089 The right mouse button pops up a context-sensitive menu:
1090 \end_layout
1092 \begin_layout Itemize
1093 Toggle <something>: Toggle this button
1094 \end_layout
1096 \begin_layout Itemize
1097 Change <something>: Change this axis value
1098 \end_layout
1100 \begin_layout Itemize
1101 Insert frame after: Insert a frame after this frame
1102 \end_layout
1104 \begin_layout Itemize
1105 Append frame: Append a frame to movie
1106 \end_layout
1108 \begin_layout Itemize
1109 Append frames: Append specified number of frames to movie
1110 \end_layout
1112 \begin_layout Itemize
1113 Delete frame: Delete this frame
1114 \end_layout
1116 \begin_layout Itemize
1117 Delete subframe: Delete this subframe
1118 \end_layout
1120 \begin_layout Itemize
1121 Truncate movie: Delete this subframe and everything after it.
1122 \end_layout
1124 \begin_layout Itemize
1125 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1126 \end_layout
1128 \begin_layout Itemize
1129 Scroll to current frame: Scroll the display to current position
1130 \end_layout
1132 \begin_layout Itemize
1133 Run to frame: Prompts for frame and runs the emulation to that frame.
1134 \end_layout
1136 \begin_layout Itemize
1137 Change number of lines visible: Change the height of the movie display (1
1138  to 255).
1139 \end_layout
1141 \begin_layout Itemize
1142 Lock scroll to playback: While playing back or rewinding movies, the display
1143  will follow if enabled.
1144 \end_layout
1146 \begin_layout Section
1147 Memory watch expression syntax
1148 \end_layout
1150 \begin_layout Standard
1151 Memory watch expressions are in RPN (Reverse Polish Notation).
1152  At the end of expression, the top entry on stack is taken as the final
1153  result.
1154 \end_layout
1156 \begin_layout Standard
1157 Notations:
1158 \end_layout
1160 \begin_layout Itemize
1161 Evaluation order is strictly left to right.
1162 \end_layout
1164 \begin_layout Itemize
1165 a is the entry on top of stack
1166 \end_layout
1168 \begin_layout Itemize
1169 b is the entry immediately below top of stack
1170 \end_layout
1172 \begin_layout Itemize
1173 ; separates values to be pushed (no intermediate pop).
1174 \end_layout
1176 \begin_layout Itemize
1177 After end of element, all used stack slots are popped and all results are
1178  pushed.
1179 \end_layout
1181 \begin_layout Itemize
1182 When pushing multiple values, the pushes occur in order shown.
1183 \end_layout
1185 \begin_layout Standard
1186 The following operators are available:
1187 \end_layout
1189 \begin_layout Itemize
1190 + : a + b
1191 \end_layout
1193 \begin_layout Itemize
1194 - : a - b
1195 \end_layout
1197 \begin_layout Itemize
1198 * : a * b
1199 \end_layout
1201 \begin_layout Itemize
1202 / : a / b
1203 \end_layout
1205 \begin_layout Itemize
1206 % : a % b
1207 \end_layout
1209 \begin_layout Itemize
1210 a : atan(a)
1211 \end_layout
1213 \begin_layout Itemize
1214 b : read_signed_byte(a)
1215 \end_layout
1217 \begin_layout Itemize
1218 c : cos(a)
1219 \end_layout
1221 \begin_layout Itemize
1222 d : read_signed_dword(a)
1223 \end_layout
1225 \begin_layout Itemize
1226 f: read_float(a)
1227 \end_layout
1229 \begin_layout Itemize
1230 i : quotent(a / b)
1231 \end_layout
1233 \begin_layout Itemize
1234 o: read_signed_hword(a)
1235 \end_layout
1237 \begin_layout Itemize
1238 p :
1239 \begin_inset Formula $\pi$
1240 \end_inset
1243 \end_layout
1245 \begin_layout Itemize
1246 q : read_signed_qword(a)
1247 \end_layout
1249 \begin_layout Itemize
1250 r : sqrt(a)
1251 \end_layout
1253 \begin_layout Itemize
1254 s : sin(a)
1255 \end_layout
1257 \begin_layout Itemize
1258 t : tan(a)
1259 \end_layout
1261 \begin_layout Itemize
1262 u : a; a
1263 \end_layout
1265 \begin_layout Itemize
1266 w : read_signed_word(a)
1267 \end_layout
1269 \begin_layout Itemize
1270 A : atan2(a, b)
1271 \end_layout
1273 \begin_layout Itemize
1274 B : read_unsigned_byte(a)
1275 \end_layout
1277 \begin_layout Itemize
1278 C<number>z : Push number <number> to stack.
1279 \end_layout
1281 \begin_layout Itemize
1282 D : read_unsigned_dword(a)
1283 \end_layout
1285 \begin_layout Itemize
1286 C0x<number>z : Push number <number> (hexadecimal) to stack.
1287 \end_layout
1289 \begin_layout Itemize
1290 F: read_double(a)
1291 \end_layout
1293 \begin_layout Itemize
1294 H<digit> : Set hexadecimal mode with specified number of digits (use A-G
1295  for 10-16 digits).
1296 \end_layout
1298 \begin_layout Itemize
1299 O: read_unsigned_hword(a)
1300 \end_layout
1302 \begin_layout Itemize
1303 Q : read_unsigned_qword(a)
1304 \end_layout
1306 \begin_layout Itemize
1307 R<digit> : round a to <digit> digits.
1308 \end_layout
1310 \begin_layout Itemize
1311 W : read_unsigned_word(a)
1312 \end_layout
1314 \begin_layout Subsection
1315 Example:
1316 \end_layout
1318 \begin_layout Standard
1319 C0x007e0878zWC0x007e002czW-
1320 \end_layout
1322 \begin_layout Enumerate
1323 Push value 0x7e0878 on top of stack (C0x007e0878z).
1324 \end_layout
1326 \begin_layout Enumerate
1327 Pop the value on top of stack (0x7e0878), read word value at that address
1328  and push the result,call it x1 (W).
1329 \end_layout
1331 \begin_layout Enumerate
1332 Push value 0x7e002c on top of stack (C0x007e002cz).
1333 \end_layout
1335 \begin_layout Enumerate
1336 Pop the value on top of stack (0x7e002c), read word value at that address
1337  and push the result,call it x2 (W).
1338 \end_layout
1340 \begin_layout Enumerate
1341 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
1342  x2 - x1 (-).
1343 \end_layout
1345 \begin_layout Enumerate
1346 Since the expression ends, the final memory watch result is the top one
1347  on stack, which is x2 - x1.
1348 \end_layout
1350 \begin_layout Section
1351 Modifier and key names:
1352 \end_layout
1354 \begin_layout Subsection
1355 wxWidgets platform
1356 \end_layout
1358 \begin_layout Subsubsection
1359 Modifier names:
1360 \end_layout
1362 \begin_layout Standard
1363 Following modifier names are known:
1364 \end_layout
1366 \begin_layout Itemize
1368 \end_layout
1370 \begin_layout Itemize
1371 ctrl
1372 \end_layout
1374 \begin_layout Itemize
1375 shift 
1376 \end_layout
1378 \begin_layout Itemize
1379 meta
1380 \end_layout
1382 \begin_layout Itemize
1383 cmd (Mac OS X only)
1384 \end_layout
1386 \begin_layout Subsubsection
1387 Key names:
1388 \end_layout
1390 \begin_layout Standard
1391 Following key names are known:
1392 \end_layout
1394 \begin_layout Itemize
1395 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1396  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1397  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1398  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1399  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1400  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1401  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1402  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1403  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1404  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1405  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1406  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1407  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1408  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1409  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1410  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1411  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1412  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1413  windows_right, windows_menu, command, special1, special2, special3, special4,
1414  special5, special6, special7, special8, special9, special10, special11,
1415  special12, special13, special14, special15, special16, special17, special18,
1416  special19, special20
1417 \end_layout
1419 \begin_layout Section
1420 Movie file format
1421 \end_layout
1423 \begin_layout Standard
1424 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1425  (note: If you recompress it, do not use compression methods other than
1426  store and deflate and especially do not use encryption of any kind).
1427 \end_layout
1429 \begin_layout Subsection
1430 Detecting clean start/SRAM/Savestate
1431 \end_layout
1433 \begin_layout Itemize
1434 If file has member 
1435 \begin_inset Quotes eld
1436 \end_inset
1438 savestate
1439 \begin_inset Quotes erd
1440 \end_inset
1442  it is savestate, otherwise:
1443 \end_layout
1445 \begin_layout Itemize
1446 If file has members with names starting 
1447 \begin_inset Quotes eld
1448 \end_inset
1450 moviesram.
1451 \begin_inset Quotes erd
1452 \end_inset
1454  it is movie starting from SRAM, otherwise:
1455 \end_layout
1457 \begin_layout Itemize
1458 It is movie starting from clear state.
1459 \end_layout
1461 \begin_layout Subsection
1462 Member: gametype
1463 \end_layout
1465 \begin_layout Standard
1466 Type of game ROM and region (as one line).
1467  Valid values are:
1468 \end_layout
1470 \begin_layout Standard
1471 \begin_inset Tabular
1472 <lyxtabular version="3" rows="8" columns="3">
1473 <features tabularvalignment="middle">
1474 <column alignment="center" valignment="top" width="0">
1475 <column alignment="center" valignment="top" width="0">
1476 <column alignment="center" valignment="top" width="0">
1477 <row>
1478 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1479 \begin_inset Text
1481 \begin_layout Plain Layout
1482 Value
1483 \end_layout
1485 \end_inset
1486 </cell>
1487 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1488 \begin_inset Text
1490 \begin_layout Plain Layout
1491 System
1492 \end_layout
1494 \end_inset
1495 </cell>
1496 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1497 \begin_inset Text
1499 \begin_layout Plain Layout
1500 Region
1501 \end_layout
1503 \end_inset
1504 </cell>
1505 </row>
1506 <row>
1507 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1508 \begin_inset Text
1510 \begin_layout Plain Layout
1511 snes_pal
1512 \end_layout
1514 \end_inset
1515 </cell>
1516 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1517 \begin_inset Text
1519 \begin_layout Plain Layout
1520 Super NES
1521 \end_layout
1523 \end_inset
1524 </cell>
1525 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1526 \begin_inset Text
1528 \begin_layout Plain Layout
1530 \end_layout
1532 \end_inset
1533 </cell>
1534 </row>
1535 <row>
1536 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1537 \begin_inset Text
1539 \begin_layout Plain Layout
1540 sgb_pal
1541 \end_layout
1543 \end_inset
1544 </cell>
1545 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1546 \begin_inset Text
1548 \begin_layout Plain Layout
1549 Super Game Boy
1550 \end_layout
1552 \end_inset
1553 </cell>
1554 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1555 \begin_inset Text
1557 \begin_layout Plain Layout
1559 \end_layout
1561 \end_inset
1562 </cell>
1563 </row>
1564 <row>
1565 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1566 \begin_inset Text
1568 \begin_layout Plain Layout
1569 snes_ntsc
1570 \end_layout
1572 \end_inset
1573 </cell>
1574 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1575 \begin_inset Text
1577 \begin_layout Plain Layout
1578 Super NES
1579 \end_layout
1581 \end_inset
1582 </cell>
1583 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1584 \begin_inset Text
1586 \begin_layout Plain Layout
1587 NTSC
1588 \end_layout
1590 \end_inset
1591 </cell>
1592 </row>
1593 <row>
1594 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1595 \begin_inset Text
1597 \begin_layout Plain Layout
1598 sgb_ntsc
1599 \end_layout
1601 \end_inset
1602 </cell>
1603 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1604 \begin_inset Text
1606 \begin_layout Plain Layout
1607 Super Game Boy
1608 \end_layout
1610 \end_inset
1611 </cell>
1612 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1613 \begin_inset Text
1615 \begin_layout Plain Layout
1616 NTSC
1617 \end_layout
1619 \end_inset
1620 </cell>
1621 </row>
1622 <row>
1623 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1624 \begin_inset Text
1626 \begin_layout Plain Layout
1628 \end_layout
1630 \end_inset
1631 </cell>
1632 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1633 \begin_inset Text
1635 \begin_layout Plain Layout
1636 BS-X (non-slotted)
1637 \end_layout
1639 \end_inset
1640 </cell>
1641 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1642 \begin_inset Text
1644 \begin_layout Plain Layout
1645 NTSC
1646 \end_layout
1648 \end_inset
1649 </cell>
1650 </row>
1651 <row>
1652 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1653 \begin_inset Text
1655 \begin_layout Plain Layout
1656 bsxslotted
1657 \end_layout
1659 \end_inset
1660 </cell>
1661 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1662 \begin_inset Text
1664 \begin_layout Plain Layout
1665 BS-X (slotted)
1666 \end_layout
1668 \end_inset
1669 </cell>
1670 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1671 \begin_inset Text
1673 \begin_layout Plain Layout
1674 NTSC
1675 \end_layout
1677 \end_inset
1678 </cell>
1679 </row>
1680 <row>
1681 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1682 \begin_inset Text
1684 \begin_layout Plain Layout
1685 sufamiturbo
1686 \end_layout
1688 \end_inset
1689 </cell>
1690 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1691 \begin_inset Text
1693 \begin_layout Plain Layout
1694 Sufami Turbo
1695 \end_layout
1697 \end_inset
1698 </cell>
1699 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1700 \begin_inset Text
1702 \begin_layout Plain Layout
1703 NTSC
1704 \end_layout
1706 \end_inset
1707 </cell>
1708 </row>
1709 </lyxtabular>
1711 \end_inset
1714 \end_layout
1716 \begin_layout Standard
1717 Frame rates are:
1718 \end_layout
1720 \begin_layout Standard
1721 \begin_inset Tabular
1722 <lyxtabular version="3" rows="3" columns="2">
1723 <features tabularvalignment="middle">
1724 <column alignment="center" valignment="top" width="0">
1725 <column alignment="center" valignment="top" width="0">
1726 <row>
1727 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1728 \begin_inset Text
1730 \begin_layout Plain Layout
1731 Region
1732 \end_layout
1734 \end_inset
1735 </cell>
1736 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1737 \begin_inset Text
1739 \begin_layout Plain Layout
1740 Framerate (fps)
1741 \end_layout
1743 \end_inset
1744 </cell>
1745 </row>
1746 <row>
1747 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1748 \begin_inset Text
1750 \begin_layout Plain Layout
1752 \end_layout
1754 \end_inset
1755 </cell>
1756 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1757 \begin_inset Text
1759 \begin_layout Plain Layout
1760 322445/6448
1761 \end_layout
1763 \end_inset
1764 </cell>
1765 </row>
1766 <row>
1767 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1768 \begin_inset Text
1770 \begin_layout Plain Layout
1771 NTSC
1772 \end_layout
1774 \end_inset
1775 </cell>
1776 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1777 \begin_inset Text
1779 \begin_layout Plain Layout
1780 10738636/178683
1781 \end_layout
1783 \end_inset
1784 </cell>
1785 </row>
1786 </lyxtabular>
1788 \end_inset
1791 \end_layout
1793 \begin_layout Subsection
1794 Member: port1
1795 \end_layout
1797 \begin_layout Standard
1798 Contains type of port #1 (as one line).
1799  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1800  If not present, defaults to 'gamepad'.
1801 \end_layout
1803 \begin_layout Subsection
1804 Member: port2
1805 \end_layout
1807 \begin_layout Standard
1808 Contains type of port #2 (as one line).
1809  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1810  'justifier' and 'justifiers'.
1811  If not present, defaults to 'none'.
1812 \end_layout
1814 \begin_layout Subsection
1815 Member: gamename
1816 \end_layout
1818 \begin_layout Standard
1819 Contains name of the game (as one line).
1820 \end_layout
1822 \begin_layout Subsection
1823 Member: authors
1824 \end_layout
1826 \begin_layout Standard
1827 Contains authors, one per line.
1828  Part before '|' is the full name, part after is the nickname.
1829 \end_layout
1831 \begin_layout Subsection
1832 Member: systemid
1833 \end_layout
1835 \begin_layout Standard
1836 Always 
1837 \begin_inset Quotes eld
1838 \end_inset
1840 lsnes-rr1
1841 \begin_inset Quotes erd
1842 \end_inset
1844  (one line).
1845  Used to reject other saves.
1846 \end_layout
1848 \begin_layout Subsection
1849 Member: controlsversion
1850 \end_layout
1852 \begin_layout Standard
1853 Always 
1854 \begin_inset Quotes eld
1855 \end_inset
1858 \begin_inset Quotes erd
1859 \end_inset
1861  (one line).
1862  Used to identify what controls are there.
1863 \end_layout
1865 \begin_layout Subsection
1866 Member: 
1867 \begin_inset Quotes eld
1868 \end_inset
1870 coreversion
1871 \begin_inset Quotes erd
1872 \end_inset
1875 \end_layout
1877 \begin_layout Standard
1878 Contains bsnes core version number (as one line).
1879 \end_layout
1881 \begin_layout Subsection
1882 Member: projectid
1883 \end_layout
1885 \begin_layout Standard
1886 Contains project ID (as one line).
1887  Used to identify if two movies are part of the same project.
1888 \end_layout
1890 \begin_layout Subsection
1891 Member: {rom,slota,slotb}{,xml}.sha256
1892 \end_layout
1894 \begin_layout Standard
1895 Contains SHA-256 of said ROM or ROM mapping file (as one line).
1896  Absent if corresponding file is absent.
1897 \end_layout
1899 \begin_layout Subsection
1900 Member: moviesram.<name>
1901 \end_layout
1903 \begin_layout Standard
1904 Raw binary startup SRAM of kind <name>.
1905  Only present in savestates and movies starting from SRAM.
1906 \end_layout
1908 \begin_layout Subsection
1909 Member: saveframe
1910 \end_layout
1912 \begin_layout Standard
1913 Contains frame number (as one line) of frame movie was saved on.
1914  Only present in savestates.
1915 \end_layout
1917 \begin_layout Subsection
1918 Member: lagcounter
1919 \end_layout
1921 \begin_layout Standard
1922 Current value of lag counter (as one line).
1923  Only present in savestates.
1924 \end_layout
1926 \begin_layout Subsection
1927 Member: pollcounters
1928 \end_layout
1930 \begin_layout Standard
1931 Contains poll counters (currently 100 of them), one per line.
1932  Each line is raw poll count if DRDY is set for it.
1933  Otherwise it is negative poll count minus one.
1934  Only present in savestates.
1935 \end_layout
1937 \begin_layout Subsection
1938 Member: hostmemory
1939 \end_layout
1941 \begin_layout Standard
1942 Raw binary dump of host memory.
1943  Only present in savestates.
1944 \end_layout
1946 \begin_layout Subsection
1947 Member: savestate
1948 \end_layout
1950 \begin_layout Standard
1951 The raw binary savestate itself.
1952  Savestate detection uses this file, only present in savestates.
1953 \end_layout
1955 \begin_layout Subsection
1956 Member: screenshot
1957 \end_layout
1959 \begin_layout Standard
1960 Screenshot of current frame.
1961  Only present in savestates.
1962  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
1963  data.
1964  Height of image is inferred from the width and size of data.
1965 \end_layout
1967 \begin_layout Subsection
1968 Member: sram.<name>
1969 \end_layout
1971 \begin_layout Standard
1972 Raw binary SRAM of kind <name> at time of savestate.
1973  Only present in savestates.
1974 \end_layout
1976 \begin_layout Subsection
1977 Member: input
1978 \end_layout
1980 \begin_layout Standard
1981 The actual input track, one line per subframe (blank lines are skipped).
1982 \end_layout
1984 \begin_layout Itemize
1985 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
1986  part of same frame as previous, otherwise it starts a new frame.
1987 \end_layout
1989 \begin_layout Itemize
1990 First subframe must start a new frame.
1991 \end_layout
1993 \begin_layout Standard
1994 Length of movie in frames is number of lines in input file that start a
1995  new frame.
1996 \end_layout
1998 \begin_layout Subsection
1999 Member: subtitles
2000 \end_layout
2002 \begin_layout Standard
2003 Subtitle track.
2004  Optional.
2005 \end_layout
2007 \begin_layout Itemize
2008 Each line is in form <firstframe> <numframes> <text>.
2009 \end_layout
2011 \begin_layout Itemize
2012 Linefeed is encoded as 
2013 \backslash
2014 n, backslash is encoded as 
2015 \backslash
2017 \backslash
2019 \end_layout
2021 \begin_layout Subsection
2022 Member: rerecords
2023 \end_layout
2025 \begin_layout Standard
2026 Contains textual base-10 rerecord count (as one line; emulator just writes
2027  this, it doesn't read it) + 1.
2028 \end_layout
2030 \begin_layout Subsection
2031 Member: rrdata
2032 \end_layout
2034 \begin_layout Standard
2035 This member stores set of load IDs.
2036  There is one load ID per rerecord (plus one corresponding to start of project).
2037 \end_layout
2039 \begin_layout Itemize
2040 This member constists of concatenation of records
2041 \end_layout
2043 \begin_layout Itemize
2044 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2045  IDs.
2046 \end_layout
2048 \begin_layout Itemize
2049 IDs are interpretted as 256-bit big-endian integers with warparound.
2050 \end_layout
2052 \begin_layout Itemize
2053 Initial predicted ID is all zeroes.
2054 \end_layout
2056 \begin_layout Standard
2057 Format of each record is:
2058 \end_layout
2060 \begin_layout Itemize
2061 1 byte: Opcode byte.
2062  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2063  Bit 7 is unused.
2064 \end_layout
2066 \begin_layout Itemize
2067 32-prefixlen bytes of ID.
2068 \end_layout
2070 \begin_layout Itemize
2071 countlen bytes of big-endian count (count).
2072 \end_layout
2074 \begin_layout Standard
2075 Records are processed as follows:
2076 \end_layout
2078 \begin_layout Itemize
2079 To form the first ID encoded by record, take the first prefixlen bytes predicted
2080  ID and append the read ID value to it.
2081  The result is the first ID encoded.
2082 \end_layout
2084 \begin_layout Itemize
2085 If countlen is 0, record encodes 1 ID.
2086 \end_layout
2088 \begin_layout Itemize
2089 If countlen is 1, record encodes 2+count IDs.
2090 \end_layout
2092 \begin_layout Itemize
2093 If countlen is 2, record encodes 258+count IDs.
2094 \end_layout
2096 \begin_layout Itemize
2097 If countlen is 3, record encodes 65794+count IDs.
2098 \end_layout
2100 \begin_layout Itemize
2101 The new predicted ID is the next ID after last one encoded by the record.
2102 \end_layout
2104 \begin_layout Standard
2105 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2106  by all records.
2107 \end_layout
2109 \begin_layout Subsection
2110 Member: starttime.second
2111 \end_layout
2113 \begin_layout Standard
2114 Movie starting time, second part.
2115  Epoch is Unix epoch.
2116  Default is 1,000,000,000.
2117 \end_layout
2119 \begin_layout Subsection
2120 Member: starttime.subsecond
2121 \end_layout
2123 \begin_layout Standard
2124 Movie starting time, subsecond part.
2125  Unit is CPU clocks.
2126  Default is 0.
2127 \end_layout
2129 \begin_layout Subsection
2130 Member: savetime.second
2131 \end_layout
2133 \begin_layout Standard
2134 Movie saving time, second part.
2135  Default is starttime.second.
2136  Only present in savestates.
2137 \end_layout
2139 \begin_layout Subsection
2140 Member: savetime.subsecond
2141 \end_layout
2143 \begin_layout Standard
2144 Movie saving time, subsecond part.
2145  Default is starttime.subsecond.
2146  Only present in savestates.
2147 \end_layout
2149 \begin_layout Section
2150 lsvs file format (commentary tracks)
2151 \end_layout
2153 \begin_layout Subsection
2154 Clusters
2155 \end_layout
2157 \begin_layout Itemize
2158 Each cluster is 8kB (8192 bytes) in size.
2159 \end_layout
2161 \begin_layout Itemize
2162 Cluster n starts at offset 8192*n in file.
2163 \end_layout
2165 \begin_layout Itemize
2166 The following clusters are system special:
2167 \end_layout
2169 \begin_deeper
2170 \begin_layout Itemize
2171 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2172 \end_layout
2174 \begin_layout Itemize
2175 Cluster 1 (superblock)
2176 \end_layout
2178 \end_deeper
2179 \begin_layout Subsection
2180 Cluster tables
2181 \end_layout
2183 \begin_layout Itemize
2184 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2185  last 11 bits of n).
2186 \end_layout
2188 \begin_layout Itemize
2189 This cluster table consists of 2048 4-byte big-endian integers.
2190 \end_layout
2192 \begin_layout Itemize
2193 Each entry describes a cluster in 16MB supercluster, in order.
2194 \end_layout
2196 \begin_layout Itemize
2197 The valid values for entries are:
2198 \end_layout
2200 \begin_deeper
2201 \begin_layout Itemize
2202 0x00000000: Free cluster
2203 \end_layout
2205 \begin_layout Itemize
2206 0x00000001: Last cluster in chain.
2207 \end_layout
2209 \begin_layout Itemize
2210 0xFFFFFFFF: System cluster (cluster tables and superblock)
2211 \end_layout
2213 \begin_layout Itemize
2214 (anything else): Number of next cluster in chain.
2215  Must not be multiple of 2048.
2216 \end_layout
2218 \end_deeper
2219 \begin_layout Itemize
2220 Due to limitations of the format, there can be at most 2097052 superclusters,
2221  giving maximum file size of 16TB.
2222 \end_layout
2224 \begin_layout Subsection
2225 Stream table
2226 \end_layout
2228 \begin_layout Itemize
2229 The stream table chain always starts in cluster 2.
2230 \end_layout
2232 \begin_layout Itemize
2233 Otherwise, it follows normal chaining.
2234 \end_layout
2236 \begin_layout Itemize
2237 The stream table consists of 16-byte entries:
2238 \end_layout
2240 \begin_deeper
2241 \begin_layout Itemize
2242 The first 8 bytes of entry give big-endian beginning position of stream
2243  in units of 1/48000 s.
2244 \end_layout
2246 \begin_layout Itemize
2247 The next 4 bytes of entry give big-endian beginning cluster for control
2248  data.
2249  0 here marks the entry as not present.
2250 \end_layout
2252 \begin_layout Itemize
2253 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2254 \end_layout
2256 \end_deeper
2257 \begin_layout Itemize
2258 Stream table clusters are normal clusters, following normal chaining.
2259 \end_layout
2261 \begin_layout Itemize
2262 The stream begnning position is not guarenteed unique.
2263  There can be multiple streams with the same starting position in the file.
2264 \end_layout
2266 \begin_layout Subsection
2267 Stream control data
2268 \end_layout
2270 \begin_layout Itemize
2271 The stream control data consists of entries 4 bytes each:
2272 \end_layout
2274 \begin_deeper
2275 \begin_layout Itemize
2276 The first 2 bytes of entry gives big-endian length of packet
2277 \end_layout
2279 \begin_layout Itemize
2280 The next byte of entry gives audio length of packet in units of 1/400 s.
2281 \end_layout
2283 \begin_layout Itemize
2284 The last byte is control byte.
2285 \end_layout
2287 \begin_deeper
2288 \begin_layout Itemize
2289 0 means this entry is not present and the control data ends.
2290 \end_layout
2292 \begin_layout Itemize
2293 1 is valid control entry.
2294 \end_layout
2296 \end_deeper
2297 \end_deeper
2298 \begin_layout Itemize
2299 The stream control data can also end by running into end of the readable
2300  chain.
2301 \end_layout
2303 \begin_deeper
2304 \begin_layout Itemize
2305 This happens if there happens to be exact multiple of 2048 packets in stream
2306  and number of packets is nonzero.
2307 \end_layout
2309 \end_deeper
2310 \begin_layout Itemize
2311 These clusters follow normal chaining.
2312 \end_layout
2314 \begin_layout Subsection
2315 Stream codec data
2316 \end_layout
2318 \begin_layout Itemize
2319 Stream codec data consists of raw Opus data packets packed back to back
2320  with nothing in between.
2321 \end_layout
2323 \begin_layout Itemize
2324 Warning: Due to internal limitations, this data must reside in the first
2325  65536 superclusters (that is, the first 1TB of the file).
2326 \end_layout
2328 \begin_layout Subsection
2329 Superblock
2330 \end_layout
2332 \begin_layout Itemize
2333 The superblock is stored in cluster 1.
2335 \end_layout
2337 \begin_layout Itemize
2338 The first 11 bytes are 
2339 \begin_inset Quotes eld
2340 \end_inset
2342 sefs-magic
2343 \begin_inset Quotes erd
2344 \end_inset
2346 <NUL>.
2347 \end_layout
2349 \begin_layout Itemize
2350 The rest are unused.
2351 \end_layout
2353 \begin_layout Itemize
2354 This cluster 1 is marked as system special.
2355 \end_layout
2357 \begin_layout Section
2358 Known ROM extensions
2359 \end_layout
2361 \begin_layout Itemize
2362 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2363 \end_layout
2365 \begin_layout Itemize
2366 DMG cartridge ROMs: dmg, gb.
2367 \end_layout
2369 \begin_layout Itemize
2370 GBC cartridge ROMs: cgb, gbc.
2371 \end_layout
2373 \begin_layout Section
2374 Gamepack files
2375 \end_layout
2377 \begin_layout Itemize
2378 The first line must be: 
2379 \begin_inset Quotes eld
2380 \end_inset
2382 [GAMEPACK FILE]
2383 \begin_inset Quotes erd
2384 \end_inset
2387 \end_layout
2389 \begin_layout Itemize
2390 There is one needed line: 
2391 \begin_inset Quotes eld
2392 \end_inset
2394 type <systype>
2395 \begin_inset Quotes erd
2396 \end_inset
2399  This sets system type to <systype>.
2400  The following system types are valid:
2401 \end_layout
2403 \begin_deeper
2404 \begin_layout Itemize
2405 snes (SNES)
2406 \end_layout
2408 \begin_layout Itemize
2409 bsx (BS-X non-slotted)
2410 \end_layout
2412 \begin_layout Itemize
2413 bsxslotted (BS-X slotted)
2414 \end_layout
2416 \begin_layout Itemize
2417 sufamiturbo (Sufami Turbo)
2418 \end_layout
2420 \begin_layout Itemize
2421 sgb (Super Game Boy)
2422 \end_layout
2424 \begin_layout Itemize
2425 dmg (Game Boy)
2426 \end_layout
2428 \begin_layout Itemize
2429 gbc (Game Boy Color)
2430 \end_layout
2432 \begin_layout Itemize
2433 gbc_gba (Game Boy Color with GBA initial register values)
2434 \end_layout
2436 \end_deeper
2437 \begin_layout Itemize
2438 Optionally a region can be specified: 
2439 \begin_inset Quotes eld
2440 \end_inset
2442 region <region>
2443 \begin_inset Quotes erd
2444 \end_inset
2447  The following values are valid:
2448 \end_layout
2450 \begin_deeper
2451 \begin_layout Itemize
2452 autodetect (Autodetect region: snes and sgb only)
2453 \end_layout
2455 \begin_layout Itemize
2456 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2457 \end_layout
2459 \begin_layout Itemize
2460 pal (PAL: snes, sgb)
2461 \end_layout
2463 \begin_layout Itemize
2464 world (World: dmg, gbc, gbc_gba)
2465 \end_layout
2467 \end_deeper
2468 \begin_layout Itemize
2469 ROM images are loaded as: 
2470 \begin_inset Quotes eld
2471 \end_inset
2473 rom <type> <file>
2474 \begin_inset Quotes erd
2475 \end_inset
2478  The following types are valid:
2479 \end_layout
2481 \begin_deeper
2482 \begin_layout Itemize
2483 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2484  BIOS in bsx, bsxslotted, sufamiturbo)
2485 \end_layout
2487 \begin_layout Itemize
2488 bsx (Cartridge ROM in bsx, bsxslotted)
2489 \end_layout
2491 \begin_layout Itemize
2492 slot-a (Cartridge ROM in sufamiturbo)
2493 \end_layout
2495 \begin_layout Itemize
2496 slot-b (Cartridge ROM in sufamiturbo)
2497 \end_layout
2499 \end_deeper
2500 \begin_layout Itemize
2501 ROM markup can be loaded as: 
2502 \begin_inset Quotes eld
2503 \end_inset
2505 xml <type> <file>
2506 \begin_inset Quotes erd
2507 \end_inset
2510  The types valid are the same as for ROMs.
2511 \end_layout
2513 \begin_layout Itemize
2514 Patches can be loaded as 
2515 \begin_inset Quotes eld
2516 \end_inset
2518 patch[<offset>] <type> <file>
2519 \begin_inset Quotes erd
2520 \end_inset
2523  The types are the same as for ROMs.
2524 \end_layout
2526 \begin_deeper
2527 \begin_layout Itemize
2528 Offset is given in form [+-]<number>.
2529  Usually offset is either +0 or -512.
2530 \end_layout
2532 \begin_layout Itemize
2533 Default offset is +0.
2534 \end_layout
2536 \end_deeper
2537 \begin_layout Subsection
2538 Example:
2539 \end_layout
2541 \begin_layout LyX-Code
2542 [GAMEPACK FILE]
2543 \end_layout
2545 \begin_layout LyX-Code
2546 type snes
2547 \end_layout
2549 \begin_layout LyX-Code
2550 rom rom speedygonzales.sfc
2551 \end_layout
2553 \begin_layout LyX-Code
2554 patch-512 rom sonicthehedgehog.ips
2555 \end_layout
2557 \begin_layout Subsection
2558 Example 2:
2559 \end_layout
2561 \begin_layout LyX-Code
2562 [GAMEPACK FILE]
2563 \end_layout
2565 \begin_layout LyX-Code
2566 type sgb
2567 \end_layout
2569 \begin_layout LyX-Code
2570 rom rom supergameboy.sfc
2571 \end_layout
2573 \begin_layout LyX-Code
2574 rom dmg megamanV.dmg
2575 \end_layout
2577 \begin_layout Section
2578 Quick'n'dirty encode guide
2579 \end_layout
2581 \begin_layout Enumerate
2582 Start the emulator and load the ROM and movie file.
2583 \end_layout
2585 \begin_layout Enumerate
2586 Set large AVI option 'set-setting avi-large on'
2587 \end_layout
2589 \begin_layout Enumerate
2590 Enable dumping 'dump-avi tmpdump' 
2591 \end_layout
2593 \begin_layout Enumerate
2594 Unpause and let it run until you want to end dumping.
2595 \end_layout
2597 \begin_layout Enumerate
2598 Close the emulator (closing the window is the easiest way).
2599  Or use 'end-avi'.
2600 \end_layout
2602 \begin_layout Enumerate
2603 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2604  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2605 \end_layout
2607 \begin_layout Enumerate
2608 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2609 \end_layout
2611 \begin_layout Enumerate
2612 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2613  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2614 \end_layout
2616 \begin_layout Enumerate
2617 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2618  Now final.mkv contains quick'n'dirty encode.
2619 \end_layout
2621 \begin_layout Section
2622 Axis configurations for some gamepad types:
2623 \end_layout
2625 \begin_layout Subsection
2626 XBox360 controller:
2627 \end_layout
2629 \begin_layout Standard
2630 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2631 \end_layout
2633 \begin_layout LyX-Code
2634 set-axis joystick0axis2 pressure-+
2635 \end_layout
2637 \begin_layout LyX-Code
2638 set-axis joystick0axis5 pressure-+
2639 \end_layout
2641 \begin_layout Itemize
2642 This is needed for SDL only.
2643  EVDEV sets those types correctly.
2644 \end_layout
2646 \begin_layout Subsection
2647 PS3 
2648 \begin_inset Quotes eld
2649 \end_inset
2651 sixaxis
2652 \begin_inset Quotes erd
2653 \end_inset
2655  controller:
2656 \end_layout
2658 \begin_layout Standard
2659 Axes 8-19 should be disabled.
2660 \end_layout
2662 \begin_layout LyX-Code
2663 set-axis joystick0axis8 disabled
2664 \end_layout
2666 \begin_layout LyX-Code
2667 set-axis joystick0axis9 disabled
2668 \end_layout
2670 \begin_layout LyX-Code
2671 set-axis joystick0axis10 disabled
2672 \end_layout
2674 \begin_layout LyX-Code
2675 set-axis joystick0axis11 disabled
2676 \end_layout
2678 \begin_layout LyX-Code
2679 set-axis joystick0axis12 disabled
2680 \end_layout
2682 \begin_layout LyX-Code
2683 set-axis joystick0axis13 disabled
2684 \end_layout
2686 \begin_layout LyX-Code
2687 set-axis joystick0axis14 disabled
2688 \end_layout
2690 \begin_layout LyX-Code
2691 set-axis joystick0axis15 disabled
2692 \end_layout
2694 \begin_layout LyX-Code
2695 set-axis joystick0axis16 disabled
2696 \end_layout
2698 \begin_layout LyX-Code
2699 set-axis joystick0axis17 disabled
2700 \end_layout
2702 \begin_layout LyX-Code
2703 set-axis joystick0axis18 disabled
2704 \end_layout
2706 \begin_layout LyX-Code
2707 set-axis joystick0axis19 disabled
2708 \end_layout
2710 \begin_layout Section
2711 Errata:
2712 \end_layout
2714 \begin_layout Subsection
2715 Problems from BSNES core:
2716 \end_layout
2718 \begin_layout Itemize
2719 The whole pending save stuff.
2720 \end_layout
2722 \begin_layout Itemize
2723 It is slow (especially accuracy).
2724 \end_layout
2726 \begin_layout Itemize
2727 Firmwares can't be loaded from ZIP archives.
2728 \end_layout
2730 \begin_layout Subsection
2731 Other problems:
2732 \end_layout
2734 \begin_layout Itemize
2735 Modifiers don't work with pseudo-keys.
2736 \end_layout
2738 \begin_layout Itemize
2739 Audio for last dumped frame is not itself dumped.
2740 \end_layout
2742 \begin_layout Itemize
2743 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2744 \end_layout
2746 \end_body
2747 \end_document