lsnes rr0-β24
[lsnes.git] / manual.lyx
blobaaaeeb5ce796c507c540919c79e366fbfd1b89cf
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 Table _SYSTEM
2587 \end_layout
2589 \begin_layout Standard
2590 Contains copy of global variables from time of Lua initialization.
2591  Non-writeable.
2592 \end_layout
2594 \begin_layout Subsection
2595 Callbacks
2596 \end_layout
2598 \begin_layout Standard
2599 Various callbacks to Lua that can occur.
2600 \end_layout
2602 \begin_layout Subsubsection
2603 Callback: on_paint()
2604 \end_layout
2606 \begin_layout Standard
2607 Called when screen is being painted.
2608  Any gui.* calls requiring graphic context draw on the screen.
2609 \end_layout
2611 \begin_layout Subsubsection
2612 Callback: on_video()
2613 \end_layout
2615 \begin_layout Standard
2616 Called when video dump frame is being painted.
2617  Any gui.* calls requiring graphic context draw on the video.
2618 \end_layout
2620 \begin_layout Subsubsection
2621 Callback: on_frame()
2622 \end_layout
2624 \begin_layout Standard
2625 Called on each starting whole frame.
2626 \end_layout
2628 \begin_layout Subsubsection
2629 Callback: on_startup()
2630 \end_layout
2632 \begin_layout Standard
2633 Called when the emulator is starting (lsnes.rc and --run files has been run).
2634 \end_layout
2636 \begin_layout Subsubsection
2637 Callback: on_pre_load(string name)
2638 \end_layout
2640 \begin_layout Standard
2641 Called just before savestate/movie load occurs (note: loads are always delayed,
2642  so this occurs even when load was initiated by lua).
2643 \end_layout
2645 \begin_layout Subsubsection
2646 Callback: on_err_load(string name)
2647 \end_layout
2649 \begin_layout Standard
2650 Called if loadstate goes wrong.
2651 \end_layout
2653 \begin_layout Subsubsection
2654 Callback: on_post_load(string name, boolean was_savestate)
2655 \end_layout
2657 \begin_layout Standard
2658 Called on successful loadstate.
2659  was_savestate gives if this was a savestate or a movie.
2660 \end_layout
2662 \begin_layout Subsubsection
2663 Callback: on_pre_save(string name, boolean is_savestate)
2664 \end_layout
2666 \begin_layout Standard
2667 Called just before savestate save occurs (note: movie saves are synchronous
2668  and won't trigger these callbacks if called from Lua).
2669 \end_layout
2671 \begin_layout Subsubsection
2672 Callback: on_err_save(string name)
2673 \end_layout
2675 \begin_layout Standard
2676 Called if savestate goes wrong.
2677 \end_layout
2679 \begin_layout Subsubsection
2680 Callback: on_post_save(string name, boolean is_savestate)
2681 \end_layout
2683 \begin_layout Standard
2684 Called on successful savaestate.
2685  is_savestate gives if this was a savestate or a movie.
2686 \end_layout
2688 \begin_layout Subsubsection
2689 Callback: on_quit()
2690 \end_layout
2692 \begin_layout Standard
2693 Called when emulator is shutting down.
2694 \end_layout
2696 \begin_layout Subsubsection
2697 Callback: on_input(boolean subframe)
2698 \end_layout
2700 \begin_layout Standard
2701 Called when emulator is just sending input to bsnes core.
2702  Warning: This is called even in readonly mode, but the results are ignored.
2703 \end_layout
2705 \begin_layout Subsubsection
2706 Callback: on_reset()
2707 \end_layout
2709 \begin_layout Standard
2710 Called when SNES is reset.
2711 \end_layout
2713 \begin_layout Subsubsection
2714 Callback: on_readwrite()
2715 \end_layout
2717 \begin_layout Standard
2718 Called when moving into readwrite mode as result of 
2719 \begin_inset Quotes eld
2720 \end_inset
2722 set-rwmode
2723 \begin_inset Quotes erd
2724 \end_inset
2726  command (note: moving to rwmode by Lua won't trigger this, as per recursive
2727  entry protection).
2728 \end_layout
2730 \begin_layout Subsubsection
2731 Callback: on_snoop(number port, number controller, number index, number
2732  value)
2733 \end_layout
2735 \begin_layout Standard
2736 Called each time bsnes asks for input.
2737  The value is the final value to be sent to bsnes core (readonly mode, autohold
2738  and autofire have been taken into account).
2739  Might be useful when translating movies to format suitable for console
2740  verification.
2741  Note: There is no way to modify the value to be sent.
2742 \end_layout
2744 \begin_layout Section
2745 Modifier and key names:
2746 \end_layout
2748 \begin_layout Subsection
2749 SDL Platform
2750 \end_layout
2752 \begin_layout Subsubsection
2753 Modifier names
2754 \end_layout
2756 \begin_layout Standard
2757 Following modifier names are known:
2758 \end_layout
2760 \begin_layout Itemize
2761 ctrl, lctrl, rctrl: Control keys
2762 \end_layout
2764 \begin_layout Itemize
2765 alt, lalt, ralt: ALT keys.
2766 \end_layout
2768 \begin_layout Itemize
2769 shift, lshift, rshift: Shift keys.
2770 \end_layout
2772 \begin_layout Itemize
2773 meta, lmeta, rmeta: Meta keys.
2774 \end_layout
2776 \begin_layout Itemize
2777 num, caps: Numlock/Capslock (these are sticky!)
2778 \end_layout
2780 \begin_layout Itemize
2781 mode: Mode select.
2782 \end_layout
2784 \begin_layout Subsubsection
2785 Key names
2786 \end_layout
2788 \begin_layout Standard
2789 Following key names are known:
2790 \end_layout
2792 \begin_layout Itemize
2793 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
2794  hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
2795  comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
2796  less, equals, greater, question, at, leftbracket, backslash, rightbracket,
2797  caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
2798  o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
2799  world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
2800  world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
2801  world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
2802  world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
2803  world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
2804  world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
2805  world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
2806  world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
2807  world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
2808  world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
2809  world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
2810  world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
2811  kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
2812  kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
2813  pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
2814  f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
2815  lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
2816  break, menu, power, euro, undo
2817 \end_layout
2819 \begin_layout Itemize
2820 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
2821  hardware-dependent scan code of <n> (useful to bind those keys that don't
2822  have symbolic names).
2823 \end_layout
2825 \begin_layout Standard
2826 In addition, following pseudo-keys are known (note: these do not work in
2827  conjunction with modifers):
2828 \end_layout
2830 \begin_layout Itemize
2831 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
2832 \end_layout
2834 \begin_layout Itemize
2835 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
2836 \end_layout
2838 \begin_layout Itemize
2839 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
2840 \end_layout
2842 \begin_layout Itemize
2843 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
2844 \end_layout
2846 \begin_layout Itemize
2847 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
2848 \end_layout
2850 \begin_layout Itemize
2851 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
2852  position (axis modes axis and axis_inverse).
2853 \end_layout
2855 \begin_layout Itemize
2856 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
2857  position (axis modes axis and axis_inverse).
2858 \end_layout
2860 \begin_layout Itemize
2861 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
2862  modes pressure_*).
2863 \end_layout
2865 \begin_layout Subsubsection
2866 Special buttons:
2867 \end_layout
2869 \begin_layout Itemize
2870 Escape: Enter/Exit Command mode, cancel modal dialogs.
2871 \end_layout
2873 \begin_layout Itemize
2874 Return (also KPEnter): Execute command, ok modal dialog.
2875 \end_layout
2877 \begin_layout Itemize
2878 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
2879  history
2880 \end_layout
2882 \begin_layout Itemize
2883 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
2884  history
2885 \end_layout
2887 \begin_layout Itemize
2888 Home (also KP7 if no num lock; command mode): Beginning of command.
2889 \end_layout
2891 \begin_layout Itemize
2892 End (also KP1 if no num lock; command mode): End of command.
2893 \end_layout
2895 \begin_layout Itemize
2896 Left (also KP4 if no num lock; command mode): Move cursor left.
2897 \end_layout
2899 \begin_layout Itemize
2900 Right (also KP6 if no num lock; command mode): Move cursor right.
2901 \end_layout
2903 \begin_layout Itemize
2904 Delete (also KP.
2905  if no num lock; command mode): Delete character to right of cursor.
2906 \end_layout
2908 \begin_layout Itemize
2909 Insert (also KP0 if no num lock; command mode): Toggle between insert /
2910  overwrite modes.
2911 \end_layout
2913 \begin_layout Itemize
2914 Backspace (command mode): Delete character to left of cursor.
2915 \end_layout
2917 \begin_layout Itemize
2918 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
2919 \end_layout
2921 \begin_layout Subsubsection
2922 Watchdog timer:
2923 \end_layout
2925 \begin_layout Standard
2926 If emulator does not reach internal polling loop in 15 seconds after leaving
2927  it or 15 seconds after starting, the emulator instantly bombs out.
2928 \end_layout
2930 \begin_layout Section
2931 Movie file format
2932 \end_layout
2934 \begin_layout Standard
2935 Movie file is .zip archive in itself, normal ZIP archive tools work on it
2936  (note: If you recompress it, do not use compression methods other than
2937  store and deflate and especially do not use encryption of any kind).
2938 \end_layout
2940 \begin_layout Subsection
2941 Detecting clean start/SRAM/Savestate
2942 \end_layout
2944 \begin_layout Itemize
2945 If file has member 
2946 \begin_inset Quotes eld
2947 \end_inset
2949 savestate
2950 \begin_inset Quotes erd
2951 \end_inset
2953  it is savestate, otherwise:
2954 \end_layout
2956 \begin_layout Itemize
2957 If file has members with names starting 
2958 \begin_inset Quotes eld
2959 \end_inset
2961 moviesram.
2962 \begin_inset Quotes erd
2963 \end_inset
2965  it is movie starting from SRAM, otherwise:
2966 \end_layout
2968 \begin_layout Itemize
2969 It is movie starting from clear state.
2970 \end_layout
2972 \begin_layout Subsection
2973 Member: gametype
2974 \end_layout
2976 \begin_layout Standard
2977 Type of game ROM and region (as one line).
2978  Valid values are:
2979 \end_layout
2981 \begin_layout Standard
2982 \begin_inset Tabular
2983 <lyxtabular version="3" rows="8" columns="3">
2984 <features tabularvalignment="middle">
2985 <column alignment="center" valignment="top" width="0">
2986 <column alignment="center" valignment="top" width="0">
2987 <column alignment="center" valignment="top" width="0">
2988 <row>
2989 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2990 \begin_inset Text
2992 \begin_layout Plain Layout
2993 Value
2994 \end_layout
2996 \end_inset
2997 </cell>
2998 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2999 \begin_inset Text
3001 \begin_layout Plain Layout
3002 System
3003 \end_layout
3005 \end_inset
3006 </cell>
3007 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3008 \begin_inset Text
3010 \begin_layout Plain Layout
3011 Region
3012 \end_layout
3014 \end_inset
3015 </cell>
3016 </row>
3017 <row>
3018 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3019 \begin_inset Text
3021 \begin_layout Plain Layout
3022 snes_pal
3023 \end_layout
3025 \end_inset
3026 </cell>
3027 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3028 \begin_inset Text
3030 \begin_layout Plain Layout
3031 Super NES
3032 \end_layout
3034 \end_inset
3035 </cell>
3036 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3037 \begin_inset Text
3039 \begin_layout Plain Layout
3041 \end_layout
3043 \end_inset
3044 </cell>
3045 </row>
3046 <row>
3047 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3048 \begin_inset Text
3050 \begin_layout Plain Layout
3051 sgb_pal
3052 \end_layout
3054 \end_inset
3055 </cell>
3056 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3057 \begin_inset Text
3059 \begin_layout Plain Layout
3060 Super Game Boy
3061 \end_layout
3063 \end_inset
3064 </cell>
3065 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3066 \begin_inset Text
3068 \begin_layout Plain Layout
3070 \end_layout
3072 \end_inset
3073 </cell>
3074 </row>
3075 <row>
3076 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3077 \begin_inset Text
3079 \begin_layout Plain Layout
3080 snes_ntsc
3081 \end_layout
3083 \end_inset
3084 </cell>
3085 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3086 \begin_inset Text
3088 \begin_layout Plain Layout
3089 Super NES
3090 \end_layout
3092 \end_inset
3093 </cell>
3094 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3095 \begin_inset Text
3097 \begin_layout Plain Layout
3098 NTSC
3099 \end_layout
3101 \end_inset
3102 </cell>
3103 </row>
3104 <row>
3105 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3106 \begin_inset Text
3108 \begin_layout Plain Layout
3109 sgb_ntsc
3110 \end_layout
3112 \end_inset
3113 </cell>
3114 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3115 \begin_inset Text
3117 \begin_layout Plain Layout
3118 Super Game Boy
3119 \end_layout
3121 \end_inset
3122 </cell>
3123 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3124 \begin_inset Text
3126 \begin_layout Plain Layout
3127 NTSC
3128 \end_layout
3130 \end_inset
3131 </cell>
3132 </row>
3133 <row>
3134 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3135 \begin_inset Text
3137 \begin_layout Plain Layout
3139 \end_layout
3141 \end_inset
3142 </cell>
3143 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3144 \begin_inset Text
3146 \begin_layout Plain Layout
3147 BS-X (non-slotted)
3148 \end_layout
3150 \end_inset
3151 </cell>
3152 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3153 \begin_inset Text
3155 \begin_layout Plain Layout
3156 NTSC
3157 \end_layout
3159 \end_inset
3160 </cell>
3161 </row>
3162 <row>
3163 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3164 \begin_inset Text
3166 \begin_layout Plain Layout
3167 bsxslotted
3168 \end_layout
3170 \end_inset
3171 </cell>
3172 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3173 \begin_inset Text
3175 \begin_layout Plain Layout
3176 BS-X (slotted)
3177 \end_layout
3179 \end_inset
3180 </cell>
3181 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3182 \begin_inset Text
3184 \begin_layout Plain Layout
3185 NTSC
3186 \end_layout
3188 \end_inset
3189 </cell>
3190 </row>
3191 <row>
3192 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3193 \begin_inset Text
3195 \begin_layout Plain Layout
3196 sufamiturbo
3197 \end_layout
3199 \end_inset
3200 </cell>
3201 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3202 \begin_inset Text
3204 \begin_layout Plain Layout
3205 Sufami Turbo
3206 \end_layout
3208 \end_inset
3209 </cell>
3210 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3211 \begin_inset Text
3213 \begin_layout Plain Layout
3214 NTSC
3215 \end_layout
3217 \end_inset
3218 </cell>
3219 </row>
3220 </lyxtabular>
3222 \end_inset
3225 \end_layout
3227 \begin_layout Standard
3228 Frame rates are:
3229 \end_layout
3231 \begin_layout Standard
3232 \begin_inset Tabular
3233 <lyxtabular version="3" rows="3" columns="2">
3234 <features tabularvalignment="middle">
3235 <column alignment="center" valignment="top" width="0">
3236 <column alignment="center" valignment="top" width="0">
3237 <row>
3238 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3239 \begin_inset Text
3241 \begin_layout Plain Layout
3242 Region
3243 \end_layout
3245 \end_inset
3246 </cell>
3247 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3248 \begin_inset Text
3250 \begin_layout Plain Layout
3251 Framerate (fps)
3252 \end_layout
3254 \end_inset
3255 </cell>
3256 </row>
3257 <row>
3258 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3259 \begin_inset Text
3261 \begin_layout Plain Layout
3263 \end_layout
3265 \end_inset
3266 </cell>
3267 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3268 \begin_inset Text
3270 \begin_layout Plain Layout
3271 322445/6448
3272 \end_layout
3274 \end_inset
3275 </cell>
3276 </row>
3277 <row>
3278 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3279 \begin_inset Text
3281 \begin_layout Plain Layout
3282 NTSC
3283 \end_layout
3285 \end_inset
3286 </cell>
3287 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3288 \begin_inset Text
3290 \begin_layout Plain Layout
3291 10738636/178683
3292 \end_layout
3294 \end_inset
3295 </cell>
3296 </row>
3297 </lyxtabular>
3299 \end_inset
3302 \end_layout
3304 \begin_layout Subsection
3305 Member: port1
3306 \end_layout
3308 \begin_layout Standard
3309 Contains type of port #1 (as one line).
3310  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
3311  If not present, defaults to 'gamepad'.
3312 \end_layout
3314 \begin_layout Subsection
3315 Member: port2
3316 \end_layout
3318 \begin_layout Standard
3319 Contains type of port #2 (as one line).
3320  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
3321  'justifier' and 'justifiers'.
3322  If not present, defaults to 'none'.
3323 \end_layout
3325 \begin_layout Subsection
3326 Member: gamename
3327 \end_layout
3329 \begin_layout Standard
3330 Contains name of the game (as one line).
3331 \end_layout
3333 \begin_layout Subsection
3334 Member: authors
3335 \end_layout
3337 \begin_layout Standard
3338 Contains authors, one per line.
3339  Part before '|' is the full name, part after is the nickname.
3340 \end_layout
3342 \begin_layout Subsection
3343 Member: systemid
3344 \end_layout
3346 \begin_layout Standard
3347 Always 
3348 \begin_inset Quotes eld
3349 \end_inset
3351 lsnes-rr1
3352 \begin_inset Quotes erd
3353 \end_inset
3355  (one line).
3356  Used to reject other saves.
3357 \end_layout
3359 \begin_layout Subsection
3360 Member: controlsversion
3361 \end_layout
3363 \begin_layout Standard
3364 Always 
3365 \begin_inset Quotes eld
3366 \end_inset
3369 \begin_inset Quotes erd
3370 \end_inset
3372  (one line).
3373  Used to identify what controls are there.
3374 \end_layout
3376 \begin_layout Subsection
3377 Member: 
3378 \begin_inset Quotes eld
3379 \end_inset
3381 coreversion
3382 \begin_inset Quotes erd
3383 \end_inset
3386 \end_layout
3388 \begin_layout Standard
3389 Contains bsnes core version number (as one line).
3390 \end_layout
3392 \begin_layout Subsection
3393 Member: projectid
3394 \end_layout
3396 \begin_layout Standard
3397 Contains project ID (as one line).
3398  Used to identify if two movies are part of the same project.
3399 \end_layout
3401 \begin_layout Subsection
3402 Member: {rom,slota,slotb}{,xml}.sha256
3403 \end_layout
3405 \begin_layout Standard
3406 Contains SHA-256 of said ROM or ROM mapping file (as one line).
3407  Absent if corresponding file is absent.
3408 \end_layout
3410 \begin_layout Subsection
3411 Member: moviesram.<name>
3412 \end_layout
3414 \begin_layout Standard
3415 Raw binary startup SRAM of kind <name>.
3416  Only present in savestates and movies starting from SRAM.
3417 \end_layout
3419 \begin_layout Subsection
3420 Member: saveframe
3421 \end_layout
3423 \begin_layout Standard
3424 Contains frame number (as one line) of frame movie was saved on.
3425  Only present in savestates.
3426 \end_layout
3428 \begin_layout Subsection
3429 Member: lagcounter
3430 \end_layout
3432 \begin_layout Standard
3433 Current value of lag counter (as one line).
3434  Only present in savestates.
3435 \end_layout
3437 \begin_layout Subsection
3438 Member: pollcounters
3439 \end_layout
3441 \begin_layout Standard
3442 Contains poll counters (currently 100 of them), one per line.
3443  Each line is raw poll count if DRDY is set for it.
3444  Otherwise it is negative poll count minus one.
3445  Only present in savestates.
3446 \end_layout
3448 \begin_layout Subsection
3449 Member: hostmemory
3450 \end_layout
3452 \begin_layout Standard
3453 Raw binary dump of host memory.
3454  Only present in savestates.
3455 \end_layout
3457 \begin_layout Subsection
3458 Member: savestate
3459 \end_layout
3461 \begin_layout Standard
3462 The raw binary savestate itself.
3463  Savestate detection uses this file, only present in savestates.
3464 \end_layout
3466 \begin_layout Subsection
3467 Member: screenshot
3468 \end_layout
3470 \begin_layout Standard
3471 Screenshot of current frame.
3472  Only present in savestates.
3473  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
3474  data.
3475  Height of image is inferred from the width and size of data.
3476 \end_layout
3478 \begin_layout Subsection
3479 Member: sram.<name>
3480 \end_layout
3482 \begin_layout Standard
3483 Raw binary SRAM of kind <name> at time of savestate.
3484  Only present in savestates.
3485 \end_layout
3487 \begin_layout Subsection
3488 Member: input
3489 \end_layout
3491 \begin_layout Standard
3492 The actual input track, one line per subframe (blank lines are skipped).
3493 \end_layout
3495 \begin_layout Itemize
3496 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
3497  part of same frame as previous, otherwise it starts a new frame.
3498 \end_layout
3500 \begin_layout Itemize
3501 First subframe must start a new frame.
3502 \end_layout
3504 \begin_layout Standard
3505 Length of movie in frames is number of lines in input file that start a
3506  new frame.
3507 \end_layout
3509 \begin_layout Subsection
3510 Member: rerecords
3511 \end_layout
3513 \begin_layout Standard
3514 Contains textual base-10 rerecord count (as one line; emulator just writes
3515  this, it doesn't read it) + 1.
3516 \end_layout
3518 \begin_layout Subsection
3519 Member: rrdata
3520 \end_layout
3522 \begin_layout Standard
3523 This member stores set of load IDs.
3524  There is one load ID per rerecord (plus one corresponding to start of project).
3525 \end_layout
3527 \begin_layout Itemize
3528 This member constists of concatenation of records
3529 \end_layout
3531 \begin_layout Itemize
3532 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
3533  IDs.
3534 \end_layout
3536 \begin_layout Itemize
3537 IDs are interpretted as 256-bit big-endian integers with warparound.
3538 \end_layout
3540 \begin_layout Itemize
3541 Initial predicted ID is all zeroes.
3542 \end_layout
3544 \begin_layout Standard
3545 Format of each record is:
3546 \end_layout
3548 \begin_layout Itemize
3549 1 byte: Opcode byte.
3550  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
3551  Bit 7 is unused.
3552 \end_layout
3554 \begin_layout Itemize
3555 32-prefixlen bytes of ID.
3556 \end_layout
3558 \begin_layout Itemize
3559 countlen bytes of big-endian count (count).
3560 \end_layout
3562 \begin_layout Standard
3563 Records are processed as follows:
3564 \end_layout
3566 \begin_layout Itemize
3567 To form the first ID encoded by record, take the first prefixlen bytes predicted
3568  ID and append the read ID value to it.
3569  The result is the first ID encoded.
3570 \end_layout
3572 \begin_layout Itemize
3573 If countlen is 0, record encodes 1 ID.
3574 \end_layout
3576 \begin_layout Itemize
3577 If countlen is 1, record encodes 2+count IDs.
3578 \end_layout
3580 \begin_layout Itemize
3581 If countlen is 2, record encodes 258+count IDs.
3582 \end_layout
3584 \begin_layout Itemize
3585 If countlen is 3, record encodes 65794+count IDs.
3586 \end_layout
3588 \begin_layout Itemize
3589 The new predicted ID is the next ID after last one encoded by the record.
3590 \end_layout
3592 \begin_layout Standard
3593 The number of rerecords + 1 is equal to the sum of number of IDs encoded
3594  by all records.
3595 \end_layout
3597 \begin_layout Subsection
3598 Member: starttime.second
3599 \end_layout
3601 \begin_layout Standard
3602 Movie starting time, second part.
3603  Epoch is Unix epoch.
3604  Default is 1,000,000,000.
3605 \end_layout
3607 \begin_layout Subsection
3608 Member: starttime.subsecond
3609 \end_layout
3611 \begin_layout Standard
3612 Movie starting time, subsecond part.
3613  Unit is CPU clocks.
3614  Default is 0.
3615 \end_layout
3617 \begin_layout Subsection
3618 Member: savetime.second
3619 \end_layout
3621 \begin_layout Standard
3622 Movie saving time, second part.
3623  Default is starttime.second.
3624  Only present in savestates.
3625 \end_layout
3627 \begin_layout Subsection
3628 Member: savetime.subsecond
3629 \end_layout
3631 \begin_layout Standard
3632 Movie saving time, subsecond part.
3633  Default is starttime.subsecond.
3634  Only present in savestates.
3635 \end_layout
3637 \begin_layout Section
3638 Compiling:
3639 \end_layout
3641 \begin_layout Subsection
3642 Building BSNES
3643 \end_layout
3645 \begin_layout Standard
3646 make ui=ui-libsnes profile=accuracy
3647 \end_layout
3649 \begin_layout Standard
3650 For Bsnes v084 You need to apply the six patches in bsnes-patches/.
3651  These fix the following:
3652 \end_layout
3654 \begin_layout Enumerate
3655 Make libsnes actually compile (it won't compile without!)
3656 \end_layout
3658 \begin_layout Enumerate
3659 Bump the version number to be correct (nice to have)
3660 \end_layout
3662 \begin_layout Enumerate
3663 Make RTC emulation time cleanly overridable (needed by games using RTC)
3664 \end_layout
3666 \begin_layout Enumerate
3667 Save/Load controller state on savestate/loadstate (many games screw up without)
3668 \end_layout
3670 \begin_layout Enumerate
3671 Fix unserialization of 64-bit integers (needed)
3672 \end_layout
3674 \begin_layout Enumerate
3675 Allow frontend to control random number seed (just nice to have)
3676 \end_layout
3678 \begin_layout Subsection
3679 Prerequisite libraries:
3680 \end_layout
3682 \begin_layout Itemize
3683 zlib
3684 \end_layout
3686 \begin_layout Itemize
3687 SDL (SDL platform)
3688 \end_layout
3690 \begin_layout Itemize
3691 SDLmain (Windows/Mac OS X only; Note you may have to extract the object
3692  out of archive)
3693 \end_layout
3695 \begin_layout Itemize
3696 boost_iostreams
3697 \end_layout
3699 \begin_layout Itemize
3700 boost_filesystem
3701 \end_layout
3703 \begin_layout Itemize
3704 boost conversion (header only)
3705 \end_layout
3707 \begin_layout Subsection
3708 Compile options to make:
3709 \end_layout
3711 \begin_layout Subsubsection
3712 BSNES_PATH=<path>
3713 \end_layout
3715 \begin_layout Standard
3716 Set path to BSNES bsnes directory to <path>.
3717 \end_layout
3719 \begin_layout Subsubsection
3720 THREADS=NO
3721 \end_layout
3723 \begin_layout Standard
3724 Don't use threads on Linux.
3725 \end_layout
3727 \begin_layout Subsubsection
3728 THREADS=YES
3729 \end_layout
3731 \begin_layout Standard
3732 Try to use threads even on non-Linux systems.
3733 \end_layout
3735 \begin_layout Subsubsection
3736 CROSS_PREFIX=<prefix>
3737 \end_layout
3739 \begin_layout Standard
3740 Prepend this to all commands refering to cross-compiling environment with
3741  this.
3742 \end_layout
3744 \begin_layout Subsubsection
3745 CC=<compiler>
3746 \end_layout
3748 \begin_layout Standard
3749 Target C++ compiler to use.
3750  Defaults to g++
3751 \end_layout
3753 \begin_layout Standard
3754 Note: If crosscompiling, this has to be crosscompiler, and CROSS_PREFIX
3755  is prepended.
3756 \end_layout
3758 \begin_layout Subsubsection
3759 BSNES_IS_COMPAT=1
3760 \end_layout
3762 \begin_layout Standard
3763 Assume BSNES uses compatiblity core instead of accuracy core.
3764 \end_layout
3766 \begin_layout Subsubsection
3767 LUA=<package>
3768 \end_layout
3770 \begin_layout Standard
3771 Compile lua support, using package <package>
3772 \end_layout
3774 \begin_layout Subsubsection
3775 GRAPHICS=<plat>
3776 \end_layout
3778 \begin_layout Standard
3779 Set graphics platform.
3780  Currently available choices are 
3781 \begin_inset Quotes eld
3782 \end_inset
3785 \begin_inset Quotes erd
3786 \end_inset
3788  and 
3789 \begin_inset Quotes eld
3790 \end_inset
3792 WXWIDGETS
3793 \begin_inset Quotes erd
3794 \end_inset
3797 \end_layout
3799 \begin_layout Subsubsection
3800 SOUND=<plat>
3801 \end_layout
3803 \begin_layout Standard
3804 Set sound platform.
3805  Currently available choices are 
3806 \begin_inset Quotes eld
3807 \end_inset
3810 \begin_inset Quotes erd
3811 \end_inset
3813  (requires SDL graphics), 
3814 \begin_inset Quotes eld
3815 \end_inset
3817 PORTAUDIO
3818 \begin_inset Quotes erd
3819 \end_inset
3821  and 
3822 \begin_inset Quotes eld
3823 \end_inset
3825 DUMMY
3826 \begin_inset Quotes erd
3827 \end_inset
3830 \end_layout
3832 \begin_layout Subsubsection
3833 JOYSTICK=<plat>
3834 \end_layout
3836 \begin_layout Standard
3837 Set joystick platform.
3838  Currently available choices are 
3839 \begin_inset Quotes eld
3840 \end_inset
3843 \begin_inset Quotes erd
3844 \end_inset
3846  (requires SDL graphics), 
3847 \begin_inset Quotes eld
3848 \end_inset
3850 EVDEV
3851 \begin_inset Quotes erd
3852 \end_inset
3854  and 
3855 \begin_inset Quotes eld
3856 \end_inset
3858 DUMMY
3859 \begin_inset Quotes erd
3860 \end_inset
3863 \end_layout
3865 \begin_layout Section
3866 Quick'n'dirty encode guide
3867 \end_layout
3869 \begin_layout Enumerate
3870 Start the emulator and load the movie file.
3871 \end_layout
3873 \begin_layout Enumerate
3874 Set large AVI option 'set-setting avi-large on'
3875 \end_layout
3877 \begin_layout Enumerate
3878 Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are 
3879 \begin_inset Quotes eld
3880 \end_inset
3882 use only if you know what you are doing.
3883 \begin_inset Quotes erd
3884 \end_inset
3887  In this case, these can be safely used because of how x264 internally works).
3888 \end_layout
3890 \begin_layout Enumerate
3891 Unpause and let it run until you want to end dumping.
3892 \end_layout
3894 \begin_layout Enumerate
3895 Close the emulator (closing the window is the easiest way).
3896  Or use 'end-avi'.
3897 \end_layout
3899 \begin_layout Enumerate
3900 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
3901  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
3902 \end_layout
3904 \begin_layout Enumerate
3905 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
3906 \end_layout
3908 \begin_layout Enumerate
3909 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
3910  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
3911 \end_layout
3913 \begin_layout Enumerate
3914 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
3915  Now final.mkv contains quick'n'dirty encode.
3916 \end_layout
3918 \begin_layout Section
3919 Axis configurations for some gamepad types:
3920 \end_layout
3922 \begin_layout Subsection
3923 XBox360 controller:
3924 \end_layout
3926 \begin_layout Standard
3927 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
3928 \end_layout
3930 \begin_layout LyX-Code
3931 set-axis joystick0axis2 pressure-+
3932 \end_layout
3934 \begin_layout LyX-Code
3935 set-axis joystick0axis5 pressure-+
3936 \end_layout
3938 \begin_layout Subsection
3939 PS3 
3940 \begin_inset Quotes eld
3941 \end_inset
3943 sixaxis
3944 \begin_inset Quotes erd
3945 \end_inset
3947  controller:
3948 \end_layout
3950 \begin_layout Standard
3951 Axes 8-19 should be disabled.
3952 \end_layout
3954 \begin_layout LyX-Code
3955 set-axis joystick0axis8 disabled
3956 \end_layout
3958 \begin_layout LyX-Code
3959 set-axis joystick0axis9 disabled
3960 \end_layout
3962 \begin_layout LyX-Code
3963 set-axis joystick0axis10 disabled
3964 \end_layout
3966 \begin_layout LyX-Code
3967 set-axis joystick0axis11 disabled
3968 \end_layout
3970 \begin_layout LyX-Code
3971 set-axis joystick0axis12 disabled
3972 \end_layout
3974 \begin_layout LyX-Code
3975 set-axis joystick0axis13 disabled
3976 \end_layout
3978 \begin_layout LyX-Code
3979 set-axis joystick0axis14 disabled
3980 \end_layout
3982 \begin_layout LyX-Code
3983 set-axis joystick0axis15 disabled
3984 \end_layout
3986 \begin_layout LyX-Code
3987 set-axis joystick0axis16 disabled
3988 \end_layout
3990 \begin_layout LyX-Code
3991 set-axis joystick0axis17 disabled
3992 \end_layout
3994 \begin_layout LyX-Code
3995 set-axis joystick0axis18 disabled
3996 \end_layout
3998 \begin_layout LyX-Code
3999 set-axis joystick0axis19 disabled
4000 \end_layout
4002 \begin_layout Section
4003 Errata:
4004 \end_layout
4006 \begin_layout Subsection
4007 Problems from BSNES core:
4008 \end_layout
4010 \begin_layout Itemize
4011 The whole pending save stuff.
4012 \end_layout
4014 \begin_layout Itemize
4015 Lack of layer hiding.
4016 \end_layout
4018 \begin_layout Itemize
4019 It is slow.
4020 \end_layout
4022 \begin_layout Itemize
4023 Firmwares can't be loaded from ZIP archives.
4024 \end_layout
4026 \begin_layout Subsection
4027 Other problems:
4028 \end_layout
4030 \begin_layout Itemize
4031 Modifiers don't work with pseudo-keys (SDL).
4032 \end_layout
4034 \begin_layout Itemize
4035 Audio for last dumped frame is not itself dumped.
4036 \end_layout
4038 \begin_layout Itemize
4039 Audio in UI is pretty bad in quality.
4040 \end_layout
4042 \begin_layout Itemize
4043 UI itself is 30fps max.
4044 \end_layout
4046 \begin_layout Itemize
4047 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
4048 \end_layout
4050 \begin_layout Itemize
4051 No menus, command based interface (SDL).
4052 \end_layout
4054 \begin_layout Itemize
4055 Long commands don't scroll.
4056 \end_layout
4058 \begin_layout Itemize
4059 The SDL screen drawing is slow.
4060 \end_layout
4062 \begin_layout Section
4063 Changelog:
4064 \end_layout
4066 \begin_layout Subsection
4067 rr0-beta1
4068 \end_layout
4070 \begin_layout Itemize
4071 Fix -Wall warnings
4072 \end_layout
4074 \begin_layout Itemize
4075 Fix dumper video corruption with levels 10-18.
4076 \end_layout
4078 \begin_layout Subsection
4079 rr0-beta2
4080 \end_layout
4082 \begin_layout Itemize
4083 Autofire
4084 \end_layout
4086 \begin_layout Itemize
4087 Lots of code cleanups
4088 \end_layout
4090 \begin_layout Itemize
4091 Lua interface to settings
4092 \end_layout
4094 \begin_layout Itemize
4095 Allow specifying AVI borders without Lua
4096 \end_layout
4098 \begin_layout Itemize
4099 Fix scaling if vscale > 1 and originx > 0 (left border exists)
4100 \end_layout
4102 \begin_layout Itemize
4103 on_snoop lua callback
4104 \end_layout
4106 \begin_layout Itemize
4107 Faster movie loading and saving.
4108 \end_layout
4110 \begin_layout Subsection
4111 rr0-beta3
4112 \end_layout
4114 \begin_layout Itemize
4115 Joystick support
4116 \end_layout
4118 \begin_layout Subsection
4119 rr0-beta4
4120 \end_layout
4122 \begin_layout Itemize
4123 Fix multi-buttons
4124 \end_layout
4126 \begin_layout Itemize
4127 Save jukebox functionality.
4128 \end_layout
4130 \begin_layout Subsection
4131 rr0-beta5
4132 \end_layout
4134 \begin_layout Itemize
4135 Try to fix some nasty failing movie load edge cases
4136 \end_layout
4138 \begin_layout Itemize
4139 Allow specifying scripts to run on command line.
4140 \end_layout
4142 \begin_layout Subsection
4143 rr0-beta6
4144 \end_layout
4146 \begin_layout Itemize
4147 Major source code reorganization.
4148 \end_layout
4150 \begin_layout Itemize
4151 Backup savestates before overwriting.
4152 \end_layout
4154 \begin_layout Itemize
4155 Don't crash if loading initial state fails.
4156 \end_layout
4158 \begin_layout Subsection
4159 rr0-beta7
4160 \end_layout
4162 \begin_layout Itemize
4163 Fix firmware lookup
4164 \end_layout
4166 \begin_layout Itemize
4167 Fix author name parsing
4168 \end_layout
4170 \begin_layout Itemize
4171 Fix rerecord counting
4172 \end_layout
4174 \begin_layout Itemize
4175 (SDL) Print messages to console if SDL is uninitialized
4176 \end_layout
4178 \begin_layout Itemize
4179 Add movieinfo program
4180 \end_layout
4182 \begin_layout Itemize
4183 Fix loading movies starting from SRAM.
4184 \end_layout
4186 \begin_layout Subsection
4187 rr0-beta8
4188 \end_layout
4190 \begin_layout Itemize
4191 Add support for unattended dumping
4192 \end_layout
4194 \begin_layout Itemize
4195 Fix compiling for Win32
4196 \end_layout
4198 \begin_layout Itemize
4199 Don't lock up if sound can't be initialized
4200 \end_layout
4202 \begin_layout Itemize
4203 Strip trailing CR from commands
4204 \end_layout
4206 \begin_layout Itemize
4207 Don't try to do dubious things in global ctors (fix crash on startup)
4208 \end_layout
4210 \begin_layout Subsection
4211 rr0-beta9
4212 \end_layout
4214 \begin_layout Itemize
4215 Small documentation tweaking
4216 \end_layout
4218 \begin_layout Itemize
4219 Fix make clean
4220 \end_layout
4222 \begin_layout Itemize
4223 Fix major bug in modifier matching
4224 \end_layout
4226 \begin_layout Subsection
4227 rr0-beta10
4228 \end_layout
4230 \begin_layout Itemize
4231 Lots of documentation fixes
4232 \end_layout
4234 \begin_layout Itemize
4235 Use dedicated callbacks for event backcomm., not commands.
4236 \end_layout
4238 \begin_layout Itemize
4239 Ensure that the watchdog is not hit when executing delayed reset.
4240 \end_layout
4242 \begin_layout Itemize
4243 Remove errant tab from joystick message.
4244 \end_layout
4246 \begin_layout Subsection
4247 rr0-beta11
4248 \end_layout
4250 \begin_layout Itemize
4251 Make autofire operate in absolute time, not linear time
4252 \end_layout
4254 \begin_layout Itemize
4255 Reinitialize controls when resuming from loadstate
4256 \end_layout
4258 \begin_layout Itemize
4259 Some more code cleanups
4260 \end_layout
4262 \begin_layout Itemize
4263 If Lua allocator fails, call OOM_panic()
4264 \end_layout
4266 \begin_layout Itemize
4267 Byte/word/dword/qword sized host memory write/read functions.
4268 \end_layout
4270 \begin_layout Itemize
4271 Dump at correct framerate if dumping interlaced NTSC (height=448).
4272 \end_layout
4274 \begin_layout Subsection
4275 rr0-beta12
4276 \end_layout
4278 \begin_layout Itemize
4279 Actually include the complete source code
4280 \end_layout
4282 \begin_layout Itemize
4283 Keep track of RTC
4284 \end_layout
4286 \begin_layout Subsection
4287 rr0-beta13
4288 \end_layout
4290 \begin_layout Itemize
4291 Document {save,start}time.{,sub}second.
4292 \end_layout
4294 \begin_layout Itemize
4295 Intercept time() from bsnes core.
4296 \end_layout
4298 \begin_layout Subsection
4299 rr0-beta14
4300 \end_layout
4302 \begin_layout Itemize
4303 Allow disabling time() interception (allow build on Mac OS X)
4304 \end_layout
4306 \begin_layout Itemize
4307 Use SDLMain on Mac OS X (make SDL not crash)
4308 \end_layout
4310 \begin_layout Itemize
4311 Disable delayed resets (just plain too buggy for now).
4312 \end_layout
4314 \begin_layout Itemize
4315 Code cleanups
4316 \end_layout
4318 \begin_layout Itemize
4319 Use 16-bit for graphics/video instead of 32-bit.
4320 \end_layout
4322 \begin_layout Itemize
4323 gui.rectangle/gui.pixel
4324 \end_layout
4326 \begin_layout Itemize
4327 gui.crosshair
4328 \end_layout
4330 \begin_layout Itemize
4331 New CSCD writer implementation.
4332 \end_layout
4334 \begin_layout Subsection
4335 rr0-beta15
4336 \end_layout
4338 \begin_layout Itemize
4339 Fix interaction of * and +.
4340 \end_layout
4342 \begin_layout Itemize
4343 Manual improvements
4344 \end_layout
4346 \begin_layout Itemize
4347 Use gettimeofday()/usleep(), these seem portable enough.
4348 \end_layout
4350 \begin_layout Itemize
4351 Move joystick axis manipulation to keymapper code.
4352 \end_layout
4354 \begin_layout Itemize
4355 Changes to how read-only works.
4356 \end_layout
4358 \begin_layout Itemize
4359 Refactor controller input code.
4360 \end_layout
4362 \begin_layout Subsection
4363 rr0-beta16
4364 \end_layout
4366 \begin_layout Itemize
4367 Fix mouseclick scale compensation.
4368 \end_layout
4370 \begin_layout Itemize
4371 Draw area boundaries correctly in SDL code.
4372 \end_layout
4374 \begin_layout Itemize
4375 gui.screenshot.
4376 \end_layout
4378 \begin_layout Itemize
4379 Fix CSCD output (buffer overrun and race condition).
4380 \end_layout
4382 \begin_layout Subsection
4383 rr0-beta17
4384 \end_layout
4386 \begin_layout Itemize
4387 JMD dumping support.
4388 \end_layout
4390 \begin_layout Itemize
4391 Allow unattended dumping to JMD.
4392 \end_layout
4394 \begin_layout Itemize
4395 Move to BSNES v083.
4396 \end_layout
4398 \begin_layout Itemize
4399 Switch back to 32-bit colors.
4400 \end_layout
4402 \begin_layout Itemize
4403 Add Lua function gui.color.
4404 \end_layout
4406 \begin_layout Itemize
4407 Use some new C++11 features in GCC 4.6.
4408 \end_layout
4410 \begin_layout Itemize
4411 Be prepared for core frequency changes.
4412 \end_layout
4414 \begin_layout Itemize
4415 Pass colors in one chunk from Lua.
4416 \end_layout
4418 \begin_layout Subsection
4419 rr0-beta18
4420 \end_layout
4422 \begin_layout Itemize
4423 New lua functions gui.line(), gui.status() and gui.circle(), memory.vma_count(),
4424  memory.read_vma() and memory.find_vma().
4425 \end_layout
4427 \begin_layout Itemize
4428 Numerious documentation fixups
4429 \end_layout
4431 \begin_layout Itemize
4432 RTC time format changed
4433 \end_layout
4435 \begin_layout Itemize
4436 Reformat flags display
4437 \end_layout
4439 \begin_layout Itemize
4440 Allow lua package name to be overridden
4441 \end_layout
4443 \begin_layout Itemize
4444 SDUMP (high-quality dumping).
4445 \end_layout
4447 \begin_layout Itemize
4448 Split platform support to plugins.
4449 \end_layout
4451 \begin_layout Itemize
4452 Make all sound plugins support basic sound commands
4453 \end_layout
4455 \begin_layout Itemize
4456 Support portaudio for sound.
4457 \end_layout
4459 \begin_layout Itemize
4460 Allow disable Lua/SDL searching.
4461 \end_layout
4463 \begin_layout Itemize
4464 Upconvert colors when copying lcscreen to screen.
4465 \end_layout
4467 \begin_layout Itemize
4468 Reorganize source tree.
4469 \end_layout
4471 \begin_layout Itemize
4472 Evdev joystick support.
4473 \end_layout
4475 \begin_layout Itemize
4476 Refactor more code into generic window code.
4477 \end_layout
4479 \begin_layout Subsection
4480 rr0-beta19
4481 \end_layout
4483 \begin_layout Itemize
4484 Refactor message handling.
4485 \end_layout
4487 \begin_layout Itemize
4488 Rework makefile
4489 \end_layout
4491 \begin_layout Itemize
4492 Documentation fixes
4493 \end_layout
4495 \begin_layout Itemize
4496 Finish pending saves before load/quit.
4497 \end_layout
4499 \begin_layout Itemize
4500 Wxwidgets graphics plugin.
4501 \end_layout
4503 \begin_layout Subsection
4504 rr0-beta20
4505 \end_layout
4507 \begin_layout Itemize
4508 Get rid of win32-crap.[ch]pp.
4509 \end_layout
4511 \begin_layout Itemize
4512 Move files around a lot.
4513 \end_layout
4515 \begin_layout Itemize
4516 Get rid of need for host C++ compiler.
4517 \end_layout
4519 \begin_layout Itemize
4520 Bsnes v084 core.
4521 \end_layout
4523 \begin_layout Itemize
4524 Refactor inter-component communication.
4525 \end_layout
4527 \begin_layout Itemize
4528 Fix zero luma.
4529 \end_layout
4531 \begin_layout Itemize
4532 Fix crash on multiline aliases.
4533 \end_layout
4535 \begin_layout Itemize
4536 Load/Save settings in wxwidgets gui.
4537 \end_layout
4539 \begin_layout Subsection
4540 rr0-beta21
4541 \end_layout
4543 \begin_layout Itemize
4544 Patch problems in bsnes core
4545 \end_layout
4547 \begin_layout Itemize
4548 SNES is little-endian, not big-endian!
4549 \end_layout
4551 \begin_layout Itemize
4552 Fix memory corruption in lcscreen::load()
4553 \end_layout
4555 \begin_layout Subsection
4556 rr0-beta22
4557 \end_layout
4559 \begin_layout Itemize
4560 Fix interpretting repeat counts in rrdata loading.
4561 \end_layout
4563 \begin_layout Itemize
4564 New lua callback: on_frame()
4565 \end_layout
4567 \begin_layout Itemize
4568 Remove calls to runtosave() that aren't supposed to be there
4569 \end_layout
4571 \begin_layout Itemize
4572 Lua function: movie.read_rtc()
4573 \end_layout
4575 \begin_layout Itemize
4576 Ignore src/fonts/font.cpp
4577 \end_layout
4579 \begin_layout Itemize
4580 Fix more bsnes core problems
4581 \end_layout
4583 \begin_layout Itemize
4584 Control bsnes random seeding
4585 \end_layout
4587 \begin_layout Itemize
4588 Pause-on-end
4589 \end_layout
4591 \begin_layout Itemize
4592 Some bsnes core debugging features (state dump and state hash)
4593 \end_layout
4595 \begin_layout Itemize
4596 Fix titlebar version number (no, the last version wasn't 'lsnes-0-beta21',
4597  it was 'lsnes rr0-beta21').
4598 \end_layout
4600 \begin_layout Subsection
4601 rr0-beta23
4602 \end_layout
4604 \begin_layout Itemize
4605 Fix memory corruption due to macro/field mixup
4606 \end_layout
4608 \begin_layout Itemize
4609 search-memory update
4610 \end_layout
4612 \begin_layout Itemize
4613 Allow direct-mapped framebuffer
4614 \end_layout
4616 \begin_layout Itemize
4617 SDL: Use SDL_ANYFORMAT if possible
4618 \end_layout
4620 \begin_layout Itemize
4621 SDMP2SOX: 2s delay modes.
4622 \end_layout
4624 \begin_layout Itemize
4625 Wxwidgets: Cleanups
4626 \end_layout
4628 \begin_layout Itemize
4629 Use sed -E, not sed -r.
4630  Fixes building on Mac OS X.
4631 \end_layout
4633 \begin_layout Itemize
4634 Wxwidgets: Save jukebox on exit
4635 \end_layout
4637 \begin_layout Itemize
4638 Fix RTC if using load-movie on savestate.
4639 \end_layout
4641 \begin_layout Itemize
4642 Fix crash related to full console mode.
4643 \end_layout
4645 \begin_layout Subsection
4646 rr0-beta24
4647 \end_layout
4649 \begin_layout Itemize
4650 Wxwidgets: Allow bringing application to foreground on Mac OS X.
4651 \end_layout
4653 \begin_layout Itemize
4654 Wxwidgets: Allow compiling on Mac OS X.
4655 \end_layout
4657 \begin_layout Itemize
4658 Use movie compare instead of movie hashing (faster save/load).
4659 \end_layout
4661 \begin_layout Itemize
4662 Lua: _SYSTEM table.
4663 \end_layout
4665 \end_body
4666 \end_document