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.GMIDIInterface
1159 \begin_layout Itemize
1160 Arguments: Optional resources specification
1163 \begin_layout Itemize
1164 Resources (defaults): I/O port 0x330-0x331, IRQ 9
1167 \begin_layout Standard
1168 Emulates General MIDI interface.
1171 \begin_layout Subsection
1172 org.jpc.modules.FMCard
1175 \begin_layout Itemize
1176 Arguments: Optional resources specification
1179 \begin_layout Itemize
1180 Resources (defaults): I/O port 0x338-0x33B
1183 \begin_layout Standard
1187 \begin_layout Subsection
1188 org.jpc.modules.BasicFPU:
1191 \begin_layout Itemize
1195 \begin_layout Itemize
1199 \begin_layout Standard
1200 Crude FPU (x87) emulator.
1203 \begin_layout Section
1207 \begin_layout Standard
1208 Hacks are saved to savestates but not movies.
1211 \begin_layout Subsection
1215 \begin_layout Standard
1216 Force bit 1 of physical address 0x0410 to zero, signaling that the system
1218 BIOS assumes system has FPU but some games use that bit to detect FPU,
1219 trying to use it if it is
1220 \begin_inset Quotes eld
1224 \begin_inset Quotes erd
1228 Try this if game startup hangs with lots of trying to use FPU but not present
1230 Don't use if there is FPU present.
1231 Needed to get games like Blake Stone / Wolfenstein 3-D to work (FPU emulator
1232 allows it to start but causes graphical glitches).
1235 \begin_layout Subsection
1239 \begin_layout Standard
1240 Update basic VGA parameters before vretrace, not after it.
1242 Commander Keen 4) don't like if this isn't done and some games (e.g.
1243 Mario & Luigi) don't like if it is done.
1244 Wrong value manifests as jerky scrolling (scrolling back and forth and
1245 fixed statusbars move).
1248 \begin_layout Section
1249 Some error messages and explanations
1252 \begin_layout Itemize
1253 <filename> is Not a valid image file
1256 \begin_layout Itemize
1257 <filename> is not image file
1260 \begin_layout Itemize
1261 <filename> claims to be floppy with illegal geometry: <x> tracks, <y> sides
1265 \begin_layout Itemize
1266 <filename> claims to be HDD with illegal geometry: <x> tracks, <y> sides
1270 \begin_layout Itemize
1271 Can't read disk image sector map.
1274 \begin_layout Itemize
1275 Can't read disk image extent.
1278 \begin_layout Standard
1279 Code expects <filename> to be valid JPC-RR format image, but it isn't JPC-RR
1280 image at all or its corrupt.
1283 \begin_layout Itemize
1284 <filename> is image of unknown type.
1287 \begin_layout Itemize
1288 <filename> has unrecognized geometry <x> <y> <z>
1291 \begin_layout Standard
1292 Possibly corrupt image, not JPC-RR image, or JPC-RR image from future version
1293 containing something current version can't comprehend.
1296 \begin_layout Itemize
1297 Invalid format specifier <something>.
1300 \begin_layout Itemize
1301 Invalid syntax of --floppy= or --HDD= option.
1304 \begin_layout Itemize
1305 Invalid format specifier/option <something>.
1308 \begin_layout Standard
1309 Invalid option or format specifier was given.
1313 \begin_layout Itemize
1314 java ImageMaker [<options>...] <format> <destination> <source> <diskname>
1317 \begin_layout Standard
1318 Check syntax of command.
1319 Especially that diskname is present!
1322 \begin_layout Itemize
1323 The image has <nnn> sectors while it should have <yyy> according to selected
1327 \begin_layout Itemize
1328 Raw image file length not divisible by 512.
1331 \begin_layout Itemize
1332 Trying to read sector out of range.
1335 \begin_layout Standard
1336 The selected geometry is wrong or raw image is incomplete.
1339 \begin_layout Itemize
1340 Invalid disk name (Should not happen!).
1343 \begin_layout Itemize
1344 Invalid geometry to be written.
1347 \begin_layout Standard
1348 This is a very likely a bug in program.
1351 \begin_layout Itemize
1352 What the heck <filename> is? It's not regular file nor directory.
1355 \begin_layout Standard
1356 That sort of file can't be used as input for image making, or the file just
1360 \begin_layout Itemize
1361 BIOS images can only be made out of regular files.
1364 \begin_layout Itemize
1365 CD images can only be made out of regular files.
1368 \begin_layout Standard
1369 Source image specified is not regular file, but image of that type can't
1370 be made of anything else.
1373 \begin_layout Itemize
1374 Can't read raw bios image file.
1377 \begin_layout Itemize
1378 Can't read sector <nnn> from image.
1381 \begin_layout Standard
1382 Reading the raw image file failed for some reason.
1385 \begin_layout Itemize
1386 Bad library line: "<something>".
1390 \begin_layout Standard
1391 Syntax error in image library.
1394 \begin_layout Itemize
1395 Removing image <something> a.k.a.
1396 "<something>" as it no longer exists.
1399 \begin_layout Standard
1400 The image file no longer exists so it gets removed from library.
1403 \begin_layout Itemize
1404 Removing image <something> a.k.a.
1405 "<something>" due to <some> conflict.
1408 \begin_layout Standard
1409 Image library code killed some image from library due to some kind of conflict
1410 with image being added.
1413 \begin_layout Itemize
1414 Too much data to fit into given space.
1417 \begin_layout Standard
1418 The tree you gave contains takes just too much space to fit into disk of
1422 \begin_layout Section
1423 Advanced: Savestate/movie format
1426 \begin_layout Subsection
1427 Special character classes
1430 \begin_layout Subsubsection
1434 \begin_layout Standard
1435 Following Unicode codepoints (encoded as UTF-8) are interpretted as space
1439 \begin_layout Itemize
1440 Codepoints 0x20, and 0x09.
1443 \begin_layout Itemize
1444 Codepoints 0x1680, 0x180E, 0x2028, 0x205F and 0x3000
1447 \begin_layout Itemize
1448 Codepoints 0x2000-0x200A.
1451 \begin_layout Subsubsection
1455 \begin_layout Standard
1456 Following byte sequences are interpretted as linefeeds (line change):
1459 \begin_layout Itemize
1460 Byte 0x0A (UTF-8 encoded codepoint 0x0A)
1463 \begin_layout Itemize
1464 Byte 0x0D (UTF-8 encoded codepoint 0x0D)
1467 \begin_layout Itemize
1468 Byte 0x1C (UTF-8 encoded codepoint 0x1C)
1471 \begin_layout Itemize
1472 Byte 0x1D (UTF-8 encoded codepoint 0x1D)
1475 \begin_layout Itemize
1476 Byte 0x1E (UTF-8 encoded codepoint 0x1E)
1479 \begin_layout Itemize
1480 Bytes 0xC2 0x85 (UTF-8 for unicode control character NL, codepoint 0x85)
1483 \begin_layout Itemize
1484 Bytes 0xE2 0x80 0xA9 (UTF-8 encoded codepoint 0x2029)
1487 \begin_layout Subsection
1491 \begin_layout Standard
1492 JRSR archive format packs multiple text archive members to text archive.
1493 It does not support binary members.
1494 JRSR archives have first five or six bytes form the magic.
1496 \begin_inset Quotes eld
1500 \begin_inset Quotes erd
1503 followed by LINEFEED character There are four kinds of lines after that
1504 (lines are terminated by LINEFEED byte/bytes):
1507 \begin_layout Itemize
1511 \begin_layout Itemize
1515 \begin_layout Itemize
1519 \begin_layout Itemize
1523 \begin_layout Standard
1524 Sequencing rules are as follows: Start member is allowed anywhere (after
1526 Member line is allowed only inside member (member started but not ended).
1527 End member is only allowed inside member.
1528 End of file is only allowed outside member.
1529 Blank line is allowed anywhere after magic.
1532 \begin_layout Subsubsection
1536 \begin_layout Standard
1537 Start member line is given as
1538 \begin_inset Quotes eld
1542 \begin_inset Quotes erd
1545 <SPACE>+ <membername> <LINEFEED>.
1546 <SPACE>+ any number of SPACE characters at least one and <LINEFEED> is
1548 The member name is UTF-8 encoded and maximum allowed line length is 2048
1549 bytes (including LINEFEED, which means name is limited to 509-2040 codepoints
1550 depending on characters used).
1551 Starting member inside another implicitly ends the previous member.
1554 \begin_layout Subsubsection
1558 \begin_layout Standard
1559 Member line is given as
1560 \begin_inset Quotes eld
1564 \begin_inset Quotes erd
1567 <content><LINEFEED>.
1568 It gives another line for member contents.
1569 <content> is passed raw to layers above (followed by line termination)
1572 \begin_layout Subsubsection
1576 \begin_layout Standard
1577 End member line is given as
1578 \begin_inset Quotes eld
1582 \begin_inset Quotes erd
1586 It ends the current member.
1587 The following line can only be start member line or file may end.
1590 \begin_layout Subsubsection
1594 \begin_layout Standard
1595 Blank line is given as <LINEFEED>.
1596 Lines like that are ignored.
1599 \begin_layout Subsection
1600 Four-to-Five encoding
1603 \begin_layout Standard
1604 Binary members are encoded into text by so-called four-to-five encoding.
1605 This encoding can encode single byte to two, two bytes to three, three
1606 bytes to four and four bytes to five.
1607 Four-to-five encoding has five kinds of blocks.
1608 All SPACE and LINEFEED characters are completely ignored, even in middle
1612 \begin_layout Subsubsection
1616 \begin_layout Standard
1617 End stream block is encoded as '!'.
1618 It ends the stream instantly.
1619 There is also implicit end of stream at end of input to decoding.
1622 \begin_layout Subsubsection
1623 Other four block types
1626 \begin_layout Standard
1627 Other four block types take the value to be encoded, read it as big-endian
1629 Then they write it as base-93 big-endian value.
1630 Then length specific constants are added to digits of that number to yield
1631 ASCII values for characters (those are stored in order):
1634 \begin_layout Standard
1635 \begin_inset Tabular
1636 <lyxtabular version="3" rows="5" columns="6">
1638 <column alignment="center" valignment="top" width="0">
1639 <column alignment="center" valignment="top" width="0">
1640 <column alignment="center" valignment="top" width="0">
1641 <column alignment="center" valignment="top" width="0">
1642 <column alignment="center" valignment="top" width="0">
1643 <column alignment="center" valignment="top" width="0">
1645 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1648 \begin_layout Plain Layout
1654 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1657 \begin_layout Plain Layout
1663 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1666 \begin_layout Plain Layout
1672 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1675 \begin_layout Plain Layout
1681 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1684 \begin_layout Plain Layout
1690 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1693 \begin_layout Plain Layout
1701 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1704 \begin_layout Plain Layout
1710 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1713 \begin_layout Plain Layout
1719 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1722 \begin_layout Plain Layout
1728 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1731 \begin_layout Plain Layout
1737 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1740 \begin_layout Plain Layout
1746 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1749 \begin_layout Plain Layout
1757 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1760 \begin_layout Plain Layout
1766 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1769 \begin_layout Plain Layout
1775 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1778 \begin_layout Plain Layout
1784 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1787 \begin_layout Plain Layout
1793 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1796 \begin_layout Plain Layout
1802 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1805 \begin_layout Plain Layout
1813 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1816 \begin_layout Plain Layout
1822 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1825 \begin_layout Plain Layout
1831 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1834 \begin_layout Plain Layout
1840 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1843 \begin_layout Plain Layout
1849 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1852 \begin_layout Plain Layout
1858 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1861 \begin_layout Plain Layout
1869 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1872 \begin_layout Plain Layout
1878 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1881 \begin_layout Plain Layout
1887 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1890 \begin_layout Plain Layout
1896 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1899 \begin_layout Plain Layout
1905 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1908 \begin_layout Plain Layout
1914 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1917 \begin_layout Plain Layout
1931 \begin_layout Standard
1932 Blocks which encode values greater than what is possible for value of that
1933 length are fatal errors.
1937 \begin_layout Subsection
1938 Line component encoing
1941 \begin_layout Standard
1942 Line component encoding sits on top of UTF-8 encoding.
1943 Line component encoding encodes non-empty 1-D array of non-empty strings
1944 into line, and thus array of those into member.
1945 Empty lines or lines that don't contain any components are ignored.
1946 Line starts with depth value of 0 and must end with depth value of zero.
1949 \begin_layout Standard
1950 Components are seperated by component separators.
1951 Empty components are ignored.
1952 Following codepoints are separators on depth 0 if not escaped:
1955 \begin_layout Itemize
1957 The depth is read pre-increment.
1960 \begin_layout Itemize
1962 The depth is read post-decrement.
1965 \begin_layout Itemize
1969 \begin_layout Standard
1970 The following characters are special:
1973 \begin_layout Itemize
1975 Increments depth by 1 if not escaped (and appears in component).
1978 \begin_layout Itemize
1980 Decrements depth by 1 if not escaped (and appears in component).
1981 Depth going negative is an error.
1984 \begin_layout Itemize
1988 Next character is interpretted as literal.
1989 Error if at end of line.
1992 \begin_layout Standard
1993 Otherwise, characters are interpretted as literals and appear in components.
1994 Depth must be zero at end of line.
1997 \begin_layout Subsection
2001 \begin_layout Standard
2002 Header section is in archive member "header".
2003 It uses line component encoding.
2004 The first component of each line is name of header, and subsequent ones
2006 How many parameters are expected is dependent on what header it is:
2009 \begin_layout Subsubsection
2013 \begin_layout Itemize
2014 Header name: "PROJECTID"
2017 \begin_layout Itemize
2021 \begin_layout Itemize
2022 Argument #1: <project-id-string>
2025 \begin_layout Itemize
2029 \begin_layout Standard
2031 Project ID is generated when PC is assembled and is then preserved in save
2033 It is used for computing rerecord counts.
2034 Emulator treats it as opaque string, the IDs it generates are formed by
2035 48 random hexadecimal digits.
2038 \begin_layout Subsubsection
2042 \begin_layout Itemize
2043 Header name: "SAVESTATEID"
2046 \begin_layout Itemize
2050 \begin_layout Itemize
2051 Argument #1: <savestate-id-string>
2054 \begin_layout Itemize
2058 \begin_layout Standard
2059 Gives save state ID.
2060 Each save state has its own save state ID.
2061 Treated as opaque string, but generated as 48 random hexadecimal digits.
2062 The presence of this header signals whether there is save state to be loaded.
2063 If this header is present, save state load will be attempted.
2064 If absent, save state is not to be loaded even if present (and correct
2065 savestate load would be technically impossible anyway).
2068 \begin_layout Standard
2069 The value is used to prevent loading incompatible save states in preserve
2070 event stream mode and also to find the point in event stream where one
2074 \begin_layout Subsubsection
2078 \begin_layout Itemize
2079 Header name: "RERECORDS"
2082 \begin_layout Itemize
2086 \begin_layout Itemize
2087 Argument #1: <rerecords>
2090 \begin_layout Itemize
2094 \begin_layout Standard
2095 Gives rerecord count.
2096 PC assembly (except when loading save state) initializes current rerecord
2098 Must be non-negative and decimal number using ASCII digit characters.
2101 \begin_layout LyX-Code
2102 On loading save state:
2105 \begin_layout LyX-Code
2106 1) If project ID matches with previous:
2109 \begin_layout LyX-Code
2110 1a) If loaded rerecord count is larger or equal to current rerecord count:
2113 \begin_layout LyX-Code
2114 1a-a) Current rerecord count is loaded rerecord count + 1.
2117 \begin_layout LyX-Code
2121 \begin_layout LyX-Code
2122 1b-a) Current rerecord count increments by 1.
2125 \begin_layout LyX-Code
2129 \begin_layout LyX-Code
2130 2a) Current rerecord count is loaded rerecord count + 1.
2133 \begin_layout Standard
2134 The current rerecord count at time of save is saved to save state.
2137 \begin_layout Subsubsection
2141 \begin_layout Itemize
2142 Header name: "SYSTEM"
2145 \begin_layout Itemize
2149 \begin_layout Itemize
2150 Argument #1: <system-id-string>
2153 \begin_layout Itemize
2157 \begin_layout Standard
2158 Gives system this movie/save is for.
2159 The only currently recognized value is
2160 \begin_inset Quotes eld
2164 \begin_inset Quotes erd
2167 (if this header is absent, use default system).
2168 Invalid values trigger error on load time.
2171 \begin_layout Subsubsection
2175 \begin_layout Itemize
2176 Header name: "AUTHORS"
2179 \begin_layout Itemize
2180 Components: 2 or more
2183 \begin_layout Itemize
2184 Arguments: free form
2187 \begin_layout Itemize
2191 \begin_layout Standard
2192 Gives authors of run.
2193 Each argument gives one author (who has full name but no nickname).
2194 May be present multiple times.
2197 \begin_layout Subsubsection
2201 \begin_layout Itemize
2202 Header name: "AUTHORNICKS"
2205 \begin_layout Itemize
2206 Components: 2 or more
2209 \begin_layout Itemize
2210 Arguments: free form
2213 \begin_layout Itemize
2217 \begin_layout Standard
2218 Gives authors of run.
2219 Each argument gives one author (who has nickname but no full name).
2220 May be present multiple times.
2223 \begin_layout Subsubsection
2227 \begin_layout Itemize
2228 Header name: "AUTHORFULL"
2231 \begin_layout Itemize
2235 \begin_layout Itemize
2236 Arguments: free form
2239 \begin_layout Itemize
2243 \begin_layout Standard
2244 Gives author of run.
2245 First argument is full name of author, and second is nickname of author.
2246 May be present multiple times.
2249 \begin_layout Subsubsection
2253 \begin_layout Itemize
2254 Header name: "COMMENT"
2257 \begin_layout Itemize
2258 Components: 2 or more
2261 \begin_layout Itemize
2262 Arguments: free form
2265 \begin_layout Itemize
2269 \begin_layout Standard
2270 Various kinds of free form data.
2271 Not parsed further by emulator.
2274 \begin_layout Subsection
2275 Initialization segment:
2278 \begin_layout Standard
2279 If SAVESTATEID header isn't present (not a save state), member "initialization"
2280 gives PC initialization parameters for assembling the PC.
2281 It is present anyway even if SAVESTATEID is present (savestate).
2284 \begin_layout Standard
2285 Following parameters are used (space separates components):
2288 \begin_layout LyX-Code
2292 \begin_layout Standard
2293 Gives Image ID of main system BIOS (mandatory)
2296 \begin_layout LyX-Code
2300 \begin_layout Standard
2301 Gives Image ID of VGA BIOS (mandatory).
2304 \begin_layout LyX-Code
2308 \begin_layout Standard
2309 Gives Image ID of hda.
2310 Present only if system has hard disk hda.
2313 \begin_layout LyX-Code
2317 \begin_layout Standard
2318 Gives Image ID of hdb.
2319 Present only if system has hard disk hdb.
2322 \begin_layout LyX-Code
2326 \begin_layout Standard
2327 Gives Image ID of hdc.
2328 Present only if system has hard disk hdc.
2331 \begin_layout LyX-Code
2335 \begin_layout Standard
2336 Gives Image ID of hdd.
2337 Present only if system has hard disk hdd.
2340 \begin_layout LyX-Code
2344 \begin_layout Standard
2345 Gives Image ID of disk in slot <num>.
2346 Slot number must be non-negative.
2349 \begin_layout LyX-Code
2350 \begin_inset Quotes eld
2354 \begin_inset Quotes erd
2360 \begin_layout Standard
2361 kGives image name of disk in slot <num>.
2362 Slot number must be non-negative.
2363 The slot must be previously declared using
2364 \begin_inset Quotes eld
2368 \begin_inset Quotes erd
2374 \begin_layout LyX-Code
2378 \begin_layout Standard
2379 Gives Image slot to initially put into floppy drive fda.
2380 Disk must be of floppy type.
2381 If none present, no disk is initially put there.
2384 \begin_layout LyX-Code
2388 \begin_layout Standard
2389 Gives Image slot to initially put into floppy drive fdb.
2390 Disk must be of floppy type.
2391 If none present, no disk is initially put there.
2394 \begin_layout LyX-Code
2398 \begin_layout Standard
2399 Gives Image slot to initially put into CD-ROM drive hdc.
2400 Not allowed if hard disk hdc is present.
2401 Disk must be of CD-ROM type.
2402 If none present no disk is initially put there.
2405 \begin_layout LyX-Code
2406 "INITIALTIME" <time>
2409 \begin_layout Standard
2410 Number of milliseconds since Unix epoch to system start up time.
2414 \begin_layout Standard
2419 \begin_layout LyX-Code
2420 "CPUDIVIDER" <divider>
2423 \begin_layout Standard
2424 Set CPU frequency divider (dividing the 1GHz master clock).
2425 Allowed range is 1-256.
2429 \begin_layout LyX-Code
2430 "MEMORYSIZE" <pages>
2433 \begin_layout Standard
2434 Number of 4KiB pages of RAM memory.
2435 Allowed range 256-262144.
2439 \begin_layout LyX-Code
2443 \begin_layout Standard
2445 Valid devices are "FLOPPY" (boot from fda), "HDD" (boot from hda) and "CDROM"
2449 \begin_layout LyX-Code
2450 "LOADMODULEA" <module> <parameters>
2453 \begin_layout Standard
2454 Load module <module> with parameters <parameters>.
2457 \begin_layout LyX-Code
2458 "LOADMODULE" <module>
2461 \begin_layout Standard
2462 Load module <module> with no parameters
2465 \begin_layout LyX-Code
2466 \begin_inset Quotes eld
2470 \begin_inset Quotes erd
2476 \begin_layout Standard
2477 Use class <fpu> as FPU emulator.
2480 \begin_layout LyX-Code
2481 \begin_inset Quotes eld
2485 \begin_inset Quotes erd
2491 \begin_layout Standard
2492 Use I/O port delay emulation (each I/O port read/write takes 666ns).
2495 \begin_layout LyX-Code
2496 \begin_inset Quotes eld
2500 \begin_inset Quotes erd
2506 \begin_layout Standard
2507 Emulate VGA horizontal retrace.
2510 \begin_layout Subsection
2511 Event record format:
2514 \begin_layout Standard
2515 Event record is in archive member "events".
2516 It uses line component encoding.
2517 Each line gives an event.
2518 First component of each line gives time stamp.
2519 These timestamps MUST be in increasing order and all MUST be non-negative.
2520 Time stamp time unit is exactly 1 nanosecond of emulated time.
2523 \begin_layout Standard
2524 The second component of each line is name of class to dispatch to.
2525 Further components are passed as-is to event handlers.
2526 Classes with names consisting only of uppercase A-Z and 0-9 are special
2528 It is error to encounter unknown such special class.
2531 \begin_layout Subsubsection
2535 \begin_layout Itemize
2536 Dispatch to: SAVESTATE
2539 \begin_layout Itemize
2540 Argument #1: Savestate id
2543 \begin_layout Itemize
2544 Argument #2 (optional): Rerecord count at time of saving savestate
2547 \begin_layout Standard
2548 Signals that savestate has occured here.
2549 The save state IDs MUST be unique in entire event stream.
2550 The second argument to savestate (if present) is rerecord count at time
2551 of saving that savestate (useful for calulating rerecord count of movie
2552 starting from savestate).
2553 No time restrictions
2556 \begin_layout Subsubsection
2560 \begin_layout Itemize
2564 \begin_layout Itemize
2566 \begin_inset Quotes eld
2570 \begin_inset Quotes erd
2574 \begin_inset Quotes eld
2578 \begin_inset Quotes erd
2584 \begin_layout Standard
2585 Controls various options.
2587 \begin_inset Quotes eld
2591 \begin_inset Quotes erd
2594 turns on absolute mode (default) where event timestamps are absolute.
2596 \begin_inset Quotes eld
2600 \begin_inset Quotes erd
2603 turns on relative mode where event timestamps are relative to last event
2605 The OPTION event itself is not affected by timing change.
2606 No time restrictions.
2607 Unknown arguments are errors.
2610 \begin_layout Subsubsection
2611 Keyboard keypress/keyrelease event:
2614 \begin_layout Itemize
2615 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2618 \begin_layout Itemize
2619 Argument #1: Fixed: "KEYEDGE"
2622 \begin_layout Itemize
2623 Argument #2: Key number.
2624 Valid values are 1-83, 85-95, 129-197 and 199-223
2627 \begin_layout Standard
2628 Send key press or key release.
2629 Keys work in toggle button manner.
2630 The event time must be multiple of 66 666, and must not be less than 60
2631 * 66 666 TUs after last PAUSE event, 20 * 66 666 TUs after last KEYEDGE
2632 on key >128 and 10 * 66 666 TUs after last KEYEDGE on key <128.
2635 \begin_layout Subsubsection
2639 \begin_layout Itemize
2640 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2643 \begin_layout Itemize
2644 Argument #1: Fixed: "PAUSE"
2647 \begin_layout Standard
2648 Send pause key event.
2649 The time restrictions are identical to KEYEDGE event.
2652 \begin_layout Subsubsection
2656 \begin_layout Itemize
2657 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2660 \begin_layout Itemize
2661 Argument #1: Fixed: "MOUSEBUTTON"
2664 \begin_layout Itemize
2665 Argument #2: Number of button to release or press (0-4)
2668 \begin_layout Standard
2669 Presses or releases the designated mouse button.
2672 \begin_layout Subsubsection
2673 X mouse motion event:
2676 \begin_layout Itemize
2677 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2680 \begin_layout Itemize
2681 Argument #1: Fixed: "XMOUSEMOTION"
2684 \begin_layout Itemize
2685 Argument #2: Number of units to move (-255 - 255)
2688 \begin_layout Standard
2689 Move the mouse in X direction by specified amount.
2693 \begin_layout Subsubsection
2694 Y mouse motion event:
2697 \begin_layout Itemize
2698 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2701 \begin_layout Itemize
2702 Argument #1: Fixed: "YMOUSEMOTION"
2705 \begin_layout Itemize
2706 Argument #2: Number of units to move (-255 - 255)
2709 \begin_layout Standard
2710 Move the mouse in Y direction by specified amount.
2714 \begin_layout Subsubsection
2715 Z mouse motion event:
2718 \begin_layout Itemize
2719 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2722 \begin_layout Itemize
2723 Argument #1: Fixed: "ZMOUSEMOTION"
2726 \begin_layout Itemize
2727 Argument #2: Number of units to move (-7 - 7)
2730 \begin_layout Standard
2731 Move the mouse in Z direction (scrollwheel) by specified amount.
2734 \begin_layout Subsubsection
2735 Joystick button event:
2738 \begin_layout Itemize
2739 Dispatch to: org.jpc.modules.Joystick
2742 \begin_layout Itemize
2744 \begin_inset Quotes eld
2748 \begin_inset Quotes erd
2752 \begin_inset Quotes eld
2756 \begin_inset Quotes erd
2760 \begin_inset Quotes eld
2764 \begin_inset Quotes erd
2768 \begin_inset Quotes eld
2772 \begin_inset Quotes erd
2778 \begin_layout Itemize
2780 \begin_inset Quotes eld
2784 \begin_inset Quotes erd
2788 \begin_inset Quotes eld
2792 \begin_inset Quotes erd
2798 \begin_layout Standard
2799 Send button down/up event.
2800 No time restrictions.
2803 \begin_layout Subsubsection
2804 Joystick axis event:
2807 \begin_layout Itemize
2808 Dispatch to: org.jpc.modules.Joystick
2811 \begin_layout Itemize
2813 \begin_inset Quotes eld
2817 \begin_inset Quotes erd
2821 \begin_inset Quotes eld
2825 \begin_inset Quotes erd
2829 \begin_inset Quotes eld
2833 \begin_inset Quotes erd
2837 \begin_inset Quotes eld
2841 \begin_inset Quotes erd
2847 \begin_layout Itemize
2848 Argument #2: Multivibrator unstable state length in ns.
2851 \begin_layout Standard
2852 Set amount of time multivibrator remains in unstable state.
2853 No time restrictions.
2856 \begin_layout Subsubsection
2860 \begin_layout Itemize
2861 Dispatch to: org.jpc.emulator.PC$ResetButton
2864 \begin_layout Itemize
2868 \begin_layout Standard
2872 \begin_layout Subsubsection
2876 \begin_layout Itemize
2877 Dispatch to: org.jpc.emulator.PC$DiskChanger
2880 \begin_layout Itemize
2881 Argument #1: Fixed: "FDA"
2884 \begin_layout Itemize
2885 Argument #2: Number of image slot to put there.
2889 \begin_layout Standard
2890 The disk number MUST be -1 or valid disk number.
2891 -1 MUST NOT be used if there is no disk in floppy drive A.
2892 This event causes specified disk to be placed to FDA or FDA disk to be
2893 ejected with no replacement if disk number is -1.
2894 The specified disk if not -1 must be of floppy type.
2895 The specified disk if valid must not be in any other drive.
2898 \begin_layout Subsubsection
2902 \begin_layout Itemize
2903 Dispatch to: org.jpc.emulator.PC$DiskChanger
2906 \begin_layout Itemize
2907 Argument #1: Fixed: "FDB"
2910 \begin_layout Itemize
2911 Argument #2: Number of image slot to put there.
2915 \begin_layout Standard
2916 The disk number MUST be -1 or valid disk number.
2917 -1 MUST NOT be used if there is no disk in floppy drive B.
2918 This event causes specified disk to be placed to FDB or FDB disk to be
2919 ejected with no replacement if disk number is -1.
2920 The specified disk if not -1 must be of floppy type.
2921 The specified disk if valid must not be in any other drive.
2924 \begin_layout Subsubsection
2928 \begin_layout Itemize
2929 Dispatch to: org.jpc.emulator.PC$DiskChanger
2932 \begin_layout Itemize
2933 Argument #1: Fixed: "CDROM"
2936 \begin_layout Itemize
2937 Argument #2: Number of image slot to put there.
2941 \begin_layout Standard
2942 The disk number MUST be -1 or valid disk number.
2943 -1 MUST NOT be used if there is no disk in CD-ROM.
2944 This event causes specified disk to be placed to CD-ROM or CD-ROM disk
2945 to be ejected with no replacement if disk number is -1.
2946 The specified disk if not -1 must be of CD-ROM type.
2949 \begin_layout Standard
2950 This event has no effect if CD-ROM is locked.
2953 \begin_layout Subsubsection
2954 Write protect floppy:
2957 \begin_layout Itemize
2958 Dispatch to: org.jpc.emulator.PC$DiskChanger
2961 \begin_layout Itemize
2962 Argument #1: Fixed: "WRITEPROTECT"
2965 \begin_layout Itemize
2966 Argument #2: Number of image slot to manipulate
2969 \begin_layout Standard
2970 Write protects specified disk.
2971 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2974 \begin_layout Subsubsection
2975 Write unprotect floppy:
2978 \begin_layout Itemize
2979 Dispatch to: org.jpc.emulator.PC$DiskChanger
2982 \begin_layout Itemize
2983 Argument #1: Fixed: "WRITEUNPROTECT"
2986 \begin_layout Itemize
2987 Argument #2: Number of image slot to manipulate
2990 \begin_layout Standard
2991 Disables write protection specified disk.
2992 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2995 \begin_layout Subsection
2999 \begin_layout Standard
3000 Diskinfo sections are named
3001 \begin_inset Quotes eld
3005 \begin_inset Quotes erd
3009 They use line component encoding, fieldtype being first component on each
3010 line (value being the second).
3011 Following fields are defined:
3014 \begin_layout Subsubsection
3018 \begin_layout Standard
3019 Gives type of image.
3023 \begin_layout Itemize
3024 \begin_inset Quotes eld
3028 \begin_inset Quotes erd
3034 \begin_layout Itemize
3035 \begin_inset Quotes eld
3039 \begin_inset Quotes erd
3045 \begin_layout Itemize
3046 \begin_inset Quotes eld
3050 \begin_inset Quotes erd
3056 \begin_layout Itemize
3057 \begin_inset Quotes eld
3061 \begin_inset Quotes erd
3064 (BIOS/VGABIOS image)
3067 \begin_layout Itemize
3068 \begin_inset Quotes eld
3072 \begin_inset Quotes erd
3075 (what the heck is this???)
3078 \begin_layout Subsubsection
3082 \begin_layout Standard
3086 \begin_layout Subsubsection
3090 \begin_layout Standard
3091 (BIOS images only) Gives length of BIOS image
3094 \begin_layout Subsubsection
3098 \begin_layout Standard
3099 MD5 of raw disk/BIOS image without any headers or trailers.
3102 \begin_layout Subsubsection
3106 \begin_layout Standard
3107 (FLOPPY/HDD/CDROM images only) Number of total sectors on disk.
3110 \begin_layout Subsubsection
3114 \begin_layout Standard
3115 (FLOPPY/HDD images only) Number of tracks on disk per side (1-256 for floppy,
3119 \begin_layout Subsubsection
3123 \begin_layout Standard
3124 (FLOPPY/HDD images only) Number of sides on disk (1 or 2 for floppy, 1-16
3128 \begin_layout Subsubsection
3132 \begin_layout Standard
3133 (FLOPPY/HDD images only) Number of sectors per track (1-255 for floppy,
3137 \begin_layout Subsubsection
3141 \begin_layout Standard
3142 Line from image comment block.
3143 Usually give data about files image has.
3144 May or may not be present (multiple times)
3147 \begin_layout Subsection
3151 \begin_layout Standard
3152 Output info is stored in section
3153 \begin_inset Quotes eld
3157 \begin_inset Quotes erd
3161 Its relatively new, so it might not be present (then the contents have
3162 to be guessed based on modules present).
3163 Each line gives information about one output, first field being the type
3167 \begin_layout Subsubsection
3171 \begin_layout Standard
3172 For video output, there are no parameters so line is just
3173 \begin_inset Quotes eld
3177 \begin_inset Quotes erd
3183 \begin_layout Subsubsection
3187 \begin_layout Standard
3188 For audio output, the only parameter is name of output, so first component
3190 \begin_inset Quotes eld
3194 \begin_inset Quotes erd
3197 and second component is name of audio output.
3200 \begin_layout Subsection
3204 \begin_layout Standard
3205 Actual savestate format is not documented here.
3206 It is close to impossible to comprehend without access to emulator source
3210 \begin_layout Section
3211 Advanced: Making class dumpable
3214 \begin_layout Standard
3215 Class is made dumpable by implementing interface org.jpc.emulator.SRDumpable
3216 and implementing method dumpSRPartial(org.jpc.emulator.SRDumper) and constructor
3217 <init>(org.jpc.emulator.SRLoader).
3218 Non-static inner classes can not be dumpable (make them static using tricks
3219 similar to what javac uses).
3222 \begin_layout Standard
3223 If dumped class has dumpable superclass, the first thing dumping function
3224 needs to do is to call dumper function of superclass and first thing loading
3225 constructor needs to do is to call loading constructor of superclass.
3226 If class has no dumpable superclass, dumper doesn't need to do anything
3227 special, while loader needs to call objectCreated(this) on SRLoader object
3228 passed as parameter.
3232 \begin_layout Standard
3233 Following these fixed parts, dump all members that are part of mutable state
3237 \begin_layout Subsection
3238 Member dumping/loading functions
3241 \begin_layout Standard
3242 There is dumping/loading function for following (all functions dumping/loading
3243 reference types can handle null):
3246 \begin_layout Itemize
3247 boolean: SRDumper.dumpBoolean, SRLoader.loadBoolean
3250 \begin_layout Itemize
3251 byte: SRDumper.dumpByte, SRLoader.loadByte
3254 \begin_layout Itemize
3255 short: SRDumper.dumpShort, SRLoader.loadShort
3258 \begin_layout Itemize
3259 int: SRDumper.dumpInt, SRLoader.loadInt
3262 \begin_layout Itemize
3263 long: SRDumper.dumpLong, SRLoader.loadLong
3266 \begin_layout Itemize
3267 String: SRDumper.dumpString, SRLoader.loadString
3270 \begin_layout Itemize
3271 boolean[]: SRDumper.dumpArray, SRLoader.loadArrayBoolean
3274 \begin_layout Itemize
3275 byte[]: SRDumper.dumpArray, SRLoader.loadArrayByte
3278 \begin_layout Itemize
3279 short[]: SRDumper.dumpArray, SRLoader.loadArrayShort
3282 \begin_layout Itemize
3283 int[]: SRDumper.dumpArray, SRLoader.loadArrayInt
3286 \begin_layout Itemize
3287 long[]: SRDumper.dumpArray, SRLoader.loadArrayLong
3290 \begin_layout Itemize
3291 double[]: SRDumper.dumpArray, SRLoader.loadArrayDouble
3294 \begin_layout Itemize
3295 <dumpable type>: SRDumper.dumpObject, SRLoader.loadObject
3298 \begin_layout Itemize
3299 special object: SRDumper.specialObject, SRLoader.specialObject
3302 \begin_layout Subsubsection
3306 \begin_layout Itemize
3307 Dumpable objects come out as type of org.jpc.emulator.SRDumpable.
3310 \begin_layout Itemize
3311 Special objects are various static objects that don't need to be stored
3312 because they don't have mutable fields.
3315 \begin_layout Itemize
3316 Don't dump fields related to event state feedback.
3319 \begin_layout Itemize
3320 Don't dump temporary flags that are only used while PC is running.
3321 Savestate when PC is running isn't possible anyway.
3324 \begin_layout Itemize
3325 Some connectors dump fields related to connector output, some don't.
3328 \begin_layout Section
3329 Advanced: Writing event targets
3332 \begin_layout Standard
3333 Whereas output connectors are the way output is dispatched, input is dispatched
3335 Event targets need to implement interface org.jpc.emulator.EventDispatchTarget.
3338 \begin_layout Standard
3339 Event targets also provode methods which then encode events and dispatch
3340 them forward (without doing anything else) to event recorder.
3341 Also, event targets may have methods for obtaining state.
3344 \begin_layout Subsection
3345 Interface org.jpc.emulator.EventDispatchTarget
3348 \begin_layout Standard
3349 Interface that marks class capable of receiving events.
3352 \begin_layout Subsubsection
3353 Method setEventRecorder(EventRecorder)
3356 \begin_layout Standard
3357 Set the event recorder input events are sent to.
3360 \begin_layout Subsubsection
3361 Method startEventCheck()
3364 \begin_layout Standard
3365 Signals target to reset all state related to event checking and state feedback.
3366 This may be called at any time in order to reinitialialize event checking/feedb
3370 \begin_layout Subsubsection
3371 Method doEvent(long, String[], int) throws IOException
3374 \begin_layout Standard
3375 Event dispatch handler.
3376 The first argument is event time, second is parameters and third is what
3378 If target doesn't like the event, throw IOException.
3379 Following types (the integer parameter) are used:
3382 \begin_layout LyX-Code
3383 0 (EventRecorder.EVENT_TIMED): Time has been assigned for event.
3386 \begin_layout LyX-Code
3387 1 (EventRecorder.EVENT_STATE_EFFECT_FUTURE): Future event in event replay
3388 for reinitialization
3391 \begin_layout LyX-Code
3392 2 (EventRecorder.EVENT_STATE_EFFECT): Past event in event replay reinitialization
3395 \begin_layout LyX-Code
3396 3 (EventRecorder.EVENT_EXECUTE): This event occurs now.
3400 \begin_layout Subsubsection
3401 Method endEventCheock()
3404 \begin_layout Standard
3405 End event reinitialization.
3409 \begin_layout Subsubsection
3410 Method getEventTimeLowBound(long, String[]) throws IOException
3413 \begin_layout Standard
3414 Return the time value that's the earliest possiblity for this event to occur.
3415 Returning any time in past (including -1) causes event to fire as soon
3417 The long parameter gives the current scheduled time for event.
3420 \begin_layout Section
3424 \begin_layout Standard
3425 Modules are various extensions that run inside emulator core.
3426 As such, they affect sync.
3427 Modules must implement interface org.jpc.emulator.HardwareComponent (they
3428 are hardware components) and must be dumpable.
3429 Additionally, they need either constructor <init>() or <init>(String).
3430 The first is if no parameters are passed, the second is for case where
3431 parameters are passed.
3434 \begin_layout Standard
3435 Aside of the constructors, modules need to obey the ordinary conventions
3436 for hardware components.
3437 No code outside modules needs to know that module exists.
3440 \begin_layout Section
3444 \begin_layout Standard
3445 Plugins handle various UI tasks.
3446 They need to implement interface org.jpc.Plugin.
3449 \begin_layout Subsection
3450 Interface org.jpc.pluginsbase.Plugin
3453 \begin_layout Subsubsection
3454 Method systemShutdown()
3457 \begin_layout Standard
3458 Called when emulator shuts down.
3459 Either called in dedicated thread or in thread that called emulatorShutdown().
3460 These handlers should do the bare minimum to get files on disk to consistent
3462 After these calls from all plugins have finished, emulator exits.
3463 Do not try to manipulate UI from these methods, as doing that easily leads
3467 \begin_layout Subsubsection
3468 Method reconnect(PC)
3471 \begin_layout Standard
3472 Gives new PC to connect to.
3473 Null is passed if plugin should disconnect.
3476 \begin_layout Subsubsection
3480 \begin_layout Standard
3481 Called in dedicated thread after plugin is initialized.
3484 \begin_layout Subsubsection
3488 \begin_layout Standard
3489 Called after PC has stopped.
3492 \begin_layout Subsubsection
3496 \begin_layout Standard
3497 Called before PC starts.
3500 \begin_layout Subsubsection
3501 Method notifyArguments(String[])
3504 \begin_layout Standard
3505 Pass arguments from command line.
3508 \begin_layout Subsubsection
3509 Constructor <init>(Plugins)
3512 \begin_layout Standard
3513 This constructor is used to initialize plugins that don't take parameters.
3516 \begin_layout Subsubsection
3517 Constructor <init>(Plugins, String)
3520 \begin_layout Standard
3521 This constructor is used to initialize plugins that take parameters.
3524 \begin_layout Subsection
3525 Class org.jpc.pluginsbase.Plugins
3528 \begin_layout Standard
3529 This class provodes various methods for manipulating plugins.
3532 \begin_layout Subsubsection
3533 Method isShuttingDown()
3536 \begin_layout Standard
3537 Returns true if Plugins.shutdownEmulator() has been called somehow, either
3538 via VM exit, CTRL+C or explicitly.
3539 Useful to skip cleanups involving GUI, as these are too deadlock-prone.
3542 \begin_layout Subsubsection
3543 Method shutdownEmulator()
3546 \begin_layout Standard
3547 Shut down and exit the emulator.
3548 All plugin shutdown functions are called in this thread.
3551 \begin_layout Subsubsection
3552 Method reconnectPC(PC)
3555 \begin_layout Standard
3556 Signal reconnectPC event to all plugins.
3559 \begin_layout Subsubsection
3563 \begin_layout Standard
3564 Signal pcStarting() event to all plugins.
3567 \begin_layout Subsubsection
3571 \begin_layout Standard
3572 Signal pcStopping() event to all plugins.
3575 \begin_layout Section
3576 Inter-plugin communication
3579 \begin_layout Subsection
3580 Receiving communications
3583 \begin_layout Standard
3584 To receive invocation/call by name 'foo-bar', declare public method named
3586 Arguments to this method can currently be String, Integer (int) or Long
3588 Last argument may be array over these types to get variable number of arguments.
3589 On call, each argument gets value from call.
3590 If last argument is array, it gets all overflowing arguments.
3591 If return type is void or method returns boolean false, call is assumed
3593 If return value is boolean true, it is assumed that there is more processing.
3596 \begin_layout Subsection
3597 void org.jpc.pluginsbase.Plugins.invokeExternalCommand(String cmd, Object[]
3601 \begin_layout Standard
3602 Invoke command asynchronously, broadcasting to all plugins.
3603 Does not wait for slow commands to complete.
3604 cmd is the name to send and args are the arguments to pass.
3607 \begin_layout Subsection
3608 void org.jpc.pluginsbase.Plugins.invokeExternalCommandSynchronous(String cmd,
3612 \begin_layout Standard
3613 Same as invokeExternalCommand, but waits for slow commands to complete.
3616 \begin_layout Subsection
3617 Object[] org.jpc.pluginsbase.Plugins.invokeExternalCommandReturn(String cmd,
3621 \begin_layout Standard
3622 Similar to invokeExternalCommandSynchornous, but:
3625 \begin_layout Itemize
3626 Quits calling more plugins when it gets successful reply.
3629 \begin_layout Itemize
3633 \begin_layout Subsection
3634 void org.jpc.pluginsbase.Plugins.returnValue(Object...
3638 \begin_layout Standard
3639 Gives return value to return from call and signals that command has completed.
3642 \begin_layout Subsection
3643 void org.jpc.pluginsbase.Plugins.signalCommandCompletion()
3646 \begin_layout Standard
3647 Signals that command has completed.
3648 Only needed if there is no return value and eci_ method returned false
3652 \begin_layout Section
3653 Lua kernel programming
3656 \begin_layout Standard
3657 At startup, kernel gets its arguments in 'args' table and the script name
3658 to run in 'scriptname' string.
3659 It should enter the named script in protected mode.
3662 \begin_layout Standard
3663 The Lua VM exports numerious callbacks to kernel.
3664 The kernel can then choose to omit, wrap or re-export these to Lua scripts.
3667 \begin_layout Itemize
3668 Always grab any functions used into local variables so nobody can mess with
3672 \begin_layout Itemize
3673 Don't use global variables in kernel (except for those passed).