1 #LyX 1.6.7 created this file. For more info see http://www.lyx.org/
6 \use_default_options true
11 \font_typewriter default
12 \font_default_family default
19 \paperfontsize default
28 \paperorientation portrait
38 \paragraph_separation indent
40 \quotes_language english
43 \paperpagestyle default
44 \tracking_changes false
60 \begin_layout Standard
61 JPC-RR is licenced under GNU GPL v2.
63 \begin_inset Quotes eld
67 \begin_inset Quotes erd
77 \begin_layout Subsection
81 \begin_layout Standard
82 To get started, you need BIOS image, VGABIOS image and DOS boot floppy and
83 JDK for Java 6 standard edition (later versions should they appear should
85 Note: JRE is not enough.
89 \begin_layout Standard
90 Note that to play back recorded movies, you need exact same version of BIOS
91 image, VGABIOS image and DOS boot floppy as was used when making the movie
92 (in addition to exact same versions of other needed media).
95 \begin_layout Subsection
99 \begin_layout Standard
100 See compile.sh or compile.bat.
101 The streamtools stuff is only needed for dumping videos.
104 \begin_layout Subsection
108 \begin_layout Standard
109 First you need to get and make some important images.
110 Obtain BIOS image, VGABIOS image and DOS boot floppy from somewhere.
111 After starting the emulator, use Drives -> Import Image to import the images
112 (ignore the error about no BIOS images being found).
115 \begin_layout Subsection
119 \begin_layout Standard
120 There is premade autoexec script called assemble.jpcrrinit that has fairly
125 \begin_layout LyX-Code
126 java JPCApplication -autoexec assemble.jpcrrinit
129 \begin_layout Standard
130 The script pops up settings for new emulated PC (if you want to load savestate,
132 Select BIOS and VGABIOS for BIOS and VGABIOS image (they should be already
133 selected), DOSfloppy for fda (boot device should be set to fda) and game
134 image as some HD drive
137 \begin_layout Subsection
141 \begin_layout Itemize
142 Putting the game as hdd (the fourth hard disk slot) causes boot to be bit
146 \begin_layout Itemize
147 Some BIOS versions have
148 \begin_inset Quotes eld
151 press F12 to select boot device
152 \begin_inset Quotes erd
156 Hit <enter> from emulated keyboard and that prompt will go away in about
157 half emulated second (it stays several emulated seconds otherwise).
161 \begin_layout Itemize
162 If game doesn't need lots of memory, hitting F5 to skip intialization files
164 If it does need more memory, run config.sys commands but not autoexec.bat.
168 \begin_layout Itemize
169 Some DOS disks have DOSIDLE with them, don't use it as it messes badly with
173 \begin_layout Section
174 Making JPC-RR format images from raw images
177 \begin_layout Standard
178 Due to various factors, JPC-RR can't use raw image files directly but requires
179 its own image format.
183 \begin_layout Subsection
184 Importing images from GUI:
187 \begin_layout Standard
188 Use Drives -> Import Image to import existing directories or image files.
189 Dialog prompting parameters will be displayed.
190 When importing floppy images, check
191 \begin_inset Quotes eld
195 \begin_inset Quotes erd
198 if possible, that enables geometry autodetection, which is reasonable virtually
199 all of the time it is offered.
202 \begin_layout Subsection
206 \begin_layout Itemize
207 If making image from directory, the names of the files must conform to FAT
208 naming restrictions (8+3 character names, no spaces, etc).
209 Avoid filenames with non-ASCII characters.
213 \begin_layout Itemize
214 The DOS limit of 112 or 224 files for floppies does not apply to images
215 created from directory trees.
216 The minimum limit value used is 512.
217 If even that isn't enough, the limit is automatically increased to fit
218 all the needed directory entries.
221 \begin_layout Itemize
222 Making boot disks from tree does NOT work.
223 Even if you got system boot files there, it still won't work.
226 \begin_layout Itemize
227 Only floppy disks and hard drives can be made from directory trees.
228 BIOS images and CDROM images require image file.
231 \begin_layout Itemize
232 Avoid floppies with custom geometry (floppy geometry does affect disk ID).
233 Disks with over 63 sectors per track don't work with DOS.
234 Wheither disks with over 127 tracks per side work with DOS is unknown.
235 Also avoid 1024-tracks per side HDDs.
238 \begin_layout Itemize
239 The geometry limits are: 2-1024 tracks per side for HDD, 1-256 tracks per
241 1-63 sectors per track for HDD, 1-255 sectors per track for floppy.
242 1-16 sides for HDD, 1 or 2 sides for floppy.
243 This gives size limit of 65280KiB for floppy disks (but note the DOS limit!)
244 and 516096KiB for HDDs.
247 \begin_layout Itemize
248 There are multiple image file contents that represent the same image.
249 The one with smallest size is picked when creating image.
252 \begin_layout Itemize
253 Note: Although the IDs are 128 bits long, they are not MD5 hashes.
257 \begin_layout Subsection
258 Importing from command line
261 \begin_layout Standard
262 There is tool called ImageMaker that can make JPC-RR images from raw images.
263 Each image has format, ID an name.
264 Format and name are specified when making image.
265 ID is automatically calculated from format and contents.
266 Name does not affect the ID but is purely for convience so one doesn't
267 have to specify long image IDs manually.
270 \begin_layout Subsubsection
274 \begin_layout Standard
275 The syntax for ImageMaker when making images is:
278 \begin_layout LyX-Code
279 $ java ImageMaker <format> [<options>...] <destination> <source> <name>
282 \begin_layout Standard
283 <destination> is file name for JPC-RR format image to write.
284 <source> is either name of regular file (raw image file) or name of directory
285 tree with files (supported for making floppy or hard disk images only).
286 In case of directory tree, the files are layout deterministically to disk,
287 so the ID will always be the same for given geometry and type.
288 <name> is name to give to disk.
292 \begin_layout LyX-Code
293 --BIOS BIOS image (note: VGABIOS is also of this type).
296 \begin_layout LyX-Code
297 --CDROM CD-ROM image.
300 \begin_layout LyX-Code
301 --HDD=cylinders,sectors,heads Hard disk with specified geometry.
304 \begin_layout LyX-Code
305 --floppy=tracks,sectors,sides Floppy disk with specified geometry.
308 \begin_layout LyX-Code
309 --floppy160 160KiB floppy (40 tracks, 8 sectors, Single sided).
312 \begin_layout LyX-Code
313 --floppy180 180KiB floppy (40 tracks, 9 sectors, Single sided).
316 \begin_layout LyX-Code
317 --floppy320 320KiB floppy (40 tracks, 8 sectors, Double sided).
320 \begin_layout LyX-Code
321 --floppy360 360KiB floppy (40 tracks, 9 sectors, Double sided).
324 \begin_layout LyX-Code
325 --floppy410 410KiB floppy (41 tracks, 10 sectors, Double sided).
328 \begin_layout LyX-Code
329 --floppy420 420KiB floppy (42 tracks, 10 sectors, Double sided).
332 \begin_layout LyX-Code
333 --floppy720 720KiB floppy (80 tracks, 9 sectors, Double sided).
336 \begin_layout LyX-Code
337 --floppy800 800KiB floppy (80 tracks, 10 sectors, Double sided).
340 \begin_layout LyX-Code
341 --floppy820 820KiB floppy (82 tracks, 10 sectors, Double sided).
344 \begin_layout LyX-Code
345 --floppy830 830KiB floppy (83 tracks, 10 sectors, Double sided).
348 \begin_layout LyX-Code
349 --floppy880 880KiB floppy (80 tracks, 11 sectors, Double sided).
352 \begin_layout LyX-Code
353 --floppy1040 1040KiB floppy (80 tracks, 13 sectors, Double sided).
356 \begin_layout LyX-Code
357 --floppy1120 1120KiB floppy (80 tracks, 14 sectors, Double sided).
360 \begin_layout LyX-Code
361 --floppy1200 1200KiB floppy (80 tracks, 15 sectors, Double sided).
364 \begin_layout LyX-Code
365 --floppy1440 1440KiB floppy (80 tracks, 18 sectors, Double sided).
368 \begin_layout LyX-Code
369 --floppy1476 1476KiB floppy (82 tracks, 18 sectors, Double sided).
372 \begin_layout LyX-Code
373 --floppy1494 1494KiB floppy (83 tracks, 18 sectors, Double sided).
376 \begin_layout LyX-Code
377 --floppy1600 1600KiB floppy (80 tracks, 20 sectors, Double sided).
380 \begin_layout LyX-Code
381 --floppy1680 1680KiB floppy (80 tracks, 21 sectors, Double sided).
384 \begin_layout LyX-Code
385 --floppy1722 1722KiB floppy (82 tracks, 21 sectors, Double sided).
388 \begin_layout LyX-Code
389 --floppy1743 1743KiB floppy (83 tracks, 21 sectors, Double sided).
392 \begin_layout LyX-Code
393 --floppy1760 1760KiB floppy (80 tracks, 22 sectors, Double sided).
396 \begin_layout LyX-Code
397 --floppy1840 1840KiB floppy (80 tracks, 23 sectors, Double sided).
400 \begin_layout LyX-Code
401 --floppy1920 1920KiB floppy (80 tracks, 24 sectors, Double sided).
404 \begin_layout LyX-Code
405 --floppy2880 2880KiB floppy (80 tracks, 36 sectors, Double sided).
408 \begin_layout LyX-Code
409 --floppy3120 3120KiB floppy (80 tracks, 39 sectors, Double sided).
412 \begin_layout LyX-Code
413 --floppy3200 3200KiB floppy (80 tracks, 40 sectors, Double sided).
416 \begin_layout LyX-Code
417 --floppy3520 3520KiB floppy (80 tracks, 44 sectors, Double sided).
420 \begin_layout LyX-Code
421 --floppy3840 3840KiB floppy (80 tracks, 48 sectors, Double sided).
424 \begin_layout Subsubsection
428 \begin_layout LyX-Code
429 --volumelabel=label Give specified volume label (affects ID).
430 Only meaningful when making image out of directory tree.
431 Default is no volume label.
434 \begin_layout LyX-Code
435 --timestamp=YYYYMMDDHHMMSS Give specified timestamp for files (affects ID).
436 Only meaningful when making image out of directory tree.
437 The default timestamp is 19900101T000000Z.
440 \begin_layout Subsubsection
444 \begin_layout Standard
448 \begin_layout LyX-Code
449 $ java ImageMaker <imagefile>
452 \begin_layout Standard
453 Variety of information about image is displayed (especially for floppies/HDDs).
454 Two important fields are calculated and claimed disk ID.
455 They should be the same.
456 If they are not, then the image file is corrupt (sadly, imagemaker has
457 bugs and bugs that cause it to write corrupt images have been seen).
460 \begin_layout Subsection
461 Advanced: The disk ID algorithm
464 \begin_layout Standard
465 The disk ID is calculated as:
468 \begin_layout LyX-Code
469 Skein-256-128-deprecated(<typecode>|<geometry>|<image>)
472 \begin_layout Standard
473 Where Skein-256-128-deprecated is Skein hash function with 256-bit internal
474 state and 128-bit output using the deprecated rotation constants (as specified
475 in Skein hash function reference documentation versions 1.0 and 1.1).
476 The <image> is the whole image, including parts not stored in image file.
477 The reason for keeping using the deprecated constants are:
480 \begin_layout Itemize
481 Changing the constants would change the IDs, which would invalidate existing
485 \begin_layout Itemize
486 This is not about cryptographic security
489 \begin_layout Itemize
490 The new constants don't improve security that much anyway.
493 \begin_layout Subsubsection
497 \begin_layout Standard
498 Floppies have <typecode> value 0 (single byte) and HDDs have 1 (single byte).
499 <geometry> is as follows (this is exactly the same form as it appears in
503 \begin_layout LyX-Code
504 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
507 \begin_layout LyX-Code
508 Byte 0 bits 2-5: Head count - 1.
511 \begin_layout LyX-Code
512 Byte 0 bits 6-7: Reserved, must be 0.
515 \begin_layout LyX-Code
516 Byte 1: Bits 0-7 of track count per side - 1.
519 \begin_layout LyX-Code
520 Byte 2: Sector count per track - 1.
523 \begin_layout Subsubsection
524 CD-ROM and BIOS images
527 \begin_layout Standard
528 CD-ROMs have <typecode> value 2 (single byte) and BIOS images have 3 (single
533 \begin_layout Subsection
534 Advanced: Disk Image format
537 \begin_layout Standard
538 The disk image consists of following parts, concatenated in this order without
542 \begin_layout Itemize
546 \begin_layout Itemize
550 \begin_layout Itemize
554 \begin_layout Itemize
558 \begin_layout Itemize
562 \begin_layout Itemize
563 type-specific geometry/size data
566 \begin_layout Itemize
570 \begin_layout Itemize
574 \begin_layout Subsubsection
578 \begin_layout Standard
579 Magic in disk image files is following 5 bytes:
580 \begin_inset Quotes eld
584 \begin_inset Quotes erd
590 \begin_layout Subsubsection
594 \begin_layout Standard
595 Disk ID is given as 16 bytes, encoding the 128-bit disk ID.
598 \begin_layout Subsubsection
602 \begin_layout Standard
603 Type code is single byte.
604 0 for floppies, 1 for HDDs, 2 for CD-ROMs and 3 for BIOS images.
605 Other values are reserved.
608 \begin_layout Subsubsection
612 \begin_layout Standard
614 Disk name length is given as two-byte big-endian value.
615 New images should have 0 here.
618 \begin_layout Subsubsection
622 \begin_layout Standard
624 Name field is there for backward compatiblity.
625 Disk name length gives length of this field in bytes.
628 \begin_layout Subsubsection
629 Type-specific geometry/size data (floppies and HDDs)
632 \begin_layout Standard
633 Floppies and HDDs have 3-byte geometry data:
636 \begin_layout LyX-Code
637 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
640 \begin_layout LyX-Code
641 Byte 0 bits 2-5: Head count - 1.
644 \begin_layout LyX-Code
645 Byte 0 bits 6-7: Reserved, must be 0.
648 \begin_layout LyX-Code
649 Byte 1: Bits 0-7 of track count per side - 1.
652 \begin_layout LyX-Code
653 Byte 2: Sector count per track - 1.
656 \begin_layout Subsubsection
657 Type specific-geometry/size data (CD-ROMs)
660 \begin_layout Standard
661 CD-ROMs have 4-byte big-endian sector (512 bytes!) count.
664 \begin_layout Subsubsection
665 Type specific-geometry/size data (BIOS images)
668 \begin_layout Standard
669 BIOS images have 4-byte big-endian byte (not sector or block) count.
672 \begin_layout Subsubsection
673 Actual image data (floppy/HDD)
676 \begin_layout Standard
677 Floppy or HDD imagedata consists of following subparts:
680 \begin_layout Itemize
684 \begin_layout Itemize
688 \begin_layout Itemize
692 \begin_layout Itemize
696 \begin_layout Standard
697 Storage method is single byte.
698 Sectors present gives number of last nonzero sector + 1 (zero if image
702 \begin_layout Subsubsection
703 Floppy/HDD storage method 0: Raw storage
706 \begin_layout Standard
707 This storage method has empty header.
708 Image data is raw dump of first sectors present sectors.
711 \begin_layout Subsubsection
712 Floppy/HDD storage method 1: Sectormap
715 \begin_layout Standard
716 Image data header contains bitfield with just enough bytes to have one bit
718 The order of bits is such that number of bit corresponding to each sector
719 in byte is sector number modulo 8 and byte number is floor of sector number
720 divided by 8 when sector numbers are counted from zero.
721 If bit corresponding to sector is set, then the sector is present in image
722 data, otherwise it is absent and assumed to be all-zeroes.
725 \begin_layout Standard
726 Image data contains dumps of all present sectors in order of increasing
730 \begin_layout Subsubsection
731 Floppy/HDD storage method 2: Extent first sector zero
734 \begin_layout Standard
735 Image data is empty as storage-specific data is mangled with image data.
736 The image data alternates between blocks encoding zero sectors and blocks
737 encoding nonzero sectors.
738 The first block encodes zero sectors.
742 \begin_layout Standard
743 Block encoding zero sectors consist of single 1-4 byte little-endian value
744 encoding number of sectors in block - 1.
745 Number of bytes is determined by sectors present value.
746 It is 1 for 1-256 sectors, 2 for 257-65536, 3 for 65537-16777216 and 4
747 for more than 16777216.
748 All sectors in block are filled with zeroes and are not stored.
751 \begin_layout Standard
752 Block encoding nonzero sectors has same block count as zero sector block
753 but is followed by the sectors stored raw.
756 \begin_layout Subsubsection
757 Floppy/HDD storage method 3: Extent first sector nonzero
760 \begin_layout Standard
761 Same as storage method 2 but first block is nonzero sector block.
764 \begin_layout Subsubsection
765 Actual image data (CD-ROMs and BIOS images)
768 \begin_layout Standard
769 These store image data raw.
770 The amount of data is specified by sector/byte count.
773 \begin_layout Subsubsection
777 \begin_layout Standard
778 Comments are given as list of strings, with UTF-8 encoded strings following
779 2-octet big-endian length.
780 Comment list is terminated by entry with length 0 (0x00 0x00).
781 Comments are optional and may be absent.
784 \begin_layout Section
788 \begin_layout Standard
789 The actual emulator is invoked as:
792 \begin_layout LyX-Code
793 $ java JPCApplication <options>...
796 \begin_layout Standard
797 The valid options are:
800 \begin_layout LyX-Code
801 -autoexec <script> Execute contents of specified file as commands when starting
805 \begin_layout LyX-Code
806 -noautoexec Don't run autoexec files.
809 \begin_layout LyX-Code
810 -norenames Copy&Delete files instead of renaming.
811 Mainly meant for debugging copy&delte code.
814 \begin_layout LyX-Code
815 -imagemaker <options> Run in image maker mode (run with parameter '-imagemaker'
816 with no further parameters for help)
819 \begin_layout Standard
820 If no arguments are given, defaults of autoexec file of 'assemble.jpcrrinit'
824 \begin_layout Subsection
828 \begin_layout Standard
829 When emulator is started, command line comes up.
830 Following commands are known:
833 \begin_layout Itemize
834 'exit': exit immediately.
835 Dumps in progress are gracefully closed.
838 \begin_layout Itemize
839 'kill': Save stack traces and kill the emulator (for debugging only).
840 Any dumps in progress are likely corrupted.
843 \begin_layout Itemize
844 'library <library>': set library directory to <library>.
847 \begin_layout Itemize
848 'load <plugin>': Load plugin (no arguments)
851 \begin_layout Itemize
852 'load <plugin>(<arguments>)': load plugin with arguments.
855 \begin_layout Itemize
856 'command <command> [<arguments>...]': Invoke command via external command interface.
859 \begin_layout Itemize
860 'call<command> [<arguments>...]': Invoke command via external command interface
861 and print return values.
864 \begin_layout Itemize
865 'lsdisks [<filename>]' Print listing of all known disks.
866 If <filename> is specified, save output to specified file.
869 \begin_layout Itemize
870 'diskinfo [<filename>] <imagename>' Print Information about <imagename>
871 (can be disk name or ID).
872 If <filename> is specified, save output to specified file.
875 \begin_layout Standard
876 When one gets command line, its useful to load some plugins.
877 See section about plugins.
878 Note: Load runner plugin (PCControl/PCRunner and so) last, as some runners
879 like to start PC immediately.
882 \begin_layout Subsection
883 PC settings dialog notes
886 \begin_layout Itemize
887 CPU divider base frequency before division is 1GHz.
890 \begin_layout Itemize
891 Images can be specified by name or by ID.
892 Name is relative to library directory.
893 If the image is in subdirectory of image directory, the directory separator
894 is is '/' regardless of what the host OS uses.
897 \begin_layout Itemize
898 CD-ROM and hdc are mutually exclusive
901 \begin_layout Itemize
902 Modules is comma-seperated list of modules to load.
903 To pass arguments to some modules, enclose the arguments in ().
904 Same module can be specified twice only if parameters differ.
907 \begin_layout Itemize
908 Setting boot device doesn't work with some BIOS versions.
909 Those versions prompt the boot device anyway.
912 \begin_layout Subsection
913 Audio output channels
916 \begin_layout Standard
917 PC can have one or more audio output channels.
918 The name of audio output associated with PC speaker is: 'org.jpc.emulator.peripher
920 Modules that have audio outputs get channel names of form <classname>-<sequenti
921 al>, where <classname> is name of main module class and sequential is number
923 Note that same module can have multiple output channels.
924 If multiple modules of same class request audio outputs, the <sequential>
925 values of subsequent module start where previous left off.
928 \begin_layout Subsection
932 \begin_layout Standard
933 Plugins actually execute the tasks of the emulator.
934 They can be loaded using
935 \begin_inset Quotes eld
939 \begin_inset Quotes erd
942 or 'load <plugin>(<arguments>)
943 \begin_inset Quotes erd
949 \begin_layout Standard
950 Different Plugins using the same output (like running PCMonitor and RAWVideoDump
951 er) should not conflict because connector output hold locking is desinged
952 to handle multiple readers.
955 \begin_layout Standard
956 If no plugin used requires GUI, then the emulator can be run without having
960 \begin_layout Subsubsection
961 plugin: org.jpc.plugins.PCControl
964 \begin_layout Standard
965 Takes optionally 'extramenu=<file>' and 'uncompressedsave=1', requires and
969 \begin_layout Standard
970 Runs the PC emulator core.
971 Has capability to start/stop emulation, breakpoint after certain time or
972 start/end of VGA vertical retrace.
973 Also can create, savestate and loadstate PC emulation.
974 Memory dumping is supported.
978 \begin_layout Standard
979 'extramenu=<file>' causes Plugin to load extra menu entries from <file>.
980 'uncompressedsave=1' causes savestates to be written uncompressed (useful
981 if they are stored in VCS supporting delta compression).
984 \begin_layout Subsubsection
985 plugin: org.jpc.plugins.PCRunner
988 \begin_layout Standard
989 Takes 'movie=<file>' as argument and optionally 'stoptime=<time>' Does not
993 \begin_layout Standard
994 Loads PC from savestate and just runs it.
996 Also automatically quits once stoptime is reached.
999 \begin_layout Subsubsection
1000 plugin: org.jpc.plugins.PCMonitor
1003 \begin_layout Standard
1004 No arguments, requires and uses GUI.
1007 \begin_layout Standard
1008 VGA monitor for emulated PC.
1011 \begin_layout Subsubsection
1012 plugin: org.jpc.plugins.VirtualKeyboard
1015 \begin_layout Standard
1016 No arguments, requires and uses GUI.
1019 \begin_layout Standard
1020 On-screen keyboard for emulated PC.
1023 \begin_layout Subsubsection
1024 plugin: org.jpc.plugins.PCStartStopTest
1027 \begin_layout Standard
1028 No arguments, requires and uses GUI.
1031 \begin_layout Standard
1032 Small plugin testing remote PC start/stop.
1033 Also supports sending some common keypresses.
1036 \begin_layout Subsubsection
1037 plugin: org.jpc.plugins.RAWVideoDumper
1040 \begin_layout Standard
1041 Takes 'rawoutput=<file>' as argument.
1042 Does not require nor use GUI.
1045 \begin_layout Standard
1046 Dumps all generated frames to RAW file <file>.
1047 Rawoutput is required.
1048 The raw file consists of concatenation of zlib streams.
1049 The uncompressed stream is concatenation of time skips (FFh FFh FFh FFh),
1050 each acting as time offset of 2^32-1 nanoseconds and saved frames.
1051 The saved frame has time offset in nanoseconds (big endian) as first four
1052 bytes (must be at most 2^32-2, as 2^32-1 is reserved for time skip).
1053 The next two bytes are big-endian width, next two big-endian height.
1054 Finally frame has 4 * width * height bytes of data that encodes pixels
1055 using 4 bytes per pixel, in left-to-right, up-to-down order.
1056 Byte 0 of each pixel is reserved, byte 1 is the red channel, byte 2 is
1057 green channel and byte 3 is blue channel.
1060 \begin_layout Standard
1061 Dumping to pipe is supported.
1064 \begin_layout Subsubsection
1065 plugin: org.jpc.plugins.RAWAudioDumper
1068 \begin_layout Standard
1069 Takes 'src=<name of audio output channel>', 'file=<output-filename>' and
1070 'offset=<offset>' as arguments, separated by ','.
1071 Does not require nor use GUI.
1074 \begin_layout Standard
1075 Dumps output from specified audio output channel (src, mandatory) to RAW-format
1076 file (file, mandatory).
1077 The resulting file consists of records, 4 or 8 bytes each.
1078 4 byte record consists of 0xFF 0xFF 0xFF 0xFF and means to increase next
1080 \begin_inset Formula $2^{32}-1$
1084 Otherwise record is 8 bytes.
1085 Each 8 byte record has three fields.
1086 First 4 byte unsinged big endian timedelta value (in nanoseconds, must
1088 \begin_inset Formula $2^{32}-1$
1091 ), then 2 byte signed big endian new left channel volume, then 2 byte signed
1092 big endian new right channel volume.
1093 Optionally 'offset' can be set to positive value (in nanoseconds) to delay
1097 \begin_layout Subsubsection
1098 plugin: org.jpc.plugins.LuaPlugin
1101 \begin_layout Standard
1102 Takes 'kernel=<name of lua kernel file>', other parameters are passed to
1103 kernel, requires and uses GUI.
1106 \begin_layout Standard
1107 Lua VM for executing scripts.
1110 \begin_layout Subsubsection
1111 plugin: org.jpc.plugins.JoystickInput
1114 \begin_layout Standard
1116 Displays window for sending joystick input.
1119 \begin_layout Section
1123 \begin_layout Subsection
1124 org.jpc.modules.Joystick:
1127 \begin_layout Itemize
1131 \begin_layout Itemize
1132 Resources: I/O port 0x201
1135 \begin_layout Standard
1136 Emulates joystick game port.
1139 \begin_layout Subsection
1140 org.jpc.modules.SoundCard
1143 \begin_layout Itemize
1144 Arguments: Optional resources specification
1147 \begin_layout Itemize
1148 Resources (defaults): I/O port 0x220-0x22F, IRQ 5, DMA 1, DMA 5
1151 \begin_layout Standard
1152 Emulates Sound card.
1155 \begin_layout Subsection
1156 org.jpc.modules.FMCard
1159 \begin_layout Itemize
1160 Arguments: Optional resources specification
1163 \begin_layout Itemize
1164 Resources (defaults): I/O port 0x338-0x33B
1167 \begin_layout Standard
1171 \begin_layout Subsection
1172 org.jpc.modules.BasicFPU:
1175 \begin_layout Itemize
1179 \begin_layout Itemize
1183 \begin_layout Standard
1184 Crude FPU (x87) emulator.
1187 \begin_layout Section
1191 \begin_layout Standard
1192 Hacks are saved to savestates but not movies.
1195 \begin_layout Subsection
1199 \begin_layout Standard
1200 Force bit 1 of physical address 0x0410 to zero, signaling that the system
1202 BIOS assumes system has FPU but some games use that bit to detect FPU,
1203 trying to use it if it is
1204 \begin_inset Quotes eld
1208 \begin_inset Quotes erd
1212 Try this if game startup hangs with lots of trying to use FPU but not present
1214 Don't use if there is FPU present.
1215 Needed to get games like Blake Stone / Wolfenstein 3-D to work (FPU emulator
1216 allows it to start but causes graphical glitches).
1219 \begin_layout Subsection
1223 \begin_layout Standard
1224 Update basic VGA parameters before vretrace, not after it.
1226 Commander Keen 4) don't like if this isn't done and some games (e.g.
1227 Mario & Luigi) don't like if it is done.
1228 Wrong value manifests as jerky scrolling (scrolling back and forth and
1229 fixed statusbars move).
1232 \begin_layout Section
1233 Some error messages and explanations
1236 \begin_layout Itemize
1237 <filename> is Not a valid image file
1240 \begin_layout Itemize
1241 <filename> is not image file
1244 \begin_layout Itemize
1245 <filename> claims to be floppy with illegal geometry: <x> tracks, <y> sides
1249 \begin_layout Itemize
1250 <filename> claims to be HDD with illegal geometry: <x> tracks, <y> sides
1254 \begin_layout Itemize
1255 Can't read disk image sector map.
1258 \begin_layout Itemize
1259 Can't read disk image extent.
1262 \begin_layout Standard
1263 Code expects <filename> to be valid JPC-RR format image, but it isn't JPC-RR
1264 image at all or its corrupt.
1267 \begin_layout Itemize
1268 <filename> is image of unknown type.
1271 \begin_layout Itemize
1272 <filename> has unrecognized geometry <x> <y> <z>
1275 \begin_layout Standard
1276 Possibly corrupt image, not JPC-RR image, or JPC-RR image from future version
1277 containing something current version can't comprehend.
1280 \begin_layout Itemize
1281 Invalid format specifier <something>.
1284 \begin_layout Itemize
1285 Invalid syntax of --floppy= or --HDD= option.
1288 \begin_layout Itemize
1289 Invalid format specifier/option <something>.
1292 \begin_layout Standard
1293 Invalid option or format specifier was given.
1297 \begin_layout Itemize
1298 java ImageMaker [<options>...] <format> <destination> <source> <diskname>
1301 \begin_layout Standard
1302 Check syntax of command.
1303 Especially that diskname is present!
1306 \begin_layout Itemize
1307 The image has <nnn> sectors while it should have <yyy> according to selected
1311 \begin_layout Itemize
1312 Raw image file length not divisible by 512.
1315 \begin_layout Itemize
1316 Trying to read sector out of range.
1319 \begin_layout Standard
1320 The selected geometry is wrong or raw image is incomplete.
1323 \begin_layout Itemize
1324 Invalid disk name (Should not happen!).
1327 \begin_layout Itemize
1328 Invalid geometry to be written.
1331 \begin_layout Standard
1332 This is a very likely a bug in program.
1335 \begin_layout Itemize
1336 What the heck <filename> is? It's not regular file nor directory.
1339 \begin_layout Standard
1340 That sort of file can't be used as input for image making, or the file just
1344 \begin_layout Itemize
1345 BIOS images can only be made out of regular files.
1348 \begin_layout Itemize
1349 CD images can only be made out of regular files.
1352 \begin_layout Standard
1353 Source image specified is not regular file, but image of that type can't
1354 be made of anything else.
1357 \begin_layout Itemize
1358 Can't read raw bios image file.
1361 \begin_layout Itemize
1362 Can't read sector <nnn> from image.
1365 \begin_layout Standard
1366 Reading the raw image file failed for some reason.
1369 \begin_layout Itemize
1370 Bad library line: "<something>".
1374 \begin_layout Standard
1375 Syntax error in image library.
1378 \begin_layout Itemize
1379 Removing image <something> a.k.a.
1380 "<something>" as it no longer exists.
1383 \begin_layout Standard
1384 The image file no longer exists so it gets removed from library.
1387 \begin_layout Itemize
1388 Removing image <something> a.k.a.
1389 "<something>" due to <some> conflict.
1392 \begin_layout Standard
1393 Image library code killed some image from library due to some kind of conflict
1394 with image being added.
1397 \begin_layout Itemize
1398 Too much data to fit into given space.
1401 \begin_layout Standard
1402 The tree you gave contains takes just too much space to fit into disk of
1406 \begin_layout Section
1407 Advanced: Savestate/movie format
1410 \begin_layout Subsection
1411 Special character classes
1414 \begin_layout Subsubsection
1418 \begin_layout Standard
1419 Following Unicode codepoints (encoded as UTF-8) are interpretted as space
1423 \begin_layout Itemize
1424 Codepoints 0x20, and 0x09.
1427 \begin_layout Itemize
1428 Codepoints 0x1680, 0x180E, 0x2028, 0x205F and 0x3000
1431 \begin_layout Itemize
1432 Codepoints 0x2000-0x200A.
1435 \begin_layout Subsubsection
1439 \begin_layout Standard
1440 Following byte sequences are interpretted as linefeeds (line change):
1443 \begin_layout Itemize
1444 Byte 0x0A (UTF-8 encoded codepoint 0x0A)
1447 \begin_layout Itemize
1448 Byte 0x0D (UTF-8 encoded codepoint 0x0D)
1451 \begin_layout Itemize
1452 Byte 0x1C (UTF-8 encoded codepoint 0x1C)
1455 \begin_layout Itemize
1456 Byte 0x1D (UTF-8 encoded codepoint 0x1D)
1459 \begin_layout Itemize
1460 Byte 0x1E (UTF-8 encoded codepoint 0x1E)
1463 \begin_layout Itemize
1464 Bytes 0xC2 0x85 (UTF-8 for unicode control character NL, codepoint 0x85)
1467 \begin_layout Itemize
1468 Bytes 0xE2 0x80 0xA9 (UTF-8 encoded codepoint 0x2029)
1471 \begin_layout Subsection
1475 \begin_layout Standard
1476 JRSR archive format packs multiple text archive members to text archive.
1477 It does not support binary members.
1478 JRSR archives have first five or six bytes form the magic.
1480 \begin_inset Quotes eld
1484 \begin_inset Quotes erd
1487 followed by LINEFEED character There are four kinds of lines after that
1488 (lines are terminated by LINEFEED byte/bytes):
1491 \begin_layout Itemize
1495 \begin_layout Itemize
1499 \begin_layout Itemize
1503 \begin_layout Itemize
1507 \begin_layout Standard
1508 Sequencing rules are as follows: Start member is allowed anywhere (after
1510 Member line is allowed only inside member (member started but not ended).
1511 End member is only allowed inside member.
1512 End of file is only allowed outside member.
1513 Blank line is allowed anywhere after magic.
1516 \begin_layout Subsubsection
1520 \begin_layout Standard
1521 Start member line is given as
1522 \begin_inset Quotes eld
1526 \begin_inset Quotes erd
1529 <SPACE>+ <membername> <LINEFEED>.
1530 <SPACE>+ any number of SPACE characters at least one and <LINEFEED> is
1532 The member name is UTF-8 encoded and maximum allowed line length is 2048
1533 bytes (including LINEFEED, which means name is limited to 509-2040 codepoints
1534 depending on characters used).
1535 Starting member inside another implicitly ends the previous member.
1538 \begin_layout Subsubsection
1542 \begin_layout Standard
1543 Member line is given as
1544 \begin_inset Quotes eld
1548 \begin_inset Quotes erd
1551 <content><LINEFEED>.
1552 It gives another line for member contents.
1553 <content> is passed raw to layers above (followed by line termination)
1556 \begin_layout Subsubsection
1560 \begin_layout Standard
1561 End member line is given as
1562 \begin_inset Quotes eld
1566 \begin_inset Quotes erd
1570 It ends the current member.
1571 The following line can only be start member line or file may end.
1574 \begin_layout Subsubsection
1578 \begin_layout Standard
1579 Blank line is given as <LINEFEED>.
1580 Lines like that are ignored.
1583 \begin_layout Subsection
1584 Four-to-Five encoding
1587 \begin_layout Standard
1588 Binary members are encoded into text by so-called four-to-five encoding.
1589 This encoding can encode single byte to two, two bytes to three, three
1590 bytes to four and four bytes to five.
1591 Four-to-five encoding has five kinds of blocks.
1592 All SPACE and LINEFEED characters are completely ignored, even in middle
1596 \begin_layout Subsubsection
1600 \begin_layout Standard
1601 End stream block is encoded as '!'.
1602 It ends the stream instantly.
1603 There is also implicit end of stream at end of input to decoding.
1606 \begin_layout Subsubsection
1607 Other four block types
1610 \begin_layout Standard
1611 Other four block types take the value to be encoded, read it as big-endian
1613 Then they write it as base-93 big-endian value.
1614 Then length specific constants are added to digits of that number to yield
1615 ASCII values for characters (those are stored in order):
1618 \begin_layout Standard
1619 \begin_inset Tabular
1620 <lyxtabular version="3" rows="5" columns="6">
1622 <column alignment="center" valignment="top" width="0">
1623 <column alignment="center" valignment="top" width="0">
1624 <column alignment="center" valignment="top" width="0">
1625 <column alignment="center" valignment="top" width="0">
1626 <column alignment="center" valignment="top" width="0">
1627 <column alignment="center" valignment="top" width="0">
1629 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1632 \begin_layout Plain Layout
1638 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1641 \begin_layout Plain Layout
1647 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1650 \begin_layout Plain Layout
1656 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1659 \begin_layout Plain Layout
1665 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1668 \begin_layout Plain Layout
1674 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1677 \begin_layout Plain Layout
1685 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1688 \begin_layout Plain Layout
1694 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1697 \begin_layout Plain Layout
1703 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1706 \begin_layout Plain Layout
1712 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1715 \begin_layout Plain Layout
1721 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1724 \begin_layout Plain Layout
1730 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1733 \begin_layout Plain Layout
1741 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1744 \begin_layout Plain Layout
1750 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1753 \begin_layout Plain Layout
1759 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1762 \begin_layout Plain Layout
1768 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1771 \begin_layout Plain Layout
1777 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1780 \begin_layout Plain Layout
1786 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1789 \begin_layout Plain Layout
1797 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1800 \begin_layout Plain Layout
1806 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1809 \begin_layout Plain Layout
1815 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1818 \begin_layout Plain Layout
1824 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1827 \begin_layout Plain Layout
1833 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1836 \begin_layout Plain Layout
1842 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1845 \begin_layout Plain Layout
1853 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1856 \begin_layout Plain Layout
1862 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1865 \begin_layout Plain Layout
1871 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1874 \begin_layout Plain Layout
1880 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1883 \begin_layout Plain Layout
1889 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1892 \begin_layout Plain Layout
1898 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1901 \begin_layout Plain Layout
1915 \begin_layout Standard
1916 Blocks which encode values greater than what is possible for value of that
1917 length are fatal errors.
1921 \begin_layout Subsection
1922 Line component encoing
1925 \begin_layout Standard
1926 Line component encoding sits on top of UTF-8 encoding.
1927 Line component encoding encodes non-empty 1-D array of non-empty strings
1928 into line, and thus array of those into member.
1929 Empty lines or lines that don't contain any components are ignored.
1930 Line starts with depth value of 0 and must end with depth value of zero.
1933 \begin_layout Standard
1934 Components are seperated by component separators.
1935 Empty components are ignored.
1936 Following codepoints are separators on depth 0 if not escaped:
1939 \begin_layout Itemize
1941 The depth is read pre-increment.
1944 \begin_layout Itemize
1946 The depth is read post-decrement.
1949 \begin_layout Itemize
1953 \begin_layout Standard
1954 The following characters are special:
1957 \begin_layout Itemize
1959 Increments depth by 1 if not escaped (and appears in component).
1962 \begin_layout Itemize
1964 Decrements depth by 1 if not escaped (and appears in component).
1965 Depth going negative is an error.
1968 \begin_layout Itemize
1972 Next character is interpretted as literal.
1973 Error if at end of line.
1976 \begin_layout Standard
1977 Otherwise, characters are interpretted as literals and appear in components.
1978 Depth must be zero at end of line.
1981 \begin_layout Subsection
1985 \begin_layout Standard
1986 Header section is in archive member "header".
1987 It uses line component encoding.
1988 The first component of each line is name of header, and subsequent ones
1990 How many parameters are expected is dependent on what header it is:
1993 \begin_layout Subsubsection
1997 \begin_layout Itemize
1998 Header name: "PROJECTID"
2001 \begin_layout Itemize
2005 \begin_layout Itemize
2006 Argument #1: <project-id-string>
2009 \begin_layout Itemize
2013 \begin_layout Standard
2015 Project ID is generated when PC is assembled and is then preserved in save
2017 It is used for computing rerecord counts.
2018 Emulator treats it as opaque string, the IDs it generates are formed by
2019 48 random hexadecimal digits.
2022 \begin_layout Subsubsection
2026 \begin_layout Itemize
2027 Header name: "SAVESTATEID"
2030 \begin_layout Itemize
2034 \begin_layout Itemize
2035 Argument #1: <savestate-id-string>
2038 \begin_layout Itemize
2042 \begin_layout Standard
2043 Gives save state ID.
2044 Each save state has its own save state ID.
2045 Treated as opaque string, but generated as 48 random hexadecimal digits.
2046 The presence of this header signals whether there is save state to be loaded.
2047 If this header is present, save state load will be attempted.
2048 If absent, save state is not to be loaded even if present (and correct
2049 savestate load would be technically impossible anyway).
2052 \begin_layout Standard
2053 The value is used to prevent loading incompatible save states in preserve
2054 event stream mode and also to find the point in event stream where one
2058 \begin_layout Subsubsection
2062 \begin_layout Itemize
2063 Header name: "RERECORDS"
2066 \begin_layout Itemize
2070 \begin_layout Itemize
2071 Argument #1: <rerecords>
2074 \begin_layout Itemize
2078 \begin_layout Standard
2079 Gives rerecord count.
2080 PC assembly (except when loading save state) initializes current rerecord
2082 Must be non-negative and decimal number using ASCII digit characters.
2085 \begin_layout LyX-Code
2086 On loading save state:
2089 \begin_layout LyX-Code
2090 1) If project ID matches with previous:
2093 \begin_layout LyX-Code
2094 1a) If loaded rerecord count is larger or equal to current rerecord count:
2097 \begin_layout LyX-Code
2098 1a-a) Current rerecord count is loaded rerecord count + 1.
2101 \begin_layout LyX-Code
2105 \begin_layout LyX-Code
2106 1b-a) Current rerecord count increments by 1.
2109 \begin_layout LyX-Code
2113 \begin_layout LyX-Code
2114 2a) Current rerecord count is loaded rerecord count + 1.
2117 \begin_layout Standard
2118 The current rerecord count at time of save is saved to save state.
2121 \begin_layout Subsubsection
2125 \begin_layout Itemize
2126 Header name: "SYSTEM"
2129 \begin_layout Itemize
2133 \begin_layout Itemize
2134 Argument #1: <system-id-string>
2137 \begin_layout Itemize
2141 \begin_layout Standard
2142 Gives system this movie/save is for.
2143 The only currently recognized value is
2144 \begin_inset Quotes eld
2148 \begin_inset Quotes erd
2151 (if this header is absent, use default system).
2152 Invalid values trigger error on load time.
2155 \begin_layout Subsubsection
2159 \begin_layout Itemize
2160 Header name: "AUTHORS"
2163 \begin_layout Itemize
2164 Components: 2 or more
2167 \begin_layout Itemize
2168 Arguments: free form
2171 \begin_layout Itemize
2175 \begin_layout Standard
2176 Gives authors of run.
2177 Each argument gives one author (who has full name but no nickname).
2178 May be present multiple times.
2181 \begin_layout Subsubsection
2185 \begin_layout Itemize
2186 Header name: "AUTHORNICKS"
2189 \begin_layout Itemize
2190 Components: 2 or more
2193 \begin_layout Itemize
2194 Arguments: free form
2197 \begin_layout Itemize
2201 \begin_layout Standard
2202 Gives authors of run.
2203 Each argument gives one author (who has nickname but no full name).
2204 May be present multiple times.
2207 \begin_layout Subsubsection
2211 \begin_layout Itemize
2212 Header name: "AUTHORFULL"
2215 \begin_layout Itemize
2219 \begin_layout Itemize
2220 Arguments: free form
2223 \begin_layout Itemize
2227 \begin_layout Standard
2228 Gives author of run.
2229 First argument is full name of author, and second is nickname of author.
2230 May be present multiple times.
2233 \begin_layout Subsubsection
2237 \begin_layout Itemize
2238 Header name: "COMMENT"
2241 \begin_layout Itemize
2242 Components: 2 or more
2245 \begin_layout Itemize
2246 Arguments: free form
2249 \begin_layout Itemize
2253 \begin_layout Standard
2254 Various kinds of free form data.
2255 Not parsed further by emulator.
2258 \begin_layout Subsection
2259 Initialization segment:
2262 \begin_layout Standard
2263 If SAVESTATEID header isn't present (not a save state), member "initialization"
2264 gives PC initialization parameters for assembling the PC.
2265 It is present anyway even if SAVESTATEID is present (savestate).
2268 \begin_layout Standard
2269 Following parameters are used (space separates components):
2272 \begin_layout LyX-Code
2276 \begin_layout Standard
2277 Gives Image ID of main system BIOS (mandatory)
2280 \begin_layout LyX-Code
2284 \begin_layout Standard
2285 Gives Image ID of VGA BIOS (mandatory).
2288 \begin_layout LyX-Code
2292 \begin_layout Standard
2293 Gives Image ID of hda.
2294 Present only if system has hard disk hda.
2297 \begin_layout LyX-Code
2301 \begin_layout Standard
2302 Gives Image ID of hdb.
2303 Present only if system has hard disk hdb.
2306 \begin_layout LyX-Code
2310 \begin_layout Standard
2311 Gives Image ID of hdc.
2312 Present only if system has hard disk hdc.
2315 \begin_layout LyX-Code
2319 \begin_layout Standard
2320 Gives Image ID of hdd.
2321 Present only if system has hard disk hdd.
2324 \begin_layout LyX-Code
2328 \begin_layout Standard
2329 Gives Image ID of disk in slot <num>.
2330 Slot number must be non-negative.
2333 \begin_layout LyX-Code
2334 \begin_inset Quotes eld
2338 \begin_inset Quotes erd
2344 \begin_layout Standard
2345 kGives image name of disk in slot <num>.
2346 Slot number must be non-negative.
2347 The slot must be previously declared using
2348 \begin_inset Quotes eld
2352 \begin_inset Quotes erd
2358 \begin_layout LyX-Code
2362 \begin_layout Standard
2363 Gives Image slot to initially put into floppy drive fda.
2364 Disk must be of floppy type.
2365 If none present, no disk is initially put there.
2368 \begin_layout LyX-Code
2372 \begin_layout Standard
2373 Gives Image slot to initially put into floppy drive fdb.
2374 Disk must be of floppy type.
2375 If none present, no disk is initially put there.
2378 \begin_layout LyX-Code
2382 \begin_layout Standard
2383 Gives Image slot to initially put into CD-ROM drive hdc.
2384 Not allowed if hard disk hdc is present.
2385 Disk must be of CD-ROM type.
2386 If none present no disk is initially put there.
2389 \begin_layout LyX-Code
2390 "INITIALTIME" <time>
2393 \begin_layout Standard
2394 Number of milliseconds since Unix epoch to system start up time.
2398 \begin_layout Standard
2403 \begin_layout LyX-Code
2404 "CPUDIVIDER" <divider>
2407 \begin_layout Standard
2408 Set CPU frequency divider (dividing the 1GHz master clock).
2409 Allowed range is 1-256.
2413 \begin_layout LyX-Code
2414 "MEMORYSIZE" <pages>
2417 \begin_layout Standard
2418 Number of 4KiB pages of RAM memory.
2419 Allowed range 256-262144.
2423 \begin_layout LyX-Code
2427 \begin_layout Standard
2429 Valid devices are "FLOPPY" (boot from fda), "HDD" (boot from hda) and "CDROM"
2433 \begin_layout LyX-Code
2434 "LOADMODULEA" <module> <parameters>
2437 \begin_layout Standard
2438 Load module <module> with parameters <parameters>.
2441 \begin_layout LyX-Code
2442 "LOADMODULE" <module>
2445 \begin_layout Standard
2446 Load module <module> with no parameters
2449 \begin_layout LyX-Code
2450 \begin_inset Quotes eld
2454 \begin_inset Quotes erd
2460 \begin_layout Standard
2461 Use class <fpu> as FPU emulator.
2464 \begin_layout LyX-Code
2465 \begin_inset Quotes eld
2469 \begin_inset Quotes erd
2475 \begin_layout Standard
2476 Use I/O port delay emulation (each I/O port read/write takes 666ns).
2479 \begin_layout LyX-Code
2480 \begin_inset Quotes eld
2484 \begin_inset Quotes erd
2490 \begin_layout Standard
2491 Emulate VGA horizontal retrace.
2494 \begin_layout Subsection
2495 Event record format:
2498 \begin_layout Standard
2499 Event record is in archive member "events".
2500 It uses line component encoding.
2501 Each line gives an event.
2502 First component of each line gives time stamp.
2503 These timestamps MUST be in increasing order and all MUST be non-negative.
2504 Time stamp time unit is exactly 1 nanosecond of emulated time.
2507 \begin_layout Standard
2508 The second component of each line is name of class to dispatch to.
2509 Further components are passed as-is to event handlers.
2510 Classes with names consisting only of uppercase A-Z and 0-9 are special
2512 It is error to encounter unknown such special class.
2515 \begin_layout Subsubsection
2519 \begin_layout Itemize
2520 Dispatch to: SAVESTATE
2523 \begin_layout Itemize
2524 Argument #1: Savestate id
2527 \begin_layout Itemize
2528 Argument #2 (optional): Rerecord count at time of saving savestate
2531 \begin_layout Standard
2532 Signals that savestate has occured here.
2533 The save state IDs MUST be unique in entire event stream.
2534 The second argument to savestate (if present) is rerecord count at time
2535 of saving that savestate (useful for calulating rerecord count of movie
2536 starting from savestate).
2537 No time restrictions
2540 \begin_layout Subsubsection
2544 \begin_layout Itemize
2548 \begin_layout Itemize
2550 \begin_inset Quotes eld
2554 \begin_inset Quotes erd
2558 \begin_inset Quotes eld
2562 \begin_inset Quotes erd
2568 \begin_layout Standard
2569 Controls various options.
2571 \begin_inset Quotes eld
2575 \begin_inset Quotes erd
2578 turns on absolute mode (default) where event timestamps are absolute.
2580 \begin_inset Quotes eld
2584 \begin_inset Quotes erd
2587 turns on relative mode where event timestamps are relative to last event
2589 The OPTION event itself is not affected by timing change.
2590 No time restrictions.
2591 Unknown arguments are errors.
2594 \begin_layout Subsubsection
2595 Keyboard keypress/keyrelease event:
2598 \begin_layout Itemize
2599 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2602 \begin_layout Itemize
2603 Argument #1: Fixed: "KEYEDGE"
2606 \begin_layout Itemize
2607 Argument #2: Key number.
2608 Valid values are 1-83, 85-95, 129-197 and 199-223
2611 \begin_layout Standard
2612 Send key press or key release.
2613 Keys work in toggle button manner.
2614 The event time must be multiple of 66 666, and must not be less than 60
2615 * 66 666 TUs after last PAUSE event, 20 * 66 666 TUs after last KEYEDGE
2616 on key >128 and 10 * 66 666 TUs after last KEYEDGE on key <128.
2619 \begin_layout Subsubsection
2623 \begin_layout Itemize
2624 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2627 \begin_layout Itemize
2628 Argument #1: Fixed: "PAUSE"
2631 \begin_layout Standard
2632 Send pause key event.
2633 The time restrictions are identical to KEYEDGE event.
2636 \begin_layout Subsubsection
2640 \begin_layout Itemize
2641 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2644 \begin_layout Itemize
2645 Argument #1: Fixed: "MOUSEBUTTON"
2648 \begin_layout Itemize
2649 Argument #2: Number of button to release or press (0-4)
2652 \begin_layout Standard
2653 Presses or releases the designated mouse button.
2656 \begin_layout Subsubsection
2657 X mouse motion event:
2660 \begin_layout Itemize
2661 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2664 \begin_layout Itemize
2665 Argument #1: Fixed: "XMOUSEMOTION"
2668 \begin_layout Itemize
2669 Argument #2: Number of units to move (-255 - 255)
2672 \begin_layout Standard
2673 Move the mouse in X direction by specified amount.
2677 \begin_layout Subsubsection
2678 Y mouse motion event:
2681 \begin_layout Itemize
2682 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2685 \begin_layout Itemize
2686 Argument #1: Fixed: "YMOUSEMOTION"
2689 \begin_layout Itemize
2690 Argument #2: Number of units to move (-255 - 255)
2693 \begin_layout Standard
2694 Move the mouse in Y direction by specified amount.
2698 \begin_layout Subsubsection
2699 Z mouse motion event:
2702 \begin_layout Itemize
2703 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2706 \begin_layout Itemize
2707 Argument #1: Fixed: "ZMOUSEMOTION"
2710 \begin_layout Itemize
2711 Argument #2: Number of units to move (-7 - 7)
2714 \begin_layout Standard
2715 Move the mouse in Z direction (scrollwheel) by specified amount.
2718 \begin_layout Subsubsection
2719 Joystick button event:
2722 \begin_layout Itemize
2723 Dispatch to: org.jpc.modules.Joystick
2726 \begin_layout Itemize
2728 \begin_inset Quotes eld
2732 \begin_inset Quotes erd
2736 \begin_inset Quotes eld
2740 \begin_inset Quotes erd
2744 \begin_inset Quotes eld
2748 \begin_inset Quotes erd
2752 \begin_inset Quotes eld
2756 \begin_inset Quotes erd
2762 \begin_layout Itemize
2764 \begin_inset Quotes eld
2768 \begin_inset Quotes erd
2772 \begin_inset Quotes eld
2776 \begin_inset Quotes erd
2782 \begin_layout Standard
2783 Send button down/up event.
2784 No time restrictions.
2787 \begin_layout Subsubsection
2788 Joystick axis event:
2791 \begin_layout Itemize
2792 Dispatch to: org.jpc.modules.Joystick
2795 \begin_layout Itemize
2797 \begin_inset Quotes eld
2801 \begin_inset Quotes erd
2805 \begin_inset Quotes eld
2809 \begin_inset Quotes erd
2813 \begin_inset Quotes eld
2817 \begin_inset Quotes erd
2821 \begin_inset Quotes eld
2825 \begin_inset Quotes erd
2831 \begin_layout Itemize
2832 Argument #2: Multivibrator unstable state length in ns.
2835 \begin_layout Standard
2836 Set amount of time multivibrator remains in unstable state.
2837 No time restrictions.
2840 \begin_layout Subsubsection
2844 \begin_layout Itemize
2845 Dispatch to: org.jpc.emulator.PC$ResetButton
2848 \begin_layout Itemize
2852 \begin_layout Standard
2856 \begin_layout Subsubsection
2860 \begin_layout Itemize
2861 Dispatch to: org.jpc.emulator.PC$DiskChanger
2864 \begin_layout Itemize
2865 Argument #1: Fixed: "FDA"
2868 \begin_layout Itemize
2869 Argument #2: Number of image slot to put there.
2873 \begin_layout Standard
2874 The disk number MUST be -1 or valid disk number.
2875 -1 MUST NOT be used if there is no disk in floppy drive A.
2876 This event causes specified disk to be placed to FDA or FDA disk to be
2877 ejected with no replacement if disk number is -1.
2878 The specified disk if not -1 must be of floppy type.
2879 The specified disk if valid must not be in any other drive.
2882 \begin_layout Subsubsection
2886 \begin_layout Itemize
2887 Dispatch to: org.jpc.emulator.PC$DiskChanger
2890 \begin_layout Itemize
2891 Argument #1: Fixed: "FDB"
2894 \begin_layout Itemize
2895 Argument #2: Number of image slot to put there.
2899 \begin_layout Standard
2900 The disk number MUST be -1 or valid disk number.
2901 -1 MUST NOT be used if there is no disk in floppy drive B.
2902 This event causes specified disk to be placed to FDB or FDB disk to be
2903 ejected with no replacement if disk number is -1.
2904 The specified disk if not -1 must be of floppy type.
2905 The specified disk if valid must not be in any other drive.
2908 \begin_layout Subsubsection
2912 \begin_layout Itemize
2913 Dispatch to: org.jpc.emulator.PC$DiskChanger
2916 \begin_layout Itemize
2917 Argument #1: Fixed: "CDROM"
2920 \begin_layout Itemize
2921 Argument #2: Number of image slot to put there.
2925 \begin_layout Standard
2926 The disk number MUST be -1 or valid disk number.
2927 -1 MUST NOT be used if there is no disk in CD-ROM.
2928 This event causes specified disk to be placed to CD-ROM or CD-ROM disk
2929 to be ejected with no replacement if disk number is -1.
2930 The specified disk if not -1 must be of CD-ROM type.
2933 \begin_layout Standard
2934 This event has no effect if CD-ROM is locked.
2937 \begin_layout Subsubsection
2938 Write protect floppy:
2941 \begin_layout Itemize
2942 Dispatch to: org.jpc.emulator.PC$DiskChanger
2945 \begin_layout Itemize
2946 Argument #1: Fixed: "WRITEPROTECT"
2949 \begin_layout Itemize
2950 Argument #2: Number of image slot to manipulate
2953 \begin_layout Standard
2954 Write protects specified disk.
2955 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2958 \begin_layout Subsubsection
2959 Write unprotect floppy:
2962 \begin_layout Itemize
2963 Dispatch to: org.jpc.emulator.PC$DiskChanger
2966 \begin_layout Itemize
2967 Argument #1: Fixed: "WRITEUNPROTECT"
2970 \begin_layout Itemize
2971 Argument #2: Number of image slot to manipulate
2974 \begin_layout Standard
2975 Disables write protection specified disk.
2976 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2979 \begin_layout Subsection
2983 \begin_layout Standard
2984 Diskinfo sections are named
2985 \begin_inset Quotes eld
2989 \begin_inset Quotes erd
2993 They use line component encoding, fieldtype being first component on each
2994 line (value being the second).
2995 Following fields are defined:
2998 \begin_layout Subsubsection
3002 \begin_layout Standard
3003 Gives type of image.
3007 \begin_layout Itemize
3008 \begin_inset Quotes eld
3012 \begin_inset Quotes erd
3018 \begin_layout Itemize
3019 \begin_inset Quotes eld
3023 \begin_inset Quotes erd
3029 \begin_layout Itemize
3030 \begin_inset Quotes eld
3034 \begin_inset Quotes erd
3040 \begin_layout Itemize
3041 \begin_inset Quotes eld
3045 \begin_inset Quotes erd
3048 (BIOS/VGABIOS image)
3051 \begin_layout Itemize
3052 \begin_inset Quotes eld
3056 \begin_inset Quotes erd
3059 (what the heck is this???)
3062 \begin_layout Subsubsection
3066 \begin_layout Standard
3070 \begin_layout Subsubsection
3074 \begin_layout Standard
3075 (BIOS images only) Gives length of BIOS image
3078 \begin_layout Subsubsection
3082 \begin_layout Standard
3083 MD5 of raw disk/BIOS image without any headers or trailers.
3086 \begin_layout Subsubsection
3090 \begin_layout Standard
3091 (FLOPPY/HDD/CDROM images only) Number of total sectors on disk.
3094 \begin_layout Subsubsection
3098 \begin_layout Standard
3099 (FLOPPY/HDD images only) Number of tracks on disk per side (1-256 for floppy,
3103 \begin_layout Subsubsection
3107 \begin_layout Standard
3108 (FLOPPY/HDD images only) Number of sides on disk (1 or 2 for floppy, 1-16
3112 \begin_layout Subsubsection
3116 \begin_layout Standard
3117 (FLOPPY/HDD images only) Number of sectors per track (1-255 for floppy,
3121 \begin_layout Subsubsection
3125 \begin_layout Standard
3126 Line from image comment block.
3127 Usually give data about files image has.
3128 May or may not be present (multiple times)
3131 \begin_layout Subsection
3135 \begin_layout Standard
3136 Output info is stored in section
3137 \begin_inset Quotes eld
3141 \begin_inset Quotes erd
3145 Its relatively new, so it might not be present (then the contents have
3146 to be guessed based on modules present).
3147 Each line gives information about one output, first field being the type
3151 \begin_layout Subsubsection
3155 \begin_layout Standard
3156 For video output, there are no parameters so line is just
3157 \begin_inset Quotes eld
3161 \begin_inset Quotes erd
3167 \begin_layout Subsubsection
3171 \begin_layout Standard
3172 For audio output, the only parameter is name of output, so first component
3174 \begin_inset Quotes eld
3178 \begin_inset Quotes erd
3181 and second component is name of audio output.
3184 \begin_layout Subsection
3188 \begin_layout Standard
3189 Actual savestate format is not documented here.
3190 It is close to impossible to comprehend without access to emulator source
3194 \begin_layout Section
3195 Advanced: Making class dumpable
3198 \begin_layout Standard
3199 Class is made dumpable by implementing interface org.jpc.emulator.SRDumpable
3200 and implementing method dumpSRPartial(org.jpc.emulator.SRDumper) and constructor
3201 <init>(org.jpc.emulator.SRLoader).
3202 Non-static inner classes can not be dumpable (make them static using tricks
3203 similar to what javac uses).
3206 \begin_layout Standard
3207 If dumped class has dumpable superclass, the first thing dumping function
3208 needs to do is to call dumper function of superclass and first thing loading
3209 constructor needs to do is to call loading constructor of superclass.
3210 If class has no dumpable superclass, dumper doesn't need to do anything
3211 special, while loader needs to call objectCreated(this) on SRLoader object
3212 passed as parameter.
3216 \begin_layout Standard
3217 Following these fixed parts, dump all members that are part of mutable state
3221 \begin_layout Subsection
3222 Member dumping/loading functions
3225 \begin_layout Standard
3226 There is dumping/loading function for following (all functions dumping/loading
3227 reference types can handle null):
3230 \begin_layout Itemize
3231 boolean: SRDumper.dumpBoolean, SRLoader.loadBoolean
3234 \begin_layout Itemize
3235 byte: SRDumper.dumpByte, SRLoader.loadByte
3238 \begin_layout Itemize
3239 short: SRDumper.dumpShort, SRLoader.loadShort
3242 \begin_layout Itemize
3243 int: SRDumper.dumpInt, SRLoader.loadInt
3246 \begin_layout Itemize
3247 long: SRDumper.dumpLong, SRLoader.loadLong
3250 \begin_layout Itemize
3251 String: SRDumper.dumpString, SRLoader.loadString
3254 \begin_layout Itemize
3255 boolean[]: SRDumper.dumpArray, SRLoader.loadArrayBoolean
3258 \begin_layout Itemize
3259 byte[]: SRDumper.dumpArray, SRLoader.loadArrayByte
3262 \begin_layout Itemize
3263 short[]: SRDumper.dumpArray, SRLoader.loadArrayShort
3266 \begin_layout Itemize
3267 int[]: SRDumper.dumpArray, SRLoader.loadArrayInt
3270 \begin_layout Itemize
3271 long[]: SRDumper.dumpArray, SRLoader.loadArrayLong
3274 \begin_layout Itemize
3275 double[]: SRDumper.dumpArray, SRLoader.loadArrayDouble
3278 \begin_layout Itemize
3279 <dumpable type>: SRDumper.dumpObject, SRLoader.loadObject
3282 \begin_layout Itemize
3283 special object: SRDumper.specialObject, SRLoader.specialObject
3286 \begin_layout Subsubsection
3290 \begin_layout Itemize
3291 Dumpable objects come out as type of org.jpc.emulator.SRDumpable.
3294 \begin_layout Itemize
3295 Special objects are various static objects that don't need to be stored
3296 because they don't have mutable fields.
3299 \begin_layout Itemize
3300 Don't dump fields related to event state feedback.
3303 \begin_layout Itemize
3304 Don't dump temporary flags that are only used while PC is running.
3305 Savestate when PC is running isn't possible anyway.
3308 \begin_layout Itemize
3309 Some connectors dump fields related to connector output, some don't.
3312 \begin_layout Section
3313 Advanced: Writing event targets
3316 \begin_layout Standard
3317 Whereas output connectors are the way output is dispatched, input is dispatched
3319 Event targets need to implement interface org.jpc.emulator.EventDispatchTarget.
3322 \begin_layout Standard
3323 Event targets also provode methods which then encode events and dispatch
3324 them forward (without doing anything else) to event recorder.
3325 Also, event targets may have methods for obtaining state.
3328 \begin_layout Subsection
3329 Interface org.jpc.emulator.EventDispatchTarget
3332 \begin_layout Standard
3333 Interface that marks class capable of receiving events.
3336 \begin_layout Subsubsection
3337 Method setEventRecorder(EventRecorder)
3340 \begin_layout Standard
3341 Set the event recorder input events are sent to.
3344 \begin_layout Subsubsection
3345 Method startEventCheck()
3348 \begin_layout Standard
3349 Signals target to reset all state related to event checking and state feedback.
3350 This may be called at any time in order to reinitialialize event checking/feedb
3354 \begin_layout Subsubsection
3355 Method doEvent(long, String[], int) throws IOException
3358 \begin_layout Standard
3359 Event dispatch handler.
3360 The first argument is event time, second is parameters and third is what
3362 If target doesn't like the event, throw IOException.
3363 Following types (the integer parameter) are used:
3366 \begin_layout LyX-Code
3367 0 (EventRecorder.EVENT_TIMED): Time has been assigned for event.
3370 \begin_layout LyX-Code
3371 1 (EventRecorder.EVENT_STATE_EFFECT_FUTURE): Future event in event replay
3372 for reinitialization
3375 \begin_layout LyX-Code
3376 2 (EventRecorder.EVENT_STATE_EFFECT): Past event in event replay reinitialization
3379 \begin_layout LyX-Code
3380 3 (EventRecorder.EVENT_EXECUTE): This event occurs now.
3384 \begin_layout Subsubsection
3385 Method endEventCheock()
3388 \begin_layout Standard
3389 End event reinitialization.
3393 \begin_layout Subsubsection
3394 Method getEventTimeLowBound(long, String[]) throws IOException
3397 \begin_layout Standard
3398 Return the time value that's the earliest possiblity for this event to occur.
3399 Returning any time in past (including -1) causes event to fire as soon
3401 The long parameter gives the current scheduled time for event.
3404 \begin_layout Section
3408 \begin_layout Standard
3409 Modules are various extensions that run inside emulator core.
3410 As such, they affect sync.
3411 Modules must implement interface org.jpc.emulator.HardwareComponent (they
3412 are hardware components) and must be dumpable.
3413 Additionally, they need either constructor <init>() or <init>(String).
3414 The first is if no parameters are passed, the second is for case where
3415 parameters are passed.
3418 \begin_layout Standard
3419 Aside of the constructors, modules need to obey the ordinary conventions
3420 for hardware components.
3421 No code outside modules needs to know that module exists.
3424 \begin_layout Section
3428 \begin_layout Standard
3429 Plugins handle various UI tasks.
3430 They need to implement interface org.jpc.Plugin.
3433 \begin_layout Subsection
3434 Interface org.jpc.pluginsbase.Plugin
3437 \begin_layout Subsubsection
3438 Method systemShutdown()
3441 \begin_layout Standard
3442 Called when emulator shuts down.
3443 Either called in dedicated thread or in thread that called emulatorShutdown().
3444 These handlers should do the bare minimum to get files on disk to consistent
3446 After these calls from all plugins have finished, emulator exits.
3447 Do not try to manipulate UI from these methods, as doing that easily leads
3451 \begin_layout Subsubsection
3452 Method reconnect(PC)
3455 \begin_layout Standard
3456 Gives new PC to connect to.
3457 Null is passed if plugin should disconnect.
3460 \begin_layout Subsubsection
3464 \begin_layout Standard
3465 Called in dedicated thread after plugin is initialized.
3468 \begin_layout Subsubsection
3472 \begin_layout Standard
3473 Called after PC has stopped.
3476 \begin_layout Subsubsection
3480 \begin_layout Standard
3481 Called before PC starts.
3484 \begin_layout Subsubsection
3485 Method notifyArguments(String[])
3488 \begin_layout Standard
3489 Pass arguments from command line.
3492 \begin_layout Subsubsection
3493 Constructor <init>(Plugins)
3496 \begin_layout Standard
3497 This constructor is used to initialize plugins that don't take parameters.
3500 \begin_layout Subsubsection
3501 Constructor <init>(Plugins, String)
3504 \begin_layout Standard
3505 This constructor is used to initialize plugins that take parameters.
3508 \begin_layout Subsection
3509 Class org.jpc.pluginsbase.Plugins
3512 \begin_layout Standard
3513 This class provodes various methods for manipulating plugins.
3516 \begin_layout Subsubsection
3517 Method isShuttingDown()
3520 \begin_layout Standard
3521 Returns true if Plugins.shutdownEmulator() has been called somehow, either
3522 via VM exit, CTRL+C or explicitly.
3523 Useful to skip cleanups involving GUI, as these are too deadlock-prone.
3526 \begin_layout Subsubsection
3527 Method shutdownEmulator()
3530 \begin_layout Standard
3531 Shut down and exit the emulator.
3532 All plugin shutdown functions are called in this thread.
3535 \begin_layout Subsubsection
3536 Method reconnectPC(PC)
3539 \begin_layout Standard
3540 Signal reconnectPC event to all plugins.
3543 \begin_layout Subsubsection
3547 \begin_layout Standard
3548 Signal pcStarting() event to all plugins.
3551 \begin_layout Subsubsection
3555 \begin_layout Standard
3556 Signal pcStopping() event to all plugins.
3559 \begin_layout Section
3560 Inter-plugin communication
3563 \begin_layout Subsection
3564 Receiving communications
3567 \begin_layout Standard
3568 To receive invocation/call by name 'foo-bar', declare public method named
3570 Arguments to this method can currently be String, Integer (int) or Long
3572 Last argument may be array over these types to get variable number of arguments.
3573 On call, each argument gets value from call.
3574 If last argument is array, it gets all overflowing arguments.
3575 If return type is void or method returns boolean false, call is assumed
3577 If return value is boolean true, it is assumed that there is more processing.
3580 \begin_layout Subsection
3581 void org.jpc.pluginsbase.Plugins.invokeExternalCommand(String cmd, Object[]
3585 \begin_layout Standard
3586 Invoke command asynchronously, broadcasting to all plugins.
3587 Does not wait for slow commands to complete.
3588 cmd is the name to send and args are the arguments to pass.
3591 \begin_layout Subsection
3592 void org.jpc.pluginsbase.Plugins.invokeExternalCommandSynchronous(String cmd,
3596 \begin_layout Standard
3597 Same as invokeExternalCommand, but waits for slow commands to complete.
3600 \begin_layout Subsection
3601 Object[] org.jpc.pluginsbase.Plugins.invokeExternalCommandReturn(String cmd,
3605 \begin_layout Standard
3606 Similar to invokeExternalCommandSynchornous, but:
3609 \begin_layout Itemize
3610 Quits calling more plugins when it gets successful reply.
3613 \begin_layout Itemize
3617 \begin_layout Subsection
3618 void org.jpc.pluginsbase.Plugins.returnValue(Object...
3622 \begin_layout Standard
3623 Gives return value to return from call and signals that command has completed.
3626 \begin_layout Subsection
3627 void org.jpc.pluginsbase.Plugins.signalCommandCompletion()
3630 \begin_layout Standard
3631 Signals that command has completed.
3632 Only needed if there is no return value and eci_ method returned false
3636 \begin_layout Section
3637 Lua kernel programming
3640 \begin_layout Standard
3641 At startup, kernel gets its arguments in 'args' table and the script name
3642 to run in 'scriptname' string.
3643 It should enter the named script in protected mode.
3646 \begin_layout Standard
3647 The Lua VM exports numerious callbacks to kernel.
3648 The kernel can then choose to omit, wrap or re-export these to Lua scripts.
3651 \begin_layout Itemize
3652 Always grab any functions used into local variables so nobody can mess with
3656 \begin_layout Itemize
3657 Don't use global variables in kernel (except for those passed).