Lua: Add memory.* functions for reading the VMA table
[lsnes.git] / manual.lyx
blobf6834aa51dd96c66911f4d95e0f64f73b86be417
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-3,462,619,485,019.
468 \end_layout
470 \begin_layout Subsection
471 <filename>
472 \end_layout
474 \begin_layout Standard
475 If filename is specified on command line, it is loaded as initial state
476  (instead of constructing one).
477  Mandatory for lsnes-avidump.exe and movieinfo.exe.
478 \end_layout
480 \begin_layout Subsection
481 Misc.
482  options
483 \end_layout
485 \begin_layout Subsubsection
486 --run=<file> (lsnes.exe only)
487 \end_layout
489 \begin_layout Standard
490 After running main RC file, run this file.
491  If multiple are specified, these execute in order specified.
492 \end_layout
494 \begin_layout Subsection
495 dump options (lsnes-avidump.exe only)
496 \end_layout
498 \begin_layout Subsubsection
499 --prefix=<prefix>
500 \end_layout
502 \begin_layout Standard
503 Set dump prefix.
504  Default is 
505 \begin_inset Quotes eld
506 \end_inset
508 avidump
509 \begin_inset Quotes erd
510 \end_inset
513 \end_layout
515 \begin_layout Subsubsection
516 --level=<level>
517 \end_layout
519 \begin_layout Standard
520 Set compression level (0-18).
521  Default is 7.
522 \end_layout
524 \begin_layout Subsubsection
525 --length=<length>
526 \end_layout
528 \begin_layout Standard
529 Set number of frames to dump.
530  Mandatory.
531 \end_layout
533 \begin_layout Subsubsection
534 --lua=<script>
535 \end_layout
537 \begin_layout Standard
538 Run specified lua script (lsnes-avidump.exe does not have initialization
539  files).
540 \end_layout
542 \begin_layout Subsubsection
543 --jmd
544 \end_layout
546 \begin_layout Standard
547 Use JMD dumping instead of AVI dumping.
548 \end_layout
550 \begin_layout Section
551 Startup file lsnes.rc
552 \end_layout
554 \begin_layout Standard
555 Upon startup, lsnes (lsnes.exe only) executes file lsnes.rc as commands.
556  This file is located in:
557 \end_layout
559 \begin_layout Itemize
560 Windows: %APPDATA%
561 \backslash
562 lsnes
563 \backslash
564 lsnes.rc (if %APPDATA% exists)
565 \end_layout
567 \begin_layout Itemize
568 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
569 \end_layout
571 \begin_layout Itemize
572 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
573 \end_layout
575 \begin_layout Itemize
576 All: ./lsnes.rc (fallback default).
577 \end_layout
579 \begin_layout Standard
580 If leading directories do not exist, attempt to create them is made.
581 \end_layout
583 \begin_layout Section
584 Game internal commands
585 \end_layout
587 \begin_layout Itemize
588 Commands beginning with '*' invoke the corresponding command without alias
589  expansion.
590 \end_layout
592 \begin_layout Itemize
593 If command starts with '+' (after possible '*'), the command is executed
594  as-is when button is pressed, and when button is released, it is executed
595  with '+' replaced by '-'.
596 \end_layout
598 \begin_layout Subsection
599 Settings:
600 \end_layout
602 \begin_layout Standard
603 Settings control various aspects of emulator behaviour.
604 \end_layout
606 \begin_layout Subsubsection
607 set-setting <setting> <value>
608 \end_layout
610 \begin_layout Standard
611 Sets setting <setting> to value <value> (may be empty).
612 \end_layout
614 \begin_layout Subsubsection
615 unset-setting <setting>
616 \end_layout
618 \begin_layout Standard
619 Try to unset setting <setting> (not all settings can be unset).
620 \end_layout
622 \begin_layout Subsubsection
623 get-setting <setting>
624 \end_layout
626 \begin_layout Standard
627 Read value of setting <setting>
628 \end_layout
630 \begin_layout Subsubsection
631 show-settings
632 \end_layout
634 \begin_layout Standard
635 Print names and values of all settings.
636 \end_layout
638 \begin_layout Subsection
639 Keybindings
640 \end_layout
642 \begin_layout Standard
643 Keybindings bind commands or aliases to keys (or pseudo-keys).
645 \end_layout
647 \begin_layout Standard
648 Notes:
649 \end_layout
651 \begin_layout Itemize
652 Do not bind edge active (+/-) commands to keys with modifiers, that won't
653  work right!
654 \end_layout
656 \begin_layout Itemize
657 Names of keys and modifiers are platform-dependent.
658 \end_layout
660 \begin_layout Itemize
661 Be careful before binding pseudo-keys (such as joystick axes, buttons or
662  hats) with modifiers.
663  That may or may not work right.
664 \end_layout
666 \begin_layout Subsubsection
667 bind-key [<mod>/<modmask>] <key> <command>
668 \end_layout
670 \begin_layout Standard
671 Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
672 ed list) are set as <mod> (comma-seperated list).
673 \end_layout
675 \begin_layout Standard
676 The names of keys and modifiers are platform-dependent.
677 \end_layout
679 \begin_layout Subsubsection
680 unbind-key [<mod>/<modmask>] <key>
681 \end_layout
683 \begin_layout Standard
684 Unbind command from <key> (with specified <mod> and <modmask>).
685 \end_layout
687 \begin_layout Subsection
688 set-axis <axis> [disabled | axis | axis-inverse | pressure0- | pressure0+
689  | pressure-0 | pressure-+ | pressure+0 | pressure+-] [minus=<val>] [zero=<val>]
690  [plus=<val>] [tolerance=<val>]
691 \end_layout
693 \begin_layout Standard
694 Set axis parameters for axis <axis>.
695 \end_layout
697 \begin_layout Itemize
698 disabled: Disable axis
699 \end_layout
701 \begin_layout Itemize
702 axis: Normal axis
703 \end_layout
705 \begin_layout Itemize
706 axis-inverse: Inverse axis
707 \end_layout
709 \begin_layout Itemize
710 pressure0-: Pressure sensitive.
711  Released at 0, pressed at -.
712 \end_layout
714 \begin_layout Itemize
715 pressure0+: Pressure sensitive.
716  Released at 0, pressed at +.
717 \end_layout
719 \begin_layout Itemize
720 pressure-0: Pressure sensitive.
721  Released at -, pressed at 0.
722 \end_layout
724 \begin_layout Itemize
725 pressure-+: Pressure sensitive.
726  Released at -, pressed at +.
727 \end_layout
729 \begin_layout Itemize
730 pressure+0: Pressure sensitive.
731  Released at +, pressed at 0.
732 \end_layout
734 \begin_layout Itemize
735 pressure+-: Pressure sensitive.
736  Released at +, pressed at -.
737 \end_layout
739 \begin_layout Itemize
740 minus=<val>: Calibration at extreme minus position (-32768-32767)
741 \end_layout
743 \begin_layout Itemize
744 zero=<val>: Calibration at neutral position (-32768-32767)
745 \end_layout
747 \begin_layout Itemize
748 plus=<val>: Calibration at extreme plus position (-32768-32767)
749 \end_layout
751 \begin_layout Itemize
752 tolerance=<value>: Center band tolerance (0<x<1).
753  The smaller the value, the more sensitive the control is.
754 \end_layout
756 \begin_layout Subsubsection
757 show-bindings
758 \end_layout
760 \begin_layout Standard
761 Print all key bindings in effect.
762 \end_layout
764 \begin_layout Subsection
765 Aliases
766 \end_layout
768 \begin_layout Standard
769 Aliases bind command to sequence of commands.
770  After alias has been defined, it replaces the command it shadows.
771 \end_layout
773 \begin_layout Standard
774 Notes:
775 \end_layout
777 \begin_layout Itemize
778 You can't alias command to itself.
779 \end_layout
781 \begin_layout Itemize
782 Aliases starting with +/- are edge active just like ordinary commands starting
783  with +/-.
784 \end_layout
786 \begin_layout Itemize
787 One command can be aliased to multiple commands.
788 \end_layout
790 \begin_layout Subsubsection
791 alias-command <command> <expansion>
792 \end_layout
794 \begin_layout Standard
795 Append <expansion> to alias <command>.
796  If alias does not already exist, it is created.
797 \end_layout
799 \begin_layout Subsubsection
800 unalias-command <command>
801 \end_layout
803 \begin_layout Standard
804 Clear alias expansion for <command>.
805 \end_layout
807 \begin_layout Subsubsection
808 show-aliases
809 \end_layout
811 \begin_layout Standard
812 Print all aliases and their expansions in effect.
813 \end_layout
815 \begin_layout Subsection
816 run-script <script>
817 \end_layout
819 \begin_layout Standard
820 Run <script> as if commands were entered on the command line.
821 \end_layout
823 \begin_layout Subsection
824 AVI Video dumping
825 \end_layout
827 \begin_layout Standard
828 Following commands control AVI video dumping:
829 \end_layout
831 \begin_layout Subsubsection
832 dump-avi <level> <prefix>
833 \end_layout
835 \begin_layout Standard
836 Dump AVI video to prefix <prefix> at level <level> (0-18).
837  Notes:
838 \end_layout
840 \begin_layout Itemize
841 The codec is Camstudio Codec in gzip mode.
842 \end_layout
844 \begin_layout Itemize
845 Encoder and muxer are internal, available on all platforms.
846 \end_layout
848 \begin_layout Itemize
849 Audio enable/disable and framerate has no effect.
850 \end_layout
852 \begin_layout Itemize
853 Levels 10-18 are not compatible with AVISource.
854 \end_layout
856 \begin_layout Itemize
857 Recomended level is 7 if decoded by AVISource.
858 \end_layout
860 \begin_layout Itemize
861 Recomended level is 16 if decoded by ffmpeg, mencoder or FFMpegSource.
862 \end_layout
864 \begin_layout Itemize
865 Dumps of low-res PAL games are 256x239 (with all the consequences odd height
866  carries).
867 \end_layout
869 \begin_layout Itemize
870 The audio dumped to .avi is low-quality version.
871  The high-quality version is dumped to .sox file.
872 \end_layout
874 \begin_layout Subsubsection
875 end-avi
876 \end_layout
878 \begin_layout Standard
879 End current AVI video dump (closing the emulator also closes the dump).
880 \end_layout
882 \begin_layout Subsection
883 JMD video dumping
884 \end_layout
886 \begin_layout Standard
887 Following commands control JMD video dumping:
888 \end_layout
890 \begin_layout Subsubsection
891 dump-jmd <level> <file>
892 \end_layout
894 \begin_layout Standard
895 Dump JMD video to file <file> at level <level> (0-9).
896 \end_layout
898 \begin_layout Subsubsection
899 end-jmd
900 \end_layout
902 \begin_layout Standard
903 End the current JMD dump in progress.
904 \end_layout
906 \begin_layout Subsection
907 Memory manipulation
908 \end_layout
910 \begin_layout Standard
911 <address> may be decimal or hexadecimal (prefixed with '0x').
912  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
913  with '-') decimal.
914 \end_layout
916 \begin_layout Standard
917 The available element <sizes> are:
918 \end_layout
920 \begin_layout Itemize
921 byte: 1 byte
922 \end_layout
924 \begin_layout Itemize
925 word: 2 bytes
926 \end_layout
928 \begin_layout Itemize
929 dword: 4 bytes
930 \end_layout
932 \begin_layout Itemize
933 qword: 8 bytes
934 \end_layout
936 \begin_layout Standard
937 When reading RAM and ROM, multi-byte reads/writes are big-endian.
938  When dealing with DSP memory, multi-byte reads/writes are native-endian
939  (do not use operand sizes exceeding DSP bitness, except dword is OK for
940  24-bit memory).
941 \end_layout
943 \begin_layout Subsubsection
944 read-<size> <address>
945 \end_layout
947 \begin_layout Standard
948 Read the value of byte in <address>.
949 \end_layout
951 \begin_layout Subsubsection
952 read-s<size> <address>
953 \end_layout
955 \begin_layout Standard
956 Read the value of signed byte in <address>.
957 \end_layout
959 \begin_layout Subsubsection
960 write-<size> <address> <value>
961 \end_layout
963 \begin_layout Standard
964 Write <value> to byte in address <address>.
965 \end_layout
967 \begin_layout Subsubsection
968 search-memory reset
969 \end_layout
971 \begin_layout Standard
972 Reset the memory search
973 \end_layout
975 \begin_layout Subsubsection
976 search-memory count
977 \end_layout
979 \begin_layout Standard
980 Print number of candidates remaining
981 \end_layout
983 \begin_layout Subsubsection
984 search-memory print
985 \end_layout
987 \begin_layout Standard
988 Print all candidates remaining
989 \end_layout
991 \begin_layout Subsubsection
992 search-memory <usflag><sizeflag><op>
993 \end_layout
995 \begin_layout Standard
996 Searches memory for addresses satisfying criteria.
997 \end_layout
999 \begin_layout Standard
1000 <usflag> can be:
1001 \end_layout
1003 \begin_layout Itemize
1004 u: unsigned
1005 \end_layout
1007 \begin_layout Itemize
1008 s: signed
1009 \end_layout
1011 \begin_layout Standard
1012 <sizeflag> can be:
1013 \end_layout
1015 \begin_layout Itemize
1016 b: byte
1017 \end_layout
1019 \begin_layout Itemize
1020 w: word
1021 \end_layout
1023 \begin_layout Itemize
1024 d: dword
1025 \end_layout
1027 \begin_layout Itemize
1028 q: qword
1029 \end_layout
1031 \begin_layout Standard
1032 <op> can be:
1033 \end_layout
1035 \begin_layout Itemize
1036 lt: < previous value.
1037 \end_layout
1039 \begin_layout Itemize
1040 le: <= previous value.
1041 \end_layout
1043 \begin_layout Itemize
1044 eq: = previous value.
1045 \end_layout
1047 \begin_layout Itemize
1048 ne: != previous value.
1049 \end_layout
1051 \begin_layout Itemize
1052 ge: >= previous value.
1053 \end_layout
1055 \begin_layout Itemize
1056 gt: > previous value.
1057 \end_layout
1059 \begin_layout Subsubsection
1060 search-memory <sizeflag> <value>
1061 \end_layout
1063 \begin_layout Standard
1064 Searches for addresses that currently have value <value>.
1065  <sizeflag> is as in previous command.
1066 \end_layout
1068 \begin_layout Subsection
1069 Main commands
1070 \end_layout
1072 \begin_layout Standard
1073 These commands are not available in lsnesrc, but are available after ROM
1074  has been loaded.
1075 \end_layout
1077 \begin_layout Subsubsection
1078 quit-emulator [/y]
1079 \end_layout
1081 \begin_layout Standard
1082 Quits the emulator (asking for confirmation).
1083  If /y is given, no confirmation is asked.
1084 \end_layout
1086 \begin_layout Subsubsection
1087 pause-emulator
1088 \end_layout
1090 \begin_layout Standard
1091 Toggle paused/unpaused
1092 \end_layout
1094 \begin_layout Subsubsection
1095 +advance-frame
1096 \end_layout
1098 \begin_layout Standard
1099 Advance frame.
1100  If the button is still held after configurable timeout expires, game unpauses
1101  for the duration frame advance is held.
1102 \end_layout
1104 \begin_layout Subsubsection
1105 +advance-poll
1106 \end_layout
1108 \begin_layout Standard
1109 Advance subframe.
1110  If the button is still held after configurable timeout expires, game unpauses
1111  for the duration frame advance is held.
1112 \end_layout
1114 \begin_layout Subsubsection
1115 advance-skiplag
1116 \end_layout
1118 \begin_layout Standard
1119 Skip to first poll in frame after current.
1120 \end_layout
1122 \begin_layout Subsubsection
1123 reset
1124 \end_layout
1126 \begin_layout Standard
1127 Reset the SNES after this frame.
1128 \end_layout
1130 \begin_layout Subsubsection
1131 load <filename>
1132 \end_layout
1134 \begin_layout Standard
1135 Load savestate <filename> in current mode.
1136 \end_layout
1138 \begin_layout Subsubsection
1139 load-state <filename>
1140 \end_layout
1142 \begin_layout Standard
1143 Load savestate <filename> in readwrite mode.
1144 \end_layout
1146 \begin_layout Subsubsection
1147 load-readonly <filename>
1148 \end_layout
1150 \begin_layout Standard
1151 Load savestate <filename> in readonly mode.
1152 \end_layout
1154 \begin_layout Subsubsection
1155 load-preserve <filename>
1156 \end_layout
1158 \begin_layout Standard
1159 Load savestate <filename> in readonly mode, preserving current events.
1160 \end_layout
1162 \begin_layout Subsubsection
1163 load-movie <filename>
1164 \end_layout
1166 \begin_layout Standard
1167 Load savestate <filename>, ignoring save part in readonly mode.
1168 \end_layout
1170 \begin_layout Subsubsection
1171 save-state <filename>
1172 \end_layout
1174 \begin_layout Standard
1175 Save system state to <filename> as soon as possible.
1176 \end_layout
1178 \begin_layout Subsubsection
1179 save-movie <filename>
1180 \end_layout
1182 \begin_layout Standard
1183 Save movie to <filename>.
1184 \end_layout
1186 \begin_layout Subsubsection
1187 set-rwmode
1188 \end_layout
1190 \begin_layout Standard
1191 Set read-write mode.
1192 \end_layout
1194 \begin_layout Subsubsection
1195 set-romode
1196 \end_layout
1198 \begin_layout Standard
1199 Set read-only mode
1200 \end_layout
1202 \begin_layout Subsubsection
1203 toggle-rwmode
1204 \end_layout
1206 \begin_layout Standard
1207 Toggle between read-only and read-write modes.
1208 \end_layout
1210 \begin_layout Subsubsection
1211 set-gamename <name>
1212 \end_layout
1214 \begin_layout Standard
1215 Set name of the game to <name>
1216 \end_layout
1218 \begin_layout Subsubsection
1219 get-gamename
1220 \end_layout
1222 \begin_layout Standard
1223 Print the name of the game.
1224 \end_layout
1226 \begin_layout Subsubsection
1227 add-author <author>
1228 \end_layout
1230 \begin_layout Standard
1231 Adds new author <author>.
1232  If <author> does not contain '|' it is full name.
1233  If it contains '|', '|' splits the full name and nickname.
1234 \end_layout
1236 \begin_layout Subsubsection
1237 edit-author <num> <author>
1238 \end_layout
1240 \begin_layout Standard
1241 Edit the author in slot <num> (0-based) to be <author> (see add-author for
1242  format)
1243 \end_layout
1245 \begin_layout Subsubsection
1246 remove-author <num>
1247 \end_layout
1249 \begin_layout Standard
1250 Remove author in slot <num>
1251 \end_layout
1253 \begin_layout Subsubsection
1254 print-authors
1255 \end_layout
1257 \begin_layout Standard
1258 Print authors.
1259 \end_layout
1261 \begin_layout Subsubsection
1262 test-1, test-2, test-3
1263 \end_layout
1265 \begin_layout Standard
1266 Internal test commands.
1267  Don't use.
1268 \end_layout
1270 \begin_layout Subsubsection
1271 take-screenshot <filename>
1272 \end_layout
1274 \begin_layout Standard
1275 Save screenshot to <filename>.
1276 \end_layout
1278 \begin_layout Subsubsection
1279 +controller<num><button>
1280 \end_layout
1282 \begin_layout Standard
1283 Press button <button> on controller <num> (1-8).
1284  The following button names are known:
1285 \end_layout
1287 \begin_layout Itemize
1288 left
1289 \end_layout
1291 \begin_layout Itemize
1292 right
1293 \end_layout
1295 \begin_layout Itemize
1297 \end_layout
1299 \begin_layout Itemize
1300 down
1301 \end_layout
1303 \begin_layout Itemize
1305 \end_layout
1307 \begin_layout Itemize
1309 \end_layout
1311 \begin_layout Itemize
1313 \end_layout
1315 \begin_layout Itemize
1317 \end_layout
1319 \begin_layout Itemize
1321 \end_layout
1323 \begin_layout Itemize
1325 \end_layout
1327 \begin_layout Itemize
1328 select
1329 \end_layout
1331 \begin_layout Itemize
1332 start
1333 \end_layout
1335 \begin_layout Itemize
1336 trigger
1337 \end_layout
1339 \begin_layout Itemize
1340 cursor
1341 \end_layout
1343 \begin_layout Itemize
1344 pause
1345 \end_layout
1347 \begin_layout Itemize
1348 turbo
1349 \end_layout
1351 \begin_layout Subsubsection
1352 controllerh<num><button>
1353 \end_layout
1355 \begin_layout Standard
1356 Hold/unhold button <button> on controller <num> (1-8).
1357  See +controller for button names.
1358 \end_layout
1360 \begin_layout Subsubsection
1361 autofire (<pattern>|-)...
1362 \end_layout
1364 \begin_layout Standard
1365 Set autofire pattern.
1366  Each parameter is comma-separated list of button names (in form of 1start,
1367  1A, 2B, etc..) to hold on that frame.
1368  After reaching the end of pattern, the pattern restarts from the beginning.
1369 \end_layout
1371 \begin_layout Subsubsection
1372 repaint
1373 \end_layout
1375 \begin_layout Standard
1376 Force a repaint.
1377 \end_layout
1379 \begin_layout Subsection
1380 Save jukebox
1381 \end_layout
1383 \begin_layout Subsubsection
1384 cycle-jukebox-backward
1385 \end_layout
1387 \begin_layout Standard
1388 Cycle save jukebox backwards.
1389 \end_layout
1391 \begin_layout Subsubsection
1392 cycle-jukebox-forward
1393 \end_layout
1395 \begin_layout Standard
1396 Cycle save jukebox forwards
1397 \end_layout
1399 \begin_layout Subsubsection
1400 add-jukebox-save <filename>
1401 \end_layout
1403 \begin_layout Standard
1404 Add <filename> to jukebox saves.
1405 \end_layout
1407 \begin_layout Subsubsection
1408 load-jukebox
1409 \end_layout
1411 \begin_layout Standard
1412 Do load from jukebox (current mode).
1413 \end_layout
1415 \begin_layout Subsubsection
1416 save-jukebox
1417 \end_layout
1419 \begin_layout Standard
1420 Do state save to jukebox.
1421 \end_layout
1423 \begin_layout Subsection
1425 \end_layout
1427 \begin_layout Standard
1428 Only available if lua support is compiled in.
1429 \end_layout
1431 \begin_layout Subsubsection
1432 eval-lua <luacode>
1433 \end_layout
1435 \begin_layout Standard
1436 Run Lua code <luacode> using built-in Lua interpretter.
1437 \end_layout
1439 \begin_layout Subsubsection
1440 run-lua <script>
1441 \end_layout
1443 \begin_layout Standard
1444 Run specified lua file using built-in Lua interpretter.
1445 \end_layout
1447 \begin_layout Subsection
1448 Memory watch
1449 \end_layout
1451 \begin_layout Subsubsection
1452 add-watch <name> <expression>
1453 \end_layout
1455 \begin_layout Standard
1456 Adds new watch (or modifies old one).
1457 \end_layout
1459 \begin_layout Subsubsection
1460 remove-watch <name>
1461 \end_layout
1463 \begin_layout Standard
1464 Remove a watch.
1465 \end_layout
1467 \begin_layout Subsection
1468 Sound
1469 \end_layout
1471 \begin_layout Subsubsection
1472 enable-sound <on/off>
1473 \end_layout
1475 \begin_layout Standard
1476 Enable/Disable sound.
1477 \end_layout
1479 \begin_layout Subsubsection
1480 set-sound-device <device>
1481 \end_layout
1483 \begin_layout Standard
1484 Set sound device to <device>
1485 \end_layout
1487 \begin_layout Subsubsection
1488 show-sound-status
1489 \end_layout
1491 \begin_layout Standard
1492 Show status of sound system.
1493 \end_layout
1495 \begin_layout Subsubsection
1496 show-sound-devices
1497 \end_layout
1499 \begin_layout Standard
1500 Show all available devices.
1501 \end_layout
1503 \begin_layout Subsection
1504 SDL Platform commands
1505 \end_layout
1507 \begin_layout Standard
1508 The following are valid on SDL platform.
1509 \end_layout
1511 \begin_layout Subsubsection
1512 identify-key
1513 \end_layout
1515 \begin_layout Standard
1516 Asks to press a key and then identifies that (pseudo-)key.
1517 \end_layout
1519 \begin_layout Subsubsection
1520 toggle-console
1521 \end_layout
1523 \begin_layout Standard
1524 Toggle between windowed/fullscreen console.
1525 \end_layout
1527 \begin_layout Subsubsection
1528 scroll-fullup
1529 \end_layout
1531 \begin_layout Standard
1532 Scroll messages window as far back as it goes.
1533 \end_layout
1535 \begin_layout Subsubsection
1536 scroll-fulldown
1537 \end_layout
1539 \begin_layout Standard
1540 Scroll messages window as far forward as it goes.
1541 \end_layout
1543 \begin_layout Subsubsection
1544 scroll-up
1545 \end_layout
1547 \begin_layout Standard
1548 Scroll messages window back one screenful.
1549 \end_layout
1551 \begin_layout Subsubsection
1552 scroll-down
1553 \end_layout
1555 \begin_layout Standard
1556 Scroll messages window forward one screenful.
1557 \end_layout
1559 \begin_layout Section
1560 Settings
1561 \end_layout
1563 \begin_layout Subsection
1564 Core settings
1565 \end_layout
1567 \begin_layout Subsubsection
1568 firmwarepath
1569 \end_layout
1571 \begin_layout Standard
1572 Set where bsnes looks for firmware files.
1573  Default is 
1574 \begin_inset Quotes eld
1575 \end_inset
1578 \begin_inset Quotes erd
1579 \end_inset
1582 \end_layout
1584 \begin_layout Subsubsection
1585 targetfps
1586 \end_layout
1588 \begin_layout Standard
1589 Set the target fps.
1590  Numeric, range is 0.001 to 
1591 \begin_inset Quotes eld
1592 \end_inset
1594 infinite
1595 \begin_inset Quotes erd
1596 \end_inset
1599  Default is native framerate.
1600 \end_layout
1602 \begin_layout Subsubsection
1603 savecompression
1604 \end_layout
1606 \begin_layout Standard
1607 Set save compression level (integer 0-9).
1608  Default is 7 (0 is no compression).
1609 \end_layout
1611 \begin_layout Subsubsection
1612 advance-timeout
1613 \end_layout
1615 \begin_layout Standard
1616 Set the frame advance timeout in milliseconds.
1617  Numeric integer, range is 0-999999999.
1618  Default is 500.
1619 \end_layout
1621 \begin_layout Subsection
1622 AVI dumper settings
1623 \end_layout
1625 \begin_layout Subsubsection
1626 avi-large
1627 \end_layout
1629 \begin_layout Standard
1630 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1631  outputs.
1632 \end_layout
1634 \begin_layout Subsubsection
1635 avi-left-border
1636 \end_layout
1638 \begin_layout Standard
1639 AVI dumper: Set the default left border thickness (unless lua overrides)
1640  for dumps.
1641  Range 0-8191.
1642  Default is 0.
1643 \end_layout
1645 \begin_layout Subsubsection
1646 avi-right-border
1647 \end_layout
1649 \begin_layout Standard
1650 AVI dumper: Set the default right border thickness (unless lua overrides)
1651  for dumps.
1652  Range 0-8191.
1653  Default is 0.
1654 \end_layout
1656 \begin_layout Subsubsection
1657 avi-top-border
1658 \end_layout
1660 \begin_layout Standard
1661 AVI dumper: Set the default top border thickness (unless lua overrides)
1662  for dumps.
1663  Range 0-8191.
1664  Default is 0.
1665 \end_layout
1667 \begin_layout Subsubsection
1668 avi-bottom-border
1669 \end_layout
1671 \begin_layout Standard
1672 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1673  for dumps.
1674  Range 0-8191.
1675  Default is 0.
1676 \end_layout
1678 \begin_layout Subsubsection
1679 avi-maxframes
1680 \end_layout
1682 \begin_layout Standard
1683 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1684  Range 0-999999999.
1685  Default is 0.
1686 \end_layout
1688 \begin_layout Subsection
1689 SDL platform settings
1690 \end_layout
1692 \begin_layout Subsubsection
1693 autorepeat-first-delay
1694 \end_layout
1696 \begin_layout Standard
1697 Sets the delay for first character in typematic autorepeat.
1698 \end_layout
1700 \begin_layout Subsubsection
1701 autorepeat-subsequent-delay
1702 \end_layout
1704 \begin_layout Standard
1705 Sets the delay for subsequent characters in typematic autorepeat.
1706 \end_layout
1708 \begin_layout Section
1709 Lua functions
1710 \end_layout
1712 \begin_layout Subsection
1713 Core (in main table)
1714 \end_layout
1716 \begin_layout Subsubsection
1717 print
1718 \end_layout
1720 \begin_layout Standard
1721 Print line to message console.
1722 \end_layout
1724 \begin_layout Subsubsection
1725 exec(string command)
1726 \end_layout
1728 \begin_layout Standard
1729 Run command as it was entered on the command line
1730 \end_layout
1732 \begin_layout Subsection
1733 Table bit:
1734 \end_layout
1736 \begin_layout Standard
1737 Bitwise logical functions and related.
1738 \end_layout
1740 \begin_layout Subsubsection
1741 none(number...) / bnot(number...)
1742 \end_layout
1744 \begin_layout Standard
1745 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1746  arguments).
1747 \end_layout
1749 \begin_layout Subsubsection
1750 any(number...) / bor(number...)
1751 \end_layout
1753 \begin_layout Standard
1754 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1755 \end_layout
1757 \begin_layout Subsubsection
1758 all(number...) / band(number...)
1759 \end_layout
1761 \begin_layout Standard
1762 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1764 \end_layout
1766 \begin_layout Subsubsection
1767 parity(number...) / bxor(number...)
1768 \end_layout
1770 \begin_layout Standard
1771 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1772  of the arguments).
1773 \end_layout
1775 \begin_layout Subsubsection
1776 lrotate(number base[, number amount[, number bits]])
1777 \end_layout
1779 \begin_layout Standard
1780 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1781 \end_layout
1783 \begin_layout Subsubsection
1784 rrotate(number base[, number amount[, number bits]])
1785 \end_layout
1787 \begin_layout Standard
1788 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1789  places.
1790 \end_layout
1792 \begin_layout Subsubsection
1793 lshift(number base[, number amount[, number bits]])
1794 \end_layout
1796 \begin_layout Standard
1797 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1798  The new bits are filled with zeroes.
1799 \end_layout
1801 \begin_layout Subsubsection
1802 lrshift(number base[, number amount[, number bits]])
1803 \end_layout
1805 \begin_layout Standard
1806 Shift bits-bit (max 48, default 48) number logically right by amount (default
1807  1) places.
1808  The new bits are filled with zeroes.
1809 \end_layout
1811 \begin_layout Subsubsection
1812 arshift(number base[, number amount[, number bits]])
1813 \end_layout
1815 \begin_layout Standard
1816 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1817  (default 1) places.
1818  The new bits are shifted in with copy of the high bit.
1819 \end_layout
1821 \begin_layout Subsection
1822 Table gui:
1823 \end_layout
1825 \begin_layout Standard
1826 Most of these functions can only be called in on_paint and on_video callbacks.
1827  Exceptions are noted.
1828 \end_layout
1830 \begin_layout Standard
1831 Colors are 32-bit.
1832  Bits 0-7 are the blue component, bits 8-15 are the green component, bits
1833  16-23 are the red component, bits 24-31 are alpha component (0 is fully
1834  opaque, 255 is almost transparent).
1835  -1 is the fully transparent color.
1836  Alpha values greater than 127 do work.
1837 \end_layout
1839 \begin_layout Standard
1840 Origin of coordinates is at top left corner of game display area.
1841  Left and top gaps correspond to negative coordinates.
1842 \end_layout
1844 \begin_layout Subsubsection
1845 gui.resolution()
1846 \end_layout
1848 \begin_layout Standard
1849 Returns 2-tuple (hresolution, vresolution).
1850 \end_layout
1852 \begin_layout Subsubsection
1853 gui.<class>_gap(number gap)
1854 \end_layout
1856 \begin_layout Standard
1857 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1858  is 8191).
1859 \end_layout
1861 \begin_layout Subsubsection
1862 gui.text(number x, number y, string text[, number fgc[, number bgc]])
1863 \end_layout
1865 \begin_layout Standard
1866 Draw specified text on the GUI (each character cell is 8 or 16 wide and
1867  16 high).
1868  Parameters:
1869 \end_layout
1871 \begin_layout Itemize
1872 x: X-coordinate to start the drawing from (and x-coordinate at begining
1873  of the lines).
1874 \end_layout
1876 \begin_layout Itemize
1877 y: Y-coordinate to start the drawing from.
1878 \end_layout
1880 \begin_layout Itemize
1881 text: The text to draw.
1882 \end_layout
1884 \begin_layout Itemize
1885 fgc: Text color (default is 0xFFFFFF (white))
1886 \end_layout
1888 \begin_layout Itemize
1889 bgc: Background color (default is -1 (transparent))
1890 \end_layout
1892 \begin_layout Subsubsection
1893 gui.rectangle(number x, number y, number width, number height[, number thickness[
1894 , number outline[, number fill]]])
1895 \end_layout
1897 \begin_layout Standard
1898 Draw rectangle on the GUI.
1899  Parameters:
1900 \end_layout
1902 \begin_layout Itemize
1903 x: X-coordinate of left edge.
1904 \end_layout
1906 \begin_layout Itemize
1907 y: Y-coordinate of upper edge.
1908 \end_layout
1910 \begin_layout Itemize
1911 width: Width of rectangle.
1912 \end_layout
1914 \begin_layout Itemize
1915 height: Height of rectangle.
1916 \end_layout
1918 \begin_layout Itemize
1919 thickness: Thickness of outline (default is 1).
1920 \end_layout
1922 \begin_layout Itemize
1923 outline: Color of outline (default is 0xFFFFFF (white))
1924 \end_layout
1926 \begin_layout Itemize
1927 fill: Color of fil (default is -1 (transparent))
1928 \end_layout
1930 \begin_layout Subsubsection
1931 gui.pixel(number x, number y[, number color])
1932 \end_layout
1934 \begin_layout Standard
1935 Draw one pixel on the GUI.
1936  Parameters:
1937 \end_layout
1939 \begin_layout Itemize
1940 x: X-coordinate of the pixel
1941 \end_layout
1943 \begin_layout Itemize
1944 y: Y-coordinate of the pixel
1945 \end_layout
1947 \begin_layout Itemize
1948 color: Color of the pixel (default is 0xFFFFFF (white))
1949 \end_layout
1951 \begin_layout Subsubsection
1952 gui.crosshair(number x, number y[, number length[, number color]])
1953 \end_layout
1955 \begin_layout Standard
1956 Draw a crosshair.
1957  Parameters:
1958 \end_layout
1960 \begin_layout Itemize
1961 x: X-coordinate of the crosshair
1962 \end_layout
1964 \begin_layout Itemize
1965 y: Y-coordinate of the crosshair
1966 \end_layout
1968 \begin_layout Itemize
1969 length: Length of the crosshair lines (default 10).
1970 \end_layout
1972 \begin_layout Itemize
1973 color: Color of the crosshair (default is 0xFFFFFF (white))
1974 \end_layout
1976 \begin_layout Subsubsection
1977 gui.line(number x1, number y1, number x2, number y2[, number color])
1978 \end_layout
1980 \begin_layout Standard
1981 Draw a thin line.
1982  Parameters:
1983 \end_layout
1985 \begin_layout Itemize
1986 x1: X-coordinate of one end.
1987 \end_layout
1989 \begin_layout Itemize
1990 y1: Y-coordinate of one end.
1991 \end_layout
1993 \begin_layout Itemize
1994 x2: X-coordinate of the other end.
1995 \end_layout
1997 \begin_layout Itemize
1998 y2: Y-coordinate of the other end.
1999 \end_layout
2001 \begin_layout Itemize
2002 color: Color of the line (default is 0xFFFFFF (white)).
2003 \end_layout
2005 \begin_layout Subsubsection
2006 gui.circle(number x, number y, number r[, number thick[, number border[,
2007  number fil]]])
2008 \end_layout
2010 \begin_layout Standard
2011 Draw a circle.
2012  Parameters.
2013 \end_layout
2015 \begin_layout Itemize
2016 x: X-coordinate of the center
2017 \end_layout
2019 \begin_layout Itemize
2020 y: Y-coordinate of the center
2021 \end_layout
2023 \begin_layout Itemize
2024 r: The radius of the circle
2025 \end_layout
2027 \begin_layout Itemize
2028 thick: Border thickness
2029 \end_layout
2031 \begin_layout Itemize
2032 border: Border color (default is 0xFFFFFF (white))
2033 \end_layout
2035 \begin_layout Itemize
2036 fill: Fill color (default is -1 (transparent)).
2037 \end_layout
2039 \begin_layout Subsubsection
2040 gui.repaint()
2041 \end_layout
2043 \begin_layout Standard
2044 Request on_repaint() to happen as soon as possible.
2045  Can be used anywhere.
2046 \end_layout
2048 \begin_layout Subsubsection
2049 gui.subframe_update(boolean on)
2050 \end_layout
2052 \begin_layout Standard
2053 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
2054  or not happen (on=false).
2055  Can be used anywhere.
2056 \end_layout
2058 \begin_layout Subsubsection
2059 gui.screenshot(string filename)
2060 \end_layout
2062 \begin_layout Standard
2063 Write PNG screenshot of the current frame (no drawings) to specified file.
2064  Can be used anywhere.
2065 \end_layout
2067 \begin_layout Subsubsection
2068 gui.color(number r, number g, number b[, number a])
2069 \end_layout
2071 \begin_layout Standard
2072 Returns color (in notation Lua scripts use) corresponding to color (r,g,b),
2073  each component in scale 0-255.
2074  If a is specified, that is alpha (0 is fully transparent, 256(sic) is fully
2075  opaque).
2076  The default alpha is 256.
2077 \end_layout
2079 \begin_layout Subsubsection
2080 gui.status(string name, string value)
2081 \end_layout
2083 \begin_layout Standard
2084 Set status field 
2085 \begin_inset Quotes eld
2086 \end_inset
2088 L[<name>]
2089 \begin_inset Quotes erd
2090 \end_inset
2092  to <value> in status area.
2093  Can be used anywhere.
2094 \end_layout
2096 \begin_layout Subsection
2097 table input
2098 \end_layout
2100 \begin_layout Standard
2101 Input handling.
2102  Only available in on_input callback.
2103 \end_layout
2105 \begin_layout Subsection
2106 get(number controller, number index)
2107 \end_layout
2109 \begin_layout Standard
2110 Read the specified index (0-11) from specified controller (0-7).
2111  Notes:
2112 \end_layout
2114 \begin_layout Itemize
2115 Uses physical controller numbering.
2116  Gamepad in port 2 is controller 4, not 1!
2117 \end_layout
2119 \begin_layout Subsection
2120 set(number controller, number index, number value)
2121 \end_layout
2123 \begin_layout Standard
2124 Write the specified index (0-11) from specified controller (0-7), storing
2125  value.
2126  Notes:
2127 \end_layout
2129 \begin_layout Itemize
2130 Uses physical controller numbering.
2131  Gamepad in port 2 is controller 4, not 1!
2132 \end_layout
2134 \begin_layout Subsection
2135 reset([number cycles])
2136 \end_layout
2138 \begin_layout Standard
2139 Execute reset.
2140  If cycles is greater than zero, do delayed reset.
2141  0 (or no value) causes immediate reset.
2142 \end_layout
2144 \begin_layout Itemize
2145 Only available with subframe flag false.
2146 \end_layout
2148 \begin_layout Subsection
2149 Table hostmemory
2150 \end_layout
2152 \begin_layout Standard
2153 Host memory handling (extra memory saved to savestates).
2154  Host memory starts empty.
2155 \end_layout
2157 \begin_layout Subsubsection
2158 read(number address)
2159 \end_layout
2161 \begin_layout Standard
2162 Reads hostmemory slot address.
2163  Slot numbers out of range return false instead of numeric.
2164 \end_layout
2166 \begin_layout Subsubsection
2167 write(number address, number value)
2168 \end_layout
2170 \begin_layout Standard
2171 Writes hostmemory slot with 0-255.
2172  Slot numbers out of range cause extension of host memory slot space.
2173 \end_layout
2175 \begin_layout Subsubsection
2176 readbyte(number address)
2177 \end_layout
2179 \begin_layout Standard
2180 Read unsigned byte (1 element) from given address.
2181  Slots out of range return false.
2182 \end_layout
2184 \begin_layout Subsubsection
2185 writebyte(number address, number value)
2186 \end_layout
2188 \begin_layout Standard
2189 Write unsigned byte (1 element) to given slot.
2190  Slot numbers out of range cause extension.
2191 \end_layout
2193 \begin_layout Subsubsection
2194 readsbyte(number address)
2195 \end_layout
2197 \begin_layout Standard
2198 Read signed byte (1 element) from given address.
2199  Slots out of range return false.
2200 \end_layout
2202 \begin_layout Subsubsection
2203 writesbyte(number address, number value)
2204 \end_layout
2206 \begin_layout Standard
2207 Write signed byte (1 element) to given slot.
2208  Slot numbers out of range cause extension.
2209 \end_layout
2211 \begin_layout Subsubsection
2212 readword(number address)
2213 \end_layout
2215 \begin_layout Standard
2216 Read unsigned word (2 elements) from given address.
2217  Slots out of range return false.
2218 \end_layout
2220 \begin_layout Subsubsection
2221 writeword(number address, number value)
2222 \end_layout
2224 \begin_layout Standard
2225 Write unsigned word (2 elements) to given slot.
2226  Slot numbers out of range cause extension.
2227 \end_layout
2229 \begin_layout Subsubsection
2230 readsword(number address)
2231 \end_layout
2233 \begin_layout Standard
2234 Read signed word (2 elements) from given address.
2235  Slots out of range return false.
2236 \end_layout
2238 \begin_layout Subsubsection
2239 writesword(number address, number value)
2240 \end_layout
2242 \begin_layout Standard
2243 Write signed word (2 elements) to given slot.
2244  Slot numbers out of range cause extension.
2245 \end_layout
2247 \begin_layout Subsubsection
2248 readdword(number address)
2249 \end_layout
2251 \begin_layout Standard
2252 Read unsigned doubleword (4 elements) from given address.
2253  Slots out of range return false.
2254 \end_layout
2256 \begin_layout Subsubsection
2257 writedword(number address, number value)
2258 \end_layout
2260 \begin_layout Standard
2261 Write unsigned doubleword (4 elements) to given slot.
2262  Slot numbers out of range cause extension.
2263 \end_layout
2265 \begin_layout Subsubsection
2266 readsdword(number address)
2267 \end_layout
2269 \begin_layout Standard
2270 Read signed doubleword (4 elements) from given address.
2271  Slots out of range return false.
2272 \end_layout
2274 \begin_layout Subsubsection
2275 writesdword(number address, number value)
2276 \end_layout
2278 \begin_layout Standard
2279 Write signed doubleword (4 elements) to given slot.
2280  Slot numbers out of range cause extension.
2281 \end_layout
2283 \begin_layout Subsubsection
2284 readqword(number address)
2285 \end_layout
2287 \begin_layout Standard
2288 Read unsigned quadword (8 elements) from given address.
2289  Slots out of range return false.
2290 \end_layout
2292 \begin_layout Subsubsection
2293 writeqword(number address, number value)
2294 \end_layout
2296 \begin_layout Standard
2297 Write unsigned quadword (4 elements) to given slot.
2298  Slot numbers out of range cause extension.
2299 \end_layout
2301 \begin_layout Subsubsection
2302 readsqword(number address)
2303 \end_layout
2305 \begin_layout Standard
2306 Read signed quadword (8 elements) from given address.
2307  Slots out of range return false.
2308 \end_layout
2310 \begin_layout Subsubsection
2311 writesqword(number address, number value)
2312 \end_layout
2314 \begin_layout Standard
2315 Write signed quadword (8 elements) to given slot.
2316  Slot numbers out of range cause extension.
2317 \end_layout
2319 \begin_layout Subsection
2320 Table movie
2321 \end_layout
2323 \begin_layout Standard
2324 Movie handling
2325 \end_layout
2327 \begin_layout Subsubsection
2328 movie.currentframe()
2329 \end_layout
2331 \begin_layout Standard
2332 Return number of current frame.
2333 \end_layout
2335 \begin_layout Subsubsection
2336 movie.framecount()
2337 \end_layout
2339 \begin_layout Standard
2340 Return number of frames in movie.
2341 \end_layout
2343 \begin_layout Subsubsection
2344 movie.readonly()
2345 \end_layout
2347 \begin_layout Standard
2348 Return true if in readonly mode, false if in readwrite.
2349 \end_layout
2351 \begin_layout Subsubsection
2352 movie.set_readwrite()
2353 \end_layout
2355 \begin_layout Standard
2356 Set readwrite mode (does not cause on_readwrite callback).
2357 \end_layout
2359 \begin_layout Subsubsection
2360 movie.frame_subframes(number frame)
2361 \end_layout
2363 \begin_layout Standard
2364 Count number of subframes in specified frame (frame numbers are 1-based)
2365  and return that.
2366 \end_layout
2368 \begin_layout Subsubsection
2369 movie.read_subframe(number frame, number subframe)
2370 \end_layout
2372 \begin_layout Standard
2373 Read specifed subframe in specified frame and return data as array (100
2374  elements, numbered 0-99 currently).
2375 \end_layout
2377 \begin_layout Subsection
2378 Table settings
2379 \end_layout
2381 \begin_layout Standard
2382 Routines for settings manipulation
2383 \end_layout
2385 \begin_layout Subsubsection
2386 get(string name)
2387 \end_layout
2389 \begin_layout Standard
2390 Get value of setting.
2391  If setting is blank, returns false.
2392  If setting value can't be obtained, returns (nil, error message).
2393 \end_layout
2395 \begin_layout Subsubsection
2396 set(string name, string value)
2397 \end_layout
2399 \begin_layout Standard
2400 Set value of setting.
2401  If setting can't be set, returns (nil, error message).
2402 \end_layout
2404 \begin_layout Subsubsection
2405 is_set(string name)
2406 \end_layout
2408 \begin_layout Standard
2409 Returns if setting is set.
2410  If setting does not exist, returns (nil, error message).
2411 \end_layout
2413 \begin_layout Subsubsection
2414 blank(string name)
2415 \end_layout
2417 \begin_layout Standard
2418 Blanks a setting and returns true.
2419  If setting can't be blanked, returns (nil, error message).
2420 \end_layout
2422 \begin_layout Subsection
2423 Table memory
2424 \end_layout
2426 \begin_layout Standard
2427 Contains various functions for managing memory
2428 \end_layout
2430 \begin_layout Subsubsection
2431 vma_count()
2432 \end_layout
2434 \begin_layout Standard
2435 Returns the number of VMAs
2436 \end_layout
2438 \begin_layout Subsubsection
2439 read_vma(number index)
2440 \end_layout
2442 \begin_layout Standard
2443 Reads the specified VMA (indices start from zero).
2444  Trying to read invalid VMA gives nil.
2445  The read VMA is table with the following fields:
2446 \end_layout
2448 \begin_layout Itemize
2449 region_name (string): The readable name of the VMA
2450 \end_layout
2452 \begin_layout Itemize
2453 baseaddr (number): Base address of the VMA
2454 \end_layout
2456 \begin_layout Itemize
2457 lastaddr (number): Last address in the VMA.
2458 \end_layout
2460 \begin_layout Itemize
2461 size (number): The size of VMA in bytes.
2462 \end_layout
2464 \begin_layout Itemize
2465 readonly (boolean): True of the VMA corresponds to ROM.
2466 \end_layout
2468 \begin_layout Itemize
2469 native_endian (boolean): True if the VMA has native endian as opposed to
2470  big endian.
2471 \end_layout
2473 \begin_layout Subsubsection
2474 find_vma(number address)
2475 \end_layout
2477 \begin_layout Standard
2478 Finds the VMA containing specified address.
2479  Returns table in the same format as read_vma or nil if not found.
2480 \end_layout
2482 \begin_layout Subsubsection
2483 readbyte(number address)
2484 \end_layout
2486 \begin_layout Standard
2487 Reads the specified address as unsigned byte and returns the result.
2488 \end_layout
2490 \begin_layout Subsubsection
2491 readsbyte(number address)
2492 \end_layout
2494 \begin_layout Standard
2495 Reads the specified address as signed byte and returns the result.
2496 \end_layout
2498 \begin_layout Subsubsection
2499 writebyte(number address, number value)
2500 \end_layout
2502 \begin_layout Standard
2503 Writes the specified value (negative values undergo 2's complement) to specified
2504  address (as a byte).
2505 \end_layout
2507 \begin_layout Subsubsection
2508 readword(number address)
2509 \end_layout
2511 \begin_layout Standard
2512 Reads the specified address as unsigned word and returns the result.
2513 \end_layout
2515 \begin_layout Subsubsection
2516 readsword(number address)
2517 \end_layout
2519 \begin_layout Standard
2520 Reads the specified address as signed word and returns the result.
2521 \end_layout
2523 \begin_layout Subsubsection
2524 writeword(number address, number value)
2525 \end_layout
2527 \begin_layout Standard
2528 Writes the specified value (negative values undergo 2's complement) to specified
2529  address (as a word).
2530 \end_layout
2532 \begin_layout Subsubsection
2533 readdword(number address)
2534 \end_layout
2536 \begin_layout Standard
2537 Reads the specified address as unsigned doubleword and returns the result.
2538 \end_layout
2540 \begin_layout Subsubsection
2541 readsdword(number address)
2542 \end_layout
2544 \begin_layout Standard
2545 Reads the specified address as signed doubleword and returns the result.
2546 \end_layout
2548 \begin_layout Subsubsection
2549 writedword(number address, number value)
2550 \end_layout
2552 \begin_layout Standard
2553 Writes the specified value (negative values undergo 2's complement) to specified
2554  address (as a doubleword).
2555 \end_layout
2557 \begin_layout Subsubsection
2558 readqword(number address)
2559 \end_layout
2561 \begin_layout Standard
2562 Reads the specified address as unsigned quadword and returns the result.
2563 \end_layout
2565 \begin_layout Subsubsection
2566 readsqword(number address)
2567 \end_layout
2569 \begin_layout Standard
2570 Reads the specified address as signed quadword and returns the result.
2571 \end_layout
2573 \begin_layout Subsubsection
2574 writeqword(number address, number value)
2575 \end_layout
2577 \begin_layout Standard
2578 Writes the specified value (negative values undergo 2's complement) to specified
2579  address (as a quadword).
2580 \end_layout
2582 \begin_layout Subsection
2583 Callbacks
2584 \end_layout
2586 \begin_layout Standard
2587 Various callbacks to Lua that can occur.
2588 \end_layout
2590 \begin_layout Subsubsection
2591 Callback: on_paint()
2592 \end_layout
2594 \begin_layout Standard
2595 Called when screen is being painted.
2596  Any gui.* calls requiring graphic context draw on the screen.
2597 \end_layout
2599 \begin_layout Subsubsection
2600 Callback: on_video()
2601 \end_layout
2603 \begin_layout Standard
2604 Called when video dump frame is being painted.
2605  Any gui.* calls requiring graphic context draw on the video.
2606 \end_layout
2608 \begin_layout Subsubsection
2609 Callback: on_startup()
2610 \end_layout
2612 \begin_layout Standard
2613 Called when the emulator is starting (lsnes.rc and --run files has been run).
2614 \end_layout
2616 \begin_layout Subsubsection
2617 Callback: on_pre_load(string name)
2618 \end_layout
2620 \begin_layout Standard
2621 Called just before savestate/movie load occurs (note: loads are always delayed,
2622  so this occurs even when load was initiated by lua).
2623 \end_layout
2625 \begin_layout Subsubsection
2626 Callback: on_err_load(string name)
2627 \end_layout
2629 \begin_layout Standard
2630 Called if loadstate goes wrong.
2631 \end_layout
2633 \begin_layout Subsubsection
2634 Callback: on_post_load(string name, boolean was_savestate)
2635 \end_layout
2637 \begin_layout Standard
2638 Called on successful loadstate.
2639  was_savestate gives if this was a savestate or a movie.
2640 \end_layout
2642 \begin_layout Subsubsection
2643 Callback: on_pre_save(string name, boolean is_savestate)
2644 \end_layout
2646 \begin_layout Standard
2647 Called just before savestate save occurs (note: movie saves are synchronous
2648  and won't trigger these callbacks if called from Lua).
2649 \end_layout
2651 \begin_layout Subsubsection
2652 Callback: on_err_save(string name)
2653 \end_layout
2655 \begin_layout Standard
2656 Called if savestate goes wrong.
2657 \end_layout
2659 \begin_layout Subsubsection
2660 Callback: on_post_save(string name, boolean is_savestate)
2661 \end_layout
2663 \begin_layout Standard
2664 Called on successful savaestate.
2665  is_savestate gives if this was a savestate or a movie.
2666 \end_layout
2668 \begin_layout Subsubsection
2669 Callback: on_quit()
2670 \end_layout
2672 \begin_layout Standard
2673 Called when emulator is shutting down.
2674 \end_layout
2676 \begin_layout Subsubsection
2677 Callback: on_input(boolean subframe)
2678 \end_layout
2680 \begin_layout Standard
2681 Called when emulator is just sending input to bsnes core.
2682  Warning: This is called even in readonly mode, but the results are ignored.
2683 \end_layout
2685 \begin_layout Subsubsection
2686 Callback: on_reset()
2687 \end_layout
2689 \begin_layout Standard
2690 Called when SNES is reset.
2691 \end_layout
2693 \begin_layout Subsubsection
2694 Callback: on_readwrite()
2695 \end_layout
2697 \begin_layout Standard
2698 Called when moving into readwrite mode as result of 
2699 \begin_inset Quotes eld
2700 \end_inset
2702 set-rwmode
2703 \begin_inset Quotes erd
2704 \end_inset
2706  command (note: moving to rwmode by Lua won't trigger this, as per recursive
2707  entry protection).
2708 \end_layout
2710 \begin_layout Subsubsection
2711 Callback: on_snoop(number port, number controller, number index, number
2712  value)
2713 \end_layout
2715 \begin_layout Standard
2716 Called each time bsnes asks for input.
2717  The value is the final value to be sent to bsnes core (readonly mode, autohold
2718  and autofire have been taken into account).
2719  Might be useful when translating movies to format suitable for console
2720  verification.
2721  Note: There is no way to modify the value to be sent.
2722 \end_layout
2724 \begin_layout Section
2725 Modifier and key names:
2726 \end_layout
2728 \begin_layout Subsection
2729 SDL Platform
2730 \end_layout
2732 \begin_layout Subsubsection
2733 Modifier names
2734 \end_layout
2736 \begin_layout Standard
2737 Following modifier names are known:
2738 \end_layout
2740 \begin_layout Itemize
2741 ctrl, lctrl, rctrl: Control keys
2742 \end_layout
2744 \begin_layout Itemize
2745 alt, lalt, ralt: ALT keys.
2746 \end_layout
2748 \begin_layout Itemize
2749 shift, lshift, rshift: Shift keys.
2750 \end_layout
2752 \begin_layout Itemize
2753 meta, lmeta, rmeta: Meta keys.
2754 \end_layout
2756 \begin_layout Itemize
2757 num, caps: Numlock/Capslock (these are sticky!)
2758 \end_layout
2760 \begin_layout Itemize
2761 mode: Mode select.
2762 \end_layout
2764 \begin_layout Subsubsection
2765 Key names
2766 \end_layout
2768 \begin_layout Standard
2769 Following key names are known:
2770 \end_layout
2772 \begin_layout Itemize
2773 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
2774  hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
2775  comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
2776  less, equals, greater, question, at, leftbracket, backslash, rightbracket,
2777  caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
2778  o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
2779  world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
2780  world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
2781  world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
2782  world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
2783  world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
2784  world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
2785  world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
2786  world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
2787  world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
2788  world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
2789  world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
2790  world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
2791  kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
2792  kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
2793  pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
2794  f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
2795  lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
2796  break, menu, power, euro, undo
2797 \end_layout
2799 \begin_layout Itemize
2800 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
2801  hardware-dependent scan code of <n> (useful to bind those keys that don't
2802  have symbolic names).
2803 \end_layout
2805 \begin_layout Standard
2806 In addition, following pseudo-keys are known (note: these do not work in
2807  conjunction with modifers):
2808 \end_layout
2810 \begin_layout Itemize
2811 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
2812 \end_layout
2814 \begin_layout Itemize
2815 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
2816 \end_layout
2818 \begin_layout Itemize
2819 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
2820 \end_layout
2822 \begin_layout Itemize
2823 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
2824 \end_layout
2826 \begin_layout Itemize
2827 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
2828 \end_layout
2830 \begin_layout Itemize
2831 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
2832  position (axis modes axis and axis_inverse).
2833 \end_layout
2835 \begin_layout Itemize
2836 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
2837  position (axis modes axis and axis_inverse).
2838 \end_layout
2840 \begin_layout Itemize
2841 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
2842  modes pressure_*).
2843 \end_layout
2845 \begin_layout Subsubsection
2846 Special buttons:
2847 \end_layout
2849 \begin_layout Itemize
2850 Escape: Enter/Exit Command mode, cancel modal dialogs.
2851 \end_layout
2853 \begin_layout Itemize
2854 Return (also KPEnter): Execute command, ok modal dialog.
2855 \end_layout
2857 \begin_layout Itemize
2858 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
2859  history
2860 \end_layout
2862 \begin_layout Itemize
2863 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
2864  history
2865 \end_layout
2867 \begin_layout Itemize
2868 Home (also KP7 if no num lock; command mode): Beginning of command.
2869 \end_layout
2871 \begin_layout Itemize
2872 End (also KP1 if no num lock; command mode): End of command.
2873 \end_layout
2875 \begin_layout Itemize
2876 Left (also KP4 if no num lock; command mode): Move cursor left.
2877 \end_layout
2879 \begin_layout Itemize
2880 Right (also KP6 if no num lock; command mode): Move cursor right.
2881 \end_layout
2883 \begin_layout Itemize
2884 Delete (also KP.
2885  if no num lock; command mode): Delete character to right of cursor.
2886 \end_layout
2888 \begin_layout Itemize
2889 Insert (also KP0 if no num lock; command mode): Toggle between insert /
2890  overwrite modes.
2891 \end_layout
2893 \begin_layout Itemize
2894 Backspace (command mode): Delete character to left of cursor.
2895 \end_layout
2897 \begin_layout Itemize
2898 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
2899 \end_layout
2901 \begin_layout Subsubsection
2902 Watchdog timer:
2903 \end_layout
2905 \begin_layout Standard
2906 If emulator does not reach internal polling loop in 15 seconds after leaving
2907  it or 15 seconds after starting, the emulator instantly bombs out.
2908 \end_layout
2910 \begin_layout Section
2911 Movie file format
2912 \end_layout
2914 \begin_layout Standard
2915 Movie file is .zip archive in itself, normal ZIP archive tools work on it
2916  (note: If you recompress it, do not use compression methods other than
2917  store and deflate and especially do not use encryption of any kind).
2918 \end_layout
2920 \begin_layout Subsection
2921 Detecting clean start/SRAM/Savestate
2922 \end_layout
2924 \begin_layout Itemize
2925 If file has member 
2926 \begin_inset Quotes eld
2927 \end_inset
2929 savestate
2930 \begin_inset Quotes erd
2931 \end_inset
2933  it is savestate, otherwise:
2934 \end_layout
2936 \begin_layout Itemize
2937 If file has members with names starting 
2938 \begin_inset Quotes eld
2939 \end_inset
2941 moviesram.
2942 \begin_inset Quotes erd
2943 \end_inset
2945  it is movie starting from SRAM, otherwise:
2946 \end_layout
2948 \begin_layout Itemize
2949 It is movie starting from clear state.
2950 \end_layout
2952 \begin_layout Subsection
2953 Member: gametype
2954 \end_layout
2956 \begin_layout Standard
2957 Type of game ROM and region (as one line).
2958  Valid values are:
2959 \end_layout
2961 \begin_layout Standard
2962 \begin_inset Tabular
2963 <lyxtabular version="3" rows="8" columns="3">
2964 <features tabularvalignment="middle">
2965 <column alignment="center" valignment="top" width="0">
2966 <column alignment="center" valignment="top" width="0">
2967 <column alignment="center" valignment="top" width="0">
2968 <row>
2969 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2970 \begin_inset Text
2972 \begin_layout Plain Layout
2973 Value
2974 \end_layout
2976 \end_inset
2977 </cell>
2978 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2979 \begin_inset Text
2981 \begin_layout Plain Layout
2982 System
2983 \end_layout
2985 \end_inset
2986 </cell>
2987 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2988 \begin_inset Text
2990 \begin_layout Plain Layout
2991 Region
2992 \end_layout
2994 \end_inset
2995 </cell>
2996 </row>
2997 <row>
2998 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2999 \begin_inset Text
3001 \begin_layout Plain Layout
3002 snes_pal
3003 \end_layout
3005 \end_inset
3006 </cell>
3007 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3008 \begin_inset Text
3010 \begin_layout Plain Layout
3011 Super NES
3012 \end_layout
3014 \end_inset
3015 </cell>
3016 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3017 \begin_inset Text
3019 \begin_layout Plain Layout
3021 \end_layout
3023 \end_inset
3024 </cell>
3025 </row>
3026 <row>
3027 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3028 \begin_inset Text
3030 \begin_layout Plain Layout
3031 sgb_pal
3032 \end_layout
3034 \end_inset
3035 </cell>
3036 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3037 \begin_inset Text
3039 \begin_layout Plain Layout
3040 Super Game Boy
3041 \end_layout
3043 \end_inset
3044 </cell>
3045 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3046 \begin_inset Text
3048 \begin_layout Plain Layout
3050 \end_layout
3052 \end_inset
3053 </cell>
3054 </row>
3055 <row>
3056 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3057 \begin_inset Text
3059 \begin_layout Plain Layout
3060 snes_ntsc
3061 \end_layout
3063 \end_inset
3064 </cell>
3065 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3066 \begin_inset Text
3068 \begin_layout Plain Layout
3069 Super NES
3070 \end_layout
3072 \end_inset
3073 </cell>
3074 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3075 \begin_inset Text
3077 \begin_layout Plain Layout
3078 NTSC
3079 \end_layout
3081 \end_inset
3082 </cell>
3083 </row>
3084 <row>
3085 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3086 \begin_inset Text
3088 \begin_layout Plain Layout
3089 sgb_ntsc
3090 \end_layout
3092 \end_inset
3093 </cell>
3094 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3095 \begin_inset Text
3097 \begin_layout Plain Layout
3098 Super Game Boy
3099 \end_layout
3101 \end_inset
3102 </cell>
3103 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3104 \begin_inset Text
3106 \begin_layout Plain Layout
3107 NTSC
3108 \end_layout
3110 \end_inset
3111 </cell>
3112 </row>
3113 <row>
3114 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3115 \begin_inset Text
3117 \begin_layout Plain Layout
3119 \end_layout
3121 \end_inset
3122 </cell>
3123 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3124 \begin_inset Text
3126 \begin_layout Plain Layout
3127 BS-X (non-slotted)
3128 \end_layout
3130 \end_inset
3131 </cell>
3132 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3133 \begin_inset Text
3135 \begin_layout Plain Layout
3136 NTSC
3137 \end_layout
3139 \end_inset
3140 </cell>
3141 </row>
3142 <row>
3143 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3144 \begin_inset Text
3146 \begin_layout Plain Layout
3147 bsxslotted
3148 \end_layout
3150 \end_inset
3151 </cell>
3152 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3153 \begin_inset Text
3155 \begin_layout Plain Layout
3156 BS-X (slotted)
3157 \end_layout
3159 \end_inset
3160 </cell>
3161 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3162 \begin_inset Text
3164 \begin_layout Plain Layout
3165 NTSC
3166 \end_layout
3168 \end_inset
3169 </cell>
3170 </row>
3171 <row>
3172 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3173 \begin_inset Text
3175 \begin_layout Plain Layout
3176 sufamiturbo
3177 \end_layout
3179 \end_inset
3180 </cell>
3181 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3182 \begin_inset Text
3184 \begin_layout Plain Layout
3185 Sufami Turbo
3186 \end_layout
3188 \end_inset
3189 </cell>
3190 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3191 \begin_inset Text
3193 \begin_layout Plain Layout
3194 NTSC
3195 \end_layout
3197 \end_inset
3198 </cell>
3199 </row>
3200 </lyxtabular>
3202 \end_inset
3205 \end_layout
3207 \begin_layout Standard
3208 Frame rates are:
3209 \end_layout
3211 \begin_layout Standard
3212 \begin_inset Tabular
3213 <lyxtabular version="3" rows="3" columns="2">
3214 <features tabularvalignment="middle">
3215 <column alignment="center" valignment="top" width="0">
3216 <column alignment="center" valignment="top" width="0">
3217 <row>
3218 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3219 \begin_inset Text
3221 \begin_layout Plain Layout
3222 Region
3223 \end_layout
3225 \end_inset
3226 </cell>
3227 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3228 \begin_inset Text
3230 \begin_layout Plain Layout
3231 Framerate (fps)
3232 \end_layout
3234 \end_inset
3235 </cell>
3236 </row>
3237 <row>
3238 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3239 \begin_inset Text
3241 \begin_layout Plain Layout
3243 \end_layout
3245 \end_inset
3246 </cell>
3247 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3248 \begin_inset Text
3250 \begin_layout Plain Layout
3251 322445/6448
3252 \end_layout
3254 \end_inset
3255 </cell>
3256 </row>
3257 <row>
3258 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3259 \begin_inset Text
3261 \begin_layout Plain Layout
3262 NTSC
3263 \end_layout
3265 \end_inset
3266 </cell>
3267 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3268 \begin_inset Text
3270 \begin_layout Plain Layout
3271 10738636/178683
3272 \end_layout
3274 \end_inset
3275 </cell>
3276 </row>
3277 </lyxtabular>
3279 \end_inset
3282 \end_layout
3284 \begin_layout Subsection
3285 Member: port1
3286 \end_layout
3288 \begin_layout Standard
3289 Contains type of port #1 (as one line).
3290  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
3291  If not present, defaults to 'gamepad'.
3292 \end_layout
3294 \begin_layout Subsection
3295 Member: port2
3296 \end_layout
3298 \begin_layout Standard
3299 Contains type of port #2 (as one line).
3300  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
3301  'justifier' and 'justifiers'.
3302  If not present, defaults to 'none'.
3303 \end_layout
3305 \begin_layout Subsection
3306 Member: gamename
3307 \end_layout
3309 \begin_layout Standard
3310 Contains name of the game (as one line).
3311 \end_layout
3313 \begin_layout Subsection
3314 Member: authors
3315 \end_layout
3317 \begin_layout Standard
3318 Contains authors, one per line.
3319  Part before '|' is the full name, part after is the nickname.
3320 \end_layout
3322 \begin_layout Subsection
3323 Member: systemid
3324 \end_layout
3326 \begin_layout Standard
3327 Always 
3328 \begin_inset Quotes eld
3329 \end_inset
3331 lsnes-rr1
3332 \begin_inset Quotes erd
3333 \end_inset
3335  (one line).
3336  Used to reject other saves.
3337 \end_layout
3339 \begin_layout Subsection
3340 Member: controlsversion
3341 \end_layout
3343 \begin_layout Standard
3344 Always 
3345 \begin_inset Quotes eld
3346 \end_inset
3349 \begin_inset Quotes erd
3350 \end_inset
3352  (one line).
3353  Used to identify what controls are there.
3354 \end_layout
3356 \begin_layout Subsection
3357 Member: 
3358 \begin_inset Quotes eld
3359 \end_inset
3361 coreversion
3362 \begin_inset Quotes erd
3363 \end_inset
3366 \end_layout
3368 \begin_layout Standard
3369 Contains bsnes core version number (as one line).
3370 \end_layout
3372 \begin_layout Subsection
3373 Member: projectid
3374 \end_layout
3376 \begin_layout Standard
3377 Contains project ID (as one line).
3378  Used to identify if two movies are part of the same project.
3379 \end_layout
3381 \begin_layout Subsection
3382 Member: {rom,slota,slotb}{,xml}.sha256
3383 \end_layout
3385 \begin_layout Standard
3386 Contains SHA-256 of said ROM or ROM mapping file (as one line).
3387  Absent if corresponding file is absent.
3388 \end_layout
3390 \begin_layout Subsection
3391 Member: moviesram.<name>
3392 \end_layout
3394 \begin_layout Standard
3395 Raw binary startup SRAM of kind <name>.
3396  Only present in savestates and movies starting from SRAM.
3397 \end_layout
3399 \begin_layout Subsection
3400 Member: moviestate
3401 \end_layout
3403 \begin_layout Standard
3404 Raw binary movie state data.
3405  Only present in savestates.
3406 \end_layout
3408 \begin_layout Standard
3409 for version 0:
3410 \end_layout
3412 \begin_layout Itemize
3413 32 bytes: SHA-256 of project ID.
3414 \end_layout
3416 \begin_layout Itemize
3417 8 bytes: Big-endian current frame.
3418 \end_layout
3420 \begin_layout Itemize
3421 100x4 bytes: Poll counters for each control (bit31 of each is 
3422 \begin_inset Quotes eld
3423 \end_inset
3425 data ready
3426 \begin_inset Quotes erd
3427 \end_inset
3429  bit), big-endian.
3430 \end_layout
3432 \begin_layout Itemize
3433 8 bytes: Big-endian lag frame count.
3434 \end_layout
3436 \begin_layout Itemize
3437 32 bytes: SHA-256 of past input
3438 \end_layout
3440 \begin_layout Itemize
3441 32 bytes: SHA-256 of previous.
3442 \end_layout
3444 \begin_layout Itemize
3445 (total of 512 bytes)
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 1/3,462,619,485,020 s.
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 Subsection
3650 Prerequisite libraries:
3651 \end_layout
3653 \begin_layout Itemize
3654 zlib
3655 \end_layout
3657 \begin_layout Itemize
3658 SDL (SDL platform)
3659 \end_layout
3661 \begin_layout Itemize
3662 SDLmain (Windows/Mac OS X only; Note you may have to extract the object
3663  out of archive)
3664 \end_layout
3666 \begin_layout Itemize
3667 boost_iostreams
3668 \end_layout
3670 \begin_layout Itemize
3671 boost_filesystem
3672 \end_layout
3674 \begin_layout Itemize
3675 boost conversion (header only)
3676 \end_layout
3678 \begin_layout Subsection
3679 Compile options to make:
3680 \end_layout
3682 \begin_layout Subsubsection
3683 BSNES_PATH=<path>
3684 \end_layout
3686 \begin_layout Standard
3687 Set path to BSNES bsnes directory to <path>.
3688 \end_layout
3690 \begin_layout Subsubsection
3691 NO_THREADS=1
3692 \end_layout
3694 \begin_layout Standard
3695 Don't use threads on Linux.
3696 \end_layout
3698 \begin_layout Subsubsection
3699 USE_THREADS=1
3700 \end_layout
3702 \begin_layout Standard
3703 Try to use threads even on non-Linux systems.
3704 \end_layout
3706 \begin_layout Subsubsection
3707 CC=<compiler>
3708 \end_layout
3710 \begin_layout Standard
3711 Target C++ compiler to use.
3712  Defaults to g++-4.5.
3713 \end_layout
3715 \begin_layout Standard
3716 Note: If crosscompiling, this has to be crosscompiler.
3717 \end_layout
3719 \begin_layout Subsubsection
3720 HOSTCC=<compiler>
3721 \end_layout
3723 \begin_layout Standard
3724 Host C++ compiler to use.
3725  Defaults to the same as CC.
3726 \end_layout
3728 \begin_layout Standard
3729 Note: If crosscompiling, that has to be host compiler (the files produced
3730  will be run in the build process!)
3731 \end_layout
3733 \begin_layout Subsubsection
3734 BSNES_IS_COMPAT=1
3735 \end_layout
3737 \begin_layout Standard
3738 Assume BSNES uses compatiblity core instead of accuracy core.
3739 \end_layout
3741 \begin_layout Subsubsection
3742 NO_LUA=1
3743 \end_layout
3745 \begin_layout Standard
3746 Don't compile in Lua support.
3747 \end_layout
3749 \begin_layout Subsubsection
3750 NO_TIME_INTERCEPT=1
3751 \end_layout
3753 \begin_layout Standard
3754 Disable time() interception.
3755  Prevents recording games using RTC but allows building on some platforms,
3756  notably Mac OS X.
3757 \end_layout
3759 \begin_layout Subsubsection
3760 GRAPHICS=<plat>
3761 \end_layout
3763 \begin_layout Standard
3764 Set graphics platform.
3765  Currently available choice is 
3766 \begin_inset Quotes eld
3767 \end_inset
3770 \begin_inset Quotes erd
3771 \end_inset
3774 \end_layout
3776 \begin_layout Subsubsection
3777 SOUND=<plat>
3778 \end_layout
3780 \begin_layout Standard
3781 Set sound platform.
3782  Currently available choices are 
3783 \begin_inset Quotes eld
3784 \end_inset
3787 \begin_inset Quotes erd
3788 \end_inset
3790  (requires SDL graphics), 
3791 \begin_inset Quotes eld
3792 \end_inset
3794 PORTAUDIO
3795 \begin_inset Quotes erd
3796 \end_inset
3798  and 
3799 \begin_inset Quotes eld
3800 \end_inset
3802 DUMMY
3803 \begin_inset Quotes erd
3804 \end_inset
3807 \end_layout
3809 \begin_layout Subsubsection
3810 JOYSTICK=<plat>
3811 \end_layout
3813 \begin_layout Standard
3814 Set joystick platform.
3815  Currently available choices are 
3816 \begin_inset Quotes eld
3817 \end_inset
3820 \begin_inset Quotes erd
3821 \end_inset
3823  (requires SDL graphics) and 
3824 \begin_inset Quotes eld
3825 \end_inset
3827 DUMMY
3828 \begin_inset Quotes erd
3829 \end_inset
3832 \end_layout
3834 \begin_layout Subsubsection
3835 NO_LUA_SEARCH=1
3836 \end_layout
3838 \begin_layout Standard
3839 Disable searching for Lua.
3840 \end_layout
3842 \begin_layout Subsubsection
3843 NO_SDL_SEARCH=1
3844 \end_layout
3846 \begin_layout Standard
3847 Disable searching for SDL.
3848 \end_layout
3850 \begin_layout Subsubsection
3851 NO_LIBDL=1
3852 \end_layout
3854 \begin_layout Standard
3855 Don't link against libdl.
3856 \end_layout
3858 \begin_layout Section
3859 Quick'n'dirty encode guide
3860 \end_layout
3862 \begin_layout Enumerate
3863 Start the emulator and load the movie file.
3864 \end_layout
3866 \begin_layout Enumerate
3867 Set large AVI option 'set-setting avi-large on'
3868 \end_layout
3870 \begin_layout Enumerate
3871 If dumping PAL, set bottom border to 2 'set-setting avi-bottom-border 2'
3872 \end_layout
3874 \begin_layout Enumerate
3875 Enable dumping 'dump-avi 12 tmpdump' (note: Normally 10 and above are 
3876 \begin_inset Quotes eld
3877 \end_inset
3879 use only if you know what you are doing.
3880 \begin_inset Quotes erd
3881 \end_inset
3884  In this case, these can be safely used because of how x264 internally works.
3885 \end_layout
3887 \begin_layout Enumerate
3888 Unpause and let it run until you want to end dumping.
3889 \end_layout
3891 \begin_layout Enumerate
3892 Close the emulator (closing the window is the easiest way)
3893 \end_layout
3895 \begin_layout Enumerate
3896 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
3897  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
3898 \end_layout
3900 \begin_layout Enumerate
3901 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
3902 \end_layout
3904 \begin_layout Enumerate
3905 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
3906  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
3907 \end_layout
3909 \begin_layout Enumerate
3910 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
3911  Now final.mkv contains quick'n'dirty encode.
3912 \end_layout
3914 \begin_layout Section
3915 Axis configurations for some gamepad types:
3916 \end_layout
3918 \begin_layout Subsection
3919 XBox360 controller:
3920 \end_layout
3922 \begin_layout Standard
3923 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
3924 \end_layout
3926 \begin_layout LyX-Code
3927 set-axis joystick0axis2 pressure-+
3928 \end_layout
3930 \begin_layout LyX-Code
3931 set-axis joystick0axis5 pressure-+
3932 \end_layout
3934 \begin_layout Subsection
3935 PS3 
3936 \begin_inset Quotes eld
3937 \end_inset
3939 sixaxis
3940 \begin_inset Quotes erd
3941 \end_inset
3943  controller:
3944 \end_layout
3946 \begin_layout Standard
3947 Axes 8-19 should be disabled.
3948 \end_layout
3950 \begin_layout LyX-Code
3951 set-axis joystick0axis8 disabled
3952 \end_layout
3954 \begin_layout LyX-Code
3955 set-axis joystick0axis9 disabled
3956 \end_layout
3958 \begin_layout LyX-Code
3959 set-axis joystick0axis10 disabled
3960 \end_layout
3962 \begin_layout LyX-Code
3963 set-axis joystick0axis11 disabled
3964 \end_layout
3966 \begin_layout LyX-Code
3967 set-axis joystick0axis12 disabled
3968 \end_layout
3970 \begin_layout LyX-Code
3971 set-axis joystick0axis13 disabled
3972 \end_layout
3974 \begin_layout LyX-Code
3975 set-axis joystick0axis14 disabled
3976 \end_layout
3978 \begin_layout LyX-Code
3979 set-axis joystick0axis15 disabled
3980 \end_layout
3982 \begin_layout LyX-Code
3983 set-axis joystick0axis16 disabled
3984 \end_layout
3986 \begin_layout LyX-Code
3987 set-axis joystick0axis17 disabled
3988 \end_layout
3990 \begin_layout LyX-Code
3991 set-axis joystick0axis18 disabled
3992 \end_layout
3994 \begin_layout LyX-Code
3995 set-axis joystick0axis19 disabled
3996 \end_layout
3998 \begin_layout Section
3999 Errata:
4000 \end_layout
4002 \begin_layout Subsection
4003 Problems from BSNES core:
4004 \end_layout
4006 \begin_layout Itemize
4007 The whole pending save stuff.
4008 \end_layout
4010 \begin_layout Itemize
4011 Delay resets are slow.
4012 \end_layout
4014 \begin_layout Itemize
4015 RTC is not emulated in sync-stable manner.
4016 \end_layout
4018 \begin_layout Itemize
4019 Lack of layer hiding.
4020 \end_layout
4022 \begin_layout Itemize
4023 It is slow.
4024 \end_layout
4026 \begin_layout Itemize
4027 Firmwares can't be loaded from ZIP archives.
4028 \end_layout
4030 \begin_layout Itemize
4031 Manual polls can be corrupted if savestate occurs during those.
4032 \end_layout
4034 \begin_layout Subsection
4035 Other problems:
4036 \end_layout
4038 \begin_layout Itemize
4039 Modifiers don't work with pseudo-keys (SDL).
4040 \end_layout
4042 \begin_layout Itemize
4043 Audio for last dumped frame is not itself dumped.
4044 \end_layout
4046 \begin_layout Itemize
4047 Audio in UI is pretty bad in quality.
4048 \end_layout
4050 \begin_layout Itemize
4051 UI itself is 30fps max.
4052 \end_layout
4054 \begin_layout Itemize
4055 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
4056 \end_layout
4058 \begin_layout Itemize
4059 No menus, command based interface (SDL).
4060 \end_layout
4062 \begin_layout Itemize
4063 Long commands don't scroll.
4064 \end_layout
4066 \begin_layout Itemize
4067 The SDL screen drawing is slow.
4068 \end_layout
4070 \begin_layout Section
4071 Changelog:
4072 \end_layout
4074 \begin_layout Subsection
4075 rr0-beta1
4076 \end_layout
4078 \begin_layout Itemize
4079 Fix -Wall warnings
4080 \end_layout
4082 \begin_layout Itemize
4083 Fix dumper video corruption with levels 10-18.
4084 \end_layout
4086 \begin_layout Subsection
4087 rr0-beta2
4088 \end_layout
4090 \begin_layout Itemize
4091 Autofire
4092 \end_layout
4094 \begin_layout Itemize
4095 Lots of code cleanups
4096 \end_layout
4098 \begin_layout Itemize
4099 Lua interface to settings
4100 \end_layout
4102 \begin_layout Itemize
4103 Allow specifying AVI borders without Lua
4104 \end_layout
4106 \begin_layout Itemize
4107 Fix scaling if vscale > 1 and originx > 0 (left border exists)
4108 \end_layout
4110 \begin_layout Itemize
4111 on_snoop lua callback
4112 \end_layout
4114 \begin_layout Itemize
4115 Faster movie loading and saving.
4116 \end_layout
4118 \begin_layout Subsection
4119 rr0-beta3
4120 \end_layout
4122 \begin_layout Itemize
4123 Joystick support
4124 \end_layout
4126 \begin_layout Subsection
4127 rr0-beta4
4128 \end_layout
4130 \begin_layout Itemize
4131 Fix multi-buttons
4132 \end_layout
4134 \begin_layout Itemize
4135 Save jukebox functionality.
4136 \end_layout
4138 \begin_layout Subsection
4139 rr0-beta5
4140 \end_layout
4142 \begin_layout Itemize
4143 Try to fix some nasty failing movie load edge cases
4144 \end_layout
4146 \begin_layout Itemize
4147 Allow specifying scripts to run on command line.
4148 \end_layout
4150 \begin_layout Subsection
4151 rr0-beta6
4152 \end_layout
4154 \begin_layout Itemize
4155 Major source code reorganization.
4156 \end_layout
4158 \begin_layout Itemize
4159 Backup savestates before overwriting.
4160 \end_layout
4162 \begin_layout Itemize
4163 Don't crash if loading initial state fails.
4164 \end_layout
4166 \begin_layout Subsection
4167 rr0-beta7
4168 \end_layout
4170 \begin_layout Itemize
4171 Fix firmware lookup
4172 \end_layout
4174 \begin_layout Itemize
4175 Fix author name parsing
4176 \end_layout
4178 \begin_layout Itemize
4179 Fix rerecord counting
4180 \end_layout
4182 \begin_layout Itemize
4183 (SDL) Print messages to console if SDL is uninitialized
4184 \end_layout
4186 \begin_layout Itemize
4187 Add movieinfo program
4188 \end_layout
4190 \begin_layout Itemize
4191 Fix loading movies starting from SRAM.
4192 \end_layout
4194 \begin_layout Subsection
4195 rr0-beta8
4196 \end_layout
4198 \begin_layout Itemize
4199 Add support for unattended dumping
4200 \end_layout
4202 \begin_layout Itemize
4203 Fix compiling for Win32
4204 \end_layout
4206 \begin_layout Itemize
4207 Don't lock up if sound can't be initialized
4208 \end_layout
4210 \begin_layout Itemize
4211 Strip trailing CR from commands
4212 \end_layout
4214 \begin_layout Itemize
4215 Don't try to do dubious things in global ctors (fix crash on startup)
4216 \end_layout
4218 \begin_layout Subsection
4219 rr0-beta9
4220 \end_layout
4222 \begin_layout Itemize
4223 Small documentation tweaking
4224 \end_layout
4226 \begin_layout Itemize
4227 Fix make clean
4228 \end_layout
4230 \begin_layout Itemize
4231 Fix major bug in modifier matching
4232 \end_layout
4234 \begin_layout Subsection
4235 rr0-beta10
4236 \end_layout
4238 \begin_layout Itemize
4239 Lots of documentation fixes
4240 \end_layout
4242 \begin_layout Itemize
4243 Use dedicated callbacks for event backcomm., not commands.
4244 \end_layout
4246 \begin_layout Itemize
4247 Ensure that the watchdog is not hit when executing delayed reset.
4248 \end_layout
4250 \begin_layout Itemize
4251 Remove errant tab from joystick message.
4252 \end_layout
4254 \begin_layout Subsection
4255 rr0-beta11
4256 \end_layout
4258 \begin_layout Itemize
4259 Make autofire operate in absolute time, not linear time
4260 \end_layout
4262 \begin_layout Itemize
4263 Reinitialize controls when resuming from loadstate
4264 \end_layout
4266 \begin_layout Itemize
4267 Some more code cleanups
4268 \end_layout
4270 \begin_layout Itemize
4271 If Lua allocator fails, call OOM_panic()
4272 \end_layout
4274 \begin_layout Itemize
4275 Byte/word/dword/qword sized host memory write/read functions.
4276 \end_layout
4278 \begin_layout Itemize
4279 Dump at correct framerate if dumping interlaced NTSC (height=448).
4280 \end_layout
4282 \begin_layout Subsection
4283 rr0-beta12
4284 \end_layout
4286 \begin_layout Itemize
4287 Actually include the complete source code
4288 \end_layout
4290 \begin_layout Itemize
4291 Keep track of RTC
4292 \end_layout
4294 \begin_layout Subsection
4295 rr0-beta13
4296 \end_layout
4298 \begin_layout Itemize
4299 Document {save,start}time.{,sub}second.
4300 \end_layout
4302 \begin_layout Itemize
4303 Intercept time() from bsnes core.
4304 \end_layout
4306 \begin_layout Subsection
4307 rr0-beta14
4308 \end_layout
4310 \begin_layout Itemize
4311 Allow disabling time() interception (allow build on Mac OS X)
4312 \end_layout
4314 \begin_layout Itemize
4315 Use SDLMain on Mac OS X (make SDL not crash)
4316 \end_layout
4318 \begin_layout Itemize
4319 Disable delayed resets (just plain too buggy for now).
4320 \end_layout
4322 \begin_layout Itemize
4323 Code cleanups
4324 \end_layout
4326 \begin_layout Itemize
4327 Use 16-bit for graphics/video instead of 32-bit.
4328 \end_layout
4330 \begin_layout Itemize
4331 gui.rectangle/gui.pixel
4332 \end_layout
4334 \begin_layout Itemize
4335 gui.crosshair
4336 \end_layout
4338 \begin_layout Itemize
4339 New CSCD writer implementation.
4340 \end_layout
4342 \begin_layout Subsection
4343 rr0-beta15
4344 \end_layout
4346 \begin_layout Itemize
4347 Fix interaction of * and +.
4348 \end_layout
4350 \begin_layout Itemize
4351 Manual improvements
4352 \end_layout
4354 \begin_layout Itemize
4355 Use gettimeofday()/usleep(), these seem portable enough.
4356 \end_layout
4358 \begin_layout Itemize
4359 Move joystick axis manipulation to keymapper code.
4360 \end_layout
4362 \begin_layout Itemize
4363 Changes to how read-only works.
4364 \end_layout
4366 \begin_layout Itemize
4367 Refactor controller input code.
4368 \end_layout
4370 \begin_layout Subsection
4371 rr0-beta16
4372 \end_layout
4374 \begin_layout Itemize
4375 Fix mouseclick scale compensation.
4376 \end_layout
4378 \begin_layout Itemize
4379 Draw area boundaries correctly in SDL code.
4380 \end_layout
4382 \begin_layout Itemize
4383 gui.screenshot.
4384 \end_layout
4386 \begin_layout Itemize
4387 Fix CSCD output (buffer overrun and race condition).
4388 \end_layout
4390 \begin_layout Subsection
4391 rr0-beta17
4392 \end_layout
4394 \begin_layout Itemize
4395 JMD dumping support.
4396 \end_layout
4398 \begin_layout Itemize
4399 Allow unattended dumping to JMD.
4400 \end_layout
4402 \begin_layout Itemize
4403 Move to BSNES v083.
4404 \end_layout
4406 \begin_layout Itemize
4407 Switch back to 32-bit colors.
4408 \end_layout
4410 \begin_layout Itemize
4411 Add Lua function gui.color.
4412 \end_layout
4414 \begin_layout Itemize
4415 Use some new C++11 features in GCC 4.6.
4416 \end_layout
4418 \begin_layout Itemize
4419 Be prepared for core frequency changes.
4420 \end_layout
4422 \begin_layout Itemize
4423 Pass colors in one chunk from Lua.
4424 \end_layout
4426 \end_body
4427 \end_document