Control bsnes random seeding
[lsnes.git] / manual.lyx
blob5bf54e7e5dbca7fb92bd5516ce59ef8caefa4473
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 Command line options
72 \end_layout
74 \begin_layout Itemize
75 Syntax: lsnes.exe <rom-options> <misc-options> (<new-session-options>|<filename>)
76 \end_layout
78 \begin_layout Itemize
79 Syntax: lsnes-avidump <dump-options> <misc-options> <rom-options> <filename>
80 \end_layout
82 \begin_layout Itemize
83 Syntax: movieinfo.exe <filename>
84 \end_layout
86 \begin_layout Subsection
87 ROM options
88 \end_layout
90 \begin_layout Standard
91 These options control loading the ROM.
92 \end_layout
94 \begin_layout Subsubsection
95 --rom=<file>
96 \end_layout
98 \begin_layout Standard
99 Load <file> (SFC file format) as main SNES cartridge ROM.
100  This is the game ROM for SNES and cartridge BIOS for other types.
101  Required option.
102 \end_layout
104 \begin_layout Subsubsection
105 --rom-xml=<file>
106 \end_layout
108 \begin_layout Standard
109 Set the mapping XML file for main cartridge ROM.
110  If not specified, defaults are used.
111 \end_layout
113 \begin_layout Subsubsection
114 --bsx=<file>
115 \end_layout
117 \begin_layout Standard
118 Load <file> (BS file format) as BS-X non-slotted flash memory.
119  Also sets system type to BS-X non-slotted (not compatible with --bsxslotted=<fi
120 le>, --dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
121 \end_layout
123 \begin_layout Subsubsection
124 --bsx-xml=<file>
125 \end_layout
127 \begin_layout Standard
128 Set mapping XML file for BS-X non-slotted flash memory.
129  If not specified, defaults are used.
130  Only can be used together with --bsx=<file>.
131 \end_layout
133 \begin_layout Subsubsection
134 --bsxslotted=<file>
135 \end_layout
137 \begin_layout Standard
138 Load <file> (BS file format) as BS-X slotted flash memory.
139  Also sets system type to BS-X slotted (not compatible with --bsx=<file>,
140  --dmg=<file>, --slot-a=<file> nor --slot-b=<file>).
141 \end_layout
143 \begin_layout Subsubsection
144 --bsxslotted-xml=<file>
145 \end_layout
147 \begin_layout Standard
148 Set mapping XML file for BS-X slotted flash memory.
149  If not specified, defaults are used.
150  Only can be used together with --bsxslotted=<file>.
151 \end_layout
153 \begin_layout Subsubsection
154 --dmg=<file>
155 \end_layout
157 \begin_layout Standard
158 Load <file> (GB file format) as Game Boy ROM.
159  Also sets system type to SGB (not compatible with --bsx=<file>, --bsxslotted=<f
160 ile>, --slot-a=<file> nor --slot-b=<file>).
161 \end_layout
163 \begin_layout Subsubsection
164 --dmg-xml=<file>
165 \end_layout
167 \begin_layout Standard
168 Set mapping XML file for Game Boy ROM.
169  If not specified, defaults are used.
170  Only can be used together with --dmg=<file>.
171 \end_layout
173 \begin_layout Subsubsection
174 --slot-a=<file>
175 \end_layout
177 \begin_layout Standard
178 Load <file> (ST file format) as Sufami turbo cartridge A ROM.
179  Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
180  --bsxslotted=<file> nor --dmg=<file>).
181 \end_layout
183 \begin_layout Subsubsection
184 --slot-a-xml=<file>
185 \end_layout
187 \begin_layout Standard
188 Set mapping XML file for Sufami turbo cartridge A ROM.
189  If not specified, defaults are used.
190  Only can be used together with --slot-a=<file>.
191 \end_layout
193 \begin_layout Subsubsection
194 --slot-b=<file>
195 \end_layout
197 \begin_layout Standard
198 Load <file> (ST file format) as Sufami turbo cartridge B ROM.
199  Also sets system type to Sufami Turbo (not compatible with --bsx=<file>,
200  --bsxslotted=<file> nor --dmg=<file>).
201 \end_layout
203 \begin_layout Subsubsection
204 --slot-b-xml=<file>
205 \end_layout
207 \begin_layout Standard
208 Set mapping XML file for Sufami turbo cartridge B ROM.
209  If not specified, defaults are used.
210  Only can be used together with --slot-b=<file>.
211 \end_layout
213 \begin_layout Subsubsection
214 --ips-rom=<file>
215 \end_layout
217 \begin_layout Standard
218 Apply IPS patch <file> to main cartridge ROM.
219  Requires --rom=<file>.
220 \end_layout
222 \begin_layout Subsubsection
223 --ips-rom-xml=<file>
224 \end_layout
226 \begin_layout Standard
227 Apply IPS patch <file> to main cartridge ROM mapping XML.
228  Requires --rom-xml=<file>.
229 \end_layout
231 \begin_layout Subsubsection
232 --ips-bsx=<file>
233 \end_layout
235 \begin_layout Standard
236 Apply IPS patch <file> to BS-X non-slotted flash.
237  Requires --bsx=<file>.
238 \end_layout
240 \begin_layout Subsubsection
241 --ips-bsx-xml=<file>
242 \end_layout
244 \begin_layout Standard
245 Apply IPS patch <file> to BS-X non-slotted flash mapping XML.
246  Requires --bsx-xml=<file>.
247 \end_layout
249 \begin_layout Subsubsection
250 --ips-bsxslotted=<file>
251 \end_layout
253 \begin_layout Standard
254 Apply IPS patch <file> to BS-X slotted flash.
255  Requires --bsxslotted=<file>.
256 \end_layout
258 \begin_layout Subsubsection
259 --ips-bsxslotted-xml=<file>
260 \end_layout
262 \begin_layout Standard
263 Apply IPS patch <file> to BS-X slotted flash mapping XML.
264  Requires --bsxslotted-xml=<file>.
265 \end_layout
267 \begin_layout Subsubsection
268 --ips-dmg=<file>
269 \end_layout
271 \begin_layout Standard
272 Apply IPS patch <file> to Game Boy ROM.
273  Requires --dmg=<file>.
274 \end_layout
276 \begin_layout Subsubsection
277 --ips-dmg-xml=<file>
278 \end_layout
280 \begin_layout Standard
281 Apply IPS patch <file> to Game Boy ROM mapping XML.
282  Requires --dmg-xml=<file>.
283 \end_layout
285 \begin_layout Subsubsection
286 --ips-slot-a=<file>
287 \end_layout
289 \begin_layout Standard
290 Apply IPS patch <file> to Sufami turbo cartridge A ROM.
291  Requires --slot-a=<file>.
292 \end_layout
294 \begin_layout Subsubsection
295 --ips-slot-a-xml=<file>
296 \end_layout
298 \begin_layout Standard
299 Apply IPS patch <file> to Sufami turbo cartridge A ROM mapping XML.
300  Requires --slot-a-xml=<file>.
301 \end_layout
303 \begin_layout Subsubsection
304 --ips-slot-b=<file>
305 \end_layout
307 \begin_layout Standard
308 Apply IPS patch <file> to Sufami turbo cartridge B ROM.
309  Requires --slot-b=<file>.
310 \end_layout
312 \begin_layout Subsubsection
313 --ips-slot-b-xml=<file>
314 \end_layout
316 \begin_layout Standard
317 Apply IPS patch <file> to Sufami turbo cartridge B ROM mapping XML.
318  Requires --slot-b-xml=<file>.
319 \end_layout
321 \begin_layout Subsubsection
322 --ips-offset=<offset>
323 \end_layout
325 \begin_layout Standard
326 Set IPS apply offset to <offset> (can be negative).
327  IPS apply offset is added to all addresses inside IPS file before applying.
328  If the resulting address is negative, write is ignored (with a warning).
329  If resulting address exceeds ROM size, the ROM is extended.
330 \end_layout
332 \begin_layout Subsubsection
333 --pal
334 \end_layout
336 \begin_layout Standard
337 Force ROM to be considered PAL-only (warning: Will cause error if used on
338  anything except SNES and SGB).
339 \end_layout
341 \begin_layout Subsubsection
342 --ntsc
343 \end_layout
345 \begin_layout Standard
346 Force ROM to be considered NTSC-only (default for everything except SNES
347  and SGB).
348 \end_layout
350 \begin_layout Subsection
351 New session options (lsnes.exe only)
352 \end_layout
354 \begin_layout Standard
355 If filename is not specified, new session is started.
356  These options control the properties of new session:
357 \end_layout
359 \begin_layout Subsubsection
360 --port1=<type>
361 \end_layout
363 \begin_layout Standard
364 Set type of port1.
365  Valid values are:
366 \end_layout
368 \begin_layout Itemize
369 none: No device connected
370 \end_layout
372 \begin_layout Itemize
373 gamepad: One gamepad (the default)
374 \end_layout
376 \begin_layout Itemize
377 multitap: Four gamepads (warning: makes most games refuse to start)
378 \end_layout
380 \begin_layout Itemize
381 mouse: Mouse.
382 \end_layout
384 \begin_layout Subsubsection
385 --port2=<type>
386 \end_layout
388 \begin_layout Standard
389 Set type of port2.
390  Valid values are:
391 \end_layout
393 \begin_layout Itemize
394 none: No device connected (the default)
395 \end_layout
397 \begin_layout Itemize
398 gamepad: One gamepad
399 \end_layout
401 \begin_layout Itemize
402 multitap: Four gamepads.
403 \end_layout
405 \begin_layout Itemize
406 mouse: Mouse
407 \end_layout
409 \begin_layout Itemize
410 superscope: Super Scope
411 \end_layout
413 \begin_layout Itemize
414 justifier: One justifier
415 \end_layout
417 \begin_layout Itemize
418 justifiers: Two justifiers
419 \end_layout
421 \begin_layout Subsubsection
422 --gamename=<name>
423 \end_layout
425 \begin_layout Standard
426 Set the name of game to <name>
427 \end_layout
429 \begin_layout Subsubsection
430 --author=<name>
431 \end_layout
433 \begin_layout Standard
434 Add author with full name of <name> (no nickname).
435 \end_layout
437 \begin_layout Subsubsection
438 --author=|<name>
439 \end_layout
441 \begin_layout Standard
442 Add author with nickname of <name> (no full name).
443 \end_layout
445 \begin_layout Subsubsection
446 --author=<fullname>|<nickname>
447 \end_layout
449 \begin_layout Standard
450 Add author with full name of <fullname> and nickname of <nickname>.
451 \end_layout
453 \begin_layout Subsubsection
454 --rtc-second=<value>
455 \end_layout
457 \begin_layout Standard
458 Set RTC second (0 is 1st January 1970 00:00:00Z).
459 \end_layout
461 \begin_layout Subsubsection
462 --rtc-subsecond=<value>
463 \end_layout
465 \begin_layout Standard
466 Set RTC subsecond.
467  Range is 0-.
468  Unit is CPU cycle.
469 \end_layout
471 \begin_layout Subsection
472 <filename>
473 \end_layout
475 \begin_layout Standard
476 If filename is specified on command line, it is loaded as initial state
477  (instead of constructing one).
478  Mandatory for lsnes-avidump.exe and movieinfo.exe.
479 \end_layout
481 \begin_layout Subsection
482 Misc.
483  options
484 \end_layout
486 \begin_layout Subsubsection
487 --run=<file> (lsnes.exe only)
488 \end_layout
490 \begin_layout Standard
491 After running main RC file, run this file.
492  If multiple are specified, these execute in order specified.
493 \end_layout
495 \begin_layout Subsection
496 dump options (lsnes-avidump.exe only)
497 \end_layout
499 \begin_layout Subsubsection
500 --prefix=<prefix>
501 \end_layout
503 \begin_layout Standard
504 Set dump prefix.
505  Default is 
506 \begin_inset Quotes eld
507 \end_inset
509 avidump
510 \begin_inset Quotes erd
511 \end_inset
514 \end_layout
516 \begin_layout Subsubsection
517 --level=<level>
518 \end_layout
520 \begin_layout Standard
521 Set compression level (0-18).
522  Default is 7.
523 \end_layout
525 \begin_layout Subsubsection
526 --length=<length>
527 \end_layout
529 \begin_layout Standard
530 Set number of frames to dump.
531  Mandatory.
532 \end_layout
534 \begin_layout Subsubsection
535 --lua=<script>
536 \end_layout
538 \begin_layout Standard
539 Run specified lua script (lsnes-avidump.exe does not have initialization
540  files).
541 \end_layout
543 \begin_layout Subsubsection
544 --jmd
545 \end_layout
547 \begin_layout Standard
548 Use JMD dumping instead of AVI dumping.
549 \end_layout
551 \begin_layout Section
552 Startup file lsnes.rc
553 \end_layout
555 \begin_layout Standard
556 Upon startup, lsnes (lsnes.exe only) executes file lsnes.rc as commands.
557  This file is located in:
558 \end_layout
560 \begin_layout Itemize
561 Windows: %APPDATA%
562 \backslash
563 lsnes
564 \backslash
565 lsnes.rc (if %APPDATA% exists)
566 \end_layout
568 \begin_layout Itemize
569 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
570 \end_layout
572 \begin_layout Itemize
573 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
574 \end_layout
576 \begin_layout Itemize
577 All: ./lsnes.rc (fallback default).
578 \end_layout
580 \begin_layout Standard
581 If leading directories do not exist, attempt to create them is made.
582 \end_layout
584 \begin_layout Section
585 Game internal commands
586 \end_layout
588 \begin_layout Itemize
589 Commands beginning with '*' invoke the corresponding command without alias
590  expansion.
591 \end_layout
593 \begin_layout Itemize
594 If command starts with '+' (after possible '*'), the command is executed
595  as-is when button is pressed, and when button is released, it is executed
596  with '+' replaced by '-'.
597 \end_layout
599 \begin_layout Subsection
600 Settings:
601 \end_layout
603 \begin_layout Standard
604 Settings control various aspects of emulator behaviour.
605 \end_layout
607 \begin_layout Subsubsection
608 set-setting <setting> <value>
609 \end_layout
611 \begin_layout Standard
612 Sets setting <setting> to value <value> (may be empty).
613 \end_layout
615 \begin_layout Subsubsection
616 unset-setting <setting>
617 \end_layout
619 \begin_layout Standard
620 Try to unset setting <setting> (not all settings can be unset).
621 \end_layout
623 \begin_layout Subsubsection
624 get-setting <setting>
625 \end_layout
627 \begin_layout Standard
628 Read value of setting <setting>
629 \end_layout
631 \begin_layout Subsubsection
632 show-settings
633 \end_layout
635 \begin_layout Standard
636 Print names and values of all settings.
637 \end_layout
639 \begin_layout Subsection
640 Keybindings
641 \end_layout
643 \begin_layout Standard
644 Keybindings bind commands or aliases to keys (or pseudo-keys).
646 \end_layout
648 \begin_layout Standard
649 Notes:
650 \end_layout
652 \begin_layout Itemize
653 Do not bind edge active (+/-) commands to keys with modifiers, that won't
654  work right!
655 \end_layout
657 \begin_layout Itemize
658 Names of keys and modifiers are platform-dependent.
659 \end_layout
661 \begin_layout Itemize
662 Be careful before binding pseudo-keys (such as joystick axes, buttons or
663  hats) with modifiers.
664  That may or may not work right.
665 \end_layout
667 \begin_layout Subsubsection
668 bind-key [<mod>/<modmask>] <key> <command>
669 \end_layout
671 \begin_layout Standard
672 Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
673 ed list) are set as <mod> (comma-seperated list).
674 \end_layout
676 \begin_layout Standard
677 The names of keys and modifiers are platform-dependent.
678 \end_layout
680 \begin_layout Subsubsection
681 unbind-key [<mod>/<modmask>] <key>
682 \end_layout
684 \begin_layout Standard
685 Unbind command from <key> (with specified <mod> and <modmask>).
686 \end_layout
688 \begin_layout Subsubsection
689 set-axis <axis> [disabled | axis | axis-inverse | pressure0- | pressure0+
690  | pressure-0 | pressure-+ | pressure+0 | pressure+-] [minus=<val>] [zero=<val>]
691  [plus=<val>] [tolerance=<val>]
692 \end_layout
694 \begin_layout Standard
695 Set axis parameters for axis <axis>.
696 \end_layout
698 \begin_layout Itemize
699 disabled: Disable axis
700 \end_layout
702 \begin_layout Itemize
703 axis: Normal axis
704 \end_layout
706 \begin_layout Itemize
707 axis-inverse: Inverse axis
708 \end_layout
710 \begin_layout Itemize
711 pressure0-: Pressure sensitive.
712  Released at 0, pressed at -.
713 \end_layout
715 \begin_layout Itemize
716 pressure0+: Pressure sensitive.
717  Released at 0, pressed at +.
718 \end_layout
720 \begin_layout Itemize
721 pressure-0: Pressure sensitive.
722  Released at -, pressed at 0.
723 \end_layout
725 \begin_layout Itemize
726 pressure-+: Pressure sensitive.
727  Released at -, pressed at +.
728 \end_layout
730 \begin_layout Itemize
731 pressure+0: Pressure sensitive.
732  Released at +, pressed at 0.
733 \end_layout
735 \begin_layout Itemize
736 pressure+-: Pressure sensitive.
737  Released at +, pressed at -.
738 \end_layout
740 \begin_layout Itemize
741 minus=<val>: Calibration at extreme minus position (-32768-32767)
742 \end_layout
744 \begin_layout Itemize
745 zero=<val>: Calibration at neutral position (-32768-32767)
746 \end_layout
748 \begin_layout Itemize
749 plus=<val>: Calibration at extreme plus position (-32768-32767)
750 \end_layout
752 \begin_layout Itemize
753 tolerance=<value>: Center band tolerance (0<x<1).
754  The smaller the value, the more sensitive the control is.
755 \end_layout
757 \begin_layout Subsubsection
758 show-bindings
759 \end_layout
761 \begin_layout Standard
762 Print all key bindings in effect.
763 \end_layout
765 \begin_layout Subsection
766 Aliases
767 \end_layout
769 \begin_layout Standard
770 Aliases bind command to sequence of commands.
771  After alias has been defined, it replaces the command it shadows.
772 \end_layout
774 \begin_layout Standard
775 Notes:
776 \end_layout
778 \begin_layout Itemize
779 You can't alias command to itself.
780 \end_layout
782 \begin_layout Itemize
783 Aliases starting with +/- are edge active just like ordinary commands starting
784  with +/-.
785 \end_layout
787 \begin_layout Itemize
788 One command can be aliased to multiple commands.
789 \end_layout
791 \begin_layout Subsubsection
792 alias-command <command> <expansion>
793 \end_layout
795 \begin_layout Standard
796 Append <expansion> to alias <command>.
797  If alias does not already exist, it is created.
798 \end_layout
800 \begin_layout Subsubsection
801 unalias-command <command>
802 \end_layout
804 \begin_layout Standard
805 Clear alias expansion for <command>.
806 \end_layout
808 \begin_layout Subsubsection
809 show-aliases
810 \end_layout
812 \begin_layout Standard
813 Print all aliases and their expansions in effect.
814 \end_layout
816 \begin_layout Subsection
817 run-script <script> (implemented for wxwidgets)
818 \end_layout
820 \begin_layout Standard
821 Run <script> as if commands were entered on the command line.
822 \end_layout
824 \begin_layout Subsection
825 AVI Video dumping
826 \end_layout
828 \begin_layout Standard
829 Following commands control AVI video dumping:
830 \end_layout
832 \begin_layout Subsubsection
833 dump-avi <level> <prefix>
834 \end_layout
836 \begin_layout Standard
837 Dump AVI video to prefix <prefix> at level <level> (0-18).
838  Notes:
839 \end_layout
841 \begin_layout Itemize
842 The codec is Camstudio Codec in gzip mode.
843 \end_layout
845 \begin_layout Itemize
846 Encoder and muxer are internal, available on all platforms.
847 \end_layout
849 \begin_layout Itemize
850 Audio enable/disable and framerate has no effect.
851 \end_layout
853 \begin_layout Itemize
854 Levels 10-18 are not compatible with AVISource.
855 \end_layout
857 \begin_layout Itemize
858 Recomended level is 7 if decoded by AVISource.
859 \end_layout
861 \begin_layout Itemize
862 Recomended level is 16 if decoded by ffmpeg, mencoder or FFMpegSource.
863 \end_layout
865 \begin_layout Itemize
866 Dumps of low-res PAL games are 256x239 (with all the consequences odd height
867  carries).
868 \end_layout
870 \begin_layout Itemize
871 The audio dumped to .avi is low-quality version.
872  The high-quality version is dumped to .sox file.
873 \end_layout
875 \begin_layout Subsubsection
876 end-avi
877 \end_layout
879 \begin_layout Standard
880 End current AVI video dump (closing the emulator also closes the dump).
881 \end_layout
883 \begin_layout Subsection
884 JMD video dumping
885 \end_layout
887 \begin_layout Standard
888 Following commands control JMD video dumping:
889 \end_layout
891 \begin_layout Subsubsection
892 dump-jmd <level> <file>
893 \end_layout
895 \begin_layout Standard
896 Dump JMD video to file <file> at level <level> (0-9).
897 \end_layout
899 \begin_layout Subsubsection
900 end-jmd
901 \end_layout
903 \begin_layout Standard
904 End the current JMD dump in progress.
905 \end_layout
907 \begin_layout Subsection
908 Memory manipulation
909 \end_layout
911 \begin_layout Standard
912 <address> may be decimal or hexadecimal (prefixed with '0x').
913  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
914  with '-') decimal.
915 \end_layout
917 \begin_layout Standard
918 The available element <sizes> are:
919 \end_layout
921 \begin_layout Itemize
922 byte: 1 byte
923 \end_layout
925 \begin_layout Itemize
926 word: 2 bytes
927 \end_layout
929 \begin_layout Itemize
930 dword: 4 bytes
931 \end_layout
933 \begin_layout Itemize
934 qword: 8 bytes
935 \end_layout
937 \begin_layout Standard
938 When reading RAM and ROM, multi-byte reads/writes are big-endian.
939  When dealing with DSP memory, multi-byte reads/writes are native-endian
940  (do not use operand sizes exceeding DSP bitness, except dword is OK for
941  24-bit memory).
942 \end_layout
944 \begin_layout Subsubsection
945 read-<size> <address>
946 \end_layout
948 \begin_layout Standard
949 Read the value of byte in <address>.
950 \end_layout
952 \begin_layout Subsubsection
953 read-s<size> <address>
954 \end_layout
956 \begin_layout Standard
957 Read the value of signed byte in <address>.
958 \end_layout
960 \begin_layout Subsubsection
961 write-<size> <address> <value>
962 \end_layout
964 \begin_layout Standard
965 Write <value> to byte in address <address>.
966 \end_layout
968 \begin_layout Subsubsection
969 search-memory reset
970 \end_layout
972 \begin_layout Standard
973 Reset the memory search
974 \end_layout
976 \begin_layout Subsubsection
977 search-memory count
978 \end_layout
980 \begin_layout Standard
981 Print number of candidates remaining
982 \end_layout
984 \begin_layout Subsubsection
985 search-memory print
986 \end_layout
988 \begin_layout Standard
989 Print all candidates remaining
990 \end_layout
992 \begin_layout Subsubsection
993 search-memory <usflag><sizeflag><op>
994 \end_layout
996 \begin_layout Standard
997 Searches memory for addresses satisfying criteria.
998 \end_layout
1000 \begin_layout Standard
1001 <usflag> can be:
1002 \end_layout
1004 \begin_layout Itemize
1005 u: unsigned
1006 \end_layout
1008 \begin_layout Itemize
1009 s: signed
1010 \end_layout
1012 \begin_layout Standard
1013 <sizeflag> can be:
1014 \end_layout
1016 \begin_layout Itemize
1017 b: byte
1018 \end_layout
1020 \begin_layout Itemize
1021 w: word
1022 \end_layout
1024 \begin_layout Itemize
1025 d: dword
1026 \end_layout
1028 \begin_layout Itemize
1029 q: qword
1030 \end_layout
1032 \begin_layout Standard
1033 <op> can be:
1034 \end_layout
1036 \begin_layout Itemize
1037 lt: < previous value.
1038 \end_layout
1040 \begin_layout Itemize
1041 le: <= previous value.
1042 \end_layout
1044 \begin_layout Itemize
1045 eq: = previous value.
1046 \end_layout
1048 \begin_layout Itemize
1049 ne: != previous value.
1050 \end_layout
1052 \begin_layout Itemize
1053 ge: >= previous value.
1054 \end_layout
1056 \begin_layout Itemize
1057 gt: > previous value.
1058 \end_layout
1060 \begin_layout Subsubsection
1061 search-memory <sizeflag> <value>
1062 \end_layout
1064 \begin_layout Standard
1065 Searches for addresses that currently have value <value>.
1066  <sizeflag> is as in previous command.
1067 \end_layout
1069 \begin_layout Subsection
1070 Main commands
1071 \end_layout
1073 \begin_layout Standard
1074 These commands are not available in lsnesrc, but are available after ROM
1075  has been loaded.
1076 \end_layout
1078 \begin_layout Subsubsection
1079 quit-emulator [/y] (implemented for wxwidgets)
1080 \end_layout
1082 \begin_layout Standard
1083 Quits the emulator (asking for confirmation).
1084  If /y is given, no confirmation is asked.
1085 \end_layout
1087 \begin_layout Subsubsection
1088 pause-emulator (implemented for wxwidgets)
1089 \end_layout
1091 \begin_layout Standard
1092 Toggle paused/unpaused
1093 \end_layout
1095 \begin_layout Subsubsection
1096 +advance-frame (implemented for wxwidgets)
1097 \end_layout
1099 \begin_layout Standard
1100 Advance frame.
1101  If the button is still held after configurable timeout expires, game unpauses
1102  for the duration frame advance is held.
1103 \end_layout
1105 \begin_layout Subsubsection
1106 +advance-poll (implemented for wxwidgets)
1107 \end_layout
1109 \begin_layout Standard
1110 Advance subframe.
1111  If the button is still held after configurable timeout expires, game unpauses
1112  for the duration frame advance is held.
1113 \end_layout
1115 \begin_layout Subsubsection
1116 advance-skiplag (implemented for wxwidgets)
1117 \end_layout
1119 \begin_layout Standard
1120 Skip to first poll in frame after current.
1121 \end_layout
1123 \begin_layout Subsubsection
1124 reset (implemented for wxwidgets)
1125 \end_layout
1127 \begin_layout Standard
1128 Reset the SNES after this frame.
1129 \end_layout
1131 \begin_layout Subsubsection
1132 load <filename> (implemented for wxwidgets)
1133 \end_layout
1135 \begin_layout Standard
1136 Load savestate <filename> in current mode.
1137 \end_layout
1139 \begin_layout Subsubsection
1140 load-state <filename> (implemented for wxwidgets)
1141 \end_layout
1143 \begin_layout Standard
1144 Load savestate <filename> in readwrite mode.
1145 \end_layout
1147 \begin_layout Subsubsection
1148 load-readonly <filename> (implemented for wxwidgets)
1149 \end_layout
1151 \begin_layout Standard
1152 Load savestate <filename> in readonly mode.
1153 \end_layout
1155 \begin_layout Subsubsection
1156 load-preserve <filename> (implemented for wxwidgets)
1157 \end_layout
1159 \begin_layout Standard
1160 Load savestate <filename> in readonly mode, preserving current events.
1161 \end_layout
1163 \begin_layout Subsubsection
1164 load-movie <filename> (implemented for wxwidgets)
1165 \end_layout
1167 \begin_layout Standard
1168 Load savestate <filename>, ignoring save part in readonly mode.
1169 \end_layout
1171 \begin_layout Subsubsection
1172 save-state <filename> (implemented for wxwidgets)
1173 \end_layout
1175 \begin_layout Standard
1176 Save system state to <filename> as soon as possible.
1177 \end_layout
1179 \begin_layout Subsubsection
1180 save-movie <filename> (implemented for wxwidgets)
1181 \end_layout
1183 \begin_layout Standard
1184 Save movie to <filename>.
1185 \end_layout
1187 \begin_layout Subsubsection
1188 set-rwmode (implemented for wxwidgets)
1189 \end_layout
1191 \begin_layout Standard
1192 Set read-write mode.
1193 \end_layout
1195 \begin_layout Subsubsection
1196 set-romode (implemented for wxwidgets)
1197 \end_layout
1199 \begin_layout Standard
1200 Set read-only mode
1201 \end_layout
1203 \begin_layout Subsubsection
1204 toggle-rwmode (implemented for wxwidgets)
1205 \end_layout
1207 \begin_layout Standard
1208 Toggle between read-only and read-write modes.
1209 \end_layout
1211 \begin_layout Subsubsection
1212 set-gamename <name> (implemented for wxwidgets)
1213 \end_layout
1215 \begin_layout Standard
1216 Set name of the game to <name>
1217 \end_layout
1219 \begin_layout Subsubsection
1220 get-gamename (implemented for wxwidgets)
1221 \end_layout
1223 \begin_layout Standard
1224 Print the name of the game.
1225 \end_layout
1227 \begin_layout Subsubsection
1228 add-author <author> (implemented for wxwidgets)
1229 \end_layout
1231 \begin_layout Standard
1232 Adds new author <author>.
1233  If <author> does not contain '|' it is full name.
1234  If it contains '|', '|' splits the full name and nickname.
1235 \end_layout
1237 \begin_layout Subsubsection
1238 edit-author <num> <author> (implemented for wxwidgets)
1239 \end_layout
1241 \begin_layout Standard
1242 Edit the author in slot <num> (0-based) to be <author> (see add-author for
1243  format)
1244 \end_layout
1246 \begin_layout Subsubsection
1247 remove-author <num> (implemented for wxwidgets)
1248 \end_layout
1250 \begin_layout Standard
1251 Remove author in slot <num>
1252 \end_layout
1254 \begin_layout Subsubsection
1255 print-authors (implemented for wxwidgets)
1256 \end_layout
1258 \begin_layout Standard
1259 Print authors.
1260 \end_layout
1262 \begin_layout Subsubsection
1263 test-1, test-2, test-3 (N/A for wxwidgets)
1264 \end_layout
1266 \begin_layout Standard
1267 Internal test commands.
1268  Don't use.
1269 \end_layout
1271 \begin_layout Subsubsection
1272 take-screenshot <filename> (implemented for wxwidgets)
1273 \end_layout
1275 \begin_layout Standard
1276 Save screenshot to <filename>.
1277 \end_layout
1279 \begin_layout Subsubsection
1280 +controller<num><button> (N/A for wxwidgets)
1281 \end_layout
1283 \begin_layout Standard
1284 Press button <button> on controller <num> (1-8).
1285  The following button names are known:
1286 \end_layout
1288 \begin_layout Itemize
1289 left
1290 \end_layout
1292 \begin_layout Itemize
1293 right
1294 \end_layout
1296 \begin_layout Itemize
1298 \end_layout
1300 \begin_layout Itemize
1301 down
1302 \end_layout
1304 \begin_layout Itemize
1306 \end_layout
1308 \begin_layout Itemize
1310 \end_layout
1312 \begin_layout Itemize
1314 \end_layout
1316 \begin_layout Itemize
1318 \end_layout
1320 \begin_layout Itemize
1322 \end_layout
1324 \begin_layout Itemize
1326 \end_layout
1328 \begin_layout Itemize
1329 select
1330 \end_layout
1332 \begin_layout Itemize
1333 start
1334 \end_layout
1336 \begin_layout Itemize
1337 trigger
1338 \end_layout
1340 \begin_layout Itemize
1341 cursor
1342 \end_layout
1344 \begin_layout Itemize
1345 pause
1346 \end_layout
1348 \begin_layout Itemize
1349 turbo
1350 \end_layout
1352 \begin_layout Subsubsection
1353 controllerh<num><button>
1354 \end_layout
1356 \begin_layout Standard
1357 Hold/unhold button <button> on controller <num> (1-8).
1358  See +controller for button names.
1359 \end_layout
1361 \begin_layout Subsubsection
1362 autofire (<pattern>|-)...
1363  (N/A for wxwidgets)
1364 \end_layout
1366 \begin_layout Standard
1367 Set autofire pattern.
1368  Each parameter is comma-separated list of button names (in form of 1start,
1369  1A, 2B, etc..) to hold on that frame.
1370  After reaching the end of pattern, the pattern restarts from the beginning.
1371 \end_layout
1373 \begin_layout Subsubsection
1374 repaint (N/A for wxwidgets)
1375 \end_layout
1377 \begin_layout Standard
1378 Force a repaint.
1379 \end_layout
1381 \begin_layout Subsection
1382 Save jukebox (implemented for wxwidgets)
1383 \end_layout
1385 \begin_layout Subsubsection
1386 cycle-jukebox-backward (N/A for wxwidgets)
1387 \end_layout
1389 \begin_layout Standard
1390 Cycle save jukebox backwards.
1391 \end_layout
1393 \begin_layout Subsubsection
1394 cycle-jukebox-forward (N/A for wxwidgets)
1395 \end_layout
1397 \begin_layout Standard
1398 Cycle save jukebox forwards
1399 \end_layout
1401 \begin_layout Subsubsection
1402 add-jukebox-save <filename> (N/A for wxwidgets)
1403 \end_layout
1405 \begin_layout Standard
1406 Add <filename> to jukebox saves.
1407 \end_layout
1409 \begin_layout Subsubsection
1410 load-jukebox (N/A for wxwidgets)
1411 \end_layout
1413 \begin_layout Standard
1414 Do load from jukebox (current mode).
1415 \end_layout
1417 \begin_layout Subsubsection
1418 save-jukebox (N/A for wxwidgets)
1419 \end_layout
1421 \begin_layout Standard
1422 Do state save to jukebox.
1423 \end_layout
1425 \begin_layout Subsection
1426 Lua (implemented for wxwidgets)
1427 \end_layout
1429 \begin_layout Standard
1430 Only available if lua support is compiled in.
1431 \end_layout
1433 \begin_layout Subsubsection
1434 <<<<<<< HEADevaluate-lua <luacode>=======eval-lua <luacode> (implemented
1435  for wxwidgets)>>>>>>> Wxwidgets Graphics plugin WIP
1436 \end_layout
1438 \begin_layout Standard
1439 Run Lua code <luacode> using built-in Lua interpretter.
1440 \end_layout
1442 \begin_layout Subsubsection
1443 run-lua <script> (implemented for wxwidgets)
1444 \end_layout
1446 \begin_layout Standard
1447 Run specified lua file using built-in Lua interpretter.
1448 \end_layout
1450 \begin_layout Subsection
1451 Memory watch
1452 \end_layout
1454 \begin_layout Subsubsection
1455 add-watch <name> <expression>
1456 \end_layout
1458 \begin_layout Standard
1459 Adds new watch (or modifies old one).
1460 \end_layout
1462 \begin_layout Subsubsection
1463 remove-watch <name>
1464 \end_layout
1466 \begin_layout Standard
1467 Remove a watch.
1468 \end_layout
1470 \begin_layout Subsection
1471 Sound (implemented for wxwidgets)
1472 \end_layout
1474 \begin_layout Subsubsection
1475 enable-sound <on/off> (implemented for wxwidgets)
1476 \end_layout
1478 \begin_layout Standard
1479 Enable/Disable sound.
1480 \end_layout
1482 \begin_layout Subsubsection
1483 set-sound-device <device> (implemented for wxwidgets)
1484 \end_layout
1486 \begin_layout Standard
1487 Set sound device to <device>
1488 \end_layout
1490 \begin_layout Subsubsection
1491 show-sound-status (implemented for wxwidgets)
1492 \end_layout
1494 \begin_layout Standard
1495 Show status of sound system.
1496 \end_layout
1498 \begin_layout Subsubsection
1499 show-sound-devices (N/A for wxwidgets)
1500 \end_layout
1502 \begin_layout Standard
1503 Show all available devices.
1504 \end_layout
1506 \begin_layout Subsection
1507 SDL Platform commands (implemented for wxwidgets)
1508 \end_layout
1510 \begin_layout Standard
1511 The following are valid on SDL platform.
1512 \end_layout
1514 \begin_layout Subsubsection
1515 identify-key (N/A for wxwidgets)
1516 \end_layout
1518 \begin_layout Standard
1519 Asks to press a key and then identifies that (pseudo-)key.
1520 \end_layout
1522 \begin_layout Subsubsection
1523 toggle-console (N/A for wxwidgets)
1524 \end_layout
1526 \begin_layout Standard
1527 Toggle between windowed/fullscreen console.
1528 \end_layout
1530 \begin_layout Subsubsection
1531 scroll-fullup (N/A for wxwidgets)
1532 \end_layout
1534 \begin_layout Standard
1535 Scroll messages window as far back as it goes.
1536 \end_layout
1538 \begin_layout Subsubsection
1539 scroll-fulldown (N/A for wxwidgets)
1540 \end_layout
1542 \begin_layout Standard
1543 Scroll messages window as far forward as it goes.
1544 \end_layout
1546 \begin_layout Subsubsection
1547 scroll-up (N/A for wxwidgets)
1548 \end_layout
1550 \begin_layout Standard
1551 Scroll messages window back one screenful.
1552 \end_layout
1554 \begin_layout Subsubsection
1555 scroll-down (N/A for wxwidgets)
1556 \end_layout
1558 \begin_layout Standard
1559 Scroll messages window forward one screenful.
1560 \end_layout
1562 \begin_layout Section
1563 Settings
1564 \end_layout
1566 \begin_layout Subsection
1567 Core settings
1568 \end_layout
1570 \begin_layout Subsubsection
1571 firmwarepath
1572 \end_layout
1574 \begin_layout Standard
1575 Set where bsnes looks for firmware files.
1576  Default is 
1577 \begin_inset Quotes eld
1578 \end_inset
1581 \begin_inset Quotes erd
1582 \end_inset
1585 \end_layout
1587 \begin_layout Subsubsection
1588 targetfps
1589 \end_layout
1591 \begin_layout Standard
1592 Set the target fps.
1593  Numeric, range is 0.001 to 
1594 \begin_inset Quotes eld
1595 \end_inset
1597 infinite
1598 \begin_inset Quotes erd
1599 \end_inset
1602  Default is native framerate.
1603 \end_layout
1605 \begin_layout Subsubsection
1606 savecompression
1607 \end_layout
1609 \begin_layout Standard
1610 Set save compression level (integer 0-9).
1611  Default is 7 (0 is no compression).
1612 \end_layout
1614 \begin_layout Subsubsection
1615 advance-timeout
1616 \end_layout
1618 \begin_layout Standard
1619 Set the frame advance timeout in milliseconds.
1620  Numeric integer, range is 0-999999999.
1621  Default is 500.
1622 \end_layout
1624 \begin_layout Subsection
1625 AVI dumper settings
1626 \end_layout
1628 \begin_layout Subsubsection
1629 avi-large
1630 \end_layout
1632 \begin_layout Standard
1633 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1634  outputs.
1635 \end_layout
1637 \begin_layout Subsubsection
1638 avi-left-border
1639 \end_layout
1641 \begin_layout Standard
1642 AVI dumper: Set the default left border thickness (unless lua overrides)
1643  for dumps.
1644  Range 0-8191.
1645  Default is 0.
1646 \end_layout
1648 \begin_layout Subsubsection
1649 avi-right-border
1650 \end_layout
1652 \begin_layout Standard
1653 AVI dumper: Set the default right border thickness (unless lua overrides)
1654  for dumps.
1655  Range 0-8191.
1656  Default is 0.
1657 \end_layout
1659 \begin_layout Subsubsection
1660 avi-top-border
1661 \end_layout
1663 \begin_layout Standard
1664 AVI dumper: Set the default top border thickness (unless lua overrides)
1665  for dumps.
1666  Range 0-8191.
1667  Default is 0.
1668 \end_layout
1670 \begin_layout Subsubsection
1671 avi-bottom-border
1672 \end_layout
1674 \begin_layout Standard
1675 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1676  for dumps.
1677  Range 0-8191.
1678  Default is 0.
1679 \end_layout
1681 \begin_layout Subsubsection
1682 avi-maxframes
1683 \end_layout
1685 \begin_layout Standard
1686 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1687  Range 0-999999999.
1688  Default is 0.
1689 \end_layout
1691 \begin_layout Subsection
1692 SDL platform settings
1693 \end_layout
1695 \begin_layout Subsubsection
1696 autorepeat-first-delay
1697 \end_layout
1699 \begin_layout Standard
1700 Sets the delay for first character in typematic autorepeat.
1701 \end_layout
1703 \begin_layout Subsubsection
1704 autorepeat-subsequent-delay
1705 \end_layout
1707 \begin_layout Standard
1708 Sets the delay for subsequent characters in typematic autorepeat.
1709 \end_layout
1711 \begin_layout Section
1712 Lua functions
1713 \end_layout
1715 \begin_layout Subsection
1716 Core (in main table)
1717 \end_layout
1719 \begin_layout Subsubsection
1720 print
1721 \end_layout
1723 \begin_layout Standard
1724 Print line to message console.
1725 \end_layout
1727 \begin_layout Subsubsection
1728 exec(string command)
1729 \end_layout
1731 \begin_layout Standard
1732 Run command as it was entered on the command line
1733 \end_layout
1735 \begin_layout Subsection
1736 Table bit:
1737 \end_layout
1739 \begin_layout Standard
1740 Bitwise logical functions and related.
1741 \end_layout
1743 \begin_layout Subsubsection
1744 bit.none(number...) / bit.bnot(number...)
1745 \end_layout
1747 \begin_layout Standard
1748 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1749  arguments).
1750 \end_layout
1752 \begin_layout Subsubsection
1753 bit.any(number...) / bit.bor(number...)
1754 \end_layout
1756 \begin_layout Standard
1757 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1758 \end_layout
1760 \begin_layout Subsubsection
1761 bit.all(number...) / bit.band(number...)
1762 \end_layout
1764 \begin_layout Standard
1765 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1767 \end_layout
1769 \begin_layout Subsubsection
1770 bit.parity(number...) / bit.bxor(number...)
1771 \end_layout
1773 \begin_layout Standard
1774 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1775  of the arguments).
1776 \end_layout
1778 \begin_layout Subsubsection
1779 bit.lrotate(number base[, number amount[, number bits]])
1780 \end_layout
1782 \begin_layout Standard
1783 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1784 \end_layout
1786 \begin_layout Subsubsection
1787 bit.rrotate(number base[, number amount[, number bits]])
1788 \end_layout
1790 \begin_layout Standard
1791 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1792  places.
1793 \end_layout
1795 \begin_layout Subsubsection
1796 bit.lshift(number base[, number amount[, number bits]])
1797 \end_layout
1799 \begin_layout Standard
1800 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1801  The new bits are filled with zeroes.
1802 \end_layout
1804 \begin_layout Subsubsection
1805 bit.lrshift(number base[, number amount[, number bits]])
1806 \end_layout
1808 \begin_layout Standard
1809 Shift bits-bit (max 48, default 48) number logically right by amount (default
1810  1) places.
1811  The new bits are filled with zeroes.
1812 \end_layout
1814 \begin_layout Subsubsection
1815 bit.arshift(number base[, number amount[, number bits]])
1816 \end_layout
1818 \begin_layout Standard
1819 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1820  (default 1) places.
1821  The new bits are shifted in with copy of the high bit.
1822 \end_layout
1824 \begin_layout Subsection
1825 Table gui:
1826 \end_layout
1828 \begin_layout Standard
1829 Most of these functions can only be called in on_paint and on_video callbacks.
1830  Exceptions are noted.
1831 \end_layout
1833 \begin_layout Standard
1834 Colors are 32-bit.
1835  Bits 0-7 are the blue component, bits 8-15 are the green component, bits
1836  16-23 are the red component, bits 24-31 are alpha component (0 is fully
1837  opaque, 255 is almost transparent).
1838  -1 is the fully transparent color.
1839  Alpha values greater than 127 do work.
1840 \end_layout
1842 \begin_layout Standard
1843 Origin of coordinates is at top left corner of game display area.
1844  Left and top gaps correspond to negative coordinates.
1845 \end_layout
1847 \begin_layout Subsubsection
1848 gui.resolution()
1849 \end_layout
1851 \begin_layout Standard
1852 Returns 2-tuple (hresolution, vresolution).
1853 \end_layout
1855 \begin_layout Subsubsection
1856 gui.<class>_gap(number gap)
1857 \end_layout
1859 \begin_layout Standard
1860 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1861  is 8191).
1862 \end_layout
1864 \begin_layout Subsubsection
1865 gui.text(number x, number y, string text[, number fgc[, number bgc]])
1866 \end_layout
1868 \begin_layout Standard
1869 Draw specified text on the GUI (each character cell is 8 or 16 wide and
1870  16 high).
1871  Parameters:
1872 \end_layout
1874 \begin_layout Itemize
1875 x: X-coordinate to start the drawing from (and x-coordinate at begining
1876  of the lines).
1877 \end_layout
1879 \begin_layout Itemize
1880 y: Y-coordinate to start the drawing from.
1881 \end_layout
1883 \begin_layout Itemize
1884 text: The text to draw.
1885 \end_layout
1887 \begin_layout Itemize
1888 fgc: Text color (default is 0xFFFFFF (white))
1889 \end_layout
1891 \begin_layout Itemize
1892 bgc: Background color (default is -1 (transparent))
1893 \end_layout
1895 \begin_layout Subsubsection
1896 gui.rectangle(number x, number y, number width, number height[, number thickness[
1897 , number outline[, number fill]]])
1898 \end_layout
1900 \begin_layout Standard
1901 Draw rectangle on the GUI.
1902  Parameters:
1903 \end_layout
1905 \begin_layout Itemize
1906 x: X-coordinate of left edge.
1907 \end_layout
1909 \begin_layout Itemize
1910 y: Y-coordinate of upper edge.
1911 \end_layout
1913 \begin_layout Itemize
1914 width: Width of rectangle.
1915 \end_layout
1917 \begin_layout Itemize
1918 height: Height of rectangle.
1919 \end_layout
1921 \begin_layout Itemize
1922 thickness: Thickness of outline (default is 1).
1923 \end_layout
1925 \begin_layout Itemize
1926 outline: Color of outline (default is 0xFFFFFF (white))
1927 \end_layout
1929 \begin_layout Itemize
1930 fill: Color of fil (default is -1 (transparent))
1931 \end_layout
1933 \begin_layout Subsubsection
1934 gui.pixel(number x, number y[, number color])
1935 \end_layout
1937 \begin_layout Standard
1938 Draw one pixel on the GUI.
1939  Parameters:
1940 \end_layout
1942 \begin_layout Itemize
1943 x: X-coordinate of the pixel
1944 \end_layout
1946 \begin_layout Itemize
1947 y: Y-coordinate of the pixel
1948 \end_layout
1950 \begin_layout Itemize
1951 color: Color of the pixel (default is 0xFFFFFF (white))
1952 \end_layout
1954 \begin_layout Subsubsection
1955 gui.crosshair(number x, number y[, number length[, number color]])
1956 \end_layout
1958 \begin_layout Standard
1959 Draw a crosshair.
1960  Parameters:
1961 \end_layout
1963 \begin_layout Itemize
1964 x: X-coordinate of the crosshair
1965 \end_layout
1967 \begin_layout Itemize
1968 y: Y-coordinate of the crosshair
1969 \end_layout
1971 \begin_layout Itemize
1972 length: Length of the crosshair lines (default 10).
1973 \end_layout
1975 \begin_layout Itemize
1976 color: Color of the crosshair (default is 0xFFFFFF (white))
1977 \end_layout
1979 \begin_layout Subsubsection
1980 gui.line(number x1, number y1, number x2, number y2[, number color])
1981 \end_layout
1983 \begin_layout Standard
1984 Draw a thin line.
1985  Parameters:
1986 \end_layout
1988 \begin_layout Itemize
1989 x1: X-coordinate of one end.
1990 \end_layout
1992 \begin_layout Itemize
1993 y1: Y-coordinate of one end.
1994 \end_layout
1996 \begin_layout Itemize
1997 x2: X-coordinate of the other end.
1998 \end_layout
2000 \begin_layout Itemize
2001 y2: Y-coordinate of the other end.
2002 \end_layout
2004 \begin_layout Itemize
2005 color: Color of the line (default is 0xFFFFFF (white)).
2006 \end_layout
2008 \begin_layout Subsubsection
2009 gui.circle(number x, number y, number r[, number thick[, number border[,
2010  number fil]]])
2011 \end_layout
2013 \begin_layout Standard
2014 Draw a circle.
2015  Parameters.
2016 \end_layout
2018 \begin_layout Itemize
2019 x: X-coordinate of the center
2020 \end_layout
2022 \begin_layout Itemize
2023 y: Y-coordinate of the center
2024 \end_layout
2026 \begin_layout Itemize
2027 r: The radius of the circle
2028 \end_layout
2030 \begin_layout Itemize
2031 thick: Border thickness
2032 \end_layout
2034 \begin_layout Itemize
2035 border: Border color (default is 0xFFFFFF (white))
2036 \end_layout
2038 \begin_layout Itemize
2039 fill: Fill color (default is -1 (transparent)).
2040 \end_layout
2042 \begin_layout Subsubsection
2043 gui.repaint()
2044 \end_layout
2046 \begin_layout Standard
2047 Request on_repaint() to happen as soon as possible.
2048  Can be used anywhere.
2049 \end_layout
2051 \begin_layout Subsubsection
2052 gui.subframe_update(boolean on)
2053 \end_layout
2055 \begin_layout Standard
2056 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
2057  or not happen (on=false).
2058  Can be used anywhere.
2059 \end_layout
2061 \begin_layout Subsubsection
2062 gui.screenshot(string filename)
2063 \end_layout
2065 \begin_layout Standard
2066 Write PNG screenshot of the current frame (no drawings) to specified file.
2067  Can be used anywhere.
2068 \end_layout
2070 \begin_layout Subsubsection
2071 gui.color(number r, number g, number b[, number a])
2072 \end_layout
2074 \begin_layout Standard
2075 Returns color (in notation Lua scripts use) corresponding to color (r,g,b),
2076  each component in scale 0-255.
2077  If a is specified, that is alpha (0 is fully transparent, 256(sic) is fully
2078  opaque).
2079  The default alpha is 256.
2080 \end_layout
2082 \begin_layout Subsubsection
2083 gui.status(string name, string value)
2084 \end_layout
2086 \begin_layout Standard
2087 Set status field 
2088 \begin_inset Quotes eld
2089 \end_inset
2091 L[<name>]
2092 \begin_inset Quotes erd
2093 \end_inset
2095  to <value> in status area.
2096  Can be used anywhere.
2097 \end_layout
2099 \begin_layout Subsection
2100 table input
2101 \end_layout
2103 \begin_layout Standard
2104 Input handling.
2105  Only available in on_input callback.
2106 \end_layout
2108 \begin_layout Subsubsection
2109 input.get(number controller, number index)
2110 \end_layout
2112 \begin_layout Standard
2113 Read the specified index (0-11) from specified controller (0-7).
2114  Notes:
2115 \end_layout
2117 \begin_layout Itemize
2118 Uses physical controller numbering.
2119  Gamepad in port 2 is controller 4, not 1!
2120 \end_layout
2122 \begin_layout Subsubsection
2123 input.set(number controller, number index, number value)
2124 \end_layout
2126 \begin_layout Standard
2127 Write the specified index (0-11) from specified controller (0-7), storing
2128  value.
2129  Notes:
2130 \end_layout
2132 \begin_layout Itemize
2133 Uses physical controller numbering.
2134  Gamepad in port 2 is controller 4, not 1!
2135 \end_layout
2137 \begin_layout Subsubsection
2138 input.reset([number cycles])
2139 \end_layout
2141 \begin_layout Standard
2142 Execute reset.
2143  If cycles is greater than zero, do delayed reset.
2144  0 (or no value) causes immediate reset.
2145 \end_layout
2147 \begin_layout Itemize
2148 Only available with subframe flag false.
2149 \end_layout
2151 \begin_layout Subsection
2152 Table hostmemory
2153 \end_layout
2155 \begin_layout Standard
2156 Host memory handling (extra memory saved to savestates).
2157  Host memory starts empty.
2158 \end_layout
2160 \begin_layout Subsubsection
2161 hostmemory.read(number address)
2162 \end_layout
2164 \begin_layout Standard
2165 Reads hostmemory slot address.
2166  Slot numbers out of range return false instead of numeric.
2167 \end_layout
2169 \begin_layout Subsubsection
2170 hostmemory.write(number address, number value)
2171 \end_layout
2173 \begin_layout Standard
2174 Writes hostmemory slot with 0-255.
2175  Slot numbers out of range cause extension of host memory slot space.
2176 \end_layout
2178 \begin_layout Subsubsection
2179 hostmemory.readbyte(number address)
2180 \end_layout
2182 \begin_layout Standard
2183 Read unsigned byte (1 element) from given address.
2184  Slots out of range return false.
2185 \end_layout
2187 \begin_layout Subsubsection
2188 hostmemory.writebyte(number address, number value)
2189 \end_layout
2191 \begin_layout Standard
2192 Write unsigned byte (1 element) to given slot.
2193  Slot numbers out of range cause extension.
2194 \end_layout
2196 \begin_layout Subsubsection
2197 hostmemory.readsbyte(number address)
2198 \end_layout
2200 \begin_layout Standard
2201 Read signed byte (1 element) from given address.
2202  Slots out of range return false.
2203 \end_layout
2205 \begin_layout Subsubsection
2206 hostmemory.writesbyte(number address, number value)
2207 \end_layout
2209 \begin_layout Standard
2210 Write signed byte (1 element) to given slot.
2211  Slot numbers out of range cause extension.
2212 \end_layout
2214 \begin_layout Subsubsection
2215 hostmemory.readword(number address)
2216 \end_layout
2218 \begin_layout Standard
2219 Read unsigned word (2 elements) from given address.
2220  Slots out of range return false.
2221 \end_layout
2223 \begin_layout Subsubsection
2224 hostmemory.writeword(number address, number value)
2225 \end_layout
2227 \begin_layout Standard
2228 Write unsigned word (2 elements) to given slot.
2229  Slot numbers out of range cause extension.
2230 \end_layout
2232 \begin_layout Subsubsection
2233 hostmemory.readsword(number address)
2234 \end_layout
2236 \begin_layout Standard
2237 Read signed word (2 elements) from given address.
2238  Slots out of range return false.
2239 \end_layout
2241 \begin_layout Subsubsection
2242 hostmemory.writesword(number address, number value)
2243 \end_layout
2245 \begin_layout Standard
2246 Write signed word (2 elements) to given slot.
2247  Slot numbers out of range cause extension.
2248 \end_layout
2250 \begin_layout Subsubsection
2251 hostmemory.readdword(number address)
2252 \end_layout
2254 \begin_layout Standard
2255 Read unsigned doubleword (4 elements) from given address.
2256  Slots out of range return false.
2257 \end_layout
2259 \begin_layout Subsubsection
2260 hostmemory.writedword(number address, number value)
2261 \end_layout
2263 \begin_layout Standard
2264 Write unsigned doubleword (4 elements) to given slot.
2265  Slot numbers out of range cause extension.
2266 \end_layout
2268 \begin_layout Subsubsection
2269 hostmemory.readsdword(number address)
2270 \end_layout
2272 \begin_layout Standard
2273 Read signed doubleword (4 elements) from given address.
2274  Slots out of range return false.
2275 \end_layout
2277 \begin_layout Subsubsection
2278 hostmemory.writesdword(number address, number value)
2279 \end_layout
2281 \begin_layout Standard
2282 Write signed doubleword (4 elements) to given slot.
2283  Slot numbers out of range cause extension.
2284 \end_layout
2286 \begin_layout Subsubsection
2287 hostmemory.readqword(number address)
2288 \end_layout
2290 \begin_layout Standard
2291 Read unsigned quadword (8 elements) from given address.
2292  Slots out of range return false.
2293 \end_layout
2295 \begin_layout Subsubsection
2296 hostmemory.writeqword(number address, number value)
2297 \end_layout
2299 \begin_layout Standard
2300 Write unsigned quadword (4 elements) to given slot.
2301  Slot numbers out of range cause extension.
2302 \end_layout
2304 \begin_layout Subsubsection
2305 hostmemory.readsqword(number address)
2306 \end_layout
2308 \begin_layout Standard
2309 Read signed quadword (8 elements) from given address.
2310  Slots out of range return false.
2311 \end_layout
2313 \begin_layout Subsubsection
2314 hostmemory.writesqword(number address, number value)
2315 \end_layout
2317 \begin_layout Standard
2318 Write signed quadword (8 elements) to given slot.
2319  Slot numbers out of range cause extension.
2320 \end_layout
2322 \begin_layout Subsection
2323 Table movie
2324 \end_layout
2326 \begin_layout Standard
2327 Movie handling
2328 \end_layout
2330 \begin_layout Subsubsection
2331 movie.currentframe()
2332 \end_layout
2334 \begin_layout Standard
2335 Return number of current frame.
2336 \end_layout
2338 \begin_layout Subsubsection
2339 movie.framecount()
2340 \end_layout
2342 \begin_layout Standard
2343 Return number of frames in movie.
2344 \end_layout
2346 \begin_layout Subsubsection
2347 movie.readonly()
2348 \end_layout
2350 \begin_layout Standard
2351 Return true if in readonly mode, false if in readwrite.
2352 \end_layout
2354 \begin_layout Subsubsection
2355 movie.set_readwrite()
2356 \end_layout
2358 \begin_layout Standard
2359 Set readwrite mode (does not cause on_readwrite callback).
2360 \end_layout
2362 \begin_layout Subsubsection
2363 movie.frame_subframes(number frame)
2364 \end_layout
2366 \begin_layout Standard
2367 Count number of subframes in specified frame (frame numbers are 1-based)
2368  and return that.
2369 \end_layout
2371 \begin_layout Subsubsection
2372 movie.read_subframe(number frame, number subframe)
2373 \end_layout
2375 \begin_layout Standard
2376 Read specifed subframe in specified frame and return data as array (100
2377  elements, numbered 0-99 currently).
2378 \end_layout
2380 \begin_layout Subsection
2381 Table settings
2382 \end_layout
2384 \begin_layout Standard
2385 Routines for settings manipulation
2386 \end_layout
2388 \begin_layout Subsubsection
2389 settings.get(string name)
2390 \end_layout
2392 \begin_layout Standard
2393 Get value of setting.
2394  If setting is blank, returns false.
2395  If setting value can't be obtained, returns (nil, error message).
2396 \end_layout
2398 \begin_layout Subsubsection
2399 settings.set(string name, string value)
2400 \end_layout
2402 \begin_layout Standard
2403 Set value of setting.
2404  If setting can't be set, returns (nil, error message).
2405 \end_layout
2407 \begin_layout Subsubsection
2408 settings.is_set(string name)
2409 \end_layout
2411 \begin_layout Standard
2412 Returns if setting is set.
2413  If setting does not exist, returns (nil, error message).
2414 \end_layout
2416 \begin_layout Subsubsection
2417 settings.blank(string name)
2418 \end_layout
2420 \begin_layout Standard
2421 Blanks a setting and returns true.
2422  If setting can't be blanked, returns (nil, error message).
2423 \end_layout
2425 \begin_layout Subsection
2426 Table memory
2427 \end_layout
2429 \begin_layout Standard
2430 Contains various functions for managing memory
2431 \end_layout
2433 \begin_layout Subsubsection
2434 memory.vma_count()
2435 \end_layout
2437 \begin_layout Standard
2438 Returns the number of VMAs
2439 \end_layout
2441 \begin_layout Subsubsection
2442 memory.read_vma(number index)
2443 \end_layout
2445 \begin_layout Standard
2446 Reads the specified VMA (indices start from zero).
2447  Trying to read invalid VMA gives nil.
2448  The read VMA is table with the following fields:
2449 \end_layout
2451 \begin_layout Itemize
2452 region_name (string): The readable name of the VMA
2453 \end_layout
2455 \begin_layout Itemize
2456 baseaddr (number): Base address of the VMA
2457 \end_layout
2459 \begin_layout Itemize
2460 lastaddr (number): Last address in the VMA.
2461 \end_layout
2463 \begin_layout Itemize
2464 size (number): The size of VMA in bytes.
2465 \end_layout
2467 \begin_layout Itemize
2468 readonly (boolean): True of the VMA corresponds to ROM.
2469 \end_layout
2471 \begin_layout Itemize
2472 native_endian (boolean): True if the VMA has native endian as opposed to
2473  little endian.
2474 \end_layout
2476 \begin_layout Subsubsection
2477 memory.find_vma(number address)
2478 \end_layout
2480 \begin_layout Standard
2481 Finds the VMA containing specified address.
2482  Returns table in the same format as read_vma or nil if not found.
2483 \end_layout
2485 \begin_layout Subsubsection
2486 memory.readbyte(number address)
2487 \end_layout
2489 \begin_layout Standard
2490 Reads the specified address as unsigned byte and returns the result.
2491 \end_layout
2493 \begin_layout Subsubsection
2494 memory.readsbyte(number address)
2495 \end_layout
2497 \begin_layout Standard
2498 Reads the specified address as signed byte and returns the result.
2499 \end_layout
2501 \begin_layout Subsubsection
2502 memory.writebyte(number address, number value)
2503 \end_layout
2505 \begin_layout Standard
2506 Writes the specified value (negative values undergo 2's complement) to specified
2507  address (as a byte).
2508 \end_layout
2510 \begin_layout Subsubsection
2511 memory.readword(number address)
2512 \end_layout
2514 \begin_layout Standard
2515 Reads the specified address as unsigned word and returns the result.
2516 \end_layout
2518 \begin_layout Subsubsection
2519 memory.readsword(number address)
2520 \end_layout
2522 \begin_layout Standard
2523 Reads the specified address as signed word and returns the result.
2524 \end_layout
2526 \begin_layout Subsubsection
2527 memory.writeword(number address, number value)
2528 \end_layout
2530 \begin_layout Standard
2531 Writes the specified value (negative values undergo 2's complement) to specified
2532  address (as a word).
2533 \end_layout
2535 \begin_layout Subsubsection
2536 memory.readdword(number address)
2537 \end_layout
2539 \begin_layout Standard
2540 Reads the specified address as unsigned doubleword and returns the result.
2541 \end_layout
2543 \begin_layout Subsubsection
2544 memory.readsdword(number address)
2545 \end_layout
2547 \begin_layout Standard
2548 Reads the specified address as signed doubleword and returns the result.
2549 \end_layout
2551 \begin_layout Subsubsection
2552 memory.writedword(number address, number value)
2553 \end_layout
2555 \begin_layout Standard
2556 Writes the specified value (negative values undergo 2's complement) to specified
2557  address (as a doubleword).
2558 \end_layout
2560 \begin_layout Subsubsection
2561 memory.readqword(number address)
2562 \end_layout
2564 \begin_layout Standard
2565 Reads the specified address as unsigned quadword and returns the result.
2566 \end_layout
2568 \begin_layout Subsubsection
2569 memory.readsqword(number address)
2570 \end_layout
2572 \begin_layout Standard
2573 Reads the specified address as signed quadword and returns the result.
2574 \end_layout
2576 \begin_layout Subsubsection
2577 memory.writeqword(number address, number value)
2578 \end_layout
2580 \begin_layout Standard
2581 Writes the specified value (negative values undergo 2's complement) to specified
2582  address (as a quadword).
2583 \end_layout
2585 \begin_layout Subsection
2586 Callbacks
2587 \end_layout
2589 \begin_layout Standard
2590 Various callbacks to Lua that can occur.
2591 \end_layout
2593 \begin_layout Subsubsection
2594 Callback: on_paint()
2595 \end_layout
2597 \begin_layout Standard
2598 Called when screen is being painted.
2599  Any gui.* calls requiring graphic context draw on the screen.
2600 \end_layout
2602 \begin_layout Subsubsection
2603 Callback: on_video()
2604 \end_layout
2606 \begin_layout Standard
2607 Called when video dump frame is being painted.
2608  Any gui.* calls requiring graphic context draw on the video.
2609 \end_layout
2611 \begin_layout Subsubsection
2612 Callback: on_frame()
2613 \end_layout
2615 \begin_layout Standard
2616 Called on each starting whole frame.
2617 \end_layout
2619 \begin_layout Subsubsection
2620 Callback: on_startup()
2621 \end_layout
2623 \begin_layout Standard
2624 Called when the emulator is starting (lsnes.rc and --run files has been run).
2625 \end_layout
2627 \begin_layout Subsubsection
2628 Callback: on_pre_load(string name)
2629 \end_layout
2631 \begin_layout Standard
2632 Called just before savestate/movie load occurs (note: loads are always delayed,
2633  so this occurs even when load was initiated by lua).
2634 \end_layout
2636 \begin_layout Subsubsection
2637 Callback: on_err_load(string name)
2638 \end_layout
2640 \begin_layout Standard
2641 Called if loadstate goes wrong.
2642 \end_layout
2644 \begin_layout Subsubsection
2645 Callback: on_post_load(string name, boolean was_savestate)
2646 \end_layout
2648 \begin_layout Standard
2649 Called on successful loadstate.
2650  was_savestate gives if this was a savestate or a movie.
2651 \end_layout
2653 \begin_layout Subsubsection
2654 Callback: on_pre_save(string name, boolean is_savestate)
2655 \end_layout
2657 \begin_layout Standard
2658 Called just before savestate save occurs (note: movie saves are synchronous
2659  and won't trigger these callbacks if called from Lua).
2660 \end_layout
2662 \begin_layout Subsubsection
2663 Callback: on_err_save(string name)
2664 \end_layout
2666 \begin_layout Standard
2667 Called if savestate goes wrong.
2668 \end_layout
2670 \begin_layout Subsubsection
2671 Callback: on_post_save(string name, boolean is_savestate)
2672 \end_layout
2674 \begin_layout Standard
2675 Called on successful savaestate.
2676  is_savestate gives if this was a savestate or a movie.
2677 \end_layout
2679 \begin_layout Subsubsection
2680 Callback: on_quit()
2681 \end_layout
2683 \begin_layout Standard
2684 Called when emulator is shutting down.
2685 \end_layout
2687 \begin_layout Subsubsection
2688 Callback: on_input(boolean subframe)
2689 \end_layout
2691 \begin_layout Standard
2692 Called when emulator is just sending input to bsnes core.
2693  Warning: This is called even in readonly mode, but the results are ignored.
2694 \end_layout
2696 \begin_layout Subsubsection
2697 Callback: on_reset()
2698 \end_layout
2700 \begin_layout Standard
2701 Called when SNES is reset.
2702 \end_layout
2704 \begin_layout Subsubsection
2705 Callback: on_readwrite()
2706 \end_layout
2708 \begin_layout Standard
2709 Called when moving into readwrite mode as result of 
2710 \begin_inset Quotes eld
2711 \end_inset
2713 set-rwmode
2714 \begin_inset Quotes erd
2715 \end_inset
2717  command (note: moving to rwmode by Lua won't trigger this, as per recursive
2718  entry protection).
2719 \end_layout
2721 \begin_layout Subsubsection
2722 Callback: on_snoop(number port, number controller, number index, number
2723  value)
2724 \end_layout
2726 \begin_layout Standard
2727 Called each time bsnes asks for input.
2728  The value is the final value to be sent to bsnes core (readonly mode, autohold
2729  and autofire have been taken into account).
2730  Might be useful when translating movies to format suitable for console
2731  verification.
2732  Note: There is no way to modify the value to be sent.
2733 \end_layout
2735 \begin_layout Section
2736 Modifier and key names:
2737 \end_layout
2739 \begin_layout Subsection
2740 SDL Platform
2741 \end_layout
2743 \begin_layout Subsubsection
2744 Modifier names
2745 \end_layout
2747 \begin_layout Standard
2748 Following modifier names are known:
2749 \end_layout
2751 \begin_layout Itemize
2752 ctrl, lctrl, rctrl: Control keys
2753 \end_layout
2755 \begin_layout Itemize
2756 alt, lalt, ralt: ALT keys.
2757 \end_layout
2759 \begin_layout Itemize
2760 shift, lshift, rshift: Shift keys.
2761 \end_layout
2763 \begin_layout Itemize
2764 meta, lmeta, rmeta: Meta keys.
2765 \end_layout
2767 \begin_layout Itemize
2768 num, caps: Numlock/Capslock (these are sticky!)
2769 \end_layout
2771 \begin_layout Itemize
2772 mode: Mode select.
2773 \end_layout
2775 \begin_layout Subsubsection
2776 Key names
2777 \end_layout
2779 \begin_layout Standard
2780 Following key names are known:
2781 \end_layout
2783 \begin_layout Itemize
2784 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
2785  hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
2786  comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
2787  less, equals, greater, question, at, leftbracket, backslash, rightbracket,
2788  caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
2789  o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
2790  world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
2791  world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
2792  world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
2793  world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
2794  world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
2795  world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
2796  world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
2797  world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
2798  world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
2799  world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
2800  world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
2801  world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
2802  kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
2803  kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
2804  pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
2805  f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
2806  lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
2807  break, menu, power, euro, undo
2808 \end_layout
2810 \begin_layout Itemize
2811 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
2812  hardware-dependent scan code of <n> (useful to bind those keys that don't
2813  have symbolic names).
2814 \end_layout
2816 \begin_layout Standard
2817 In addition, following pseudo-keys are known (note: these do not work in
2818  conjunction with modifers):
2819 \end_layout
2821 \begin_layout Itemize
2822 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
2823 \end_layout
2825 \begin_layout Itemize
2826 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
2827 \end_layout
2829 \begin_layout Itemize
2830 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
2831 \end_layout
2833 \begin_layout Itemize
2834 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
2835 \end_layout
2837 \begin_layout Itemize
2838 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
2839 \end_layout
2841 \begin_layout Itemize
2842 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
2843  position (axis modes axis and axis_inverse).
2844 \end_layout
2846 \begin_layout Itemize
2847 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
2848  position (axis modes axis and axis_inverse).
2849 \end_layout
2851 \begin_layout Itemize
2852 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
2853  modes pressure_*).
2854 \end_layout
2856 \begin_layout Subsubsection
2857 Special buttons:
2858 \end_layout
2860 \begin_layout Itemize
2861 Escape: Enter/Exit Command mode, cancel modal dialogs.
2862 \end_layout
2864 \begin_layout Itemize
2865 Return (also KPEnter): Execute command, ok modal dialog.
2866 \end_layout
2868 \begin_layout Itemize
2869 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
2870  history
2871 \end_layout
2873 \begin_layout Itemize
2874 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
2875  history
2876 \end_layout
2878 \begin_layout Itemize
2879 Home (also KP7 if no num lock; command mode): Beginning of command.
2880 \end_layout
2882 \begin_layout Itemize
2883 End (also KP1 if no num lock; command mode): End of command.
2884 \end_layout
2886 \begin_layout Itemize
2887 Left (also KP4 if no num lock; command mode): Move cursor left.
2888 \end_layout
2890 \begin_layout Itemize
2891 Right (also KP6 if no num lock; command mode): Move cursor right.
2892 \end_layout
2894 \begin_layout Itemize
2895 Delete (also KP.
2896  if no num lock; command mode): Delete character to right of cursor.
2897 \end_layout
2899 \begin_layout Itemize
2900 Insert (also KP0 if no num lock; command mode): Toggle between insert /
2901  overwrite modes.
2902 \end_layout
2904 \begin_layout Itemize
2905 Backspace (command mode): Delete character to left of cursor.
2906 \end_layout
2908 \begin_layout Itemize
2909 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
2910 \end_layout
2912 \begin_layout Subsubsection
2913 Watchdog timer:
2914 \end_layout
2916 \begin_layout Standard
2917 If emulator does not reach internal polling loop in 15 seconds after leaving
2918  it or 15 seconds after starting, the emulator instantly bombs out.
2919 \end_layout
2921 \begin_layout Section
2922 Movie file format
2923 \end_layout
2925 \begin_layout Standard
2926 Movie file is .zip archive in itself, normal ZIP archive tools work on it
2927  (note: If you recompress it, do not use compression methods other than
2928  store and deflate and especially do not use encryption of any kind).
2929 \end_layout
2931 \begin_layout Subsection
2932 Detecting clean start/SRAM/Savestate
2933 \end_layout
2935 \begin_layout Itemize
2936 If file has member 
2937 \begin_inset Quotes eld
2938 \end_inset
2940 savestate
2941 \begin_inset Quotes erd
2942 \end_inset
2944  it is savestate, otherwise:
2945 \end_layout
2947 \begin_layout Itemize
2948 If file has members with names starting 
2949 \begin_inset Quotes eld
2950 \end_inset
2952 moviesram.
2953 \begin_inset Quotes erd
2954 \end_inset
2956  it is movie starting from SRAM, otherwise:
2957 \end_layout
2959 \begin_layout Itemize
2960 It is movie starting from clear state.
2961 \end_layout
2963 \begin_layout Subsection
2964 Member: gametype
2965 \end_layout
2967 \begin_layout Standard
2968 Type of game ROM and region (as one line).
2969  Valid values are:
2970 \end_layout
2972 \begin_layout Standard
2973 \begin_inset Tabular
2974 <lyxtabular version="3" rows="8" columns="3">
2975 <features tabularvalignment="middle">
2976 <column alignment="center" valignment="top" width="0">
2977 <column alignment="center" valignment="top" width="0">
2978 <column alignment="center" valignment="top" width="0">
2979 <row>
2980 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2981 \begin_inset Text
2983 \begin_layout Plain Layout
2984 Value
2985 \end_layout
2987 \end_inset
2988 </cell>
2989 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2990 \begin_inset Text
2992 \begin_layout Plain Layout
2993 System
2994 \end_layout
2996 \end_inset
2997 </cell>
2998 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2999 \begin_inset Text
3001 \begin_layout Plain Layout
3002 Region
3003 \end_layout
3005 \end_inset
3006 </cell>
3007 </row>
3008 <row>
3009 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3010 \begin_inset Text
3012 \begin_layout Plain Layout
3013 snes_pal
3014 \end_layout
3016 \end_inset
3017 </cell>
3018 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3019 \begin_inset Text
3021 \begin_layout Plain Layout
3022 Super NES
3023 \end_layout
3025 \end_inset
3026 </cell>
3027 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3028 \begin_inset Text
3030 \begin_layout Plain Layout
3032 \end_layout
3034 \end_inset
3035 </cell>
3036 </row>
3037 <row>
3038 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3039 \begin_inset Text
3041 \begin_layout Plain Layout
3042 sgb_pal
3043 \end_layout
3045 \end_inset
3046 </cell>
3047 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3048 \begin_inset Text
3050 \begin_layout Plain Layout
3051 Super Game Boy
3052 \end_layout
3054 \end_inset
3055 </cell>
3056 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3057 \begin_inset Text
3059 \begin_layout Plain Layout
3061 \end_layout
3063 \end_inset
3064 </cell>
3065 </row>
3066 <row>
3067 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3068 \begin_inset Text
3070 \begin_layout Plain Layout
3071 snes_ntsc
3072 \end_layout
3074 \end_inset
3075 </cell>
3076 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3077 \begin_inset Text
3079 \begin_layout Plain Layout
3080 Super NES
3081 \end_layout
3083 \end_inset
3084 </cell>
3085 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3086 \begin_inset Text
3088 \begin_layout Plain Layout
3089 NTSC
3090 \end_layout
3092 \end_inset
3093 </cell>
3094 </row>
3095 <row>
3096 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3097 \begin_inset Text
3099 \begin_layout Plain Layout
3100 sgb_ntsc
3101 \end_layout
3103 \end_inset
3104 </cell>
3105 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3106 \begin_inset Text
3108 \begin_layout Plain Layout
3109 Super Game Boy
3110 \end_layout
3112 \end_inset
3113 </cell>
3114 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3115 \begin_inset Text
3117 \begin_layout Plain Layout
3118 NTSC
3119 \end_layout
3121 \end_inset
3122 </cell>
3123 </row>
3124 <row>
3125 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3126 \begin_inset Text
3128 \begin_layout Plain Layout
3130 \end_layout
3132 \end_inset
3133 </cell>
3134 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3135 \begin_inset Text
3137 \begin_layout Plain Layout
3138 BS-X (non-slotted)
3139 \end_layout
3141 \end_inset
3142 </cell>
3143 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3144 \begin_inset Text
3146 \begin_layout Plain Layout
3147 NTSC
3148 \end_layout
3150 \end_inset
3151 </cell>
3152 </row>
3153 <row>
3154 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3155 \begin_inset Text
3157 \begin_layout Plain Layout
3158 bsxslotted
3159 \end_layout
3161 \end_inset
3162 </cell>
3163 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3164 \begin_inset Text
3166 \begin_layout Plain Layout
3167 BS-X (slotted)
3168 \end_layout
3170 \end_inset
3171 </cell>
3172 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3173 \begin_inset Text
3175 \begin_layout Plain Layout
3176 NTSC
3177 \end_layout
3179 \end_inset
3180 </cell>
3181 </row>
3182 <row>
3183 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3184 \begin_inset Text
3186 \begin_layout Plain Layout
3187 sufamiturbo
3188 \end_layout
3190 \end_inset
3191 </cell>
3192 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3193 \begin_inset Text
3195 \begin_layout Plain Layout
3196 Sufami Turbo
3197 \end_layout
3199 \end_inset
3200 </cell>
3201 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3202 \begin_inset Text
3204 \begin_layout Plain Layout
3205 NTSC
3206 \end_layout
3208 \end_inset
3209 </cell>
3210 </row>
3211 </lyxtabular>
3213 \end_inset
3216 \end_layout
3218 \begin_layout Standard
3219 Frame rates are:
3220 \end_layout
3222 \begin_layout Standard
3223 \begin_inset Tabular
3224 <lyxtabular version="3" rows="3" columns="2">
3225 <features tabularvalignment="middle">
3226 <column alignment="center" valignment="top" width="0">
3227 <column alignment="center" valignment="top" width="0">
3228 <row>
3229 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3230 \begin_inset Text
3232 \begin_layout Plain Layout
3233 Region
3234 \end_layout
3236 \end_inset
3237 </cell>
3238 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3239 \begin_inset Text
3241 \begin_layout Plain Layout
3242 Framerate (fps)
3243 \end_layout
3245 \end_inset
3246 </cell>
3247 </row>
3248 <row>
3249 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3250 \begin_inset Text
3252 \begin_layout Plain Layout
3254 \end_layout
3256 \end_inset
3257 </cell>
3258 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3259 \begin_inset Text
3261 \begin_layout Plain Layout
3262 322445/6448
3263 \end_layout
3265 \end_inset
3266 </cell>
3267 </row>
3268 <row>
3269 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3270 \begin_inset Text
3272 \begin_layout Plain Layout
3273 NTSC
3274 \end_layout
3276 \end_inset
3277 </cell>
3278 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3279 \begin_inset Text
3281 \begin_layout Plain Layout
3282 10738636/178683
3283 \end_layout
3285 \end_inset
3286 </cell>
3287 </row>
3288 </lyxtabular>
3290 \end_inset
3293 \end_layout
3295 \begin_layout Subsection
3296 Member: port1
3297 \end_layout
3299 \begin_layout Standard
3300 Contains type of port #1 (as one line).
3301  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
3302  If not present, defaults to 'gamepad'.
3303 \end_layout
3305 \begin_layout Subsection
3306 Member: port2
3307 \end_layout
3309 \begin_layout Standard
3310 Contains type of port #2 (as one line).
3311  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
3312  'justifier' and 'justifiers'.
3313  If not present, defaults to 'none'.
3314 \end_layout
3316 \begin_layout Subsection
3317 Member: gamename
3318 \end_layout
3320 \begin_layout Standard
3321 Contains name of the game (as one line).
3322 \end_layout
3324 \begin_layout Subsection
3325 Member: authors
3326 \end_layout
3328 \begin_layout Standard
3329 Contains authors, one per line.
3330  Part before '|' is the full name, part after is the nickname.
3331 \end_layout
3333 \begin_layout Subsection
3334 Member: systemid
3335 \end_layout
3337 \begin_layout Standard
3338 Always 
3339 \begin_inset Quotes eld
3340 \end_inset
3342 lsnes-rr1
3343 \begin_inset Quotes erd
3344 \end_inset
3346  (one line).
3347  Used to reject other saves.
3348 \end_layout
3350 \begin_layout Subsection
3351 Member: controlsversion
3352 \end_layout
3354 \begin_layout Standard
3355 Always 
3356 \begin_inset Quotes eld
3357 \end_inset
3360 \begin_inset Quotes erd
3361 \end_inset
3363  (one line).
3364  Used to identify what controls are there.
3365 \end_layout
3367 \begin_layout Subsection
3368 Member: 
3369 \begin_inset Quotes eld
3370 \end_inset
3372 coreversion
3373 \begin_inset Quotes erd
3374 \end_inset
3377 \end_layout
3379 \begin_layout Standard
3380 Contains bsnes core version number (as one line).
3381 \end_layout
3383 \begin_layout Subsection
3384 Member: projectid
3385 \end_layout
3387 \begin_layout Standard
3388 Contains project ID (as one line).
3389  Used to identify if two movies are part of the same project.
3390 \end_layout
3392 \begin_layout Subsection
3393 Member: {rom,slota,slotb}{,xml}.sha256
3394 \end_layout
3396 \begin_layout Standard
3397 Contains SHA-256 of said ROM or ROM mapping file (as one line).
3398  Absent if corresponding file is absent.
3399 \end_layout
3401 \begin_layout Subsection
3402 Member: moviesram.<name>
3403 \end_layout
3405 \begin_layout Standard
3406 Raw binary startup SRAM of kind <name>.
3407  Only present in savestates and movies starting from SRAM.
3408 \end_layout
3410 \begin_layout Subsection
3411 Member: moviestate
3412 \end_layout
3414 \begin_layout Standard
3415 Raw binary movie state data.
3416  Only present in savestates.
3417 \end_layout
3419 \begin_layout Standard
3420 for version 0:
3421 \end_layout
3423 \begin_layout Itemize
3424 32 bytes: SHA-256 of project ID.
3425 \end_layout
3427 \begin_layout Itemize
3428 8 bytes: Big-endian current frame.
3429 \end_layout
3431 \begin_layout Itemize
3432 100x4 bytes: Poll counters for each control (bit31 of each is 
3433 \begin_inset Quotes eld
3434 \end_inset
3436 data ready
3437 \begin_inset Quotes erd
3438 \end_inset
3440  bit), big-endian.
3441 \end_layout
3443 \begin_layout Itemize
3444 8 bytes: Big-endian lag frame count.
3445 \end_layout
3447 \begin_layout Itemize
3448 32 bytes: SHA-256 of past input
3449 \end_layout
3451 \begin_layout Itemize
3452 32 bytes: SHA-256 of previous.
3453 \end_layout
3455 \begin_layout Itemize
3456 (total of 512 bytes)
3457 \end_layout
3459 \begin_layout Subsection
3460 Member: hostmemory
3461 \end_layout
3463 \begin_layout Standard
3464 Raw binary dump of host memory.
3465  Only present in savestates.
3466 \end_layout
3468 \begin_layout Subsection
3469 Member: savestate
3470 \end_layout
3472 \begin_layout Standard
3473 The raw binary savestate itself.
3474  Savestate detection uses this file, only present in savestates.
3475 \end_layout
3477 \begin_layout Subsection
3478 Member: screenshot
3479 \end_layout
3481 \begin_layout Standard
3482 Screenshot of current frame.
3483  Only present in savestates.
3484  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
3485  data.
3486  Height of image is inferred from the width and size of data.
3487 \end_layout
3489 \begin_layout Subsection
3490 Member: sram.<name>
3491 \end_layout
3493 \begin_layout Standard
3494 Raw binary SRAM of kind <name> at time of savestate.
3495  Only present in savestates.
3496 \end_layout
3498 \begin_layout Subsection
3499 Member: input
3500 \end_layout
3502 \begin_layout Standard
3503 The actual input track, one line per subframe (blank lines are skipped).
3504 \end_layout
3506 \begin_layout Itemize
3507 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
3508  part of same frame as previous, otherwise it starts a new frame.
3509 \end_layout
3511 \begin_layout Itemize
3512 First subframe must start a new frame.
3513 \end_layout
3515 \begin_layout Standard
3516 Length of movie in frames is number of lines in input file that start a
3517  new frame.
3518 \end_layout
3520 \begin_layout Subsection
3521 Member: rerecords
3522 \end_layout
3524 \begin_layout Standard
3525 Contains textual base-10 rerecord count (as one line; emulator just writes
3526  this, it doesn't read it) + 1.
3527 \end_layout
3529 \begin_layout Subsection
3530 Member: rrdata
3531 \end_layout
3533 \begin_layout Standard
3534 This member stores set of load IDs.
3535  There is one load ID per rerecord (plus one corresponding to start of project).
3536 \end_layout
3538 \begin_layout Itemize
3539 This member constists of concatenation of records
3540 \end_layout
3542 \begin_layout Itemize
3543 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
3544  IDs.
3545 \end_layout
3547 \begin_layout Itemize
3548 IDs are interpretted as 256-bit big-endian integers with warparound.
3549 \end_layout
3551 \begin_layout Itemize
3552 Initial predicted ID is all zeroes.
3553 \end_layout
3555 \begin_layout Standard
3556 Format of each record is:
3557 \end_layout
3559 \begin_layout Itemize
3560 1 byte: Opcode byte.
3561  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
3562  Bit 7 is unused.
3563 \end_layout
3565 \begin_layout Itemize
3566 32-prefixlen bytes of ID.
3567 \end_layout
3569 \begin_layout Itemize
3570 countlen bytes of big-endian count (count).
3571 \end_layout
3573 \begin_layout Standard
3574 Records are processed as follows:
3575 \end_layout
3577 \begin_layout Itemize
3578 To form the first ID encoded by record, take the first prefixlen bytes predicted
3579  ID and append the read ID value to it.
3580  The result is the first ID encoded.
3581 \end_layout
3583 \begin_layout Itemize
3584 If countlen is 0, record encodes 1 ID.
3585 \end_layout
3587 \begin_layout Itemize
3588 If countlen is 1, record encodes 2+count IDs.
3589 \end_layout
3591 \begin_layout Itemize
3592 If countlen is 2, record encodes 258+count IDs.
3593 \end_layout
3595 \begin_layout Itemize
3596 If countlen is 3, record encodes 65794+count IDs.
3597 \end_layout
3599 \begin_layout Itemize
3600 The new predicted ID is the next ID after last one encoded by the record.
3601 \end_layout
3603 \begin_layout Standard
3604 The number of rerecords + 1 is equal to the sum of number of IDs encoded
3605  by all records.
3606 \end_layout
3608 \begin_layout Subsection
3609 Member: starttime.second
3610 \end_layout
3612 \begin_layout Standard
3613 Movie starting time, second part.
3614  Epoch is Unix epoch.
3615  Default is 1,000,000,000.
3616 \end_layout
3618 \begin_layout Subsection
3619 Member: starttime.subsecond
3620 \end_layout
3622 \begin_layout Standard
3623 Movie starting time, subsecond part.
3624  Unit is CPU clocks.
3625  Default is 0.
3626 \end_layout
3628 \begin_layout Subsection
3629 Member: savetime.second
3630 \end_layout
3632 \begin_layout Standard
3633 Movie saving time, second part.
3634  Default is starttime.second.
3635  Only present in savestates.
3636 \end_layout
3638 \begin_layout Subsection
3639 Member: savetime.subsecond
3640 \end_layout
3642 \begin_layout Standard
3643 Movie saving time, subsecond part.
3644  Default is starttime.subsecond.
3645  Only present in savestates.
3646 \end_layout
3648 \begin_layout Section
3649 Compiling:
3650 \end_layout
3652 \begin_layout Subsection
3653 Building BSNES
3654 \end_layout
3656 \begin_layout Standard
3657 make ui=ui-libsnes profile=accuracy
3658 \end_layout
3660 \begin_layout Standard
3661 For Bsnes v084 You need to apply the six patches in bsnes-patches/.
3662  These fix the following:
3663 \end_layout
3665 \begin_layout Enumerate
3666 Make libsnes actually compile (it won't compile without!)
3667 \end_layout
3669 \begin_layout Enumerate
3670 Bump the version number to be correct (nice to have)
3671 \end_layout
3673 \begin_layout Enumerate
3674 Make RTC emulation time cleanly overridable (needed by games using RTC)
3675 \end_layout
3677 \begin_layout Enumerate
3678 Save/Load controller state on savestate/loadstate (many games screw up without)
3679 \end_layout
3681 \begin_layout Enumerate
3682 Fix unserialization of 64-bit integers (needed)
3683 \end_layout
3685 \begin_layout Enumerate
3686 Allow frontend to control random number seed (just nice to have)
3687 \end_layout
3689 \begin_layout Subsection
3690 Prerequisite libraries:
3691 \end_layout
3693 \begin_layout Itemize
3694 zlib
3695 \end_layout
3697 \begin_layout Itemize
3698 SDL (SDL platform)
3699 \end_layout
3701 \begin_layout Itemize
3702 SDLmain (Windows/Mac OS X only; Note you may have to extract the object
3703  out of archive)
3704 \end_layout
3706 \begin_layout Itemize
3707 boost_iostreams
3708 \end_layout
3710 \begin_layout Itemize
3711 boost_filesystem
3712 \end_layout
3714 \begin_layout Itemize
3715 boost conversion (header only)
3716 \end_layout
3718 \begin_layout Subsection
3719 Compile options to make:
3720 \end_layout
3722 \begin_layout Subsubsection
3723 BSNES_PATH=<path>
3724 \end_layout
3726 \begin_layout Standard
3727 Set path to BSNES bsnes directory to <path>.
3728 \end_layout
3730 \begin_layout Subsubsection
3731 THREADS=NO
3732 \end_layout
3734 \begin_layout Standard
3735 Don't use threads on Linux.
3736 \end_layout
3738 \begin_layout Subsubsection
3739 THREADS=YES
3740 \end_layout
3742 \begin_layout Standard
3743 Try to use threads even on non-Linux systems.
3744 \end_layout
3746 \begin_layout Subsubsection
3747 CROSS_PREFIX=<prefix>
3748 \end_layout
3750 \begin_layout Standard
3751 Prepend this to all commands refering to cross-compiling environment with
3752  this.
3753 \end_layout
3755 \begin_layout Subsubsection
3756 CC=<compiler>
3757 \end_layout
3759 \begin_layout Standard
3760 Target C++ compiler to use.
3761  Defaults to g++
3762 \end_layout
3764 \begin_layout Standard
3765 Note: If crosscompiling, this has to be crosscompiler, and CROSS_PREFIX
3766  is prepended.
3767 \end_layout
3769 \begin_layout Subsubsection
3770 BSNES_IS_COMPAT=1
3771 \end_layout
3773 \begin_layout Standard
3774 Assume BSNES uses compatiblity core instead of accuracy core.
3775 \end_layout
3777 \begin_layout Subsubsection
3778 LUA=<package>
3779 \end_layout
3781 \begin_layout Standard
3782 Compile lua support, using package <package>
3783 \end_layout
3785 \begin_layout Subsubsection
3786 GRAPHICS=<plat>
3787 \end_layout
3789 \begin_layout Standard
3790 Set graphics platform.
3791  Currently available choices are 
3792 \begin_inset Quotes eld
3793 \end_inset
3796 \begin_inset Quotes erd
3797 \end_inset
3799  and 
3800 \begin_inset Quotes eld
3801 \end_inset
3803 WXWIDGETS
3804 \begin_inset Quotes erd
3805 \end_inset
3808 \end_layout
3810 \begin_layout Subsubsection
3811 SOUND=<plat>
3812 \end_layout
3814 \begin_layout Standard
3815 Set sound platform.
3816  Currently available choices are 
3817 \begin_inset Quotes eld
3818 \end_inset
3821 \begin_inset Quotes erd
3822 \end_inset
3824  (requires SDL graphics), 
3825 \begin_inset Quotes eld
3826 \end_inset
3828 PORTAUDIO
3829 \begin_inset Quotes erd
3830 \end_inset
3832  and 
3833 \begin_inset Quotes eld
3834 \end_inset
3836 DUMMY
3837 \begin_inset Quotes erd
3838 \end_inset
3841 \end_layout
3843 \begin_layout Subsubsection
3844 JOYSTICK=<plat>
3845 \end_layout
3847 \begin_layout Standard
3848 Set joystick platform.
3849  Currently available choices are 
3850 \begin_inset Quotes eld
3851 \end_inset
3854 \begin_inset Quotes erd
3855 \end_inset
3857  (requires SDL graphics), 
3858 \begin_inset Quotes eld
3859 \end_inset
3861 EVDEV
3862 \begin_inset Quotes erd
3863 \end_inset
3865  and 
3866 \begin_inset Quotes eld
3867 \end_inset
3869 DUMMY
3870 \begin_inset Quotes erd
3871 \end_inset
3874 \end_layout
3876 \begin_layout Section
3877 Quick'n'dirty encode guide
3878 \end_layout
3880 \begin_layout Enumerate
3881 Start the emulator and load the movie file.
3882 \end_layout
3884 \begin_layout Enumerate
3885 Set large AVI option 'set-setting avi-large on'
3886 \end_layout
3888 \begin_layout Enumerate
3889 If dumping PAL, set bottom border to 2 'set-setting avi-bottom-border 2'
3890 \end_layout
3892 \begin_layout Enumerate
3893 Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are 
3894 \begin_inset Quotes eld
3895 \end_inset
3897 use only if you know what you are doing.
3898 \begin_inset Quotes erd
3899 \end_inset
3902  In this case, these can be safely used because of how x264 internally works.
3903 \end_layout
3905 \begin_layout Enumerate
3906 Unpause and let it run until you want to end dumping.
3907 \end_layout
3909 \begin_layout Enumerate
3910 Close the emulator (closing the window is the easiest way)
3911 \end_layout
3913 \begin_layout Enumerate
3914 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
3915  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
3916 \end_layout
3918 \begin_layout Enumerate
3919 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
3920 \end_layout
3922 \begin_layout Enumerate
3923 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
3924  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
3925 \end_layout
3927 \begin_layout Enumerate
3928 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
3929  Now final.mkv contains quick'n'dirty encode.
3930 \end_layout
3932 \begin_layout Section
3933 Axis configurations for some gamepad types:
3934 \end_layout
3936 \begin_layout Subsection
3937 XBox360 controller:
3938 \end_layout
3940 \begin_layout Standard
3941 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
3942 \end_layout
3944 \begin_layout LyX-Code
3945 set-axis joystick0axis2 pressure-+
3946 \end_layout
3948 \begin_layout LyX-Code
3949 set-axis joystick0axis5 pressure-+
3950 \end_layout
3952 \begin_layout Subsection
3953 PS3 
3954 \begin_inset Quotes eld
3955 \end_inset
3957 sixaxis
3958 \begin_inset Quotes erd
3959 \end_inset
3961  controller:
3962 \end_layout
3964 \begin_layout Standard
3965 Axes 8-19 should be disabled.
3966 \end_layout
3968 \begin_layout LyX-Code
3969 set-axis joystick0axis8 disabled
3970 \end_layout
3972 \begin_layout LyX-Code
3973 set-axis joystick0axis9 disabled
3974 \end_layout
3976 \begin_layout LyX-Code
3977 set-axis joystick0axis10 disabled
3978 \end_layout
3980 \begin_layout LyX-Code
3981 set-axis joystick0axis11 disabled
3982 \end_layout
3984 \begin_layout LyX-Code
3985 set-axis joystick0axis12 disabled
3986 \end_layout
3988 \begin_layout LyX-Code
3989 set-axis joystick0axis13 disabled
3990 \end_layout
3992 \begin_layout LyX-Code
3993 set-axis joystick0axis14 disabled
3994 \end_layout
3996 \begin_layout LyX-Code
3997 set-axis joystick0axis15 disabled
3998 \end_layout
4000 \begin_layout LyX-Code
4001 set-axis joystick0axis16 disabled
4002 \end_layout
4004 \begin_layout LyX-Code
4005 set-axis joystick0axis17 disabled
4006 \end_layout
4008 \begin_layout LyX-Code
4009 set-axis joystick0axis18 disabled
4010 \end_layout
4012 \begin_layout LyX-Code
4013 set-axis joystick0axis19 disabled
4014 \end_layout
4016 \begin_layout Section
4017 Errata:
4018 \end_layout
4020 \begin_layout Subsection
4021 Problems from BSNES core:
4022 \end_layout
4024 \begin_layout Itemize
4025 The whole pending save stuff.
4026 \end_layout
4028 \begin_layout Itemize
4029 Delay resets are slow.
4030 \end_layout
4032 \begin_layout Itemize
4033 RTC is not emulated in sync-stable manner.
4034 \end_layout
4036 \begin_layout Itemize
4037 Lack of layer hiding.
4038 \end_layout
4040 \begin_layout Itemize
4041 It is slow.
4042 \end_layout
4044 \begin_layout Itemize
4045 Firmwares can't be loaded from ZIP archives.
4046 \end_layout
4048 \begin_layout Itemize
4049 Manual polls can be corrupted if savestate occurs during those.
4050 \end_layout
4052 \begin_layout Subsection
4053 Other problems:
4054 \end_layout
4056 \begin_layout Itemize
4057 Modifiers don't work with pseudo-keys (SDL).
4058 \end_layout
4060 \begin_layout Itemize
4061 Audio for last dumped frame is not itself dumped.
4062 \end_layout
4064 \begin_layout Itemize
4065 Audio in UI is pretty bad in quality.
4066 \end_layout
4068 \begin_layout Itemize
4069 UI itself is 30fps max.
4070 \end_layout
4072 \begin_layout Itemize
4073 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
4074 \end_layout
4076 \begin_layout Itemize
4077 No menus, command based interface (SDL).
4078 \end_layout
4080 \begin_layout Itemize
4081 Long commands don't scroll.
4082 \end_layout
4084 \begin_layout Itemize
4085 The SDL screen drawing is slow.
4086 \end_layout
4088 \begin_layout Section
4089 Changelog:
4090 \end_layout
4092 \begin_layout Subsection
4093 rr0-beta1
4094 \end_layout
4096 \begin_layout Itemize
4097 Fix -Wall warnings
4098 \end_layout
4100 \begin_layout Itemize
4101 Fix dumper video corruption with levels 10-18.
4102 \end_layout
4104 \begin_layout Subsection
4105 rr0-beta2
4106 \end_layout
4108 \begin_layout Itemize
4109 Autofire
4110 \end_layout
4112 \begin_layout Itemize
4113 Lots of code cleanups
4114 \end_layout
4116 \begin_layout Itemize
4117 Lua interface to settings
4118 \end_layout
4120 \begin_layout Itemize
4121 Allow specifying AVI borders without Lua
4122 \end_layout
4124 \begin_layout Itemize
4125 Fix scaling if vscale > 1 and originx > 0 (left border exists)
4126 \end_layout
4128 \begin_layout Itemize
4129 on_snoop lua callback
4130 \end_layout
4132 \begin_layout Itemize
4133 Faster movie loading and saving.
4134 \end_layout
4136 \begin_layout Subsection
4137 rr0-beta3
4138 \end_layout
4140 \begin_layout Itemize
4141 Joystick support
4142 \end_layout
4144 \begin_layout Subsection
4145 rr0-beta4
4146 \end_layout
4148 \begin_layout Itemize
4149 Fix multi-buttons
4150 \end_layout
4152 \begin_layout Itemize
4153 Save jukebox functionality.
4154 \end_layout
4156 \begin_layout Subsection
4157 rr0-beta5
4158 \end_layout
4160 \begin_layout Itemize
4161 Try to fix some nasty failing movie load edge cases
4162 \end_layout
4164 \begin_layout Itemize
4165 Allow specifying scripts to run on command line.
4166 \end_layout
4168 \begin_layout Subsection
4169 rr0-beta6
4170 \end_layout
4172 \begin_layout Itemize
4173 Major source code reorganization.
4174 \end_layout
4176 \begin_layout Itemize
4177 Backup savestates before overwriting.
4178 \end_layout
4180 \begin_layout Itemize
4181 Don't crash if loading initial state fails.
4182 \end_layout
4184 \begin_layout Subsection
4185 rr0-beta7
4186 \end_layout
4188 \begin_layout Itemize
4189 Fix firmware lookup
4190 \end_layout
4192 \begin_layout Itemize
4193 Fix author name parsing
4194 \end_layout
4196 \begin_layout Itemize
4197 Fix rerecord counting
4198 \end_layout
4200 \begin_layout Itemize
4201 (SDL) Print messages to console if SDL is uninitialized
4202 \end_layout
4204 \begin_layout Itemize
4205 Add movieinfo program
4206 \end_layout
4208 \begin_layout Itemize
4209 Fix loading movies starting from SRAM.
4210 \end_layout
4212 \begin_layout Subsection
4213 rr0-beta8
4214 \end_layout
4216 \begin_layout Itemize
4217 Add support for unattended dumping
4218 \end_layout
4220 \begin_layout Itemize
4221 Fix compiling for Win32
4222 \end_layout
4224 \begin_layout Itemize
4225 Don't lock up if sound can't be initialized
4226 \end_layout
4228 \begin_layout Itemize
4229 Strip trailing CR from commands
4230 \end_layout
4232 \begin_layout Itemize
4233 Don't try to do dubious things in global ctors (fix crash on startup)
4234 \end_layout
4236 \begin_layout Subsection
4237 rr0-beta9
4238 \end_layout
4240 \begin_layout Itemize
4241 Small documentation tweaking
4242 \end_layout
4244 \begin_layout Itemize
4245 Fix make clean
4246 \end_layout
4248 \begin_layout Itemize
4249 Fix major bug in modifier matching
4250 \end_layout
4252 \begin_layout Subsection
4253 rr0-beta10
4254 \end_layout
4256 \begin_layout Itemize
4257 Lots of documentation fixes
4258 \end_layout
4260 \begin_layout Itemize
4261 Use dedicated callbacks for event backcomm., not commands.
4262 \end_layout
4264 \begin_layout Itemize
4265 Ensure that the watchdog is not hit when executing delayed reset.
4266 \end_layout
4268 \begin_layout Itemize
4269 Remove errant tab from joystick message.
4270 \end_layout
4272 \begin_layout Subsection
4273 rr0-beta11
4274 \end_layout
4276 \begin_layout Itemize
4277 Make autofire operate in absolute time, not linear time
4278 \end_layout
4280 \begin_layout Itemize
4281 Reinitialize controls when resuming from loadstate
4282 \end_layout
4284 \begin_layout Itemize
4285 Some more code cleanups
4286 \end_layout
4288 \begin_layout Itemize
4289 If Lua allocator fails, call OOM_panic()
4290 \end_layout
4292 \begin_layout Itemize
4293 Byte/word/dword/qword sized host memory write/read functions.
4294 \end_layout
4296 \begin_layout Itemize
4297 Dump at correct framerate if dumping interlaced NTSC (height=448).
4298 \end_layout
4300 \begin_layout Subsection
4301 rr0-beta12
4302 \end_layout
4304 \begin_layout Itemize
4305 Actually include the complete source code
4306 \end_layout
4308 \begin_layout Itemize
4309 Keep track of RTC
4310 \end_layout
4312 \begin_layout Subsection
4313 rr0-beta13
4314 \end_layout
4316 \begin_layout Itemize
4317 Document {save,start}time.{,sub}second.
4318 \end_layout
4320 \begin_layout Itemize
4321 Intercept time() from bsnes core.
4322 \end_layout
4324 \begin_layout Subsection
4325 rr0-beta14
4326 \end_layout
4328 \begin_layout Itemize
4329 Allow disabling time() interception (allow build on Mac OS X)
4330 \end_layout
4332 \begin_layout Itemize
4333 Use SDLMain on Mac OS X (make SDL not crash)
4334 \end_layout
4336 \begin_layout Itemize
4337 Disable delayed resets (just plain too buggy for now).
4338 \end_layout
4340 \begin_layout Itemize
4341 Code cleanups
4342 \end_layout
4344 \begin_layout Itemize
4345 Use 16-bit for graphics/video instead of 32-bit.
4346 \end_layout
4348 \begin_layout Itemize
4349 gui.rectangle/gui.pixel
4350 \end_layout
4352 \begin_layout Itemize
4353 gui.crosshair
4354 \end_layout
4356 \begin_layout Itemize
4357 New CSCD writer implementation.
4358 \end_layout
4360 \begin_layout Subsection
4361 rr0-beta15
4362 \end_layout
4364 \begin_layout Itemize
4365 Fix interaction of * and +.
4366 \end_layout
4368 \begin_layout Itemize
4369 Manual improvements
4370 \end_layout
4372 \begin_layout Itemize
4373 Use gettimeofday()/usleep(), these seem portable enough.
4374 \end_layout
4376 \begin_layout Itemize
4377 Move joystick axis manipulation to keymapper code.
4378 \end_layout
4380 \begin_layout Itemize
4381 Changes to how read-only works.
4382 \end_layout
4384 \begin_layout Itemize
4385 Refactor controller input code.
4386 \end_layout
4388 \begin_layout Subsection
4389 rr0-beta16
4390 \end_layout
4392 \begin_layout Itemize
4393 Fix mouseclick scale compensation.
4394 \end_layout
4396 \begin_layout Itemize
4397 Draw area boundaries correctly in SDL code.
4398 \end_layout
4400 \begin_layout Itemize
4401 gui.screenshot.
4402 \end_layout
4404 \begin_layout Itemize
4405 Fix CSCD output (buffer overrun and race condition).
4406 \end_layout
4408 \begin_layout Subsection
4409 rr0-beta17
4410 \end_layout
4412 \begin_layout Itemize
4413 JMD dumping support.
4414 \end_layout
4416 \begin_layout Itemize
4417 Allow unattended dumping to JMD.
4418 \end_layout
4420 \begin_layout Itemize
4421 Move to BSNES v083.
4422 \end_layout
4424 \begin_layout Itemize
4425 Switch back to 32-bit colors.
4426 \end_layout
4428 \begin_layout Itemize
4429 Add Lua function gui.color.
4430 \end_layout
4432 \begin_layout Itemize
4433 Use some new C++11 features in GCC 4.6.
4434 \end_layout
4436 \begin_layout Itemize
4437 Be prepared for core frequency changes.
4438 \end_layout
4440 \begin_layout Itemize
4441 Pass colors in one chunk from Lua.
4442 \end_layout
4444 \begin_layout Subsection
4445 rr0-beta18
4446 \end_layout
4448 \begin_layout Itemize
4449 New lua functions gui.line(), gui.status() and gui.circle(), memory.vma_count(),
4450  memory.read_vma() and memory.find_vma().
4451 \end_layout
4453 \begin_layout Itemize
4454 Numerious documentation fixups
4455 \end_layout
4457 \begin_layout Itemize
4458 RTC time format changed
4459 \end_layout
4461 \begin_layout Itemize
4462 Reformat flags display
4463 \end_layout
4465 \begin_layout Itemize
4466 Allow lua package name to be overridden
4467 \end_layout
4469 \begin_layout Itemize
4470 SDUMP (high-quality dumping).
4471 \end_layout
4473 \begin_layout Itemize
4474 Split platform support to plugins.
4475 \end_layout
4477 \begin_layout Itemize
4478 Make all sound plugins support basic sound commands
4479 \end_layout
4481 \begin_layout Itemize
4482 Support portaudio for sound.
4483 \end_layout
4485 \begin_layout Itemize
4486 Allow disable Lua/SDL searching.
4487 \end_layout
4489 \begin_layout Itemize
4490 Upconvert colors when copying lcscreen to screen.
4491 \end_layout
4493 \begin_layout Itemize
4494 Reorganize source tree.
4495 \end_layout
4497 \begin_layout Itemize
4498 Evdev joystick support.
4499 \end_layout
4501 \begin_layout Itemize
4502 Refactor more code into generic window code.
4503 \end_layout
4505 \begin_layout Subsection
4506 rr0-beta19
4507 \end_layout
4509 \begin_layout Itemize
4510 Refactor message handling.
4511 \end_layout
4513 \begin_layout Itemize
4514 Rework makefile
4515 \end_layout
4517 \begin_layout Itemize
4518 Documentation fixes
4519 \end_layout
4521 \begin_layout Itemize
4522 Finish pending saves before load/quit.
4523 \end_layout
4525 \begin_layout Itemize
4526 Wxwidgets graphics plugin.
4527 \end_layout
4529 \begin_layout Subsection
4530 rr0-beta20
4531 \end_layout
4533 \begin_layout Itemize
4534 Get rid of win32-crap.[ch]pp.
4535 \end_layout
4537 \begin_layout Itemize
4538 Move files around a lot.
4539 \end_layout
4541 \begin_layout Itemize
4542 Get rid of need for host C++ compiler.
4543 \end_layout
4545 \begin_layout Itemize
4546 Bsnes v084 core.
4547 \end_layout
4549 \begin_layout Itemize
4550 Refactor inter-component communication.
4551 \end_layout
4553 \begin_layout Itemize
4554 Fix zero luma.
4555 \end_layout
4557 \begin_layout Itemize
4558 Fix crash on multiline aliases.
4559 \end_layout
4561 \begin_layout Itemize
4562 Load/Save settings in wxwidgets gui.
4563 \end_layout
4565 \begin_layout Subsection
4566 rr0-beta21
4567 \end_layout
4569 \begin_layout Itemize
4570 Patch problems in bsnes core
4571 \end_layout
4573 \begin_layout Itemize
4574 SNES is little-endian, not big-endian!
4575 \end_layout
4577 \begin_layout Itemize
4578 Fix memory corruption in lcscreen::load()
4579 \end_layout
4581 \end_body
4582 \end_document