Rudimentary library unloading support
[lsnes.git] / manual.lyx
blob067a721e443acb774a564c6524648c4113c3e398
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 Itemize
418 <address> can be one of:
419 \end_layout
421 \begin_deeper
422 \begin_layout Itemize
423 Decimal number
424 \end_layout
426 \begin_layout Itemize
427 Hexadecimal number (prefixed with 0x)
428 \end_layout
430 \begin_layout Itemize
431 <memarea>+<hexoffset> (no 0x prefix for offset).
432 \end_layout
434 \end_deeper
435 \begin_layout Standard
436 <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
437  with '-') decimal.
438 \end_layout
440 \begin_layout Standard
441 The available element <sizes> are:
442 \end_layout
444 \begin_layout Itemize
445 byte: 1 byte
446 \end_layout
448 \begin_layout Itemize
449 word: 2 bytes
450 \end_layout
452 \begin_layout Itemize
453 hword: 3 bytes
454 \end_layout
456 \begin_layout Itemize
457 dword: 4 bytes
458 \end_layout
460 \begin_layout Itemize
461 qword: 8 bytes
462 \end_layout
464 \begin_layout Itemize
465 float: 4 bytes (floating-point)
466 \end_layout
468 \begin_layout Itemize
469 double: 8 bytes (floating-point)
470 \end_layout
472 \begin_layout Standard
473 When reading RAM and ROM, multi-byte reads/writes are big-endian.
474  When dealing with DSP memory, multi-byte reads/writes are native-endian
475  (do not use operand sizes exceeding DSP bitness, except dword is OK for
476  24-bit memory).
477 \end_layout
479 \begin_layout Subsubsection
480 read-<size> <address>
481 \end_layout
483 \begin_layout Standard
484 Read the value of byte in <address>.
485 \end_layout
487 \begin_layout Subsubsection
488 read-s<size> <address>
489 \end_layout
491 \begin_layout Standard
492 Read the value of signed byte in <address>.
493 \end_layout
495 \begin_layout Subsubsection
496 write-<size> <address> <value>
497 \end_layout
499 \begin_layout Standard
500 Write <value> to byte in address <address>.
501 \end_layout
503 \begin_layout Subsection
504 Main commands
505 \end_layout
507 \begin_layout Standard
508 These commands are not available in lsnesrc, but are available after ROM
509  has been loaded.
510 \end_layout
512 \begin_layout Subsubsection
513 quit-emulator
514 \end_layout
516 \begin_layout Standard
517 Quits the emulator.
518 \end_layout
520 \begin_layout Subsubsection
521 pause-emulator
522 \end_layout
524 \begin_layout Standard
525 Toggle paused/unpaused
526 \end_layout
528 \begin_layout Subsubsection
529 +advance-frame 
530 \end_layout
532 \begin_layout Standard
533 Advance frame.
534  If the button is still held after configurable timeout expires, game unpauses
535  for the duration frame advance is held.
536 \end_layout
538 \begin_layout Subsubsection
539 +advance-poll 
540 \end_layout
542 \begin_layout Standard
543 Advance subframe.
544  If the button is still held after configurable timeout expires, game unpauses
545  for the duration frame advance is held.
546 \end_layout
548 \begin_layout Subsubsection
549 advance-skiplag 
550 \end_layout
552 \begin_layout Standard
553 Skip to first poll in frame after current.
554 \end_layout
556 \begin_layout Subsubsection
557 reset 
558 \end_layout
560 \begin_layout Standard
561 Reset the SNES after this frame.
562 \end_layout
564 \begin_layout Subsubsection
565 load <filename> 
566 \end_layout
568 \begin_layout Standard
569 Load savestate <filename> in current mode.
570 \end_layout
572 \begin_layout Subsubsection
573 load-state <filename> 
574 \end_layout
576 \begin_layout Standard
577 Load savestate <filename> in readwrite mode.
578 \end_layout
580 \begin_layout Subsubsection
581 load-readonly <filename> 
582 \end_layout
584 \begin_layout Standard
585 Load savestate <filename> in readonly mode.
586 \end_layout
588 \begin_layout Subsubsection
589 load-preserve <filename> 
590 \end_layout
592 \begin_layout Standard
593 Load savestate <filename> in readonly mode, preserving current events.
594 \end_layout
596 \begin_layout Subsubsection
597 load-movie <filename> 
598 \end_layout
600 \begin_layout Standard
601 Load savestate <filename>, ignoring save part in readonly mode.
602 \end_layout
604 \begin_layout Subsubsection
605 save-state <filename> 
606 \end_layout
608 \begin_layout Standard
609 Save system state to <filename> as soon as possible.
610 \end_layout
612 \begin_layout Subsubsection
613 save-movie <filename> 
614 \end_layout
616 \begin_layout Standard
617 Save movie to <filename>.
618 \end_layout
620 \begin_layout Subsubsection
621 set-rwmode 
622 \end_layout
624 \begin_layout Standard
625 Set recording mode.
626 \end_layout
628 \begin_layout Subsubsection
629 set-romode 
630 \end_layout
632 \begin_layout Standard
633 Set playback mode
634 \end_layout
636 \begin_layout Subsubsection
637 toggle-rwmode 
638 \end_layout
640 \begin_layout Standard
641 Toggle between playback and recording modes.
642 \end_layout
644 \begin_layout Subsubsection
645 test-1, test-2, test-3
646 \end_layout
648 \begin_layout Standard
649 Internal test commands.
650  Don't use.
651 \end_layout
653 \begin_layout Subsubsection
654 take-screenshot <filename> 
655 \end_layout
657 \begin_layout Standard
658 Save screenshot to <filename>.
659 \end_layout
661 \begin_layout Subsubsection
662 +controller <class>-<#>-<button>
663 \end_layout
665 \begin_layout Standard
666 Press button <button> on controller <num> of class <class>.
667 \end_layout
669 \begin_layout Itemize
670 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
671  ext0, ext1, ext2, ext3
672 \end_layout
674 \begin_layout Itemize
675 Class 'mouse': L, R
676 \end_layout
678 \begin_layout Itemize
679 Class 'superscope': trigger, cursor, turbo, pause
680 \end_layout
682 \begin_layout Itemize
683 Class 'justifier': trigger, start
684 \end_layout
686 \begin_layout Itemize
687 Class 'gb': A, B, select, start, up, down, left, right
688 \end_layout
690 \begin_layout Subsubsection
691 hold-controller <class>-<#>-<button>
692 \end_layout
694 \begin_layout Standard
695 Hold/unhold button <button> on controller <num> of class <class>.
696 \end_layout
698 \begin_layout Subsubsection
699 type-controller <class>-<#>-<button>
700 \end_layout
702 \begin_layout Standard
703 Hold/unhold button <button> on controller <num> of class <class> for the
704  next frame.
705  See +controller for button names.
706 \end_layout
708 \begin_layout Standard
709 Cauntion: Does not work properly if outside frame advance.
710 \end_layout
712 \begin_layout Subsubsection
713 +autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
714 \end_layout
716 \begin_layout Standard
717 Start autofire.
718  If duty is not specified, defaults to 1.
719  If <cyclelen> is not specified, defaults to 2.
720 \end_layout
722 \begin_layout Subsubsection
723 -autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
724 \end_layout
726 \begin_layout Standard
727 End autofire.
728 \end_layout
730 \begin_layout Subsubsection
731 autofire-controller <class>-<#>-<button> [[<duty>] <cyclelen>]
732 \end_layout
734 \begin_layout Standard
735 Toggle autofire.
736  If autofire is turned on, specified cycle is used.
737 \end_layout
739 \begin_layout Subsubsection
740 designate-position <class>-<#>-analog<n>
741 \end_layout
743 \begin_layout Standard
744 Designate position for analog pair.
745  <n> is only there if there are multiple axis pairs.
746 \end_layout
748 \begin_layout Subsubsection
749 repaint
750 \end_layout
752 \begin_layout Standard
753 Force a repaint.
754 \end_layout
756 \begin_layout Subsubsection
757 toggle-pause-on-end
758 \end_layout
760 \begin_layout Standard
761 Toggle pause on end flag.
762 \end_layout
764 \begin_layout Subsubsection
765 set-pause-on-end
766 \end_layout
768 \begin_layout Standard
769 Set pause on end flag.
770 \end_layout
772 \begin_layout Subsubsection
773 clear-pause-on-end
774 \end_layout
776 \begin_layout Standard
777 Clear pause on end flag.
778 \end_layout
780 \begin_layout Subsubsection
781 action <action> [<parameters>]
782 \end_layout
784 \begin_layout Standard
785 Run specified core action.
786 \end_layout
788 \begin_layout Subsection
789 Save jukebox 
790 \end_layout
792 \begin_layout Subsubsection
793 cycle-jukebox-backward
794 \end_layout
796 \begin_layout Standard
797 Cycle save jukebox backwards.
798 \end_layout
800 \begin_layout Subsubsection
801 cycle-jukebox-forward
802 \end_layout
804 \begin_layout Standard
805 Cycle save jukebox forwards
806 \end_layout
808 \begin_layout Subsubsection
809 set-jukebox-slot <slot>
810 \end_layout
812 \begin_layout Standard
813 Set current jukebox slot
814 \end_layout
816 \begin_layout Subsubsection
817 load-jukebox
818 \end_layout
820 \begin_layout Standard
821 Do load from jukebox (current mode).
822 \end_layout
824 \begin_layout Subsubsection
825 save-jukebox
826 \end_layout
828 \begin_layout Standard
829 Do state save to jukebox.
830 \end_layout
832 \begin_layout Subsection
833 Slot branches
834 \end_layout
836 \begin_layout Subsubsection
837 list-branches
838 \end_layout
840 \begin_layout Standard
841 List all branches
842 \end_layout
844 \begin_layout Subsubsection
845 create-branch <pid> <name>
846 \end_layout
848 \begin_layout Standard
849 Create a new branch, with <pid> as parent and <name> as name.
850 \end_layout
852 \begin_layout Subsubsection
853 rename-branch <id> <name>
854 \end_layout
856 \begin_layout Standard
857 Rename branch <id> to <name>.
858 \end_layout
860 \begin_layout Subsubsection
861 reparent-branch <id> <pid>
862 \end_layout
864 \begin_layout Standard
865 Set parent of branch <id> to <pid>.
866 \end_layout
868 \begin_layout Subsubsection
869 set-branch <id>
870 \end_layout
872 \begin_layout Standard
873 Set current branch to <id>.
874 \end_layout
876 \begin_layout Subsubsection
877 delete-branch <id>
878 \end_layout
880 \begin_layout Standard
881 Delete branch <id>.
882 \end_layout
884 \begin_layout Standard
886 \end_layout
888 \begin_layout Subsection
889 Lua 
890 \end_layout
892 \begin_layout Subsubsection
893 evaluate-lua <luacode>
894 \end_layout
896 \begin_layout Standard
897 Run Lua code <luacode> using built-in Lua interpretter.
898 \end_layout
900 \begin_layout Subsubsection
901 L <luacode>
902 \end_layout
904 \begin_layout Standard
905 Synonym for evaluate-lua.
906 \end_layout
908 \begin_layout Subsubsection
909 run-lua <script>
910 \end_layout
912 \begin_layout Standard
913 Run specified lua file using built-in Lua interpretter.
914 \end_layout
916 \begin_layout Subsubsection
917 reset-lua
918 \end_layout
920 \begin_layout Standard
921 Clear the Lua VM state and restore to factory defaults.
922 \end_layout
924 \begin_layout Subsection
925 Sound 
926 \end_layout
928 \begin_layout Subsubsection
929 enable-sound <on/off> 
930 \end_layout
932 \begin_layout Standard
933 Enable/Disable sound.
934 \end_layout
936 \begin_layout Subsection
937 Misc.
938 \end_layout
940 \begin_layout Subsubsection
941 reload-rom [<file>]
942 \end_layout
944 \begin_layout Standard
945 Reloads the main ROM image from <file>.
946 \end_layout
948 \begin_layout Subsubsection
949 +tangent
950 \end_layout
952 \begin_layout Standard
953 Tangent for recording voice for commentary track.
954  While pressed, record a stream.
955 \end_layout
957 \begin_layout Subsubsection
958 advance-subframe-timeout
959 \end_layout
961 \begin_layout Standard
962 Subframe advance timeout in milliseconds.
963  Default is 100.
964 \end_layout
966 \begin_layout Section
967 Settings
968 \end_layout
970 \begin_layout Subsection
971 Core settings
972 \end_layout
974 \begin_layout Subsection
975 AVI dumper settings
976 \end_layout
978 \begin_layout Subsubsection
979 avi-large
980 \end_layout
982 \begin_layout Standard
983 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
984  outputs.
985 \end_layout
987 \begin_layout Subsubsection
988 avi-left-border
989 \end_layout
991 \begin_layout Standard
992 AVI dumper: Set the default left border thickness (unless lua overrides)
993  for dumps.
994  Range 0-8191.
995  Default is 0.
996 \end_layout
998 \begin_layout Subsubsection
999 avi-right-border
1000 \end_layout
1002 \begin_layout Standard
1003 AVI dumper: Set the default right border thickness (unless lua overrides)
1004  for dumps.
1005  Range 0-8191.
1006  Default is 0.
1007 \end_layout
1009 \begin_layout Subsubsection
1010 avi-top-border
1011 \end_layout
1013 \begin_layout Standard
1014 AVI dumper: Set the default top border thickness (unless lua overrides)
1015  for dumps.
1016  Range 0-8191.
1017  Default is 0.
1018 \end_layout
1020 \begin_layout Subsubsection
1021 avi-bottom-border
1022 \end_layout
1024 \begin_layout Standard
1025 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1026  for dumps.
1027  Range 0-8191.
1028  Default is 0.
1029 \end_layout
1031 \begin_layout Subsubsection
1032 avi-maxframes
1033 \end_layout
1035 \begin_layout Standard
1036 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1037  Range 0-999999999.
1038  Default is 0.
1039 \end_layout
1041 \begin_layout Subsubsection
1042 avi-compresison
1043 \end_layout
1045 \begin_layout Standard
1046 AVI dumper: Compression level (0-18).
1047 \end_layout
1049 \begin_layout Itemize
1050 Compression levels 10 and above are not compatible with stock CSCD codec.
1051 \end_layout
1053 \begin_layout Itemize
1054 Recomended level is 7.
1055 \end_layout
1057 \begin_layout Subsubsection
1058 avi-soundrate
1059 \end_layout
1061 \begin_layout Standard
1062 AVI dumper: Set method of determining the sound rate.
1063 \end_layout
1065 \begin_layout Itemize
1066 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1067  128, 176.4 and 192 kHz.
1068 \end_layout
1070 \begin_layout Itemize
1071 1: Round down to nearest integer.
1072 \end_layout
1074 \begin_layout Itemize
1075 2: Round up to nearest ingeter.
1076 \end_layout
1078 \begin_layout Itemize
1079 3: Multiply by denominator.
1080 \end_layout
1082 \begin_layout Itemize
1083 4: High quality 44.1kHz (SRC needed).
1084 \end_layout
1086 \begin_layout Itemize
1087 5: High quality 48kHz (SRC needed).
1088 \end_layout
1090 \begin_layout Subsection
1091 JMD options
1092 \end_layout
1094 \begin_layout Subsubsection
1095 jmd-compression
1096 \end_layout
1098 \begin_layout Standard
1099 JMD dumper: Compression level (0-9).
1100 \end_layout
1102 \begin_layout Section
1103 Movie editor
1104 \end_layout
1106 \begin_layout Itemize
1107 The editor edits in-memory movie.
1108 \end_layout
1110 \begin_layout Itemize
1111 Because past can't be edited and readwrite mode doesn't allow future, editing
1112  only works in 
1113 \emph on
1114 read only
1115 \emph default
1116  mode.
1117 \end_layout
1119 \begin_layout Itemize
1120 Keyboard triggers the normal hotkeys and bindings.
1121 \end_layout
1123 \begin_layout Subsection
1124 Left button actions
1125 \end_layout
1127 \begin_layout Itemize
1128 Clicking on cell in future (indicated by lack of redish background) toggles
1129  it (if it is a button) or prompts for a value (if it is an axis)
1130 \end_layout
1132 \begin_layout Itemize
1133 Dragging vertically toggles sequence of buttons or changes a sequence of
1134  axis values.
1135 \end_layout
1137 \begin_layout Subsection
1138 Right button actions
1139 \end_layout
1141 \begin_layout Standard
1142 The right mouse button pops up a context-sensitive menu:
1143 \end_layout
1145 \begin_layout Itemize
1146 Toggle <something>: Toggle this button
1147 \end_layout
1149 \begin_layout Itemize
1150 Change <something>: Change this axis value
1151 \end_layout
1153 \begin_layout Itemize
1154 Insert frame after: Insert a frame after this frame
1155 \end_layout
1157 \begin_layout Itemize
1158 Append frame: Append a frame to movie
1159 \end_layout
1161 \begin_layout Itemize
1162 Append frames: Append specified number of frames to movie
1163 \end_layout
1165 \begin_layout Itemize
1166 Delete frame: Delete this frame
1167 \end_layout
1169 \begin_layout Itemize
1170 Delete subframe: Delete this subframe
1171 \end_layout
1173 \begin_layout Itemize
1174 Truncate movie: Delete this subframe and everything after it.
1175 \end_layout
1177 \begin_layout Itemize
1178 Scroll to frame: Prompt for a frame and scroll the display to that frame.
1179 \end_layout
1181 \begin_layout Itemize
1182 Scroll to current frame: Scroll the display to current position
1183 \end_layout
1185 \begin_layout Itemize
1186 Run to frame: Prompts for frame and runs the emulation to that frame.
1187 \end_layout
1189 \begin_layout Itemize
1190 Change number of lines visible: Change the height of the movie display (1
1191  to 255).
1192 \end_layout
1194 \begin_layout Itemize
1195 Lock scroll to playback: While playing back or rewinding movies, the display
1196  will follow if enabled.
1197 \end_layout
1199 \begin_layout Section
1200 Memory watch expression syntax
1201 \end_layout
1203 \begin_layout Standard
1204 Memory watch expressions has the following syntax elements:
1205 \end_layout
1207 \begin_layout LyX-Code
1208 ${foo}     The value of memory watch foo.
1209 \end_layout
1211 \begin_layout LyX-Code
1212 0x1234     Hexadecimal number 1234
1213 \end_layout
1215 \begin_layout LyX-Code
1216 12345      Decimal number 12345
1217 \end_layout
1219 \begin_layout LyX-Code
1220 3.141      Decimal number 3.141
1221 \end_layout
1223 \begin_layout LyX-Code
1224 -a         Unary negation
1225 \end_layout
1227 \begin_layout LyX-Code
1228 ~a         Bitwise NOT (integers only)
1229 \end_layout
1231 \begin_layout LyX-Code
1232 a*b        Multiplication
1233 \end_layout
1235 \begin_layout LyX-Code
1236 a/b        Division/quotent
1237 \end_layout
1239 \begin_layout LyX-Code
1240 a%b        Remainder (integers only)
1241 \end_layout
1243 \begin_layout LyX-Code
1244 a+b        Sum or string concatenation
1245 \end_layout
1247 \begin_layout LyX-Code
1248 a-b        Difference
1249 \end_layout
1251 \begin_layout LyX-Code
1252 a<<b       Shift left (integers only)
1253 \end_layout
1255 \begin_layout LyX-Code
1256 a>>b       Shift right (integers only).
1257  Arithmetic for signed.
1258 \end_layout
1260 \begin_layout LyX-Code
1261 a<b        Less than
1262 \end_layout
1264 \begin_layout LyX-Code
1265 a<=b       Less or equal to
1266 \end_layout
1268 \begin_layout LyX-Code
1269 a==b       Equal to
1270 \end_layout
1272 \begin_layout LyX-Code
1273 a!=b       Not equal to
1274 \end_layout
1276 \begin_layout LyX-Code
1277 a>=b       Greater or equal to
1278 \end_layout
1280 \begin_layout LyX-Code
1281 a>b        Greater than
1282 \end_layout
1284 \begin_layout LyX-Code
1285 a&b        Bitwise AND (integers only)
1286 \end_layout
1288 \begin_layout LyX-Code
1289 a^b        Bitwise XOR (integers only)
1290 \end_layout
1292 \begin_layout LyX-Code
1293 a|b        Bitwise OR (integers only)
1294 \end_layout
1296 \begin_layout LyX-Code
1297 a&&b       Logical AND
1298 \end_layout
1300 \begin_layout LyX-Code
1301 a||b       Logical OR
1302 \end_layout
1304 \begin_layout LyX-Code
1305 Ï€          Numeric constant pi.
1306 \end_layout
1308 \begin_layout LyX-Code
1309 i          Imaginary unit
1310 \end_layout
1312 \begin_layout LyX-Code
1313 if(x,y)    If x is true, y, else false.
1314 \end_layout
1316 \begin_layout LyX-Code
1317 if(x,y,z)  If x is true, y, else z.
1318 \end_layout
1320 \begin_layout LyX-Code
1321 select(x...)
1322 \end_layout
1324 \begin_layout LyX-Code
1325            First value in x...
1326  that is not false, or false if none.
1327 \end_layout
1329 \begin_layout LyX-Code
1330 unsigned(x)
1331 \end_layout
1333 \begin_layout LyX-Code
1334            Cast x to unsigned.
1335 \end_layout
1337 \begin_layout LyX-Code
1338 signed(x)
1339 \end_layout
1341 \begin_layout LyX-Code
1342            Cast x to signed.
1343 \end_layout
1345 \begin_layout LyX-Code
1346 float(x)
1347 \end_layout
1349 \begin_layout LyX-Code
1350            Cast x to float.
1351 \end_layout
1353 \begin_layout LyX-Code
1354 min(x...)  The smallest value among x...
1355  or false if empty.
1356 \end_layout
1358 \begin_layout LyX-Code
1359 max(x...)  The largest value among x...
1360  or false if empty.
1361 \end_layout
1363 \begin_layout LyX-Code
1364 sum(x...)  Sum/concatenation of x...
1365  or false if empty.
1366 \end_layout
1368 \begin_layout LyX-Code
1369 prod(x...) Product of x...
1370  or false if empty.
1371 \end_layout
1373 \begin_layout LyX-Code
1374 sqrt(x)    Square root of x.
1375 \end_layout
1377 \begin_layout LyX-Code
1378 log(x)     Natural log of x.
1379 \end_layout
1381 \begin_layout LyX-Code
1382 log(x,y)   Log of y to base x.
1383 \end_layout
1385 \begin_layout LyX-Code
1386 exp(x)     e^x.
1387 \end_layout
1389 \begin_layout LyX-Code
1390 exp(x,y)   x^y
1391 \end_layout
1393 \begin_layout LyX-Code
1394 sin(x)     Sine of x
1395 \end_layout
1397 \begin_layout LyX-Code
1398 cos(x)     Cosine of x
1399 \end_layout
1401 \begin_layout LyX-Code
1402 tan(x)     Tangent of x
1403 \end_layout
1405 \begin_layout LyX-Code
1406 asin(x)    Arcsine of x
1407 \end_layout
1409 \begin_layout LyX-Code
1410 acos(x)    Arccosine of x
1411 \end_layout
1413 \begin_layout LyX-Code
1414 atan(x)    Arctangent of x
1415 \end_layout
1417 \begin_layout LyX-Code
1418 atan(x,y)  Angle between vector (x,y) and x-axis.
1419 \end_layout
1421 \begin_layout LyX-Code
1422 sinh(x)    Hyperbolic sine of x
1423 \end_layout
1425 \begin_layout LyX-Code
1426 cosh(x)    Hyperbolic cosine of x
1427 \end_layout
1429 \begin_layout LyX-Code
1430 tanh(x)    Hyperbolic tangent of x
1431 \end_layout
1433 \begin_layout LyX-Code
1434 arsinh(x)  Hyperbolic arsine of x
1435 \end_layout
1437 \begin_layout LyX-Code
1438 arcosh(x)  Hyperbolic arcosine of x
1439 \end_layout
1441 \begin_layout LyX-Code
1442 artanh(x)  Hyperbolic artangent of x
1443 \end_layout
1445 \begin_layout LyX-Code
1446 torad(x)   Convert x degrees to radians.
1447 \end_layout
1449 \begin_layout LyX-Code
1450 todeg(x)   Convert x radians to degrees.
1451 \end_layout
1453 \begin_layout LyX-Code
1454 re(x)      Real part of complex number x.
1455 \end_layout
1457 \begin_layout LyX-Code
1458 im(x)      Imaginary part of complex number x.
1459 \end_layout
1461 \begin_layout LyX-Code
1462 conj(x)    Complex conjugate of x.
1463 \end_layout
1465 \begin_layout LyX-Code
1466 abs(x)     Absolute value of x.
1467 \end_layout
1469 \begin_layout LyX-Code
1470 arg(x)     Argument of x.
1471 \end_layout
1473 \begin_layout LyX-Code
1474 pyth(x...) sqrt(sum(x^2)).
1475  I.e.
1476  pythagorean distance.
1477 \end_layout
1479 \begin_layout LyX-Code
1480 e          Base of natural logarithm
1481 \end_layout
1483 \begin_layout LyX-Code
1484 pi         Pi
1485 \end_layout
1487 \begin_layout LyX-Code
1488 true       Constant true
1489 \end_layout
1491 \begin_layout LyX-Code
1492 false      Constant false
1493 \end_layout
1495 \begin_layout LyX-Code
1497 \end_layout
1499 \begin_layout Section
1500 Modifier and key names:
1501 \end_layout
1503 \begin_layout Subsection
1504 wxWidgets platform
1505 \end_layout
1507 \begin_layout Subsubsection
1508 Modifier names:
1509 \end_layout
1511 \begin_layout Standard
1512 Following modifier names are known:
1513 \end_layout
1515 \begin_layout Itemize
1517 \end_layout
1519 \begin_layout Itemize
1520 ctrl
1521 \end_layout
1523 \begin_layout Itemize
1524 shift 
1525 \end_layout
1527 \begin_layout Itemize
1528 meta
1529 \end_layout
1531 \begin_layout Itemize
1532 cmd (Mac OS X only)
1533 \end_layout
1535 \begin_layout Subsubsection
1536 Key names:
1537 \end_layout
1539 \begin_layout Standard
1540 Following key names are known:
1541 \end_layout
1543 \begin_layout Itemize
1544 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
1545  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
1546  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
1547  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1548  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
1549  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
1550  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
1551  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
1552  pause, capital, end, home, lefT, up, right, down, select, print, execute,
1553  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
1554  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
1555  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1556  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
1557  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
1558  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
1559  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
1560  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
1561  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
1562  windows_right, windows_menu, command, special1, special2, special3, special4,
1563  special5, special6, special7, special8, special9, special10, special11,
1564  special12, special13, special14, special15, special16, special17, special18,
1565  special19, special20
1566 \end_layout
1568 \begin_layout Section
1569 Movie file format
1570 \end_layout
1572 \begin_layout Standard
1573 Movie file is .zip archive in itself, normal ZIP archive tools work on it
1574  (note: If you recompress it, do not use compression methods other than
1575  store and deflate and especially do not use encryption of any kind).
1576 \end_layout
1578 \begin_layout Subsection
1579 Detecting clean start/SRAM/Savestate
1580 \end_layout
1582 \begin_layout Itemize
1583 If file has member 
1584 \begin_inset Quotes eld
1585 \end_inset
1587 savestate
1588 \begin_inset Quotes erd
1589 \end_inset
1591  it is savestate, otherwise:
1592 \end_layout
1594 \begin_layout Itemize
1595 If file has members with names starting 
1596 \begin_inset Quotes eld
1597 \end_inset
1599 moviesram.
1600 \begin_inset Quotes erd
1601 \end_inset
1603  it is movie starting from SRAM, otherwise:
1604 \end_layout
1606 \begin_layout Itemize
1607 It is movie starting from clear state.
1608 \end_layout
1610 \begin_layout Subsection
1611 Member: gametype
1612 \end_layout
1614 \begin_layout Standard
1615 Type of game ROM and region (as one line).
1616  Valid values are:
1617 \end_layout
1619 \begin_layout Standard
1620 \begin_inset Tabular
1621 <lyxtabular version="3" rows="8" columns="3">
1622 <features tabularvalignment="middle">
1623 <column alignment="center" valignment="top" width="0">
1624 <column alignment="center" valignment="top" width="0">
1625 <column alignment="center" valignment="top" width="0">
1626 <row>
1627 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1628 \begin_inset Text
1630 \begin_layout Plain Layout
1631 Value
1632 \end_layout
1634 \end_inset
1635 </cell>
1636 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1637 \begin_inset Text
1639 \begin_layout Plain Layout
1640 System
1641 \end_layout
1643 \end_inset
1644 </cell>
1645 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1646 \begin_inset Text
1648 \begin_layout Plain Layout
1649 Region
1650 \end_layout
1652 \end_inset
1653 </cell>
1654 </row>
1655 <row>
1656 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1657 \begin_inset Text
1659 \begin_layout Plain Layout
1660 snes_pal
1661 \end_layout
1663 \end_inset
1664 </cell>
1665 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1666 \begin_inset Text
1668 \begin_layout Plain Layout
1669 Super NES
1670 \end_layout
1672 \end_inset
1673 </cell>
1674 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1675 \begin_inset Text
1677 \begin_layout Plain Layout
1679 \end_layout
1681 \end_inset
1682 </cell>
1683 </row>
1684 <row>
1685 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1686 \begin_inset Text
1688 \begin_layout Plain Layout
1689 sgb_pal
1690 \end_layout
1692 \end_inset
1693 </cell>
1694 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1695 \begin_inset Text
1697 \begin_layout Plain Layout
1698 Super Game Boy
1699 \end_layout
1701 \end_inset
1702 </cell>
1703 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1704 \begin_inset Text
1706 \begin_layout Plain Layout
1708 \end_layout
1710 \end_inset
1711 </cell>
1712 </row>
1713 <row>
1714 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1715 \begin_inset Text
1717 \begin_layout Plain Layout
1718 snes_ntsc
1719 \end_layout
1721 \end_inset
1722 </cell>
1723 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1724 \begin_inset Text
1726 \begin_layout Plain Layout
1727 Super NES
1728 \end_layout
1730 \end_inset
1731 </cell>
1732 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1733 \begin_inset Text
1735 \begin_layout Plain Layout
1736 NTSC
1737 \end_layout
1739 \end_inset
1740 </cell>
1741 </row>
1742 <row>
1743 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1744 \begin_inset Text
1746 \begin_layout Plain Layout
1747 sgb_ntsc
1748 \end_layout
1750 \end_inset
1751 </cell>
1752 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1753 \begin_inset Text
1755 \begin_layout Plain Layout
1756 Super Game Boy
1757 \end_layout
1759 \end_inset
1760 </cell>
1761 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1762 \begin_inset Text
1764 \begin_layout Plain Layout
1765 NTSC
1766 \end_layout
1768 \end_inset
1769 </cell>
1770 </row>
1771 <row>
1772 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1773 \begin_inset Text
1775 \begin_layout Plain Layout
1777 \end_layout
1779 \end_inset
1780 </cell>
1781 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1782 \begin_inset Text
1784 \begin_layout Plain Layout
1785 BS-X (non-slotted)
1786 \end_layout
1788 \end_inset
1789 </cell>
1790 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1791 \begin_inset Text
1793 \begin_layout Plain Layout
1794 NTSC
1795 \end_layout
1797 \end_inset
1798 </cell>
1799 </row>
1800 <row>
1801 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1802 \begin_inset Text
1804 \begin_layout Plain Layout
1805 bsxslotted
1806 \end_layout
1808 \end_inset
1809 </cell>
1810 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1811 \begin_inset Text
1813 \begin_layout Plain Layout
1814 BS-X (slotted)
1815 \end_layout
1817 \end_inset
1818 </cell>
1819 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1820 \begin_inset Text
1822 \begin_layout Plain Layout
1823 NTSC
1824 \end_layout
1826 \end_inset
1827 </cell>
1828 </row>
1829 <row>
1830 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1831 \begin_inset Text
1833 \begin_layout Plain Layout
1834 sufamiturbo
1835 \end_layout
1837 \end_inset
1838 </cell>
1839 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1840 \begin_inset Text
1842 \begin_layout Plain Layout
1843 Sufami Turbo
1844 \end_layout
1846 \end_inset
1847 </cell>
1848 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1849 \begin_inset Text
1851 \begin_layout Plain Layout
1852 NTSC
1853 \end_layout
1855 \end_inset
1856 </cell>
1857 </row>
1858 </lyxtabular>
1860 \end_inset
1863 \end_layout
1865 \begin_layout Standard
1866 Frame rates are:
1867 \end_layout
1869 \begin_layout Standard
1870 \begin_inset Tabular
1871 <lyxtabular version="3" rows="3" columns="2">
1872 <features tabularvalignment="middle">
1873 <column alignment="center" valignment="top" width="0">
1874 <column alignment="center" valignment="top" width="0">
1875 <row>
1876 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1877 \begin_inset Text
1879 \begin_layout Plain Layout
1880 Region
1881 \end_layout
1883 \end_inset
1884 </cell>
1885 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1886 \begin_inset Text
1888 \begin_layout Plain Layout
1889 Framerate (fps)
1890 \end_layout
1892 \end_inset
1893 </cell>
1894 </row>
1895 <row>
1896 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1897 \begin_inset Text
1899 \begin_layout Plain Layout
1901 \end_layout
1903 \end_inset
1904 </cell>
1905 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1906 \begin_inset Text
1908 \begin_layout Plain Layout
1909 322445/6448
1910 \end_layout
1912 \end_inset
1913 </cell>
1914 </row>
1915 <row>
1916 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1917 \begin_inset Text
1919 \begin_layout Plain Layout
1920 NTSC
1921 \end_layout
1923 \end_inset
1924 </cell>
1925 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1926 \begin_inset Text
1928 \begin_layout Plain Layout
1929 10738636/178683
1930 \end_layout
1932 \end_inset
1933 </cell>
1934 </row>
1935 </lyxtabular>
1937 \end_inset
1940 \end_layout
1942 \begin_layout Subsection
1943 Member: port1
1944 \end_layout
1946 \begin_layout Standard
1947 Contains type of port #1 (as one line).
1948  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
1949  If not present, defaults to 'gamepad'.
1950 \end_layout
1952 \begin_layout Subsection
1953 Member: port2
1954 \end_layout
1956 \begin_layout Standard
1957 Contains type of port #2 (as one line).
1958  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
1959  'justifier' and 'justifiers'.
1960  If not present, defaults to 'none'.
1961 \end_layout
1963 \begin_layout Subsection
1964 Member: gamename
1965 \end_layout
1967 \begin_layout Standard
1968 Contains name of the game (as one line).
1969 \end_layout
1971 \begin_layout Subsection
1972 Member: authors
1973 \end_layout
1975 \begin_layout Standard
1976 Contains authors, one per line.
1977  Part before '|' is the full name, part after is the nickname.
1978 \end_layout
1980 \begin_layout Subsection
1981 Member: systemid
1982 \end_layout
1984 \begin_layout Standard
1985 Always 
1986 \begin_inset Quotes eld
1987 \end_inset
1989 lsnes-rr1
1990 \begin_inset Quotes erd
1991 \end_inset
1993  (one line).
1994  Used to reject other saves.
1995 \end_layout
1997 \begin_layout Subsection
1998 Member: controlsversion
1999 \end_layout
2001 \begin_layout Standard
2002 Always 
2003 \begin_inset Quotes eld
2004 \end_inset
2007 \begin_inset Quotes erd
2008 \end_inset
2010  (one line).
2011  Used to identify what controls are there.
2012 \end_layout
2014 \begin_layout Subsection
2015 Member: 
2016 \begin_inset Quotes eld
2017 \end_inset
2019 coreversion
2020 \begin_inset Quotes erd
2021 \end_inset
2024 \end_layout
2026 \begin_layout Standard
2027 Contains bsnes core version number (as one line).
2028 \end_layout
2030 \begin_layout Subsection
2031 Member: projectid
2032 \end_layout
2034 \begin_layout Standard
2035 Contains project ID (as one line).
2036  Used to identify if two movies are part of the same project.
2037 \end_layout
2039 \begin_layout Subsection
2040 Member: {rom,slota,slotb}{,xml}.sha256
2041 \end_layout
2043 \begin_layout Standard
2044 Contains SHA-256 of said ROM or ROM mapping file (as one line).
2045  Absent if corresponding file is absent.
2046 \end_layout
2048 \begin_layout Subsection
2049 Member: moviesram.<name>
2050 \end_layout
2052 \begin_layout Standard
2053 Raw binary startup SRAM of kind <name>.
2054  Only present in savestates and movies starting from SRAM.
2055 \end_layout
2057 \begin_layout Subsection
2058 Member: saveframe
2059 \end_layout
2061 \begin_layout Standard
2062 Contains frame number (as one line) of frame movie was saved on.
2063  Only present in savestates.
2064 \end_layout
2066 \begin_layout Subsection
2067 Member: lagcounter
2068 \end_layout
2070 \begin_layout Standard
2071 Current value of lag counter (as one line).
2072  Only present in savestates.
2073 \end_layout
2075 \begin_layout Subsection
2076 Member: pollcounters
2077 \end_layout
2079 \begin_layout Standard
2080 Contains poll counters (currently 100 of them), one per line.
2081  Each line is raw poll count if DRDY is set for it.
2082  Otherwise it is negative poll count minus one.
2083  Only present in savestates.
2084 \end_layout
2086 \begin_layout Subsection
2087 Member: hostmemory
2088 \end_layout
2090 \begin_layout Standard
2091 Raw binary dump of host memory.
2092  Only present in savestates.
2093 \end_layout
2095 \begin_layout Subsection
2096 Member: savestate
2097 \end_layout
2099 \begin_layout Standard
2100 The raw binary savestate itself.
2101  Savestate detection uses this file, only present in savestates.
2102 \end_layout
2104 \begin_layout Subsection
2105 Member: screenshot
2106 \end_layout
2108 \begin_layout Standard
2109 Screenshot of current frame.
2110  Only present in savestates.
2111  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
2112  data.
2113  Height of image is inferred from the width and size of data.
2114 \end_layout
2116 \begin_layout Subsection
2117 Member: sram.<name>
2118 \end_layout
2120 \begin_layout Standard
2121 Raw binary SRAM of kind <name> at time of savestate.
2122  Only present in savestates.
2123 \end_layout
2125 \begin_layout Subsection
2126 Member: input
2127 \end_layout
2129 \begin_layout Standard
2130 The actual input track, one line per subframe (blank lines are skipped).
2131 \end_layout
2133 \begin_layout Itemize
2134 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
2135  part of same frame as previous, otherwise it starts a new frame.
2136 \end_layout
2138 \begin_layout Itemize
2139 First subframe must start a new frame.
2140 \end_layout
2142 \begin_layout Standard
2143 Length of movie in frames is number of lines in input file that start a
2144  new frame.
2145 \end_layout
2147 \begin_layout Subsection
2148 Member: subtitles
2149 \end_layout
2151 \begin_layout Standard
2152 Subtitle track.
2153  Optional.
2154 \end_layout
2156 \begin_layout Itemize
2157 Each line is in form <firstframe> <numframes> <text>.
2158 \end_layout
2160 \begin_layout Itemize
2161 Linefeed is encoded as 
2162 \backslash
2163 n, backslash is encoded as 
2164 \backslash
2166 \backslash
2168 \end_layout
2170 \begin_layout Subsection
2171 Member: rerecords
2172 \end_layout
2174 \begin_layout Standard
2175 Contains textual base-10 rerecord count (as one line; emulator just writes
2176  this, it doesn't read it) + 1.
2177 \end_layout
2179 \begin_layout Subsection
2180 Member: rrdata
2181 \end_layout
2183 \begin_layout Standard
2184 This member stores set of load IDs.
2185  There is one load ID per rerecord (plus one corresponding to start of project).
2186 \end_layout
2188 \begin_layout Itemize
2189 This member constists of concatenation of records
2190 \end_layout
2192 \begin_layout Itemize
2193 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
2194  IDs.
2195 \end_layout
2197 \begin_layout Itemize
2198 IDs are interpretted as 256-bit big-endian integers with warparound.
2199 \end_layout
2201 \begin_layout Itemize
2202 Initial predicted ID is all zeroes.
2203 \end_layout
2205 \begin_layout Standard
2206 Format of each record is:
2207 \end_layout
2209 \begin_layout Itemize
2210 1 byte: Opcode byte.
2211  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
2212  Bit 7 is unused.
2213 \end_layout
2215 \begin_layout Itemize
2216 32-prefixlen bytes of ID.
2217 \end_layout
2219 \begin_layout Itemize
2220 countlen bytes of big-endian count (count).
2221 \end_layout
2223 \begin_layout Standard
2224 Records are processed as follows:
2225 \end_layout
2227 \begin_layout Itemize
2228 To form the first ID encoded by record, take the first prefixlen bytes predicted
2229  ID and append the read ID value to it.
2230  The result is the first ID encoded.
2231 \end_layout
2233 \begin_layout Itemize
2234 If countlen is 0, record encodes 1 ID.
2235 \end_layout
2237 \begin_layout Itemize
2238 If countlen is 1, record encodes 2+count IDs.
2239 \end_layout
2241 \begin_layout Itemize
2242 If countlen is 2, record encodes 258+count IDs.
2243 \end_layout
2245 \begin_layout Itemize
2246 If countlen is 3, record encodes 65794+count IDs.
2247 \end_layout
2249 \begin_layout Itemize
2250 The new predicted ID is the next ID after last one encoded by the record.
2251 \end_layout
2253 \begin_layout Standard
2254 The number of rerecords + 1 is equal to the sum of number of IDs encoded
2255  by all records.
2256 \end_layout
2258 \begin_layout Subsection
2259 Member: starttime.second
2260 \end_layout
2262 \begin_layout Standard
2263 Movie starting time, second part.
2264  Epoch is Unix epoch.
2265  Default is 1,000,000,000.
2266 \end_layout
2268 \begin_layout Subsection
2269 Member: starttime.subsecond
2270 \end_layout
2272 \begin_layout Standard
2273 Movie starting time, subsecond part.
2274  Unit is CPU clocks.
2275  Default is 0.
2276 \end_layout
2278 \begin_layout Subsection
2279 Member: savetime.second
2280 \end_layout
2282 \begin_layout Standard
2283 Movie saving time, second part.
2284  Default is starttime.second.
2285  Only present in savestates.
2286 \end_layout
2288 \begin_layout Subsection
2289 Member: savetime.subsecond
2290 \end_layout
2292 \begin_layout Standard
2293 Movie saving time, subsecond part.
2294  Default is starttime.subsecond.
2295  Only present in savestates.
2296 \end_layout
2298 \begin_layout Section
2299 lsvs file format (commentary tracks)
2300 \end_layout
2302 \begin_layout Subsection
2303 Clusters
2304 \end_layout
2306 \begin_layout Itemize
2307 Each cluster is 8kB (8192 bytes) in size.
2308 \end_layout
2310 \begin_layout Itemize
2311 Cluster n starts at offset 8192*n in file.
2312 \end_layout
2314 \begin_layout Itemize
2315 The following clusters are system special:
2316 \end_layout
2318 \begin_deeper
2319 \begin_layout Itemize
2320 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
2321 \end_layout
2323 \begin_layout Itemize
2324 Cluster 1 (superblock)
2325 \end_layout
2327 \end_deeper
2328 \begin_layout Subsection
2329 Cluster tables
2330 \end_layout
2332 \begin_layout Itemize
2333 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
2334  last 11 bits of n).
2335 \end_layout
2337 \begin_layout Itemize
2338 This cluster table consists of 2048 4-byte big-endian integers.
2339 \end_layout
2341 \begin_layout Itemize
2342 Each entry describes a cluster in 16MB supercluster, in order.
2343 \end_layout
2345 \begin_layout Itemize
2346 The valid values for entries are:
2347 \end_layout
2349 \begin_deeper
2350 \begin_layout Itemize
2351 0x00000000: Free cluster
2352 \end_layout
2354 \begin_layout Itemize
2355 0x00000001: Last cluster in chain.
2356 \end_layout
2358 \begin_layout Itemize
2359 0xFFFFFFFF: System cluster (cluster tables and superblock)
2360 \end_layout
2362 \begin_layout Itemize
2363 (anything else): Number of next cluster in chain.
2364  Must not be multiple of 2048.
2365 \end_layout
2367 \end_deeper
2368 \begin_layout Itemize
2369 Due to limitations of the format, there can be at most 2097052 superclusters,
2370  giving maximum file size of 16TB.
2371 \end_layout
2373 \begin_layout Subsection
2374 Stream table
2375 \end_layout
2377 \begin_layout Itemize
2378 The stream table chain always starts in cluster 2.
2379 \end_layout
2381 \begin_layout Itemize
2382 Otherwise, it follows normal chaining.
2383 \end_layout
2385 \begin_layout Itemize
2386 The stream table consists of 16-byte entries:
2387 \end_layout
2389 \begin_deeper
2390 \begin_layout Itemize
2391 The first 8 bytes of entry give big-endian beginning position of stream
2392  in units of 1/48000 s.
2393 \end_layout
2395 \begin_layout Itemize
2396 The next 4 bytes of entry give big-endian beginning cluster for control
2397  data.
2398  0 here marks the entry as not present.
2399 \end_layout
2401 \begin_layout Itemize
2402 The last 4 bytes of entry give big-endian beginning cluster for codec data.
2403 \end_layout
2405 \end_deeper
2406 \begin_layout Itemize
2407 Stream table clusters are normal clusters, following normal chaining.
2408 \end_layout
2410 \begin_layout Itemize
2411 The stream begnning position is not guarenteed unique.
2412  There can be multiple streams with the same starting position in the file.
2413 \end_layout
2415 \begin_layout Subsection
2416 Stream control data
2417 \end_layout
2419 \begin_layout Itemize
2420 The stream control data consists of entries 4 bytes each:
2421 \end_layout
2423 \begin_deeper
2424 \begin_layout Itemize
2425 The first 2 bytes of entry gives big-endian length of packet
2426 \end_layout
2428 \begin_layout Itemize
2429 The next byte of entry gives audio length of packet in units of 1/400 s.
2430 \end_layout
2432 \begin_layout Itemize
2433 The last byte is control byte.
2434 \end_layout
2436 \begin_deeper
2437 \begin_layout Itemize
2438 0 means this entry is not present and the control data ends.
2439 \end_layout
2441 \begin_layout Itemize
2442 1 is valid control entry.
2443 \end_layout
2445 \end_deeper
2446 \end_deeper
2447 \begin_layout Itemize
2448 The stream control data can also end by running into end of the readable
2449  chain.
2450 \end_layout
2452 \begin_deeper
2453 \begin_layout Itemize
2454 This happens if there happens to be exact multiple of 2048 packets in stream
2455  and number of packets is nonzero.
2456 \end_layout
2458 \end_deeper
2459 \begin_layout Itemize
2460 These clusters follow normal chaining.
2461 \end_layout
2463 \begin_layout Subsection
2464 Stream codec data
2465 \end_layout
2467 \begin_layout Itemize
2468 Stream codec data consists of raw Opus data packets packed back to back
2469  with nothing in between.
2470 \end_layout
2472 \begin_layout Itemize
2473 Warning: Due to internal limitations, this data must reside in the first
2474  65536 superclusters (that is, the first 1TB of the file).
2475 \end_layout
2477 \begin_layout Subsection
2478 Superblock
2479 \end_layout
2481 \begin_layout Itemize
2482 The superblock is stored in cluster 1.
2484 \end_layout
2486 \begin_layout Itemize
2487 The first 11 bytes are 
2488 \begin_inset Quotes eld
2489 \end_inset
2491 sefs-magic
2492 \begin_inset Quotes erd
2493 \end_inset
2495 <NUL>.
2496 \end_layout
2498 \begin_layout Itemize
2499 The rest are unused.
2500 \end_layout
2502 \begin_layout Itemize
2503 This cluster 1 is marked as system special.
2504 \end_layout
2506 \begin_layout Section
2507 Known ROM extensions
2508 \end_layout
2510 \begin_layout Itemize
2511 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
2512 \end_layout
2514 \begin_layout Itemize
2515 DMG cartridge ROMs: dmg, gb.
2516 \end_layout
2518 \begin_layout Itemize
2519 GBC cartridge ROMs: cgb, gbc.
2520 \end_layout
2522 \begin_layout Section
2523 Gamepack files
2524 \end_layout
2526 \begin_layout Itemize
2527 The first line must be: 
2528 \begin_inset Quotes eld
2529 \end_inset
2531 [GAMEPACK FILE]
2532 \begin_inset Quotes erd
2533 \end_inset
2536 \end_layout
2538 \begin_layout Itemize
2539 There is one needed line: 
2540 \begin_inset Quotes eld
2541 \end_inset
2543 type <systype>
2544 \begin_inset Quotes erd
2545 \end_inset
2548  This sets system type to <systype>.
2549  The following system types are valid:
2550 \end_layout
2552 \begin_deeper
2553 \begin_layout Itemize
2554 snes (SNES)
2555 \end_layout
2557 \begin_layout Itemize
2558 bsx (BS-X non-slotted)
2559 \end_layout
2561 \begin_layout Itemize
2562 bsxslotted (BS-X slotted)
2563 \end_layout
2565 \begin_layout Itemize
2566 sufamiturbo (Sufami Turbo)
2567 \end_layout
2569 \begin_layout Itemize
2570 sgb (Super Game Boy)
2571 \end_layout
2573 \begin_layout Itemize
2574 dmg (Game Boy)
2575 \end_layout
2577 \begin_layout Itemize
2578 gbc (Game Boy Color)
2579 \end_layout
2581 \begin_layout Itemize
2582 gbc_gba (Game Boy Color with GBA initial register values)
2583 \end_layout
2585 \end_deeper
2586 \begin_layout Itemize
2587 Optionally a region can be specified: 
2588 \begin_inset Quotes eld
2589 \end_inset
2591 region <region>
2592 \begin_inset Quotes erd
2593 \end_inset
2596  The following values are valid:
2597 \end_layout
2599 \begin_deeper
2600 \begin_layout Itemize
2601 autodetect (Autodetect region: snes and sgb only)
2602 \end_layout
2604 \begin_layout Itemize
2605 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
2606 \end_layout
2608 \begin_layout Itemize
2609 pal (PAL: snes, sgb)
2610 \end_layout
2612 \begin_layout Itemize
2613 world (World: dmg, gbc, gbc_gba)
2614 \end_layout
2616 \end_deeper
2617 \begin_layout Itemize
2618 ROM images are loaded as: 
2619 \begin_inset Quotes eld
2620 \end_inset
2622 rom <type> <file>
2623 \begin_inset Quotes erd
2624 \end_inset
2627  The following types are valid:
2628 \end_layout
2630 \begin_deeper
2631 \begin_layout Itemize
2632 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
2633  BIOS in bsx, bsxslotted, sufamiturbo)
2634 \end_layout
2636 \begin_layout Itemize
2637 bsx (Cartridge ROM in bsx, bsxslotted)
2638 \end_layout
2640 \begin_layout Itemize
2641 slot-a (Cartridge ROM in sufamiturbo)
2642 \end_layout
2644 \begin_layout Itemize
2645 slot-b (Cartridge ROM in sufamiturbo)
2646 \end_layout
2648 \end_deeper
2649 \begin_layout Itemize
2650 ROM markup can be loaded as: 
2651 \begin_inset Quotes eld
2652 \end_inset
2654 xml <type> <file>
2655 \begin_inset Quotes erd
2656 \end_inset
2659  The types valid are the same as for ROMs.
2660 \end_layout
2662 \begin_layout Itemize
2663 Patches can be loaded as 
2664 \begin_inset Quotes eld
2665 \end_inset
2667 patch[<offset>] <type> <file>
2668 \begin_inset Quotes erd
2669 \end_inset
2672  The types are the same as for ROMs.
2673 \end_layout
2675 \begin_deeper
2676 \begin_layout Itemize
2677 Offset is given in form [+-]<number>.
2678  Usually offset is either +0 or -512.
2679 \end_layout
2681 \begin_layout Itemize
2682 Default offset is +0.
2683 \end_layout
2685 \end_deeper
2686 \begin_layout Subsection
2687 Example:
2688 \end_layout
2690 \begin_layout LyX-Code
2691 [GAMEPACK FILE]
2692 \end_layout
2694 \begin_layout LyX-Code
2695 type snes
2696 \end_layout
2698 \begin_layout LyX-Code
2699 rom rom speedygonzales.sfc
2700 \end_layout
2702 \begin_layout LyX-Code
2703 patch-512 rom sonicthehedgehog.ips
2704 \end_layout
2706 \begin_layout Subsection
2707 Example 2:
2708 \end_layout
2710 \begin_layout LyX-Code
2711 [GAMEPACK FILE]
2712 \end_layout
2714 \begin_layout LyX-Code
2715 type sgb
2716 \end_layout
2718 \begin_layout LyX-Code
2719 rom rom supergameboy.sfc
2720 \end_layout
2722 \begin_layout LyX-Code
2723 rom dmg megamanV.dmg
2724 \end_layout
2726 \begin_layout Section
2727 Quick'n'dirty encode guide
2728 \end_layout
2730 \begin_layout Enumerate
2731 Start the emulator and load the ROM and movie file.
2732 \end_layout
2734 \begin_layout Enumerate
2735 Set large AVI option 'set-setting avi-large on'
2736 \end_layout
2738 \begin_layout Enumerate
2739 Enable dumping 'dump-avi tmpdump' 
2740 \end_layout
2742 \begin_layout Enumerate
2743 Unpause and let it run until you want to end dumping.
2744 \end_layout
2746 \begin_layout Enumerate
2747 Close the emulator (closing the window is the easiest way).
2748  Or use 'end-avi'.
2749 \end_layout
2751 \begin_layout Enumerate
2752 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
2753  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
2754 \end_layout
2756 \begin_layout Enumerate
2757 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
2758 \end_layout
2760 \begin_layout Enumerate
2761 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
2762  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
2763 \end_layout
2765 \begin_layout Enumerate
2766 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
2767  Now final.mkv contains quick'n'dirty encode.
2768 \end_layout
2770 \begin_layout Section
2771 Axis configurations for some gamepad types:
2772 \end_layout
2774 \begin_layout Subsection
2775 XBox360 controller:
2776 \end_layout
2778 \begin_layout Standard
2779 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
2780 \end_layout
2782 \begin_layout LyX-Code
2783 set-axis joystick0axis2 pressure-+
2784 \end_layout
2786 \begin_layout LyX-Code
2787 set-axis joystick0axis5 pressure-+
2788 \end_layout
2790 \begin_layout Itemize
2791 This is needed for SDL only.
2792  EVDEV sets those types correctly.
2793 \end_layout
2795 \begin_layout Subsection
2796 PS3 
2797 \begin_inset Quotes eld
2798 \end_inset
2800 sixaxis
2801 \begin_inset Quotes erd
2802 \end_inset
2804  controller:
2805 \end_layout
2807 \begin_layout Standard
2808 Axes 8-19 should be disabled.
2809 \end_layout
2811 \begin_layout LyX-Code
2812 set-axis joystick0axis8 disabled
2813 \end_layout
2815 \begin_layout LyX-Code
2816 set-axis joystick0axis9 disabled
2817 \end_layout
2819 \begin_layout LyX-Code
2820 set-axis joystick0axis10 disabled
2821 \end_layout
2823 \begin_layout LyX-Code
2824 set-axis joystick0axis11 disabled
2825 \end_layout
2827 \begin_layout LyX-Code
2828 set-axis joystick0axis12 disabled
2829 \end_layout
2831 \begin_layout LyX-Code
2832 set-axis joystick0axis13 disabled
2833 \end_layout
2835 \begin_layout LyX-Code
2836 set-axis joystick0axis14 disabled
2837 \end_layout
2839 \begin_layout LyX-Code
2840 set-axis joystick0axis15 disabled
2841 \end_layout
2843 \begin_layout LyX-Code
2844 set-axis joystick0axis16 disabled
2845 \end_layout
2847 \begin_layout LyX-Code
2848 set-axis joystick0axis17 disabled
2849 \end_layout
2851 \begin_layout LyX-Code
2852 set-axis joystick0axis18 disabled
2853 \end_layout
2855 \begin_layout LyX-Code
2856 set-axis joystick0axis19 disabled
2857 \end_layout
2859 \begin_layout Section
2860 Errata:
2861 \end_layout
2863 \begin_layout Subsection
2864 Problems from BSNES core:
2865 \end_layout
2867 \begin_layout Itemize
2868 The whole pending save stuff.
2869 \end_layout
2871 \begin_layout Itemize
2872 It is slow (especially accuracy).
2873 \end_layout
2875 \begin_layout Itemize
2876 Firmwares can't be loaded from ZIP archives.
2877 \end_layout
2879 \begin_layout Subsection
2880 Other problems:
2881 \end_layout
2883 \begin_layout Itemize
2884 Modifiers don't work with pseudo-keys.
2885 \end_layout
2887 \begin_layout Itemize
2888 Audio for last dumped frame is not itself dumped.
2889 \end_layout
2891 \begin_layout Itemize
2892 Audio in UI is pretty bad in quality if game doesn't run at full speed.
2893 \end_layout
2895 \end_body
2896 \end_document