Update manuals for changes
[lsnes.git] / manual.lyx
blobdcc190f16e211ba9e60c776c4584138e66d1fafa
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass article
6 \use_default_options true
7 \maintain_unincluded_children false
8 \language finnish
9 \language_package default
10 \inputencoding auto
11 \fontencoding global
12 \font_roman default
13 \font_sans default
14 \font_typewriter default
15 \font_default_family default
16 \use_non_tex_fonts false
17 \font_sc false
18 \font_osf false
19 \font_sf_scale 100
20 \font_tt_scale 100
22 \graphics default
23 \default_output_format default
24 \output_sync 0
25 \bibtex_command default
26 \index_command default
27 \paperfontsize default
28 \use_hyperref false
29 \papersize default
30 \use_geometry false
31 \use_amsmath 1
32 \use_esint 1
33 \use_mhchem 1
34 \use_mathdots 1
35 \cite_engine basic
36 \use_bibtopic false
37 \use_indices false
38 \paperorientation portrait
39 \suppress_date false
40 \use_refstyle 1
41 \index Hakusana
42 \shortcut idx
43 \color #008000
44 \end_index
45 \secnumdepth 3
46 \tocdepth 3
47 \paragraph_separation indent
48 \paragraph_indentation default
49 \quotes_language english
50 \papercolumns 1
51 \papersides 1
52 \paperpagestyle default
53 \tracking_changes false
54 \output_changes false
55 \html_math_output 0
56 \html_css_as_file 0
57 \html_be_strict false
58 \end_header
60 \begin_body
62 \begin_layout Section
63 Introduction
64 \end_layout
66 \begin_layout Standard
67 lsnes is SNES rerecording emulator based on bsnes core.
68 \end_layout
70 \begin_layout Section
71 Dependencies
72 \end_layout
74 \begin_layout Enumerate
75 bsnes libsnes
76 \end_layout
78 \begin_deeper
79 \begin_layout Enumerate
80 v084 or 085
81 \end_layout
83 \begin_layout Enumerate
84 accuracy or compatiblity core.
85 \end_layout
87 \begin_layout Enumerate
88 Patched version (using included 6 patches)
89 \end_layout
91 \end_deeper
92 \begin_layout Enumerate
93 Zlib
94 \end_layout
96 \begin_layout Enumerate
97 boost_iostreams
98 \end_layout
100 \begin_layout Enumerate
101 boost_filesystem
102 \end_layout
104 \begin_layout Enumerate
105 boost_thread
106 \end_layout
108 \begin_layout Enumerate
109 libsdl (SDL only)
110 \end_layout
112 \begin_layout Enumerate
113 sdlmain (SDL only, part of SDL)
114 \end_layout
116 \begin_layout Enumerate
117 boost_conversion (this is header-only library)
118 \end_layout
120 \begin_layout Enumerate
121 libswscale (wxwidgets graphics only)
122 \end_layout
124 \begin_layout Enumerate
125 Portaudio (portaudio sound only)
126 \end_layout
128 \begin_layout Enumerate
129 std::thread and co (for threaded dumper only, not needed if std::thread
130  is available)
131 \end_layout
133 \begin_layout Enumerate
134 Lua (if Lua support is needed).
135 \end_layout
137 \begin_layout Itemize
138 Version 5.1.X or 5.2X.
139 \end_layout
141 \begin_layout Section
142 Building
143 \end_layout
145 \begin_layout Standard
146 Building is via makefile, the following options are available:
147 \end_layout
149 \begin_layout Itemize
150 CROSS_PREFIX=<prefix>
151 \end_layout
153 \begin_deeper
154 \begin_layout Itemize
155 Prefix to apply to commands when building executables / object files for
156  the target architecture.
158 \end_layout
160 \begin_layout Itemize
161 Default is blank.
162 \end_layout
164 \end_deeper
165 \begin_layout Itemize
166 CC=<name>
167 \end_layout
169 \begin_deeper
170 \begin_layout Itemize
171 Name of C++ compiler.
172 \end_layout
174 \begin_layout Itemize
175 CROSS_PREFIX is prepended if compiling for target architecture.
176 \end_layout
178 \begin_layout Itemize
179 This needs to be at least GCC 4.6.
180 \end_layout
182 \begin_layout Itemize
183 Set to 'g++-mp-4.6' if compiling on Mac OS X using GCC 4.6 from Macports.
184 \end_layout
186 \begin_layout Itemize
187 Default is 'g++'.
188 \end_layout
190 \end_deeper
191 \begin_layout Itemize
192 HOSTCC=<name>
193 \end_layout
195 \begin_deeper
196 \begin_layout Itemize
197 Name of host C++ compiler.
198 \end_layout
200 \begin_layout Itemize
201 Default is value of 'CC' option.
202 \end_layout
204 \end_deeper
205 \begin_layout Itemize
206 USER_HOSTCCFLAGS=<flags>:
207 \end_layout
209 \begin_deeper
210 \begin_layout Itemize
211 Compiler flags to pass when compiling/linking for host architecture.
212 \end_layout
214 \begin_layout Itemize
215 Default is blank.
216 \end_layout
218 \end_deeper
219 \begin_layout Itemize
220 USER_CFLAGS=<flags>
221 \end_layout
223 \begin_deeper
224 \begin_layout Itemize
225 Extra flags to pass when compiling for target architecture
226 \end_layout
228 \begin_layout Itemize
229 Default is blank.
230 \end_layout
232 \end_deeper
233 \begin_layout Itemize
234 USER_LDFLAGS=<flags>: 
235 \end_layout
237 \begin_deeper
238 \begin_layout Itemize
239 Extra flags to pass when linking for target architecture.
240 \end_layout
242 \begin_layout Itemize
243 Default is blank.
244 \end_layout
246 \end_deeper
247 \begin_layout Itemize
248 USER_PLATFORM_CFLAGS=<flags>
249 \end_layout
251 \begin_deeper
252 \begin_layout Itemize
253 Extra flags to pass when compiling files using platform-dependent code for
254  target architecture.
255 \end_layout
257 \begin_layout Itemize
258 Default is blank.
259 \end_layout
261 \end_deeper
262 \begin_layout Itemize
263 USER_PLATFORM_LDFLAGS=<flags>
264 \end_layout
266 \begin_deeper
267 \begin_layout Itemize
268 Extra flags to pass when linking files using platform-dependent code for
269  target architecture.
270 \end_layout
272 \begin_layout Itemize
273 Default is blank.
274 \end_layout
276 \end_deeper
277 \begin_layout Itemize
278 FONT_SRC=<file>
279 \end_layout
281 \begin_deeper
282 \begin_layout Itemize
283 Set the font file to use.
284 \end_layout
286 \begin_layout Itemize
287 Currently the valid values are:
288 \end_layout
290 \begin_deeper
291 \begin_layout Itemize
292 cp437.hex: Standard VGA font (256 characters).
293 \end_layout
295 \begin_layout Itemize
296 unifontfull-5.1.20080820.hex: GNU unifont (covers most of Unicode BMP)
297 \end_layout
299 \end_deeper
300 \begin_layout Itemize
301 Default is 'unifontfull-5.1.20080820.hex'
302 \end_layout
304 \end_deeper
305 \begin_layout Itemize
306 LUA=<package>
307 \end_layout
309 \begin_deeper
310 \begin_layout Itemize
311 Package to use for Lua support.
312 \end_layout
314 \begin_layout Itemize
315 Usually valid value is 'lua' or 'lua5.1'.
316 \end_layout
318 \begin_layout Itemize
319 Default is not to build Lua support.
320 \end_layout
322 \end_deeper
323 \begin_layout Itemize
324 THREADS=<value>
325 \end_layout
327 \begin_deeper
328 \begin_layout Itemize
329 Override platform default for dumper threading support.
330 \end_layout
332 \begin_layout Itemize
333 Threading is default on Linux.
334 \end_layout
336 \begin_layout Itemize
337 'YES' tries to use threading (std::thread).
338 \end_layout
340 \begin_layout Itemize
341 'BOOST' tries to use threading (boost::thread).
342 \end_layout
344 \begin_layout Itemize
345 'NO' disables threading.
346 \end_layout
348 \begin_layout Itemize
349 Note: This has absolutely nothing to do with platform threading.
350 \end_layout
352 \end_deeper
353 \begin_layout Itemize
354 BSNES_IS_COMPAT=<anything>
355 \end_layout
357 \begin_deeper
358 \begin_layout Itemize
359 Signals that BSNES core used is compatiblity core, not accuracy core.
360 \end_layout
362 \begin_layout Itemize
363 Default is to assume accuracy core.
364 \end_layout
366 \end_deeper
367 \begin_layout Itemize
368 JOYSTICK=<implementation>
369 \end_layout
371 \begin_deeper
372 \begin_layout Itemize
373 Set joystick implementation.
374  Valid values are:
375 \end_layout
377 \begin_deeper
378 \begin_layout Itemize
379 SDL: Use SDL for joystick (requires SDL graphics)
380 \end_layout
382 \begin_layout Itemize
383 EVDEV: Use EVDEV for joystick (Linux only).
384 \end_layout
386 \begin_layout Itemize
387 DUMMY: Disable joystick support.
388 \end_layout
390 \end_deeper
391 \begin_layout Itemize
392 Default is SDL.
393 \end_layout
395 \end_deeper
396 \begin_layout Itemize
397 SOUND=<implementation>
398 \end_layout
400 \begin_deeper
401 \begin_layout Itemize
402 Set sound implementation.
403  Valid values are:
404 \end_layout
406 \begin_deeper
407 \begin_layout Itemize
408 SDL: Use SDL for sound (requires SDL graphics)
409 \end_layout
411 \begin_layout Itemize
412 PORTAUDIO: Use Portaudio for sound.
413 \end_layout
415 \begin_layout Itemize
416 DUMMY: Disable sound support
417 \end_layout
419 \end_deeper
420 \begin_layout Itemize
421 Default is SDL.
422 \end_layout
424 \end_deeper
425 \begin_layout Itemize
426 GRAPHICS=<implementation>
427 \end_layout
429 \begin_deeper
430 \begin_layout Itemize
431 Set windowing library to use.
432  Valid values are:
433 \end_layout
435 \begin_deeper
436 \begin_layout Itemize
437 SDL: Use SDL for graphics
438 \end_layout
440 \begin_layout Itemize
441 WXWIDGETS: Use wxWidgets for graphics.
442 \end_layout
444 \end_deeper
445 \begin_layout Itemize
446 Default is SDL.
447 \end_layout
449 \end_deeper
450 \begin_layout Section
451 Command line options
452 \end_layout
454 \begin_layout Subsection
455 ROM options
456 \end_layout
458 \begin_layout Standard
459 <kind> in the following can be one of:
460 \end_layout
462 \begin_layout Itemize
463 rom: Cartridge ROM (BIOS for special carts).
464  This is required.
465 \end_layout
467 \begin_layout Itemize
468 bsx: BS-X (non-slotted) Game flash ROM.
469 \end_layout
471 \begin_layout Itemize
472 bsxslotted: BS-X (slotted) Game flash ROM.
473 \end_layout
475 \begin_layout Itemize
476 dmg: DMG game ROM
477 \end_layout
479 \begin_layout Itemize
480 slot-a: Sufami Turbo Slot A ROM
481 \end_layout
483 \begin_layout Itemize
484 slot-b: Sufami Turbo Slot B ROM
485 \end_layout
487 \begin_layout Subsubsection
488 --<kind>=<file> (lsnes/SDL, lsnes-avidump)
489 \end_layout
491 \begin_layout Standard
492 Load <file> as specified ROM (SFC/BS/DMG/ST file format).
493 \end_layout
495 \begin_layout Subsubsection
496 --<kind>-xml=<file> (lsnes/SDL, lsnes-avidump)
497 \end_layout
499 \begin_layout Standard
500 Override hardware detection for ROM, reading the values from <file> (BSNES
501  XML format).
502 \end_layout
504 \begin_layout Subsubsection
505 --ips-<kind>=<file> (lsnes/SDL, lsnes-avidump)
506 \end_layout
508 \begin_layout Standard
509 Apply BPS/IPS patch <file> to ROM <kind>.
510  If specified multiple times, the patches are applied in order.
511 \end_layout
513 \begin_layout Subsubsection
514 --ips-<kind>-xml=<file> (lsnes/SDL, lsnes-avidump)
515 \end_layout
517 \begin_layout Standard
518 Apply BPS/IPS patch <file> to XML of ROM <kind>.
519  If specified multiple times, the patches are applied in order.
520 \end_layout
522 \begin_layout Subsubsection
523 --ips-offset=<offset> (lsnes/SDL, lsnes-avidump)
524 \end_layout
526 \begin_layout Standard
527 Set offset to apply to IPS patches.
528  May be negative.
529  Handy for applying headered IPS patches (use offset of -512 for this).
530  The offset must be 0 for BPS patches.
531 \end_layout
533 \begin_layout Subsubsection
534 --pal
535 \end_layout
537 \begin_layout Standard
538 Force ROM to be considered PAL-only.
539 \end_layout
541 \begin_layout Itemize
542 Only works on SNES and SGB ROMs (not BS-X or Sufami Turbo).
543 \end_layout
545 \begin_layout Itemize
546 Attempting to load NTSC movie file will error out.
547 \end_layout
549 \begin_layout Subsubsection
550 --ntsc
551 \end_layout
553 \begin_layout Standard
554 Force ROM to be considered NTSC-only.
555 \end_layout
557 \begin_layout Itemize
558 Attempting to load PAL movie file will error out.
559 \end_layout
561 \begin_layout Subsection
562 Session options
563 \end_layout
565 \begin_layout Subsubsection
566 <filename> (lsnes/SDL, lsnes-avidump, movieinfo)
567 \end_layout
569 \begin_layout Standard
570 Load <filename> as movie or savestate file.
571  All other session options are ignored.
572 \end_layout
574 \begin_layout Subsubsection
575 --port1=<device> (lsnes/SDL)
576 \end_layout
578 \begin_layout Standard
579 Set type of port1.
580  Valid values are:
581 \end_layout
583 \begin_layout Itemize
584 none: No device connected
585 \end_layout
587 \begin_layout Itemize
588 gamepad: One gamepad (the default)
589 \end_layout
591 \begin_layout Itemize
592 multitap: Four gamepads (warning: makes most games refuse to start)
593 \end_layout
595 \begin_layout Itemize
596 mouse: Mouse.
597 \end_layout
599 \begin_layout Subsubsection
600 --port2=<type> (lsnes/SDL)
601 \end_layout
603 \begin_layout Standard
604 Set type of port2.
605  Valid values are:
606 \end_layout
608 \begin_layout Itemize
609 none: No device connected (the default)
610 \end_layout
612 \begin_layout Itemize
613 gamepad: One gamepad
614 \end_layout
616 \begin_layout Itemize
617 multitap: Four gamepads.
618 \end_layout
620 \begin_layout Itemize
621 mouse: Mouse
622 \end_layout
624 \begin_layout Itemize
625 superscope: Super Scope
626 \end_layout
628 \begin_layout Itemize
629 justifier: One justifier
630 \end_layout
632 \begin_layout Itemize
633 justifiers: Two justifiers
634 \end_layout
636 \begin_layout Subsubsection
637 --gamename=<name> (lsnes/SDL)
638 \end_layout
640 \begin_layout Standard
641 Set the name of game to <name>.
642  Default is blank.
643 \end_layout
645 \begin_layout Subsubsection
646 --author=<name> (lsnes/SDL)
647 \end_layout
649 \begin_layout Standard
650 Add author with full name of <name> (no nickname).
651 \end_layout
653 \begin_layout Subsubsection
654 --author=|<name> (lsnes/SDL)
655 \end_layout
657 \begin_layout Standard
658 Add author with nickname of <name> (no full name).
659 \end_layout
661 \begin_layout Subsubsection
662 --author=<fullname>|<nickname> (lsnes/SDL)
663 \end_layout
665 \begin_layout Standard
666 Add author with full name of <fullname> and nickname of <nickname>.
667 \end_layout
669 \begin_layout Subsubsection
670 --rtc-second=<value> (lsnes/SDL)
671 \end_layout
673 \begin_layout Standard
674 Set RTC second (0 is 1st January 1970 00:00:00Z).
675  Default is 1,000,000,000.
676 \end_layout
678 \begin_layout Subsubsection
679 --rtc-subsecond=<value> (lsnes/SDL)
680 \end_layout
682 \begin_layout Standard
683 Set RTC subsecond.
684  Range is 0-.
685  Unit is CPU cycle.
686  Default is 0.
687 \end_layout
689 \begin_layout Subsection
690 Misc.
691  options:
692 \end_layout
694 \begin_layout Subsubsection
695 --run=<file> (lsnes/SDL)
696 \end_layout
698 \begin_layout Standard
699 After running main RC file, run this file.
700  If multiple are specified, these execute in order specified.
701 \end_layout
703 \begin_layout Subsection
704 dump options (lsnes-dumpavi only)
705 \end_layout
707 \begin_layout Subsubsection
708 --dumper=<dumper>
709 \end_layout
711 \begin_layout Standard
712 Set the dumper to use (required).
713  Use 'list' for listing of known dumpers.
714 \end_layout
716 \begin_layout Subsubsection
717 --mode=<mode>
718 \end_layout
720 \begin_layout Standard
721 Set the mode to use (required for dumpers with multiple modes, forbidden
722  otherwise).
723  Use 'list' for known modes.
724 \end_layout
726 \begin_layout Subsubsection
727 --prefix=<prefix>
728 \end_layout
730 \begin_layout Standard
731 Set dump prefix.
732  Default is 
733 \begin_inset Quotes eld
734 \end_inset
736 avidump
737 \begin_inset Quotes erd
738 \end_inset
741 \end_layout
743 \begin_layout Subsubsection
744 --option=<name>=<value>
745 \end_layout
747 \begin_layout Standard
748 Set option <name> to value <value>.
749 \end_layout
751 \begin_layout Subsubsection
752 --length=<length>
753 \end_layout
755 \begin_layout Standard
756 Set number of frames to dump.
757  Mandatory.
758 \end_layout
760 \begin_layout Subsubsection
761 --lua=<script>
762 \end_layout
764 \begin_layout Standard
765 Run specified lua script (lsnes-dumpavi does not have initialization files).
766 \end_layout
768 \begin_layout Section
769 Startup file lsnes.rc
770 \end_layout
772 \begin_layout Standard
773 Upon startup, lsnes (lsnes/SDL only) executes file lsnes.rc as commands.
774  This file is located in:
775 \end_layout
777 \begin_layout Itemize
778 Windows: %APPDATA%
779 \backslash
780 lsnes
781 \backslash
782 lsnes.rc (if %APPDATA% exists)
783 \end_layout
785 \begin_layout Itemize
786 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
787 \end_layout
789 \begin_layout Itemize
790 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
791 \end_layout
793 \begin_layout Itemize
794 All: ./lsnes.rc (fallback default).
795 \end_layout
797 \begin_layout Standard
798 If leading directories do not exist, attempt to create them is made.
799 \end_layout
801 \begin_layout Section
802 Internal commands
803 \end_layout
805 \begin_layout Itemize
806 Commands beginning with '*' invoke the corresponding command without alias
807  expansion.
808 \end_layout
810 \begin_layout Itemize
811 If command starts with '+' (after possible '*'), the command is executed
812  as-is when button is pressed, and when button is released, it is executed
813  with '+' replaced by '-'.
814 \end_layout
816 \begin_layout Itemize
817 Commands without '+' execute only on negative edge (release).
818 \end_layout
820 \begin_layout Subsection
821 Settings:
822 \end_layout
824 \begin_layout Standard
825 Settings control various aspects of emulator behaviour.
826 \end_layout
828 \begin_layout Subsubsection
829 set-setting <setting> <value>
830 \end_layout
832 \begin_layout Standard
833 Sets setting <setting> to value <value> (may be empty).
834 \end_layout
836 \begin_layout Subsubsection
837 unset-setting <setting>
838 \end_layout
840 \begin_layout Standard
841 Try to unset setting <setting> (not all settings can be unset).
842 \end_layout
844 \begin_layout Subsubsection
845 get-setting <setting>
846 \end_layout
848 \begin_layout Standard
849 Read value of setting <setting>
850 \end_layout
852 \begin_layout Subsubsection
853 show-settings
854 \end_layout
856 \begin_layout Standard
857 Print names and values of all settings.
858 \end_layout
860 \begin_layout Subsection
861 Keybindings
862 \end_layout
864 \begin_layout Standard
865 Keybindings bind commands or aliases to keys (or pseudo-keys).
867 \end_layout
869 \begin_layout Standard
870 Notes:
871 \end_layout
873 \begin_layout Itemize
874 Do not bind edge active (+/-) commands to keys with modifiers, that won't
875  work right!
876 \end_layout
878 \begin_layout Itemize
879 Names of keys and modifiers are platform-dependent.
880 \end_layout
882 \begin_layout Itemize
883 Be careful before binding pseudo-keys (such as joystick axes, buttons or
884  hats) with modifiers.
885  That may or may not work right.
886 \end_layout
888 \begin_layout Subsubsection
889 bind-key [<mod>/<modmask>] <key> <command>
890 \end_layout
892 \begin_layout Standard
893 Bind <command> to key <key> (activating if modifiers in <modmask> (comma-seperat
894 ed list) are set as <mod> (comma-seperated list).
895 \end_layout
897 \begin_layout Standard
898 The names of keys and modifiers are platform-dependent.
899 \end_layout
901 \begin_layout Subsubsection
902 unbind-key [<mod>/<modmask>] <key>
903 \end_layout
905 \begin_layout Standard
906 Unbind command from <key> (with specified <mod> and <modmask>).
907 \end_layout
909 \begin_layout Subsubsection
910 set-axis <axis> [disabled | axis | axis-inverse | pressure0- | pressure0+
911  | pressure-0 | pressure-+ | pressure+0 | pressure+-] [minus=<val>] [zero=<val>]
912  [plus=<val>] [tolerance=<val>]
913 \end_layout
915 \begin_layout Standard
916 Set axis parameters for axis <axis>.
917 \end_layout
919 \begin_layout Itemize
920 disabled: Disable axis
921 \end_layout
923 \begin_layout Itemize
924 axis: Normal axis
925 \end_layout
927 \begin_layout Itemize
928 axis-inverse: Inverse axis
929 \end_layout
931 \begin_layout Itemize
932 pressure0-: Pressure sensitive.
933  Released at 0, pressed at -.
934 \end_layout
936 \begin_layout Itemize
937 pressure0+: Pressure sensitive.
938  Released at 0, pressed at +.
939 \end_layout
941 \begin_layout Itemize
942 pressure-0: Pressure sensitive.
943  Released at -, pressed at 0.
944 \end_layout
946 \begin_layout Itemize
947 pressure-+: Pressure sensitive.
948  Released at -, pressed at +.
949 \end_layout
951 \begin_layout Itemize
952 pressure+0: Pressure sensitive.
953  Released at +, pressed at 0.
954 \end_layout
956 \begin_layout Itemize
957 pressure+-: Pressure sensitive.
958  Released at +, pressed at -.
959 \end_layout
961 \begin_layout Itemize
962 minus=<val>: Calibration at extreme minus position (-32768-32767)
963 \end_layout
965 \begin_layout Itemize
966 zero=<val>: Calibration at neutral position (-32768-32767)
967 \end_layout
969 \begin_layout Itemize
970 plus=<val>: Calibration at extreme plus position (-32768-32767)
971 \end_layout
973 \begin_layout Itemize
974 tolerance=<value>: Center band tolerance (0<x<1).
975  The smaller the value, the more sensitive the control is.
976 \end_layout
978 \begin_layout Subsubsection
979 show-bindings
980 \end_layout
982 \begin_layout Standard
983 Print all key bindings in effect.
984 \end_layout
986 \begin_layout Subsection
987 Aliases
988 \end_layout
990 \begin_layout Standard
991 Aliases bind command to sequence of commands.
992  After alias has been defined, it replaces the command it shadows.
993 \end_layout
995 \begin_layout Standard
996 Notes:
997 \end_layout
999 \begin_layout Itemize
1000 You can't alias command to itself.
1001 \end_layout
1003 \begin_layout Itemize
1004 Aliases starting with +/- are edge active just like ordinary commands starting
1005  with +/-.
1006 \end_layout
1008 \begin_layout Itemize
1009 One command can be aliased to multiple commands.
1010 \end_layout
1012 \begin_layout Subsubsection
1013 alias-command <command> <expansion>
1014 \end_layout
1016 \begin_layout Standard
1017 Append <expansion> to alias <command>.
1018  If alias does not already exist, it is created.
1019 \end_layout
1021 \begin_layout Subsubsection
1022 unalias-command <command>
1023 \end_layout
1025 \begin_layout Standard
1026 Clear alias expansion for <command>.
1027 \end_layout
1029 \begin_layout Subsubsection
1030 show-aliases
1031 \end_layout
1033 \begin_layout Standard
1034 Print all aliases and their expansions in effect.
1035 \end_layout
1037 \begin_layout Subsection
1038 run-script <script>
1039 \end_layout
1041 \begin_layout Standard
1042 Run <script> as if commands were entered on the command line.
1043 \end_layout
1045 \begin_layout Subsection
1046 Video dumping
1047 \end_layout
1049 \begin_layout Standard
1050 Following commands control video dumping:
1051 \end_layout
1053 \begin_layout Subsubsection
1054 dump-avi <prefix>
1055 \end_layout
1057 \begin_layout Standard
1058 Dump AVI video to prefix <prefix> Notes:
1059 \end_layout
1061 \begin_layout Itemize
1062 The codec is Camstudio Codec in gzip mode.
1063 \end_layout
1065 \begin_layout Itemize
1066 Encoder and muxer are internal, available on all platforms.
1067 \end_layout
1069 \begin_layout Itemize
1070 Audio enable/disable and framerate has no effect.
1071 \end_layout
1073 \begin_layout Itemize
1074 The audio dumped to .avi is low-quality version.
1075  The high-quality version is dumped to .sox file.
1076 \end_layout
1078 \begin_layout Subsubsection
1079 end-avi
1080 \end_layout
1082 \begin_layout Standard
1083 End current AVI video dump (closing the emulator also closes the dump).
1084 \end_layout
1086 \begin_layout Subsubsection
1087 dump-jmd <file>
1088 \end_layout
1090 \begin_layout Standard
1091 Dump JMD video to file <file>.
1092 \end_layout
1094 \begin_layout Subsubsection
1095 end-jmd
1096 \end_layout
1098 \begin_layout Standard
1099 End the current JMD dump in progress.
1100 \end_layout
1102 \begin_layout Subsubsection
1103 dump-sdmp <prefix>
1104 \end_layout
1106 \begin_layout Standard
1107 Dump SDMP to <prefix>, splitting at 2GB.
1108 \end_layout
1110 \begin_layout Subsubsection
1111 dump-sdmp-ss <file>
1112 \end_layout
1114 \begin_layout Standard
1115 Dump SDMP to <file>, no splitting
1116 \end_layout
1118 \begin_layout Subsubsection
1119 end-sdmp
1120 \end_layout
1122 \begin_layout Standard
1123 End the current SDMP dump in progress.
1124 \end_layout
1126 \begin_layout Subsubsection
1127 dump-raw <prefix>
1128 \end_layout
1130 \begin_layout Standard
1131 Dump raw audio (to <prefix>.audio, at 32040.5Hz) and video (to <prefix>.video>,
1132  at nominal framerate and 512x448 / 512x478 size).
1133 \end_layout
1135 \begin_layout Subsubsection
1136 end-raw
1137 \end_layout
1139 \begin_layout Standard
1140 End the current RAW dump in progress.
1141 \end_layout
1143 \begin_layout Subsection
1144 Memory manipulation
1145 \end_layout
1147 \begin_layout Standard
1148 <address> may be decimal or hexadecimal (prefixed with '0x').
1149  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
1150  with '-') decimal.
1151 \end_layout
1153 \begin_layout Standard
1154 The available element <sizes> are:
1155 \end_layout
1157 \begin_layout Itemize
1158 byte: 1 byte
1159 \end_layout
1161 \begin_layout Itemize
1162 word: 2 bytes
1163 \end_layout
1165 \begin_layout Itemize
1166 dword: 4 bytes
1167 \end_layout
1169 \begin_layout Itemize
1170 qword: 8 bytes
1171 \end_layout
1173 \begin_layout Standard
1174 When reading RAM and ROM, multi-byte reads/writes are big-endian.
1175  When dealing with DSP memory, multi-byte reads/writes are native-endian
1176  (do not use operand sizes exceeding DSP bitness, except dword is OK for
1177  24-bit memory).
1178 \end_layout
1180 \begin_layout Subsubsection
1181 read-<size> <address>
1182 \end_layout
1184 \begin_layout Standard
1185 Read the value of byte in <address>.
1186 \end_layout
1188 \begin_layout Subsubsection
1189 read-s<size> <address>
1190 \end_layout
1192 \begin_layout Standard
1193 Read the value of signed byte in <address>.
1194 \end_layout
1196 \begin_layout Subsubsection
1197 write-<size> <address> <value>
1198 \end_layout
1200 \begin_layout Standard
1201 Write <value> to byte in address <address>.
1202 \end_layout
1204 \begin_layout Subsubsection
1205 search-memory reset
1206 \end_layout
1208 \begin_layout Standard
1209 Reset the memory search
1210 \end_layout
1212 \begin_layout Subsubsection
1213 search-memory count
1214 \end_layout
1216 \begin_layout Standard
1217 Print number of candidates remaining
1218 \end_layout
1220 \begin_layout Subsubsection
1221 search-memory print
1222 \end_layout
1224 \begin_layout Standard
1225 Print all candidates remaining
1226 \end_layout
1228 \begin_layout Subsubsection
1229 search-memory <usflag><sizeflag><op>
1230 \end_layout
1232 \begin_layout Standard
1233 Searches memory for addresses satisfying criteria.
1234 \end_layout
1236 \begin_layout Standard
1237 <usflag> can be:
1238 \end_layout
1240 \begin_layout Itemize
1241 u: unsigned
1242 \end_layout
1244 \begin_layout Itemize
1245 s: signed
1246 \end_layout
1248 \begin_layout Standard
1249 <sizeflag> can be:
1250 \end_layout
1252 \begin_layout Itemize
1253 b: byte
1254 \end_layout
1256 \begin_layout Itemize
1257 w: word
1258 \end_layout
1260 \begin_layout Itemize
1261 d: dword
1262 \end_layout
1264 \begin_layout Itemize
1265 q: qword
1266 \end_layout
1268 \begin_layout Standard
1269 <op> can be:
1270 \end_layout
1272 \begin_layout Itemize
1273 lt: < previous value.
1274 \end_layout
1276 \begin_layout Itemize
1277 le: <= previous value.
1278 \end_layout
1280 \begin_layout Itemize
1281 eq: = previous value.
1282 \end_layout
1284 \begin_layout Itemize
1285 ne: != previous value.
1286 \end_layout
1288 \begin_layout Itemize
1289 ge: >= previous value.
1290 \end_layout
1292 \begin_layout Itemize
1293 gt: > previous value.
1294 \end_layout
1296 \begin_layout Subsubsection
1297 search-memory <sizeflag> <value>
1298 \end_layout
1300 \begin_layout Standard
1301 Searches for addresses that currently have value <value>.
1302  <sizeflag> is as in previous command.
1303 \end_layout
1305 \begin_layout Subsection
1306 Main commands
1307 \end_layout
1309 \begin_layout Standard
1310 These commands are not available in lsnesrc, but are available after ROM
1311  has been loaded.
1312 \end_layout
1314 \begin_layout Subsubsection
1315 quit-emulator [/y]
1316 \end_layout
1318 \begin_layout Standard
1319 Quits the emulator (asking for confirmation).
1320  If /y is given, no confirmation is asked.
1321 \end_layout
1323 \begin_layout Subsubsection
1324 pause-emulator
1325 \end_layout
1327 \begin_layout Standard
1328 Toggle paused/unpaused
1329 \end_layout
1331 \begin_layout Subsubsection
1332 +advance-frame 
1333 \end_layout
1335 \begin_layout Standard
1336 Advance frame.
1337  If the button is still held after configurable timeout expires, game unpauses
1338  for the duration frame advance is held.
1339 \end_layout
1341 \begin_layout Subsubsection
1342 +advance-poll 
1343 \end_layout
1345 \begin_layout Standard
1346 Advance subframe.
1347  If the button is still held after configurable timeout expires, game unpauses
1348  for the duration frame advance is held.
1349 \end_layout
1351 \begin_layout Subsubsection
1352 advance-skiplag 
1353 \end_layout
1355 \begin_layout Standard
1356 Skip to first poll in frame after current.
1357 \end_layout
1359 \begin_layout Subsubsection
1360 reset 
1361 \end_layout
1363 \begin_layout Standard
1364 Reset the SNES after this frame.
1365 \end_layout
1367 \begin_layout Subsubsection
1368 load <filename> 
1369 \end_layout
1371 \begin_layout Standard
1372 Load savestate <filename> in current mode.
1373 \end_layout
1375 \begin_layout Subsubsection
1376 load-state <filename> 
1377 \end_layout
1379 \begin_layout Standard
1380 Load savestate <filename> in readwrite mode.
1381 \end_layout
1383 \begin_layout Subsubsection
1384 load-readonly <filename> 
1385 \end_layout
1387 \begin_layout Standard
1388 Load savestate <filename> in readonly mode.
1389 \end_layout
1391 \begin_layout Subsubsection
1392 load-preserve <filename> 
1393 \end_layout
1395 \begin_layout Standard
1396 Load savestate <filename> in readonly mode, preserving current events.
1397 \end_layout
1399 \begin_layout Subsubsection
1400 load-movie <filename> 
1401 \end_layout
1403 \begin_layout Standard
1404 Load savestate <filename>, ignoring save part in readonly mode.
1405 \end_layout
1407 \begin_layout Subsubsection
1408 save-state <filename> 
1409 \end_layout
1411 \begin_layout Standard
1412 Save system state to <filename> as soon as possible.
1413 \end_layout
1415 \begin_layout Subsubsection
1416 save-movie <filename> 
1417 \end_layout
1419 \begin_layout Standard
1420 Save movie to <filename>.
1421 \end_layout
1423 \begin_layout Subsubsection
1424 set-rwmode 
1425 \end_layout
1427 \begin_layout Standard
1428 Set read-write mode.
1429 \end_layout
1431 \begin_layout Subsubsection
1432 set-romode 
1433 \end_layout
1435 \begin_layout Standard
1436 Set read-only mode
1437 \end_layout
1439 \begin_layout Subsubsection
1440 toggle-rwmode 
1441 \end_layout
1443 \begin_layout Standard
1444 Toggle between read-only and read-write modes.
1445 \end_layout
1447 \begin_layout Subsubsection
1448 set-gamename <name> 
1449 \end_layout
1451 \begin_layout Standard
1452 Set name of the game to <name>
1453 \end_layout
1455 \begin_layout Subsubsection
1456 get-gamename 
1457 \end_layout
1459 \begin_layout Standard
1460 Print the name of the game.
1461 \end_layout
1463 \begin_layout Subsubsection
1464 add-author <author> 
1465 \end_layout
1467 \begin_layout Standard
1468 Adds new author <author>.
1469  If <author> does not contain '|' it is full name.
1470  If it contains '|', '|' splits the full name and nickname.
1471 \end_layout
1473 \begin_layout Subsubsection
1474 edit-author <num> <author> 
1475 \end_layout
1477 \begin_layout Standard
1478 Edit the author in slot <num> (0-based) to be <author> (see add-author for
1479  format)
1480 \end_layout
1482 \begin_layout Subsubsection
1483 remove-author <num> 
1484 \end_layout
1486 \begin_layout Standard
1487 Remove author in slot <num>
1488 \end_layout
1490 \begin_layout Subsubsection
1491 print-authors 
1492 \end_layout
1494 \begin_layout Standard
1495 Print authors.
1496 \end_layout
1498 \begin_layout Subsubsection
1499 test-1, test-2, test-3
1500 \end_layout
1502 \begin_layout Standard
1503 Internal test commands.
1504  Don't use.
1505 \end_layout
1507 \begin_layout Subsubsection
1508 take-screenshot <filename> 
1509 \end_layout
1511 \begin_layout Standard
1512 Save screenshot to <filename>.
1513 \end_layout
1515 \begin_layout Subsubsection
1516 +controller<num><button>
1517 \end_layout
1519 \begin_layout Standard
1520 Press button <button> on controller <num> (1-8).
1521  The following button names are known:
1522 \end_layout
1524 \begin_layout Itemize
1525 left
1526 \end_layout
1528 \begin_layout Itemize
1529 right
1530 \end_layout
1532 \begin_layout Itemize
1534 \end_layout
1536 \begin_layout Itemize
1537 down
1538 \end_layout
1540 \begin_layout Itemize
1542 \end_layout
1544 \begin_layout Itemize
1546 \end_layout
1548 \begin_layout Itemize
1550 \end_layout
1552 \begin_layout Itemize
1554 \end_layout
1556 \begin_layout Itemize
1558 \end_layout
1560 \begin_layout Itemize
1562 \end_layout
1564 \begin_layout Itemize
1565 select
1566 \end_layout
1568 \begin_layout Itemize
1569 start
1570 \end_layout
1572 \begin_layout Itemize
1573 trigger
1574 \end_layout
1576 \begin_layout Itemize
1577 cursor
1578 \end_layout
1580 \begin_layout Itemize
1581 pause
1582 \end_layout
1584 \begin_layout Itemize
1585 turbo
1586 \end_layout
1588 \begin_layout Subsubsection
1589 controllerh<num><button>
1590 \end_layout
1592 \begin_layout Standard
1593 Hold/unhold button <button> on controller <num> (1-8).
1594  See +controller for button names.
1595 \end_layout
1597 \begin_layout Subsubsection
1598 autofire (<pattern>|-)...
1599 \end_layout
1601 \begin_layout Standard
1602 Set autofire pattern.
1603  Each parameter is comma-separated list of button names (in form of 1start,
1604  1A, 2B, etc..) to hold on that frame.
1605  After reaching the end of pattern, the pattern restarts from the beginning.
1606 \end_layout
1608 \begin_layout Subsubsection
1609 repaint
1610 \end_layout
1612 \begin_layout Standard
1613 Force a repaint.
1614 \end_layout
1616 \begin_layout Subsection
1617 Save jukebox 
1618 \end_layout
1620 \begin_layout Subsubsection
1621 cycle-jukebox-backward
1622 \end_layout
1624 \begin_layout Standard
1625 Cycle save jukebox backwards.
1626 \end_layout
1628 \begin_layout Subsubsection
1629 cycle-jukebox-forward
1630 \end_layout
1632 \begin_layout Standard
1633 Cycle save jukebox forwards
1634 \end_layout
1636 \begin_layout Subsubsection
1637 add-jukebox-save <filename>
1638 \end_layout
1640 \begin_layout Standard
1641 Add <filename> to jukebox saves.
1642 \end_layout
1644 \begin_layout Subsubsection
1645 load-jukebox
1646 \end_layout
1648 \begin_layout Standard
1649 Do load from jukebox (current mode).
1650 \end_layout
1652 \begin_layout Subsubsection
1653 save-jukebox
1654 \end_layout
1656 \begin_layout Standard
1657 Do state save to jukebox.
1658 \end_layout
1660 \begin_layout Subsection
1661 Lua 
1662 \end_layout
1664 \begin_layout Standard
1665 Only available if lua support is compiled in.
1666 \end_layout
1668 \begin_layout Subsubsection
1669 evaluate-lua <luacode>
1670 \end_layout
1672 \begin_layout Standard
1673 Run Lua code <luacode> using built-in Lua interpretter.
1674 \end_layout
1676 \begin_layout Subsubsection
1677 run-lua <script>
1678 \end_layout
1680 \begin_layout Standard
1681 Run specified lua file using built-in Lua interpretter.
1682 \end_layout
1684 \begin_layout Subsection
1685 Memory watch
1686 \end_layout
1688 \begin_layout Subsubsection
1689 add-watch <name> <expression>
1690 \end_layout
1692 \begin_layout Standard
1693 Adds new watch (or modifies old one).
1694 \end_layout
1696 \begin_layout Subsubsection
1697 remove-watch <name>
1698 \end_layout
1700 \begin_layout Standard
1701 Remove a watch.
1702 \end_layout
1704 \begin_layout Subsection
1705 Sound 
1706 \end_layout
1708 \begin_layout Subsubsection
1709 enable-sound <on/off> 
1710 \end_layout
1712 \begin_layout Standard
1713 Enable/Disable sound.
1714 \end_layout
1716 \begin_layout Subsubsection
1717 set-sound-device <device> 
1718 \end_layout
1720 \begin_layout Standard
1721 Set sound device to <device>
1722 \end_layout
1724 \begin_layout Subsubsection
1725 show-sound-status 
1726 \end_layout
1728 \begin_layout Standard
1729 Show status of sound system.
1730 \end_layout
1732 \begin_layout Subsubsection
1733 show-sound-devices
1734 \end_layout
1736 \begin_layout Standard
1737 Show all available devices.
1738 \end_layout
1740 \begin_layout Subsection
1741 SDL Platform commands 
1742 \end_layout
1744 \begin_layout Standard
1745 The following are valid on SDL platform.
1746 \end_layout
1748 \begin_layout Subsubsection
1749 identify-key
1750 \end_layout
1752 \begin_layout Standard
1753 Asks to press a key and then identifies that (pseudo-)key.
1754 \end_layout
1756 \begin_layout Subsubsection
1757 toggle-console 
1758 \end_layout
1760 \begin_layout Standard
1761 Toggle between windowed/fullscreen console.
1762 \end_layout
1764 \begin_layout Subsubsection
1765 scroll-fullup 
1766 \end_layout
1768 \begin_layout Standard
1769 Scroll messages window as far back as it goes.
1770 \end_layout
1772 \begin_layout Subsubsection
1773 scroll-fulldown 
1774 \end_layout
1776 \begin_layout Standard
1777 Scroll messages window as far forward as it goes.
1778 \end_layout
1780 \begin_layout Subsubsection
1781 scroll-up 
1782 \end_layout
1784 \begin_layout Standard
1785 Scroll messages window back one screenful.
1786 \end_layout
1788 \begin_layout Subsubsection
1789 scroll-down 
1790 \end_layout
1792 \begin_layout Standard
1793 Scroll messages window forward one screenful.
1794 \end_layout
1796 \begin_layout Section
1797 Settings
1798 \end_layout
1800 \begin_layout Subsection
1801 Core settings
1802 \end_layout
1804 \begin_layout Subsubsection
1805 firmwarepath
1806 \end_layout
1808 \begin_layout Standard
1809 Set where bsnes looks for firmware files.
1810  Default is 
1811 \begin_inset Quotes eld
1812 \end_inset
1815 \begin_inset Quotes erd
1816 \end_inset
1819 \end_layout
1821 \begin_layout Subsubsection
1822 targetfps
1823 \end_layout
1825 \begin_layout Standard
1826 Set the target fps.
1827  Numeric, range is 0.001 to 
1828 \begin_inset Quotes eld
1829 \end_inset
1831 infinite
1832 \begin_inset Quotes erd
1833 \end_inset
1836  Default is native framerate.
1837 \end_layout
1839 \begin_layout Subsubsection
1840 savecompression
1841 \end_layout
1843 \begin_layout Standard
1844 Set save compression level (integer 0-9).
1845  Default is 7 (0 is no compression).
1846 \end_layout
1848 \begin_layout Subsubsection
1849 advance-timeout
1850 \end_layout
1852 \begin_layout Standard
1853 Set the frame advance timeout in milliseconds.
1854  Numeric integer, range is 0-999999999.
1855  Default is 500.
1856 \end_layout
1858 \begin_layout Subsection
1859 AVI dumper settings
1860 \end_layout
1862 \begin_layout Subsubsection
1863 avi-large
1864 \end_layout
1866 \begin_layout Standard
1867 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1868  outputs.
1869 \end_layout
1871 \begin_layout Subsubsection
1872 avi-left-border
1873 \end_layout
1875 \begin_layout Standard
1876 AVI dumper: Set the default left border thickness (unless lua overrides)
1877  for dumps.
1878  Range 0-8191.
1879  Default is 0.
1880 \end_layout
1882 \begin_layout Subsubsection
1883 avi-right-border
1884 \end_layout
1886 \begin_layout Standard
1887 AVI dumper: Set the default right border thickness (unless lua overrides)
1888  for dumps.
1889  Range 0-8191.
1890  Default is 0.
1891 \end_layout
1893 \begin_layout Subsubsection
1894 avi-top-border
1895 \end_layout
1897 \begin_layout Standard
1898 AVI dumper: Set the default top border thickness (unless lua overrides)
1899  for dumps.
1900  Range 0-8191.
1901  Default is 0.
1902 \end_layout
1904 \begin_layout Subsubsection
1905 avi-bottom-border
1906 \end_layout
1908 \begin_layout Standard
1909 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1910  for dumps.
1911  Range 0-8191.
1912  Default is 0.
1913 \end_layout
1915 \begin_layout Subsubsection
1916 avi-maxframes
1917 \end_layout
1919 \begin_layout Standard
1920 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1921  Range 0-999999999.
1922  Default is 0.
1923 \end_layout
1925 \begin_layout Subsubsection
1926 avi-compresison
1927 \end_layout
1929 \begin_layout Standard
1930 AVI dumper: Compression level (0-18).
1931 \end_layout
1933 \begin_layout Itemize
1934 Compression levels 10 and above are not compatible with stock CSCD codec.
1935 \end_layout
1937 \begin_layout Itemize
1938 Recomended level is 7.
1939 \end_layout
1941 \begin_layout Subsubsection
1942 avi-soundrate
1943 \end_layout
1945 \begin_layout Standard
1946 AVI dumper: Set method of determining the sound rate.
1947 \end_layout
1949 \begin_layout Itemize
1950 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1951  128, 176.4 and 192 kHz.
1952 \end_layout
1954 \begin_layout Itemize
1955 1: Round down to nearest integer.
1956 \end_layout
1958 \begin_layout Itemize
1959 2: Round up to nearest ingeter.
1960 \end_layout
1962 \begin_layout Subsection
1963 JMD options
1964 \end_layout
1966 \begin_layout Subsubsection
1967 jmd-copression
1968 \end_layout
1970 \begin_layout Standard
1971 JMD dumper: Compression level (0-9).
1972 \end_layout
1974 \begin_layout Subsection
1975 SDL platform settings
1976 \end_layout
1978 \begin_layout Subsubsection
1979 autorepeat-first-delay
1980 \end_layout
1982 \begin_layout Standard
1983 Sets the delay for first character in typematic autorepeat.
1984 \end_layout
1986 \begin_layout Subsubsection
1987 autorepeat-subsequent-delay
1988 \end_layout
1990 \begin_layout Standard
1991 Sets the delay for subsequent characters in typematic autorepeat.
1992 \end_layout
1994 \begin_layout Section
1995 Lua functions
1996 \end_layout
1998 \begin_layout Subsection
1999 Core (in main table)
2000 \end_layout
2002 \begin_layout Subsubsection
2003 print
2004 \end_layout
2006 \begin_layout Standard
2007 Print line to message console.
2008 \end_layout
2010 \begin_layout Subsubsection
2011 exec(string command)
2012 \end_layout
2014 \begin_layout Standard
2015 Run command as it was entered on the command line
2016 \end_layout
2018 \begin_layout Subsubsection
2019 utime()
2020 \end_layout
2022 \begin_layout Standard
2023 Returns two values.
2024  First is time since some epoch in seconds, the second is microseconds mod
2025  10^6 since that epoch.
2026 \end_layout
2028 \begin_layout Subsubsection
2029 emulator_ready()
2030 \end_layout
2032 \begin_layout Standard
2033 Returns true if emulator has finished booting, false if not (on_startup()
2034  will be issued later).
2035 \end_layout
2037 \begin_layout Subsection
2038 Table bit:
2039 \end_layout
2041 \begin_layout Standard
2042 Bitwise logical functions and related.
2043 \end_layout
2045 \begin_layout Subsubsection
2046 bit.none(number...) / bit.bnot(number...)
2047 \end_layout
2049 \begin_layout Standard
2050 48-bit bitwise NOT / NONE function (set bits that are set in none of the
2051  arguments).
2052 \end_layout
2054 \begin_layout Subsubsection
2055 bit.any(number...) / bit.bor(number...)
2056 \end_layout
2058 \begin_layout Standard
2059 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
2060 \end_layout
2062 \begin_layout Subsubsection
2063 bit.all(number...) / bit.band(number...)
2064 \end_layout
2066 \begin_layout Standard
2067 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
2069 \end_layout
2071 \begin_layout Subsubsection
2072 bit.parity(number...) / bit.bxor(number...)
2073 \end_layout
2075 \begin_layout Standard
2076 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
2077  of the arguments).
2078 \end_layout
2080 \begin_layout Subsubsection
2081 bit.lrotate(number base[, number amount[, number bits]])
2082 \end_layout
2084 \begin_layout Standard
2085 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
2086 \end_layout
2088 \begin_layout Subsubsection
2089 bit.rrotate(number base[, number amount[, number bits]])
2090 \end_layout
2092 \begin_layout Standard
2093 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
2094  places.
2095 \end_layout
2097 \begin_layout Subsubsection
2098 bit.lshift(number base[, number amount[, number bits]])
2099 \end_layout
2101 \begin_layout Standard
2102 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
2103  The new bits are filled with zeroes.
2104 \end_layout
2106 \begin_layout Subsubsection
2107 bit.lrshift(number base[, number amount[, number bits]])
2108 \end_layout
2110 \begin_layout Standard
2111 Shift bits-bit (max 48, default 48) number logically right by amount (default
2112  1) places.
2113  The new bits are filled with zeroes.
2114 \end_layout
2116 \begin_layout Subsubsection
2117 bit.arshift(number base[, number amount[, number bits]])
2118 \end_layout
2120 \begin_layout Standard
2121 Shift bits-bit (max 48, default 48) number arithmetically right by amount
2122  (default 1) places.
2123  The new bits are shifted in with copy of the high bit.
2124 \end_layout
2126 \begin_layout Subsection
2127 Table gui:
2128 \end_layout
2130 \begin_layout Standard
2131 Most of these functions can only be called in on_paint and on_video callbacks.
2132  Exceptions are noted.
2133 \end_layout
2135 \begin_layout Standard
2136 Colors are 32-bit.
2137  Bits 0-7 are the blue component, bits 8-15 are the green component, bits
2138  16-23 are the red component, bits 24-31 are alpha component (0 is fully
2139  opaque, 255 is almost transparent).
2140  -1 is the fully transparent color.
2141  Alpha values greater than 127 do work.
2142 \end_layout
2144 \begin_layout Standard
2145 Origin of coordinates is at top left corner of game display area.
2146  Left and top gaps correspond to negative coordinates.
2147 \end_layout
2149 \begin_layout Subsubsection
2150 gui.resolution()
2151 \end_layout
2153 \begin_layout Standard
2154 Returns 2-tuple (hresolution, vresolution).
2155 \end_layout
2157 \begin_layout Subsubsection
2158 gui.<class>_gap(number gap)
2159 \end_layout
2161 \begin_layout Standard
2162 Set the <class> (left, right, top, bottom) gap to specified value (max gap
2163  is 8191).
2164 \end_layout
2166 \begin_layout Subsubsection
2167 gui.text(number x, number y, string text[, number fgc[, number bgc]])
2168 \end_layout
2170 \begin_layout Standard
2171 Draw specified text on the GUI (each character cell is 8 or 16 wide and
2172  16 high).
2173  Parameters:
2174 \end_layout
2176 \begin_layout Itemize
2177 x: X-coordinate to start the drawing from (and x-coordinate at begining
2178  of the lines).
2179 \end_layout
2181 \begin_layout Itemize
2182 y: Y-coordinate to start the drawing from.
2183 \end_layout
2185 \begin_layout Itemize
2186 text: The text to draw.
2187 \end_layout
2189 \begin_layout Itemize
2190 fgc: Text color (default is 0xFFFFFF (white))
2191 \end_layout
2193 \begin_layout Itemize
2194 bgc: Background color (default is -1 (transparent))
2195 \end_layout
2197 \begin_layout Subsubsection
2198 gui.textH(number x, number y, string text[, number fgc[, number bgc]])
2199 \end_layout
2201 \begin_layout Standard
2202 Like gui.text, but draw using double-width.
2203 \end_layout
2205 \begin_layout Subsubsection
2206 gui.textV(number x, number y, string text[, number fgc[, number bgc]])
2207 \end_layout
2209 \begin_layout Standard
2210 Like gui.text, but draw using double-height.
2211 \end_layout
2213 \begin_layout Subsubsection
2214 gui.textHV(number x, number y, string text[, number fgc[, number bgc]])
2215 \end_layout
2217 \begin_layout Standard
2218 Like gui.text, but draw using double-width/double-height.
2219 \end_layout
2221 \begin_layout Subsubsection
2222 gui.rectangle(number x, number y, number width, number height[, number thickness[
2223 , number outline[, number fill]]])
2224 \end_layout
2226 \begin_layout Standard
2227 Draw rectangle on the GUI.
2228  Parameters:
2229 \end_layout
2231 \begin_layout Itemize
2232 x: X-coordinate of left edge.
2233 \end_layout
2235 \begin_layout Itemize
2236 y: Y-coordinate of upper edge.
2237 \end_layout
2239 \begin_layout Itemize
2240 width: Width of rectangle.
2241 \end_layout
2243 \begin_layout Itemize
2244 height: Height of rectangle.
2245 \end_layout
2247 \begin_layout Itemize
2248 thickness: Thickness of outline (default is 1).
2249 \end_layout
2251 \begin_layout Itemize
2252 outline: Color of outline (default is 0xFFFFFF (white))
2253 \end_layout
2255 \begin_layout Itemize
2256 fill: Color of fil (default is -1 (transparent))
2257 \end_layout
2259 \begin_layout Subsubsection
2260 gui.pixel(number x, number y[, number color])
2261 \end_layout
2263 \begin_layout Standard
2264 Draw one pixel on the GUI.
2265  Parameters:
2266 \end_layout
2268 \begin_layout Itemize
2269 x: X-coordinate of the pixel
2270 \end_layout
2272 \begin_layout Itemize
2273 y: Y-coordinate of the pixel
2274 \end_layout
2276 \begin_layout Itemize
2277 color: Color of the pixel (default is 0xFFFFFF (white))
2278 \end_layout
2280 \begin_layout Subsubsection
2281 gui.crosshair(number x, number y[, number length[, number color]])
2282 \end_layout
2284 \begin_layout Standard
2285 Draw a crosshair.
2286  Parameters:
2287 \end_layout
2289 \begin_layout Itemize
2290 x: X-coordinate of the crosshair
2291 \end_layout
2293 \begin_layout Itemize
2294 y: Y-coordinate of the crosshair
2295 \end_layout
2297 \begin_layout Itemize
2298 length: Length of the crosshair lines (default 10).
2299 \end_layout
2301 \begin_layout Itemize
2302 color: Color of the crosshair (default is 0xFFFFFF (white))
2303 \end_layout
2305 \begin_layout Subsubsection
2306 gui.line(number x1, number y1, number x2, number y2[, number color])
2307 \end_layout
2309 \begin_layout Standard
2310 Draw a thin line.
2311  Parameters:
2312 \end_layout
2314 \begin_layout Itemize
2315 x1: X-coordinate of one end.
2316 \end_layout
2318 \begin_layout Itemize
2319 y1: Y-coordinate of one end.
2320 \end_layout
2322 \begin_layout Itemize
2323 x2: X-coordinate of the other end.
2324 \end_layout
2326 \begin_layout Itemize
2327 y2: Y-coordinate of the other end.
2328 \end_layout
2330 \begin_layout Itemize
2331 color: Color of the line (default is 0xFFFFFF (white)).
2332 \end_layout
2334 \begin_layout Subsubsection
2335 gui.circle(number x, number y, number r[, number thick[, number border[,
2336  number fil]]])
2337 \end_layout
2339 \begin_layout Standard
2340 Draw a circle.
2341  Parameters.
2342 \end_layout
2344 \begin_layout Itemize
2345 x: X-coordinate of the center
2346 \end_layout
2348 \begin_layout Itemize
2349 y: Y-coordinate of the center
2350 \end_layout
2352 \begin_layout Itemize
2353 r: The radius of the circle
2354 \end_layout
2356 \begin_layout Itemize
2357 thick: Border thickness
2358 \end_layout
2360 \begin_layout Itemize
2361 border: Border color (default is 0xFFFFFF (white))
2362 \end_layout
2364 \begin_layout Itemize
2365 fill: Fill color (default is -1 (transparent)).
2366 \end_layout
2368 \begin_layout Subsubsection
2369 gui.bitmap_draw(number x, number y, bitmap bitmap, palette palette)
2370 \end_layout
2372 \begin_layout Standard
2373 Draw a bitmap on screen with specified palette.
2374  Parameters:
2375 \end_layout
2377 \begin_layout Itemize
2378 x: X-coordinate of left edge.
2379 \end_layout
2381 \begin_layout Itemize
2382 y: Y-coordinate of top edge.
2383 \end_layout
2385 \begin_layout Itemize
2386 bitmap: The bitmap to draw
2387 \end_layout
2389 \begin_layout Itemize
2390 palette: The palette to draw the bitmap using.
2391 \end_layout
2393 \begin_layout Subsubsection
2394 gui.bitmap_draw(number x, number y, dbitmap bitmap)
2395 \end_layout
2397 \begin_layout Standard
2398 Draw a bitmap on screen.
2399  Parameters:
2400 \end_layout
2402 \begin_layout Itemize
2403 x: X-coordinate of left edge.
2404 \end_layout
2406 \begin_layout Itemize
2407 y: Y-coordinate of top edge.
2408 \end_layout
2410 \begin_layout Itemize
2411 bitmap: The bitmap to draw
2412 \end_layout
2414 \begin_layout Subsubsection
2415 gui.palette_new()
2416 \end_layout
2418 \begin_layout Standard
2419 Returns a new palette (initially all transparent).
2420  Can be used anywhere.
2421 \end_layout
2423 \begin_layout Subsubsection
2424 gui.bitmap_new(number w, number h, boolean direct)
2425 \end_layout
2427 \begin_layout Standard
2428 Returns a new bitmap/dbitmap.
2429  Can be used anywhere.
2430  Parameters:
2431 \end_layout
2433 \begin_layout Itemize
2434 w: The width of new bitmap
2435 \end_layout
2437 \begin_layout Itemize
2438 h: The height of new bitmap
2439 \end_layout
2441 \begin_layout Itemize
2442 direct: If true, the returned bitmap is dbitmap, otherwise bitmap.
2443 \end_layout
2445 \begin_layout Subsubsection
2446 gui.bitmap_load(string file)
2447 \end_layout
2449 \begin_layout Standard
2450 Returns loaded bitmap/dbitmap (if bitmap, the second return value is palette
2451  for bitmap).
2452  Can be used anywhere.
2453  Parameters:
2454 \end_layout
2456 \begin_layout Itemize
2457 file: The name of file to load.
2458 \end_layout
2460 \begin_layout Subsubsection
2461 gui.palette_set(palette palette, number index, number color)
2462 \end_layout
2464 \begin_layout Standard
2465 Sets color in palette.
2466  Can be used anywhere.
2467  Parameters:
2468 \end_layout
2470 \begin_layout Itemize
2471 palette: The palette to manipulate
2472 \end_layout
2474 \begin_layout Itemize
2475 index: Index of color (0-65535).
2476 \end_layout
2478 \begin_layout Itemize
2479 color: The color value.
2480 \end_layout
2482 \begin_layout Subsubsection
2483 gui.bitmap_pset(bitmap/dbitmap bitmap, number x, number y, number color)
2484 \end_layout
2486 \begin_layout Standard
2487 Sets specified pixel in bitmap.
2488  Can be used anywhere.
2489  Parameters:
2490 \end_layout
2492 \begin_layout Itemize
2493 bitmap: The bitmap to manipulate
2494 \end_layout
2496 \begin_layout Itemize
2497 x: The x-coordinate of the pixel.
2498 \end_layout
2500 \begin_layout Itemize
2501 y: The y-coordinate of the pixel.
2502 \end_layout
2504 \begin_layout Itemize
2505 color: If bitmap is a bitmap, color index (0-65535).
2506  Otherwise color value.
2507 \end_layout
2509 \begin_layout Subsubsection
2510 gui.bitmap_size(bitmap/dbitmap bitmap)
2511 \end_layout
2513 \begin_layout Standard
2514 Get size of bitmap.
2515  Can be used anywhere.
2516  Parameters:
2517 \end_layout
2519 \begin_layout Itemize
2520 bitmap: The bitmap to query.
2521 \end_layout
2523 \begin_layout Standard
2524 The first return is the width, the second is the height.
2525 \end_layout
2527 \begin_layout Subsubsection
2528 gui.bitmap_blit(bitmap/dbitmap dest, number dx, number dy, bitmap/dbitmap
2529  src, number sx, number sy, number w, number h[, number ck])
2530 \end_layout
2532 \begin_layout Standard
2533 Blit a part of bitmap to another.
2534  Can be used anywhere.
2535  Parameters:
2536 \end_layout
2538 \begin_layout Itemize
2539 dest: Destination to blit to.
2540 \end_layout
2542 \begin_layout Itemize
2543 dx: left edge of target
2544 \end_layout
2546 \begin_layout Itemize
2547 dy: Top edge of target
2548 \end_layout
2550 \begin_layout Itemize
2551 src: The source to blit from.
2552  Must be of the same type as destination.
2553 \end_layout
2555 \begin_layout Itemize
2556 sx: left edge of source
2557 \end_layout
2559 \begin_layout Itemize
2560 sy: Top edge of source
2561 \end_layout
2563 \begin_layout Itemize
2564 w: Width of region
2565 \end_layout
2567 \begin_layout Itemize
2568 h: Height of region.
2569 \end_layout
2571 \begin_layout Itemize
2572 ck: Color key.
2573  Pixels of this color are not blitted.
2574 \end_layout
2576 \begin_deeper
2577 \begin_layout Itemize
2578 If bitmaps are bitmaps, this is color index of colorkey.
2579  Values outside range 0-65535 cause no key to be used as colorkey.
2580 \end_layout
2582 \begin_layout Itemize
2583 If bitmaps are dbitmaps, this color value of colorkey.
2584 \end_layout
2586 \begin_layout Itemize
2587 May be absent or nil for no colorkey blit.
2588 \end_layout
2590 \end_deeper
2591 \begin_layout Subsubsection
2592 gui.repaint()
2593 \end_layout
2595 \begin_layout Standard
2596 Request on_repaint() to happen as soon as possible.
2597  Can be used anywhere.
2598 \end_layout
2600 \begin_layout Subsubsection
2601 gui.subframe_update(boolean on)
2602 \end_layout
2604 \begin_layout Standard
2605 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
2606  or not happen (on=false).
2607  Can be used anywhere.
2608 \end_layout
2610 \begin_layout Subsubsection
2611 gui.screenshot(string filename)
2612 \end_layout
2614 \begin_layout Standard
2615 Write PNG screenshot of the current frame (no drawings) to specified file.
2616  Can be used anywhere.
2617 \end_layout
2619 \begin_layout Subsubsection
2620 gui.color(number r, number g, number b[, number a])
2621 \end_layout
2623 \begin_layout Standard
2624 Returns color (in notation Lua scripts use) corresponding to color (r,g,b),
2625  each component in scale 0-255.
2626  If a is specified, that is alpha (0 is fully transparent, 256(sic) is fully
2627  opaque).
2628  The default alpha is 256.
2629 \end_layout
2631 \begin_layout Subsubsection
2632 gui.status(string name, string value)
2633 \end_layout
2635 \begin_layout Standard
2636 Set status field 
2637 \begin_inset Quotes eld
2638 \end_inset
2640 L[<name>]
2641 \begin_inset Quotes erd
2642 \end_inset
2644  to <value> in status area.
2645  Can be used anywhere.
2646 \end_layout
2648 \begin_layout Subsection
2649 table input
2650 \end_layout
2652 \begin_layout Standard
2653 Input handling.
2654  Only available in on_input callback.
2655 \end_layout
2657 \begin_layout Subsubsection
2658 input.get(number controller, number index)
2659 \end_layout
2661 \begin_layout Standard
2662 Read the specified index (0-11) from specified controller (0-7).
2663  Notes:
2664 \end_layout
2666 \begin_layout Itemize
2667 Uses physical controller numbering.
2668  Gamepad in port 2 is controller 4, not 1!
2669 \end_layout
2671 \begin_layout Subsubsection
2672 input.set(number controller, number index, number value)
2673 \end_layout
2675 \begin_layout Standard
2676 Write the specified index (0-11) from specified controller (0-7), storing
2677  value.
2678  Notes:
2679 \end_layout
2681 \begin_layout Itemize
2682 Uses physical controller numbering.
2683  Gamepad in port 2 is controller 4, not 1!
2684 \end_layout
2686 \begin_layout Subsubsection
2687 input.reset([number cycles])
2688 \end_layout
2690 \begin_layout Standard
2691 Execute reset.
2692  If cycles is greater than zero, do delayed reset.
2693  0 (or no value) causes immediate reset.
2694 \end_layout
2696 \begin_layout Itemize
2697 Only available with subframe flag false.
2698 \end_layout
2700 \begin_layout Subsubsection
2701 input.raw()
2702 \end_layout
2704 \begin_layout Standard
2705 Returns table of tables of all available keys and axes.
2706  The first table is indexed by key name (platform-dependent!), and the inner
2707  table has the following fields:
2708 \end_layout
2710 \begin_layout Itemize
2711 last_rawval: Last reported raw value for control.
2712 \end_layout
2714 \begin_layout Itemize
2715 ktype: Type of key (disabled, key, mouse, axis, axis-inverse, hat, pressure-m0,
2716  pressure-mp, pressure-0m, pressure-0p, pressure-pm, pressure-p0).
2717 \end_layout
2719 \begin_layout Itemize
2720 cal_left: Minimum calibration value.
2721  Only meaningful with axis and pressure types.
2722 \end_layout
2724 \begin_layout Itemize
2725 cal_center: Center calibration value.
2726  Only meaningful with axis and pressure types.
2727 \end_layout
2729 \begin_layout Itemize
2730 cal_right: Maximum calibration value.
2731  Only meaningful with axis and pressure types.
2732 \end_layout
2734 \begin_layout Itemize
2735 cal_tolerance: Dead zone tolerance.
2736  Only meaningful with axis and pressure types.
2737 \end_layout
2739 \begin_layout Subsubsection
2740 input.keyhook(key, state)
2741 \end_layout
2743 \begin_layout Standard
2744 Requests that keyhook events to be sent for key (state=true) or not sent
2745  (state=false).
2746 \end_layout
2748 \begin_layout Subsection
2749 Table hostmemory
2750 \end_layout
2752 \begin_layout Standard
2753 Host memory handling (extra memory saved to savestates).
2754  Host memory starts empty.
2755 \end_layout
2757 \begin_layout Subsubsection
2758 hostmemory.read(number address)
2759 \end_layout
2761 \begin_layout Standard
2762 Reads hostmemory slot address.
2763  Slot numbers out of range return false instead of numeric.
2764 \end_layout
2766 \begin_layout Subsubsection
2767 hostmemory.write(number address, number value)
2768 \end_layout
2770 \begin_layout Standard
2771 Writes hostmemory slot with 0-255.
2772  Slot numbers out of range cause extension of host memory slot space.
2773 \end_layout
2775 \begin_layout Subsubsection
2776 hostmemory.readbyte(number address)
2777 \end_layout
2779 \begin_layout Standard
2780 Read unsigned byte (1 element) from given address.
2781  Slots out of range return false.
2782 \end_layout
2784 \begin_layout Subsubsection
2785 hostmemory.writebyte(number address, number value)
2786 \end_layout
2788 \begin_layout Standard
2789 Write unsigned byte (1 element) to given slot.
2790  Slot numbers out of range cause extension.
2791 \end_layout
2793 \begin_layout Subsubsection
2794 hostmemory.readsbyte(number address)
2795 \end_layout
2797 \begin_layout Standard
2798 Read signed byte (1 element) from given address.
2799  Slots out of range return false.
2800 \end_layout
2802 \begin_layout Subsubsection
2803 hostmemory.writesbyte(number address, number value)
2804 \end_layout
2806 \begin_layout Standard
2807 Write signed byte (1 element) to given slot.
2808  Slot numbers out of range cause extension.
2809 \end_layout
2811 \begin_layout Subsubsection
2812 hostmemory.readword(number address)
2813 \end_layout
2815 \begin_layout Standard
2816 Read unsigned word (2 elements) from given address.
2817  Slots out of range return false.
2818 \end_layout
2820 \begin_layout Subsubsection
2821 hostmemory.writeword(number address, number value)
2822 \end_layout
2824 \begin_layout Standard
2825 Write unsigned word (2 elements) to given slot.
2826  Slot numbers out of range cause extension.
2827 \end_layout
2829 \begin_layout Subsubsection
2830 hostmemory.readsword(number address)
2831 \end_layout
2833 \begin_layout Standard
2834 Read signed word (2 elements) from given address.
2835  Slots out of range return false.
2836 \end_layout
2838 \begin_layout Subsubsection
2839 hostmemory.writesword(number address, number value)
2840 \end_layout
2842 \begin_layout Standard
2843 Write signed word (2 elements) to given slot.
2844  Slot numbers out of range cause extension.
2845 \end_layout
2847 \begin_layout Subsubsection
2848 hostmemory.readdword(number address)
2849 \end_layout
2851 \begin_layout Standard
2852 Read unsigned doubleword (4 elements) from given address.
2853  Slots out of range return false.
2854 \end_layout
2856 \begin_layout Subsubsection
2857 hostmemory.writedword(number address, number value)
2858 \end_layout
2860 \begin_layout Standard
2861 Write unsigned doubleword (4 elements) to given slot.
2862  Slot numbers out of range cause extension.
2863 \end_layout
2865 \begin_layout Subsubsection
2866 hostmemory.readsdword(number address)
2867 \end_layout
2869 \begin_layout Standard
2870 Read signed doubleword (4 elements) from given address.
2871  Slots out of range return false.
2872 \end_layout
2874 \begin_layout Subsubsection
2875 hostmemory.writesdword(number address, number value)
2876 \end_layout
2878 \begin_layout Standard
2879 Write signed doubleword (4 elements) to given slot.
2880  Slot numbers out of range cause extension.
2881 \end_layout
2883 \begin_layout Subsubsection
2884 hostmemory.readqword(number address)
2885 \end_layout
2887 \begin_layout Standard
2888 Read unsigned quadword (8 elements) from given address.
2889  Slots out of range return false.
2890 \end_layout
2892 \begin_layout Subsubsection
2893 hostmemory.writeqword(number address, number value)
2894 \end_layout
2896 \begin_layout Standard
2897 Write unsigned quadword (4 elements) to given slot.
2898  Slot numbers out of range cause extension.
2899 \end_layout
2901 \begin_layout Subsubsection
2902 hostmemory.readsqword(number address)
2903 \end_layout
2905 \begin_layout Standard
2906 Read signed quadword (8 elements) from given address.
2907  Slots out of range return false.
2908 \end_layout
2910 \begin_layout Subsubsection
2911 hostmemory.writesqword(number address, number value)
2912 \end_layout
2914 \begin_layout Standard
2915 Write signed quadword (8 elements) to given slot.
2916  Slot numbers out of range cause extension.
2917 \end_layout
2919 \begin_layout Subsection
2920 Table movie
2921 \end_layout
2923 \begin_layout Standard
2924 Movie handling
2925 \end_layout
2927 \begin_layout Subsubsection
2928 movie.currentframe()
2929 \end_layout
2931 \begin_layout Standard
2932 Return number of current frame.
2933 \end_layout
2935 \begin_layout Subsubsection
2936 movie.framecount()
2937 \end_layout
2939 \begin_layout Standard
2940 Return number of frames in movie.
2941 \end_layout
2943 \begin_layout Subsubsection
2944 movie.readonly()
2945 \end_layout
2947 \begin_layout Standard
2948 Return true if in readonly mode, false if in readwrite.
2949 \end_layout
2951 \begin_layout Subsubsection
2952 movie.set_readwrite()
2953 \end_layout
2955 \begin_layout Standard
2956 Set readwrite mode (does not cause on_readwrite callback).
2957 \end_layout
2959 \begin_layout Subsubsection
2960 movie.frame_subframes(number frame)
2961 \end_layout
2963 \begin_layout Standard
2964 Count number of subframes in specified frame (frame numbers are 1-based)
2965  and return that.
2966 \end_layout
2968 \begin_layout Subsubsection
2969 movie.read_subframe(number frame, number subframe)
2970 \end_layout
2972 \begin_layout Standard
2973 Read specifed subframe in specified frame and return data as array (100
2974  elements, numbered 0-99 currently).
2975 \end_layout
2977 \begin_layout Subsection
2978 Table settings
2979 \end_layout
2981 \begin_layout Standard
2982 Routines for settings manipulation
2983 \end_layout
2985 \begin_layout Subsubsection
2986 settings.get(string name)
2987 \end_layout
2989 \begin_layout Standard
2990 Get value of setting.
2991  If setting is blank, returns false.
2992  If setting value can't be obtained, returns (nil, error message).
2993 \end_layout
2995 \begin_layout Subsubsection
2996 settings.set(string name, string value)
2997 \end_layout
2999 \begin_layout Standard
3000 Set value of setting.
3001  If setting can't be set, returns (nil, error message).
3002 \end_layout
3004 \begin_layout Subsubsection
3005 settings.is_set(string name)
3006 \end_layout
3008 \begin_layout Standard
3009 Returns if setting is set.
3010  If setting does not exist, returns (nil, error message).
3011 \end_layout
3013 \begin_layout Subsubsection
3014 settings.blank(string name)
3015 \end_layout
3017 \begin_layout Standard
3018 Blanks a setting and returns true.
3019  If setting can't be blanked, returns (nil, error message).
3020 \end_layout
3022 \begin_layout Subsection
3023 Table memory
3024 \end_layout
3026 \begin_layout Standard
3027 Contains various functions for managing memory
3028 \end_layout
3030 \begin_layout Subsubsection
3031 memory.vma_count()
3032 \end_layout
3034 \begin_layout Standard
3035 Returns the number of VMAs
3036 \end_layout
3038 \begin_layout Subsubsection
3039 memory.read_vma(number index)
3040 \end_layout
3042 \begin_layout Standard
3043 Reads the specified VMA (indices start from zero).
3044  Trying to read invalid VMA gives nil.
3045  The read VMA is table with the following fields:
3046 \end_layout
3048 \begin_layout Itemize
3049 region_name (string): The readable name of the VMA
3050 \end_layout
3052 \begin_layout Itemize
3053 baseaddr (number): Base address of the VMA
3054 \end_layout
3056 \begin_layout Itemize
3057 lastaddr (number): Last address in the VMA.
3058 \end_layout
3060 \begin_layout Itemize
3061 size (number): The size of VMA in bytes.
3062 \end_layout
3064 \begin_layout Itemize
3065 readonly (boolean): True of the VMA corresponds to ROM.
3066 \end_layout
3068 \begin_layout Itemize
3069 native_endian (boolean): True if the VMA has native endian as opposed to
3070  little endian.
3071 \end_layout
3073 \begin_layout Subsubsection
3074 memory.find_vma(number address)
3075 \end_layout
3077 \begin_layout Standard
3078 Finds the VMA containing specified address.
3079  Returns table in the same format as read_vma or nil if not found.
3080 \end_layout
3082 \begin_layout Subsubsection
3083 memory.readbyte(number address)
3084 \end_layout
3086 \begin_layout Standard
3087 Reads the specified address as unsigned byte and returns the result.
3088 \end_layout
3090 \begin_layout Subsubsection
3091 memory.readsbyte(number address)
3092 \end_layout
3094 \begin_layout Standard
3095 Reads the specified address as signed byte and returns the result.
3096 \end_layout
3098 \begin_layout Subsubsection
3099 memory.writebyte(number address, number value)
3100 \end_layout
3102 \begin_layout Standard
3103 Writes the specified value (negative values undergo 2's complement) to specified
3104  address (as a byte).
3105 \end_layout
3107 \begin_layout Subsubsection
3108 memory.readword(number address)
3109 \end_layout
3111 \begin_layout Standard
3112 Reads the specified address as unsigned word and returns the result.
3113 \end_layout
3115 \begin_layout Subsubsection
3116 memory.readsword(number address)
3117 \end_layout
3119 \begin_layout Standard
3120 Reads the specified address as signed word and returns the result.
3121 \end_layout
3123 \begin_layout Subsubsection
3124 memory.writeword(number address, number value)
3125 \end_layout
3127 \begin_layout Standard
3128 Writes the specified value (negative values undergo 2's complement) to specified
3129  address (as a word).
3130 \end_layout
3132 \begin_layout Subsubsection
3133 memory.readdword(number address)
3134 \end_layout
3136 \begin_layout Standard
3137 Reads the specified address as unsigned doubleword and returns the result.
3138 \end_layout
3140 \begin_layout Subsubsection
3141 memory.readsdword(number address)
3142 \end_layout
3144 \begin_layout Standard
3145 Reads the specified address as signed doubleword and returns the result.
3146 \end_layout
3148 \begin_layout Subsubsection
3149 memory.writedword(number address, number value)
3150 \end_layout
3152 \begin_layout Standard
3153 Writes the specified value (negative values undergo 2's complement) to specified
3154  address (as a doubleword).
3155 \end_layout
3157 \begin_layout Subsubsection
3158 memory.readqword(number address)
3159 \end_layout
3161 \begin_layout Standard
3162 Reads the specified address as unsigned quadword and returns the result.
3163 \end_layout
3165 \begin_layout Subsubsection
3166 memory.readsqword(number address)
3167 \end_layout
3169 \begin_layout Standard
3170 Reads the specified address as signed quadword and returns the result.
3171 \end_layout
3173 \begin_layout Subsubsection
3174 memory.writeqword(number address, number value)
3175 \end_layout
3177 \begin_layout Standard
3178 Writes the specified value (negative values undergo 2's complement) to specified
3179  address (as a quadword).
3180 \end_layout
3182 \begin_layout Subsection
3183 Table _SYSTEM
3184 \end_layout
3186 \begin_layout Standard
3187 Contains copy of global variables from time of Lua initialization.
3188  Non-writeable.
3189 \end_layout
3191 \begin_layout Subsection
3192 Callbacks
3193 \end_layout
3195 \begin_layout Standard
3196 Various callbacks to Lua that can occur.
3197 \end_layout
3199 \begin_layout Subsubsection
3200 Callback: on_paint(bool not_synth)
3201 \end_layout
3203 \begin_layout Standard
3204 Called when screen is being painted.
3205  Any gui.* calls requiring graphic context draw on the screen.
3206 \end_layout
3208 \begin_layout Standard
3209 not_synth is true if this hook is being called in response to received frame,
3210  false otherwise.
3211 \end_layout
3213 \begin_layout Subsubsection
3214 Callback: on_video()
3215 \end_layout
3217 \begin_layout Standard
3218 Called when video dump frame is being painted.
3219  Any gui.* calls requiring graphic context draw on the video.
3220 \end_layout
3222 \begin_layout Subsubsection
3223 Callback: on_frame_emulated()
3224 \end_layout
3226 \begin_layout Standard
3227 Called when emulating frame has completed and on_paint()/on_video() calls
3228  are about to be issued.
3229 \end_layout
3231 \begin_layout Subsubsection
3232 Callback: on_frame()
3233 \end_layout
3235 \begin_layout Standard
3236 Called on each starting whole frame.
3237 \end_layout
3239 \begin_layout Subsubsection
3240 Callback: on_startup()
3241 \end_layout
3243 \begin_layout Standard
3244 Called when the emulator is starting (lsnes.rc and --run files has been run).
3245 \end_layout
3247 \begin_layout Subsubsection
3248 Callback: on_rewind()
3249 \end_layout
3251 \begin_layout Standard
3252 Called when rewind movie to beginning has completed.
3253 \end_layout
3255 \begin_layout Subsubsection
3256 Callback: on_pre_load(string name)
3257 \end_layout
3259 \begin_layout Standard
3260 Called just before savestate/movie load occurs (note: loads are always delayed,
3261  so this occurs even when load was initiated by lua).
3262 \end_layout
3264 \begin_layout Subsubsection
3265 Callback: on_err_load(string name)
3266 \end_layout
3268 \begin_layout Standard
3269 Called if loadstate goes wrong.
3270 \end_layout
3272 \begin_layout Subsubsection
3273 Callback: on_post_load(string name, boolean was_savestate)
3274 \end_layout
3276 \begin_layout Standard
3277 Called on successful loadstate.
3278  was_savestate gives if this was a savestate or a movie.
3279 \end_layout
3281 \begin_layout Subsubsection
3282 Callback: on_pre_save(string name, boolean is_savestate)
3283 \end_layout
3285 \begin_layout Standard
3286 Called just before savestate save occurs (note: movie saves are synchronous
3287  and won't trigger these callbacks if called from Lua).
3288 \end_layout
3290 \begin_layout Subsubsection
3291 Callback: on_err_save(string name)
3292 \end_layout
3294 \begin_layout Standard
3295 Called if savestate goes wrong.
3296 \end_layout
3298 \begin_layout Subsubsection
3299 Callback: on_post_save(string name, boolean is_savestate)
3300 \end_layout
3302 \begin_layout Standard
3303 Called on successful savaestate.
3304  is_savestate gives if this was a savestate or a movie.
3305 \end_layout
3307 \begin_layout Subsubsection
3308 Callback: on_quit()
3309 \end_layout
3311 \begin_layout Standard
3312 Called when emulator is shutting down.
3313 \end_layout
3315 \begin_layout Subsubsection
3316 Callback: on_input(boolean subframe)
3317 \end_layout
3319 \begin_layout Standard
3320 Called when emulator is just sending input to bsnes core.
3321  Warning: This is called even in readonly mode, but the results are ignored.
3322 \end_layout
3324 \begin_layout Subsubsection
3325 Callback: on_reset()
3326 \end_layout
3328 \begin_layout Standard
3329 Called when SNES is reset.
3330 \end_layout
3332 \begin_layout Subsubsection
3333 Callback: on_readwrite()
3334 \end_layout
3336 \begin_layout Standard
3337 Called when moving into readwrite mode as result of 
3338 \begin_inset Quotes eld
3339 \end_inset
3341 set-rwmode
3342 \begin_inset Quotes erd
3343 \end_inset
3345  command (note: moving to rwmode by Lua won't trigger this, as per recursive
3346  entry protection).
3347 \end_layout
3349 \begin_layout Subsubsection
3350 Callback: on_snoop(number port, number controller, number index, number
3351  value)
3352 \end_layout
3354 \begin_layout Standard
3355 Called each time bsnes asks for input.
3356  The value is the final value to be sent to bsnes core (readonly mode, autohold
3357  and autofire have been taken into account).
3358  Might be useful when translating movies to format suitable for console
3359  verification.
3360  Note: There is no way to modify the value to be sent.
3361 \end_layout
3363 \begin_layout Subsubsection
3364 Callback: on_keyhook(string keyname, table state)
3365 \end_layout
3367 \begin_layout Standard
3368 Sent when key that has keyhook events requested changes state.
3369  Keyname is name of the key (group) and state is the state (same kind as
3370  table values in input.raw).
3371 \end_layout
3373 \begin_layout Section
3374 Memory watch expression syntax
3375 \end_layout
3377 \begin_layout Standard
3378 Memory watch expressions are in RPN (Reverse Polish Notation).
3379  At the end of expression, the top entry on stack is taken as the final
3380  result.
3381 \end_layout
3383 \begin_layout Standard
3384 Notations:
3385 \end_layout
3387 \begin_layout Itemize
3388 Evaluation order is strictly left to right.
3389 \end_layout
3391 \begin_layout Itemize
3392 a is the entry on top of stack
3393 \end_layout
3395 \begin_layout Itemize
3396 b is the entry immediately below top of stack
3397 \end_layout
3399 \begin_layout Itemize
3400 ; separates values to be pushed (no intermediate pop).
3401 \end_layout
3403 \begin_layout Itemize
3404 After end of element, all used stack slots are popped and all results are
3405  pushed.
3406 \end_layout
3408 \begin_layout Itemize
3409 When pushing multiple values, the pushes occur in order shown.
3410 \end_layout
3412 \begin_layout Standard
3413 The following operators are available:
3414 \end_layout
3416 \begin_layout Itemize
3417 + : a + b
3418 \end_layout
3420 \begin_layout Itemize
3421 - : a - b
3422 \end_layout
3424 \begin_layout Itemize
3425 * : a * b
3426 \end_layout
3428 \begin_layout Itemize
3429 / : a / b
3430 \end_layout
3432 \begin_layout Itemize
3433 % : a % b
3434 \end_layout
3436 \begin_layout Itemize
3437 a : atan(a)
3438 \end_layout
3440 \begin_layout Itemize
3441 b : read_signed_byte(a)
3442 \end_layout
3444 \begin_layout Itemize
3445 c : cos(a)
3446 \end_layout
3448 \begin_layout Itemize
3449 d : read_signed_dword(a)
3450 \end_layout
3452 \begin_layout Itemize
3453 i : quotent(a / b)
3454 \end_layout
3456 \begin_layout Itemize
3457 p :
3458 \begin_inset Formula $\pi$
3459 \end_inset
3462 \end_layout
3464 \begin_layout Itemize
3465 q : read_signed_qword(a)
3466 \end_layout
3468 \begin_layout Itemize
3469 r : sqrt(a)
3470 \end_layout
3472 \begin_layout Itemize
3473 s : sin(a)
3474 \end_layout
3476 \begin_layout Itemize
3477 t : tan(a)
3478 \end_layout
3480 \begin_layout Itemize
3481 u : a; a
3482 \end_layout
3484 \begin_layout Itemize
3485 w : read_signed_word(a)
3486 \end_layout
3488 \begin_layout Itemize
3489 A : atan2(a, b)
3490 \end_layout
3492 \begin_layout Itemize
3493 B : read_unsigned_byte(a)
3494 \end_layout
3496 \begin_layout Itemize
3497 C<number>z : Push number <number> to stack.
3498 \end_layout
3500 \begin_layout Itemize
3501 D : read_unsigned_dword(a)
3502 \end_layout
3504 \begin_layout Itemize
3505 C0x<number>z : Push number <number> (hexadecimal) to stack.
3506 \end_layout
3508 \begin_layout Itemize
3509 Q : read_unsigned_qword(a)
3510 \end_layout
3512 \begin_layout Itemize
3513 R<digit> : round a to <digit> digits.
3514 \end_layout
3516 \begin_layout Itemize
3517 W : read_unsigned_word(a)
3518 \end_layout
3520 \begin_layout Subsection
3521 Example:
3522 \end_layout
3524 \begin_layout Standard
3525 C0x007e0878zWC0x007e002czW-
3526 \end_layout
3528 \begin_layout Enumerate
3529 Push value 0x7e0878 on top of stack (C0x007e0878z).
3530 \end_layout
3532 \begin_layout Enumerate
3533 Pop the value on top of stack (0x7e0878), read word value at that address
3534  and push the result,call it x1 (W).
3535 \end_layout
3537 \begin_layout Enumerate
3538 Push value 0x7e002c on top of stack (C0x007e002cz).
3539 \end_layout
3541 \begin_layout Enumerate
3542 Pop the value on top of stack (0x7e002c), read word value at that address
3543  and push the result,call it x2 (W).
3544 \end_layout
3546 \begin_layout Enumerate
3547 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
3548  x2 - x1 (-).
3549 \end_layout
3551 \begin_layout Enumerate
3552 Since the expression ends, the final memory watch result is the top one
3553  on stack, which is x2 - x1.
3554 \end_layout
3556 \begin_layout Section
3557 Modifier and key names:
3558 \end_layout
3560 \begin_layout Subsection
3561 SDL Platform
3562 \end_layout
3564 \begin_layout Subsubsection
3565 Modifier names
3566 \end_layout
3568 \begin_layout Standard
3569 Following modifier names are known:
3570 \end_layout
3572 \begin_layout Itemize
3573 ctrl, lctrl, rctrl: Control keys
3574 \end_layout
3576 \begin_layout Itemize
3577 alt, lalt, ralt: ALT keys.
3578 \end_layout
3580 \begin_layout Itemize
3581 shift, lshift, rshift: Shift keys.
3582 \end_layout
3584 \begin_layout Itemize
3585 meta, lmeta, rmeta: Meta keys.
3586 \end_layout
3588 \begin_layout Itemize
3589 num, caps: Numlock/Capslock (these are sticky!)
3590 \end_layout
3592 \begin_layout Itemize
3593 mode: Mode select.
3594 \end_layout
3596 \begin_layout Subsubsection
3597 Key names
3598 \end_layout
3600 \begin_layout Standard
3601 Following key names are known:
3602 \end_layout
3604 \begin_layout Itemize
3605 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
3606  hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
3607  comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
3608  less, equals, greater, question, at, leftbracket, backslash, rightbracket,
3609  caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
3610  o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
3611  world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
3612  world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
3613  world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
3614  world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
3615  world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
3616  world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
3617  world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
3618  world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
3619  world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
3620  world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
3621  world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
3622  world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
3623  kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
3624  kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
3625  pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
3626  f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
3627  lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
3628  break, menu, power, euro, undo
3629 \end_layout
3631 \begin_layout Itemize
3632 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
3633  hardware-dependent scan code of <n> (useful to bind those keys that don't
3634  have symbolic names).
3635 \end_layout
3637 \begin_layout Subsubsection
3638 Joystick pseudo-keys:
3639 \end_layout
3641 \begin_layout Itemize
3642 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
3643 \end_layout
3645 \begin_layout Itemize
3646 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
3647 \end_layout
3649 \begin_layout Itemize
3650 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
3651 \end_layout
3653 \begin_layout Itemize
3654 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
3655 \end_layout
3657 \begin_layout Itemize
3658 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
3659 \end_layout
3661 \begin_layout Itemize
3662 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
3663  position (axis modes axis and axis_inverse).
3664 \end_layout
3666 \begin_layout Itemize
3667 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
3668  position (axis modes axis and axis_inverse).
3669 \end_layout
3671 \begin_layout Itemize
3672 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
3673  modes pressure_*).
3674 \end_layout
3676 \begin_layout Subsubsection
3677 Special buttons:
3678 \end_layout
3680 \begin_layout Itemize
3681 Escape: Enter/Exit Command mode, cancel modal dialogs.
3682 \end_layout
3684 \begin_layout Itemize
3685 Return (also KPEnter): Execute command, ok modal dialog.
3686 \end_layout
3688 \begin_layout Itemize
3689 Pgup/Up (also KP8/9 if no num lock; command mode): Previous command in command
3690  history
3691 \end_layout
3693 \begin_layout Itemize
3694 Pgdn/Down(also KP2/3 if no num lock; command mode): Next command in command
3695  history
3696 \end_layout
3698 \begin_layout Itemize
3699 Home (also KP7 if no num lock; command mode): Beginning of command.
3700 \end_layout
3702 \begin_layout Itemize
3703 End (also KP1 if no num lock; command mode): End of command.
3704 \end_layout
3706 \begin_layout Itemize
3707 Left (also KP4 if no num lock; command mode): Move cursor left.
3708 \end_layout
3710 \begin_layout Itemize
3711 Right (also KP6 if no num lock; command mode): Move cursor right.
3712 \end_layout
3714 \begin_layout Itemize
3715 Delete (also KP.
3716  if no num lock; command mode): Delete character to right of cursor.
3717 \end_layout
3719 \begin_layout Itemize
3720 Insert (also KP0 if no num lock; command mode): Toggle between insert /
3721  overwrite modes.
3722 \end_layout
3724 \begin_layout Itemize
3725 Backspace (command mode): Delete character to left of cursor.
3726 \end_layout
3728 \begin_layout Itemize
3729 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
3730 \end_layout
3732 \begin_layout Subsection
3733 wxWidgets platform
3734 \end_layout
3736 \begin_layout Subsubsection
3737 Modifier names:
3738 \end_layout
3740 \begin_layout Standard
3741 Following modifier names are known:
3742 \end_layout
3744 \begin_layout Itemize
3746 \end_layout
3748 \begin_layout Itemize
3749 ctrl
3750 \end_layout
3752 \begin_layout Itemize
3753 shift 
3754 \end_layout
3756 \begin_layout Itemize
3757 meta
3758 \end_layout
3760 \begin_layout Itemize
3761 cmd (Mac OS X only)
3762 \end_layout
3764 \begin_layout Subsubsection
3765 Key names:
3766 \end_layout
3768 \begin_layout Standard
3769 Following key names are known:
3770 \end_layout
3772 \begin_layout Itemize
3773 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
3774  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
3775  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
3776  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
3777  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
3778  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
3779  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
3780  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
3781  pause, capital, end, home, lefT, up, right, down, select, print, execute,
3782  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
3783  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
3784  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
3785  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
3786  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
3787  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
3788  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
3789  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
3790  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
3791  windows_right, windows_menu, command, special1, special2, special3, special4,
3792  special5, special6, special7, special8, special9, special10, special11,
3793  special12, special13, special14, special15, special16, special17, special18,
3794  special19, special20
3795 \end_layout
3797 \begin_layout Section
3798 Movie file format
3799 \end_layout
3801 \begin_layout Standard
3802 Movie file is .zip archive in itself, normal ZIP archive tools work on it
3803  (note: If you recompress it, do not use compression methods other than
3804  store and deflate and especially do not use encryption of any kind).
3805 \end_layout
3807 \begin_layout Subsection
3808 Detecting clean start/SRAM/Savestate
3809 \end_layout
3811 \begin_layout Itemize
3812 If file has member 
3813 \begin_inset Quotes eld
3814 \end_inset
3816 savestate
3817 \begin_inset Quotes erd
3818 \end_inset
3820  it is savestate, otherwise:
3821 \end_layout
3823 \begin_layout Itemize
3824 If file has members with names starting 
3825 \begin_inset Quotes eld
3826 \end_inset
3828 moviesram.
3829 \begin_inset Quotes erd
3830 \end_inset
3832  it is movie starting from SRAM, otherwise:
3833 \end_layout
3835 \begin_layout Itemize
3836 It is movie starting from clear state.
3837 \end_layout
3839 \begin_layout Subsection
3840 Member: gametype
3841 \end_layout
3843 \begin_layout Standard
3844 Type of game ROM and region (as one line).
3845  Valid values are:
3846 \end_layout
3848 \begin_layout Standard
3849 \begin_inset Tabular
3850 <lyxtabular version="3" rows="8" columns="3">
3851 <features tabularvalignment="middle">
3852 <column alignment="center" valignment="top" width="0">
3853 <column alignment="center" valignment="top" width="0">
3854 <column alignment="center" valignment="top" width="0">
3855 <row>
3856 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3857 \begin_inset Text
3859 \begin_layout Plain Layout
3860 Value
3861 \end_layout
3863 \end_inset
3864 </cell>
3865 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3866 \begin_inset Text
3868 \begin_layout Plain Layout
3869 System
3870 \end_layout
3872 \end_inset
3873 </cell>
3874 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3875 \begin_inset Text
3877 \begin_layout Plain Layout
3878 Region
3879 \end_layout
3881 \end_inset
3882 </cell>
3883 </row>
3884 <row>
3885 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3886 \begin_inset Text
3888 \begin_layout Plain Layout
3889 snes_pal
3890 \end_layout
3892 \end_inset
3893 </cell>
3894 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3895 \begin_inset Text
3897 \begin_layout Plain Layout
3898 Super NES
3899 \end_layout
3901 \end_inset
3902 </cell>
3903 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3904 \begin_inset Text
3906 \begin_layout Plain Layout
3908 \end_layout
3910 \end_inset
3911 </cell>
3912 </row>
3913 <row>
3914 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3915 \begin_inset Text
3917 \begin_layout Plain Layout
3918 sgb_pal
3919 \end_layout
3921 \end_inset
3922 </cell>
3923 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3924 \begin_inset Text
3926 \begin_layout Plain Layout
3927 Super Game Boy
3928 \end_layout
3930 \end_inset
3931 </cell>
3932 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3933 \begin_inset Text
3935 \begin_layout Plain Layout
3937 \end_layout
3939 \end_inset
3940 </cell>
3941 </row>
3942 <row>
3943 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3944 \begin_inset Text
3946 \begin_layout Plain Layout
3947 snes_ntsc
3948 \end_layout
3950 \end_inset
3951 </cell>
3952 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3953 \begin_inset Text
3955 \begin_layout Plain Layout
3956 Super NES
3957 \end_layout
3959 \end_inset
3960 </cell>
3961 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3962 \begin_inset Text
3964 \begin_layout Plain Layout
3965 NTSC
3966 \end_layout
3968 \end_inset
3969 </cell>
3970 </row>
3971 <row>
3972 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3973 \begin_inset Text
3975 \begin_layout Plain Layout
3976 sgb_ntsc
3977 \end_layout
3979 \end_inset
3980 </cell>
3981 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3982 \begin_inset Text
3984 \begin_layout Plain Layout
3985 Super Game Boy
3986 \end_layout
3988 \end_inset
3989 </cell>
3990 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3991 \begin_inset Text
3993 \begin_layout Plain Layout
3994 NTSC
3995 \end_layout
3997 \end_inset
3998 </cell>
3999 </row>
4000 <row>
4001 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4002 \begin_inset Text
4004 \begin_layout Plain Layout
4006 \end_layout
4008 \end_inset
4009 </cell>
4010 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4011 \begin_inset Text
4013 \begin_layout Plain Layout
4014 BS-X (non-slotted)
4015 \end_layout
4017 \end_inset
4018 </cell>
4019 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4020 \begin_inset Text
4022 \begin_layout Plain Layout
4023 NTSC
4024 \end_layout
4026 \end_inset
4027 </cell>
4028 </row>
4029 <row>
4030 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4031 \begin_inset Text
4033 \begin_layout Plain Layout
4034 bsxslotted
4035 \end_layout
4037 \end_inset
4038 </cell>
4039 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4040 \begin_inset Text
4042 \begin_layout Plain Layout
4043 BS-X (slotted)
4044 \end_layout
4046 \end_inset
4047 </cell>
4048 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4049 \begin_inset Text
4051 \begin_layout Plain Layout
4052 NTSC
4053 \end_layout
4055 \end_inset
4056 </cell>
4057 </row>
4058 <row>
4059 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4060 \begin_inset Text
4062 \begin_layout Plain Layout
4063 sufamiturbo
4064 \end_layout
4066 \end_inset
4067 </cell>
4068 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4069 \begin_inset Text
4071 \begin_layout Plain Layout
4072 Sufami Turbo
4073 \end_layout
4075 \end_inset
4076 </cell>
4077 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
4078 \begin_inset Text
4080 \begin_layout Plain Layout
4081 NTSC
4082 \end_layout
4084 \end_inset
4085 </cell>
4086 </row>
4087 </lyxtabular>
4089 \end_inset
4092 \end_layout
4094 \begin_layout Standard
4095 Frame rates are:
4096 \end_layout
4098 \begin_layout Standard
4099 \begin_inset Tabular
4100 <lyxtabular version="3" rows="3" columns="2">
4101 <features tabularvalignment="middle">
4102 <column alignment="center" valignment="top" width="0">
4103 <column alignment="center" valignment="top" width="0">
4104 <row>
4105 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4106 \begin_inset Text
4108 \begin_layout Plain Layout
4109 Region
4110 \end_layout
4112 \end_inset
4113 </cell>
4114 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
4115 \begin_inset Text
4117 \begin_layout Plain Layout
4118 Framerate (fps)
4119 \end_layout
4121 \end_inset
4122 </cell>
4123 </row>
4124 <row>
4125 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4126 \begin_inset Text
4128 \begin_layout Plain Layout
4130 \end_layout
4132 \end_inset
4133 </cell>
4134 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4135 \begin_inset Text
4137 \begin_layout Plain Layout
4138 322445/6448
4139 \end_layout
4141 \end_inset
4142 </cell>
4143 </row>
4144 <row>
4145 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4146 \begin_inset Text
4148 \begin_layout Plain Layout
4149 NTSC
4150 \end_layout
4152 \end_inset
4153 </cell>
4154 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
4155 \begin_inset Text
4157 \begin_layout Plain Layout
4158 10738636/178683
4159 \end_layout
4161 \end_inset
4162 </cell>
4163 </row>
4164 </lyxtabular>
4166 \end_inset
4169 \end_layout
4171 \begin_layout Subsection
4172 Member: port1
4173 \end_layout
4175 \begin_layout Standard
4176 Contains type of port #1 (as one line).
4177  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
4178  If not present, defaults to 'gamepad'.
4179 \end_layout
4181 \begin_layout Subsection
4182 Member: port2
4183 \end_layout
4185 \begin_layout Standard
4186 Contains type of port #2 (as one line).
4187  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
4188  'justifier' and 'justifiers'.
4189  If not present, defaults to 'none'.
4190 \end_layout
4192 \begin_layout Subsection
4193 Member: gamename
4194 \end_layout
4196 \begin_layout Standard
4197 Contains name of the game (as one line).
4198 \end_layout
4200 \begin_layout Subsection
4201 Member: authors
4202 \end_layout
4204 \begin_layout Standard
4205 Contains authors, one per line.
4206  Part before '|' is the full name, part after is the nickname.
4207 \end_layout
4209 \begin_layout Subsection
4210 Member: systemid
4211 \end_layout
4213 \begin_layout Standard
4214 Always 
4215 \begin_inset Quotes eld
4216 \end_inset
4218 lsnes-rr1
4219 \begin_inset Quotes erd
4220 \end_inset
4222  (one line).
4223  Used to reject other saves.
4224 \end_layout
4226 \begin_layout Subsection
4227 Member: controlsversion
4228 \end_layout
4230 \begin_layout Standard
4231 Always 
4232 \begin_inset Quotes eld
4233 \end_inset
4236 \begin_inset Quotes erd
4237 \end_inset
4239  (one line).
4240  Used to identify what controls are there.
4241 \end_layout
4243 \begin_layout Subsection
4244 Member: 
4245 \begin_inset Quotes eld
4246 \end_inset
4248 coreversion
4249 \begin_inset Quotes erd
4250 \end_inset
4253 \end_layout
4255 \begin_layout Standard
4256 Contains bsnes core version number (as one line).
4257 \end_layout
4259 \begin_layout Subsection
4260 Member: projectid
4261 \end_layout
4263 \begin_layout Standard
4264 Contains project ID (as one line).
4265  Used to identify if two movies are part of the same project.
4266 \end_layout
4268 \begin_layout Subsection
4269 Member: {rom,slota,slotb}{,xml}.sha256
4270 \end_layout
4272 \begin_layout Standard
4273 Contains SHA-256 of said ROM or ROM mapping file (as one line).
4274  Absent if corresponding file is absent.
4275 \end_layout
4277 \begin_layout Subsection
4278 Member: moviesram.<name>
4279 \end_layout
4281 \begin_layout Standard
4282 Raw binary startup SRAM of kind <name>.
4283  Only present in savestates and movies starting from SRAM.
4284 \end_layout
4286 \begin_layout Subsection
4287 Member: saveframe
4288 \end_layout
4290 \begin_layout Standard
4291 Contains frame number (as one line) of frame movie was saved on.
4292  Only present in savestates.
4293 \end_layout
4295 \begin_layout Subsection
4296 Member: lagcounter
4297 \end_layout
4299 \begin_layout Standard
4300 Current value of lag counter (as one line).
4301  Only present in savestates.
4302 \end_layout
4304 \begin_layout Subsection
4305 Member: pollcounters
4306 \end_layout
4308 \begin_layout Standard
4309 Contains poll counters (currently 100 of them), one per line.
4310  Each line is raw poll count if DRDY is set for it.
4311  Otherwise it is negative poll count minus one.
4312  Only present in savestates.
4313 \end_layout
4315 \begin_layout Subsection
4316 Member: hostmemory
4317 \end_layout
4319 \begin_layout Standard
4320 Raw binary dump of host memory.
4321  Only present in savestates.
4322 \end_layout
4324 \begin_layout Subsection
4325 Member: savestate
4326 \end_layout
4328 \begin_layout Standard
4329 The raw binary savestate itself.
4330  Savestate detection uses this file, only present in savestates.
4331 \end_layout
4333 \begin_layout Subsection
4334 Member: screenshot
4335 \end_layout
4337 \begin_layout Standard
4338 Screenshot of current frame.
4339  Only present in savestates.
4340  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
4341  data.
4342  Height of image is inferred from the width and size of data.
4343 \end_layout
4345 \begin_layout Subsection
4346 Member: sram.<name>
4347 \end_layout
4349 \begin_layout Standard
4350 Raw binary SRAM of kind <name> at time of savestate.
4351  Only present in savestates.
4352 \end_layout
4354 \begin_layout Subsection
4355 Member: input
4356 \end_layout
4358 \begin_layout Standard
4359 The actual input track, one line per subframe (blank lines are skipped).
4360 \end_layout
4362 \begin_layout Itemize
4363 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
4364  part of same frame as previous, otherwise it starts a new frame.
4365 \end_layout
4367 \begin_layout Itemize
4368 First subframe must start a new frame.
4369 \end_layout
4371 \begin_layout Standard
4372 Length of movie in frames is number of lines in input file that start a
4373  new frame.
4374 \end_layout
4376 \begin_layout Subsection
4377 Member: rerecords
4378 \end_layout
4380 \begin_layout Standard
4381 Contains textual base-10 rerecord count (as one line; emulator just writes
4382  this, it doesn't read it) + 1.
4383 \end_layout
4385 \begin_layout Subsection
4386 Member: rrdata
4387 \end_layout
4389 \begin_layout Standard
4390 This member stores set of load IDs.
4391  There is one load ID per rerecord (plus one corresponding to start of project).
4392 \end_layout
4394 \begin_layout Itemize
4395 This member constists of concatenation of records
4396 \end_layout
4398 \begin_layout Itemize
4399 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
4400  IDs.
4401 \end_layout
4403 \begin_layout Itemize
4404 IDs are interpretted as 256-bit big-endian integers with warparound.
4405 \end_layout
4407 \begin_layout Itemize
4408 Initial predicted ID is all zeroes.
4409 \end_layout
4411 \begin_layout Standard
4412 Format of each record is:
4413 \end_layout
4415 \begin_layout Itemize
4416 1 byte: Opcode byte.
4417  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
4418  Bit 7 is unused.
4419 \end_layout
4421 \begin_layout Itemize
4422 32-prefixlen bytes of ID.
4423 \end_layout
4425 \begin_layout Itemize
4426 countlen bytes of big-endian count (count).
4427 \end_layout
4429 \begin_layout Standard
4430 Records are processed as follows:
4431 \end_layout
4433 \begin_layout Itemize
4434 To form the first ID encoded by record, take the first prefixlen bytes predicted
4435  ID and append the read ID value to it.
4436  The result is the first ID encoded.
4437 \end_layout
4439 \begin_layout Itemize
4440 If countlen is 0, record encodes 1 ID.
4441 \end_layout
4443 \begin_layout Itemize
4444 If countlen is 1, record encodes 2+count IDs.
4445 \end_layout
4447 \begin_layout Itemize
4448 If countlen is 2, record encodes 258+count IDs.
4449 \end_layout
4451 \begin_layout Itemize
4452 If countlen is 3, record encodes 65794+count IDs.
4453 \end_layout
4455 \begin_layout Itemize
4456 The new predicted ID is the next ID after last one encoded by the record.
4457 \end_layout
4459 \begin_layout Standard
4460 The number of rerecords + 1 is equal to the sum of number of IDs encoded
4461  by all records.
4462 \end_layout
4464 \begin_layout Subsection
4465 Member: starttime.second
4466 \end_layout
4468 \begin_layout Standard
4469 Movie starting time, second part.
4470  Epoch is Unix epoch.
4471  Default is 1,000,000,000.
4472 \end_layout
4474 \begin_layout Subsection
4475 Member: starttime.subsecond
4476 \end_layout
4478 \begin_layout Standard
4479 Movie starting time, subsecond part.
4480  Unit is CPU clocks.
4481  Default is 0.
4482 \end_layout
4484 \begin_layout Subsection
4485 Member: savetime.second
4486 \end_layout
4488 \begin_layout Standard
4489 Movie saving time, second part.
4490  Default is starttime.second.
4491  Only present in savestates.
4492 \end_layout
4494 \begin_layout Subsection
4495 Member: savetime.subsecond
4496 \end_layout
4498 \begin_layout Standard
4499 Movie saving time, subsecond part.
4500  Default is starttime.subsecond.
4501  Only present in savestates.
4502 \end_layout
4504 \begin_layout Section
4505 Quick'n'dirty encode guide
4506 \end_layout
4508 \begin_layout Enumerate
4509 Start the emulator and load the movie file.
4510 \end_layout
4512 \begin_layout Enumerate
4513 Set large AVI option 'set-setting avi-large on'
4514 \end_layout
4516 \begin_layout Enumerate
4517 Enable dumping 'dump-avi tmpdump' 
4518 \end_layout
4520 \begin_layout Enumerate
4521 Unpause and let it run until you want to end dumping.
4522 \end_layout
4524 \begin_layout Enumerate
4525 Close the emulator (closing the window is the easiest way).
4526  Or use 'end-avi'.
4527 \end_layout
4529 \begin_layout Enumerate
4530 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
4531  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
4532 \end_layout
4534 \begin_layout Enumerate
4535 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
4536 \end_layout
4538 \begin_layout Enumerate
4539 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
4540  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
4541 \end_layout
4543 \begin_layout Enumerate
4544 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
4545  Now final.mkv contains quick'n'dirty encode.
4546 \end_layout
4548 \begin_layout Section
4549 Axis configurations for some gamepad types:
4550 \end_layout
4552 \begin_layout Subsection
4553 XBox360 controller:
4554 \end_layout
4556 \begin_layout Standard
4557 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
4558 \end_layout
4560 \begin_layout LyX-Code
4561 set-axis joystick0axis2 pressure-+
4562 \end_layout
4564 \begin_layout LyX-Code
4565 set-axis joystick0axis5 pressure-+
4566 \end_layout
4568 \begin_layout Itemize
4569 This is needed for SDL only.
4570  EVDEV sets those types correctly.
4571 \end_layout
4573 \begin_layout Subsection
4574 PS3 
4575 \begin_inset Quotes eld
4576 \end_inset
4578 sixaxis
4579 \begin_inset Quotes erd
4580 \end_inset
4582  controller:
4583 \end_layout
4585 \begin_layout Standard
4586 Axes 8-19 should be disabled.
4587 \end_layout
4589 \begin_layout LyX-Code
4590 set-axis joystick0axis8 disabled
4591 \end_layout
4593 \begin_layout LyX-Code
4594 set-axis joystick0axis9 disabled
4595 \end_layout
4597 \begin_layout LyX-Code
4598 set-axis joystick0axis10 disabled
4599 \end_layout
4601 \begin_layout LyX-Code
4602 set-axis joystick0axis11 disabled
4603 \end_layout
4605 \begin_layout LyX-Code
4606 set-axis joystick0axis12 disabled
4607 \end_layout
4609 \begin_layout LyX-Code
4610 set-axis joystick0axis13 disabled
4611 \end_layout
4613 \begin_layout LyX-Code
4614 set-axis joystick0axis14 disabled
4615 \end_layout
4617 \begin_layout LyX-Code
4618 set-axis joystick0axis15 disabled
4619 \end_layout
4621 \begin_layout LyX-Code
4622 set-axis joystick0axis16 disabled
4623 \end_layout
4625 \begin_layout LyX-Code
4626 set-axis joystick0axis17 disabled
4627 \end_layout
4629 \begin_layout LyX-Code
4630 set-axis joystick0axis18 disabled
4631 \end_layout
4633 \begin_layout LyX-Code
4634 set-axis joystick0axis19 disabled
4635 \end_layout
4637 \begin_layout Section
4638 Errata:
4639 \end_layout
4641 \begin_layout Subsection
4642 Problems from BSNES core:
4643 \end_layout
4645 \begin_layout Itemize
4646 The whole pending save stuff.
4647 \end_layout
4649 \begin_layout Itemize
4650 Lack of layer hiding.
4651 \end_layout
4653 \begin_layout Itemize
4654 It is slow (especially accuracy).
4655 \end_layout
4657 \begin_layout Itemize
4658 Firmwares can't be loaded from ZIP archives.
4659 \end_layout
4661 \begin_layout Subsection
4662 Other problems:
4663 \end_layout
4665 \begin_layout Itemize
4666 Modifiers don't work with pseudo-keys (SDL, EVDEV).
4667 \end_layout
4669 \begin_layout Itemize
4670 Audio for last dumped frame is not itself dumped.
4671 \end_layout
4673 \begin_layout Itemize
4674 Audio in UI is pretty bad in quality if game doesn't run at full speed.
4675 \end_layout
4677 \begin_layout Itemize
4678 AVI compression levels 10-18 are not compatible with AVISynth AVISource.
4679 \end_layout
4681 \begin_layout Itemize
4682 No menus, command based interface (SDL).
4683 \end_layout
4685 \begin_layout Itemize
4686 Long commands don't scroll.
4687 \end_layout
4689 \begin_layout Itemize
4690 Wxwidgets UI is still buggy.
4691 \end_layout
4693 \begin_layout Section
4694 Changelog:
4695 \end_layout
4697 \begin_layout Subsection
4698 rr0-beta1
4699 \end_layout
4701 \begin_layout Itemize
4702 Fix -Wall warnings
4703 \end_layout
4705 \begin_layout Itemize
4706 Fix dumper video corruption with levels 10-18.
4707 \end_layout
4709 \begin_layout Subsection
4710 rr0-beta2
4711 \end_layout
4713 \begin_layout Itemize
4714 Autofire
4715 \end_layout
4717 \begin_layout Itemize
4718 Lots of code cleanups
4719 \end_layout
4721 \begin_layout Itemize
4722 Lua interface to settings
4723 \end_layout
4725 \begin_layout Itemize
4726 Allow specifying AVI borders without Lua
4727 \end_layout
4729 \begin_layout Itemize
4730 Fix scaling if vscale > 1 and originx > 0 (left border exists)
4731 \end_layout
4733 \begin_layout Itemize
4734 on_snoop lua callback
4735 \end_layout
4737 \begin_layout Itemize
4738 Faster movie loading and saving.
4739 \end_layout
4741 \begin_layout Subsection
4742 rr0-beta3
4743 \end_layout
4745 \begin_layout Itemize
4746 Joystick support
4747 \end_layout
4749 \begin_layout Subsection
4750 rr0-beta4
4751 \end_layout
4753 \begin_layout Itemize
4754 Fix multi-buttons
4755 \end_layout
4757 \begin_layout Itemize
4758 Save jukebox functionality.
4759 \end_layout
4761 \begin_layout Subsection
4762 rr0-beta5
4763 \end_layout
4765 \begin_layout Itemize
4766 Try to fix some nasty failing movie load edge cases
4767 \end_layout
4769 \begin_layout Itemize
4770 Allow specifying scripts to run on command line.
4771 \end_layout
4773 \begin_layout Subsection
4774 rr0-beta6
4775 \end_layout
4777 \begin_layout Itemize
4778 Major source code reorganization.
4779 \end_layout
4781 \begin_layout Itemize
4782 Backup savestates before overwriting.
4783 \end_layout
4785 \begin_layout Itemize
4786 Don't crash if loading initial state fails.
4787 \end_layout
4789 \begin_layout Subsection
4790 rr0-beta7
4791 \end_layout
4793 \begin_layout Itemize
4794 Fix firmware lookup
4795 \end_layout
4797 \begin_layout Itemize
4798 Fix author name parsing
4799 \end_layout
4801 \begin_layout Itemize
4802 Fix rerecord counting
4803 \end_layout
4805 \begin_layout Itemize
4806 (SDL) Print messages to console if SDL is uninitialized
4807 \end_layout
4809 \begin_layout Itemize
4810 Add movieinfo program
4811 \end_layout
4813 \begin_layout Itemize
4814 Fix loading movies starting from SRAM.
4815 \end_layout
4817 \begin_layout Subsection
4818 rr0-beta8
4819 \end_layout
4821 \begin_layout Itemize
4822 Add support for unattended dumping
4823 \end_layout
4825 \begin_layout Itemize
4826 Fix compiling for Win32
4827 \end_layout
4829 \begin_layout Itemize
4830 Don't lock up if sound can't be initialized
4831 \end_layout
4833 \begin_layout Itemize
4834 Strip trailing CR from commands
4835 \end_layout
4837 \begin_layout Itemize
4838 Don't try to do dubious things in global ctors (fix crash on startup)
4839 \end_layout
4841 \begin_layout Subsection
4842 rr0-beta9
4843 \end_layout
4845 \begin_layout Itemize
4846 Small documentation tweaking
4847 \end_layout
4849 \begin_layout Itemize
4850 Fix make clean
4851 \end_layout
4853 \begin_layout Itemize
4854 Fix major bug in modifier matching
4855 \end_layout
4857 \begin_layout Subsection
4858 rr0-beta10
4859 \end_layout
4861 \begin_layout Itemize
4862 Lots of documentation fixes
4863 \end_layout
4865 \begin_layout Itemize
4866 Use dedicated callbacks for event backcomm., not commands.
4867 \end_layout
4869 \begin_layout Itemize
4870 Ensure that the watchdog is not hit when executing delayed reset.
4871 \end_layout
4873 \begin_layout Itemize
4874 Remove errant tab from joystick message.
4875 \end_layout
4877 \begin_layout Subsection
4878 rr0-beta11
4879 \end_layout
4881 \begin_layout Itemize
4882 Make autofire operate in absolute time, not linear time
4883 \end_layout
4885 \begin_layout Itemize
4886 Reinitialize controls when resuming from loadstate
4887 \end_layout
4889 \begin_layout Itemize
4890 Some more code cleanups
4891 \end_layout
4893 \begin_layout Itemize
4894 If Lua allocator fails, call OOM_panic()
4895 \end_layout
4897 \begin_layout Itemize
4898 Byte/word/dword/qword sized host memory write/read functions.
4899 \end_layout
4901 \begin_layout Itemize
4902 Dump at correct framerate if dumping interlaced NTSC (height=448).
4903 \end_layout
4905 \begin_layout Subsection
4906 rr0-beta12
4907 \end_layout
4909 \begin_layout Itemize
4910 Actually include the complete source code
4911 \end_layout
4913 \begin_layout Itemize
4914 Keep track of RTC
4915 \end_layout
4917 \begin_layout Subsection
4918 rr0-beta13
4919 \end_layout
4921 \begin_layout Itemize
4922 Document {save,start}time.{,sub}second.
4923 \end_layout
4925 \begin_layout Itemize
4926 Intercept time() from bsnes core.
4927 \end_layout
4929 \begin_layout Subsection
4930 rr0-beta14
4931 \end_layout
4933 \begin_layout Itemize
4934 Allow disabling time() interception (allow build on Mac OS X)
4935 \end_layout
4937 \begin_layout Itemize
4938 Use SDLMain on Mac OS X (make SDL not crash)
4939 \end_layout
4941 \begin_layout Itemize
4942 Disable delayed resets (just plain too buggy for now).
4943 \end_layout
4945 \begin_layout Itemize
4946 Code cleanups
4947 \end_layout
4949 \begin_layout Itemize
4950 Use 16-bit for graphics/video instead of 32-bit.
4951 \end_layout
4953 \begin_layout Itemize
4954 gui.rectangle/gui.pixel
4955 \end_layout
4957 \begin_layout Itemize
4958 gui.crosshair
4959 \end_layout
4961 \begin_layout Itemize
4962 New CSCD writer implementation.
4963 \end_layout
4965 \begin_layout Subsection
4966 rr0-beta15
4967 \end_layout
4969 \begin_layout Itemize
4970 Fix interaction of * and +.
4971 \end_layout
4973 \begin_layout Itemize
4974 Manual improvements
4975 \end_layout
4977 \begin_layout Itemize
4978 Use gettimeofday()/usleep(), these seem portable enough.
4979 \end_layout
4981 \begin_layout Itemize
4982 Move joystick axis manipulation to keymapper code.
4983 \end_layout
4985 \begin_layout Itemize
4986 Changes to how read-only works.
4987 \end_layout
4989 \begin_layout Itemize
4990 Refactor controller input code.
4991 \end_layout
4993 \begin_layout Subsection
4994 rr0-beta16
4995 \end_layout
4997 \begin_layout Itemize
4998 Fix mouseclick scale compensation.
4999 \end_layout
5001 \begin_layout Itemize
5002 Draw area boundaries correctly in SDL code.
5003 \end_layout
5005 \begin_layout Itemize
5006 gui.screenshot.
5007 \end_layout
5009 \begin_layout Itemize
5010 Fix CSCD output (buffer overrun and race condition).
5011 \end_layout
5013 \begin_layout Subsection
5014 rr0-beta17
5015 \end_layout
5017 \begin_layout Itemize
5018 JMD dumping support.
5019 \end_layout
5021 \begin_layout Itemize
5022 Allow unattended dumping to JMD.
5023 \end_layout
5025 \begin_layout Itemize
5026 Move to BSNES v083.
5027 \end_layout
5029 \begin_layout Itemize
5030 Switch back to 32-bit colors.
5031 \end_layout
5033 \begin_layout Itemize
5034 Add Lua function gui.color.
5035 \end_layout
5037 \begin_layout Itemize
5038 Use some new C++11 features in GCC 4.6.
5039 \end_layout
5041 \begin_layout Itemize
5042 Be prepared for core frequency changes.
5043 \end_layout
5045 \begin_layout Itemize
5046 Pass colors in one chunk from Lua.
5047 \end_layout
5049 \begin_layout Subsection
5050 rr0-beta18
5051 \end_layout
5053 \begin_layout Itemize
5054 New lua functions gui.line(), gui.status() and gui.circle(), memory.vma_count(),
5055  memory.read_vma() and memory.find_vma().
5056 \end_layout
5058 \begin_layout Itemize
5059 Numerious documentation fixups
5060 \end_layout
5062 \begin_layout Itemize
5063 RTC time format changed
5064 \end_layout
5066 \begin_layout Itemize
5067 Reformat flags display
5068 \end_layout
5070 \begin_layout Itemize
5071 Allow lua package name to be overridden
5072 \end_layout
5074 \begin_layout Itemize
5075 SDUMP (high-quality dumping).
5076 \end_layout
5078 \begin_layout Itemize
5079 Split platform support to plugins.
5080 \end_layout
5082 \begin_layout Itemize
5083 Make all sound plugins support basic sound commands
5084 \end_layout
5086 \begin_layout Itemize
5087 Support portaudio for sound.
5088 \end_layout
5090 \begin_layout Itemize
5091 Allow disable Lua/SDL searching.
5092 \end_layout
5094 \begin_layout Itemize
5095 Upconvert colors when copying lcscreen to screen.
5096 \end_layout
5098 \begin_layout Itemize
5099 Reorganize source tree.
5100 \end_layout
5102 \begin_layout Itemize
5103 Evdev joystick support.
5104 \end_layout
5106 \begin_layout Itemize
5107 Refactor more code into generic window code.
5108 \end_layout
5110 \begin_layout Subsection
5111 rr0-beta19
5112 \end_layout
5114 \begin_layout Itemize
5115 Refactor message handling.
5116 \end_layout
5118 \begin_layout Itemize
5119 Rework makefile
5120 \end_layout
5122 \begin_layout Itemize
5123 Documentation fixes
5124 \end_layout
5126 \begin_layout Itemize
5127 Finish pending saves before load/quit.
5128 \end_layout
5130 \begin_layout Itemize
5131 Wxwidgets graphics plugin.
5132 \end_layout
5134 \begin_layout Subsection
5135 rr0-beta20
5136 \end_layout
5138 \begin_layout Itemize
5139 Get rid of win32-crap.[ch]pp.
5140 \end_layout
5142 \begin_layout Itemize
5143 Move files around a lot.
5144 \end_layout
5146 \begin_layout Itemize
5147 Get rid of need for host C++ compiler.
5148 \end_layout
5150 \begin_layout Itemize
5151 Bsnes v084 core.
5152 \end_layout
5154 \begin_layout Itemize
5155 Refactor inter-component communication.
5156 \end_layout
5158 \begin_layout Itemize
5159 Fix zero luma.
5160 \end_layout
5162 \begin_layout Itemize
5163 Fix crash on multiline aliases.
5164 \end_layout
5166 \begin_layout Itemize
5167 Load/Save settings in wxwidgets gui.
5168 \end_layout
5170 \begin_layout Subsection
5171 rr0-beta21
5172 \end_layout
5174 \begin_layout Itemize
5175 Patch problems in bsnes core
5176 \end_layout
5178 \begin_layout Itemize
5179 SNES is little-endian, not big-endian!
5180 \end_layout
5182 \begin_layout Itemize
5183 Fix memory corruption in lcscreen::load()
5184 \end_layout
5186 \begin_layout Subsection
5187 rr0-beta22
5188 \end_layout
5190 \begin_layout Itemize
5191 Fix interpretting repeat counts in rrdata loading.
5192 \end_layout
5194 \begin_layout Itemize
5195 New lua callback: on_frame()
5196 \end_layout
5198 \begin_layout Itemize
5199 Remove calls to runtosave() that aren't supposed to be there
5200 \end_layout
5202 \begin_layout Itemize
5203 Lua function: movie.read_rtc()
5204 \end_layout
5206 \begin_layout Itemize
5207 Ignore src/fonts/font.cpp
5208 \end_layout
5210 \begin_layout Itemize
5211 Fix more bsnes core problems
5212 \end_layout
5214 \begin_layout Itemize
5215 Control bsnes random seeding
5216 \end_layout
5218 \begin_layout Itemize
5219 Pause-on-end
5220 \end_layout
5222 \begin_layout Itemize
5223 Some bsnes core debugging features (state dump and state hash)
5224 \end_layout
5226 \begin_layout Itemize
5227 Fix titlebar version number (no, the last version wasn't 'lsnes-0-beta21',
5228  it was 'lsnes rr0-beta21').
5229 \end_layout
5231 \begin_layout Subsection
5232 rr0-beta23
5233 \end_layout
5235 \begin_layout Itemize
5236 Fix memory corruption due to macro/field mixup
5237 \end_layout
5239 \begin_layout Itemize
5240 search-memory update
5241 \end_layout
5243 \begin_layout Itemize
5244 Allow direct-mapped framebuffer
5245 \end_layout
5247 \begin_layout Itemize
5248 SDL: Use SDL_ANYFORMAT if possible
5249 \end_layout
5251 \begin_layout Itemize
5252 SDMP2SOX: 2s delay modes.
5253 \end_layout
5255 \begin_layout Itemize
5256 Wxwidgets: Cleanups
5257 \end_layout
5259 \begin_layout Itemize
5260 Use sed -E, not sed -r.
5261  Fixes building on Mac OS X.
5262 \end_layout
5264 \begin_layout Itemize
5265 Wxwidgets: Save jukebox on exit
5266 \end_layout
5268 \begin_layout Itemize
5269 Fix RTC if using load-movie on savestate.
5270 \end_layout
5272 \begin_layout Itemize
5273 Fix crash related to full console mode.
5274 \end_layout
5276 \begin_layout Subsection
5277 rr0-beta24
5278 \end_layout
5280 \begin_layout Itemize
5281 Wxwidgets: Allow bringing application to foreground on Mac OS X.
5282 \end_layout
5284 \begin_layout Itemize
5285 Wxwidgets: Allow compiling on Mac OS X.
5286 \end_layout
5288 \begin_layout Itemize
5289 Use movie compare instead of movie hashing (faster save/load).
5290 \end_layout
5292 \begin_layout Itemize
5293 Lua: _SYSTEM table.
5294 \end_layout
5296 \begin_layout Subsection
5297 rr0-beta25
5298 \end_layout
5300 \begin_layout Itemize
5301 sdmp2sox: Pad soundtrack if using -l or -L.
5302 \end_layout
5304 \begin_layout Itemize
5305 sdmp2sox: Fix NTSC overscan.
5306 \end_layout
5308 \begin_layout Itemize
5309 sdmp2sox: Add AR correction mode.
5310 \end_layout
5312 \begin_layout Itemize
5313 call lua_close() when exiting.
5314 \end_layout
5316 \begin_layout Itemize
5317 Fix zip_writer bug causing warnings from info-zip and error from advzip.
5318 \end_layout
5320 \begin_layout Subsection
5321 rr0-beta26
5322 \end_layout
5324 \begin_layout Itemize
5325 Fix IPS patching code (use bsnes core IPS patcher).
5326 \end_layout
5328 \begin_layout Itemize
5329 Implement BPS patching (using bsnes core IPS patcher).
5330 \end_layout
5332 \begin_layout Itemize
5333 Add feature to load headered ROMs.
5334 \end_layout
5336 \begin_layout Subsection
5337 rr0-beta27
5338 \end_layout
5340 \begin_layout Itemize
5341 Show command names when showing keybindings
5342 \end_layout
5344 \begin_layout Subsection
5346 \end_layout
5348 \begin_layout Itemize
5349 Fix pause-on-end to be actually controllable
5350 \end_layout
5352 \begin_layout Itemize
5353 SDL: Poll all events in queue, not just first one (fixes slowness in command
5354  typing)
5355 \end_layout
5357 \begin_layout Itemize
5358 Wxwidgets: Fix ROM loading.
5359 \end_layout
5361 \begin_layout Subsection
5362 rr1-beta0
5363 \end_layout
5365 \begin_layout Itemize
5366 Lua: Add gui.textH, gui.textV, gui.textHV
5367 \end_layout
5369 \begin_layout Itemize
5370 Fix text colors on SDL on Mac OS X
5371 \end_layout
5373 \begin_layout Itemize
5374 Mode 'F' for finished in readonly mode.
5375 \end_layout
5377 \begin_layout Itemize
5378 Fix some WS errors.
5379 \end_layout
5381 \begin_layout Itemize
5382 Reliably pause after skip poll
5383 \end_layout
5385 \begin_layout Itemize
5386 Split UI and core into their own threads
5387 \end_layout
5389 \begin_layout Subsection
5390 rr1-beta1
5391 \end_layout
5393 \begin_layout Itemize
5394 Remove leftover dummy SRAM slot
5395 \end_layout
5397 \begin_layout Itemize
5398 Fix controller numbers.
5399 \end_layout
5401 \begin_layout Subsection
5402 rr1-beta2
5403 \end_layout
5405 \begin_layout Itemize
5406 Fix lsnes-dumpavi after interface change.
5407 \end_layout
5409 \begin_layout Itemize
5410 Also give BSNES patches for v085.
5411 \end_layout
5413 \begin_layout Itemize
5414 Pack movie data in memory.
5415 \end_layout
5417 \begin_layout Subsection
5418 rr1-beta3
5419 \end_layout
5421 \begin_layout Itemize
5422 Fix framecount/length given when loading movies.
5423 \end_layout
5425 \begin_layout Itemize
5426 Controller command memory leak fixes.
5427 \end_layout
5429 \begin_layout Itemize
5430 Don't leak palette if freeing screen object.
5431 \end_layout
5433 \begin_layout Subsection
5434 rr1-beta4
5435 \end_layout
5437 \begin_layout Itemize
5438 Detect revisions.
5439 \end_layout
5441 \begin_layout Itemize
5442 Wxwidgets: Allow controlling dumper from the menu.
5443 \end_layout
5445 \begin_layout Subsection
5446 rr1-beta5
5447 \end_layout
5449 \begin_layout Itemize
5450 Rewrite parts of manual
5451 \end_layout
5453 \begin_layout Itemize
5454 Lua: Make it work with Lua 5.2.
5455 \end_layout
5457 \begin_layout Subsection
5458 rr1-beta6
5459 \end_layout
5461 \begin_layout Itemize
5462 Win32: Fix compile errors.
5463 \end_layout
5465 \begin_layout Subsection
5466 rr1-beta7
5467 \end_layout
5469 \begin_layout Itemize
5470 Refactor controller input code.
5471 \end_layout
5473 \begin_layout Itemize
5474 Fix crash when using command line on SDL / Mac OS X.
5475 \end_layout
5477 \begin_layout Subsection
5478 rr1-beta8
5479 \end_layout
5481 \begin_layout Itemize
5482 Delete core/coroutine (obsolete)
5483 \end_layout
5485 \begin_layout Itemize
5486 Lag input display by one frame.
5487 \end_layout
5489 \begin_layout Itemize
5490 Rewind movie to beginning function.
5491 \end_layout
5493 \begin_layout Itemize
5494 Fix wrong frame number reported to Lua when repainting after loadstate
5495 \end_layout
5497 \begin_layout Itemize
5498 Support UI editing of jukebox
5499 \end_layout
5501 \begin_layout Itemize
5502 Wxwidgets: Save settings on exit.
5503 \end_layout
5505 \begin_layout Itemize
5506 Support ${project} for filenames
5507 \end_layout
5509 \begin_layout Itemize
5510 SDL: Fix command history
5511 \end_layout
5513 \begin_layout Subsection
5514 rr1-beta9
5515 \end_layout
5517 \begin_layout Itemize
5518 Fix some order-of-global-ctor bugs.
5519 \end_layout
5521 \begin_layout Subsection
5522 rr1-beta10
5523 \end_layout
5525 \begin_layout Itemize
5526 Fix crashes when quitting on Win32.
5527 \end_layout
5529 \begin_layout Subsection
5530 rr1-beta11
5531 \end_layout
5533 \begin_layout Itemize
5534 EVDEV: Queue keypresses from joystick, don't send directly
5535 \end_layout
5537 \begin_layout Itemize
5538 Wxwidgets: Load-Preserve that actually works.
5539 \end_layout
5541 \begin_layout Subsection
5542 rr1-beta12
5543 \end_layout
5545 \begin_layout Itemize
5546 Wxwidgets: GUI for memory search.
5547 \end_layout
5549 \begin_layout Itemize
5550 Warn about using synchronous queue in UI callback.
5551 \end_layout
5553 \begin_layout Subsection
5554 rr1-beta13
5555 \end_layout
5557 \begin_layout Itemize
5558 Remember last saved file for each ROM
5559 \end_layout
5561 \begin_layout Itemize
5562 Support MT dumping via boost.
5563 \end_layout
5565 \begin_layout Itemize
5566 Lua: input.raw
5567 \end_layout
5569 \begin_layout Itemize
5570 Lua: input.keyhook
5571 \end_layout
5573 \begin_layout Itemize
5574 Make mouse be ordinary input instead of special-casing
5575 \end_layout
5577 \begin_layout Itemize
5578 SDL: Don't screw up commands with NUL codepoints.
5579 \end_layout
5581 \begin_layout Subsection
5582 rr1-beta14
5583 \end_layout
5585 \begin_layout Itemize
5586 Merge status panel and main window
5587 \end_layout
5589 \begin_layout Itemize
5590 True movie slot support (the rest of it)
5591 \end_layout
5593 \begin_layout Itemize
5594 SDL: Fix compilation error
5595 \end_layout
5597 \begin_layout Itemize
5598 Elminate cross calls in dump menu code.
5599 \end_layout
5601 \begin_layout Subsection
5602 rr1-beta15
5603 \end_layout
5605 \begin_layout Itemize
5606 Cancel pending saves command
5607 \end_layout
5609 \begin_layout Itemize
5610 Wxwidgets: Code refactoring
5611 \end_layout
5613 \begin_layout Itemize
5614 Wxwidgets: Fix system -> reset
5615 \end_layout
5617 \begin_layout Itemize
5618 Wxwidgets: Read watch expressions in the right thread
5619 \end_layout
5621 \begin_layout Subsection
5622 rr1-beta16
5623 \end_layout
5625 \begin_layout Itemize
5626 Wxwidgets: Don't prompt for member when running Lua script (Lua doesn't
5627  support that).
5628 \end_layout
5630 \begin_layout Itemize
5631 Wxwidgets: 128 -> 1024 Autohold slots (in case more are needed).
5632 \end_layout
5634 \begin_layout Itemize
5635 Don't append trailing '-' to prefix when saving movie.
5636 \end_layout
5638 \begin_layout Itemize
5639 Fix ROM/savestate handling (don't let user mismatch ROM and savestates).
5640 \end_layout
5642 \begin_layout Subsection
5644 \end_layout
5646 \begin_layout Itemize
5647 Document memory watch syntax.
5648 \end_layout
5650 \begin_layout Subsection
5651 rr1-delta1
5652 \end_layout
5654 \begin_layout Itemize
5655 Fix unattended dumping (lsnes-dumpavi)
5656 \end_layout
5658 \begin_layout Itemize
5659 Support RAW dumping
5660 \end_layout
5662 \begin_layout Itemize
5663 Use adv_dumper instead of the old interface in lsnes-dumpavi (changes syntax)
5664 \end_layout
5666 \begin_layout Itemize
5667 Add option to control sample rate preturbation in AVI dumper
5668 \end_layout
5670 \begin_layout Subsection
5671 rr1-delta2
5672 \end_layout
5674 \begin_layout Itemize
5675 Wxwidgets: Fix dumper submodes
5676 \end_layout
5678 \begin_layout Itemize
5679 Set core controller types before loadstate
5680 \end_layout
5682 \begin_layout Subsection
5683 rr1-delta2epsilon1
5684 \end_layout
5686 \begin_layout Itemize
5687 Fix compiling with bsnes v086.
5688 \end_layout
5690 \begin_layout Subsection
5691 rr1-delta3
5692 \end_layout
5694 \begin_layout Itemize
5695 Don't prompt before quitting
5696 \end_layout
5698 \begin_layout Itemize
5699 Start unpaused, preserve pause/unpause over load.
5700 \end_layout
5702 \begin_layout Itemize
5703 Try to autodetect if ROM is headered.
5704 \end_layout
5706 \begin_layout Itemize
5707 Wxwidgets: Only bring up ROM patching screen if specifically requested.
5708 \end_layout
5710 \begin_layout Itemize
5711 Allow configuring some hotkeys.
5712 \end_layout
5714 \begin_layout Subsection
5715 rr1-delta4
5716 \end_layout
5718 \begin_layout Itemize
5719 Lots of code cleanups
5720 \end_layout
5722 \begin_layout Itemize
5723 Fix JMD compression (JMD dumping was broken)
5724 \end_layout
5726 \begin_layout Itemize
5727 Don't crash if Lua C function throws an exception.
5728 \end_layout
5730 \begin_layout Itemize
5731 Support bitmap drawing in Lua.
5732 \end_layout
5734 \begin_layout Itemize
5735 Fix bsnes v085/v086 patches.
5736 \end_layout
5738 \begin_layout Itemize
5739 Improve stability on win32.
5740 \end_layout
5742 \begin_layout Subsection
5743 rr1-delta4epsilon1
5744 \end_layout
5746 \begin_layout Itemize
5747 Don't corrupt movie if movie length is integer multiple of frames per page.
5748 \end_layout
5750 \end_body
5751 \end_document