Remove do_basic_core_init (do equivalent tasks on demand)
[lsnes.git] / manual.lyx
blobaee61e7665adbad1c3435347b0d419265bfda63d
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass article
6 \use_default_options true
7 \maintain_unincluded_children false
8 \language finnish
9 \language_package default
10 \inputencoding auto
11 \fontencoding global
12 \font_roman default
13 \font_sans default
14 \font_typewriter default
15 \font_default_family default
16 \use_non_tex_fonts false
17 \font_sc false
18 \font_osf false
19 \font_sf_scale 100
20 \font_tt_scale 100
22 \graphics default
23 \default_output_format default
24 \output_sync 0
25 \bibtex_command default
26 \index_command default
27 \paperfontsize default
28 \use_hyperref false
29 \papersize default
30 \use_geometry false
31 \use_amsmath 1
32 \use_esint 1
33 \use_mhchem 1
34 \use_mathdots 1
35 \cite_engine basic
36 \use_bibtopic false
37 \use_indices false
38 \paperorientation portrait
39 \suppress_date false
40 \use_refstyle 1
41 \index Hakusana
42 \shortcut idx
43 \color #008000
44 \end_index
45 \secnumdepth 3
46 \tocdepth 3
47 \paragraph_separation indent
48 \paragraph_indentation default
49 \quotes_language english
50 \papercolumns 1
51 \papersides 1
52 \paperpagestyle default
53 \tracking_changes false
54 \output_changes false
55 \html_math_output 0
56 \html_css_as_file 0
57 \html_be_strict false
58 \end_header
60 \begin_body
62 \begin_layout Section
63 Introduction
64 \end_layout
66 \begin_layout Standard
67 lsnes is SNES rerecording emulator based on bsnes core.
68 \end_layout
70 \begin_layout Section
71 Dependencies
72 \end_layout
74 \begin_layout Enumerate
75 bsnes libsnes (for bsnes SNES core)
76 \end_layout
78 \begin_deeper
79 \begin_layout Enumerate
80 v084-v087 (v084 or v085 for delayreset support)
81 \end_layout
83 \begin_layout Enumerate
84 accuracy or compatiblity core with debugger enabled.
85 \end_layout
87 \begin_layout Enumerate
88 Patched version (using included 7 patches)
89 \end_layout
91 \end_deeper
92 \begin_layout Enumerate
93 gambatte (for gambatte core)
94 \end_layout
96 \begin_deeper
97 \begin_layout Enumerate
98 SVN r320
99 \end_layout
101 \begin_layout Enumerate
102 Patched with included patches
103 \end_layout
105 \end_deeper
106 \begin_layout Enumerate
107 Zlib
108 \end_layout
110 \begin_layout Enumerate
111 boost_iostreams
112 \end_layout
114 \begin_layout Enumerate
115 boost_filesystem
116 \end_layout
118 \begin_layout Enumerate
119 boost_thread (if native std::thread is not available)
120 \end_layout
122 \begin_layout Enumerate
123 libsdl (SDL only)
124 \end_layout
126 \begin_layout Enumerate
127 sdlmain (SDL only, part of SDL)
128 \end_layout
130 \begin_layout Enumerate
131 boost_conversion (this is header-only library)
132 \end_layout
134 \begin_layout Enumerate
135 libswscale (wxwidgets graphics only)
136 \end_layout
138 \begin_layout Enumerate
139 Portaudio (portaudio sound only)
140 \end_layout
142 \begin_layout Enumerate
143 libao (libao sound only)
144 \end_layout
146 \begin_layout Enumerate
147 Lua (if Lua support is needed).
148 \end_layout
150 \begin_deeper
151 \begin_layout Itemize
152 Version 5.1.X or 5.2X.
153 \end_layout
155 \end_deeper
156 \begin_layout Enumerate
157 G++ 4.6 (bsnes doesn't seem to like 4.7, status for gambatte is unknown).
158 \end_layout
160 \begin_layout Section
161 Building
162 \end_layout
164 \begin_layout Itemize
165 Copy bsnes sources (the bsnes subdirectory) to subdirectory 'bsnes' (for
166  bsnes core).
167 \end_layout
169 \begin_layout Itemize
170 Copy gambatte sources to subdirectory 'gambatte' (for gambatte core).
171 \end_layout
173 \begin_layout Itemize
174 Patch the bsnes sources with included patches (directory 'bsnes-patches/<version
175 >', bsnes core)
176 \end_layout
178 \begin_layout Itemize
179 Patch the gambatte sources with included patches (directory 'gambatte-patches/<v
180 ersion>', gambatte core)
181 \end_layout
183 \begin_layout Itemize
184 Edit options.build (or copy of that file)
185 \end_layout
187 \begin_layout Itemize
188 Run make (passing 'OPTIONS=<filename>' if using something else than options.build
190 \end_layout
192 \begin_layout Section
193 Command line options
194 \end_layout
196 \begin_layout Subsection
197 ROM options
198 \end_layout
200 \begin_layout Subsubsection
201 --rom=<file> (lsnes/SDL, lsnes/wxwidgets, lsnes-avidump)
202 \end_layout
204 \begin_layout Standard
205 Load <file> as ROM.
206 \end_layout
208 \begin_layout Subsection
209 Session options
210 \end_layout
212 \begin_layout Subsubsection
213 --pause
214 \end_layout
216 \begin_layout Standard
217 Start paused
218 \end_layout
220 \begin_layout Subsubsection
221 <filename> (lsnes/SDL, lsnes-avidump, movieinfo)
222 \end_layout
224 \begin_layout Standard
225 Load <filename> as movie or savestate file.
226  All other session options are ignored.
227 \end_layout
229 \begin_layout Subsubsection
230 --port1=<device> (lsnes/SDL, bsnes core only)
231 \end_layout
233 \begin_layout Standard
234 Set type of port1.
235  Valid values are:
236 \end_layout
238 \begin_layout Itemize
239 none: No device connected
240 \end_layout
242 \begin_layout Itemize
243 gamepad: One gamepad (the default)
244 \end_layout
246 \begin_layout Itemize
247 multitap: Four gamepads (warning: makes most games refuse to start)
248 \end_layout
250 \begin_layout Itemize
251 mouse: Mouse.
252 \end_layout
254 \begin_layout Subsubsection
255 --port2=<type> (lsnes/SDL, bsnes core only)
256 \end_layout
258 \begin_layout Standard
259 Set type of port2.
260  Valid values are:
261 \end_layout
263 \begin_layout Itemize
264 none: No device connected (the default)
265 \end_layout
267 \begin_layout Itemize
268 gamepad: One gamepad
269 \end_layout
271 \begin_layout Itemize
272 multitap: Four gamepads.
273 \end_layout
275 \begin_layout Itemize
276 mouse: Mouse
277 \end_layout
279 \begin_layout Itemize
280 superscope: Super Scope
281 \end_layout
283 \begin_layout Itemize
284 justifier: One justifier
285 \end_layout
287 \begin_layout Itemize
288 justifiers: Two justifiers
289 \end_layout
291 \begin_layout Subsubsection
292 --gamename=<name> (lsnes/SDL)
293 \end_layout
295 \begin_layout Standard
296 Set the name of game to <name>.
297  Default is blank.
298 \end_layout
300 \begin_layout Subsubsection
301 --author=<name> (lsnes/SDL)
302 \end_layout
304 \begin_layout Standard
305 Add author with full name of <name> (no nickname).
306 \end_layout
308 \begin_layout Subsubsection
309 --author=|<name> (lsnes/SDL)
310 \end_layout
312 \begin_layout Standard
313 Add author with nickname of <name> (no full name).
314 \end_layout
316 \begin_layout Subsubsection
317 --author=<fullname>|<nickname> (lsnes/SDL)
318 \end_layout
320 \begin_layout Standard
321 Add author with full name of <fullname> and nickname of <nickname>.
322 \end_layout
324 \begin_layout Subsubsection
325 --rtc-second=<value> (lsnes/SDL)
326 \end_layout
328 \begin_layout Standard
329 Set RTC second (0 is 1st January 1970 00:00:00Z).
330  Default is 1,000,000,000.
331 \end_layout
333 \begin_layout Subsubsection
334 --rtc-subsecond=<value> (lsnes/SDL)
335 \end_layout
337 \begin_layout Standard
338 Set RTC subsecond.
339  Range is 0-.
340  Unit is CPU cycle.
341  Default is 0.
342 \end_layout
344 \begin_layout Subsubsection
345 --anchor-savestate=<file> (lsnes/SDL)
346 \end_layout
348 \begin_layout Standard
349 Set the anchor savestate file.
350 \end_layout
352 \begin_layout Subsubsection
353 --load=<file> (lsnes/wxwidgets)
354 \end_layout
356 \begin_layout Standard
357 After loading the ROM, load <file> as savestate/movie.
358 \end_layout
360 \begin_layout Subsection
361 Misc.
362  options:
363 \end_layout
365 \begin_layout Subsubsection
366 --run=<file> (lsnes/SDL)
367 \end_layout
369 \begin_layout Standard
370 After running main RC file, run this file.
371  If multiple are specified, these execute in order specified.
372 \end_layout
374 \begin_layout Subsection
375 dump options (lsnes-dumpavi only)
376 \end_layout
378 \begin_layout Subsubsection
379 --dumper=<dumper>
380 \end_layout
382 \begin_layout Standard
383 Set the dumper to use (required).
384  Use 'list' for listing of known dumpers.
385 \end_layout
387 \begin_layout Subsubsection
388 --mode=<mode>
389 \end_layout
391 \begin_layout Standard
392 Set the mode to use (required for dumpers with multiple modes, forbidden
393  otherwise).
394  Use 'list' for known modes.
395 \end_layout
397 \begin_layout Subsubsection
398 --prefix=<prefix>
399 \end_layout
401 \begin_layout Standard
402 Set dump prefix.
403  Default is 
404 \begin_inset Quotes eld
405 \end_inset
407 avidump
408 \begin_inset Quotes erd
409 \end_inset
412 \end_layout
414 \begin_layout Subsubsection
415 --option=<name>=<value>
416 \end_layout
418 \begin_layout Standard
419 Set option <name> to value <value>.
420 \end_layout
422 \begin_layout Subsubsection
423 --length=<length>
424 \end_layout
426 \begin_layout Standard
427 Set number of frames to dump.
428  Mandatory.
429 \end_layout
431 \begin_layout Subsubsection
432 --lua=<script>
433 \end_layout
435 \begin_layout Standard
436 Run specified lua script (lsnes-dumpavi does not have initialization files).
437 \end_layout
439 \begin_layout Subsubsection
440 --load-library=<library>
441 \end_layout
443 \begin_layout Standard
444 Load the specified shared object / dynamic library / dynamic link library.
445 \end_layout
447 \begin_layout Section
448 Startup file lsnes.rc
449 \end_layout
451 \begin_layout Standard
452 Upon startup, lsnes (lsnes/SDL only) executes file lsnes.rc as commands.
453  This file is located in:
454 \end_layout
456 \begin_layout Itemize
457 Windows: %APPDATA%
458 \backslash
459 lsnes
460 \backslash
461 lsnes.rc (if %APPDATA% exists)
462 \end_layout
464 \begin_layout Itemize
465 Unix: $XDG_CONFIG_HOME/lsnes/lsnes.rc (if $XDG_CONFIG_HOME exists)
466 \end_layout
468 \begin_layout Itemize
469 Unix: $HOME/.config/lsnes/lsnes.rc (if $HOME exists)
470 \end_layout
472 \begin_layout Itemize
473 All: ./lsnes.rc (fallback default).
474 \end_layout
476 \begin_layout Standard
477 If leading directories do not exist, attempt to create them is made.
478 \end_layout
480 \begin_layout Section
481 Internal commands
482 \end_layout
484 \begin_layout Itemize
485 Commands beginning with '*' invoke the corresponding command without alias
486  expansion.
487 \end_layout
489 \begin_layout Itemize
490 If command starts with '+' (after possible '*'), the command is executed
491  as-is when button is pressed, and when button is released, it is executed
492  with '+' replaced by '-'.
493 \end_layout
495 \begin_layout Itemize
496 Commands without '+' execute only on negative edge (release).
497 \end_layout
499 \begin_layout Subsection
500 run-script <script>
501 \end_layout
503 \begin_layout Standard
504 Run <script> as if commands were entered on the command line.
505 \end_layout
507 \begin_layout Subsection
508 Memory manipulation
509 \end_layout
511 \begin_layout Standard
512 <address> may be decimal or hexadecimal (prefixed with '0x').
513  <value> can be hexadecimal (prefixed with '0x'), unsigned or signed (prefixed
514  with '-') decimal.
515 \end_layout
517 \begin_layout Standard
518 The available element <sizes> are:
519 \end_layout
521 \begin_layout Itemize
522 byte: 1 byte
523 \end_layout
525 \begin_layout Itemize
526 word: 2 bytes
527 \end_layout
529 \begin_layout Itemize
530 dword: 4 bytes
531 \end_layout
533 \begin_layout Itemize
534 qword: 8 bytes
535 \end_layout
537 \begin_layout Standard
538 When reading RAM and ROM, multi-byte reads/writes are big-endian.
539  When dealing with DSP memory, multi-byte reads/writes are native-endian
540  (do not use operand sizes exceeding DSP bitness, except dword is OK for
541  24-bit memory).
542 \end_layout
544 \begin_layout Subsubsection
545 read-<size> <address>
546 \end_layout
548 \begin_layout Standard
549 Read the value of byte in <address>.
550 \end_layout
552 \begin_layout Subsubsection
553 read-s<size> <address>
554 \end_layout
556 \begin_layout Standard
557 Read the value of signed byte in <address>.
558 \end_layout
560 \begin_layout Subsubsection
561 write-<size> <address> <value>
562 \end_layout
564 \begin_layout Standard
565 Write <value> to byte in address <address>.
566 \end_layout
568 \begin_layout Subsection
569 Main commands
570 \end_layout
572 \begin_layout Standard
573 These commands are not available in lsnesrc, but are available after ROM
574  has been loaded.
575 \end_layout
577 \begin_layout Subsubsection
578 quit-emulator [/y]
579 \end_layout
581 \begin_layout Standard
582 Quits the emulator (asking for confirmation).
583  If /y is given, no confirmation is asked.
584 \end_layout
586 \begin_layout Subsubsection
587 pause-emulator
588 \end_layout
590 \begin_layout Standard
591 Toggle paused/unpaused
592 \end_layout
594 \begin_layout Subsubsection
595 +advance-frame 
596 \end_layout
598 \begin_layout Standard
599 Advance frame.
600  If the button is still held after configurable timeout expires, game unpauses
601  for the duration frame advance is held.
602 \end_layout
604 \begin_layout Subsubsection
605 +advance-poll 
606 \end_layout
608 \begin_layout Standard
609 Advance subframe.
610  If the button is still held after configurable timeout expires, game unpauses
611  for the duration frame advance is held.
612 \end_layout
614 \begin_layout Subsubsection
615 advance-skiplag 
616 \end_layout
618 \begin_layout Standard
619 Skip to first poll in frame after current.
620 \end_layout
622 \begin_layout Subsubsection
623 reset 
624 \end_layout
626 \begin_layout Standard
627 Reset the SNES after this frame.
628 \end_layout
630 \begin_layout Subsubsection
631 load <filename> 
632 \end_layout
634 \begin_layout Standard
635 Load savestate <filename> in current mode.
636 \end_layout
638 \begin_layout Subsubsection
639 load-state <filename> 
640 \end_layout
642 \begin_layout Standard
643 Load savestate <filename> in readwrite mode.
644 \end_layout
646 \begin_layout Subsubsection
647 load-readonly <filename> 
648 \end_layout
650 \begin_layout Standard
651 Load savestate <filename> in readonly mode.
652 \end_layout
654 \begin_layout Subsubsection
655 load-preserve <filename> 
656 \end_layout
658 \begin_layout Standard
659 Load savestate <filename> in readonly mode, preserving current events.
660 \end_layout
662 \begin_layout Subsubsection
663 load-movie <filename> 
664 \end_layout
666 \begin_layout Standard
667 Load savestate <filename>, ignoring save part in readonly mode.
668 \end_layout
670 \begin_layout Subsubsection
671 save-state <filename> 
672 \end_layout
674 \begin_layout Standard
675 Save system state to <filename> as soon as possible.
676 \end_layout
678 \begin_layout Subsubsection
679 save-movie <filename> 
680 \end_layout
682 \begin_layout Standard
683 Save movie to <filename>.
684 \end_layout
686 \begin_layout Subsubsection
687 set-rwmode 
688 \end_layout
690 \begin_layout Standard
691 Set read-write mode.
692 \end_layout
694 \begin_layout Subsubsection
695 set-romode 
696 \end_layout
698 \begin_layout Standard
699 Set read-only mode
700 \end_layout
702 \begin_layout Subsubsection
703 toggle-rwmode 
704 \end_layout
706 \begin_layout Standard
707 Toggle between read-only and read-write modes.
708 \end_layout
710 \begin_layout Subsubsection
711 test-1, test-2, test-3
712 \end_layout
714 \begin_layout Standard
715 Internal test commands.
716  Don't use.
717 \end_layout
719 \begin_layout Subsubsection
720 take-screenshot <filename> 
721 \end_layout
723 \begin_layout Standard
724 Save screenshot to <filename>.
725 \end_layout
727 \begin_layout Subsubsection
728 +controller <class>-<#>-<button>
729 \end_layout
731 \begin_layout Standard
732 Press button <button> on controller <num> of class <class>.
733 \end_layout
735 \begin_layout Itemize
736 Class 'gamepad': A, B, X, Y, L, R, select, start, up, down, left, right,
737  ext0, ext1, ext2, ext3
738 \end_layout
740 \begin_layout Itemize
741 Class 'mouse': L, R
742 \end_layout
744 \begin_layout Itemize
745 Class 'superscope': trigger, cursor, turbo, pause
746 \end_layout
748 \begin_layout Itemize
749 Class 'justifier': trigger, start
750 \end_layout
752 \begin_layout Itemize
753 Class 'gb': A, B, select, start, up, down, left, right
754 \end_layout
756 \begin_layout Subsubsection
757 hold-controller <class>-<#>-<button>
758 \end_layout
760 \begin_layout Standard
761 Hold/unhold button <button> on controller <num> of class <class>.
762 \end_layout
764 \begin_layout Subsubsection
765 type-controller <class>-<#>-<button>
766 \end_layout
768 \begin_layout Standard
769 Hold/unhold button <button> on controller <num> of class <class> for the
770  next frame.
771  See +controller for button names.
772 \end_layout
774 \begin_layout Standard
775 Cauntion: Does not work properly if outside frame advance.
776 \end_layout
778 \begin_layout Subsubsection
779 designate-position <class>-<#>-analog<n>
780 \end_layout
782 \begin_layout Standard
783 Designate position for analog pair.
784  <n> is only there if there are multiple axis pairs.
785 \end_layout
787 \begin_layout Subsubsection
788 autofire (<pattern>|-)...
789 \end_layout
791 \begin_layout Standard
792 Set autofire pattern.
793  Each parameter is comma-separated list of button names to hold on that
794  frame.
795  After reaching the end of pattern, the pattern restarts from the beginning.
796 \end_layout
798 \begin_layout Subsubsection
799 repaint
800 \end_layout
802 \begin_layout Standard
803 Force a repaint.
804 \end_layout
806 \begin_layout Subsection
807 Save jukebox 
808 \end_layout
810 \begin_layout Subsubsection
811 cycle-jukebox-backward
812 \end_layout
814 \begin_layout Standard
815 Cycle save jukebox backwards.
816 \end_layout
818 \begin_layout Subsubsection
819 cycle-jukebox-forward
820 \end_layout
822 \begin_layout Standard
823 Cycle save jukebox forwards
824 \end_layout
826 \begin_layout Subsubsection
827 load-jukebox
828 \end_layout
830 \begin_layout Standard
831 Do load from jukebox (current mode).
832 \end_layout
834 \begin_layout Subsubsection
835 save-jukebox
836 \end_layout
838 \begin_layout Standard
839 Do state save to jukebox.
840 \end_layout
842 \begin_layout Subsection
843 Lua 
844 \end_layout
846 \begin_layout Standard
847 Only available if lua support is compiled in.
848 \end_layout
850 \begin_layout Subsubsection
851 evaluate-lua <luacode>
852 \end_layout
854 \begin_layout Standard
855 Run Lua code <luacode> using built-in Lua interpretter.
856 \end_layout
858 \begin_layout Subsubsection
859 run-lua <script>
860 \end_layout
862 \begin_layout Standard
863 Run specified lua file using built-in Lua interpretter.
864 \end_layout
866 \begin_layout Subsubsection
867 reset-lua
868 \end_layout
870 \begin_layout Standard
871 Clear the Lua VM state and restore to factory defaults.
872 \end_layout
874 \begin_layout Subsection
875 Memory watch
876 \end_layout
878 \begin_layout Subsubsection
879 add-watch <name> <expression>
880 \end_layout
882 \begin_layout Standard
883 Adds new watch (or modifies old one).
884 \end_layout
886 \begin_layout Subsubsection
887 remove-watch <name>
888 \end_layout
890 \begin_layout Standard
891 Remove a watch.
892 \end_layout
894 \begin_layout Subsection
895 Sound 
896 \end_layout
898 \begin_layout Subsubsection
899 enable-sound <on/off> 
900 \end_layout
902 \begin_layout Standard
903 Enable/Disable sound.
904 \end_layout
906 \begin_layout Subsubsection
907 set-volume <multiplier>
908 \end_layout
910 \begin_layout Standard
911 Set the volume multiplier to <multiplier>.
912  1 is normal volume, and higher numbers are louder.
913 \end_layout
915 \begin_layout Subsubsection
916 set-volume <multiplier>%
917 \end_layout
919 \begin_layout Standard
920 Set the volume multiplier to <multiplier> percent.
921  100 is normal volume, and higher numbers are louder.
922 \end_layout
924 \begin_layout Subsubsection
925 set-volume <multiplier>dB
926 \end_layout
928 \begin_layout Standard
929 Set the volume multiplier to <multiplier> dB.
930  0 is normal volume, and higher numbers are louder.
931  The value may be negative.
932 \end_layout
934 \begin_layout Subsection
935 Misc.
936 \end_layout
938 \begin_layout Subsubsection
939 reload-rom [<file>]
940 \end_layout
942 \begin_layout Standard
943 Reloads the main ROM image from <file>.
944 \end_layout
946 \begin_layout Subsubsection
947 +tangent
948 \end_layout
950 \begin_layout Standard
951 Tangent for recording voice for commentary track.
952  While pressed, record a stream.
953 \end_layout
955 \begin_layout Section
956 Settings
957 \end_layout
959 \begin_layout Subsection
960 Core settings
961 \end_layout
963 \begin_layout Subsubsection
964 firmwarepath
965 \end_layout
967 \begin_layout Standard
968 Set where bsnes looks for firmware files.
969  Default is 
970 \begin_inset Quotes eld
971 \end_inset
974 \begin_inset Quotes erd
975 \end_inset
978 \end_layout
980 \begin_layout Subsubsection
981 target
982 \end_layout
984 \begin_layout Standard
985 Set the target .
986  Numeric, range is 0.001 to 
987 \begin_inset Quotes eld
988 \end_inset
990 infinite
991 \begin_inset Quotes erd
992 \end_inset
995  Default is native framerate.
996 \end_layout
998 \begin_layout Subsubsection
999 savecompression
1000 \end_layout
1002 \begin_layout Standard
1003 Set save compression level (integer 0-9).
1004  Default is 7 (0 is no compression).
1005 \end_layout
1007 \begin_layout Subsubsection
1008 advance-timeout
1009 \end_layout
1011 \begin_layout Standard
1012 Set the frame advance timeout in milliseconds.
1013  Numeric integer, range is 0-999999999.
1014  Default is 500.
1015 \end_layout
1017 \begin_layout Subsubsection
1018 allow-inconsistent-saves (bsnes only)
1019 \end_layout
1021 \begin_layout Standard
1022 If true, save without synchronization.
1023  Makes games seriously unstable.
1024 \end_layout
1026 \begin_layout Subsubsection
1027 save-every-frame (bsnes only)
1028 \end_layout
1030 \begin_layout Standard
1031 If true, simulate saving on each frame.
1032  Trades off emulation accuracy for sync stability.
1033  Also needed if the movie assumes saving on each frame for rewind.
1034 \end_layout
1036 \begin_layout Subsection
1037 AVI dumper settings
1038 \end_layout
1040 \begin_layout Subsubsection
1041 avi-large
1042 \end_layout
1044 \begin_layout Standard
1045 AVI dumper: Always dump at 512x448 or 512x478 regardless of what the console
1046  outputs.
1047 \end_layout
1049 \begin_layout Subsubsection
1050 avi-left-border
1051 \end_layout
1053 \begin_layout Standard
1054 AVI dumper: Set the default left border thickness (unless lua overrides)
1055  for dumps.
1056  Range 0-8191.
1057  Default is 0.
1058 \end_layout
1060 \begin_layout Subsubsection
1061 avi-right-border
1062 \end_layout
1064 \begin_layout Standard
1065 AVI dumper: Set the default right border thickness (unless lua overrides)
1066  for dumps.
1067  Range 0-8191.
1068  Default is 0.
1069 \end_layout
1071 \begin_layout Subsubsection
1072 avi-top-border
1073 \end_layout
1075 \begin_layout Standard
1076 AVI dumper: Set the default top border thickness (unless lua overrides)
1077  for dumps.
1078  Range 0-8191.
1079  Default is 0.
1080 \end_layout
1082 \begin_layout Subsubsection
1083 avi-bottom-border
1084 \end_layout
1086 \begin_layout Standard
1087 AVI dumper: Set the default bottom border thickness (unless lua overrides)
1088  for dumps.
1089  Range 0-8191.
1090  Default is 0.
1091 \end_layout
1093 \begin_layout Subsubsection
1094 avi-maxframes
1095 \end_layout
1097 \begin_layout Standard
1098 AVI dumper: Maximum number of frames per dump segment (0 => unlimited).
1099  Range 0-999999999.
1100  Default is 0.
1101 \end_layout
1103 \begin_layout Subsubsection
1104 avi-compresison
1105 \end_layout
1107 \begin_layout Standard
1108 AVI dumper: Compression level (0-18).
1109 \end_layout
1111 \begin_layout Itemize
1112 Compression levels 10 and above are not compatible with stock CSCD codec.
1113 \end_layout
1115 \begin_layout Itemize
1116 Recomended level is 7.
1117 \end_layout
1119 \begin_layout Subsubsection
1120 avi-soundrate
1121 \end_layout
1123 \begin_layout Standard
1124 AVI dumper: Set method of determining the sound rate.
1125 \end_layout
1127 \begin_layout Itemize
1128 0: Pick nearest of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96,
1129  128, 176.4 and 192 kHz.
1130 \end_layout
1132 \begin_layout Itemize
1133 1: Round down to nearest integer.
1134 \end_layout
1136 \begin_layout Itemize
1137 2: Round up to nearest ingeter.
1138 \end_layout
1140 \begin_layout Subsection
1141 JMD options
1142 \end_layout
1144 \begin_layout Subsubsection
1145 jmd-copression
1146 \end_layout
1148 \begin_layout Standard
1149 JMD dumper: Compression level (0-9).
1150 \end_layout
1152 \begin_layout Subsection
1153 SDL platform settings
1154 \end_layout
1156 \begin_layout Subsubsection
1157 autorepeat-first-delay
1158 \end_layout
1160 \begin_layout Standard
1161 Sets the delay for first character in typematic autorepeat.
1162 \end_layout
1164 \begin_layout Subsubsection
1165 autorepeat-subsequent-delay
1166 \end_layout
1168 \begin_layout Standard
1169 Sets the delay for subsequent characters in typematic autorepeat.
1170 \end_layout
1172 \begin_layout Section
1173 Lua functions
1174 \end_layout
1176 \begin_layout Subsection
1177 Core (in main table)
1178 \end_layout
1180 \begin_layout Subsubsection
1181 print
1182 \end_layout
1184 \begin_layout Standard
1185 Print line to message console.
1186 \end_layout
1188 \begin_layout Subsubsection
1189 exec(string command)
1190 \end_layout
1192 \begin_layout Standard
1193 Run command as it was entered on the command line
1194 \end_layout
1196 \begin_layout Subsubsection
1197 utime()
1198 \end_layout
1200 \begin_layout Standard
1201 Returns two values.
1202  First is time since some epoch in seconds, the second is microseconds mod
1203  10^6 since that epoch.
1204 \end_layout
1206 \begin_layout Subsubsection
1207 emulator_ready()
1208 \end_layout
1210 \begin_layout Standard
1211 Returns true if emulator has finished booting, false if not (on_startup()
1212  will be issued later).
1213 \end_layout
1215 \begin_layout Subsubsection
1216 set_idle_timeout(number timeout)
1217 \end_layout
1219 \begin_layout Standard
1220 Set number of microseconds to block idle for.
1221  After this timeout has expired, on_idle() will be called once.
1222 \end_layout
1224 \begin_layout Subsubsection
1225 set_timer_timeout(number timeout)
1226 \end_layout
1228 \begin_layout Standard
1229 Set number of microseconds to block timer for.
1230  After this timeout has expired, on_timer() will be called once.
1231 \end_layout
1233 \begin_layout Subsubsection
1234 bus_address(number snesaddr)
1235 \end_layout
1237 \begin_layout Standard
1238 Returns virtual address corresponding to specified address on SNES bus.
1239 \end_layout
1241 \begin_layout Subsubsection
1242 loopwrapper(function fun, ...)
1243 \end_layout
1245 \begin_layout Standard
1246 Calls function fun with function and specified arguments.
1247  The function passed suspends execution until the function returned is called.
1248  Handy for linear flow control among multiple invocations of a hook.
1249  Example code:
1250 \end_layout
1252 \begin_layout LyX-Code
1253 on_paint = loopwrapper(function(wait)
1254 \end_layout
1256 \begin_deeper
1257 \begin_layout LyX-Code
1258 while true do
1259 \end_layout
1261 \begin_deeper
1262 \begin_layout LyX-Code
1263 gui.text(0, 0, 
1264 \begin_inset Quotes eld
1265 \end_inset
1267 Test!
1268 \begin_inset Quotes erd
1269 \end_inset
1272 \end_layout
1274 \begin_layout LyX-Code
1275 wait();
1276 \end_layout
1278 \end_deeper
1279 \begin_layout LyX-Code
1281 \end_layout
1283 \end_deeper
1284 \begin_layout LyX-Code
1285 end);
1286 \end_layout
1288 \begin_layout Subsection
1289 Table bit:
1290 \end_layout
1292 \begin_layout Standard
1293 Bitwise logical functions and related.
1294 \end_layout
1296 \begin_layout Subsubsection
1297 bit.none(number...) / bit.bnot(number...)
1298 \end_layout
1300 \begin_layout Standard
1301 48-bit bitwise NOT / NONE function (set bits that are set in none of the
1302  arguments).
1303 \end_layout
1305 \begin_layout Subsubsection
1306 bit.any(number...) / bit.bor(number...)
1307 \end_layout
1309 \begin_layout Standard
1310 48-bit bitwise OR / ANY function (set bits that are set in any of the arguments).
1311 \end_layout
1313 \begin_layout Subsubsection
1314 bit.all(number...) / bit.band(number...)
1315 \end_layout
1317 \begin_layout Standard
1318 48-bit bitwise AND / ALL function (set bits that are set in all of the arguments
1320 \end_layout
1322 \begin_layout Subsubsection
1323 bit.parity(number...) / bit.bxor(number...)
1324 \end_layout
1326 \begin_layout Standard
1327 48-bit bitwise XOR / PARITY function (set bits that are set in odd number
1328  of the arguments).
1329 \end_layout
1331 \begin_layout Subsubsection
1332 bit.lrotate(number base[, number amount[, number bits]])
1333 \end_layout
1335 \begin_layout Standard
1336 Rotate bits-bit (max 48, default 48) number left by amount (default 1) places.
1337 \end_layout
1339 \begin_layout Subsubsection
1340 bit.rrotate(number base[, number amount[, number bits]])
1341 \end_layout
1343 \begin_layout Standard
1344 Rotate bits-bit (max 48, default 48) number right by amount (default 1)
1345  places.
1346 \end_layout
1348 \begin_layout Subsubsection
1349 bit.lshift(number base[, number amount[, number bits]])
1350 \end_layout
1352 \begin_layout Standard
1353 Shift bits-bit (max 48, default 48) number left by amount (default 1) places.
1354  The new bits are filled with zeroes.
1355 \end_layout
1357 \begin_layout Subsubsection
1358 bit.lrshift(number base[, number amount[, number bits]])
1359 \end_layout
1361 \begin_layout Standard
1362 Shift bits-bit (max 48, default 48) number logically right by amount (default
1363  1) places.
1364  The new bits are filled with zeroes.
1365 \end_layout
1367 \begin_layout Subsubsection
1368 bit.arshift(number base[, number amount[, number bits]])
1369 \end_layout
1371 \begin_layout Standard
1372 Shift bits-bit (max 48, default 48) number arithmetically right by amount
1373  (default 1) places.
1374  The new bits are shifted in with copy of the high bit.
1375 \end_layout
1377 \begin_layout Subsubsection
1378 bit.extract(number base[, number bit0[, number bit1,...]])
1379 \end_layout
1381 \begin_layout Standard
1382 Returns number that has bit0-th bit as bit 0, bit1-th bit as 1 and so on.
1383 \end_layout
1385 \begin_layout Standard
1386 Notes: 
1387 \end_layout
1389 \begin_layout Itemize
1390 Bit numbers up to 51 should work reliably (then things start falling apart
1391  due to double precision issues).
1392 \end_layout
1394 \begin_layout Itemize
1395 There are two special bit positions, true and false, standing for always
1396  set bit and always clear bit.
1397 \end_layout
1399 \begin_layout Subsubsection
1400 bit.value([number bit1[, number bit2,...]])
1401 \end_layout
1403 \begin_layout Standard
1404 Returns bitwise OR of 1 left shifted by bit1 places, 1 left shifted by bit2
1405  places and so on.
1406  As special value, nil argument is no-op.
1407 \end_layout
1409 \begin_layout Subsection
1410 Table gui:
1411 \end_layout
1413 \begin_layout Standard
1414 Most of these functions can only be called in on_paint and on_video callbacks.
1415  Exceptions are noted.
1416 \end_layout
1418 \begin_layout Standard
1419 Colors are 32-bit.
1420  Bits 0-7 are the blue component, bits 8-15 are the green component, bits
1421  16-23 are the red component, bits 24-31 are alpha component (0 is fully
1422  opaque, 255 is almost transparent).
1423  -1 is the fully transparent color.
1424  Alpha values greater than 127 do work.
1425 \end_layout
1427 \begin_layout Standard
1428 Origin of coordinates is at top left corner of game display area.
1429  Left and top gaps correspond to negative coordinates.
1430 \end_layout
1432 \begin_layout Subsubsection
1433 gui.resolution()
1434 \end_layout
1436 \begin_layout Standard
1437 Returns 2-tuple (hresolution, vresolution).
1438 \end_layout
1440 \begin_layout Subsubsection
1441 gui.<class>_gap(number gap)
1442 \end_layout
1444 \begin_layout Standard
1445 Set the <class> (left, right, top, bottom) gap to specified value (max gap
1446  is 8191).
1447 \end_layout
1449 \begin_layout Subsubsection
1450 gui.text(number x, number y, string text[, number fgc[, number bgc]])
1451 \end_layout
1453 \begin_layout Standard
1454 Draw specified text on the GUI (each character cell is 8 or 16 wide and
1455  16 high).
1456  Parameters:
1457 \end_layout
1459 \begin_layout Itemize
1460 x: X-coordinate to start the drawing from (and x-coordinate at begining
1461  of the lines).
1462 \end_layout
1464 \begin_layout Itemize
1465 y: Y-coordinate to start the drawing from.
1466 \end_layout
1468 \begin_layout Itemize
1469 text: The text to draw.
1470 \end_layout
1472 \begin_layout Itemize
1473 fgc: Text color (default is 0xFFFFFF (white))
1474 \end_layout
1476 \begin_layout Itemize
1477 bgc: Background color (default is -1 (transparent))
1478 \end_layout
1480 \begin_layout Subsubsection
1481 gui.textH(number x, number y, string text[, number fgc[, number bgc]])
1482 \end_layout
1484 \begin_layout Standard
1485 Like gui.text, but draw using double-width.
1486 \end_layout
1488 \begin_layout Subsubsection
1489 gui.textV(number x, number y, string text[, number fgc[, number bgc]])
1490 \end_layout
1492 \begin_layout Standard
1493 Like gui.text, but draw using double-height.
1494 \end_layout
1496 \begin_layout Subsubsection
1497 gui.textHV(number x, number y, string text[, number fgc[, number bgc]])
1498 \end_layout
1500 \begin_layout Standard
1501 Like gui.text, but draw using double-width/double-height.
1502 \end_layout
1504 \begin_layout Subsubsection
1505 gui.rectangle(number x, number y, number width, number height[, number thickness[
1506 , number outline[, number fill]]])
1507 \end_layout
1509 \begin_layout Standard
1510 Draw rectangle on the GUI.
1511  Parameters:
1512 \end_layout
1514 \begin_layout Itemize
1515 x: X-coordinate of left edge.
1516 \end_layout
1518 \begin_layout Itemize
1519 y: Y-coordinate of upper edge.
1520 \end_layout
1522 \begin_layout Itemize
1523 width: Width of rectangle.
1524 \end_layout
1526 \begin_layout Itemize
1527 height: Height of rectangle.
1528 \end_layout
1530 \begin_layout Itemize
1531 thickness: Thickness of outline (default is 1).
1532 \end_layout
1534 \begin_layout Itemize
1535 outline: Color of outline (default is 0xFFFFFF (white))
1536 \end_layout
1538 \begin_layout Itemize
1539 fill: Color of fill (default is -1 (transparent))
1540 \end_layout
1542 \begin_layout Subsubsection
1543 gui.box(number x, number y, number width, number height[, number thickness[,
1544  number outline1[,number outline2[, number fill]]]])
1545 \end_layout
1547 \begin_layout Standard
1548 Draw rectangle with 3D effect on the GUI.
1549  Parameters:
1550 \end_layout
1552 \begin_layout Itemize
1553 x: X-coordinate of left edge.
1554 \end_layout
1556 \begin_layout Itemize
1557 y: Y-coordinate of upper edge.
1558 \end_layout
1560 \begin_layout Itemize
1561 width: Width of rectangle.
1562 \end_layout
1564 \begin_layout Itemize
1565 height: Height of rectangle.
1566 \end_layout
1568 \begin_layout Itemize
1569 thickness: Thickness of outline (default is 1).
1570 \end_layout
1572 \begin_layout Itemize
1573 outline1: First color of outline (default is 0xFFFFFF (white))
1574 \end_layout
1576 \begin_layout Itemize
1577 outline2: First color of outline (default is 0x808080 (dark gray))
1578 \end_layout
1580 \begin_layout Itemize
1581 fill: Color of fill (default is 0xC0C0C0 (light grayy))
1582 \end_layout
1584 \begin_layout Subsubsection
1585 gui.pixel(number x, number y[, number color])
1586 \end_layout
1588 \begin_layout Standard
1589 Draw one pixel on the GUI.
1590  Parameters:
1591 \end_layout
1593 \begin_layout Itemize
1594 x: X-coordinate of the pixel
1595 \end_layout
1597 \begin_layout Itemize
1598 y: Y-coordinate of the pixel
1599 \end_layout
1601 \begin_layout Itemize
1602 color: Color of the pixel (default is 0xFFFFFF (white))
1603 \end_layout
1605 \begin_layout Subsubsection
1606 gui.crosshair(number x, number y[, number length[, number color]])
1607 \end_layout
1609 \begin_layout Standard
1610 Draw a crosshair.
1611  Parameters:
1612 \end_layout
1614 \begin_layout Itemize
1615 x: X-coordinate of the crosshair
1616 \end_layout
1618 \begin_layout Itemize
1619 y: Y-coordinate of the crosshair
1620 \end_layout
1622 \begin_layout Itemize
1623 length: Length of the crosshair lines (default 10).
1624 \end_layout
1626 \begin_layout Itemize
1627 color: Color of the crosshair (default is 0xFFFFFF (white))
1628 \end_layout
1630 \begin_layout Subsubsection
1631 gui.line(number x1, number y1, number x2, number y2[, number color])
1632 \end_layout
1634 \begin_layout Standard
1635 Draw a thin line.
1636  Parameters:
1637 \end_layout
1639 \begin_layout Itemize
1640 x1: X-coordinate of one end.
1641 \end_layout
1643 \begin_layout Itemize
1644 y1: Y-coordinate of one end.
1645 \end_layout
1647 \begin_layout Itemize
1648 x2: X-coordinate of the other end.
1649 \end_layout
1651 \begin_layout Itemize
1652 y2: Y-coordinate of the other end.
1653 \end_layout
1655 \begin_layout Itemize
1656 color: Color of the line (default is 0xFFFFFF (white)).
1657 \end_layout
1659 \begin_layout Subsubsection
1660 gui.circle(number x, number y, number r[, number thick[, number border[,
1661  number fil]]])
1662 \end_layout
1664 \begin_layout Standard
1665 Draw a circle.
1666  Parameters.
1667 \end_layout
1669 \begin_layout Itemize
1670 x: X-coordinate of the center
1671 \end_layout
1673 \begin_layout Itemize
1674 y: Y-coordinate of the center
1675 \end_layout
1677 \begin_layout Itemize
1678 r: The radius of the circle
1679 \end_layout
1681 \begin_layout Itemize
1682 thick: Border thickness
1683 \end_layout
1685 \begin_layout Itemize
1686 border: Border color (default is 0xFFFFFF (white))
1687 \end_layout
1689 \begin_layout Itemize
1690 fill: Fill color (default is -1 (transparent)).
1691 \end_layout
1693 \begin_layout Subsubsection
1694 gui.bitmap_draw(number x, number y, bitmap bitmap, palette palette)
1695 \end_layout
1697 \begin_layout Standard
1698 Draw a bitmap on screen with specified palette.
1699  Parameters:
1700 \end_layout
1702 \begin_layout Itemize
1703 x: X-coordinate of left edge.
1704 \end_layout
1706 \begin_layout Itemize
1707 y: Y-coordinate of top edge.
1708 \end_layout
1710 \begin_layout Itemize
1711 bitmap: The bitmap to draw
1712 \end_layout
1714 \begin_layout Itemize
1715 palette: The palette to draw the bitmap using.
1716 \end_layout
1718 \begin_layout Subsubsection
1719 gui.bitmap_draw(number x, number y, dbitmap bitmap)
1720 \end_layout
1722 \begin_layout Standard
1723 Draw a bitmap on screen.
1724  Parameters:
1725 \end_layout
1727 \begin_layout Itemize
1728 x: X-coordinate of left edge.
1729 \end_layout
1731 \begin_layout Itemize
1732 y: Y-coordinate of top edge.
1733 \end_layout
1735 \begin_layout Itemize
1736 bitmap: The bitmap to draw
1737 \end_layout
1739 \begin_layout Subsubsection
1740 gui.palette_new()
1741 \end_layout
1743 \begin_layout Standard
1744 Returns a new palette (initially all transparent).
1745  Can be used anywhere.
1746 \end_layout
1748 \begin_layout Subsubsection
1749 gui.bitmap_new(number w, number h, boolean direct[, bool icolor])
1750 \end_layout
1752 \begin_layout Standard
1753 Returns a new bitmap/dbitmap.
1754  Can be used anywhere.
1755  Parameters:
1756 \end_layout
1758 \begin_layout Itemize
1759 w: The width of new bitmap
1760 \end_layout
1762 \begin_layout Itemize
1763 h: The height of new bitmap
1764 \end_layout
1766 \begin_layout Itemize
1767 direct: If true, the returned bitmap is dbitmap, otherwise bitmap.
1768 \end_layout
1770 \begin_layout Itemize
1771 icolor: Initital fill color (defaults to 0 on BITMAP, -1 on DBITMAP)
1772 \end_layout
1774 \begin_layout Subsubsection
1775 gui.bitmap_load(string file)
1776 \end_layout
1778 \begin_layout Standard
1779 Returns loaded bitmap/dbitmap (if bitmap, the second return value is palette
1780  for bitmap).
1781  Can be used anywhere.
1782  Parameters:
1783 \end_layout
1785 \begin_layout Itemize
1786 file: The name of file to load.
1787 \end_layout
1789 \begin_layout Subsubsection
1790 gui.palette_set(palette palette, number index, number color)
1791 \end_layout
1793 \begin_layout Standard
1794 Sets color in palette.
1795  Can be used anywhere.
1796  Parameters:
1797 \end_layout
1799 \begin_layout Itemize
1800 palette: The palette to manipulate
1801 \end_layout
1803 \begin_layout Itemize
1804 index: Index of color (0-65535).
1805 \end_layout
1807 \begin_layout Itemize
1808 color: The color value.
1809 \end_layout
1811 \begin_layout Subsubsection
1812 gui.bitmap_pset(bitmap/dbitmap bitmap, number x, number y, number color)
1813 \end_layout
1815 \begin_layout Standard
1816 Sets specified pixel in bitmap.
1817  Can be used anywhere.
1818  Parameters:
1819 \end_layout
1821 \begin_layout Itemize
1822 bitmap: The bitmap to manipulate
1823 \end_layout
1825 \begin_layout Itemize
1826 x: The x-coordinate of the pixel.
1827 \end_layout
1829 \begin_layout Itemize
1830 y: The y-coordinate of the pixel.
1831 \end_layout
1833 \begin_layout Itemize
1834 color: If bitmap is a bitmap, color index (0-65535).
1835  Otherwise color value.
1836 \end_layout
1838 \begin_layout Subsubsection
1839 gui.bitmap_size(bitmap/dbitmap bitmap)
1840 \end_layout
1842 \begin_layout Standard
1843 Get size of bitmap.
1844  Can be used anywhere.
1845  Parameters:
1846 \end_layout
1848 \begin_layout Itemize
1849 bitmap: The bitmap to query.
1850 \end_layout
1852 \begin_layout Standard
1853 The first return is the width, the second is the height.
1854 \end_layout
1856 \begin_layout Subsubsection
1857 gui.bitmap_blit(bitmap/dbitmap dest, number dx, number dy, bitmap/dbitmap
1858  src, number sx, number sy, number w, number h[, number ck])
1859 \end_layout
1861 \begin_layout Standard
1862 Blit a part of bitmap to another.
1863  Can be used anywhere.
1864  Parameters:
1865 \end_layout
1867 \begin_layout Itemize
1868 dest: Destination to blit to.
1869 \end_layout
1871 \begin_layout Itemize
1872 dx: left edge of target
1873 \end_layout
1875 \begin_layout Itemize
1876 dy: Top edge of target
1877 \end_layout
1879 \begin_layout Itemize
1880 src: The source to blit from.
1881  Must be of the same type as destination.
1882 \end_layout
1884 \begin_layout Itemize
1885 sx: left edge of source
1886 \end_layout
1888 \begin_layout Itemize
1889 sy: Top edge of source
1890 \end_layout
1892 \begin_layout Itemize
1893 w: Width of region
1894 \end_layout
1896 \begin_layout Itemize
1897 h: Height of region.
1898 \end_layout
1900 \begin_layout Itemize
1901 ck: Color key.
1902  Pixels of this color are not blitted.
1903 \end_layout
1905 \begin_deeper
1906 \begin_layout Itemize
1907 If bitmaps are bitmaps, this is color index of colorkey.
1908  Values outside range 0-65535 cause no key to be used as colorkey.
1909 \end_layout
1911 \begin_layout Itemize
1912 If bitmaps are dbitmaps, this color value of colorkey.
1913 \end_layout
1915 \begin_layout Itemize
1916 May be absent or nil for no colorkey blit.
1917 \end_layout
1919 \end_deeper
1920 \begin_layout Subsubsection
1921 gui.repaint()
1922 \end_layout
1924 \begin_layout Standard
1925 Request on_repaint() to happen as soon as possible.
1926  Can be used anywhere.
1927 \end_layout
1929 \begin_layout Subsubsection
1930 gui.subframe_update(boolean on)
1931 \end_layout
1933 \begin_layout Standard
1934 Request subframe updates (calling on_paint() on subframes) to happen (on=true)
1935  or not happen (on=false).
1936  Can be used anywhere.
1937 \end_layout
1939 \begin_layout Subsubsection
1940 gui.screenshot(string filename)
1941 \end_layout
1943 \begin_layout Standard
1944 Write PNG screenshot of the current frame (no drawings) to specified file.
1945  Can be used anywhere.
1946 \end_layout
1948 \begin_layout Subsubsection
1949 gui.color(number r, number g, number b[, number a])
1950 \end_layout
1952 \begin_layout Standard
1953 Returns color (in notation Lua scripts use) corresponding to color (r,g,b),
1954  each component in scale 0-255.
1955  If a is specified, that is alpha (0 is fully transparent, 256(sic) is fully
1956  opaque).
1957  The default alpha is 256.
1958 \end_layout
1960 \begin_layout Subsubsection
1961 gui.status(string name, string value)
1962 \end_layout
1964 \begin_layout Standard
1965 Set status field 
1966 \begin_inset Quotes eld
1967 \end_inset
1969 L[<name>]
1970 \begin_inset Quotes erd
1971 \end_inset
1973  to <value> in status area.
1974  Can be used anywhere.
1975 \end_layout
1977 \begin_layout Subsubsection
1978 gui.rainbow(number step, number steps[, number color])
1979 \end_layout
1981 \begin_layout Standard
1982 Perform hue rotation of color <color> (default bright red), by <step> steps.
1983  The number of steps per full rotation is given by absolute value of <steps>.
1984 \end_layout
1986 \begin_layout Standard
1987 If <steps> is negative, the rotation will be counterclockwise.
1988 \end_layout
1990 \begin_layout Subsubsection
1991 gui.screenshot(string filename)
1992 \end_layout
1994 \begin_layout Standard
1995 Saves a screenshot into specified file.
1996 \end_layout
1998 \begin_layout Subsection
1999 table input
2000 \end_layout
2002 \begin_layout Standard
2003 Input handling.
2004  Only available in on_input callback.
2005 \end_layout
2007 \begin_layout Subsubsection
2008 input.get(number controller, number index)
2009 \end_layout
2011 \begin_layout Standard
2012 Read the specified index (0-11) from specified controller (0-7).
2013  Notes:
2014 \end_layout
2016 \begin_layout Itemize
2017 Uses physical controller numbering.
2018  Gamepad in port 2 is controller 4, not 1!
2019 \end_layout
2021 \begin_layout Subsubsection
2022 input.set(number controller, number index, number value)
2023 \end_layout
2025 \begin_layout Standard
2026 Write the specified index (0-11) from specified controller (0-7), storing
2027  value.
2028  Notes:
2029 \end_layout
2031 \begin_layout Itemize
2032 Uses physical controller numbering.
2033  Gamepad in port 2 is controller 4, not 1!
2034 \end_layout
2036 \begin_layout Subsubsection
2037 input.geta(number controller)
2038 \end_layout
2040 \begin_layout Standard
2041 Get input state for entiere controller.
2042  Returns 13 return values.
2043 \end_layout
2045 \begin_layout Itemize
2046 1st return value: Bitmask: bit i is set if i:th index is nonzero
2047 \end_layout
2049 \begin_layout Itemize
2050 2nd-13th return value: value of i:th index.
2051 \end_layout
2053 \begin_layout Subsubsection
2054 input.seta(number controller, number bitmask, number args...)
2055 \end_layout
2057 \begin_layout Standard
2058 Set state for entiere controller.
2059  args is up to 12 values for indices (overriding values in bitmask if specified).
2060 \end_layout
2062 \begin_layout Subsubsection
2063 input.controllertype(number controller)
2064 \end_layout
2066 \begin_layout Standard
2067 Get the type of controller as string.
2068  Valid values are:
2069 \end_layout
2071 \begin_layout Itemize
2072 gamepad
2073 \end_layout
2075 \begin_layout Itemize
2076 mouse
2077 \end_layout
2079 \begin_layout Itemize
2080 justifier
2081 \end_layout
2083 \begin_layout Itemize
2084 superscope
2085 \end_layout
2087 \begin_layout Subsubsection
2088 input.reset([number cycles])
2089 \end_layout
2091 \begin_layout Standard
2092 Execute reset.
2093  If cycles is greater than zero, do delayed reset.
2094  0 (or no value) causes immediate reset.
2095 \end_layout
2097 \begin_layout Itemize
2098 Only available with subframe flag false.
2099 \end_layout
2101 \begin_layout Subsubsection
2102 input.raw()
2103 \end_layout
2105 \begin_layout Standard
2106 Returns table of tables of all available keys and axes.
2107  The first table is indexed by key name (platform-dependent!), and the inner
2108  table has the following fields:
2109 \end_layout
2111 \begin_layout Itemize
2112 value: Last reported value for control
2113 \end_layout
2115 \begin_deeper
2116 \begin_layout Itemize
2117 For keys: 1 for pressed, 0 for released.
2118 \end_layout
2120 \begin_layout Itemize
2121 For axes: -32767...32767.
2122 \end_layout
2124 \begin_layout Itemize
2125 For presure-sensitive buttons: 0...32767.
2126 \end_layout
2128 \begin_layout Itemize
2129 For hats: Bitmask: 1=>Up, 2=>Right, 4=>Down, 8=>Left.
2130 \end_layout
2132 \begin_layout Itemize
2133 For mouse: Coordinates relative to game area.
2134 \end_layout
2136 \end_deeper
2137 \begin_layout Itemize
2138 ktype: Type of key (disabled, key, mouse, axis, axis-inverse, hat, pressure-m0,
2139  pressure-mp, pressure-0m, pressure-0p, pressure-pm, pressure-p0).
2140 \end_layout
2142 \begin_layout Subsubsection
2143 input.keyhook(string key, boolean state)
2144 \end_layout
2146 \begin_layout Standard
2147 Requests that keyhook events to be sent for key (state=true) or not sent
2148  (state=false).
2149 \end_layout
2151 \begin_layout Subsubsection
2152 input.joyget(number controller)
2153 \end_layout
2155 \begin_layout Standard
2156 Returns table for current controls for specified controller.
2157  The names of fields vary by controller type.
2158 \end_layout
2160 \begin_layout Itemize
2161 The buttons have the same name as those are referred to in other contexts
2162  in the emulator
2163 \end_layout
2165 \begin_layout Itemize
2166 The analog axes are 
2167 \begin_inset Quotes eld
2168 \end_inset
2170 xaxis
2171 \begin_inset Quotes erd
2172 \end_inset
2174  and 
2175 \begin_inset Quotes eld
2176 \end_inset
2178 yaxis
2179 \begin_inset Quotes erd
2180 \end_inset
2183 \end_layout
2185 \begin_layout Subsubsection
2186 input.joyset(number controller, table controls)
2187 \end_layout
2189 \begin_layout Standard
2190 Set the the state of specified controller to values specified in specified
2191  table.
2192 \end_layout
2194 \begin_layout Subsubsection
2195 input.lcid_to_pcid(number controller)
2196 \end_layout
2198 \begin_layout Standard
2199 Return the physical index, physical port and controller number in port for
2200  specified (1-based) logical controller.
2201 \end_layout
2203 \begin_layout Subsection
2204 Table keyboard
2205 \end_layout
2207 \begin_layout Standard
2208 Various keybinding-related functions
2209 \end_layout
2211 \begin_layout Subsubsection
2212 keyboard.bind(string mod, string mask, string key, string cmd)
2213 \end_layout
2215 \begin_layout Standard
2216 Bind specified key with specified modifers to specified command.
2217 \end_layout
2219 \begin_layout Subsubsection
2220 keyboard.unbind(string mod, string mask, string key)
2221 \end_layout
2223 \begin_layout Standard
2224 Unbind specified key with specified modifers.
2225 \end_layout
2227 \begin_layout Subsubsection
2228 keyboard.alias(string alias, string expansion)
2229 \end_layout
2231 \begin_layout Standard
2232 Set expansion of given command.
2233 \end_layout
2235 \begin_layout Subsection
2236 Table subtitle
2237 \end_layout
2239 \begin_layout Standard
2240 Subtitle handling
2241 \end_layout
2243 \begin_layout Subsubsection
2244 subtitle.byindex(number i)
2245 \end_layout
2247 \begin_layout Standard
2248 Read the frame and length of ith subtitle.
2249  Returns nothing if not present.
2250 \end_layout
2252 \begin_layout Subsubsection
2253 subtitle.set(number f, number l, string txt)
2254 \end_layout
2256 \begin_layout Standard
2257 Set the text of subtitle.
2258 \end_layout
2260 \begin_layout Subsubsection
2261 subtitle.get(number f, number l)
2262 \end_layout
2264 \begin_layout Standard
2265 Get the text of subtitle.
2266 \end_layout
2268 \begin_layout Subsubsection
2269 subtitle.delete(number f, number l)
2270 \end_layout
2272 \begin_layout Standard
2273 Delete specified subtitle.
2274 \end_layout
2276 \begin_layout Subsection
2277 Table hostmemory
2278 \end_layout
2280 \begin_layout Standard
2281 Host memory handling (extra memory saved to savestates).
2282  Host memory starts empty.
2283 \end_layout
2285 \begin_layout Subsubsection
2286 hostmemory.read(number address)
2287 \end_layout
2289 \begin_layout Standard
2290 Reads hostmemory slot address.
2291  Slot numbers out of range return false instead of numeric.
2292 \end_layout
2294 \begin_layout Subsubsection
2295 hostmemory.write(number address, number value)
2296 \end_layout
2298 \begin_layout Standard
2299 Writes hostmemory slot with 0-255.
2300  Slot numbers out of range cause extension of host memory slot space.
2301 \end_layout
2303 \begin_layout Subsubsection
2304 hostmemory.readbyte(number address)
2305 \end_layout
2307 \begin_layout Standard
2308 Read unsigned byte (1 element) from given address.
2309  Slots out of range return false.
2310 \end_layout
2312 \begin_layout Subsubsection
2313 hostmemory.writebyte(number address, number value)
2314 \end_layout
2316 \begin_layout Standard
2317 Write unsigned byte (1 element) to given slot.
2318  Slot numbers out of range cause extension.
2319 \end_layout
2321 \begin_layout Subsubsection
2322 hostmemory.readsbyte(number address)
2323 \end_layout
2325 \begin_layout Standard
2326 Read signed byte (1 element) from given address.
2327  Slots out of range return false.
2328 \end_layout
2330 \begin_layout Subsubsection
2331 hostmemory.writesbyte(number address, number value)
2332 \end_layout
2334 \begin_layout Standard
2335 Write signed byte (1 element) to given slot.
2336  Slot numbers out of range cause extension.
2337 \end_layout
2339 \begin_layout Subsubsection
2340 hostmemory.readword(number address)
2341 \end_layout
2343 \begin_layout Standard
2344 Read unsigned word (2 elements) from given address.
2345  Slots out of range return false.
2346 \end_layout
2348 \begin_layout Subsubsection
2349 hostmemory.writeword(number address, number value)
2350 \end_layout
2352 \begin_layout Standard
2353 Write unsigned word (2 elements) to given slot.
2354  Slot numbers out of range cause extension.
2355 \end_layout
2357 \begin_layout Subsubsection
2358 hostmemory.readsword(number address)
2359 \end_layout
2361 \begin_layout Standard
2362 Read signed word (2 elements) from given address.
2363  Slots out of range return false.
2364 \end_layout
2366 \begin_layout Subsubsection
2367 hostmemory.writesword(number address, number value)
2368 \end_layout
2370 \begin_layout Standard
2371 Write signed word (2 elements) to given slot.
2372  Slot numbers out of range cause extension.
2373 \end_layout
2375 \begin_layout Subsubsection
2376 hostmemory.readdword(number address)
2377 \end_layout
2379 \begin_layout Standard
2380 Read unsigned doubleword (4 elements) from given address.
2381  Slots out of range return false.
2382 \end_layout
2384 \begin_layout Subsubsection
2385 hostmemory.writedword(number address, number value)
2386 \end_layout
2388 \begin_layout Standard
2389 Write unsigned doubleword (4 elements) to given slot.
2390  Slot numbers out of range cause extension.
2391 \end_layout
2393 \begin_layout Subsubsection
2394 hostmemory.readsdword(number address)
2395 \end_layout
2397 \begin_layout Standard
2398 Read signed doubleword (4 elements) from given address.
2399  Slots out of range return false.
2400 \end_layout
2402 \begin_layout Subsubsection
2403 hostmemory.writesdword(number address, number value)
2404 \end_layout
2406 \begin_layout Standard
2407 Write signed doubleword (4 elements) to given slot.
2408  Slot numbers out of range cause extension.
2409 \end_layout
2411 \begin_layout Subsubsection
2412 hostmemory.readqword(number address)
2413 \end_layout
2415 \begin_layout Standard
2416 Read unsigned quadword (8 elements) from given address.
2417  Slots out of range return false.
2418 \end_layout
2420 \begin_layout Subsubsection
2421 hostmemory.writeqword(number address, number value)
2422 \end_layout
2424 \begin_layout Standard
2425 Write unsigned quadword (4 elements) to given slot.
2426  Slot numbers out of range cause extension.
2427 \end_layout
2429 \begin_layout Subsubsection
2430 hostmemory.readsqword(number address)
2431 \end_layout
2433 \begin_layout Standard
2434 Read signed quadword (8 elements) from given address.
2435  Slots out of range return false.
2436 \end_layout
2438 \begin_layout Subsubsection
2439 hostmemory.writesqword(number address, number value)
2440 \end_layout
2442 \begin_layout Standard
2443 Write signed quadword (8 elements) to given slot.
2444  Slot numbers out of range cause extension.
2445 \end_layout
2447 \begin_layout Subsection
2448 Table movie
2449 \end_layout
2451 \begin_layout Standard
2452 Movie handling
2453 \end_layout
2455 \begin_layout Subsubsection
2456 movie.currentframe()
2457 \end_layout
2459 \begin_layout Standard
2460 Return number of current frame.
2461 \end_layout
2463 \begin_layout Subsubsection
2464 movie.framecount()
2465 \end_layout
2467 \begin_layout Standard
2468 Return number of frames in movie.
2469 \end_layout
2471 \begin_layout Subsubsection
2472 movie.readonly()
2473 \end_layout
2475 \begin_layout Standard
2476 Return true if in readonly mode, false if in readwrite.
2477 \end_layout
2479 \begin_layout Subsubsection
2480 movie.rerecords()
2481 \end_layout
2483 \begin_layout Standard
2484 Returns the current value of rerecord count.
2485 \end_layout
2487 \begin_layout Subsubsection
2488 movie.set_readwrite()
2489 \end_layout
2491 \begin_layout Standard
2492 Set readwrite mode (does not cause on_readwrite callback).
2493 \end_layout
2495 \begin_layout Subsubsection
2496 movie.frame_subframes(number frame)
2497 \end_layout
2499 \begin_layout Standard
2500 Count number of subframes in specified frame (frame numbers are 1-based)
2501  and return that.
2502 \end_layout
2504 \begin_layout Subsubsection
2505 movie.read_subframe(number frame, number subframe)
2506 \end_layout
2508 \begin_layout Standard
2509 Read specifed subframe in specified frame and return data as array (100
2510  elements, numbered 0-99 currently).
2511 \end_layout
2513 \begin_layout Subsubsection
2514 movie.read_rtc()
2515 \end_layout
2517 \begin_layout Standard
2518 Returns the current value of the RTC as a pair (second, subsecond).
2519 \end_layout
2521 \begin_layout Subsubsection
2522 movie.unsafe_rewind([UNSAFEREWIND state])
2523 \end_layout
2525 \begin_layout Standard
2526 Start setting point for unsafe rewind or jump to point of unsafe rewind.
2527 \end_layout
2529 \begin_layout Itemize
2530 If called without argument, causes emulator to start process of setting
2531  unsafe rewind point.
2532  When this has finished, callback on_set_rewind occurs, passing the rewind
2533  state to lua script.
2534 \end_layout
2536 \begin_layout Itemize
2537 If called with argument, causes emulator rewind to passed rewind point as
2538  soon as possible.
2539  Readwrite mode is implicitly activated.
2540 \end_layout
2542 \begin_layout Standard
2543 The following warnings apply to unsafe rewinding:
2544 \end_layout
2546 \begin_layout Itemize
2547 There are no safety checks against misuse (that's what 
2548 \begin_inset Quotes eld
2549 \end_inset
2551 unsafe
2552 \begin_inset Quotes erd
2553 \end_inset
2555  comes from)!
2556 \end_layout
2558 \begin_layout Itemize
2559 Only call rewind from timeline rewind point was set from.
2560 \end_layout
2562 \begin_layout Itemize
2563 Only call rewind from after the rewind point was set.
2564 \end_layout
2566 \begin_layout Subsection
2567 Table settings
2568 \end_layout
2570 \begin_layout Standard
2571 Routines for settings manipulation
2572 \end_layout
2574 \begin_layout Subsubsection
2575 settings.get(string name)
2576 \end_layout
2578 \begin_layout Standard
2579 Get value of setting.
2580  If setting is blank, returns false.
2581  If setting value can't be obtained, returns (nil, error message).
2582 \end_layout
2584 \begin_layout Subsubsection
2585 settings.set(string name, string value)
2586 \end_layout
2588 \begin_layout Standard
2589 Set value of setting.
2590  If setting can't be set, returns (nil, error message).
2591 \end_layout
2593 \begin_layout Subsubsection
2594 settings.is_set(string name)
2595 \end_layout
2597 \begin_layout Standard
2598 Returns if setting is set.
2599  If setting does not exist, returns (nil, error message).
2600 \end_layout
2602 \begin_layout Subsubsection
2603 settings.blank(string name)
2604 \end_layout
2606 \begin_layout Standard
2607 Blanks a setting and returns true.
2608  If setting can't be blanked, returns (nil, error message).
2609 \end_layout
2611 \begin_layout Subsection
2612 Table memory
2613 \end_layout
2615 \begin_layout Standard
2616 Contains various functions for managing memory
2617 \end_layout
2619 \begin_layout Subsubsection
2620 memory.vma_count()
2621 \end_layout
2623 \begin_layout Standard
2624 Returns the number of VMAs
2625 \end_layout
2627 \begin_layout Subsubsection
2628 memory.read_vma(number index)
2629 \end_layout
2631 \begin_layout Standard
2632 Reads the specified VMA (indices start from zero).
2633  Trying to read invalid VMA gives nil.
2634  The read VMA is table with the following fields:
2635 \end_layout
2637 \begin_layout Itemize
2638 region_name (string): The readable name of the VMA
2639 \end_layout
2641 \begin_layout Itemize
2642 baseaddr (number): Base address of the VMA
2643 \end_layout
2645 \begin_layout Itemize
2646 lastaddr (number): Last address in the VMA.
2647 \end_layout
2649 \begin_layout Itemize
2650 size (number): The size of VMA in bytes.
2651 \end_layout
2653 \begin_layout Itemize
2654 readonly (boolean): True of the VMA corresponds to ROM.
2655 \end_layout
2657 \begin_layout Itemize
2658 iospace (boolean): True if the VMA is I/O space.
2659 \end_layout
2661 \begin_layout Itemize
2662 native_endian (boolean): True if the VMA has native endian as opposed to
2663  little endian.
2664 \end_layout
2666 \begin_layout Subsubsection
2667 memory.find_vma(number address)
2668 \end_layout
2670 \begin_layout Standard
2671 Finds the VMA containing specified address.
2672  Returns table in the same format as read_vma or nil if not found.
2673 \end_layout
2675 \begin_layout Subsubsection
2676 memory.readbyte(number address)
2677 \end_layout
2679 \begin_layout Standard
2680 Reads the specified address as unsigned byte and returns the result.
2681 \end_layout
2683 \begin_layout Subsubsection
2684 memory.readsbyte(number address)
2685 \end_layout
2687 \begin_layout Standard
2688 Reads the specified address as signed byte and returns the result.
2689 \end_layout
2691 \begin_layout Subsubsection
2692 memory.writebyte(number address, number value)
2693 \end_layout
2695 \begin_layout Standard
2696 Writes the specified value (negative values undergo 2's complement) to specified
2697  address (as a byte).
2698 \end_layout
2700 \begin_layout Subsubsection
2701 memory.readword(number address)
2702 \end_layout
2704 \begin_layout Standard
2705 Reads the specified address as unsigned word and returns the result.
2706 \end_layout
2708 \begin_layout Subsubsection
2709 memory.readsword(number address)
2710 \end_layout
2712 \begin_layout Standard
2713 Reads the specified address as signed word and returns the result.
2714 \end_layout
2716 \begin_layout Subsubsection
2717 memory.writeword(number address, number value)
2718 \end_layout
2720 \begin_layout Standard
2721 Writes the specified value (negative values undergo 2's complement) to specified
2722  address (as a word).
2723 \end_layout
2725 \begin_layout Subsubsection
2726 memory.readdword(number address)
2727 \end_layout
2729 \begin_layout Standard
2730 Reads the specified address as unsigned doubleword and returns the result.
2731 \end_layout
2733 \begin_layout Subsubsection
2734 memory.readsdword(number address)
2735 \end_layout
2737 \begin_layout Standard
2738 Reads the specified address as signed doubleword and returns the result.
2739 \end_layout
2741 \begin_layout Subsubsection
2742 memory.writedword(number address, number value)
2743 \end_layout
2745 \begin_layout Standard
2746 Writes the specified value (negative values undergo 2's complement) to specified
2747  address (as a doubleword).
2748 \end_layout
2750 \begin_layout Subsubsection
2751 memory.readqword(number address)
2752 \end_layout
2754 \begin_layout Standard
2755 Reads the specified address as unsigned quadword and returns the result.
2756 \end_layout
2758 \begin_layout Subsubsection
2759 memory.readsqword(number address)
2760 \end_layout
2762 \begin_layout Standard
2763 Reads the specified address as signed quadword and returns the result.
2764 \end_layout
2766 \begin_layout Subsubsection
2767 memory.writeqword(number address, number value)
2768 \end_layout
2770 \begin_layout Standard
2771 Writes the specified value (negative values undergo 2's complement) to specified
2772  address (as a quadword).
2773 \end_layout
2775 \begin_layout Subsubsection
2776 memory.hash_region(number base, number size)
2777 \end_layout
2779 \begin_layout Standard
2780 Hash specified number of bytes starting from specified address and return
2781  the SHA-256.
2782 \end_layout
2784 \begin_layout Subsubsection
2785 memory.hash_state()
2786 \end_layout
2788 \begin_layout Standard
2789 Hash the current system state.
2790  Mainly useful for debugging savestates.
2791 \end_layout
2793 \begin_layout Subsubsection
2794 memory.readregion(number base, number size)
2795 \end_layout
2797 \begin_layout Standard
2798 Read a region of memory.
2799 \end_layout
2801 \begin_layout Itemize
2802 Warning: If the region crosses VMA boundary, the results are undefined.
2803 \end_layout
2805 \begin_layout Subsubsection
2806 memory.map<type>([number base, number size])
2807 \end_layout
2809 \begin_layout Standard
2810 Returns a table mapping specified memory aperture for read/write.
2811  If parameters are omitted, entiere map space is the aperture.
2812 \end_layout
2814 \begin_layout Itemize
2815 Type may be one of: byte, sbyte, word, sword, dword, sdword, qword or sqword.
2816 \end_layout
2818 \begin_layout Subsubsection
2819 memory.writeregion(number base, number size, table data)
2820 \end_layout
2822 \begin_layout Standard
2823 Write a region of memory.
2824 \end_layout
2826 \begin_layout Itemize
2827 Warning: If the region crosses VMA boundary, the results are undefined.
2828 \end_layout
2830 \begin_layout Subsubsection
2831 memory.map_struct()
2832 \end_layout
2834 \begin_layout Standard
2835 Returns a new mapping structure (MMAP_STRUCT)
2836 \end_layout
2838 \begin_layout Subsubsection
2839 MMAP_STRUCT(string key, number address, string type)
2840 \end_layout
2842 \begin_layout Standard
2843 Bind key in mmap structure to specified address with specified type.
2844 \end_layout
2846 \begin_layout Itemize
2847 Type may be one of: byte, sbyte, word, sword, dword, sdword, qword or sqword.
2848 \end_layout
2850 \begin_layout Subsubsection
2851 memory.read_expr(string expr)
2852 \end_layout
2854 \begin_layout Standard
2855 Evaluate specified watch expression and return result
2856 \end_layout
2858 \begin_layout Subsection
2859 Table subtitle
2860 \end_layout
2862 \begin_layout Standard
2863 Contains functions for manipulating subtitles.
2864 \end_layout
2866 \begin_layout Subsubsection
2867 subtitle.byindex(number index)
2868 \end_layout
2870 \begin_layout Standard
2871 Get (basetime, length) pair of specified subtitle index or nothing if index
2872  isn't valid.
2873 \end_layout
2875 \begin_layout Subsubsection
2876 subtitle.get(number basetime, number length)
2877 \end_layout
2879 \begin_layout Standard
2880 Read the specified subtitle.
2881  Returns 
2882 \begin_inset Quotes eld
2883 \end_inset
2886 \begin_inset Quotes erd
2887 \end_inset
2889  if the subtitle does not exist.
2890 \end_layout
2892 \begin_layout Subsubsection
2893 subtitle.set(number basetime, number length, string content)
2894 \end_layout
2896 \begin_layout Standard
2897 Set the specified subtitle.
2898 \end_layout
2900 \begin_layout Subsubsection
2901 subtitle.deltete(number basetime, number length)
2902 \end_layout
2904 \begin_layout Standard
2905 Delete the specified subtitle.
2906 \end_layout
2908 \begin_layout Subsection
2909 Table _SYSTEM
2910 \end_layout
2912 \begin_layout Standard
2913 Contains copy of global variables from time of Lua initialization.
2914  Non-writeable.
2915 \end_layout
2917 \begin_layout Subsection
2918 Callbacks
2919 \end_layout
2921 \begin_layout Standard
2922 Various callbacks to Lua that can occur.
2923 \end_layout
2925 \begin_layout Subsubsection
2926 Callback: on_paint(bool not_synth)
2927 \end_layout
2929 \begin_layout Standard
2930 Called when screen is being painted.
2931  Any gui.* calls requiring graphic context draw on the screen.
2932 \end_layout
2934 \begin_layout Standard
2935 not_synth is true if this hook is being called in response to received frame,
2936  false otherwise.
2937 \end_layout
2939 \begin_layout Subsubsection
2940 Callback: on_video()
2941 \end_layout
2943 \begin_layout Standard
2944 Called when video dump frame is being painted.
2945  Any gui.* calls requiring graphic context draw on the video.
2946 \end_layout
2948 \begin_layout Subsubsection
2949 Callback: on_frame_emulated()
2950 \end_layout
2952 \begin_layout Standard
2953 Called when emulating frame has completed and on_paint()/on_video() calls
2954  are about to be issued.
2955 \end_layout
2957 \begin_layout Subsubsection
2958 Callback: on_frame()
2959 \end_layout
2961 \begin_layout Standard
2962 Called on each starting whole frame.
2963 \end_layout
2965 \begin_layout Subsubsection
2966 Callback: on_startup()
2967 \end_layout
2969 \begin_layout Standard
2970 Called when the emulator is starting (lsnes.rc and --run files has been run).
2971 \end_layout
2973 \begin_layout Subsubsection
2974 Callback: on_rewind()
2975 \end_layout
2977 \begin_layout Standard
2978 Called when rewind movie to beginning has completed.
2979 \end_layout
2981 \begin_layout Subsubsection
2982 Callback: on_pre_load(string name)
2983 \end_layout
2985 \begin_layout Standard
2986 Called just before savestate/movie load occurs (note: loads are always delayed,
2987  so this occurs even when load was initiated by lua).
2988 \end_layout
2990 \begin_layout Subsubsection
2991 Callback: on_err_load(string name)
2992 \end_layout
2994 \begin_layout Standard
2995 Called if loadstate goes wrong.
2996 \end_layout
2998 \begin_layout Subsubsection
2999 Callback: on_post_load(string name, boolean was_savestate)
3000 \end_layout
3002 \begin_layout Standard
3003 Called on successful loadstate.
3004  was_savestate gives if this was a savestate or a movie.
3005 \end_layout
3007 \begin_layout Subsubsection
3008 Callback: on_pre_save(string name, boolean is_savestate)
3009 \end_layout
3011 \begin_layout Standard
3012 Called just before savestate save occurs (note: movie saves are synchronous
3013  and won't trigger these callbacks if called from Lua).
3014 \end_layout
3016 \begin_layout Subsubsection
3017 Callback: on_err_save(string name)
3018 \end_layout
3020 \begin_layout Standard
3021 Called if savestate goes wrong.
3022 \end_layout
3024 \begin_layout Subsubsection
3025 Callback: on_post_save(string name, boolean is_savestate)
3026 \end_layout
3028 \begin_layout Standard
3029 Called on successful savaestate.
3030  is_savestate gives if this was a savestate or a movie.
3031 \end_layout
3033 \begin_layout Subsubsection
3034 Callback: on_quit()
3035 \end_layout
3037 \begin_layout Standard
3038 Called when emulator is shutting down.
3039 \end_layout
3041 \begin_layout Subsubsection
3042 Callback: on_input(boolean subframe)
3043 \end_layout
3045 \begin_layout Standard
3046 Called when emulator is just sending input to bsnes core.
3047  Warning: This is called even in readonly mode, but the results are ignored.
3048 \end_layout
3050 \begin_layout Subsubsection
3051 Callback: on_reset()
3052 \end_layout
3054 \begin_layout Standard
3055 Called when SNES is reset.
3056 \end_layout
3058 \begin_layout Subsubsection
3059 Callback: on_readwrite()
3060 \end_layout
3062 \begin_layout Standard
3063 Called when moving into readwrite mode as result of 
3064 \begin_inset Quotes eld
3065 \end_inset
3067 set-rwmode
3068 \begin_inset Quotes erd
3069 \end_inset
3071  command (note: moving to rwmode by Lua won't trigger this, as per recursive
3072  entry protection).
3073 \end_layout
3075 \begin_layout Subsubsection
3076 Callback: on_snoop(number port, number controller, number index, number
3077  value)
3078 \end_layout
3080 \begin_layout Standard
3081 Called each time bsnes asks for input.
3082  The value is the final value to be sent to bsnes core (readonly mode, autohold
3083  and autofire have been taken into account).
3084  Might be useful when translating movies to format suitable for console
3085  verification.
3086  Note: There is no way to modify the value to be sent.
3087 \end_layout
3089 \begin_layout Subsubsection
3090 Callback: on_keyhook(string keyname, table state)
3091 \end_layout
3093 \begin_layout Standard
3094 Sent when key that has keyhook events requested changes state.
3095  Keyname is name of the key (group) and state is the state (same kind as
3096  table values in input.raw).
3097 \end_layout
3099 \begin_layout Subsubsection
3100 Callback: on_idle()
3101 \end_layout
3103 \begin_layout Standard
3104 Called when requested by set_idle_timeout(), the timeout has expired and
3105  emulator is waiting.
3106 \end_layout
3108 \begin_layout Subsubsection
3109 Callback: on_timer()
3110 \end_layout
3112 \begin_layout Standard
3113 Called when requested by set_idle_timeout() and the timeout has expired
3114  (regardless if emulator is waiting).
3115 \end_layout
3117 \begin_layout Subsubsection
3118 Callback: on_set_rewind(UNSAFEREWIND r)
3119 \end_layout
3121 \begin_layout Standard
3122 Called when unsafe rewind object has been constructed.
3123 \end_layout
3125 \begin_layout Subsubsection
3126 Callback: on_pre_rewind() 
3127 \end_layout
3129 \begin_layout Standard
3130 Called just before unsafe rewind is about to occur.
3131 \end_layout
3133 \begin_layout Subsubsection
3134 Callback: on_post_rewind() 
3135 \end_layout
3137 \begin_layout Standard
3138 Called just after unsafe rewind has occured.
3139 \end_layout
3141 \begin_layout Section
3142 Memory watch expression syntax
3143 \end_layout
3145 \begin_layout Standard
3146 Memory watch expressions are in RPN (Reverse Polish Notation).
3147  At the end of expression, the top entry on stack is taken as the final
3148  result.
3149 \end_layout
3151 \begin_layout Standard
3152 Notations:
3153 \end_layout
3155 \begin_layout Itemize
3156 Evaluation order is strictly left to right.
3157 \end_layout
3159 \begin_layout Itemize
3160 a is the entry on top of stack
3161 \end_layout
3163 \begin_layout Itemize
3164 b is the entry immediately below top of stack
3165 \end_layout
3167 \begin_layout Itemize
3168 ; separates values to be pushed (no intermediate pop).
3169 \end_layout
3171 \begin_layout Itemize
3172 After end of element, all used stack slots are popped and all results are
3173  pushed.
3174 \end_layout
3176 \begin_layout Itemize
3177 When pushing multiple values, the pushes occur in order shown.
3178 \end_layout
3180 \begin_layout Standard
3181 The following operators are available:
3182 \end_layout
3184 \begin_layout Itemize
3185 + : a + b
3186 \end_layout
3188 \begin_layout Itemize
3189 - : a - b
3190 \end_layout
3192 \begin_layout Itemize
3193 * : a * b
3194 \end_layout
3196 \begin_layout Itemize
3197 / : a / b
3198 \end_layout
3200 \begin_layout Itemize
3201 % : a % b
3202 \end_layout
3204 \begin_layout Itemize
3205 a : atan(a)
3206 \end_layout
3208 \begin_layout Itemize
3209 b : read_signed_byte(a)
3210 \end_layout
3212 \begin_layout Itemize
3213 c : cos(a)
3214 \end_layout
3216 \begin_layout Itemize
3217 d : read_signed_dword(a)
3218 \end_layout
3220 \begin_layout Itemize
3221 i : quotent(a / b)
3222 \end_layout
3224 \begin_layout Itemize
3225 p :
3226 \begin_inset Formula $\pi$
3227 \end_inset
3230 \end_layout
3232 \begin_layout Itemize
3233 q : read_signed_qword(a)
3234 \end_layout
3236 \begin_layout Itemize
3237 r : sqrt(a)
3238 \end_layout
3240 \begin_layout Itemize
3241 s : sin(a)
3242 \end_layout
3244 \begin_layout Itemize
3245 t : tan(a)
3246 \end_layout
3248 \begin_layout Itemize
3249 u : a; a
3250 \end_layout
3252 \begin_layout Itemize
3253 w : read_signed_word(a)
3254 \end_layout
3256 \begin_layout Itemize
3257 A : atan2(a, b)
3258 \end_layout
3260 \begin_layout Itemize
3261 B : read_unsigned_byte(a)
3262 \end_layout
3264 \begin_layout Itemize
3265 C<number>z : Push number <number> to stack.
3266 \end_layout
3268 \begin_layout Itemize
3269 D : read_unsigned_dword(a)
3270 \end_layout
3272 \begin_layout Itemize
3273 C0x<number>z : Push number <number> (hexadecimal) to stack.
3274 \end_layout
3276 \begin_layout Itemize
3277 Q : read_unsigned_qword(a)
3278 \end_layout
3280 \begin_layout Itemize
3281 R<digit> : round a to <digit> digits.
3282 \end_layout
3284 \begin_layout Itemize
3285 W : read_unsigned_word(a)
3286 \end_layout
3288 \begin_layout Subsection
3289 Example:
3290 \end_layout
3292 \begin_layout Standard
3293 C0x007e0878zWC0x007e002czW-
3294 \end_layout
3296 \begin_layout Enumerate
3297 Push value 0x7e0878 on top of stack (C0x007e0878z).
3298 \end_layout
3300 \begin_layout Enumerate
3301 Pop the value on top of stack (0x7e0878), read word value at that address
3302  and push the result,call it x1 (W).
3303 \end_layout
3305 \begin_layout Enumerate
3306 Push value 0x7e002c on top of stack (C0x007e002cz).
3307 \end_layout
3309 \begin_layout Enumerate
3310 Pop the value on top of stack (0x7e002c), read word value at that address
3311  and push the result,call it x2 (W).
3312 \end_layout
3314 \begin_layout Enumerate
3315 Pop the two top numbers on stack, x1 and x2, substract x1 from x2 and push
3316  x2 - x1 (-).
3317 \end_layout
3319 \begin_layout Enumerate
3320 Since the expression ends, the final memory watch result is the top one
3321  on stack, which is x2 - x1.
3322 \end_layout
3324 \begin_layout Section
3325 Modifier and key names:
3326 \end_layout
3328 \begin_layout Subsection
3329 SDL Platform
3330 \end_layout
3332 \begin_layout Subsubsection
3333 Modifier names
3334 \end_layout
3336 \begin_layout Standard
3337 Following modifier names are known:
3338 \end_layout
3340 \begin_layout Itemize
3341 ctrl, lctrl, rctrl: Control keys
3342 \end_layout
3344 \begin_layout Itemize
3345 alt, lalt, ralt: ALT keys.
3346 \end_layout
3348 \begin_layout Itemize
3349 shift, lshift, rshift: Shift keys.
3350 \end_layout
3352 \begin_layout Itemize
3353 meta, lmeta, rmeta: Meta keys.
3354 \end_layout
3356 \begin_layout Itemize
3357 num, caps: Numlock/Capslock (these are sticky!)
3358 \end_layout
3360 \begin_layout Itemize
3361 mode: Mode select.
3362 \end_layout
3364 \begin_layout Subsubsection
3365 Key names
3366 \end_layout
3368 \begin_layout Standard
3369 Following key names are known:
3370 \end_layout
3372 \begin_layout Itemize
3373 backspace, tab, clear, return, pause, escape, space, exclaim, quotedbl,
3374  hash, dollar, ampersand, quote, leftparen, rightparen, asterisk, plus,
3375  comma, minus, period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon,
3376  less, equals, greater, question, at, leftbracket, backslash, rightbracket,
3377  caret, underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
3378  o, p, q, r, s, t, u, v, w, x, y, z, delete, world_0, world_1, world_2,
3379  world_3, world_4, world_5, world_6, world_7, world_8, world_9, world_10,
3380  world_11, world_12, world_13, world_14, world_15, world_16, world_17, world_18,
3381  world_19, world_20, world_21, world_22, world_23, world_24, world_25, world_26,
3382  world_27, world_28, world_29, world_30, world_31, world_32, world_33, world_34,
3383  world_35, world_36, world_37, world_38, world_39, world_40, world_41, world_42,
3384  world_43, world_44, world_45, world_46, world_47, world_48, world_49, world_50,
3385  world_51, world_52, world_53, world_54, world_55, world_56, world_57, world_58,
3386  world_59, world_60, world_61, world_62, world_63, world_64, world_65, world_66,
3387  world_67, world_68, world_69, world_70, world_71, world_72, world_73, world_74,
3388  world_75, world_76, world_77, world_78, world_79, world_80, world_81, world_82,
3389  world_83, world_84, world_85, world_86, world_87, world_88, world_89, world_90,
3390  world_91, world_92, world_93, world_94, world_95, kp0, kp1, kp2, kp3, kp4,
3391  kp5, kp6, kp7, kp8, kp9, kp_period, kp_divide, kp_multiply, kp_minus, kp_plus,
3392  kp_enter, kp_equals, up, down, right, left, insert, home, end, pageup,
3393  pagedown, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14,
3394  f15, numlock, capslock, scrollock, rshift, lshift, rctrl, lctrl, ralt,
3395  lalt, rmeta, lmeta, lsuper, rsuper, mode, compose, help, print, sysreq,
3396  break, menu, power, euro, undo
3397 \end_layout
3399 \begin_layout Itemize
3400 Names of form 'key<n>' where <n> is 0-255 are interpretted as key having
3401  hardware-dependent scan code of <n> (useful to bind those keys that don't
3402  have symbolic names).
3403 \end_layout
3405 \begin_layout Subsubsection
3406 Joystick pseudo-keys:
3407 \end_layout
3409 \begin_layout Itemize
3410 joystick<num>button<button>: Joystick <num> (0-based) button <button> (0-based).
3411 \end_layout
3413 \begin_layout Itemize
3414 joystick<num>hat<hat>n: Joystick <num> (0-based) hat <hat> (0-based) up.
3415 \end_layout
3417 \begin_layout Itemize
3418 joystick<num>hat<hat>w: Joystick <num> (0-based) hat <hat> (0-based) left.
3419 \end_layout
3421 \begin_layout Itemize
3422 joystick<num>hat<hat>s: Joystick <num> (0-based) hat <hat> (0-based) down.
3423 \end_layout
3425 \begin_layout Itemize
3426 joystick<num>hat<hat>e: Joystick <num> (0-based) hat <hat> (0-based) right.
3427 \end_layout
3429 \begin_layout Itemize
3430 joystick<num>axis<axis>-: Joystick <num> (0-based) axis <axis> negative
3431  position (axis modes axis and axis_inverse).
3432 \end_layout
3434 \begin_layout Itemize
3435 joystick<num>axis<axis>+: Joystick <num> (0-based) axis <axis> positive
3436  position (axis modes axis and axis_inverse).
3437 \end_layout
3439 \begin_layout Itemize
3440 joystick<num>axis<axis>: Joystick <num> (0-based) axis <axis> pressure (axis
3441  modes pressure_*).
3442 \end_layout
3444 \begin_layout Subsubsection
3445 Special buttons:
3446 \end_layout
3448 \begin_layout Itemize
3449 Escape: Enter/Exit Command mode, cancel modal dialogs.
3450 \end_layout
3452 \begin_layout Itemize
3453 Return (also KPEnter): Execute command, ok modal dialog.
3454 \end_layout
3456 \begin_layout Itemize
3457 Pgup/Up (also KP8/9 if no num lock, CTRL+P; command mode): Previous command
3458  in command history
3459 \end_layout
3461 \begin_layout Itemize
3462 Pgdn/Down(also KP2/3 if no num lock, CTRL+N; command mode): Next command
3463  in command history
3464 \end_layout
3466 \begin_layout Itemize
3467 Home (also KP7 if no num lock, CTRL+A; command mode): Beginning of command.
3468 \end_layout
3470 \begin_layout Itemize
3471 End (also KP1 if no num lock, CTRL+E; command mode): End of command.
3472 \end_layout
3474 \begin_layout Itemize
3475 Left (also KP4 if no num lock, CTRL+B; command mode): Move cursor left.
3476 \end_layout
3478 \begin_layout Itemize
3479 Right (also KP6 if no num lock, CTRL+F; command mode): Move cursor right.
3480 \end_layout
3482 \begin_layout Itemize
3483 Delete (also KP.
3484  if no num lock; command mode): Delete character to right of cursor.
3485 \end_layout
3487 \begin_layout Itemize
3488 Insert (also KP0 if no num lock; command mode): Toggle between insert /
3489  overwrite modes.
3490 \end_layout
3492 \begin_layout Itemize
3493 Backspace (command mode): Delete character to left of cursor.
3494 \end_layout
3496 \begin_layout Itemize
3497 CTRL+LEFT (also ALT+B; command mode): Previous word.
3498 \end_layout
3500 \begin_layout Itemize
3501 CTRL+RIGHT (also ALT+F; command mode): Next word.
3502 \end_layout
3504 \begin_layout Itemize
3505 ALT+D (also CTRL+W; command mode): Delete word.
3506 \end_layout
3508 \begin_layout Itemize
3509 LCTRL+LALT+ESCAPE: Ungraceful shutdown (leaves dump corrupted!).
3510 \end_layout
3512 \begin_layout Subsection
3513 wxWidgets platform
3514 \end_layout
3516 \begin_layout Subsubsection
3517 Modifier names:
3518 \end_layout
3520 \begin_layout Standard
3521 Following modifier names are known:
3522 \end_layout
3524 \begin_layout Itemize
3526 \end_layout
3528 \begin_layout Itemize
3529 ctrl
3530 \end_layout
3532 \begin_layout Itemize
3533 shift 
3534 \end_layout
3536 \begin_layout Itemize
3537 meta
3538 \end_layout
3540 \begin_layout Itemize
3541 cmd (Mac OS X only)
3542 \end_layout
3544 \begin_layout Subsubsection
3545 Key names:
3546 \end_layout
3548 \begin_layout Standard
3549 Following key names are known:
3550 \end_layout
3552 \begin_layout Itemize
3553 back, tab, return, escape, space, exclaim, quotedbl, hash, dollar, percent,
3554  ampersand, quote, leftparen, rightparen, asterisk, plus, comma, minus,
3555  period, slash, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, colon, semicolon, less, equals,
3556  greater, question, at, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
3557  q, r, s, t, u, v, w, x, y, z, leftbracket, backslash, rightbracket, caret,
3558  underscore, backquote, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p,
3559  q, r, s, t, u, v, w, x, y, z, leftcurly, pipe, rightcurly, tilde, delete,
3560  start, lbutton, rbutton, cancel, mbutton, clear, shift, alt, control, menu,
3561  pause, capital, end, home, lefT, up, right, down, select, print, execute,
3562  snapshot, insert, help, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5,
3563  numpad6, numpad7, numpad8, numpad9, multiply, add, separator, subtract,
3564  decimal, divide, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
3565  f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, numlock, scroll,
3566  pageup, pagedown, numpad_space, numpad_tab, numpad_enter, numpad_f1, numpad_f2,
3567  numpad_f3, numpad_f4, numpad_home, numpad_left, numpad_up, numpad_right,
3568  numpad_down, numpad_pageup, numpad_pagedown, numpad_end, numpad_begin,
3569  numpad_insert, numpad_delete, numpad_equal, numpad_multiply, numpad_add,
3570  numpad_separator, numpad_subtract, numpad_decimal, numpad_divide, windows_left,
3571  windows_right, windows_menu, command, special1, special2, special3, special4,
3572  special5, special6, special7, special8, special9, special10, special11,
3573  special12, special13, special14, special15, special16, special17, special18,
3574  special19, special20
3575 \end_layout
3577 \begin_layout Section
3578 Movie file format
3579 \end_layout
3581 \begin_layout Standard
3582 Movie file is .zip archive in itself, normal ZIP archive tools work on it
3583  (note: If you recompress it, do not use compression methods other than
3584  store and deflate and especially do not use encryption of any kind).
3585 \end_layout
3587 \begin_layout Subsection
3588 Detecting clean start/SRAM/Savestate
3589 \end_layout
3591 \begin_layout Itemize
3592 If file has member 
3593 \begin_inset Quotes eld
3594 \end_inset
3596 savestate
3597 \begin_inset Quotes erd
3598 \end_inset
3600  it is savestate, otherwise:
3601 \end_layout
3603 \begin_layout Itemize
3604 If file has members with names starting 
3605 \begin_inset Quotes eld
3606 \end_inset
3608 moviesram.
3609 \begin_inset Quotes erd
3610 \end_inset
3612  it is movie starting from SRAM, otherwise:
3613 \end_layout
3615 \begin_layout Itemize
3616 It is movie starting from clear state.
3617 \end_layout
3619 \begin_layout Subsection
3620 Member: gametype
3621 \end_layout
3623 \begin_layout Standard
3624 Type of game ROM and region (as one line).
3625  Valid values are:
3626 \end_layout
3628 \begin_layout Standard
3629 \begin_inset Tabular
3630 <lyxtabular version="3" rows="8" columns="3">
3631 <features tabularvalignment="middle">
3632 <column alignment="center" valignment="top" width="0">
3633 <column alignment="center" valignment="top" width="0">
3634 <column alignment="center" valignment="top" width="0">
3635 <row>
3636 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3637 \begin_inset Text
3639 \begin_layout Plain Layout
3640 Value
3641 \end_layout
3643 \end_inset
3644 </cell>
3645 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3646 \begin_inset Text
3648 \begin_layout Plain Layout
3649 System
3650 \end_layout
3652 \end_inset
3653 </cell>
3654 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3655 \begin_inset Text
3657 \begin_layout Plain Layout
3658 Region
3659 \end_layout
3661 \end_inset
3662 </cell>
3663 </row>
3664 <row>
3665 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3666 \begin_inset Text
3668 \begin_layout Plain Layout
3669 snes_pal
3670 \end_layout
3672 \end_inset
3673 </cell>
3674 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3675 \begin_inset Text
3677 \begin_layout Plain Layout
3678 Super NES
3679 \end_layout
3681 \end_inset
3682 </cell>
3683 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3684 \begin_inset Text
3686 \begin_layout Plain Layout
3688 \end_layout
3690 \end_inset
3691 </cell>
3692 </row>
3693 <row>
3694 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3695 \begin_inset Text
3697 \begin_layout Plain Layout
3698 sgb_pal
3699 \end_layout
3701 \end_inset
3702 </cell>
3703 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3704 \begin_inset Text
3706 \begin_layout Plain Layout
3707 Super Game Boy
3708 \end_layout
3710 \end_inset
3711 </cell>
3712 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3713 \begin_inset Text
3715 \begin_layout Plain Layout
3717 \end_layout
3719 \end_inset
3720 </cell>
3721 </row>
3722 <row>
3723 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3724 \begin_inset Text
3726 \begin_layout Plain Layout
3727 snes_ntsc
3728 \end_layout
3730 \end_inset
3731 </cell>
3732 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3733 \begin_inset Text
3735 \begin_layout Plain Layout
3736 Super NES
3737 \end_layout
3739 \end_inset
3740 </cell>
3741 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3742 \begin_inset Text
3744 \begin_layout Plain Layout
3745 NTSC
3746 \end_layout
3748 \end_inset
3749 </cell>
3750 </row>
3751 <row>
3752 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3753 \begin_inset Text
3755 \begin_layout Plain Layout
3756 sgb_ntsc
3757 \end_layout
3759 \end_inset
3760 </cell>
3761 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3762 \begin_inset Text
3764 \begin_layout Plain Layout
3765 Super Game Boy
3766 \end_layout
3768 \end_inset
3769 </cell>
3770 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3771 \begin_inset Text
3773 \begin_layout Plain Layout
3774 NTSC
3775 \end_layout
3777 \end_inset
3778 </cell>
3779 </row>
3780 <row>
3781 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3782 \begin_inset Text
3784 \begin_layout Plain Layout
3786 \end_layout
3788 \end_inset
3789 </cell>
3790 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3791 \begin_inset Text
3793 \begin_layout Plain Layout
3794 BS-X (non-slotted)
3795 \end_layout
3797 \end_inset
3798 </cell>
3799 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3800 \begin_inset Text
3802 \begin_layout Plain Layout
3803 NTSC
3804 \end_layout
3806 \end_inset
3807 </cell>
3808 </row>
3809 <row>
3810 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3811 \begin_inset Text
3813 \begin_layout Plain Layout
3814 bsxslotted
3815 \end_layout
3817 \end_inset
3818 </cell>
3819 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3820 \begin_inset Text
3822 \begin_layout Plain Layout
3823 BS-X (slotted)
3824 \end_layout
3826 \end_inset
3827 </cell>
3828 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3829 \begin_inset Text
3831 \begin_layout Plain Layout
3832 NTSC
3833 \end_layout
3835 \end_inset
3836 </cell>
3837 </row>
3838 <row>
3839 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3840 \begin_inset Text
3842 \begin_layout Plain Layout
3843 sufamiturbo
3844 \end_layout
3846 \end_inset
3847 </cell>
3848 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3849 \begin_inset Text
3851 \begin_layout Plain Layout
3852 Sufami Turbo
3853 \end_layout
3855 \end_inset
3856 </cell>
3857 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3858 \begin_inset Text
3860 \begin_layout Plain Layout
3861 NTSC
3862 \end_layout
3864 \end_inset
3865 </cell>
3866 </row>
3867 </lyxtabular>
3869 \end_inset
3872 \end_layout
3874 \begin_layout Standard
3875 Frame rates are:
3876 \end_layout
3878 \begin_layout Standard
3879 \begin_inset Tabular
3880 <lyxtabular version="3" rows="3" columns="2">
3881 <features tabularvalignment="middle">
3882 <column alignment="center" valignment="top" width="0">
3883 <column alignment="center" valignment="top" width="0">
3884 <row>
3885 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3886 \begin_inset Text
3888 \begin_layout Plain Layout
3889 Region
3890 \end_layout
3892 \end_inset
3893 </cell>
3894 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3895 \begin_inset Text
3897 \begin_layout Plain Layout
3898 Framerate (fps)
3899 \end_layout
3901 \end_inset
3902 </cell>
3903 </row>
3904 <row>
3905 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3906 \begin_inset Text
3908 \begin_layout Plain Layout
3910 \end_layout
3912 \end_inset
3913 </cell>
3914 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3915 \begin_inset Text
3917 \begin_layout Plain Layout
3918 322445/6448
3919 \end_layout
3921 \end_inset
3922 </cell>
3923 </row>
3924 <row>
3925 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3926 \begin_inset Text
3928 \begin_layout Plain Layout
3929 NTSC
3930 \end_layout
3932 \end_inset
3933 </cell>
3934 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3935 \begin_inset Text
3937 \begin_layout Plain Layout
3938 10738636/178683
3939 \end_layout
3941 \end_inset
3942 </cell>
3943 </row>
3944 </lyxtabular>
3946 \end_inset
3949 \end_layout
3951 \begin_layout Subsection
3952 Member: port1
3953 \end_layout
3955 \begin_layout Standard
3956 Contains type of port #1 (as one line).
3957  Valid values are 'none', 'gamepad', 'multitap' and 'mouse'.
3958  If not present, defaults to 'gamepad'.
3959 \end_layout
3961 \begin_layout Subsection
3962 Member: port2
3963 \end_layout
3965 \begin_layout Standard
3966 Contains type of port #2 (as one line).
3967  Valid values are 'none', 'gamepad', 'multitap', 'mouse', 'superscope',
3968  'justifier' and 'justifiers'.
3969  If not present, defaults to 'none'.
3970 \end_layout
3972 \begin_layout Subsection
3973 Member: gamename
3974 \end_layout
3976 \begin_layout Standard
3977 Contains name of the game (as one line).
3978 \end_layout
3980 \begin_layout Subsection
3981 Member: authors
3982 \end_layout
3984 \begin_layout Standard
3985 Contains authors, one per line.
3986  Part before '|' is the full name, part after is the nickname.
3987 \end_layout
3989 \begin_layout Subsection
3990 Member: systemid
3991 \end_layout
3993 \begin_layout Standard
3994 Always 
3995 \begin_inset Quotes eld
3996 \end_inset
3998 lsnes-rr1
3999 \begin_inset Quotes erd
4000 \end_inset
4002  (one line).
4003  Used to reject other saves.
4004 \end_layout
4006 \begin_layout Subsection
4007 Member: controlsversion
4008 \end_layout
4010 \begin_layout Standard
4011 Always 
4012 \begin_inset Quotes eld
4013 \end_inset
4016 \begin_inset Quotes erd
4017 \end_inset
4019  (one line).
4020  Used to identify what controls are there.
4021 \end_layout
4023 \begin_layout Subsection
4024 Member: 
4025 \begin_inset Quotes eld
4026 \end_inset
4028 coreversion
4029 \begin_inset Quotes erd
4030 \end_inset
4033 \end_layout
4035 \begin_layout Standard
4036 Contains bsnes core version number (as one line).
4037 \end_layout
4039 \begin_layout Subsection
4040 Member: projectid
4041 \end_layout
4043 \begin_layout Standard
4044 Contains project ID (as one line).
4045  Used to identify if two movies are part of the same project.
4046 \end_layout
4048 \begin_layout Subsection
4049 Member: {rom,slota,slotb}{,xml}.sha256
4050 \end_layout
4052 \begin_layout Standard
4053 Contains SHA-256 of said ROM or ROM mapping file (as one line).
4054  Absent if corresponding file is absent.
4055 \end_layout
4057 \begin_layout Subsection
4058 Member: moviesram.<name>
4059 \end_layout
4061 \begin_layout Standard
4062 Raw binary startup SRAM of kind <name>.
4063  Only present in savestates and movies starting from SRAM.
4064 \end_layout
4066 \begin_layout Subsection
4067 Member: saveframe
4068 \end_layout
4070 \begin_layout Standard
4071 Contains frame number (as one line) of frame movie was saved on.
4072  Only present in savestates.
4073 \end_layout
4075 \begin_layout Subsection
4076 Member: lagcounter
4077 \end_layout
4079 \begin_layout Standard
4080 Current value of lag counter (as one line).
4081  Only present in savestates.
4082 \end_layout
4084 \begin_layout Subsection
4085 Member: pollcounters
4086 \end_layout
4088 \begin_layout Standard
4089 Contains poll counters (currently 100 of them), one per line.
4090  Each line is raw poll count if DRDY is set for it.
4091  Otherwise it is negative poll count minus one.
4092  Only present in savestates.
4093 \end_layout
4095 \begin_layout Subsection
4096 Member: hostmemory
4097 \end_layout
4099 \begin_layout Standard
4100 Raw binary dump of host memory.
4101  Only present in savestates.
4102 \end_layout
4104 \begin_layout Subsection
4105 Member: savestate
4106 \end_layout
4108 \begin_layout Standard
4109 The raw binary savestate itself.
4110  Savestate detection uses this file, only present in savestates.
4111 \end_layout
4113 \begin_layout Subsection
4114 Member: screenshot
4115 \end_layout
4117 \begin_layout Standard
4118 Screenshot of current frame.
4119  Only present in savestates.
4120  First 2 bytes are big-endian width of image, rest are 24-bit RGB image
4121  data.
4122  Height of image is inferred from the width and size of data.
4123 \end_layout
4125 \begin_layout Subsection
4126 Member: sram.<name>
4127 \end_layout
4129 \begin_layout Standard
4130 Raw binary SRAM of kind <name> at time of savestate.
4131  Only present in savestates.
4132 \end_layout
4134 \begin_layout Subsection
4135 Member: input
4136 \end_layout
4138 \begin_layout Standard
4139 The actual input track, one line per subframe (blank lines are skipped).
4140 \end_layout
4142 \begin_layout Itemize
4143 If the first byte of each line is '.', ' ', <tab> or '|', then the line is
4144  part of same frame as previous, otherwise it starts a new frame.
4145 \end_layout
4147 \begin_layout Itemize
4148 First subframe must start a new frame.
4149 \end_layout
4151 \begin_layout Standard
4152 Length of movie in frames is number of lines in input file that start a
4153  new frame.
4154 \end_layout
4156 \begin_layout Subsection
4157 Member: subtitles
4158 \end_layout
4160 \begin_layout Standard
4161 Subtitle track.
4162  Optional.
4163 \end_layout
4165 \begin_layout Itemize
4166 Each line is in form <firstframe> <numframes> <text>.
4167 \end_layout
4169 \begin_layout Itemize
4170 Linefeed is encoded as 
4171 \backslash
4172 n, backslash is encoded as 
4173 \backslash
4175 \backslash
4177 \end_layout
4179 \begin_layout Subsection
4180 Member: rerecords
4181 \end_layout
4183 \begin_layout Standard
4184 Contains textual base-10 rerecord count (as one line; emulator just writes
4185  this, it doesn't read it) + 1.
4186 \end_layout
4188 \begin_layout Subsection
4189 Member: rrdata
4190 \end_layout
4192 \begin_layout Standard
4193 This member stores set of load IDs.
4194  There is one load ID per rerecord (plus one corresponding to start of project).
4195 \end_layout
4197 \begin_layout Itemize
4198 This member constists of concatenation of records
4199 \end_layout
4201 \begin_layout Itemize
4202 Each record is 2-36 bytes long and can represent 1-16,843,009 consequtive
4203  IDs.
4204 \end_layout
4206 \begin_layout Itemize
4207 IDs are interpretted as 256-bit big-endian integers with warparound.
4208 \end_layout
4210 \begin_layout Itemize
4211 Initial predicted ID is all zeroes.
4212 \end_layout
4214 \begin_layout Standard
4215 Format of each record is:
4216 \end_layout
4218 \begin_layout Itemize
4219 1 byte: Opcode byte.
4220  Bits 0-4 are prefix length (prefixlen), bits 5-6 are count length (countlen).
4221  Bit 7 is unused.
4222 \end_layout
4224 \begin_layout Itemize
4225 32-prefixlen bytes of ID.
4226 \end_layout
4228 \begin_layout Itemize
4229 countlen bytes of big-endian count (count).
4230 \end_layout
4232 \begin_layout Standard
4233 Records are processed as follows:
4234 \end_layout
4236 \begin_layout Itemize
4237 To form the first ID encoded by record, take the first prefixlen bytes predicted
4238  ID and append the read ID value to it.
4239  The result is the first ID encoded.
4240 \end_layout
4242 \begin_layout Itemize
4243 If countlen is 0, record encodes 1 ID.
4244 \end_layout
4246 \begin_layout Itemize
4247 If countlen is 1, record encodes 2+count IDs.
4248 \end_layout
4250 \begin_layout Itemize
4251 If countlen is 2, record encodes 258+count IDs.
4252 \end_layout
4254 \begin_layout Itemize
4255 If countlen is 3, record encodes 65794+count IDs.
4256 \end_layout
4258 \begin_layout Itemize
4259 The new predicted ID is the next ID after last one encoded by the record.
4260 \end_layout
4262 \begin_layout Standard
4263 The number of rerecords + 1 is equal to the sum of number of IDs encoded
4264  by all records.
4265 \end_layout
4267 \begin_layout Subsection
4268 Member: starttime.second
4269 \end_layout
4271 \begin_layout Standard
4272 Movie starting time, second part.
4273  Epoch is Unix epoch.
4274  Default is 1,000,000,000.
4275 \end_layout
4277 \begin_layout Subsection
4278 Member: starttime.subsecond
4279 \end_layout
4281 \begin_layout Standard
4282 Movie starting time, subsecond part.
4283  Unit is CPU clocks.
4284  Default is 0.
4285 \end_layout
4287 \begin_layout Subsection
4288 Member: savetime.second
4289 \end_layout
4291 \begin_layout Standard
4292 Movie saving time, second part.
4293  Default is starttime.second.
4294  Only present in savestates.
4295 \end_layout
4297 \begin_layout Subsection
4298 Member: savetime.subsecond
4299 \end_layout
4301 \begin_layout Standard
4302 Movie saving time, subsecond part.
4303  Default is starttime.subsecond.
4304  Only present in savestates.
4305 \end_layout
4307 \begin_layout Section
4308 lsvs file format (commentary tracks)
4309 \end_layout
4311 \begin_layout Subsection
4312 Clusters
4313 \end_layout
4315 \begin_layout Itemize
4316 Each cluster is 8kB (8192 bytes) in size.
4317 \end_layout
4319 \begin_layout Itemize
4320 Cluster n starts at offset 8192*n in file.
4321 \end_layout
4323 \begin_layout Itemize
4324 The following clusters are system special:
4325 \end_layout
4327 \begin_deeper
4328 \begin_layout Itemize
4329 Cluster 0 and all clusters with number multiple of 2048 (cluster tables)
4330 \end_layout
4332 \begin_layout Itemize
4333 Cluster 1 (superblock)
4334 \end_layout
4336 \end_deeper
4337 \begin_layout Subsection
4338 Cluster tables
4339 \end_layout
4341 \begin_layout Itemize
4342 The cluster table describing cluster n is stored in cluster n & ~0x7FF (zero
4343  last 11 bits of n).
4344 \end_layout
4346 \begin_layout Itemize
4347 This cluster table consists of 2048 4-byte big-endian integers.
4348 \end_layout
4350 \begin_layout Itemize
4351 Each entry describes a cluster in 16MB supercluster, in order.
4352 \end_layout
4354 \begin_layout Itemize
4355 The valid values for entries are:
4356 \end_layout
4358 \begin_deeper
4359 \begin_layout Itemize
4360 0x00000000: Free cluster
4361 \end_layout
4363 \begin_layout Itemize
4364 0x00000001: Last cluster in chain.
4365 \end_layout
4367 \begin_layout Itemize
4368 0xFFFFFFFF: System cluster (cluster tables and superblock)
4369 \end_layout
4371 \begin_layout Itemize
4372 (anything else): Number of next cluster in chain.
4373  Must not be multiple of 2048.
4374 \end_layout
4376 \end_deeper
4377 \begin_layout Itemize
4378 Due to limitations of the format, there can be at most 2097052 superclusters,
4379  giving maximum file size of 16TB.
4380 \end_layout
4382 \begin_layout Subsection
4383 Stream table
4384 \end_layout
4386 \begin_layout Itemize
4387 The stream table chain always starts in cluster 2.
4388 \end_layout
4390 \begin_layout Itemize
4391 Otherwise, it follows normal chaining.
4392 \end_layout
4394 \begin_layout Itemize
4395 The stream table consists of 16-byte entries:
4396 \end_layout
4398 \begin_deeper
4399 \begin_layout Itemize
4400 The first 8 bytes of entry give big-endian beginning position of stream
4401  in units of 1/48000 s.
4402 \end_layout
4404 \begin_layout Itemize
4405 The next 4 bytes of entry give big-endian beginning cluster for control
4406  data.
4407  0 here marks the entry as not present.
4408 \end_layout
4410 \begin_layout Itemize
4411 The last 4 bytes of entry give big-endian beginning cluster for codec data.
4412 \end_layout
4414 \end_deeper
4415 \begin_layout Itemize
4416 Stream table clusters are normal clusters, following normal chaining.
4417 \end_layout
4419 \begin_layout Itemize
4420 The stream begnning position is not guarenteed unique.
4421  There can be multiple streams with the same starting position in the file.
4422 \end_layout
4424 \begin_layout Subsection
4425 Stream control data
4426 \end_layout
4428 \begin_layout Itemize
4429 The stream control data consists of entries 4 bytes each:
4430 \end_layout
4432 \begin_deeper
4433 \begin_layout Itemize
4434 The first 2 bytes of entry gives big-endian length of packet
4435 \end_layout
4437 \begin_layout Itemize
4438 The next byte of entry gives audio length of packet in units of 1/400 s.
4439 \end_layout
4441 \begin_layout Itemize
4442 The last byte is control byte.
4443 \end_layout
4445 \begin_deeper
4446 \begin_layout Itemize
4447 0 means this entry is not present and the control data ends.
4448 \end_layout
4450 \begin_layout Itemize
4451 1 is valid control entry.
4452 \end_layout
4454 \end_deeper
4455 \end_deeper
4456 \begin_layout Itemize
4457 The stream control data can also end by running into end of the readable
4458  chain.
4459 \end_layout
4461 \begin_deeper
4462 \begin_layout Itemize
4463 This happens if there happens to be exact multiple of 2048 packets in stream
4464  and number of packets is nonzero.
4465 \end_layout
4467 \end_deeper
4468 \begin_layout Itemize
4469 These clusters follow normal chaining.
4470 \end_layout
4472 \begin_layout Subsection
4473 Stream codec data
4474 \end_layout
4476 \begin_layout Itemize
4477 Stream codec data consists of raw Opus data packets packed back to back
4478  with nothing in between.
4479 \end_layout
4481 \begin_layout Itemize
4482 Warning: Due to internal limitations, this data must reside in the first
4483  65536 superclusters (that is, the first 1TB of the file).
4484 \end_layout
4486 \begin_layout Subsection
4487 Superblock
4488 \end_layout
4490 \begin_layout Itemize
4491 The superblock is stored in cluster 1.
4493 \end_layout
4495 \begin_layout Itemize
4496 The first 11 bytes are 
4497 \begin_inset Quotes eld
4498 \end_inset
4500 sefs-magic
4501 \begin_inset Quotes erd
4502 \end_inset
4504 <NUL>.
4505 \end_layout
4507 \begin_layout Itemize
4508 The rest are unused.
4509 \end_layout
4511 \begin_layout Itemize
4512 This cluster 1 is marked as system special.
4513 \end_layout
4515 \begin_layout Section
4516 Known ROM extensions
4517 \end_layout
4519 \begin_layout Itemize
4520 SNES cartridge ROMs: sfc, smc, swc, fig, ufo, sf2, gd3, gd7, dx2, mgd, mgh.
4521 \end_layout
4523 \begin_layout Itemize
4524 DMG cartridge ROMs: dmg, gb.
4525 \end_layout
4527 \begin_layout Itemize
4528 GBC cartridge ROMs: cgb, gbc.
4529 \end_layout
4531 \begin_layout Section
4532 Gamepack files
4533 \end_layout
4535 \begin_layout Itemize
4536 The first line must be: 
4537 \begin_inset Quotes eld
4538 \end_inset
4540 [GAMEPACK FILE]
4541 \begin_inset Quotes erd
4542 \end_inset
4545 \end_layout
4547 \begin_layout Itemize
4548 There is one needed line: 
4549 \begin_inset Quotes eld
4550 \end_inset
4552 type <systype>
4553 \begin_inset Quotes erd
4554 \end_inset
4557  This sets system type to <systype>.
4558  The following system types are valid:
4559 \end_layout
4561 \begin_deeper
4562 \begin_layout Itemize
4563 snes (SNES)
4564 \end_layout
4566 \begin_layout Itemize
4567 bsx (BS-X non-slotted)
4568 \end_layout
4570 \begin_layout Itemize
4571 bsxslotted (BS-X slotted)
4572 \end_layout
4574 \begin_layout Itemize
4575 sufamiturbo (Sufami Turbo)
4576 \end_layout
4578 \begin_layout Itemize
4579 sgb (Super Game Boy)
4580 \end_layout
4582 \begin_layout Itemize
4583 dmg (Game Boy)
4584 \end_layout
4586 \begin_layout Itemize
4587 gbc (Game Boy Color)
4588 \end_layout
4590 \begin_layout Itemize
4591 gbc_gba (Game Boy Color with GBA initial register values)
4592 \end_layout
4594 \end_deeper
4595 \begin_layout Itemize
4596 Optionally a region can be specified: 
4597 \begin_inset Quotes eld
4598 \end_inset
4600 region <region>
4601 \begin_inset Quotes erd
4602 \end_inset
4605  The following values are valid:
4606 \end_layout
4608 \begin_deeper
4609 \begin_layout Itemize
4610 autodetect (Autodetect region: snes and sgb only)
4611 \end_layout
4613 \begin_layout Itemize
4614 ntsc (NTSC: snes, bsx, bsxslotted, sufamiturbo, sgb)
4615 \end_layout
4617 \begin_layout Itemize
4618 pal (PAL: snes, sgb)
4619 \end_layout
4621 \begin_layout Itemize
4622 world (World: dmg, gbc, gbc_gba)
4623 \end_layout
4625 \end_deeper
4626 \begin_layout Itemize
4627 ROM images are loaded as: 
4628 \begin_inset Quotes eld
4629 \end_inset
4631 rom <type> <file>
4632 \begin_inset Quotes erd
4633 \end_inset
4636  The following types are valid:
4637 \end_layout
4639 \begin_deeper
4640 \begin_layout Itemize
4641 rom (Cartridge ROM in snes, dmg, gbc, gbc_gba.
4642  BIOS in bsx, bsxslotted, sufamiturbo)
4643 \end_layout
4645 \begin_layout Itemize
4646 bsx (Cartridge ROM in bsx, bsxslotted)
4647 \end_layout
4649 \begin_layout Itemize
4650 slot-a (Cartridge ROM in sufamiturbo)
4651 \end_layout
4653 \begin_layout Itemize
4654 slot-b (Cartridge ROM in sufamiturbo)
4655 \end_layout
4657 \end_deeper
4658 \begin_layout Itemize
4659 ROM markup can be loaded as: 
4660 \begin_inset Quotes eld
4661 \end_inset
4663 xml <type> <file>
4664 \begin_inset Quotes erd
4665 \end_inset
4668  The types valid are the same as for ROMs.
4669 \end_layout
4671 \begin_layout Itemize
4672 Patches can be loaded as 
4673 \begin_inset Quotes eld
4674 \end_inset
4676 patch[<offset>] <type> <file>
4677 \begin_inset Quotes erd
4678 \end_inset
4681  The types are the same as for ROMs.
4682 \end_layout
4684 \begin_deeper
4685 \begin_layout Itemize
4686 Offset is given in form [+-]<number>.
4687  Usually offset is either +0 or -512.
4688 \end_layout
4690 \begin_layout Itemize
4691 Default offset is +0.
4692 \end_layout
4694 \end_deeper
4695 \begin_layout Subsection
4696 Example:
4697 \end_layout
4699 \begin_layout LyX-Code
4700 [GAMEPACK FILE]
4701 \end_layout
4703 \begin_layout LyX-Code
4704 type snes
4705 \end_layout
4707 \begin_layout LyX-Code
4708 rom rom speedygonzales.sfc
4709 \end_layout
4711 \begin_layout LyX-Code
4712 patch-512 rom sonicthehedgehog.ips
4713 \end_layout
4715 \begin_layout Subsection
4716 Example 2:
4717 \end_layout
4719 \begin_layout LyX-Code
4720 [GAMEPACK FILE]
4721 \end_layout
4723 \begin_layout LyX-Code
4724 type sgb
4725 \end_layout
4727 \begin_layout LyX-Code
4728 rom rom supergameboy.sfc
4729 \end_layout
4731 \begin_layout LyX-Code
4732 rom dmg megamanV.dmg
4733 \end_layout
4735 \begin_layout Section
4736 Quick'n'dirty encode guide
4737 \end_layout
4739 \begin_layout Enumerate
4740 Start the emulator and load the ROM and movie file.
4741 \end_layout
4743 \begin_layout Enumerate
4744 Set large AVI option 'set-setting avi-large on'
4745 \end_layout
4747 \begin_layout Enumerate
4748 Enable dumping 'dump-avi tmpdump' 
4749 \end_layout
4751 \begin_layout Enumerate
4752 Unpause and let it run until you want to end dumping.
4753 \end_layout
4755 \begin_layout Enumerate
4756 Close the emulator (closing the window is the easiest way).
4757  Or use 'end-avi'.
4758 \end_layout
4760 \begin_layout Enumerate
4761 For each tmpdump*.avi file created, on command prompt, do 'x264 --crf 10
4762  -o tmpdump_<numbers>.mkv tmpdump_<numbers>.avi'.
4763 \end_layout
4765 \begin_layout Enumerate
4766 Do 'sox tmpdump.sox tmpdump.ogg rate -v 32000'
4767 \end_layout
4769 \begin_layout Enumerate
4770 Do 'mkvmerge -o tmpdump_video.mkv tmpdump_0000000.mkv + tmpdump_0000001.mkv
4771  + tmpdump_0000002.mkv' (list every tmpdump_<numbers>.mkv, with + in between).
4772 \end_layout
4774 \begin_layout Enumerate
4775 Do 'mkvmerge -o final.mkv tmpdump_video.mkv tmpdump.ogg'.
4776  Now final.mkv contains quick'n'dirty encode.
4777 \end_layout
4779 \begin_layout Section
4780 Axis configurations for some gamepad types:
4781 \end_layout
4783 \begin_layout Subsection
4784 XBox360 controller:
4785 \end_layout
4787 \begin_layout Standard
4788 Axes 2 and 5 (joystick<n>axis2 and joystick<n>axis5) should be set to pressure-+.
4789 \end_layout
4791 \begin_layout LyX-Code
4792 set-axis joystick0axis2 pressure-+
4793 \end_layout
4795 \begin_layout LyX-Code
4796 set-axis joystick0axis5 pressure-+
4797 \end_layout
4799 \begin_layout Itemize
4800 This is needed for SDL only.
4801  EVDEV sets those types correctly.
4802 \end_layout
4804 \begin_layout Subsection
4805 PS3 
4806 \begin_inset Quotes eld
4807 \end_inset
4809 sixaxis
4810 \begin_inset Quotes erd
4811 \end_inset
4813  controller:
4814 \end_layout
4816 \begin_layout Standard
4817 Axes 8-19 should be disabled.
4818 \end_layout
4820 \begin_layout LyX-Code
4821 set-axis joystick0axis8 disabled
4822 \end_layout
4824 \begin_layout LyX-Code
4825 set-axis joystick0axis9 disabled
4826 \end_layout
4828 \begin_layout LyX-Code
4829 set-axis joystick0axis10 disabled
4830 \end_layout
4832 \begin_layout LyX-Code
4833 set-axis joystick0axis11 disabled
4834 \end_layout
4836 \begin_layout LyX-Code
4837 set-axis joystick0axis12 disabled
4838 \end_layout
4840 \begin_layout LyX-Code
4841 set-axis joystick0axis13 disabled
4842 \end_layout
4844 \begin_layout LyX-Code
4845 set-axis joystick0axis14 disabled
4846 \end_layout
4848 \begin_layout LyX-Code
4849 set-axis joystick0axis15 disabled
4850 \end_layout
4852 \begin_layout LyX-Code
4853 set-axis joystick0axis16 disabled
4854 \end_layout
4856 \begin_layout LyX-Code
4857 set-axis joystick0axis17 disabled
4858 \end_layout
4860 \begin_layout LyX-Code
4861 set-axis joystick0axis18 disabled
4862 \end_layout
4864 \begin_layout LyX-Code
4865 set-axis joystick0axis19 disabled
4866 \end_layout
4868 \begin_layout Section
4869 Errata:
4870 \end_layout
4872 \begin_layout Subsection
4873 Problems from BSNES core:
4874 \end_layout
4876 \begin_layout Itemize
4877 The whole pending save stuff.
4878 \end_layout
4880 \begin_layout Itemize
4881 Lack of layer hiding.
4882 \end_layout
4884 \begin_layout Itemize
4885 It is slow (especially accuracy).
4886 \end_layout
4888 \begin_layout Itemize
4889 Firmwares can't be loaded from ZIP archives.
4890 \end_layout
4892 \begin_layout Subsection
4893 Other problems:
4894 \end_layout
4896 \begin_layout Itemize
4897 Modifiers don't work with pseudo-keys (SDL, EVDEV).
4898 \end_layout
4900 \begin_layout Itemize
4901 Audio for last dumped frame is not itself dumped.
4902 \end_layout
4904 \begin_layout Itemize
4905 Audio in UI is pretty bad in quality if game doesn't run at full speed.
4906 \end_layout
4908 \begin_layout Itemize
4909 No menus, command based interface (SDL).
4910 \end_layout
4912 \begin_layout Itemize
4913 Long commands don't scroll.
4914 \end_layout
4916 \begin_layout Section
4917 Changelog:
4918 \end_layout
4920 \begin_layout Subsection
4921 rr0-beta1
4922 \end_layout
4924 \begin_layout Itemize
4925 Fix -Wall warnings
4926 \end_layout
4928 \begin_layout Itemize
4929 Fix dumper video corruption with levels 10-18.
4930 \end_layout
4932 \begin_layout Subsection
4933 rr0-beta2
4934 \end_layout
4936 \begin_layout Itemize
4937 Autofire
4938 \end_layout
4940 \begin_layout Itemize
4941 Lots of code cleanups
4942 \end_layout
4944 \begin_layout Itemize
4945 Lua interface to settings
4946 \end_layout
4948 \begin_layout Itemize
4949 Allow specifying AVI borders without Lua
4950 \end_layout
4952 \begin_layout Itemize
4953 Fix scaling if vscale > 1 and originx > 0 (left border exists)
4954 \end_layout
4956 \begin_layout Itemize
4957 on_snoop lua callback
4958 \end_layout
4960 \begin_layout Itemize
4961 Faster movie loading and saving.
4962 \end_layout
4964 \begin_layout Subsection
4965 rr0-beta3
4966 \end_layout
4968 \begin_layout Itemize
4969 Joystick support
4970 \end_layout
4972 \begin_layout Subsection
4973 rr0-beta4
4974 \end_layout
4976 \begin_layout Itemize
4977 Fix multi-buttons
4978 \end_layout
4980 \begin_layout Itemize
4981 Save jukebox functionality.
4982 \end_layout
4984 \begin_layout Subsection
4985 rr0-beta5
4986 \end_layout
4988 \begin_layout Itemize
4989 Try to fix some nasty failing movie load edge cases
4990 \end_layout
4992 \begin_layout Itemize
4993 Allow specifying scripts to run on command line.
4994 \end_layout
4996 \begin_layout Subsection
4997 rr0-beta6
4998 \end_layout
5000 \begin_layout Itemize
5001 Major source code reorganization.
5002 \end_layout
5004 \begin_layout Itemize
5005 Backup savestates before overwriting.
5006 \end_layout
5008 \begin_layout Itemize
5009 Don't crash if loading initial state fails.
5010 \end_layout
5012 \begin_layout Subsection
5013 rr0-beta7
5014 \end_layout
5016 \begin_layout Itemize
5017 Fix firmware lookup
5018 \end_layout
5020 \begin_layout Itemize
5021 Fix author name parsing
5022 \end_layout
5024 \begin_layout Itemize
5025 Fix rerecord counting
5026 \end_layout
5028 \begin_layout Itemize
5029 (SDL) Print messages to console if SDL is uninitialized
5030 \end_layout
5032 \begin_layout Itemize
5033 Add movieinfo program
5034 \end_layout
5036 \begin_layout Itemize
5037 Fix loading movies starting from SRAM.
5038 \end_layout
5040 \begin_layout Subsection
5041 rr0-beta8
5042 \end_layout
5044 \begin_layout Itemize
5045 Add support for unattended dumping
5046 \end_layout
5048 \begin_layout Itemize
5049 Fix compiling for Win32
5050 \end_layout
5052 \begin_layout Itemize
5053 Don't lock up if sound can't be initialized
5054 \end_layout
5056 \begin_layout Itemize
5057 Strip trailing CR from commands
5058 \end_layout
5060 \begin_layout Itemize
5061 Don't try to do dubious things in global ctors (fix crash on startup)
5062 \end_layout
5064 \begin_layout Subsection
5065 rr0-beta9
5066 \end_layout
5068 \begin_layout Itemize
5069 Small documentation tweaking
5070 \end_layout
5072 \begin_layout Itemize
5073 Fix make clean
5074 \end_layout
5076 \begin_layout Itemize
5077 Fix major bug in modifier matching
5078 \end_layout
5080 \begin_layout Subsection
5081 rr0-beta10
5082 \end_layout
5084 \begin_layout Itemize
5085 Lots of documentation fixes
5086 \end_layout
5088 \begin_layout Itemize
5089 Use dedicated callbacks for event backcomm., not commands.
5090 \end_layout
5092 \begin_layout Itemize
5093 Ensure that the watchdog is not hit when executing delayed reset.
5094 \end_layout
5096 \begin_layout Itemize
5097 Remove errant tab from joystick message.
5098 \end_layout
5100 \begin_layout Subsection
5101 rr0-beta11
5102 \end_layout
5104 \begin_layout Itemize
5105 Make autofire operate in absolute time, not linear time
5106 \end_layout
5108 \begin_layout Itemize
5109 Reinitialize controls when resuming from loadstate
5110 \end_layout
5112 \begin_layout Itemize
5113 Some more code cleanups
5114 \end_layout
5116 \begin_layout Itemize
5117 If Lua allocator fails, call OOM_panic()
5118 \end_layout
5120 \begin_layout Itemize
5121 Byte/word/dword/qword sized host memory write/read functions.
5122 \end_layout
5124 \begin_layout Itemize
5125 Dump at correct framerate if dumping interlaced NTSC (height=448).
5126 \end_layout
5128 \begin_layout Subsection
5129 rr0-beta12
5130 \end_layout
5132 \begin_layout Itemize
5133 Actually include the complete source code
5134 \end_layout
5136 \begin_layout Itemize
5137 Keep track of RTC
5138 \end_layout
5140 \begin_layout Subsection
5141 rr0-beta13
5142 \end_layout
5144 \begin_layout Itemize
5145 Document {save,start}time.{,sub}second.
5146 \end_layout
5148 \begin_layout Itemize
5149 Intercept time() from bsnes core.
5150 \end_layout
5152 \begin_layout Subsection
5153 rr0-beta14
5154 \end_layout
5156 \begin_layout Itemize
5157 Allow disabling time() interception (allow build on Mac OS X)
5158 \end_layout
5160 \begin_layout Itemize
5161 Use SDLMain on Mac OS X (make SDL not crash)
5162 \end_layout
5164 \begin_layout Itemize
5165 Disable delayed resets (just plain too buggy for now).
5166 \end_layout
5168 \begin_layout Itemize
5169 Code cleanups
5170 \end_layout
5172 \begin_layout Itemize
5173 Use 16-bit for graphics/video instead of 32-bit.
5174 \end_layout
5176 \begin_layout Itemize
5177 gui.rectangle/gui.pixel
5178 \end_layout
5180 \begin_layout Itemize
5181 gui.crosshair
5182 \end_layout
5184 \begin_layout Itemize
5185 New CSCD writer implementation.
5186 \end_layout
5188 \begin_layout Subsection
5189 rr0-beta15
5190 \end_layout
5192 \begin_layout Itemize
5193 Fix interaction of * and +.
5194 \end_layout
5196 \begin_layout Itemize
5197 Manual improvements
5198 \end_layout
5200 \begin_layout Itemize
5201 Use gettimeofday()/usleep(), these seem portable enough.
5202 \end_layout
5204 \begin_layout Itemize
5205 Move joystick axis manipulation to keymapper code.
5206 \end_layout
5208 \begin_layout Itemize
5209 Changes to how read-only works.
5210 \end_layout
5212 \begin_layout Itemize
5213 Refactor controller input code.
5214 \end_layout
5216 \begin_layout Subsection
5217 rr0-beta16
5218 \end_layout
5220 \begin_layout Itemize
5221 Fix mouseclick scale compensation.
5222 \end_layout
5224 \begin_layout Itemize
5225 Draw area boundaries correctly in SDL code.
5226 \end_layout
5228 \begin_layout Itemize
5229 gui.screenshot.
5230 \end_layout
5232 \begin_layout Itemize
5233 Fix CSCD output (buffer overrun and race condition).
5234 \end_layout
5236 \begin_layout Subsection
5237 rr0-beta17
5238 \end_layout
5240 \begin_layout Itemize
5241 JMD dumping support.
5242 \end_layout
5244 \begin_layout Itemize
5245 Allow unattended dumping to JMD.
5246 \end_layout
5248 \begin_layout Itemize
5249 Move to BSNES v083.
5250 \end_layout
5252 \begin_layout Itemize
5253 Switch back to 32-bit colors.
5254 \end_layout
5256 \begin_layout Itemize
5257 Add Lua function gui.color.
5258 \end_layout
5260 \begin_layout Itemize
5261 Use some new C++11 features in GCC 4.6.
5262 \end_layout
5264 \begin_layout Itemize
5265 Be prepared for core frequency changes.
5266 \end_layout
5268 \begin_layout Itemize
5269 Pass colors in one chunk from Lua.
5270 \end_layout
5272 \begin_layout Subsection
5273 rr0-beta18
5274 \end_layout
5276 \begin_layout Itemize
5277 New lua functions gui.line(), gui.status() and gui.circle(), memory.vma_count(),
5278  memory.read_vma() and memory.find_vma().
5279 \end_layout
5281 \begin_layout Itemize
5282 Numerious documentation fixups
5283 \end_layout
5285 \begin_layout Itemize
5286 RTC time format changed
5287 \end_layout
5289 \begin_layout Itemize
5290 Reformat flags display
5291 \end_layout
5293 \begin_layout Itemize
5294 Allow lua package name to be overridden
5295 \end_layout
5297 \begin_layout Itemize
5298 SDUMP (high-quality dumping).
5299 \end_layout
5301 \begin_layout Itemize
5302 Split platform support to plugins.
5303 \end_layout
5305 \begin_layout Itemize
5306 Make all sound plugins support basic sound commands
5307 \end_layout
5309 \begin_layout Itemize
5310 Support portaudio for sound.
5311 \end_layout
5313 \begin_layout Itemize
5314 Allow disable Lua/SDL searching.
5315 \end_layout
5317 \begin_layout Itemize
5318 Upconvert colors when copying lcscreen to screen.
5319 \end_layout
5321 \begin_layout Itemize
5322 Reorganize source tree.
5323 \end_layout
5325 \begin_layout Itemize
5326 Evdev joystick support.
5327 \end_layout
5329 \begin_layout Itemize
5330 Refactor more code into generic window code.
5331 \end_layout
5333 \begin_layout Subsection
5334 rr0-beta19
5335 \end_layout
5337 \begin_layout Itemize
5338 Refactor message handling.
5339 \end_layout
5341 \begin_layout Itemize
5342 Rework makefile
5343 \end_layout
5345 \begin_layout Itemize
5346 Documentation fixes
5347 \end_layout
5349 \begin_layout Itemize
5350 Finish pending saves before load/quit.
5351 \end_layout
5353 \begin_layout Itemize
5354 Wxwidgets graphics plugin.
5355 \end_layout
5357 \begin_layout Subsection
5358 rr0-beta20
5359 \end_layout
5361 \begin_layout Itemize
5362 Get rid of win32-crap.[ch]pp.
5363 \end_layout
5365 \begin_layout Itemize
5366 Move files around a lot.
5367 \end_layout
5369 \begin_layout Itemize
5370 Get rid of need for host C++ compiler.
5371 \end_layout
5373 \begin_layout Itemize
5374 Bsnes v084 core.
5375 \end_layout
5377 \begin_layout Itemize
5378 Refactor inter-component communication.
5379 \end_layout
5381 \begin_layout Itemize
5382 Fix zero luma.
5383 \end_layout
5385 \begin_layout Itemize
5386 Fix crash on multiline aliases.
5387 \end_layout
5389 \begin_layout Itemize
5390 Load/Save settings in wxwidgets gui.
5391 \end_layout
5393 \begin_layout Subsection
5394 rr0-beta21
5395 \end_layout
5397 \begin_layout Itemize
5398 Patch problems in bsnes core
5399 \end_layout
5401 \begin_layout Itemize
5402 SNES is little-endian, not big-endian!
5403 \end_layout
5405 \begin_layout Itemize
5406 Fix memory corruption in lcscreen::load()
5407 \end_layout
5409 \begin_layout Subsection
5410 rr0-beta22
5411 \end_layout
5413 \begin_layout Itemize
5414 Fix interpretting repeat counts in rrdata loading.
5415 \end_layout
5417 \begin_layout Itemize
5418 New lua callback: on_frame()
5419 \end_layout
5421 \begin_layout Itemize
5422 Remove calls to runtosave() that aren't supposed to be there
5423 \end_layout
5425 \begin_layout Itemize
5426 Lua function: movie.read_rtc()
5427 \end_layout
5429 \begin_layout Itemize
5430 Ignore src/fonts/font.cpp
5431 \end_layout
5433 \begin_layout Itemize
5434 Fix more bsnes core problems
5435 \end_layout
5437 \begin_layout Itemize
5438 Control bsnes random seeding
5439 \end_layout
5441 \begin_layout Itemize
5442 Pause-on-end
5443 \end_layout
5445 \begin_layout Itemize
5446 Some bsnes core debugging features (state dump and state hash)
5447 \end_layout
5449 \begin_layout Itemize
5450 Fix titlebar version number (no, the last version wasn't 'lsnes-0-beta21',
5451  it was 'lsnes rr0-beta21').
5452 \end_layout
5454 \begin_layout Subsection
5455 rr0-beta23
5456 \end_layout
5458 \begin_layout Itemize
5459 Fix memory corruption due to macro/field mixup
5460 \end_layout
5462 \begin_layout Itemize
5463 search-memory update
5464 \end_layout
5466 \begin_layout Itemize
5467 Allow direct-mapped framebuffer
5468 \end_layout
5470 \begin_layout Itemize
5471 SDL: Use SDL_ANYFORMAT if possible
5472 \end_layout
5474 \begin_layout Itemize
5475 SDMP2SOX: 2s delay modes.
5476 \end_layout
5478 \begin_layout Itemize
5479 Wxwidgets: Cleanups
5480 \end_layout
5482 \begin_layout Itemize
5483 Use sed -E, not sed -r.
5484  Fixes building on Mac OS X.
5485 \end_layout
5487 \begin_layout Itemize
5488 Wxwidgets: Save jukebox on exit
5489 \end_layout
5491 \begin_layout Itemize
5492 Fix RTC if using load-movie on savestate.
5493 \end_layout
5495 \begin_layout Itemize
5496 Fix crash related to full console mode.
5497 \end_layout
5499 \begin_layout Subsection
5500 rr0-beta24
5501 \end_layout
5503 \begin_layout Itemize
5504 Wxwidgets: Allow bringing application to foreground on Mac OS X.
5505 \end_layout
5507 \begin_layout Itemize
5508 Wxwidgets: Allow compiling on Mac OS X.
5509 \end_layout
5511 \begin_layout Itemize
5512 Use movie compare instead of movie hashing (faster save/load).
5513 \end_layout
5515 \begin_layout Itemize
5516 Lua: _SYSTEM table.
5517 \end_layout
5519 \begin_layout Subsection
5520 rr0-beta25
5521 \end_layout
5523 \begin_layout Itemize
5524 sdmp2sox: Pad soundtrack if using -l or -L.
5525 \end_layout
5527 \begin_layout Itemize
5528 sdmp2sox: Fix NTSC overscan.
5529 \end_layout
5531 \begin_layout Itemize
5532 sdmp2sox: Add AR correction mode.
5533 \end_layout
5535 \begin_layout Itemize
5536 call lua_close() when exiting.
5537 \end_layout
5539 \begin_layout Itemize
5540 Fix zip_writer bug causing warnings from info-zip and error from advzip.
5541 \end_layout
5543 \begin_layout Subsection
5544 rr0-beta26
5545 \end_layout
5547 \begin_layout Itemize
5548 Fix IPS patching code (use bsnes core IPS patcher).
5549 \end_layout
5551 \begin_layout Itemize
5552 Implement BPS patching (using bsnes core IPS patcher).
5553 \end_layout
5555 \begin_layout Itemize
5556 Add feature to load headered ROMs.
5557 \end_layout
5559 \begin_layout Subsection
5560 rr0-beta27
5561 \end_layout
5563 \begin_layout Itemize
5564 Show command names when showing keybindings
5565 \end_layout
5567 \begin_layout Subsection
5569 \end_layout
5571 \begin_layout Itemize
5572 Fix pause-on-end to be actually controllable
5573 \end_layout
5575 \begin_layout Itemize
5576 SDL: Poll all events in queue, not just first one (fixes slowness in command
5577  typing)
5578 \end_layout
5580 \begin_layout Itemize
5581 Wxwidgets: Fix ROM loading.
5582 \end_layout
5584 \begin_layout Subsection
5585 rr1-beta0
5586 \end_layout
5588 \begin_layout Itemize
5589 Lua: Add gui.textH, gui.textV, gui.textHV
5590 \end_layout
5592 \begin_layout Itemize
5593 Fix text colors on SDL on Mac OS X
5594 \end_layout
5596 \begin_layout Itemize
5597 Mode 'F' for finished in readonly mode.
5598 \end_layout
5600 \begin_layout Itemize
5601 Fix some WS errors.
5602 \end_layout
5604 \begin_layout Itemize
5605 Reliably pause after skip poll
5606 \end_layout
5608 \begin_layout Itemize
5609 Split UI and core into their own threads
5610 \end_layout
5612 \begin_layout Subsection
5613 rr1-beta1
5614 \end_layout
5616 \begin_layout Itemize
5617 Remove leftover dummy SRAM slot
5618 \end_layout
5620 \begin_layout Itemize
5621 Fix controller numbers.
5622 \end_layout
5624 \begin_layout Subsection
5625 rr1-beta2
5626 \end_layout
5628 \begin_layout Itemize
5629 Fix lsnes-dumpavi after interface change.
5630 \end_layout
5632 \begin_layout Itemize
5633 Also give BSNES patches for v085.
5634 \end_layout
5636 \begin_layout Itemize
5637 Pack movie data in memory.
5638 \end_layout
5640 \begin_layout Subsection
5641 rr1-beta3
5642 \end_layout
5644 \begin_layout Itemize
5645 Fix framecount/length given when loading movies.
5646 \end_layout
5648 \begin_layout Itemize
5649 Controller command memory leak fixes.
5650 \end_layout
5652 \begin_layout Itemize
5653 Don't leak palette if freeing screen object.
5654 \end_layout
5656 \begin_layout Subsection
5657 rr1-beta4
5658 \end_layout
5660 \begin_layout Itemize
5661 Detect revisions.
5662 \end_layout
5664 \begin_layout Itemize
5665 Wxwidgets: Allow controlling dumper from the menu.
5666 \end_layout
5668 \begin_layout Subsection
5669 rr1-beta5
5670 \end_layout
5672 \begin_layout Itemize
5673 Rewrite parts of manual
5674 \end_layout
5676 \begin_layout Itemize
5677 Lua: Make it work with Lua 5.2.
5678 \end_layout
5680 \begin_layout Subsection
5681 rr1-beta6
5682 \end_layout
5684 \begin_layout Itemize
5685 Win32: Fix compile errors.
5686 \end_layout
5688 \begin_layout Subsection
5689 rr1-beta7
5690 \end_layout
5692 \begin_layout Itemize
5693 Refactor controller input code.
5694 \end_layout
5696 \begin_layout Itemize
5697 Fix crash when using command line on SDL / Mac OS X.
5698 \end_layout
5700 \begin_layout Subsection
5701 rr1-beta8
5702 \end_layout
5704 \begin_layout Itemize
5705 Delete core/coroutine (obsolete)
5706 \end_layout
5708 \begin_layout Itemize
5709 Lag input display by one frame.
5710 \end_layout
5712 \begin_layout Itemize
5713 Rewind movie to beginning function.
5714 \end_layout
5716 \begin_layout Itemize
5717 Fix wrong frame number reported to Lua when repainting after loadstate
5718 \end_layout
5720 \begin_layout Itemize
5721 Support UI editing of jukebox
5722 \end_layout
5724 \begin_layout Itemize
5725 Wxwidgets: Save settings on exit.
5726 \end_layout
5728 \begin_layout Itemize
5729 Support ${project} for filenames
5730 \end_layout
5732 \begin_layout Itemize
5733 SDL: Fix command history
5734 \end_layout
5736 \begin_layout Subsection
5737 rr1-beta9
5738 \end_layout
5740 \begin_layout Itemize
5741 Fix some order-of-global-ctor bugs.
5742 \end_layout
5744 \begin_layout Subsection
5745 rr1-beta10
5746 \end_layout
5748 \begin_layout Itemize
5749 Fix crashes when quitting on Win32.
5750 \end_layout
5752 \begin_layout Subsection
5753 rr1-beta11
5754 \end_layout
5756 \begin_layout Itemize
5757 EVDEV: Queue keypresses from joystick, don't send directly
5758 \end_layout
5760 \begin_layout Itemize
5761 Wxwidgets: Load-Preserve that actually works.
5762 \end_layout
5764 \begin_layout Subsection
5765 rr1-beta12
5766 \end_layout
5768 \begin_layout Itemize
5769 Wxwidgets: GUI for memory search.
5770 \end_layout
5772 \begin_layout Itemize
5773 Warn about using synchronous queue in UI callback.
5774 \end_layout
5776 \begin_layout Subsection
5777 rr1-beta13
5778 \end_layout
5780 \begin_layout Itemize
5781 Remember last saved file for each ROM
5782 \end_layout
5784 \begin_layout Itemize
5785 Support MT dumping via boost.
5786 \end_layout
5788 \begin_layout Itemize
5789 Lua: input.raw
5790 \end_layout
5792 \begin_layout Itemize
5793 Lua: input.keyhook
5794 \end_layout
5796 \begin_layout Itemize
5797 Make mouse be ordinary input instead of special-casing
5798 \end_layout
5800 \begin_layout Itemize
5801 SDL: Don't screw up commands with NUL codepoints.
5802 \end_layout
5804 \begin_layout Subsection
5805 rr1-beta14
5806 \end_layout
5808 \begin_layout Itemize
5809 Merge status panel and main window
5810 \end_layout
5812 \begin_layout Itemize
5813 True movie slot support (the rest of it)
5814 \end_layout
5816 \begin_layout Itemize
5817 SDL: Fix compilation error
5818 \end_layout
5820 \begin_layout Itemize
5821 Elminate cross calls in dump menu code.
5822 \end_layout
5824 \begin_layout Subsection
5825 rr1-beta15
5826 \end_layout
5828 \begin_layout Itemize
5829 Cancel pending saves command
5830 \end_layout
5832 \begin_layout Itemize
5833 Wxwidgets: Code refactoring
5834 \end_layout
5836 \begin_layout Itemize
5837 Wxwidgets: Fix system -> reset
5838 \end_layout
5840 \begin_layout Itemize
5841 Wxwidgets: Read watch expressions in the right thread
5842 \end_layout
5844 \begin_layout Subsection
5845 rr1-beta16
5846 \end_layout
5848 \begin_layout Itemize
5849 Wxwidgets: Don't prompt for member when running Lua script (Lua doesn't
5850  support that).
5851 \end_layout
5853 \begin_layout Itemize
5854 Wxwidgets: 128 -> 1024 Autohold slots (in case more are needed).
5855 \end_layout
5857 \begin_layout Itemize
5858 Don't append trailing '-' to prefix when saving movie.
5859 \end_layout
5861 \begin_layout Itemize
5862 Fix ROM/savestate handling (don't let user mismatch ROM and savestates).
5863 \end_layout
5865 \begin_layout Subsection
5867 \end_layout
5869 \begin_layout Itemize
5870 Document memory watch syntax.
5871 \end_layout
5873 \begin_layout Subsection
5874 rr1-delta1
5875 \end_layout
5877 \begin_layout Itemize
5878 Fix unattended dumping (lsnes-dumpavi)
5879 \end_layout
5881 \begin_layout Itemize
5882 Support RAW dumping
5883 \end_layout
5885 \begin_layout Itemize
5886 Use adv_dumper instead of the old interface in lsnes-dumpavi (changes syntax)
5887 \end_layout
5889 \begin_layout Itemize
5890 Add option to control sample rate preturbation in AVI dumper
5891 \end_layout
5893 \begin_layout Subsection
5894 rr1-delta2
5895 \end_layout
5897 \begin_layout Itemize
5898 Wxwidgets: Fix dumper submodes
5899 \end_layout
5901 \begin_layout Itemize
5902 Set core controller types before loadstate
5903 \end_layout
5905 \begin_layout Subsection
5906 rr1-delta2epsilon1
5907 \end_layout
5909 \begin_layout Itemize
5910 Fix compiling with bsnes v086.
5911 \end_layout
5913 \begin_layout Subsection
5914 rr1-delta3
5915 \end_layout
5917 \begin_layout Itemize
5918 Don't prompt before quitting
5919 \end_layout
5921 \begin_layout Itemize
5922 Start unpaused, preserve pause/unpause over load.
5923 \end_layout
5925 \begin_layout Itemize
5926 Try to autodetect if ROM is headered.
5927 \end_layout
5929 \begin_layout Itemize
5930 Wxwidgets: Only bring up ROM patching screen if specifically requested.
5931 \end_layout
5933 \begin_layout Itemize
5934 Allow configuring some hotkeys.
5935 \end_layout
5937 \begin_layout Subsection
5938 rr1-delta4
5939 \end_layout
5941 \begin_layout Itemize
5942 Lots of code cleanups
5943 \end_layout
5945 \begin_layout Itemize
5946 Fix JMD compression (JMD dumping was broken)
5947 \end_layout
5949 \begin_layout Itemize
5950 Don't crash if Lua C function throws an exception.
5951 \end_layout
5953 \begin_layout Itemize
5954 Support bitmap drawing in Lua.
5955 \end_layout
5957 \begin_layout Itemize
5958 Fix bsnes v085/v086 patches.
5959 \end_layout
5961 \begin_layout Itemize
5962 Improve stability on win32.
5963 \end_layout
5965 \begin_layout Subsection
5966 rr1-delta4epsilon1
5967 \end_layout
5969 \begin_layout Itemize
5970 Don't corrupt movie if movie length is integer multiple of frames per page.
5971 \end_layout
5973 \begin_layout Subsection
5974 rr1-delta5
5975 \end_layout
5977 \begin_layout Itemize
5978 New Lua hooks: on_rewind, on_frame_emulated, on_idle, on_timer
5979 \end_layout
5981 \begin_layout Itemize
5982 New Lua functions: emulator_ready(), utime(), set_idle_timeout(), set_timer_time
5983 out(), bit.extract(), bit.value(), input.geta(), input.seta() and input.controllertyp
5985 \end_layout
5987 \begin_layout Itemize
5988 Wxwidgets: Fix internal focus lost (hotkeys stop working)
5989 \end_layout
5991 \begin_layout Itemize
5992 Wxwidgets: Fix broken modifiers
5993 \end_layout
5995 \begin_layout Itemize
5996 on_paint has parameter now.
5997 \end_layout
5999 \begin_layout Itemize
6000 Optional initital fill for bitmaps
6001 \end_layout
6003 \begin_layout Itemize
6004 Fix palette changing.
6005 \end_layout
6007 \begin_layout Itemize
6008 Optimize rendering a bit.
6009 \end_layout
6011 \begin_layout Itemize
6012 Bsnes v087 support.
6013 \end_layout
6015 \begin_layout Subsection
6016 rr1-delta5epsilon1
6017 \end_layout
6019 \begin_layout Itemize
6020 Movieinfo: Fix display of port #2 type.
6021 \end_layout
6023 \begin_layout Itemize
6024 Call on_input() after loadstate.
6025 \end_layout
6027 \begin_layout Subsection
6028 rr1-delta5epsilon2
6029 \end_layout
6031 \begin_layout Itemize
6032 Fix writing port2 data to movie.
6033 \end_layout
6035 \begin_layout Itemize
6036 Fix SRAM handling with Bsnes v087.
6037 \end_layout
6039 \begin_layout Subsection
6040 rr1-delta6
6041 \end_layout
6043 \begin_layout Itemize
6044 Library loading support
6045 \end_layout
6047 \begin_layout Itemize
6048 Built-in TSCC encoder
6049 \end_layout
6051 \begin_layout Itemize
6052 Hi-color (256T colors) dumping.
6053 \end_layout
6055 \begin_layout Itemize
6056 Dump over TCP/IP(v6)
6057 \end_layout
6059 \begin_layout Itemize
6060 Hidable status panel
6061 \end_layout
6063 \begin_layout Itemize
6064 Turbo toggle/hold
6065 \end_layout
6067 \begin_layout Itemize
6068 Adjustable sound volume
6069 \end_layout
6071 \begin_layout Itemize
6072 Screen scaling
6073 \end_layout
6075 \begin_layout Itemize
6076 Allow DnD into filename boxes
6077 \end_layout
6079 \begin_layout Itemize
6080 Configurable paths
6081 \end_layout
6083 \begin_layout Itemize
6084 Portaudio: Fix speaker popping at start
6085 \end_layout
6087 \begin_layout Itemize
6088 Lots of UI changes
6089 \end_layout
6091 \begin_layout Itemize
6092 Speed adjustment menu
6093 \end_layout
6095 \begin_layout Itemize
6096 Win32 joystick support
6097 \end_layout
6099 \begin_layout Itemize
6100 Lua: gui.rainbow and gui.box
6101 \end_layout
6103 \begin_layout Itemize
6104 Split key lists into classes (the key list was large!)
6105 \end_layout
6107 \begin_layout Itemize
6108 More save slots support
6109 \end_layout
6111 \begin_layout Itemize
6112 Wxwidgets (wxJoystick) joystick support
6113 \end_layout
6115 \begin_layout Subsection
6116 rr1-delta7
6117 \end_layout
6119 \begin_layout Itemize
6120 Lots of internal joystick refactoring
6121 \end_layout
6123 \begin_layout Itemize
6124 Evdev: Add mapping for BTN_TOOL_QUINTTAP
6125 \end_layout
6127 \begin_layout Itemize
6128 Wxwidgets: Settings mode (open settings without ROM)
6129 \end_layout
6131 \begin_layout Itemize
6132 Wxwidgets: Prompt key to use option
6133 \end_layout
6135 \begin_layout Itemize
6136 Wxwidgets: Fix crash if key goes away underneath
6137 \end_layout
6139 \begin_layout Itemize
6140 Wxwidgets: Fix mouse position in presence of scaling
6141 \end_layout
6143 \begin_layout Itemize
6144 AVI dumper: Mode 4 (high-quality resampling to common rate using SRC)
6145 \end_layout
6147 \begin_layout Itemize
6148 Wxwidgets: Redesign hotkeys dialog to avoid tree control (tree control doesn't
6149  seem to work well on WinXP)
6150 \end_layout
6152 \begin_layout Itemize
6153 Start paused option.
6154 \end_layout
6156 \begin_layout Subsection
6157 rr1-delta7epsilon1
6158 \end_layout
6160 \begin_layout Itemize
6161 AVI: ZMBV support
6162 \end_layout
6164 \begin_layout Itemize
6165 lsnes-dumpavi: Start Lua before starting dumper
6166 \end_layout
6168 \begin_layout Itemize
6169 AVI: Fix secondary audio in mode 4.
6170 \end_layout
6172 \begin_layout Subsection
6173 rr1-delta7epsilon2
6174 \end_layout
6176 \begin_layout Itemize
6177 AVI: Refactor ZMBV a bit.
6178 \end_layout
6180 \begin_layout Itemize
6181 Fix error reading analog values from movie file
6182 \end_layout
6184 \begin_layout Subsection
6185 rr1-delta8
6186 \end_layout
6188 \begin_layout Itemize
6189 Delayed reset support
6190 \end_layout
6192 \begin_layout Itemize
6193 Lua: memory.hash_region
6194 \end_layout
6196 \begin_layout Subsection
6197 rr1-delta8epsilon1
6198 \end_layout
6200 \begin_layout Itemize
6201 Rework the build system
6202 \end_layout
6204 \begin_layout Itemize
6205 Typing input support
6206 \end_layout
6208 \begin_layout Itemize
6209 Fix building with bsnes v086 and v087.
6210 \end_layout
6212 \begin_layout Itemize
6213 SDL: Save settings on exit
6214 \end_layout
6216 \begin_layout Itemize
6217 SDL: Command to enter command line mode with given command.
6218 \end_layout
6220 \begin_layout Itemize
6221 SDL: More advanced command editing.
6222 \end_layout
6224 \begin_layout Subsection
6225 rr1-delta9
6226 \end_layout
6228 \begin_layout Itemize
6229 wxMSW: Fix the 
6230 \begin_inset Quotes eld
6231 \end_inset
6233 arrow keys and enter don't work
6234 \begin_inset Quotes erd
6235 \end_inset
6237  problem
6238 \end_layout
6240 \begin_layout Itemize
6241 MSU-1 support
6242 \end_layout
6244 \begin_layout Itemize
6245 Show mode changes due to rewinding.
6246 \end_layout
6248 \begin_layout Itemize
6249 Unsafe rewind support
6250 \end_layout
6252 \begin_layout Itemize
6253 Fix directory transversal.
6254 \end_layout
6256 \begin_layout Subsection
6257 rr1-delta10
6258 \end_layout
6260 \begin_layout Itemize
6261 AVI: Sound mode 5 (48kHz high-quality)
6262 \end_layout
6264 \begin_layout Itemize
6265 Lua: Reset Lua VM
6266 \end_layout
6268 \begin_layout Itemize
6269 Map the SNES bus into address space
6270 \end_layout
6272 \begin_layout Itemize
6273 Fix loading memory watch files with CRLF line endings
6274 \end_layout
6276 \begin_layout Subsection
6277 rr1-delta10epsilon1
6278 \end_layout
6280 \begin_layout Itemize
6281 Map bsnes internal state into memory space
6282 \end_layout
6284 \begin_layout Itemize
6285 Fix the 
6286 \begin_inset Quotes eld
6287 \end_inset
6289 click on panel wedges the emulator
6290 \begin_inset Quotes erd
6291 \end_inset
6293  for real.
6294 \end_layout
6296 \begin_layout Itemize
6297 DnD movies/saves on the main window.
6298 \end_layout
6300 \begin_layout Subsection
6301 rr1-delta11
6302 \end_layout
6304 \begin_layout Itemize
6305 Split core bindings into own module.
6306 \end_layout
6308 \begin_layout Itemize
6309 Remember invalid settings
6310 \end_layout
6312 \begin_layout Itemize
6313 Support for modified Gambatte core for GB/GBC emulation.
6314 \end_layout
6316 \begin_layout Itemize
6317 Reload/swap ROM function
6318 \end_layout
6320 \begin_layout Subsection
6321 rr1-delta11epsilon1
6322 \end_layout
6324 \begin_layout Itemize
6325 Fix step poll function
6326 \end_layout
6328 \begin_layout Subsection
6329 rr1-delta12
6330 \end_layout
6332 \begin_layout Itemize
6333 Non-insane savestate anchoring
6334 \end_layout
6336 \begin_layout Subsection
6337 rr1-delta13
6338 \end_layout
6340 \begin_layout Itemize
6341 More Memory search methods
6342 \end_layout
6344 \begin_layout Itemize
6345 Preserve movie if loading in RO mode.
6346 \end_layout
6348 \begin_layout Itemize
6349 Fix a obscure case in timeline check
6350 \end_layout
6352 \begin_layout Itemize
6353 Revamp the entiere ROM loading code
6354 \end_layout
6356 \begin_layout Itemize
6357 Support DnD on ROMs
6358 \end_layout
6360 \begin_layout Itemize
6361 Revamp menu layout
6362 \end_layout
6364 \begin_layout Itemize
6365 Standalone hotkey config dialog
6366 \end_layout
6368 \begin_layout Itemize
6369 Show bindings in more user-friendly format
6370 \end_layout
6372 \begin_layout Subsection
6373 rr1-delta13epsilon1
6374 \end_layout
6376 \begin_layout Itemize
6377 Pipedec support
6378 \end_layout
6380 \begin_layout Itemize
6381 Fix uninitialized variables in bsnes v085
6382 \end_layout
6384 \begin_layout Subsection
6385 rr1-delta14
6386 \end_layout
6388 \begin_layout Itemize
6389 Merge gambatte core into mainline (from its own branch)
6390 \end_layout
6392 \begin_layout Itemize
6393 Wxwidgets: Show expected dump file formats
6394 \end_layout
6396 \begin_layout Itemize
6397 Memory watch: Data typing
6398 \end_layout
6400 \begin_layout Itemize
6401 lsnes internal MMIO area.
6402 \end_layout
6404 \begin_layout Itemize
6405 Wxwidgets: New memory watch editor
6406 \end_layout
6408 \begin_layout Itemize
6409 Hexadecimal memory watches
6410 \end_layout
6412 \begin_layout Itemize
6413 Wxwidgets: Monospaced panel
6414 \end_layout
6416 \begin_layout Itemize
6417 Wxwidgets: Split memory watches in panel
6418 \end_layout
6420 \begin_layout Itemize
6421 Wxwidgets: Disable VMAs in memory search
6422 \end_layout
6424 \begin_layout Itemize
6425 lsnes-dumpavi: Fix speed bug
6426 \end_layout
6428 \begin_layout Itemize
6429 Movie subtitle support
6430 \end_layout
6432 \begin_layout Itemize
6433 Fix rerecord count reporting
6434 \end_layout
6436 \begin_layout Itemize
6437 Don't trash movie when loading in readonly mode.
6438 \end_layout
6440 \begin_layout Subsection
6441 rr1-delta14epsilon1
6442 \end_layout
6444 \begin_layout Itemize
6445 Wxwidgets: Fix crashes on closing settings dialogs on Mac OS X.
6446 \end_layout
6448 \begin_layout Itemize
6449 Fix build on Mac OS X.
6450 \end_layout
6452 \begin_layout Itemize
6453 Lua: loopwrapper
6454 \end_layout
6456 \begin_layout Itemize
6457 Wxwidgets: Hidable messages window
6458 \end_layout
6460 \begin_layout Itemize
6461 Lua: input.joyset
6462 \end_layout
6464 \begin_layout Itemize
6465 Bsnes: Support inconsistent saves
6466 \end_layout
6468 \begin_layout Itemize
6469 Bsnes: Allow simulating saving every frame
6470 \end_layout
6472 \begin_layout Itemize
6473 Fix desync if savestate is loaded in readonly mode in certain conditions.
6474 \end_layout
6476 \begin_layout Itemize
6477 Wxwidgets: Fix save dialogs on Mac OS X.
6478 \end_layout
6480 \begin_layout Itemize
6481 Wxwidgets: Fix insane status width on Win32.
6482 \end_layout
6484 \begin_layout Itemize
6485 Wxwidgets: Fix autohold processing to be faster.
6486 \end_layout
6488 \begin_layout Itemize
6489 Wxwidgets: Allow loading ROMs and movies from commandline.
6490 \end_layout
6492 \begin_layout Subsection
6493 rr1-delta15
6494 \end_layout
6496 \begin_layout Itemize
6497 Be a bit smarter with --load
6498 \end_layout
6500 \begin_layout Itemize
6501 Rewrote higher-level parts of audio system
6502 \end_layout
6504 \begin_layout Itemize
6505 Tool to build commentary tracks
6506 \end_layout
6508 \begin_layout Itemize
6509 Lua: input.joyget
6510 \end_layout
6512 \begin_layout Itemize
6513 Gambatte: Add support for SVN358
6514 \end_layout
6516 \begin_layout Itemize
6517 Use builtin font when rendering status panel.
6518 \end_layout
6520 \begin_layout Itemize
6521 Option to detach memory watch to its own window.
6522 \end_layout
6524 \begin_layout Itemize
6525 Recent ROMs/Movies menu
6526 \end_layout
6528 \begin_layout Itemize
6529 Libao support
6530 \end_layout
6532 \begin_layout Itemize
6533 Useful lag counter for SNES games that autopoll
6534 \end_layout
6536 \begin_layout Itemize
6537 Fix buffer overflow in gambatte sound output
6538 \end_layout
6540 \begin_layout Subsection
6541 rr1-delta15epsilon1
6542 \end_layout
6544 \begin_layout Itemize
6545 Don't blow up on wxGTK if the window is hidden somehow
6546 \end_layout
6548 \begin_layout Itemize
6549 Support simultaneous drop of ROM and movie.
6550 \end_layout
6552 \begin_layout Itemize
6553 Gambatte: Don't save spurious SRAMs.
6554 \end_layout
6556 \begin_layout Itemize
6557 Make SGB ROMs actually usable.
6558 \end_layout
6560 \begin_layout Itemize
6561 Fix so that saved movies appear in recent movies.
6562 \end_layout
6564 \begin_layout Itemize
6565 Don't open multiple commentary editors at once.
6566 \end_layout
6568 \begin_layout Subsection
6569 rr1-delta15epsilon2
6570 \end_layout
6572 \begin_layout Itemize
6573 Lua: memory.readregion/memory.writeregion
6574 \end_layout
6576 \begin_layout Itemize
6577 Lua: memory.map{,s}{byte,word,dword,qword}
6578 \end_layout
6580 \begin_layout Itemize
6581 Lua: memory.map_structure
6582 \end_layout
6584 \begin_layout Itemize
6585 Lua: Fix bus_address for gambatte
6586 \end_layout
6588 \begin_layout Itemize
6589 Fix features dependent of bsnes debugger
6590 \end_layout
6592 \begin_layout Itemize
6593 Cleanup bsnes debugger logic
6594 \end_layout
6596 \begin_layout Itemize
6597 Fix resets in presence of save every frame
6598 \end_layout
6600 \begin_layout Subsection
6601 rr1-delta15epsilon3
6602 \end_layout
6604 \begin_layout Itemize
6605 Lua: input.lcid_to_pcid
6606 \end_layout
6608 \begin_layout Itemize
6609 Fix off-by-one bug with slot hashes
6610 \end_layout
6612 \begin_layout Itemize
6613 Fix crashes on certain memory watch expressions
6614 \end_layout
6616 \begin_layout Itemize
6617 Lua: memory.read_expr
6618 \end_layout
6620 \begin_layout Itemize
6621 Lua: Fix memory.read_expr on nil argument
6622 \end_layout
6624 \begin_layout Itemize
6625 Fix the code to compile on G++ 4.7
6626 \end_layout
6628 \begin_layout Itemize
6629 Change button_id to be a function pointer field, not a virtual method
6630 \end_layout
6632 \begin_layout Itemize
6633 Add bsnes patches to fix libsnes to compile on GCC 4.7
6634 \end_layout
6636 \begin_layout Itemize
6637 Gambatte: Always use legacy lag counting
6638 \end_layout
6640 \begin_layout Itemize
6641 Memory commands: Memory addresses are up to 16 hex digits, not up to 8
6642 \end_layout
6644 \begin_layout Itemize
6645 Fix analog controllers
6646 \end_layout
6648 \begin_layout Itemize
6649 Fix autohold menus
6650 \end_layout
6652 \begin_layout Itemize
6653 Fix button symbols in input display
6654 \end_layout
6656 \begin_layout Itemize
6657 Compensate for nuts bsnes superscope/justifier handling
6658 \end_layout
6660 \begin_layout Itemize
6661 Lua: Fix bit.extract boolean handling
6662 \end_layout
6664 \end_body
6665 \end_document