Specialize (D)BITMAP:sample_texture when s is power of two
[lsnes.git] / manual.lyx
blobe107d374daa51ad8352a7e9e65cb670cc50ba043
1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
2 \lyxformat 474
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_math auto
16 \font_default_family default
17 \use_non_tex_fonts false
18 \font_sc false
19 \font_osf false
20 \font_sf_scale 100
21 \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_package amsmath 1
32 \use_package amssymb 1
33 \use_package cancel 1
34 \use_package esint 1
35 \use_package mathdots 1
36 \use_package mathtools 1
37 \use_package mhchem 1
38 \use_package stackrel 1
39 \use_package stmaryrd 1
40 \use_package undertilde 1
41 \cite_engine basic
42 \cite_engine_type default
43 \biblio_style plain
44 \use_bibtopic false
45 \use_indices false
46 \paperorientation portrait
47 \suppress_date false
48 \justification true
49 \use_refstyle 1
50 \index Hakusana
51 \shortcut idx
52 \color #008000
53 \end_index
54 \secnumdepth 3
55 \tocdepth 3
56 \paragraph_separation indent
57 \paragraph_indentation default
58 \quotes_language english
59 \papercolumns 1
60 \papersides 1
61 \paperpagestyle default
62 \tracking_changes false
63 \output_changes false
64 \html_math_output 0
65 \html_css_as_file 0
66 \html_be_strict false
67 \end_header
69 \begin_body
71 \begin_layout Section
72 Introduction
73 \end_layout
75 \begin_layout Standard
76 lsnes is SNES rerecording emulator based on bsnes core.
77 \end_layout
79 \begin_layout Section
80 Dependencies
81 \end_layout
83 \begin_layout Enumerate
84 bsnes libsnes (for bsnes SNES core)
85 \end_layout
87 \begin_deeper
88 \begin_layout Enumerate
89 v084-v087 (v084 or v085 for delayreset support)
90 \end_layout
92 \begin_layout Enumerate
93 accuracy or compatiblity core with debugger enabled.
94 \end_layout
96 \begin_layout Enumerate
97 Patched version (using included 7 patches)
98 \end_layout
100 \end_deeper
101 \begin_layout Enumerate
102 gambatte (for gambatte core)
103 \end_layout
105 \begin_deeper
106 \begin_layout Enumerate
107 SVN r320, r358 or r364
108 \end_layout
110 \begin_layout Enumerate
111 Patched with included patches
112 \end_layout
114 \end_deeper
115 \begin_layout Enumerate
116 Zlib
117 \end_layout
119 \begin_layout Enumerate
120 boost_iostreams
121 \end_layout
123 \begin_layout Enumerate
124 boost_filesystem
125 \end_layout
127 \begin_layout Enumerate
128 boost_thread (if native std::thread is not available)
129 \end_layout
131 \begin_layout Enumerate
132 libsdl (SDL only)
133 \end_layout
135 \begin_layout Enumerate
136 sdlmain (SDL only, part of SDL)
137 \end_layout
139 \begin_layout Enumerate
140 boost_conversion (this is header-only library)
141 \end_layout
143 \begin_layout Enumerate
144 libswscale (wxwidgets graphics only)
145 \end_layout
147 \begin_layout Enumerate
148 Portaudio (portaudio sound only)
149 \end_layout
151 \begin_layout Enumerate
152 libao (libao sound only)
153 \end_layout
155 \begin_layout Enumerate
156 Lua version 5.1.X or 5.2.X
157 \end_layout
159 \begin_layout Enumerate
160 G++ 4.6 or 4.7
161 \end_layout
163 \begin_layout Enumerate
164 libopus (optional, for commentary track tool)
165 \end_layout
167 \begin_layout Section
168 Building
169 \end_layout
171 \begin_layout Itemize
172 Copy bsnes sources (the bsnes subdirectory) to subdirectory 'bsnes' (for
173  bsnes core).
174 \end_layout
176 \begin_layout Itemize
177 Copy gambatte sources to subdirectory 'gambatte' (for gambatte core).
178 \end_layout
180 \begin_layout Itemize
181 Patch the bsnes sources with included patches (directory 'bsnes-patches/<version
182 >', bsnes core)
183 \end_layout
185 \begin_layout Itemize
186 Patch the gambatte sources with included patches (directory 'gambatte-patches/<v
187 ersion>', gambatte core)
188 \end_layout
190 \begin_layout Itemize
191 Edit options.build (or copy of that file)
192 \end_layout
194 \begin_layout Itemize
195 Run make (passing 'OPTIONS=<filename>' if using something else than options.build
197 \end_layout
199 \begin_layout Section
200 Command line options
201 \end_layout
203 \begin_layout Subsection
204 Wxwidgets options
205 \end_layout
207 \begin_layout Subsubsection
208 --rom=<file>
209 \end_layout
211 \begin_layout Standard
212 Load <file> as ROM.
213 \end_layout
215 \begin_layout Subsubsection
216 <file>
217 \end_layout
219 \begin_layout Standard
220 Load <file> as ROM.
221 \end_layout
223 \begin_layout Subsubsection
224 --load=<file>
225 \end_layout
227 \begin_layout Standard
228 Load <file> as movie or savestate file on startup.
229 \end_layout
231 \begin_layout Subsubsection
232 --settings
233 \end_layout
235 \begin_layout Standard
236 Instead of starting the emulator, only display the settings.
237 \end_layout
239 \begin_layout Subsubsection
240 --pluginmanager
241 \end_layout
243 \begin_layout Standard
244 Instead of starting the emulator, display the plugin manager (useful to
245  disable some plugin that causes emulator to crash on startup)
246 \end_layout
248 \begin_layout Subsubsection
249 --lua=<file>
250 \end_layout
252 \begin_layout Standard
253 Run this Lua file on startup
254 \end_layout
256 \begin_layout Subsection
257 dump options (lsnes-dumpavi only)
258 \end_layout
260 \begin_layout Subsubsection
261 --rom=<file>
262 \end_layout
264 \begin_layout Standard
265 Load <file> as ROM.
266  Required.
267 \end_layout
269 \begin_layout Subsubsection
270 <filename>
271 \end_layout
273 \begin_layout Standard
274 Load <filename> as movie or savestate file on startup.
275  Required.
276 \end_layout
278 \begin_layout Subsubsection
279 --dumper=<dumper>
280 \end_layout
282 \begin_layout Standard
283 Set the dumper to use (required).
284  Use 'list' for listing of known dumpers.
285 \end_layout
287 \begin_layout Subsubsection
288 --firmware-path=<path>
289 \end_layout
291 \begin_layout Standard
292 Set path to look for firmware.
293 \end_layout
295 \begin_layout Subsubsection
296 --mode=<mode>
297 \end_layout
299 \begin_layout Standard
300 Set the mode to use (required for dumpers with multiple modes, forbidden
301  otherwise).
302  Use 'list' for known modes.
303 \end_layout
305 \begin_layout Subsubsection
306 --prefix=<prefix>
307 \end_layout
309 \begin_layout Standard
310 Set dump prefix.
311  Default is 
312 \begin_inset Quotes eld
313 \end_inset
315 avidump
316 \begin_inset Quotes erd
317 \end_inset
320 \end_layout
322 \begin_layout Subsubsection
323 --option=<name>=<value>
324 \end_layout
326 \begin_layout Standard
327 Set option <name> to value <value>.
328 \end_layout
330 \begin_layout Subsubsection
331 --length=<length>
332 \end_layout
334 \begin_layout Standard
335 Set number of frames to dump.
336  Mandatory, unless --overdump-length is specified.
337 \end_layout
339 \begin_layout Subsubsection
340 --overdump-length=<length>
341 \end_layout
343 \begin_layout Standard
344 Set number of frames to dump after movie end.
345  Mutually exclusive with --length.
346 \end_layout
348 \begin_layout Subsubsection
349 --lua=<script>
350 \end_layout
352 \begin_layout Standard
353 Run specified lua script (lsnes-dumpavi does not have initialization files).
354 \end_layout
356 \begin_layout Subsubsection
357 --load-library=<library>
358 \end_layout
360 \begin_layout Standard
361 Load the specified shared object / dynamic library / dynamic link library.
362 \end_layout
364 \begin_layout Subsection
365 lsnes settings directory
366 \end_layout
368 \begin_layout Standard
369 The lsnes settings directory is (in order of decreasing perference):
370 \end_layout
372 \begin_layout Itemize
373 Windows: %APPDATA%
374 \backslash
375 lsnes (if %APPDATA% exists)
376 \end_layout
378 \begin_layout Itemize
379 Unix: $XDG_CONFIG_HOME/lsnes (if $XDG_CONFIG_HOME exists)
380 \end_layout
382 \begin_layout Itemize
383 Unix: $HOME/.config/lsnes (if $HOME exists)
384 \end_layout
386 \begin_layout Itemize
387 All: .
388  (fallback default).
389 \end_layout
391 \begin_layout Standard
392 If leading directories do not exist, attempt to create them is made.
393 \end_layout
395 \begin_layout Section
396 Internal commands
397 \end_layout
399 \begin_layout Itemize
400 Commands beginning with '*' invoke the corresponding command without alias
401  expansion.
402 \end_layout
404 \begin_layout Itemize
405 If command starts with '+' (after possible '*'), the command is executed
406  as-is when button is pressed, and when button is released, it is executed
407  with '+' replaced by '-'.
408 \end_layout
410 \begin_layout Itemize
411 Commands without '+' execute only on negative edge (release).
412 \end_layout
414 \begin_layout Subsection
415 run-script <script>
416 \end_layout
418 \begin_layout Standard
419 Run <script> as if commands were entered on the command line.
420 \end_layout
422 \begin_layout Subsection
423 Memory manipulation
424 \end_layout
426 \begin_layout Itemize
427 <address> can be one of:
428 \end_layout
430 \begin_deeper
431 \begin_layout Itemize
432 Decimal number
433 \end_layout
435 \begin_layout Itemize
436 Hexadecimal number (prefixed with 0x)
437 \end_layout
439 \begin_layout Itemize
440 <memarea>+<hexoffset> (no 0x prefix for offset).
441 \end_layout
443 \end_deeper
444 \begin_layout Standard
445 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
446  with '-') decimal.
447 \end_layout
449 \begin_layout Standard
450 The available element <sizes> are:
451 \end_layout
453 \begin_layout Itemize
454 byte: 1 byte
455 \end_layout
457 \begin_layout Itemize
458 word: 2 bytes
459 \end_layout
461 \begin_layout Itemize
462 hword: 3 bytes
463 \end_layout
465 \begin_layout Itemize
466 dword: 4 bytes
467 \end_layout
469 \begin_layout Itemize
470 qword: 8 bytes
471 \end_layout
473 \begin_layout Itemize
474 float: 4 bytes (floating-point)
475 \end_layout
477 \begin_layout Itemize
478 double: 8 bytes (floating-point)
479 \end_layout
481 \begin_layout Standard
482 When reading RAM and ROM, multi-byte reads/writes are big-endian.
483  When dealing with DSP memory, multi-byte reads/writes are native-endian
484  (do not use operand sizes exceeding DSP bitness, except dword is OK for
485  24-bit memory).
486 \end_layout
488 \begin_layout Subsubsection
489 read-<size> <address>
490 \end_layout
492 \begin_layout Standard
493 Read the value of byte in <address>.
494 \end_layout
496 \begin_layout Subsubsection
497 read-s<size> <address>
498 \end_layout
500 \begin_layout Standard
501 Read the value of signed byte in <address>.
502 \end_layout
504 \begin_layout Subsubsection
505 write-<size> <address> <value>
506 \end_layout
508 \begin_layout Standard
509 Write <value> to byte in address <address>.
510 \end_layout
512 \begin_layout Subsection
513 Main commands
514 \end_layout
516 \begin_layout Standard
517 These commands are not available in lsnesrc, but are available after ROM
518  has been loaded.
519 \end_layout
521 \begin_layout Subsubsection
522 quit-emulator
523 \end_layout
525 \begin_layout Standard
526 Quits the emulator.
527 \end_layout
529 \begin_layout Subsubsection
530 pause-emulator
531 \end_layout
533 \begin_layout Standard
534 Toggle paused/unpaused
535 \end_layout
537 \begin_layout Subsubsection
538 +advance-frame 
539 \end_layout
541 \begin_layout Standard
542 Advance frame.
543  If the button is still held after configurable timeout expires, game unpauses
544  for the duration frame advance is held.
545 \end_layout
547 \begin_layout Subsubsection
548 +advance-poll 
549 \end_layout
551 \begin_layout Standard
552 Advance subframe.
553  If the button is still held after configurable timeout expires, game unpauses
554  for the duration frame advance is held.
555 \end_layout
557 \begin_layout Subsubsection
558 advance-skiplag 
559 \end_layout
561 \begin_layout Standard
562 Skip to first poll in frame after current.
563 \end_layout
565 \begin_layout Subsubsection
566 reset 
567 \end_layout
569 \begin_layout Standard
570 Reset the SNES after this frame.
571 \end_layout
573 \begin_layout Subsubsection
574 load <filename> 
575 \end_layout
577 \begin_layout Standard
578 Load savestate <filename> in current mode.
579 \end_layout
581 \begin_layout Subsubsection
582 load-state <filename> 
583 \end_layout
585 \begin_layout Standard
586 Load savestate <filename> in readwrite mode.
587 \end_layout
589 \begin_layout Subsubsection
590 load-readonly <filename> 
591 \end_layout
593 \begin_layout Standard
594 Load savestate <filename> in readonly mode.
595 \end_layout
597 \begin_layout Subsubsection
598 load-preserve <filename> 
599 \end_layout
601 \begin_layout Standard
602 Load savestate <filename> in readonly mode, preserving current events.
603 \end_layout
605 \begin_layout Subsubsection
606 load-movie <filename> 
607 \end_layout
609 \begin_layout Standard
610 Load savestate <filename>, ignoring save part in readonly mode.
611 \end_layout
613 \begin_layout Subsubsection
614 save-state <filename> 
615 \end_layout
617 \begin_layout Standard
618 Save system state to <filename> as soon as possible.
619 \end_layout
621 \begin_layout Subsubsection
622 save-movie <filename> 
623 \end_layout
625 \begin_layout Standard
626 Save movie to <filename>.
627 \end_layout
629 \begin_layout Subsubsection
630 set-rwmode 
631 \end_layout
633 \begin_layout Standard
634 Set recording mode.
635 \end_layout
637 \begin_layout Subsubsection
638 set-romode 
639 \end_layout
641 \begin_layout Standard
642 Set playback mode
643 \end_layout
645 \begin_layout Subsubsection
646 toggle-rwmode 
647 \end_layout
649 \begin_layout Standard
650 Toggle between playback and recording modes.
651 \end_layout
653 \begin_layout Subsubsection
654 test-1, test-2, test-3
655 \end_layout
657 \begin_layout Standard
658 Internal test commands.
659  Don't use.
660 \end_layout
662 \begin_layout Subsubsection
663 take-screenshot <filename> 
664 \end_layout
666 \begin_layout Standard
667 Save screenshot to <filename>.
668 \end_layout
670 \begin_layout Subsubsection
671 +controller <class>-<#>-<button>
672 \end_layout
674 \begin_layout Standard
675 Press button <button> on controller <num> of class <class>.
676 \end_layout
678 \begin_layout Itemize
679 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
680  ext0, ext1, ext2, ext3
681 \end_layout
683 \begin_layout Itemize
684 Class 'mouse': L, R
685 \end_layout
687 \begin_layout Itemize
688 Class 'superscope': trigger, cursor, turbo, pause
689 \end_layout
691 \begin_layout Itemize
692 Class 'justifier': trigger, start
693 \end_layout
695 \begin_layout Itemize
696 Class 'gb': A, B, select, start, up, down, left, right
697 \end_layout
699 \begin_layout Subsubsection
700 hold-controller <class>-<#>-<button>
701 \end_layout
703 \begin_layout Standard
704 Hold/unhold button <button> on controller <num> of class <class>.
705 \end_layout
707 \begin_layout Subsubsection
708 type-controller <class>-<#>-<button>
709 \end_layout
711 \begin_layout Standard
712 Hold/unhold button <button> on controller <num> of class <class> for the
713  next frame.
714  See +controller for button names.
715 \end_layout
717 \begin_layout Standard
718 Cauntion: Does not work properly if outside frame advance.
719 \end_layout
721 \begin_layout Subsubsection
722 +autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
723 \end_layout
725 \begin_layout Standard
726 Start autofire.
727  If duty is not specified, defaults to 1.
728  If <cyclelen> is not specified, defaults to 2.
729 \end_layout
731 \begin_layout Subsubsection
732 -autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
733 \end_layout
735 \begin_layout Standard
736 End autofire.
737 \end_layout
739 \begin_layout Subsubsection
740 autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
741 \end_layout
743 \begin_layout Standard
744 Toggle autofire.
745  If autofire is turned on, specified cycle is used.
746 \end_layout
748 \begin_layout Subsubsection
749 designate-position <class>-<#>-analog<n>
750 \end_layout
752 \begin_layout Standard
753 Designate position for analog pair.
754  <n> is only there if there are multiple axis pairs.
755 \end_layout
757 \begin_layout Subsubsection
758 repaint
759 \end_layout
761 \begin_layout Standard
762 Force a repaint.
763 \end_layout
765 \begin_layout Subsubsection
766 toggle-pause-on-end
767 \end_layout
769 \begin_layout Standard
770 Toggle pause on end flag.
771 \end_layout
773 \begin_layout Subsubsection
774 set-pause-on-end
775 \end_layout
777 \begin_layout Standard
778 Set pause on end flag.
779 \end_layout
781 \begin_layout Subsubsection
782 clear-pause-on-end
783 \end_layout
785 \begin_layout Standard
786 Clear pause on end flag.
787 \end_layout
789 \begin_layout Subsubsection
790 action <action> [<parameters>]
791 \end_layout
793 \begin_layout Standard
794 Run specified core action.
795 \end_layout
797 \begin_layout Subsection
798 Save jukebox 
799 \end_layout
801 \begin_layout Subsubsection
802 cycle-jukebox-backward
803 \end_layout
805 \begin_layout Standard
806 Cycle save jukebox backwards.
807 \end_layout
809 \begin_layout Subsubsection
810 cycle-jukebox-forward
811 \end_layout
813 \begin_layout Standard
814 Cycle save jukebox forwards
815 \end_layout
817 \begin_layout Subsubsection
818 set-jukebox-slot <slot>
819 \end_layout
821 \begin_layout Standard
822 Set current jukebox slot
823 \end_layout
825 \begin_layout Subsubsection
826 load-jukebox
827 \end_layout
829 \begin_layout Standard
830 Do load from jukebox (current mode).
831 \end_layout
833 \begin_layout Subsubsection
834 save-jukebox
835 \end_layout
837 \begin_layout Standard
838 Do state save to jukebox.
839 \end_layout
841 \begin_layout Subsection
842 Slot branches
843 \end_layout
845 \begin_layout Subsubsection
846 list-branches
847 \end_layout
849 \begin_layout Standard
850 List all branches
851 \end_layout
853 \begin_layout Subsubsection
854 create-branch <pid> <name>
855 \end_layout
857 \begin_layout Standard
858 Create a new branch, with <pid> as parent and <name> as name.
859 \end_layout
861 \begin_layout Subsubsection
862 rename-branch <id> <name>
863 \end_layout
865 \begin_layout Standard
866 Rename branch <id> to <name>.
867 \end_layout
869 \begin_layout Subsubsection
870 reparent-branch <id> <pid>
871 \end_layout
873 \begin_layout Standard
874 Set parent of branch <id> to <pid>.
875 \end_layout
877 \begin_layout Subsubsection
878 set-branch <id>
879 \end_layout
881 \begin_layout Standard
882 Set current branch to <id>.
883 \end_layout
885 \begin_layout Subsubsection
886 delete-branch <id>
887 \end_layout
889 \begin_layout Standard
890 Delete branch <id>.
891 \end_layout
893 \begin_layout Standard
895 \end_layout
897 \begin_layout Subsection
898 Lua 
899 \end_layout
901 \begin_layout Subsubsection
902 evaluate-lua <luacode>
903 \end_layout
905 \begin_layout Standard
906 Run Lua code <luacode> using built-in Lua interpretter.
907 \end_layout
909 \begin_layout Subsubsection
910 L <luacode>
911 \end_layout
913 \begin_layout Standard
914 Synonym for evaluate-lua.
915 \end_layout
917 \begin_layout Subsubsection
918 run-lua <script>
919 \end_layout
921 \begin_layout Standard
922 Run specified lua file using built-in Lua interpretter.
923 \end_layout
925 \begin_layout Subsubsection
926 reset-lua
927 \end_layout
929 \begin_layout Standard
930 Clear the Lua VM state and restore to factory defaults.
931 \end_layout
933 \begin_layout Subsection
934 Sound 
935 \end_layout
937 \begin_layout Subsubsection
938 enable-sound <on/off> 
939 \end_layout
941 \begin_layout Standard
942 Enable/Disable sound.
943 \end_layout
945 \begin_layout Subsection
946 Misc.
947 \end_layout
949 \begin_layout Subsubsection
950 load-rom <file>
951 \end_layout
953 \begin_layout Standard
954 Loads ROM (format autodetected) from <file>.
955 \end_layout
957 \begin_layout Subsubsection
958 reload-rom
959 \end_layout
961 \begin_layout Standard
962 Reloads the main ROM image from.
963 \end_layout
965 \begin_layout Subsubsection
966 +tangent
967 \end_layout
969 \begin_layout Standard
970 Tangent for recording voice for commentary track.
971  While pressed, record a stream.
972 \end_layout
974 \begin_layout Subsubsection
975 advance-subframe-timeout
976 \end_layout
978 \begin_layout Standard
979 Subframe advance timeout in milliseconds.
980  Default is 100.
981 \end_layout
983 \begin_layout Subsubsection
984 set-speed <speed>
985 \end_layout
987 \begin_layout Standard
988 Set the speed multiplier.
989  <speed> may be positive number (1 is normal speed) or 
990 \begin_inset Quotes eld
991 \end_inset
993 turbo
994 \begin_inset Quotes erd
995 \end_inset
997  for turbo.
998 \end_layout
1000 \begin_layout Section
1001 Settings
1002 \end_layout
1004 \begin_layout Subsection
1005 Core settings
1006 \end_layout
1008 \begin_layout Subsection
1009 AVI dumper settings
1010 \end_layout
1012 \begin_layout Subsubsection
1013 avi-large
1014 \end_layout
1016 \begin_layout Standard
1017 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1018  outputs.
1019 \end_layout
1021 \begin_layout Subsubsection
1022 avi-left-border
1023 \end_layout
1025 \begin_layout Standard
1026 AVI dumper: Set the default left border thickness (unless lua overrides)
1027  for dumps.
1028  Range 0-8191.
1029  Default is 0.
1030 \end_layout
1032 \begin_layout Subsubsection
1033 avi-right-border
1034 \end_layout
1036 \begin_layout Standard
1037 AVI dumper: Set the default right border thickness (unless lua overrides)
1038  for dumps.
1039  Range 0-8191.
1040  Default is 0.
1041 \end_layout
1043 \begin_layout Subsubsection
1044 avi-top-border
1045 \end_layout
1047 \begin_layout Standard
1048 AVI dumper: Set the default top border thickness (unless lua overrides)
1049  for dumps.
1050  Range 0-8191.
1051  Default is 0.
1052 \end_layout
1054 \begin_layout Subsubsection
1055 avi-bottom-border
1056 \end_layout
1058 \begin_layout Standard
1059 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1060  for dumps.
1061  Range 0-8191.
1062  Default is 0.
1063 \end_layout
1065 \begin_layout Subsubsection
1066 avi-maxframes
1067 \end_layout
1069 \begin_layout Standard
1070 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1071  Range 0-999999999.
1072  Default is 0.
1073 \end_layout
1075 \begin_layout Subsubsection
1076 avi-compresison
1077 \end_layout
1079 \begin_layout Standard
1080 AVI dumper: Compression level (0-18).
1081 \end_layout
1083 \begin_layout Itemize
1084 Compression levels 10 and above are not compatible with stock CSCD codec.
1085 \end_layout
1087 \begin_layout Itemize
1088 Recomended level is 7.
1089 \end_layout
1091 \begin_layout Subsubsection
1092 avi-soundrate
1093 \end_layout
1095 \begin_layout Standard
1096 AVI dumper: Set method of determining the sound rate.
1097 \end_layout
1099 \begin_layout Itemize
1100 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1101  128, 176.4 and 192 kHz.
1102 \end_layout
1104 \begin_layout Itemize
1105 1: Round down to nearest integer.
1106 \end_layout
1108 \begin_layout Itemize
1109 2: Round up to nearest ingeter.
1110 \end_layout
1112 \begin_layout Itemize
1113 3: Multiply by denominator.
1114 \end_layout
1116 \begin_layout Itemize
1117 4: High quality 44.1kHz (SRC needed).
1118 \end_layout
1120 \begin_layout Itemize
1121 5: High quality 48kHz (SRC needed).
1122 \end_layout
1124 \begin_layout Subsection
1125 JMD options
1126 \end_layout
1128 \begin_layout Subsubsection
1129 jmd-compression
1130 \end_layout
1132 \begin_layout Standard
1133 JMD dumper: Compression level (0-9).
1134 \end_layout
1136 \begin_layout Section
1137 Movie editor
1138 \end_layout
1140 \begin_layout Itemize
1141 The editor edits in-memory movie.
1142 \end_layout
1144 \begin_layout Itemize
1145 Because past can't be edited and readwrite mode doesn't allow future, editing
1146  only works in 
1147 \emph on
1148 read only
1149 \emph default
1150  mode.
1151 \end_layout
1153 \begin_layout Itemize
1154 Keyboard triggers the normal hotkeys and bindings.
1155 \end_layout
1157 \begin_layout Subsection
1158 Left button actions
1159 \end_layout
1161 \begin_layout Itemize
1162 Clicking on cell in future (indicated by lack of redish background) toggles
1163  it (if it is a button) or prompts for a value (if it is an axis)
1164 \end_layout
1166 \begin_layout Itemize
1167 Dragging vertically toggles sequence of buttons or changes a sequence of
1168  axis values.
1169 \end_layout
1171 \begin_layout Subsection
1172 Right button actions
1173 \end_layout
1175 \begin_layout Standard
1176 The right mouse button pops up a context-sensitive menu:
1177 \end_layout
1179 \begin_layout Itemize
1180 Toggle <something>: Toggle this button
1181 \end_layout
1183 \begin_layout Itemize
1184 Change <something>: Change this axis value
1185 \end_layout
1187 \begin_layout Itemize
1188 Insert frame after: Insert a frame after this frame
1189 \end_layout
1191 \begin_layout Itemize
1192 Append frame: Append a frame to movie
1193 \end_layout
1195 \begin_layout Itemize
1196 Append frames: Append specified number of frames to movie
1197 \end_layout
1199 \begin_layout Itemize
1200 Delete frame: Delete this frame
1201 \end_layout
1203 \begin_layout Itemize
1204 Delete subframe: Delete this subframe
1205 \end_layout
1207 \begin_layout Itemize
1208 Truncate movie: Delete this subframe and everything after it.
1209 \end_layout
1211 \begin_layout Itemize
1212 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1213 \end_layout
1215 \begin_layout Itemize
1216 Scroll to current frame: Scroll the display to current position
1217 \end_layout
1219 \begin_layout Itemize
1220 Run to frame: Prompts for frame and runs the emulation to that frame.
1221 \end_layout
1223 \begin_layout Itemize
1224 Change number of lines visible: Change the height of the movie display (1
1225  to 255).
1226 \end_layout
1228 \begin_layout Itemize
1229 Lock scroll to playback: While playing back or rewinding movies, the display
1230  will follow if enabled.
1231 \end_layout
1233 \begin_layout Section
1234 Memory watch expression syntax
1235 \end_layout
1237 \begin_layout Standard
1238 Memory watch expressions has the following syntax elements:
1239 \end_layout
1241 \begin_layout LyX-Code
1242 ${foo}     The value of memory watch foo.
1243 \end_layout
1245 \begin_layout LyX-Code
1246 0x1234     Hexadecimal number 1234
1247 \end_layout
1249 \begin_layout LyX-Code
1250 12345      Decimal number 12345
1251 \end_layout
1253 \begin_layout LyX-Code
1254 3.141      Decimal number 3.141
1255 \end_layout
1257 \begin_layout LyX-Code
1258 -a         Unary negation
1259 \end_layout
1261 \begin_layout LyX-Code
1262 ~a         Bitwise NOT (integers only)
1263 \end_layout
1265 \begin_layout LyX-Code
1266 a*b        Multiplication
1267 \end_layout
1269 \begin_layout LyX-Code
1270 a/b        Division/quotent
1271 \end_layout
1273 \begin_layout LyX-Code
1274 a%b        Remainder (integers only)
1275 \end_layout
1277 \begin_layout LyX-Code
1278 a+b        Sum or string concatenation
1279 \end_layout
1281 \begin_layout LyX-Code
1282 a-b        Difference
1283 \end_layout
1285 \begin_layout LyX-Code
1286 a<<b       Shift left (integers only)
1287 \end_layout
1289 \begin_layout LyX-Code
1290 a>>b       Shift right (integers only).
1291  Arithmetic for signed.
1292 \end_layout
1294 \begin_layout LyX-Code
1295 a<b        Less than
1296 \end_layout
1298 \begin_layout LyX-Code
1299 a<=b       Less or equal to
1300 \end_layout
1302 \begin_layout LyX-Code
1303 a==b       Equal to
1304 \end_layout
1306 \begin_layout LyX-Code
1307 a!=b       Not equal to
1308 \end_layout
1310 \begin_layout LyX-Code
1311 a>=b       Greater or equal to
1312 \end_layout
1314 \begin_layout LyX-Code
1315 a>b        Greater than
1316 \end_layout
1318 \begin_layout LyX-Code
1319 a&b        Bitwise AND (integers only)
1320 \end_layout
1322 \begin_layout LyX-Code
1323 a^b        Bitwise XOR (integers only)
1324 \end_layout
1326 \begin_layout LyX-Code
1327 a|b        Bitwise OR (integers only)
1328 \end_layout
1330 \begin_layout LyX-Code
1331 a&&b       Logical AND
1332 \end_layout
1334 \begin_layout LyX-Code
1335 a||b       Logical OR
1336 \end_layout
1338 \begin_layout LyX-Code
1339 Ï€          Numeric constant pi.
1340 \end_layout
1342 \begin_layout LyX-Code
1343 i          Imaginary unit
1344 \end_layout
1346 \begin_layout LyX-Code
1347 if(x,y)    If x is true, y, else false.
1348 \end_layout
1350 \begin_layout LyX-Code
1351 if(x,y,z)  If x is true, y, else z.
1352 \end_layout
1354 \begin_layout LyX-Code
1355 select(x...)
1356 \end_layout
1358 \begin_layout LyX-Code
1359            First value in x...
1360  that is not false, or false if none.
1361 \end_layout
1363 \begin_layout LyX-Code
1364 unsigned(x)
1365 \end_layout
1367 \begin_layout LyX-Code
1368            Cast x to unsigned.
1369 \end_layout
1371 \begin_layout LyX-Code
1372 signed(x)
1373 \end_layout
1375 \begin_layout LyX-Code
1376            Cast x to signed.
1377 \end_layout
1379 \begin_layout LyX-Code
1380 float(x)
1381 \end_layout
1383 \begin_layout LyX-Code
1384            Cast x to float.
1385 \end_layout
1387 \begin_layout LyX-Code
1388 min(x...)  The smallest value among x...
1389  or false if empty.
1390 \end_layout
1392 \begin_layout LyX-Code
1393 max(x...)  The largest value among x...
1394  or false if empty.
1395 \end_layout
1397 \begin_layout LyX-Code
1398 sum(x...)  Sum/concatenation of x...
1399  or false if empty.
1400 \end_layout
1402 \begin_layout LyX-Code
1403 prod(x...) Product of x...
1404  or false if empty.
1405 \end_layout
1407 \begin_layout LyX-Code
1408 sqrt(x)    Square root of x.
1409 \end_layout
1411 \begin_layout LyX-Code
1412 log(x)     Natural log of x.
1413 \end_layout
1415 \begin_layout LyX-Code
1416 log(x,y)   Log of y to base x.
1417 \end_layout
1419 \begin_layout LyX-Code
1420 exp(x)     e^x.
1421 \end_layout
1423 \begin_layout LyX-Code
1424 exp(x,y)   x^y
1425 \end_layout
1427 \begin_layout LyX-Code
1428 sin(x)     Sine of x
1429 \end_layout
1431 \begin_layout LyX-Code
1432 cos(x)     Cosine of x
1433 \end_layout
1435 \begin_layout LyX-Code
1436 tan(x)     Tangent of x
1437 \end_layout
1439 \begin_layout LyX-Code
1440 asin(x)    Arcsine of x
1441 \end_layout
1443 \begin_layout LyX-Code
1444 acos(x)    Arccosine of x
1445 \end_layout
1447 \begin_layout LyX-Code
1448 atan(x)    Arctangent of x
1449 \end_layout
1451 \begin_layout LyX-Code
1452 atan(x,y)  Angle between vector (x,y) and x-axis.
1453 \end_layout
1455 \begin_layout LyX-Code
1456 sinh(x)    Hyperbolic sine of x
1457 \end_layout
1459 \begin_layout LyX-Code
1460 cosh(x)    Hyperbolic cosine of x
1461 \end_layout
1463 \begin_layout LyX-Code
1464 tanh(x)    Hyperbolic tangent of x
1465 \end_layout
1467 \begin_layout LyX-Code
1468 arsinh(x)  Hyperbolic arsine of x
1469 \end_layout
1471 \begin_layout LyX-Code
1472 arcosh(x)  Hyperbolic arcosine of x
1473 \end_layout
1475 \begin_layout LyX-Code
1476 artanh(x)  Hyperbolic artangent of x
1477 \end_layout
1479 \begin_layout LyX-Code
1480 torad(x)   Convert x degrees to radians.
1481 \end_layout
1483 \begin_layout LyX-Code
1484 todeg(x)   Convert x radians to degrees.
1485 \end_layout
1487 \begin_layout LyX-Code
1488 re(x)      Real part of complex number x.
1489 \end_layout
1491 \begin_layout LyX-Code
1492 im(x)      Imaginary part of complex number x.
1493 \end_layout
1495 \begin_layout LyX-Code
1496 conj(x)    Complex conjugate of x.
1497 \end_layout
1499 \begin_layout LyX-Code
1500 abs(x)     Absolute value of x.
1501 \end_layout
1503 \begin_layout LyX-Code
1504 arg(x)     Argument of x.
1505 \end_layout
1507 \begin_layout LyX-Code
1508 pyth(x...) sqrt(sum(x^2)).
1509  I.e.
1510  pythagorean distance.
1511 \end_layout
1513 \begin_layout LyX-Code
1514 e          Base of natural logarithm
1515 \end_layout
1517 \begin_layout LyX-Code
1518 pi         Pi
1519 \end_layout
1521 \begin_layout LyX-Code
1522 true       Constant true
1523 \end_layout
1525 \begin_layout LyX-Code
1526 false      Constant false
1527 \end_layout
1529 \begin_layout LyX-Code
1531 \end_layout
1533 \begin_layout Section
1534 Modifier and key names:
1535 \end_layout
1537 \begin_layout Subsection
1538 wxWidgets platform
1539 \end_layout
1541 \begin_layout Subsubsection
1542 Modifier names:
1543 \end_layout
1545 \begin_layout Standard
1546 Following modifier names are known:
1547 \end_layout
1549 \begin_layout Itemize
1551 \end_layout
1553 \begin_layout Itemize
1554 ctrl
1555 \end_layout
1557 \begin_layout Itemize
1558 shift 
1559 \end_layout
1561 \begin_layout Itemize
1562 meta
1563 \end_layout
1565 \begin_layout Itemize
1566 cmd (Mac OS X only)
1567 \end_layout
1569 \begin_layout Subsubsection
1570 Key names:
1571 \end_layout
1573 \begin_layout Standard
1574 Following key names are known:
1575 \end_layout
1577 \begin_layout Itemize
1578 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1579  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1580  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1581  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1582  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1583  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1584  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1585  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1586  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1587  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1588  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1589  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1590  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1591  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1592  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1593  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1594  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1595  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1596  windows_right, windows_menu, command, special1, special2, special3, special4,
1597  special5, special6, special7, special8, special9, special10, special11,
1598  special12, special13, special14, special15, special16, special17, special18,
1599  special19, special20
1600 \end_layout
1602 \begin_layout Section
1603 Movie file format
1604 \end_layout
1606 \begin_layout Standard
1607 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1608  (note: If you recompress it, do not use compression methods other than
1609  store and deflate and especially do not use encryption of any kind).
1610 \end_layout
1612 \begin_layout Subsection
1613 Detecting clean start/SRAM/Savestate
1614 \end_layout
1616 \begin_layout Itemize
1617 If file has member 
1618 \begin_inset Quotes eld
1619 \end_inset
1621 savestate
1622 \begin_inset Quotes erd
1623 \end_inset
1625  it is savestate, otherwise:
1626 \end_layout
1628 \begin_layout Itemize
1629 If file has members with names starting 
1630 \begin_inset Quotes eld
1631 \end_inset
1633 moviesram.
1634 \begin_inset Quotes erd
1635 \end_inset
1637  it is movie starting from SRAM, otherwise:
1638 \end_layout
1640 \begin_layout Itemize
1641 It is movie starting from clear state.
1642 \end_layout
1644 \begin_layout Subsection
1645 Member: gametype
1646 \end_layout
1648 \begin_layout Standard
1649 Type of game ROM and region (as one line).
1650  Valid values are:
1651 \end_layout
1653 \begin_layout Standard
1654 \begin_inset Tabular
1655 <lyxtabular version="3" rows="8" columns="3">
1656 <features rotate="0" tabularvalignment="middle">
1657 <column alignment="center" valignment="top">
1658 <column alignment="center" valignment="top">
1659 <column alignment="center" valignment="top">
1660 <row>
1661 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1662 \begin_inset Text
1664 \begin_layout Plain Layout
1665 Value
1666 \end_layout
1668 \end_inset
1669 </cell>
1670 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1671 \begin_inset Text
1673 \begin_layout Plain Layout
1674 System
1675 \end_layout
1677 \end_inset
1678 </cell>
1679 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1680 \begin_inset Text
1682 \begin_layout Plain Layout
1683 Region
1684 \end_layout
1686 \end_inset
1687 </cell>
1688 </row>
1689 <row>
1690 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1691 \begin_inset Text
1693 \begin_layout Plain Layout
1694 snes_pal
1695 \end_layout
1697 \end_inset
1698 </cell>
1699 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1700 \begin_inset Text
1702 \begin_layout Plain Layout
1703 Super NES
1704 \end_layout
1706 \end_inset
1707 </cell>
1708 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1709 \begin_inset Text
1711 \begin_layout Plain Layout
1713 \end_layout
1715 \end_inset
1716 </cell>
1717 </row>
1718 <row>
1719 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1720 \begin_inset Text
1722 \begin_layout Plain Layout
1723 sgb_pal
1724 \end_layout
1726 \end_inset
1727 </cell>
1728 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1729 \begin_inset Text
1731 \begin_layout Plain Layout
1732 Super Game Boy
1733 \end_layout
1735 \end_inset
1736 </cell>
1737 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1738 \begin_inset Text
1740 \begin_layout Plain Layout
1742 \end_layout
1744 \end_inset
1745 </cell>
1746 </row>
1747 <row>
1748 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1749 \begin_inset Text
1751 \begin_layout Plain Layout
1752 snes_ntsc
1753 \end_layout
1755 \end_inset
1756 </cell>
1757 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1758 \begin_inset Text
1760 \begin_layout Plain Layout
1761 Super NES
1762 \end_layout
1764 \end_inset
1765 </cell>
1766 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1767 \begin_inset Text
1769 \begin_layout Plain Layout
1770 NTSC
1771 \end_layout
1773 \end_inset
1774 </cell>
1775 </row>
1776 <row>
1777 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1778 \begin_inset Text
1780 \begin_layout Plain Layout
1781 sgb_ntsc
1782 \end_layout
1784 \end_inset
1785 </cell>
1786 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1787 \begin_inset Text
1789 \begin_layout Plain Layout
1790 Super Game Boy
1791 \end_layout
1793 \end_inset
1794 </cell>
1795 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1796 \begin_inset Text
1798 \begin_layout Plain Layout
1799 NTSC
1800 \end_layout
1802 \end_inset
1803 </cell>
1804 </row>
1805 <row>
1806 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1807 \begin_inset Text
1809 \begin_layout Plain Layout
1811 \end_layout
1813 \end_inset
1814 </cell>
1815 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1816 \begin_inset Text
1818 \begin_layout Plain Layout
1819 BS-X (non-slotted)
1820 \end_layout
1822 \end_inset
1823 </cell>
1824 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1825 \begin_inset Text
1827 \begin_layout Plain Layout
1828 NTSC
1829 \end_layout
1831 \end_inset
1832 </cell>
1833 </row>
1834 <row>
1835 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1836 \begin_inset Text
1838 \begin_layout Plain Layout
1839 bsxslotted
1840 \end_layout
1842 \end_inset
1843 </cell>
1844 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1845 \begin_inset Text
1847 \begin_layout Plain Layout
1848 BS-X (slotted)
1849 \end_layout
1851 \end_inset
1852 </cell>
1853 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1854 \begin_inset Text
1856 \begin_layout Plain Layout
1857 NTSC
1858 \end_layout
1860 \end_inset
1861 </cell>
1862 </row>
1863 <row>
1864 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1865 \begin_inset Text
1867 \begin_layout Plain Layout
1868 sufamiturbo
1869 \end_layout
1871 \end_inset
1872 </cell>
1873 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1874 \begin_inset Text
1876 \begin_layout Plain Layout
1877 Sufami Turbo
1878 \end_layout
1880 \end_inset
1881 </cell>
1882 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1883 \begin_inset Text
1885 \begin_layout Plain Layout
1886 NTSC
1887 \end_layout
1889 \end_inset
1890 </cell>
1891 </row>
1892 </lyxtabular>
1894 \end_inset
1897 \end_layout
1899 \begin_layout Standard
1900 Frame rates are:
1901 \end_layout
1903 \begin_layout Standard
1904 \begin_inset Tabular
1905 <lyxtabular version="3" rows="3" columns="2">
1906 <features rotate="0" tabularvalignment="middle">
1907 <column alignment="center" valignment="top">
1908 <column alignment="center" valignment="top">
1909 <row>
1910 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1911 \begin_inset Text
1913 \begin_layout Plain Layout
1914 Region
1915 \end_layout
1917 \end_inset
1918 </cell>
1919 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1920 \begin_inset Text
1922 \begin_layout Plain Layout
1923 Framerate (fps)
1924 \end_layout
1926 \end_inset
1927 </cell>
1928 </row>
1929 <row>
1930 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1931 \begin_inset Text
1933 \begin_layout Plain Layout
1935 \end_layout
1937 \end_inset
1938 </cell>
1939 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1940 \begin_inset Text
1942 \begin_layout Plain Layout
1943 322445/6448
1944 \end_layout
1946 \end_inset
1947 </cell>
1948 </row>
1949 <row>
1950 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1951 \begin_inset Text
1953 \begin_layout Plain Layout
1954 NTSC
1955 \end_layout
1957 \end_inset
1958 </cell>
1959 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1960 \begin_inset Text
1962 \begin_layout Plain Layout
1963 10738636/178683
1964 \end_layout
1966 \end_inset
1967 </cell>
1968 </row>
1969 </lyxtabular>
1971 \end_inset
1974 \end_layout
1976 \begin_layout Subsection
1977 Member: port1
1978 \end_layout
1980 \begin_layout Standard
1981 Contains type of port #1 (as one line).
1982  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1983  If not present, defaults to 'gamepad'.
1984 \end_layout
1986 \begin_layout Subsection
1987 Member: port2
1988 \end_layout
1990 \begin_layout Standard
1991 Contains type of port #2 (as one line).
1992  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1993  'justifier' and 'justifiers'.
1994  If not present, defaults to 'none'.
1995 \end_layout
1997 \begin_layout Subsection
1998 Member: gamename
1999 \end_layout
2001 \begin_layout Standard
2002 Contains name of the game (as one line).
2003 \end_layout
2005 \begin_layout Subsection
2006 Member: authors
2007 \end_layout
2009 \begin_layout Standard
2010 Contains authors, one per line.
2011  Part before '|' is the full name, part after is the nickname.
2012 \end_layout
2014 \begin_layout Subsection
2015 Member: systemid
2016 \end_layout
2018 \begin_layout Standard
2019 Always 
2020 \begin_inset Quotes eld
2021 \end_inset
2023 lsnes-rr1
2024 \begin_inset Quotes erd
2025 \end_inset
2027  (one line).
2028  Used to reject other saves.
2029 \end_layout
2031 \begin_layout Subsection
2032 Member: controlsversion
2033 \end_layout
2035 \begin_layout Standard
2036 Always 
2037 \begin_inset Quotes eld
2038 \end_inset
2041 \begin_inset Quotes erd
2042 \end_inset
2044  (one line).
2045  Used to identify what controls are there.
2046 \end_layout
2048 \begin_layout Subsection
2049 Member: 
2050 \begin_inset Quotes eld
2051 \end_inset
2053 coreversion
2054 \begin_inset Quotes erd
2055 \end_inset
2058 \end_layout
2060 \begin_layout Standard
2061 Contains bsnes core version number (as one line).
2062 \end_layout
2064 \begin_layout Subsection
2065 Member: projectid
2066 \end_layout
2068 \begin_layout Standard
2069 Contains project ID (as one line).
2070  Used to identify if two movies are part of the same project.
2071 \end_layout
2073 \begin_layout Subsection
2074 Member: {rom,slota,slotb}{,xml}.sha256
2075 \end_layout
2077 \begin_layout Standard
2078 Contains SHA-256 of said ROM or ROM mapping file (as one line).
2079  Absent if corresponding file is absent.
2080 \end_layout
2082 \begin_layout Subsection
2083 Member: moviesram.<name>
2084 \end_layout
2086 \begin_layout Standard
2087 Raw binary startup SRAM of kind <name>.
2088  Only present in savestates and movies starting from SRAM.
2089 \end_layout
2091 \begin_layout Subsection
2092 Member: saveframe
2093 \end_layout
2095 \begin_layout Standard
2096 Contains frame number (as one line) of frame movie was saved on.
2097  Only present in savestates.
2098 \end_layout
2100 \begin_layout Subsection
2101 Member: lagcounter
2102 \end_layout
2104 \begin_layout Standard
2105 Current value of lag counter (as one line).
2106  Only present in savestates.
2107 \end_layout
2109 \begin_layout Subsection
2110 Member: pollcounters
2111 \end_layout
2113 \begin_layout Standard
2114 Contains poll counters (currently 100 of them), one per line.
2115  Each line is raw poll count if DRDY is set for it.
2116  Otherwise it is negative poll count minus one.
2117  Only present in savestates.
2118 \end_layout
2120 \begin_layout Subsection
2121 Member: hostmemory
2122 \end_layout
2124 \begin_layout Standard
2125 Raw binary dump of host memory.
2126  Only present in savestates.
2127 \end_layout
2129 \begin_layout Subsection
2130 Member: savestate
2131 \end_layout
2133 \begin_layout Standard
2134 The raw binary savestate itself.
2135  Savestate detection uses this file, only present in savestates.
2136 \end_layout
2138 \begin_layout Subsection
2139 Member: screenshot
2140 \end_layout
2142 \begin_layout Standard
2143 Screenshot of current frame.
2144  Only present in savestates.
2145  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
2146  data.
2147  Height of image is inferred from the width and size of data.
2148 \end_layout
2150 \begin_layout Subsection
2151 Member: sram.<name>
2152 \end_layout
2154 \begin_layout Standard
2155 Raw binary SRAM of kind <name> at time of savestate.
2156  Only present in savestates.
2157 \end_layout
2159 \begin_layout Subsection
2160 Member: input
2161 \end_layout
2163 \begin_layout Standard
2164 The actual input track, one line per subframe (blank lines are skipped).
2165 \end_layout
2167 \begin_layout Itemize
2168 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
2169  part of same frame as previous, otherwise it starts a new frame.
2170 \end_layout
2172 \begin_layout Itemize
2173 First subframe must start a new frame.
2174 \end_layout
2176 \begin_layout Standard
2177 Length of movie in frames is number of lines in input file that start a
2178  new frame.
2179 \end_layout
2181 \begin_layout Subsection
2182 Member: subtitles
2183 \end_layout
2185 \begin_layout Standard
2186 Subtitle track.
2187  Optional.
2188 \end_layout
2190 \begin_layout Itemize
2191 Each line is in form <firstframe> <numframes> <text>.
2192 \end_layout
2194 \begin_layout Itemize
2195 Linefeed is encoded as 
2196 \backslash
2197 n, backslash is encoded as 
2198 \backslash
2200 \backslash
2202 \end_layout
2204 \begin_layout Subsection
2205 Member: rerecords
2206 \end_layout
2208 \begin_layout Standard
2209 Contains textual base-10 rerecord count (as one line; emulator just writes
2210  this, it doesn't read it) + 1.
2211 \end_layout
2213 \begin_layout Subsection
2214 Member: rrdata
2215 \end_layout
2217 \begin_layout Standard
2218 This member stores set of load IDs.
2219  There is one load ID per rerecord (plus one corresponding to start of project).
2220 \end_layout
2222 \begin_layout Itemize
2223 This member constists of concatenation of records
2224 \end_layout
2226 \begin_layout Itemize
2227 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2228  IDs.
2229 \end_layout
2231 \begin_layout Itemize
2232 IDs are interpretted as 256-bit big-endian integers with warparound.
2233 \end_layout
2235 \begin_layout Itemize
2236 Initial predicted ID is all zeroes.
2237 \end_layout
2239 \begin_layout Standard
2240 Format of each record is:
2241 \end_layout
2243 \begin_layout Itemize
2244 1 byte: Opcode byte.
2245  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2246  Bit 7 is unused.
2247 \end_layout
2249 \begin_layout Itemize
2250 32-prefixlen bytes of ID.
2251 \end_layout
2253 \begin_layout Itemize
2254 countlen bytes of big-endian count (count).
2255 \end_layout
2257 \begin_layout Standard
2258 Records are processed as follows:
2259 \end_layout
2261 \begin_layout Itemize
2262 To form the first ID encoded by record, take the first prefixlen bytes predicted
2263  ID and append the read ID value to it.
2264  The result is the first ID encoded.
2265 \end_layout
2267 \begin_layout Itemize
2268 If countlen is 0, record encodes 1 ID.
2269 \end_layout
2271 \begin_layout Itemize
2272 If countlen is 1, record encodes 2+count IDs.
2273 \end_layout
2275 \begin_layout Itemize
2276 If countlen is 2, record encodes 258+count IDs.
2277 \end_layout
2279 \begin_layout Itemize
2280 If countlen is 3, record encodes 65794+count IDs.
2281 \end_layout
2283 \begin_layout Itemize
2284 The new predicted ID is the next ID after last one encoded by the record.
2285 \end_layout
2287 \begin_layout Standard
2288 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2289  by all records.
2290 \end_layout
2292 \begin_layout Subsection
2293 Member: starttime.second
2294 \end_layout
2296 \begin_layout Standard
2297 Movie starting time, second part.
2298  Epoch is Unix epoch.
2299  Default is 1,000,000,000.
2300 \end_layout
2302 \begin_layout Subsection
2303 Member: starttime.subsecond
2304 \end_layout
2306 \begin_layout Standard
2307 Movie starting time, subsecond part.
2308  Unit is CPU clocks.
2309  Default is 0.
2310 \end_layout
2312 \begin_layout Subsection
2313 Member: savetime.second
2314 \end_layout
2316 \begin_layout Standard
2317 Movie saving time, second part.
2318  Default is starttime.second.
2319  Only present in savestates.
2320 \end_layout
2322 \begin_layout Subsection
2323 Member: savetime.subsecond
2324 \end_layout
2326 \begin_layout Standard
2327 Movie saving time, subsecond part.
2328  Default is starttime.subsecond.
2329  Only present in savestates.
2330 \end_layout
2332 \begin_layout Section
2333 lsvs file format (commentary tracks)
2334 \end_layout
2336 \begin_layout Subsection
2337 Clusters
2338 \end_layout
2340 \begin_layout Itemize
2341 Each cluster is 8kB (8192 bytes) in size.
2342 \end_layout
2344 \begin_layout Itemize
2345 Cluster n starts at offset 8192*n in file.
2346 \end_layout
2348 \begin_layout Itemize
2349 The following clusters are system special:
2350 \end_layout
2352 \begin_deeper
2353 \begin_layout Itemize
2354 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2355 \end_layout
2357 \begin_layout Itemize
2358 Cluster 1 (superblock)
2359 \end_layout
2361 \end_deeper
2362 \begin_layout Subsection
2363 Cluster tables
2364 \end_layout
2366 \begin_layout Itemize
2367 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2368  last 11 bits of n).
2369 \end_layout
2371 \begin_layout Itemize
2372 This cluster table consists of 2048 4-byte big-endian integers.
2373 \end_layout
2375 \begin_layout Itemize
2376 Each entry describes a cluster in 16MB supercluster, in order.
2377 \end_layout
2379 \begin_layout Itemize
2380 The valid values for entries are:
2381 \end_layout
2383 \begin_deeper
2384 \begin_layout Itemize
2385 0x00000000: Free cluster
2386 \end_layout
2388 \begin_layout Itemize
2389 0x00000001: Last cluster in chain.
2390 \end_layout
2392 \begin_layout Itemize
2393 0xFFFFFFFF: System cluster (cluster tables and superblock)
2394 \end_layout
2396 \begin_layout Itemize
2397 (anything else): Number of next cluster in chain.
2398  Must not be multiple of 2048.
2399 \end_layout
2401 \end_deeper
2402 \begin_layout Itemize
2403 Due to limitations of the format, there can be at most 2097052 superclusters,
2404  giving maximum file size of 16TB.
2405 \end_layout
2407 \begin_layout Subsection
2408 Stream table
2409 \end_layout
2411 \begin_layout Itemize
2412 The stream table chain always starts in cluster 2.
2413 \end_layout
2415 \begin_layout Itemize
2416 Otherwise, it follows normal chaining.
2417 \end_layout
2419 \begin_layout Itemize
2420 The stream table consists of 16-byte entries:
2421 \end_layout
2423 \begin_deeper
2424 \begin_layout Itemize
2425 The first 8 bytes of entry give big-endian beginning position of stream
2426  in units of 1/48000 s.
2427 \end_layout
2429 \begin_layout Itemize
2430 The next 4 bytes of entry give big-endian beginning cluster for control
2431  data.
2432  0 here marks the entry as not present.
2433 \end_layout
2435 \begin_layout Itemize
2436 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2437 \end_layout
2439 \end_deeper
2440 \begin_layout Itemize
2441 Stream table clusters are normal clusters, following normal chaining.
2442 \end_layout
2444 \begin_layout Itemize
2445 The stream begnning position is not guarenteed unique.
2446  There can be multiple streams with the same starting position in the file.
2447 \end_layout
2449 \begin_layout Subsection
2450 Stream control data
2451 \end_layout
2453 \begin_layout Itemize
2454 The stream control data consists of entries 4 bytes each:
2455 \end_layout
2457 \begin_deeper
2458 \begin_layout Itemize
2459 The first 2 bytes of entry gives big-endian length of packet
2460 \end_layout
2462 \begin_layout Itemize
2463 The next byte of entry gives audio length of packet in units of 1/400 s.
2464 \end_layout
2466 \begin_layout Itemize
2467 The last byte is control byte.
2468 \end_layout
2470 \begin_deeper
2471 \begin_layout Itemize
2472 0 means this entry is not present and the control data ends.
2473 \end_layout
2475 \begin_layout Itemize
2476 1 is valid control entry.
2477 \end_layout
2479 \end_deeper
2480 \end_deeper
2481 \begin_layout Itemize
2482 The stream control data can also end by running into end of the readable
2483  chain.
2484 \end_layout
2486 \begin_deeper
2487 \begin_layout Itemize
2488 This happens if there happens to be exact multiple of 2048 packets in stream
2489  and number of packets is nonzero.
2490 \end_layout
2492 \end_deeper
2493 \begin_layout Itemize
2494 These clusters follow normal chaining.
2495 \end_layout
2497 \begin_layout Subsection
2498 Stream codec data
2499 \end_layout
2501 \begin_layout Itemize
2502 Stream codec data consists of raw Opus data packets packed back to back
2503  with nothing in between.
2504 \end_layout
2506 \begin_layout Itemize
2507 Warning: Due to internal limitations, this data must reside in the first
2508  65536 superclusters (that is, the first 1TB of the file).
2509 \end_layout
2511 \begin_layout Subsection
2512 Superblock
2513 \end_layout
2515 \begin_layout Itemize
2516 The superblock is stored in cluster 1.
2518 \end_layout
2520 \begin_layout Itemize
2521 The first 11 bytes are 
2522 \begin_inset Quotes eld
2523 \end_inset
2525 sefs-magic
2526 \begin_inset Quotes erd
2527 \end_inset
2529 <NUL>.
2530 \end_layout
2532 \begin_layout Itemize
2533 The rest are unused.
2534 \end_layout
2536 \begin_layout Itemize
2537 This cluster 1 is marked as system special.
2538 \end_layout
2540 \begin_layout Section
2541 Known ROM extensions
2542 \end_layout
2544 \begin_layout Itemize
2545 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2546 \end_layout
2548 \begin_layout Itemize
2549 DMG cartridge ROMs: dmg, gb.
2550 \end_layout
2552 \begin_layout Itemize
2553 GBC cartridge ROMs: cgb, gbc.
2554 \end_layout
2556 \begin_layout Section
2557 Gamepack files
2558 \end_layout
2560 \begin_layout Itemize
2561 The first line must be: 
2562 \begin_inset Quotes eld
2563 \end_inset
2565 [GAMEPACK FILE]
2566 \begin_inset Quotes erd
2567 \end_inset
2570 \end_layout
2572 \begin_layout Itemize
2573 There is one needed line: 
2574 \begin_inset Quotes eld
2575 \end_inset
2577 type <systype>
2578 \begin_inset Quotes erd
2579 \end_inset
2582  This sets system type to <systype>.
2583  The following system types are valid:
2584 \end_layout
2586 \begin_deeper
2587 \begin_layout Itemize
2588 snes (SNES)
2589 \end_layout
2591 \begin_layout Itemize
2592 bsx (BS-X non-slotted)
2593 \end_layout
2595 \begin_layout Itemize
2596 bsxslotted (BS-X slotted)
2597 \end_layout
2599 \begin_layout Itemize
2600 sufamiturbo (Sufami Turbo)
2601 \end_layout
2603 \begin_layout Itemize
2604 sgb (Super Game Boy)
2605 \end_layout
2607 \begin_layout Itemize
2608 dmg (Game Boy)
2609 \end_layout
2611 \begin_layout Itemize
2612 gbc (Game Boy Color)
2613 \end_layout
2615 \begin_layout Itemize
2616 gbc_gba (Game Boy Color with GBA initial register values)
2617 \end_layout
2619 \end_deeper
2620 \begin_layout Itemize
2621 Optionally a region can be specified: 
2622 \begin_inset Quotes eld
2623 \end_inset
2625 region <region>
2626 \begin_inset Quotes erd
2627 \end_inset
2630  The following values are valid:
2631 \end_layout
2633 \begin_deeper
2634 \begin_layout Itemize
2635 autodetect (Autodetect region: snes and sgb only)
2636 \end_layout
2638 \begin_layout Itemize
2639 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2640 \end_layout
2642 \begin_layout Itemize
2643 pal (PAL: snes, sgb)
2644 \end_layout
2646 \begin_layout Itemize
2647 world (World: dmg, gbc, gbc_gba)
2648 \end_layout
2650 \end_deeper
2651 \begin_layout Itemize
2652 ROM images are loaded as: 
2653 \begin_inset Quotes eld
2654 \end_inset
2656 rom <type> <file>
2657 \begin_inset Quotes erd
2658 \end_inset
2661  The following types are valid:
2662 \end_layout
2664 \begin_deeper
2665 \begin_layout Itemize
2666 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2667  BIOS in bsx, bsxslotted, sufamiturbo)
2668 \end_layout
2670 \begin_layout Itemize
2671 bsx (Cartridge ROM in bsx, bsxslotted)
2672 \end_layout
2674 \begin_layout Itemize
2675 slot-a (Cartridge ROM in sufamiturbo)
2676 \end_layout
2678 \begin_layout Itemize
2679 slot-b (Cartridge ROM in sufamiturbo)
2680 \end_layout
2682 \end_deeper
2683 \begin_layout Itemize
2684 ROM markup can be loaded as: 
2685 \begin_inset Quotes eld
2686 \end_inset
2688 xml <type> <file>
2689 \begin_inset Quotes erd
2690 \end_inset
2693  The types valid are the same as for ROMs.
2694 \end_layout
2696 \begin_layout Itemize
2697 Patches can be loaded as 
2698 \begin_inset Quotes eld
2699 \end_inset
2701 patch[<offset>] <type> <file>
2702 \begin_inset Quotes erd
2703 \end_inset
2706  The types are the same as for ROMs.
2707 \end_layout
2709 \begin_deeper
2710 \begin_layout Itemize
2711 Offset is given in form [+-]<number>.
2712  Usually offset is either +0 or -512.
2713 \end_layout
2715 \begin_layout Itemize
2716 Default offset is +0.
2717 \end_layout
2719 \end_deeper
2720 \begin_layout Subsection
2721 Example:
2722 \end_layout
2724 \begin_layout LyX-Code
2725 [GAMEPACK FILE]
2726 \end_layout
2728 \begin_layout LyX-Code
2729 type snes
2730 \end_layout
2732 \begin_layout LyX-Code
2733 rom rom speedygonzales.sfc
2734 \end_layout
2736 \begin_layout LyX-Code
2737 patch-512 rom sonicthehedgehog.ips
2738 \end_layout
2740 \begin_layout Subsection
2741 Example 2:
2742 \end_layout
2744 \begin_layout LyX-Code
2745 [GAMEPACK FILE]
2746 \end_layout
2748 \begin_layout LyX-Code
2749 type sgb
2750 \end_layout
2752 \begin_layout LyX-Code
2753 rom rom supergameboy.sfc
2754 \end_layout
2756 \begin_layout LyX-Code
2757 rom dmg megamanV.dmg
2758 \end_layout
2760 \begin_layout Section
2761 Quick'n'dirty encode guide
2762 \end_layout
2764 \begin_layout Enumerate
2765 Start the emulator and load the ROM and movie file.
2766 \end_layout
2768 \begin_layout Enumerate
2769 Set large AVI option 'set-setting avi-large on'
2770 \end_layout
2772 \begin_layout Enumerate
2773 Enable dumping 'dump-avi tmpdump' 
2774 \end_layout
2776 \begin_layout Enumerate
2777 Unpause and let it run until you want to end dumping.
2778 \end_layout
2780 \begin_layout Enumerate
2781 Close the emulator (closing the window is the easiest way).
2782  Or use 'end-avi'.
2783 \end_layout
2785 \begin_layout Enumerate
2786 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2787  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2788 \end_layout
2790 \begin_layout Enumerate
2791 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2792 \end_layout
2794 \begin_layout Enumerate
2795 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2796  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2797 \end_layout
2799 \begin_layout Enumerate
2800 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2801  Now final.mkv contains quick'n'dirty encode.
2802 \end_layout
2804 \begin_layout Section
2805 Axis configurations for some gamepad types:
2806 \end_layout
2808 \begin_layout Subsection
2809 XBox360 controller:
2810 \end_layout
2812 \begin_layout Standard
2813 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2814 \end_layout
2816 \begin_layout LyX-Code
2817 set-axis joystick0axis2 pressure-+
2818 \end_layout
2820 \begin_layout LyX-Code
2821 set-axis joystick0axis5 pressure-+
2822 \end_layout
2824 \begin_layout Itemize
2825 This is needed for SDL only.
2826  EVDEV sets those types correctly.
2827 \end_layout
2829 \begin_layout Subsection
2830 PS3 
2831 \begin_inset Quotes eld
2832 \end_inset
2834 sixaxis
2835 \begin_inset Quotes erd
2836 \end_inset
2838  controller:
2839 \end_layout
2841 \begin_layout Standard
2842 Axes 8-19 should be disabled.
2843 \end_layout
2845 \begin_layout LyX-Code
2846 set-axis joystick0axis8 disabled
2847 \end_layout
2849 \begin_layout LyX-Code
2850 set-axis joystick0axis9 disabled
2851 \end_layout
2853 \begin_layout LyX-Code
2854 set-axis joystick0axis10 disabled
2855 \end_layout
2857 \begin_layout LyX-Code
2858 set-axis joystick0axis11 disabled
2859 \end_layout
2861 \begin_layout LyX-Code
2862 set-axis joystick0axis12 disabled
2863 \end_layout
2865 \begin_layout LyX-Code
2866 set-axis joystick0axis13 disabled
2867 \end_layout
2869 \begin_layout LyX-Code
2870 set-axis joystick0axis14 disabled
2871 \end_layout
2873 \begin_layout LyX-Code
2874 set-axis joystick0axis15 disabled
2875 \end_layout
2877 \begin_layout LyX-Code
2878 set-axis joystick0axis16 disabled
2879 \end_layout
2881 \begin_layout LyX-Code
2882 set-axis joystick0axis17 disabled
2883 \end_layout
2885 \begin_layout LyX-Code
2886 set-axis joystick0axis18 disabled
2887 \end_layout
2889 \begin_layout LyX-Code
2890 set-axis joystick0axis19 disabled
2891 \end_layout
2893 \begin_layout Section
2894 Errata:
2895 \end_layout
2897 \begin_layout Subsection
2898 Problems from BSNES core:
2899 \end_layout
2901 \begin_layout Itemize
2902 The whole pending save stuff.
2903 \end_layout
2905 \begin_layout Itemize
2906 It is slow (especially accuracy).
2907 \end_layout
2909 \begin_layout Itemize
2910 Firmwares can't be loaded from ZIP archives.
2911 \end_layout
2913 \begin_layout Subsection
2914 Other problems:
2915 \end_layout
2917 \begin_layout Itemize
2918 Modifiers don't work with pseudo-keys.
2919 \end_layout
2921 \begin_layout Itemize
2922 Audio for last dumped frame is not itself dumped.
2923 \end_layout
2925 \begin_layout Itemize
2926 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2927 \end_layout
2929 \end_body
2930 \end_document