Move one #ifdef BSNES_HAS_DEBUGGER to the proper place
[lsnes.git] / manual.lyx
bloba339f3243a629b1b98991b6093cdac52aeb2e849
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 Slot branches
817 \end_layout
819 \begin_layout Subsubsection
820 list-branches
821 \end_layout
823 \begin_layout Standard
824 List all branches
825 \end_layout
827 \begin_layout Subsubsection
828 create-branch <pid> <name>
829 \end_layout
831 \begin_layout Standard
832 Create a new branch, with <pid> as parent and <name> as name.
833 \end_layout
835 \begin_layout Subsubsection
836 rename-branch <id> <name>
837 \end_layout
839 \begin_layout Standard
840 Rename branch <id> to <name>.
841 \end_layout
843 \begin_layout Subsubsection
844 reparent-branch <id> <pid>
845 \end_layout
847 \begin_layout Standard
848 Set parent of branch <id> to <pid>.
849 \end_layout
851 \begin_layout Subsubsection
852 set-branch <id>
853 \end_layout
855 \begin_layout Standard
856 Set current branch to <id>.
857 \end_layout
859 \begin_layout Subsubsection
860 delete-branch <id>
861 \end_layout
863 \begin_layout Standard
864 Delete branch <id>.
865 \end_layout
867 \begin_layout Standard
869 \end_layout
871 \begin_layout Subsection
872 Lua 
873 \end_layout
875 \begin_layout Subsubsection
876 evaluate-lua <luacode>
877 \end_layout
879 \begin_layout Standard
880 Run Lua code <luacode> using built-in Lua interpretter.
881 \end_layout
883 \begin_layout Subsubsection
884 L <luacode>
885 \end_layout
887 \begin_layout Standard
888 Synonym for evaluate-lua.
889 \end_layout
891 \begin_layout Subsubsection
892 run-lua <script>
893 \end_layout
895 \begin_layout Standard
896 Run specified lua file using built-in Lua interpretter.
897 \end_layout
899 \begin_layout Subsubsection
900 reset-lua
901 \end_layout
903 \begin_layout Standard
904 Clear the Lua VM state and restore to factory defaults.
905 \end_layout
907 \begin_layout Subsection
908 Sound 
909 \end_layout
911 \begin_layout Subsubsection
912 enable-sound <on/off> 
913 \end_layout
915 \begin_layout Standard
916 Enable/Disable sound.
917 \end_layout
919 \begin_layout Subsection
920 Misc.
921 \end_layout
923 \begin_layout Subsubsection
924 reload-rom [<file>]
925 \end_layout
927 \begin_layout Standard
928 Reloads the main ROM image from <file>.
929 \end_layout
931 \begin_layout Subsubsection
932 +tangent
933 \end_layout
935 \begin_layout Standard
936 Tangent for recording voice for commentary track.
937  While pressed, record a stream.
938 \end_layout
940 \begin_layout Subsubsection
941 advance-subframe-timeout
942 \end_layout
944 \begin_layout Standard
945 Subframe advance timeout in milliseconds.
946  Default is 100.
947 \end_layout
949 \begin_layout Section
950 Settings
951 \end_layout
953 \begin_layout Subsection
954 Core settings
955 \end_layout
957 \begin_layout Subsection
958 AVI dumper settings
959 \end_layout
961 \begin_layout Subsubsection
962 avi-large
963 \end_layout
965 \begin_layout Standard
966 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
967  outputs.
968 \end_layout
970 \begin_layout Subsubsection
971 avi-left-border
972 \end_layout
974 \begin_layout Standard
975 AVI dumper: Set the default left border thickness (unless lua overrides)
976  for dumps.
977  Range 0-8191.
978  Default is 0.
979 \end_layout
981 \begin_layout Subsubsection
982 avi-right-border
983 \end_layout
985 \begin_layout Standard
986 AVI dumper: Set the default right border thickness (unless lua overrides)
987  for dumps.
988  Range 0-8191.
989  Default is 0.
990 \end_layout
992 \begin_layout Subsubsection
993 avi-top-border
994 \end_layout
996 \begin_layout Standard
997 AVI dumper: Set the default top border thickness (unless lua overrides)
998  for dumps.
999  Range 0-8191.
1000  Default is 0.
1001 \end_layout
1003 \begin_layout Subsubsection
1004 avi-bottom-border
1005 \end_layout
1007 \begin_layout Standard
1008 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1009  for dumps.
1010  Range 0-8191.
1011  Default is 0.
1012 \end_layout
1014 \begin_layout Subsubsection
1015 avi-maxframes
1016 \end_layout
1018 \begin_layout Standard
1019 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1020  Range 0-999999999.
1021  Default is 0.
1022 \end_layout
1024 \begin_layout Subsubsection
1025 avi-compresison
1026 \end_layout
1028 \begin_layout Standard
1029 AVI dumper: Compression level (0-18).
1030 \end_layout
1032 \begin_layout Itemize
1033 Compression levels 10 and above are not compatible with stock CSCD codec.
1034 \end_layout
1036 \begin_layout Itemize
1037 Recomended level is 7.
1038 \end_layout
1040 \begin_layout Subsubsection
1041 avi-soundrate
1042 \end_layout
1044 \begin_layout Standard
1045 AVI dumper: Set method of determining the sound rate.
1046 \end_layout
1048 \begin_layout Itemize
1049 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1050  128, 176.4 and 192 kHz.
1051 \end_layout
1053 \begin_layout Itemize
1054 1: Round down to nearest integer.
1055 \end_layout
1057 \begin_layout Itemize
1058 2: Round up to nearest ingeter.
1059 \end_layout
1061 \begin_layout Itemize
1062 3: Multiply by denominator.
1063 \end_layout
1065 \begin_layout Itemize
1066 4: High quality 44.1kHz (SRC needed).
1067 \end_layout
1069 \begin_layout Itemize
1070 5: High quality 48kHz (SRC needed).
1071 \end_layout
1073 \begin_layout Subsection
1074 JMD options
1075 \end_layout
1077 \begin_layout Subsubsection
1078 jmd-compression
1079 \end_layout
1081 \begin_layout Standard
1082 JMD dumper: Compression level (0-9).
1083 \end_layout
1085 \begin_layout Section
1086 Movie editor
1087 \end_layout
1089 \begin_layout Itemize
1090 The editor edits in-memory movie.
1091 \end_layout
1093 \begin_layout Itemize
1094 Because past can't be edited and readwrite mode doesn't allow future, editing
1095  only works in 
1096 \emph on
1097 read only
1098 \emph default
1099  mode.
1100 \end_layout
1102 \begin_layout Itemize
1103 Keyboard triggers the normal hotkeys and bindings.
1104 \end_layout
1106 \begin_layout Subsection
1107 Left button actions
1108 \end_layout
1110 \begin_layout Itemize
1111 Clicking on cell in future (indicated by lack of redish background) toggles
1112  it (if it is a button) or prompts for a value (if it is an axis)
1113 \end_layout
1115 \begin_layout Itemize
1116 Dragging vertically toggles sequence of buttons or changes a sequence of
1117  axis values.
1118 \end_layout
1120 \begin_layout Subsection
1121 Right button actions
1122 \end_layout
1124 \begin_layout Standard
1125 The right mouse button pops up a context-sensitive menu:
1126 \end_layout
1128 \begin_layout Itemize
1129 Toggle <something>: Toggle this button
1130 \end_layout
1132 \begin_layout Itemize
1133 Change <something>: Change this axis value
1134 \end_layout
1136 \begin_layout Itemize
1137 Insert frame after: Insert a frame after this frame
1138 \end_layout
1140 \begin_layout Itemize
1141 Append frame: Append a frame to movie
1142 \end_layout
1144 \begin_layout Itemize
1145 Append frames: Append specified number of frames to movie
1146 \end_layout
1148 \begin_layout Itemize
1149 Delete frame: Delete this frame
1150 \end_layout
1152 \begin_layout Itemize
1153 Delete subframe: Delete this subframe
1154 \end_layout
1156 \begin_layout Itemize
1157 Truncate movie: Delete this subframe and everything after it.
1158 \end_layout
1160 \begin_layout Itemize
1161 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1162 \end_layout
1164 \begin_layout Itemize
1165 Scroll to current frame: Scroll the display to current position
1166 \end_layout
1168 \begin_layout Itemize
1169 Run to frame: Prompts for frame and runs the emulation to that frame.
1170 \end_layout
1172 \begin_layout Itemize
1173 Change number of lines visible: Change the height of the movie display (1
1174  to 255).
1175 \end_layout
1177 \begin_layout Itemize
1178 Lock scroll to playback: While playing back or rewinding movies, the display
1179  will follow if enabled.
1180 \end_layout
1182 \begin_layout Section
1183 Memory watch expression syntax
1184 \end_layout
1186 \begin_layout Standard
1187 Memory watch expressions has the following syntax elements:
1188 \end_layout
1190 \begin_layout LyX-Code
1191 ${foo}     The value of memory watch foo.
1192 \end_layout
1194 \begin_layout LyX-Code
1195 0x1234     Hexadecimal number 1234
1196 \end_layout
1198 \begin_layout LyX-Code
1199 12345      Decimal number 12345
1200 \end_layout
1202 \begin_layout LyX-Code
1203 3.141      Decimal number 3.141
1204 \end_layout
1206 \begin_layout LyX-Code
1207 -a         Unary negation
1208 \end_layout
1210 \begin_layout LyX-Code
1211 ~a         Bitwise NOT (integers only)
1212 \end_layout
1214 \begin_layout LyX-Code
1215 a*b        Multiplication
1216 \end_layout
1218 \begin_layout LyX-Code
1219 a/b        Division/quotent
1220 \end_layout
1222 \begin_layout LyX-Code
1223 a%b        Remainder (integers only)
1224 \end_layout
1226 \begin_layout LyX-Code
1227 a+b        Sum or string concatenation
1228 \end_layout
1230 \begin_layout LyX-Code
1231 a-b        Difference
1232 \end_layout
1234 \begin_layout LyX-Code
1235 a<<b       Shift left (integers only)
1236 \end_layout
1238 \begin_layout LyX-Code
1239 a>>b       Shift right (integers only).
1240  Arithmetic for signed.
1241 \end_layout
1243 \begin_layout LyX-Code
1244 a<b        Less than
1245 \end_layout
1247 \begin_layout LyX-Code
1248 a<=b       Less or equal to
1249 \end_layout
1251 \begin_layout LyX-Code
1252 a==b       Equal to
1253 \end_layout
1255 \begin_layout LyX-Code
1256 a!=b       Not equal to
1257 \end_layout
1259 \begin_layout LyX-Code
1260 a>=b       Greater or equal to
1261 \end_layout
1263 \begin_layout LyX-Code
1264 a>b        Greater than
1265 \end_layout
1267 \begin_layout LyX-Code
1268 a&b        Bitwise AND (integers only)
1269 \end_layout
1271 \begin_layout LyX-Code
1272 a^b        Bitwise XOR (integers only)
1273 \end_layout
1275 \begin_layout LyX-Code
1276 a|b        Bitwise OR (integers only)
1277 \end_layout
1279 \begin_layout LyX-Code
1280 a&&b       Logical AND
1281 \end_layout
1283 \begin_layout LyX-Code
1284 a||b       Logical OR
1285 \end_layout
1287 \begin_layout LyX-Code
1288 Ï€          Numeric constant pi.
1289 \end_layout
1291 \begin_layout LyX-Code
1292 i          Imaginary unit
1293 \end_layout
1295 \begin_layout LyX-Code
1296 if(x,y)    If x is true, y, else false.
1297 \end_layout
1299 \begin_layout LyX-Code
1300 if(x,y,z)  If x is true, y, else z.
1301 \end_layout
1303 \begin_layout LyX-Code
1304 select(x...)
1305 \end_layout
1307 \begin_layout LyX-Code
1308            First value in x...
1309  that is not false, or false if none.
1310 \end_layout
1312 \begin_layout LyX-Code
1313 unsigned(x)
1314 \end_layout
1316 \begin_layout LyX-Code
1317            Cast x to unsigned.
1318 \end_layout
1320 \begin_layout LyX-Code
1321 signed(x)
1322 \end_layout
1324 \begin_layout LyX-Code
1325            Cast x to signed.
1326 \end_layout
1328 \begin_layout LyX-Code
1329 float(x)
1330 \end_layout
1332 \begin_layout LyX-Code
1333            Cast x to float.
1334 \end_layout
1336 \begin_layout LyX-Code
1337 min(x...)  The smallest value among x...
1338  or false if empty.
1339 \end_layout
1341 \begin_layout LyX-Code
1342 max(x...)  The largest value among x...
1343  or false if empty.
1344 \end_layout
1346 \begin_layout LyX-Code
1347 sum(x...)  Sum/concatenation of x...
1348  or false if empty.
1349 \end_layout
1351 \begin_layout LyX-Code
1352 prod(x...) Product of x...
1353  or false if empty.
1354 \end_layout
1356 \begin_layout LyX-Code
1357 sqrt(x)    Square root of x.
1358 \end_layout
1360 \begin_layout LyX-Code
1361 log(x)     Natural log of x.
1362 \end_layout
1364 \begin_layout LyX-Code
1365 log(x,y)   Log of y to base x.
1366 \end_layout
1368 \begin_layout LyX-Code
1369 exp(x)     e^x.
1370 \end_layout
1372 \begin_layout LyX-Code
1373 exp(x,y)   x^y
1374 \end_layout
1376 \begin_layout LyX-Code
1377 sin(x)     Sine of x
1378 \end_layout
1380 \begin_layout LyX-Code
1381 cos(x)     Cosine of x
1382 \end_layout
1384 \begin_layout LyX-Code
1385 tan(x)     Tangent of x
1386 \end_layout
1388 \begin_layout LyX-Code
1389 asin(x)    Arcsine of x
1390 \end_layout
1392 \begin_layout LyX-Code
1393 acos(x)    Arccosine of x
1394 \end_layout
1396 \begin_layout LyX-Code
1397 atan(x)    Arctangent of x
1398 \end_layout
1400 \begin_layout LyX-Code
1401 atan(x,y)  Angle between vector (x,y) and x-axis.
1402 \end_layout
1404 \begin_layout LyX-Code
1405 sinh(x)    Hyperbolic sine of x
1406 \end_layout
1408 \begin_layout LyX-Code
1409 cosh(x)    Hyperbolic cosine of x
1410 \end_layout
1412 \begin_layout LyX-Code
1413 tanh(x)    Hyperbolic tangent of x
1414 \end_layout
1416 \begin_layout LyX-Code
1417 arsinh(x)  Hyperbolic arsine of x
1418 \end_layout
1420 \begin_layout LyX-Code
1421 arcosh(x)  Hyperbolic arcosine of x
1422 \end_layout
1424 \begin_layout LyX-Code
1425 artanh(x)  Hyperbolic artangent of x
1426 \end_layout
1428 \begin_layout LyX-Code
1429 torad(x)   Convert x degrees to radians.
1430 \end_layout
1432 \begin_layout LyX-Code
1433 todeg(x)   Convert x radians to degrees.
1434 \end_layout
1436 \begin_layout LyX-Code
1437 re(x)      Real part of complex number x.
1438 \end_layout
1440 \begin_layout LyX-Code
1441 im(x)      Imaginary part of complex number x.
1442 \end_layout
1444 \begin_layout LyX-Code
1445 conj(x)    Complex conjugate of x.
1446 \end_layout
1448 \begin_layout LyX-Code
1449 abs(x)     Absolute value of x.
1450 \end_layout
1452 \begin_layout LyX-Code
1453 arg(x)     Argument of x.
1454 \end_layout
1456 \begin_layout LyX-Code
1457 pyth(x...) sqrt(sum(x^2)).
1458  I.e.
1459  pythagorean distance.
1460 \end_layout
1462 \begin_layout LyX-Code
1463 e          Base of natural logarithm
1464 \end_layout
1466 \begin_layout LyX-Code
1467 pi         Pi
1468 \end_layout
1470 \begin_layout LyX-Code
1471 true       Constant true
1472 \end_layout
1474 \begin_layout LyX-Code
1475 false      Constant false
1476 \end_layout
1478 \begin_layout LyX-Code
1480 \end_layout
1482 \begin_layout Section
1483 Modifier and key names:
1484 \end_layout
1486 \begin_layout Subsection
1487 wxWidgets platform
1488 \end_layout
1490 \begin_layout Subsubsection
1491 Modifier names:
1492 \end_layout
1494 \begin_layout Standard
1495 Following modifier names are known:
1496 \end_layout
1498 \begin_layout Itemize
1500 \end_layout
1502 \begin_layout Itemize
1503 ctrl
1504 \end_layout
1506 \begin_layout Itemize
1507 shift 
1508 \end_layout
1510 \begin_layout Itemize
1511 meta
1512 \end_layout
1514 \begin_layout Itemize
1515 cmd (Mac OS X only)
1516 \end_layout
1518 \begin_layout Subsubsection
1519 Key names:
1520 \end_layout
1522 \begin_layout Standard
1523 Following key names are known:
1524 \end_layout
1526 \begin_layout Itemize
1527 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1528  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1529  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1530  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1531  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1532  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1533  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1534  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1535  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1536  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1537  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1538  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1539  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1540  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1541  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1542  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1543  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1544  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1545  windows_right, windows_menu, command, special1, special2, special3, special4,
1546  special5, special6, special7, special8, special9, special10, special11,
1547  special12, special13, special14, special15, special16, special17, special18,
1548  special19, special20
1549 \end_layout
1551 \begin_layout Section
1552 Movie file format
1553 \end_layout
1555 \begin_layout Standard
1556 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1557  (note: If you recompress it, do not use compression methods other than
1558  store and deflate and especially do not use encryption of any kind).
1559 \end_layout
1561 \begin_layout Subsection
1562 Detecting clean start/SRAM/Savestate
1563 \end_layout
1565 \begin_layout Itemize
1566 If file has member 
1567 \begin_inset Quotes eld
1568 \end_inset
1570 savestate
1571 \begin_inset Quotes erd
1572 \end_inset
1574  it is savestate, otherwise:
1575 \end_layout
1577 \begin_layout Itemize
1578 If file has members with names starting 
1579 \begin_inset Quotes eld
1580 \end_inset
1582 moviesram.
1583 \begin_inset Quotes erd
1584 \end_inset
1586  it is movie starting from SRAM, otherwise:
1587 \end_layout
1589 \begin_layout Itemize
1590 It is movie starting from clear state.
1591 \end_layout
1593 \begin_layout Subsection
1594 Member: gametype
1595 \end_layout
1597 \begin_layout Standard
1598 Type of game ROM and region (as one line).
1599  Valid values are:
1600 \end_layout
1602 \begin_layout Standard
1603 \begin_inset Tabular
1604 <lyxtabular version="3" rows="8" columns="3">
1605 <features tabularvalignment="middle">
1606 <column alignment="center" valignment="top" width="0">
1607 <column alignment="center" valignment="top" width="0">
1608 <column alignment="center" valignment="top" width="0">
1609 <row>
1610 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1611 \begin_inset Text
1613 \begin_layout Plain Layout
1614 Value
1615 \end_layout
1617 \end_inset
1618 </cell>
1619 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1620 \begin_inset Text
1622 \begin_layout Plain Layout
1623 System
1624 \end_layout
1626 \end_inset
1627 </cell>
1628 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1629 \begin_inset Text
1631 \begin_layout Plain Layout
1632 Region
1633 \end_layout
1635 \end_inset
1636 </cell>
1637 </row>
1638 <row>
1639 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1640 \begin_inset Text
1642 \begin_layout Plain Layout
1643 snes_pal
1644 \end_layout
1646 \end_inset
1647 </cell>
1648 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1649 \begin_inset Text
1651 \begin_layout Plain Layout
1652 Super NES
1653 \end_layout
1655 \end_inset
1656 </cell>
1657 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1658 \begin_inset Text
1660 \begin_layout Plain Layout
1662 \end_layout
1664 \end_inset
1665 </cell>
1666 </row>
1667 <row>
1668 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1669 \begin_inset Text
1671 \begin_layout Plain Layout
1672 sgb_pal
1673 \end_layout
1675 \end_inset
1676 </cell>
1677 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1678 \begin_inset Text
1680 \begin_layout Plain Layout
1681 Super Game Boy
1682 \end_layout
1684 \end_inset
1685 </cell>
1686 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1687 \begin_inset Text
1689 \begin_layout Plain Layout
1691 \end_layout
1693 \end_inset
1694 </cell>
1695 </row>
1696 <row>
1697 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1698 \begin_inset Text
1700 \begin_layout Plain Layout
1701 snes_ntsc
1702 \end_layout
1704 \end_inset
1705 </cell>
1706 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1707 \begin_inset Text
1709 \begin_layout Plain Layout
1710 Super NES
1711 \end_layout
1713 \end_inset
1714 </cell>
1715 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1716 \begin_inset Text
1718 \begin_layout Plain Layout
1719 NTSC
1720 \end_layout
1722 \end_inset
1723 </cell>
1724 </row>
1725 <row>
1726 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1727 \begin_inset Text
1729 \begin_layout Plain Layout
1730 sgb_ntsc
1731 \end_layout
1733 \end_inset
1734 </cell>
1735 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1736 \begin_inset Text
1738 \begin_layout Plain Layout
1739 Super Game Boy
1740 \end_layout
1742 \end_inset
1743 </cell>
1744 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1745 \begin_inset Text
1747 \begin_layout Plain Layout
1748 NTSC
1749 \end_layout
1751 \end_inset
1752 </cell>
1753 </row>
1754 <row>
1755 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1756 \begin_inset Text
1758 \begin_layout Plain Layout
1760 \end_layout
1762 \end_inset
1763 </cell>
1764 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1765 \begin_inset Text
1767 \begin_layout Plain Layout
1768 BS-X (non-slotted)
1769 \end_layout
1771 \end_inset
1772 </cell>
1773 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1774 \begin_inset Text
1776 \begin_layout Plain Layout
1777 NTSC
1778 \end_layout
1780 \end_inset
1781 </cell>
1782 </row>
1783 <row>
1784 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1785 \begin_inset Text
1787 \begin_layout Plain Layout
1788 bsxslotted
1789 \end_layout
1791 \end_inset
1792 </cell>
1793 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1794 \begin_inset Text
1796 \begin_layout Plain Layout
1797 BS-X (slotted)
1798 \end_layout
1800 \end_inset
1801 </cell>
1802 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1803 \begin_inset Text
1805 \begin_layout Plain Layout
1806 NTSC
1807 \end_layout
1809 \end_inset
1810 </cell>
1811 </row>
1812 <row>
1813 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1814 \begin_inset Text
1816 \begin_layout Plain Layout
1817 sufamiturbo
1818 \end_layout
1820 \end_inset
1821 </cell>
1822 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1823 \begin_inset Text
1825 \begin_layout Plain Layout
1826 Sufami Turbo
1827 \end_layout
1829 \end_inset
1830 </cell>
1831 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1832 \begin_inset Text
1834 \begin_layout Plain Layout
1835 NTSC
1836 \end_layout
1838 \end_inset
1839 </cell>
1840 </row>
1841 </lyxtabular>
1843 \end_inset
1846 \end_layout
1848 \begin_layout Standard
1849 Frame rates are:
1850 \end_layout
1852 \begin_layout Standard
1853 \begin_inset Tabular
1854 <lyxtabular version="3" rows="3" columns="2">
1855 <features tabularvalignment="middle">
1856 <column alignment="center" valignment="top" width="0">
1857 <column alignment="center" valignment="top" width="0">
1858 <row>
1859 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1860 \begin_inset Text
1862 \begin_layout Plain Layout
1863 Region
1864 \end_layout
1866 \end_inset
1867 </cell>
1868 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1869 \begin_inset Text
1871 \begin_layout Plain Layout
1872 Framerate (fps)
1873 \end_layout
1875 \end_inset
1876 </cell>
1877 </row>
1878 <row>
1879 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1880 \begin_inset Text
1882 \begin_layout Plain Layout
1884 \end_layout
1886 \end_inset
1887 </cell>
1888 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1889 \begin_inset Text
1891 \begin_layout Plain Layout
1892 322445/6448
1893 \end_layout
1895 \end_inset
1896 </cell>
1897 </row>
1898 <row>
1899 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1900 \begin_inset Text
1902 \begin_layout Plain Layout
1903 NTSC
1904 \end_layout
1906 \end_inset
1907 </cell>
1908 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1909 \begin_inset Text
1911 \begin_layout Plain Layout
1912 10738636/178683
1913 \end_layout
1915 \end_inset
1916 </cell>
1917 </row>
1918 </lyxtabular>
1920 \end_inset
1923 \end_layout
1925 \begin_layout Subsection
1926 Member: port1
1927 \end_layout
1929 \begin_layout Standard
1930 Contains type of port #1 (as one line).
1931  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1932  If not present, defaults to 'gamepad'.
1933 \end_layout
1935 \begin_layout Subsection
1936 Member: port2
1937 \end_layout
1939 \begin_layout Standard
1940 Contains type of port #2 (as one line).
1941  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1942  'justifier' and 'justifiers'.
1943  If not present, defaults to 'none'.
1944 \end_layout
1946 \begin_layout Subsection
1947 Member: gamename
1948 \end_layout
1950 \begin_layout Standard
1951 Contains name of the game (as one line).
1952 \end_layout
1954 \begin_layout Subsection
1955 Member: authors
1956 \end_layout
1958 \begin_layout Standard
1959 Contains authors, one per line.
1960  Part before '|' is the full name, part after is the nickname.
1961 \end_layout
1963 \begin_layout Subsection
1964 Member: systemid
1965 \end_layout
1967 \begin_layout Standard
1968 Always 
1969 \begin_inset Quotes eld
1970 \end_inset
1972 lsnes-rr1
1973 \begin_inset Quotes erd
1974 \end_inset
1976  (one line).
1977  Used to reject other saves.
1978 \end_layout
1980 \begin_layout Subsection
1981 Member: controlsversion
1982 \end_layout
1984 \begin_layout Standard
1985 Always 
1986 \begin_inset Quotes eld
1987 \end_inset
1990 \begin_inset Quotes erd
1991 \end_inset
1993  (one line).
1994  Used to identify what controls are there.
1995 \end_layout
1997 \begin_layout Subsection
1998 Member: 
1999 \begin_inset Quotes eld
2000 \end_inset
2002 coreversion
2003 \begin_inset Quotes erd
2004 \end_inset
2007 \end_layout
2009 \begin_layout Standard
2010 Contains bsnes core version number (as one line).
2011 \end_layout
2013 \begin_layout Subsection
2014 Member: projectid
2015 \end_layout
2017 \begin_layout Standard
2018 Contains project ID (as one line).
2019  Used to identify if two movies are part of the same project.
2020 \end_layout
2022 \begin_layout Subsection
2023 Member: {rom,slota,slotb}{,xml}.sha256
2024 \end_layout
2026 \begin_layout Standard
2027 Contains SHA-256 of said ROM or ROM mapping file (as one line).
2028  Absent if corresponding file is absent.
2029 \end_layout
2031 \begin_layout Subsection
2032 Member: moviesram.<name>
2033 \end_layout
2035 \begin_layout Standard
2036 Raw binary startup SRAM of kind <name>.
2037  Only present in savestates and movies starting from SRAM.
2038 \end_layout
2040 \begin_layout Subsection
2041 Member: saveframe
2042 \end_layout
2044 \begin_layout Standard
2045 Contains frame number (as one line) of frame movie was saved on.
2046  Only present in savestates.
2047 \end_layout
2049 \begin_layout Subsection
2050 Member: lagcounter
2051 \end_layout
2053 \begin_layout Standard
2054 Current value of lag counter (as one line).
2055  Only present in savestates.
2056 \end_layout
2058 \begin_layout Subsection
2059 Member: pollcounters
2060 \end_layout
2062 \begin_layout Standard
2063 Contains poll counters (currently 100 of them), one per line.
2064  Each line is raw poll count if DRDY is set for it.
2065  Otherwise it is negative poll count minus one.
2066  Only present in savestates.
2067 \end_layout
2069 \begin_layout Subsection
2070 Member: hostmemory
2071 \end_layout
2073 \begin_layout Standard
2074 Raw binary dump of host memory.
2075  Only present in savestates.
2076 \end_layout
2078 \begin_layout Subsection
2079 Member: savestate
2080 \end_layout
2082 \begin_layout Standard
2083 The raw binary savestate itself.
2084  Savestate detection uses this file, only present in savestates.
2085 \end_layout
2087 \begin_layout Subsection
2088 Member: screenshot
2089 \end_layout
2091 \begin_layout Standard
2092 Screenshot of current frame.
2093  Only present in savestates.
2094  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
2095  data.
2096  Height of image is inferred from the width and size of data.
2097 \end_layout
2099 \begin_layout Subsection
2100 Member: sram.<name>
2101 \end_layout
2103 \begin_layout Standard
2104 Raw binary SRAM of kind <name> at time of savestate.
2105  Only present in savestates.
2106 \end_layout
2108 \begin_layout Subsection
2109 Member: input
2110 \end_layout
2112 \begin_layout Standard
2113 The actual input track, one line per subframe (blank lines are skipped).
2114 \end_layout
2116 \begin_layout Itemize
2117 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
2118  part of same frame as previous, otherwise it starts a new frame.
2119 \end_layout
2121 \begin_layout Itemize
2122 First subframe must start a new frame.
2123 \end_layout
2125 \begin_layout Standard
2126 Length of movie in frames is number of lines in input file that start a
2127  new frame.
2128 \end_layout
2130 \begin_layout Subsection
2131 Member: subtitles
2132 \end_layout
2134 \begin_layout Standard
2135 Subtitle track.
2136  Optional.
2137 \end_layout
2139 \begin_layout Itemize
2140 Each line is in form <firstframe> <numframes> <text>.
2141 \end_layout
2143 \begin_layout Itemize
2144 Linefeed is encoded as 
2145 \backslash
2146 n, backslash is encoded as 
2147 \backslash
2149 \backslash
2151 \end_layout
2153 \begin_layout Subsection
2154 Member: rerecords
2155 \end_layout
2157 \begin_layout Standard
2158 Contains textual base-10 rerecord count (as one line; emulator just writes
2159  this, it doesn't read it) + 1.
2160 \end_layout
2162 \begin_layout Subsection
2163 Member: rrdata
2164 \end_layout
2166 \begin_layout Standard
2167 This member stores set of load IDs.
2168  There is one load ID per rerecord (plus one corresponding to start of project).
2169 \end_layout
2171 \begin_layout Itemize
2172 This member constists of concatenation of records
2173 \end_layout
2175 \begin_layout Itemize
2176 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2177  IDs.
2178 \end_layout
2180 \begin_layout Itemize
2181 IDs are interpretted as 256-bit big-endian integers with warparound.
2182 \end_layout
2184 \begin_layout Itemize
2185 Initial predicted ID is all zeroes.
2186 \end_layout
2188 \begin_layout Standard
2189 Format of each record is:
2190 \end_layout
2192 \begin_layout Itemize
2193 1 byte: Opcode byte.
2194  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2195  Bit 7 is unused.
2196 \end_layout
2198 \begin_layout Itemize
2199 32-prefixlen bytes of ID.
2200 \end_layout
2202 \begin_layout Itemize
2203 countlen bytes of big-endian count (count).
2204 \end_layout
2206 \begin_layout Standard
2207 Records are processed as follows:
2208 \end_layout
2210 \begin_layout Itemize
2211 To form the first ID encoded by record, take the first prefixlen bytes predicted
2212  ID and append the read ID value to it.
2213  The result is the first ID encoded.
2214 \end_layout
2216 \begin_layout Itemize
2217 If countlen is 0, record encodes 1 ID.
2218 \end_layout
2220 \begin_layout Itemize
2221 If countlen is 1, record encodes 2+count IDs.
2222 \end_layout
2224 \begin_layout Itemize
2225 If countlen is 2, record encodes 258+count IDs.
2226 \end_layout
2228 \begin_layout Itemize
2229 If countlen is 3, record encodes 65794+count IDs.
2230 \end_layout
2232 \begin_layout Itemize
2233 The new predicted ID is the next ID after last one encoded by the record.
2234 \end_layout
2236 \begin_layout Standard
2237 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2238  by all records.
2239 \end_layout
2241 \begin_layout Subsection
2242 Member: starttime.second
2243 \end_layout
2245 \begin_layout Standard
2246 Movie starting time, second part.
2247  Epoch is Unix epoch.
2248  Default is 1,000,000,000.
2249 \end_layout
2251 \begin_layout Subsection
2252 Member: starttime.subsecond
2253 \end_layout
2255 \begin_layout Standard
2256 Movie starting time, subsecond part.
2257  Unit is CPU clocks.
2258  Default is 0.
2259 \end_layout
2261 \begin_layout Subsection
2262 Member: savetime.second
2263 \end_layout
2265 \begin_layout Standard
2266 Movie saving time, second part.
2267  Default is starttime.second.
2268  Only present in savestates.
2269 \end_layout
2271 \begin_layout Subsection
2272 Member: savetime.subsecond
2273 \end_layout
2275 \begin_layout Standard
2276 Movie saving time, subsecond part.
2277  Default is starttime.subsecond.
2278  Only present in savestates.
2279 \end_layout
2281 \begin_layout Section
2282 lsvs file format (commentary tracks)
2283 \end_layout
2285 \begin_layout Subsection
2286 Clusters
2287 \end_layout
2289 \begin_layout Itemize
2290 Each cluster is 8kB (8192 bytes) in size.
2291 \end_layout
2293 \begin_layout Itemize
2294 Cluster n starts at offset 8192*n in file.
2295 \end_layout
2297 \begin_layout Itemize
2298 The following clusters are system special:
2299 \end_layout
2301 \begin_deeper
2302 \begin_layout Itemize
2303 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2304 \end_layout
2306 \begin_layout Itemize
2307 Cluster 1 (superblock)
2308 \end_layout
2310 \end_deeper
2311 \begin_layout Subsection
2312 Cluster tables
2313 \end_layout
2315 \begin_layout Itemize
2316 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2317  last 11 bits of n).
2318 \end_layout
2320 \begin_layout Itemize
2321 This cluster table consists of 2048 4-byte big-endian integers.
2322 \end_layout
2324 \begin_layout Itemize
2325 Each entry describes a cluster in 16MB supercluster, in order.
2326 \end_layout
2328 \begin_layout Itemize
2329 The valid values for entries are:
2330 \end_layout
2332 \begin_deeper
2333 \begin_layout Itemize
2334 0x00000000: Free cluster
2335 \end_layout
2337 \begin_layout Itemize
2338 0x00000001: Last cluster in chain.
2339 \end_layout
2341 \begin_layout Itemize
2342 0xFFFFFFFF: System cluster (cluster tables and superblock)
2343 \end_layout
2345 \begin_layout Itemize
2346 (anything else): Number of next cluster in chain.
2347  Must not be multiple of 2048.
2348 \end_layout
2350 \end_deeper
2351 \begin_layout Itemize
2352 Due to limitations of the format, there can be at most 2097052 superclusters,
2353  giving maximum file size of 16TB.
2354 \end_layout
2356 \begin_layout Subsection
2357 Stream table
2358 \end_layout
2360 \begin_layout Itemize
2361 The stream table chain always starts in cluster 2.
2362 \end_layout
2364 \begin_layout Itemize
2365 Otherwise, it follows normal chaining.
2366 \end_layout
2368 \begin_layout Itemize
2369 The stream table consists of 16-byte entries:
2370 \end_layout
2372 \begin_deeper
2373 \begin_layout Itemize
2374 The first 8 bytes of entry give big-endian beginning position of stream
2375  in units of 1/48000 s.
2376 \end_layout
2378 \begin_layout Itemize
2379 The next 4 bytes of entry give big-endian beginning cluster for control
2380  data.
2381  0 here marks the entry as not present.
2382 \end_layout
2384 \begin_layout Itemize
2385 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2386 \end_layout
2388 \end_deeper
2389 \begin_layout Itemize
2390 Stream table clusters are normal clusters, following normal chaining.
2391 \end_layout
2393 \begin_layout Itemize
2394 The stream begnning position is not guarenteed unique.
2395  There can be multiple streams with the same starting position in the file.
2396 \end_layout
2398 \begin_layout Subsection
2399 Stream control data
2400 \end_layout
2402 \begin_layout Itemize
2403 The stream control data consists of entries 4 bytes each:
2404 \end_layout
2406 \begin_deeper
2407 \begin_layout Itemize
2408 The first 2 bytes of entry gives big-endian length of packet
2409 \end_layout
2411 \begin_layout Itemize
2412 The next byte of entry gives audio length of packet in units of 1/400 s.
2413 \end_layout
2415 \begin_layout Itemize
2416 The last byte is control byte.
2417 \end_layout
2419 \begin_deeper
2420 \begin_layout Itemize
2421 0 means this entry is not present and the control data ends.
2422 \end_layout
2424 \begin_layout Itemize
2425 1 is valid control entry.
2426 \end_layout
2428 \end_deeper
2429 \end_deeper
2430 \begin_layout Itemize
2431 The stream control data can also end by running into end of the readable
2432  chain.
2433 \end_layout
2435 \begin_deeper
2436 \begin_layout Itemize
2437 This happens if there happens to be exact multiple of 2048 packets in stream
2438  and number of packets is nonzero.
2439 \end_layout
2441 \end_deeper
2442 \begin_layout Itemize
2443 These clusters follow normal chaining.
2444 \end_layout
2446 \begin_layout Subsection
2447 Stream codec data
2448 \end_layout
2450 \begin_layout Itemize
2451 Stream codec data consists of raw Opus data packets packed back to back
2452  with nothing in between.
2453 \end_layout
2455 \begin_layout Itemize
2456 Warning: Due to internal limitations, this data must reside in the first
2457  65536 superclusters (that is, the first 1TB of the file).
2458 \end_layout
2460 \begin_layout Subsection
2461 Superblock
2462 \end_layout
2464 \begin_layout Itemize
2465 The superblock is stored in cluster 1.
2467 \end_layout
2469 \begin_layout Itemize
2470 The first 11 bytes are 
2471 \begin_inset Quotes eld
2472 \end_inset
2474 sefs-magic
2475 \begin_inset Quotes erd
2476 \end_inset
2478 <NUL>.
2479 \end_layout
2481 \begin_layout Itemize
2482 The rest are unused.
2483 \end_layout
2485 \begin_layout Itemize
2486 This cluster 1 is marked as system special.
2487 \end_layout
2489 \begin_layout Section
2490 Known ROM extensions
2491 \end_layout
2493 \begin_layout Itemize
2494 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2495 \end_layout
2497 \begin_layout Itemize
2498 DMG cartridge ROMs: dmg, gb.
2499 \end_layout
2501 \begin_layout Itemize
2502 GBC cartridge ROMs: cgb, gbc.
2503 \end_layout
2505 \begin_layout Section
2506 Gamepack files
2507 \end_layout
2509 \begin_layout Itemize
2510 The first line must be: 
2511 \begin_inset Quotes eld
2512 \end_inset
2514 [GAMEPACK FILE]
2515 \begin_inset Quotes erd
2516 \end_inset
2519 \end_layout
2521 \begin_layout Itemize
2522 There is one needed line: 
2523 \begin_inset Quotes eld
2524 \end_inset
2526 type <systype>
2527 \begin_inset Quotes erd
2528 \end_inset
2531  This sets system type to <systype>.
2532  The following system types are valid:
2533 \end_layout
2535 \begin_deeper
2536 \begin_layout Itemize
2537 snes (SNES)
2538 \end_layout
2540 \begin_layout Itemize
2541 bsx (BS-X non-slotted)
2542 \end_layout
2544 \begin_layout Itemize
2545 bsxslotted (BS-X slotted)
2546 \end_layout
2548 \begin_layout Itemize
2549 sufamiturbo (Sufami Turbo)
2550 \end_layout
2552 \begin_layout Itemize
2553 sgb (Super Game Boy)
2554 \end_layout
2556 \begin_layout Itemize
2557 dmg (Game Boy)
2558 \end_layout
2560 \begin_layout Itemize
2561 gbc (Game Boy Color)
2562 \end_layout
2564 \begin_layout Itemize
2565 gbc_gba (Game Boy Color with GBA initial register values)
2566 \end_layout
2568 \end_deeper
2569 \begin_layout Itemize
2570 Optionally a region can be specified: 
2571 \begin_inset Quotes eld
2572 \end_inset
2574 region <region>
2575 \begin_inset Quotes erd
2576 \end_inset
2579  The following values are valid:
2580 \end_layout
2582 \begin_deeper
2583 \begin_layout Itemize
2584 autodetect (Autodetect region: snes and sgb only)
2585 \end_layout
2587 \begin_layout Itemize
2588 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2589 \end_layout
2591 \begin_layout Itemize
2592 pal (PAL: snes, sgb)
2593 \end_layout
2595 \begin_layout Itemize
2596 world (World: dmg, gbc, gbc_gba)
2597 \end_layout
2599 \end_deeper
2600 \begin_layout Itemize
2601 ROM images are loaded as: 
2602 \begin_inset Quotes eld
2603 \end_inset
2605 rom <type> <file>
2606 \begin_inset Quotes erd
2607 \end_inset
2610  The following types are valid:
2611 \end_layout
2613 \begin_deeper
2614 \begin_layout Itemize
2615 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2616  BIOS in bsx, bsxslotted, sufamiturbo)
2617 \end_layout
2619 \begin_layout Itemize
2620 bsx (Cartridge ROM in bsx, bsxslotted)
2621 \end_layout
2623 \begin_layout Itemize
2624 slot-a (Cartridge ROM in sufamiturbo)
2625 \end_layout
2627 \begin_layout Itemize
2628 slot-b (Cartridge ROM in sufamiturbo)
2629 \end_layout
2631 \end_deeper
2632 \begin_layout Itemize
2633 ROM markup can be loaded as: 
2634 \begin_inset Quotes eld
2635 \end_inset
2637 xml <type> <file>
2638 \begin_inset Quotes erd
2639 \end_inset
2642  The types valid are the same as for ROMs.
2643 \end_layout
2645 \begin_layout Itemize
2646 Patches can be loaded as 
2647 \begin_inset Quotes eld
2648 \end_inset
2650 patch[<offset>] <type> <file>
2651 \begin_inset Quotes erd
2652 \end_inset
2655  The types are the same as for ROMs.
2656 \end_layout
2658 \begin_deeper
2659 \begin_layout Itemize
2660 Offset is given in form [+-]<number>.
2661  Usually offset is either +0 or -512.
2662 \end_layout
2664 \begin_layout Itemize
2665 Default offset is +0.
2666 \end_layout
2668 \end_deeper
2669 \begin_layout Subsection
2670 Example:
2671 \end_layout
2673 \begin_layout LyX-Code
2674 [GAMEPACK FILE]
2675 \end_layout
2677 \begin_layout LyX-Code
2678 type snes
2679 \end_layout
2681 \begin_layout LyX-Code
2682 rom rom speedygonzales.sfc
2683 \end_layout
2685 \begin_layout LyX-Code
2686 patch-512 rom sonicthehedgehog.ips
2687 \end_layout
2689 \begin_layout Subsection
2690 Example 2:
2691 \end_layout
2693 \begin_layout LyX-Code
2694 [GAMEPACK FILE]
2695 \end_layout
2697 \begin_layout LyX-Code
2698 type sgb
2699 \end_layout
2701 \begin_layout LyX-Code
2702 rom rom supergameboy.sfc
2703 \end_layout
2705 \begin_layout LyX-Code
2706 rom dmg megamanV.dmg
2707 \end_layout
2709 \begin_layout Section
2710 Quick'n'dirty encode guide
2711 \end_layout
2713 \begin_layout Enumerate
2714 Start the emulator and load the ROM and movie file.
2715 \end_layout
2717 \begin_layout Enumerate
2718 Set large AVI option 'set-setting avi-large on'
2719 \end_layout
2721 \begin_layout Enumerate
2722 Enable dumping 'dump-avi tmpdump' 
2723 \end_layout
2725 \begin_layout Enumerate
2726 Unpause and let it run until you want to end dumping.
2727 \end_layout
2729 \begin_layout Enumerate
2730 Close the emulator (closing the window is the easiest way).
2731  Or use 'end-avi'.
2732 \end_layout
2734 \begin_layout Enumerate
2735 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2736  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2737 \end_layout
2739 \begin_layout Enumerate
2740 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2741 \end_layout
2743 \begin_layout Enumerate
2744 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2745  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2746 \end_layout
2748 \begin_layout Enumerate
2749 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2750  Now final.mkv contains quick'n'dirty encode.
2751 \end_layout
2753 \begin_layout Section
2754 Axis configurations for some gamepad types:
2755 \end_layout
2757 \begin_layout Subsection
2758 XBox360 controller:
2759 \end_layout
2761 \begin_layout Standard
2762 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2763 \end_layout
2765 \begin_layout LyX-Code
2766 set-axis joystick0axis2 pressure-+
2767 \end_layout
2769 \begin_layout LyX-Code
2770 set-axis joystick0axis5 pressure-+
2771 \end_layout
2773 \begin_layout Itemize
2774 This is needed for SDL only.
2775  EVDEV sets those types correctly.
2776 \end_layout
2778 \begin_layout Subsection
2779 PS3 
2780 \begin_inset Quotes eld
2781 \end_inset
2783 sixaxis
2784 \begin_inset Quotes erd
2785 \end_inset
2787  controller:
2788 \end_layout
2790 \begin_layout Standard
2791 Axes 8-19 should be disabled.
2792 \end_layout
2794 \begin_layout LyX-Code
2795 set-axis joystick0axis8 disabled
2796 \end_layout
2798 \begin_layout LyX-Code
2799 set-axis joystick0axis9 disabled
2800 \end_layout
2802 \begin_layout LyX-Code
2803 set-axis joystick0axis10 disabled
2804 \end_layout
2806 \begin_layout LyX-Code
2807 set-axis joystick0axis11 disabled
2808 \end_layout
2810 \begin_layout LyX-Code
2811 set-axis joystick0axis12 disabled
2812 \end_layout
2814 \begin_layout LyX-Code
2815 set-axis joystick0axis13 disabled
2816 \end_layout
2818 \begin_layout LyX-Code
2819 set-axis joystick0axis14 disabled
2820 \end_layout
2822 \begin_layout LyX-Code
2823 set-axis joystick0axis15 disabled
2824 \end_layout
2826 \begin_layout LyX-Code
2827 set-axis joystick0axis16 disabled
2828 \end_layout
2830 \begin_layout LyX-Code
2831 set-axis joystick0axis17 disabled
2832 \end_layout
2834 \begin_layout LyX-Code
2835 set-axis joystick0axis18 disabled
2836 \end_layout
2838 \begin_layout LyX-Code
2839 set-axis joystick0axis19 disabled
2840 \end_layout
2842 \begin_layout Section
2843 Errata:
2844 \end_layout
2846 \begin_layout Subsection
2847 Problems from BSNES core:
2848 \end_layout
2850 \begin_layout Itemize
2851 The whole pending save stuff.
2852 \end_layout
2854 \begin_layout Itemize
2855 It is slow (especially accuracy).
2856 \end_layout
2858 \begin_layout Itemize
2859 Firmwares can't be loaded from ZIP archives.
2860 \end_layout
2862 \begin_layout Subsection
2863 Other problems:
2864 \end_layout
2866 \begin_layout Itemize
2867 Modifiers don't work with pseudo-keys.
2868 \end_layout
2870 \begin_layout Itemize
2871 Audio for last dumped frame is not itself dumped.
2872 \end_layout
2874 \begin_layout Itemize
2875 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2876 \end_layout
2878 \end_body
2879 \end_document