1 #LyX 1.6.5 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.bat that has fairly reasonable
125 \begin_layout LyX-Code
126 java JPCApplication -library library -autoexec assemble.bat
129 \begin_layout Standard
131 \begin_inset Quotes eld
135 \begin_inset Quotes erd
138 specifies that contents of directory 'library' are to be used as library.
139 The script pops up settings for new emulated PC (if you want to load savestate,
141 Select BIOS and VGABIOS for BIOS and VGABIOS image (they should be already
142 selected), DOSfloppy for fda (boot device should be set to fda) and game
143 image as some HD drive
146 \begin_layout Subsection
150 \begin_layout Itemize
151 Putting the game as hdd (the fourth hard disk slot) causes boot to be bit
155 \begin_layout Itemize
156 Some BIOS versions have
157 \begin_inset Quotes eld
160 press F12 to select boot device
161 \begin_inset Quotes erd
165 Hit <enter> from emulated keyboard and that prompt will go away in about
166 half emulated second (it stays several emulated seconds otherwise).
170 \begin_layout Itemize
171 If game doesn't need lots of memory, hitting F5 to skip intialization files
173 If it does need more memory, run config.sys commands but not autoexec.bat.
177 \begin_layout Itemize
178 Some DOS disks have DOSIDLE with them, don't use it as it messes badly with
182 \begin_layout Section
183 Making JPC-RR format images from raw images
186 \begin_layout Standard
187 Due to various factors, JPC-RR can't use raw image files directly but requires
188 its own image format.
192 \begin_layout Subsection
193 Importing images from GUI:
196 \begin_layout Standard
197 Use Drives -> Import Image to import existing directories or image files.
198 Dialog prompting parameters will be displayed.
199 When importing floppy images, check
200 \begin_inset Quotes eld
204 \begin_inset Quotes erd
207 if possible, that enables geometry autodetection, which is reasonable virtually
208 all of the time it is offered.
211 \begin_layout Subsection
215 \begin_layout Itemize
216 If making image from directory, the names of the files must conform to FAT
217 naming restrictions (8+3 character names, no spaces, etc).
218 Avoid filenames with non-ASCII characters.
222 \begin_layout Itemize
223 The DOS limit of 112 or 224 files for floppies does not apply to images
224 created from directory trees.
225 The minimum limit value used is 512.
226 If even that isn't enough, the limit is automatically increased to fit
227 all the needed directory entries.
230 \begin_layout Itemize
231 Making boot disks from tree does NOT work.
232 Even if you got system boot files there, it still won't work.
235 \begin_layout Itemize
236 Only floppy disks and hard drives can be made from directory trees.
237 BIOS images and CDROM images require image file.
240 \begin_layout Itemize
241 Avoid floppies with custom geometry (floppy geometry does affect disk ID).
242 Disks with over 63 sectors per track don't work with DOS.
243 Wheither disks with over 127 tracks per side work with DOS is unknown.
244 Also avoid 1024-tracks per side HDDs.
247 \begin_layout Itemize
248 The geometry limits are: 2-1024 tracks per side for HDD, 1-256 tracks per
250 1-63 sectors per track for HDD, 1-255 sectors per track for floppy.
251 1-16 sides for HDD, 1 or 2 sides for floppy.
252 This gives size limit of 65280KiB for floppy disks (but note the DOS limit!)
253 and 516096KiB for HDDs.
256 \begin_layout Itemize
257 There are multiple image file contents that represent the same image.
258 The one with smallest size is picked when creating image.
261 \begin_layout Itemize
262 Note: Although the IDs are 128 bits long, they are not MD5 hashes.
266 \begin_layout Subsection
267 Importing from command line
270 \begin_layout Standard
271 There is tool called ImageMaker that can make JPC-RR images from raw images.
272 Each image has format, ID an name.
273 Format and name are specified when making image.
274 ID is automatically calculated from format and contents.
275 Name does not affect the ID but is purely for convience so one doesn't
276 have to specify long image IDs manually.
279 \begin_layout Subsubsection
283 \begin_layout Standard
284 The syntax for ImageMaker when making images is:
287 \begin_layout LyX-Code
288 $ java ImageMaker <format> [<options>...] <destination> <source> <name>
291 \begin_layout Standard
292 <destination> is file name for JPC-RR format image to write.
293 <source> is either name of regular file (raw image file) or name of directory
294 tree with files (supported for making floppy or hard disk images only).
295 In case of directory tree, the files are layout deterministically to disk,
296 so the ID will always be the same for given geometry and type.
297 <name> is name to give to disk.
301 \begin_layout LyX-Code
302 --BIOS BIOS image (note: VGABIOS is also of this type).
305 \begin_layout LyX-Code
306 --CDROM CD-ROM image.
309 \begin_layout LyX-Code
310 --HDD=cylinders,sectors,heads Hard disk with specified geometry.
313 \begin_layout LyX-Code
314 --floppy=tracks,sectors,sides Floppy disk with specified geometry.
317 \begin_layout LyX-Code
318 --floppy160 160KiB floppy (40 tracks, 8 sectors, Single sided).
321 \begin_layout LyX-Code
322 --floppy180 180KiB floppy (40 tracks, 9 sectors, Single sided).
325 \begin_layout LyX-Code
326 --floppy320 320KiB floppy (40 tracks, 8 sectors, Double sided).
329 \begin_layout LyX-Code
330 --floppy360 360KiB floppy (40 tracks, 9 sectors, Double sided).
333 \begin_layout LyX-Code
334 --floppy410 410KiB floppy (41 tracks, 10 sectors, Double sided).
337 \begin_layout LyX-Code
338 --floppy420 420KiB floppy (42 tracks, 10 sectors, Double sided).
341 \begin_layout LyX-Code
342 --floppy720 720KiB floppy (80 tracks, 9 sectors, Double sided).
345 \begin_layout LyX-Code
346 --floppy800 800KiB floppy (80 tracks, 10 sectors, Double sided).
349 \begin_layout LyX-Code
350 --floppy820 820KiB floppy (82 tracks, 10 sectors, Double sided).
353 \begin_layout LyX-Code
354 --floppy830 830KiB floppy (83 tracks, 10 sectors, Double sided).
357 \begin_layout LyX-Code
358 --floppy880 880KiB floppy (80 tracks, 11 sectors, Double sided).
361 \begin_layout LyX-Code
362 --floppy1040 1040KiB floppy (80 tracks, 13 sectors, Double sided).
365 \begin_layout LyX-Code
366 --floppy1120 1120KiB floppy (80 tracks, 14 sectors, Double sided).
369 \begin_layout LyX-Code
370 --floppy1200 1200KiB floppy (80 tracks, 15 sectors, Double sided).
373 \begin_layout LyX-Code
374 --floppy1440 1440KiB floppy (80 tracks, 18 sectors, Double sided).
377 \begin_layout LyX-Code
378 --floppy1476 1476KiB floppy (82 tracks, 18 sectors, Double sided).
381 \begin_layout LyX-Code
382 --floppy1494 1494KiB floppy (83 tracks, 18 sectors, Double sided).
385 \begin_layout LyX-Code
386 --floppy1600 1600KiB floppy (80 tracks, 20 sectors, Double sided).
389 \begin_layout LyX-Code
390 --floppy1680 1680KiB floppy (80 tracks, 21 sectors, Double sided).
393 \begin_layout LyX-Code
394 --floppy1722 1722KiB floppy (82 tracks, 21 sectors, Double sided).
397 \begin_layout LyX-Code
398 --floppy1743 1743KiB floppy (83 tracks, 21 sectors, Double sided).
401 \begin_layout LyX-Code
402 --floppy1760 1760KiB floppy (80 tracks, 22 sectors, Double sided).
405 \begin_layout LyX-Code
406 --floppy1840 1840KiB floppy (80 tracks, 23 sectors, Double sided).
409 \begin_layout LyX-Code
410 --floppy1920 1920KiB floppy (80 tracks, 24 sectors, Double sided).
413 \begin_layout LyX-Code
414 --floppy2880 2880KiB floppy (80 tracks, 36 sectors, Double sided).
417 \begin_layout LyX-Code
418 --floppy3120 3120KiB floppy (80 tracks, 39 sectors, Double sided).
421 \begin_layout LyX-Code
422 --floppy3200 3200KiB floppy (80 tracks, 40 sectors, Double sided).
425 \begin_layout LyX-Code
426 --floppy3520 3520KiB floppy (80 tracks, 44 sectors, Double sided).
429 \begin_layout LyX-Code
430 --floppy3840 3840KiB floppy (80 tracks, 48 sectors, Double sided).
433 \begin_layout Subsubsection
437 \begin_layout LyX-Code
438 --volumelabel=label Give specified volume label (affects ID).
439 Only meaningful when making image out of directory tree.
440 Default is no volume label.
443 \begin_layout LyX-Code
444 --timestamp=YYYYMMDDHHMMSS Give specified timestamp for files (affects ID).
445 Only meaningful when making image out of directory tree.
446 The default timestamp is 19900101T000000Z.
449 \begin_layout Subsubsection
453 \begin_layout Standard
457 \begin_layout LyX-Code
458 $ java ImageMaker <imagefile>
461 \begin_layout Standard
462 Variety of information about image is displayed (especially for floppies/HDDs).
463 Two important fields are calculated and claimed disk ID.
464 They should be the same.
465 If they are not, then the image file is corrupt (sadly, imagemaker has
466 bugs and bugs that cause it to write corrupt images have been seen).
469 \begin_layout Subsection
470 Advanced: The disk ID algorithm
473 \begin_layout Standard
474 The disk ID is calculated as:
477 \begin_layout LyX-Code
478 Skein-256-128-deprecated(<typecode>|<geometry>|<image>)
481 \begin_layout Standard
482 Where Skein-256-128-deprecated is Skein hash function with 256-bit internal
483 state and 128-bit output using the deprecated rotation constants (as specified
484 in Skein hash function reference documentation versions 1.0 and 1.1).
485 The <image> is the whole image, including parts not stored in image file.
486 The reason for keeping using the deprecated constants are:
489 \begin_layout Itemize
490 Changing the constants would change the IDs, which would invalidate existing
494 \begin_layout Itemize
495 This is not about cryptographic security
498 \begin_layout Itemize
499 The new constants don't improve security that much anyway.
502 \begin_layout Subsubsection
506 \begin_layout Standard
507 Floppies have <typecode> value 0 (single byte) and HDDs have 1 (single byte).
508 <geometry> is as follows (this is exactly the same form as it appears in
512 \begin_layout LyX-Code
513 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
516 \begin_layout LyX-Code
517 Byte 0 bits 2-5: Head count - 1.
520 \begin_layout LyX-Code
521 Byte 0 bits 6-7: Reserved, must be 0.
524 \begin_layout LyX-Code
525 Byte 1: Bits 0-7 of track count per side - 1.
528 \begin_layout LyX-Code
529 Byte 2: Sector count per track - 1.
532 \begin_layout Subsubsection
533 CD-ROM and BIOS images
536 \begin_layout Standard
537 CD-ROMs have <typecode> value 2 (single byte) and BIOS images have 3 (single
542 \begin_layout Subsection
543 Advanced: Disk Image format
546 \begin_layout Standard
547 The disk image consists of following parts, concatenated in this order without
551 \begin_layout Itemize
555 \begin_layout Itemize
559 \begin_layout Itemize
563 \begin_layout Itemize
567 \begin_layout Itemize
571 \begin_layout Itemize
572 type-specific geometry/size data
575 \begin_layout Itemize
579 \begin_layout Itemize
583 \begin_layout Subsubsection
587 \begin_layout Standard
588 Magic in disk image files is following 5 bytes:
589 \begin_inset Quotes eld
593 \begin_inset Quotes erd
599 \begin_layout Subsubsection
603 \begin_layout Standard
604 Disk ID is given as 16 bytes, encoding the 128-bit disk ID.
607 \begin_layout Subsubsection
611 \begin_layout Standard
612 Type code is single byte.
613 0 for floppies, 1 for HDDs, 2 for CD-ROMs and 3 for BIOS images.
614 Other values are reserved.
617 \begin_layout Subsubsection
621 \begin_layout Standard
623 Disk name length is given as two-byte big-endian value.
624 New images should have 0 here.
627 \begin_layout Subsubsection
631 \begin_layout Standard
633 Name field is there for backward compatiblity.
634 Disk name length gives length of this field in bytes.
637 \begin_layout Subsubsection
638 Type-specific geometry/size data (floppies and HDDs)
641 \begin_layout Standard
642 Floppies and HDDs have 3-byte geometry data:
645 \begin_layout LyX-Code
646 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
649 \begin_layout LyX-Code
650 Byte 0 bits 2-5: Head count - 1.
653 \begin_layout LyX-Code
654 Byte 0 bits 6-7: Reserved, must be 0.
657 \begin_layout LyX-Code
658 Byte 1: Bits 0-7 of track count per side - 1.
661 \begin_layout LyX-Code
662 Byte 2: Sector count per track - 1.
665 \begin_layout Subsubsection
666 Type specific-geometry/size data (CD-ROMs)
669 \begin_layout Standard
670 CD-ROMs have 4-byte big-endian sector (512 bytes!) count.
673 \begin_layout Subsubsection
674 Type specific-geometry/size data (BIOS images)
677 \begin_layout Standard
678 BIOS images have 4-byte big-endian byte (not sector or block) count.
681 \begin_layout Subsubsection
682 Actual image data (floppy/HDD)
685 \begin_layout Standard
686 Floppy or HDD imagedata consists of following subparts:
689 \begin_layout Itemize
693 \begin_layout Itemize
697 \begin_layout Itemize
701 \begin_layout Itemize
705 \begin_layout Standard
706 Storage method is single byte.
707 Sectors present gives number of last nonzero sector + 1 (zero if image
711 \begin_layout Subsubsection
712 Floppy/HDD storage method 0: Raw storage
715 \begin_layout Standard
716 This storage method has empty header.
717 Image data is raw dump of first sectors present sectors.
720 \begin_layout Subsubsection
721 Floppy/HDD storage method 1: Sectormap
724 \begin_layout Standard
725 Image data header contains bitfield with just enough bytes to have one bit
727 The order of bits is such that number of bit corresponding to each sector
728 in byte is sector number modulo 8 and byte number is floor of sector number
729 divided by 8 when sector numbers are counted from zero.
730 If bit corresponding to sector is set, then the sector is present in image
731 data, otherwise it is absent and assumed to be all-zeroes.
734 \begin_layout Standard
735 Image data contains dumps of all present sectors in order of increasing
739 \begin_layout Subsubsection
740 Floppy/HDD storage method 2: Extent first sector zero
743 \begin_layout Standard
744 Image data is empty as storage-specific data is mangled with image data.
745 The image data alternates between blocks encoding zero sectors and blocks
746 encoding nonzero sectors.
747 The first block encodes zero sectors.
751 \begin_layout Standard
752 Block encoding zero sectors consist of single 1-4 byte little-endian value
753 encoding number of sectors in block - 1.
754 Number of bytes is determined by sectors present value.
755 It is 1 for 1-256 sectors, 2 for 257-65536, 3 for 65537-16777216 and 4
756 for more than 16777216.
757 All sectors in block are filled with zeroes and are not stored.
760 \begin_layout Standard
761 Block encoding nonzero sectors has same block count as zero sector block
762 but is followed by the sectors stored raw.
765 \begin_layout Subsubsection
766 Floppy/HDD storage method 3: Extent first sector nonzero
769 \begin_layout Standard
770 Same as storage method 2 but first block is nonzero sector block.
773 \begin_layout Subsubsection
774 Actual image data (CD-ROMs and BIOS images)
777 \begin_layout Standard
778 These store image data raw.
779 The amount of data is specified by sector/byte count.
782 \begin_layout Subsubsection
786 \begin_layout Standard
787 Comments are given as list of strings, with UTF-8 encoded strings following
788 2-octet big-endian length.
789 Comment list is terminated by entry with length 0 (0x00 0x00).
790 Comments are optional and may be absent.
793 \begin_layout Section
797 \begin_layout Standard
798 The actual emulator is invoked as:
801 \begin_layout LyX-Code
802 $ java JPCApplication <options>...
805 \begin_layout Standard
806 The valid options are:
809 \begin_layout LyX-Code
810 -library <library> Use the specified directory when searching for images
811 (can only be specified once).
814 \begin_layout LyX-Code
815 -autoexec <script> Execute contents of specified file as commands when starting
819 \begin_layout Subsection
823 \begin_layout Standard
824 When emulator is started, command line comes up.
825 Following commands are known:
828 \begin_layout Itemize
829 'exit': exit immediately
832 \begin_layout Itemize
833 'load <plugin>': Load plugin (no arguments)
836 \begin_layout Itemize
837 'load <plugin>(<arguments>)': load plugin with arguments.
840 \begin_layout Itemize
841 'command <command> [<arguments>...]': Invoke command via external command interface.
844 \begin_layout Itemize
845 'call<command> [<arguments>...]': Invoke command via external command interface
846 and print return values.
849 \begin_layout Standard
850 When one gets command line, its useful to load some plugins.
851 See section about plugins.
852 Note: Load runner plugin (PCControl/PCRunner and so) last, as some runners
853 like to start PC immediately.
856 \begin_layout Subsection
857 PC settings dialog notes
860 \begin_layout Itemize
861 CPU divider base frequency before division is 1GHz.
864 \begin_layout Itemize
865 Images can be specified by name or by ID.
866 Name is relative to library directory.
867 If the image is in subdirectory of image directory, the directory separator
868 is is '/' regardless of what the host OS uses.
871 \begin_layout Itemize
872 CD-ROM and hdc are mutually exclusive
875 \begin_layout Itemize
876 Modules is comma-seperated list of modules to load.
877 To pass arguments to some modules, enclose the arguments in ().
878 Same module can be specified twice only if parameters differ.
881 \begin_layout Itemize
882 Setting boot device doesn't work with some BIOS versions.
883 Those versions prompt the boot device anyway.
886 \begin_layout Subsection
887 Audio output channels
890 \begin_layout Standard
891 PC can have one or more audio output channels.
892 The name of audio output associated with PC speaker is: 'org.jpc.emulator.peripher
894 Modules that have audio outputs get channel names of form <classname>-<sequenti
895 al>, where <classname> is name of main module class and sequential is number
897 Note that same module can have multiple output channels.
898 If multiple modules of same class request audio outputs, the <sequential>
899 values of subsequent module start where previous left off.
902 \begin_layout Subsection
906 \begin_layout Standard
907 Plugins actually execute the tasks of the emulator.
908 They can be loaded using
909 \begin_inset Quotes eld
913 \begin_inset Quotes erd
916 or 'load <plugin>(<arguments>)
917 \begin_inset Quotes erd
923 \begin_layout Standard
924 Different Plugins using the same output (like running PCMonitor and RAWVideoDump
925 er) should not conflict because connector output hold locking is desinged
926 to handle multiple readers.
929 \begin_layout Standard
930 If no plugin used requires GUI, then the emulator can be run without having
934 \begin_layout Subsubsection
935 plugin: org.jpc.plugins.PCControl
938 \begin_layout Standard
939 No arguments, requires and uses GUI.
942 \begin_layout Standard
943 Runs the PC emulator core.
944 Has capability to start/stop emulation, breakpoint after certain time or
945 start/end of VGA vertical retrace.
946 Also can create, savestate and loadstate PC emulation.
947 Memory dumping is supported.
951 \begin_layout Subsubsection
952 plugin: org.jpc.plugins.PCRunner
955 \begin_layout Standard
956 Takes 'movie=<file>' as argument and optionally 'stoptime=<time>' Does not
960 \begin_layout Standard
961 Loads PC from savestate and just runs it.
963 Also automatically quits once stoptime is reached.
966 \begin_layout Subsubsection
967 plugin: org.jpc.plugins.PCMonitor
970 \begin_layout Standard
971 No arguments, requires and uses GUI.
974 \begin_layout Standard
975 VGA monitor for emulated PC.
978 \begin_layout Subsubsection
979 plugin: org.jpc.plugins.VirtualKeyboard
982 \begin_layout Standard
983 No arguments, requires and uses GUI.
986 \begin_layout Standard
987 On-screen keyboard for emulated PC.
990 \begin_layout Subsubsection
991 plugin: org.jpc.plugins.PCStartStopTest
994 \begin_layout Standard
995 No arguments, requires and uses GUI.
998 \begin_layout Standard
999 Small plugin testing remote PC start/stop.
1000 Also supports sending some common keypresses.
1003 \begin_layout Subsubsection
1004 plugin: org.jpc.plugins.RAWVideoDumper
1007 \begin_layout Standard
1008 Takes 'rawoutput=<file>' as argument.
1009 Does not require nor use GUI.
1012 \begin_layout Standard
1013 Dumps all generated frames to RAW file <file>.
1014 Rawoutput is required.
1015 The raw file consists of concatenation of zlib streams.
1016 The uncompressed stream is concatenation of time skips (FFh FFh FFh FFh),
1017 each acting as time offset of 2^32-1 nanoseconds and saved frames.
1018 The saved frame has time offset in nanoseconds (big endian) as first four
1019 bytes (must be at most 2^32-2, as 2^32-1 is reserved for time skip).
1020 The next two bytes are big-endian width, next two big-endian height.
1021 Finally frame has 4 * width * height bytes of data that encodes pixels
1022 using 4 bytes per pixel, in left-to-right, up-to-down order.
1023 Byte 0 of each pixel is reserved, byte 1 is the red channel, byte 2 is
1024 green channel and byte 3 is blue channel.
1027 \begin_layout Standard
1028 Dumping to pipe is supported.
1031 \begin_layout Subsubsection
1032 plugin: org.jpc.plugins.RAWAudioDumper
1035 \begin_layout Standard
1036 Takes 'src=<name of audio output channel>', 'file=<output-filename>' and
1037 'offset=<offset>' as arguments, separated by ','.
1038 Does not require nor use GUI.
1041 \begin_layout Standard
1042 Dumps output from specified audio output channel (src, mandatory) to RAW-format
1043 file (file, mandatory).
1044 The resulting file consists of records, 4 or 8 bytes each.
1045 4 byte record consists of 0xFF 0xFF 0xFF 0xFF and means to increase next
1047 \begin_inset Formula $2^{32}-1$
1051 Otherwise record is 8 bytes.
1052 Each 8 byte record has three fields.
1053 First 4 byte unsinged big endian timedelta value (in nanoseconds, must
1055 \begin_inset Formula $2^{32}-1$
1058 ), then 2 byte signed big endian new left channel volume, then 2 byte signed
1059 big endian new right channel volume.
1060 Optionally 'offset' can be set to positive value (in nanoseconds) to delay
1064 \begin_layout Subsubsection
1065 plugin: org.jpc.plugins.LuaPlugin
1068 \begin_layout Standard
1069 Takes 'kernel=<name of lua kernel file>', other parameters are passed to
1070 kernel, requires and uses GUI.
1073 \begin_layout Standard
1074 Lua VM for executing scripts.
1077 \begin_layout Subsubsection
1078 plugin: org.jpc.plugins.JoystickInput
1081 \begin_layout Standard
1083 Displays window for sending joystick input.
1086 \begin_layout Section
1090 \begin_layout Subsection
1091 org.jpc.modules.Joystick:
1094 \begin_layout Itemize
1098 \begin_layout Itemize
1099 Resources: I/O port 0x201
1102 \begin_layout Standard
1103 Emulates joystick game port.
1106 \begin_layout Subsection
1107 org.jpc.modules.BasicFPU:
1110 \begin_layout Itemize
1114 \begin_layout Itemize
1118 \begin_layout Standard
1119 Crude FPU (x87) emulator.
1122 \begin_layout Section
1126 \begin_layout Standard
1127 Hacks are saved to savestates but not movies.
1130 \begin_layout Subsection
1134 \begin_layout Standard
1135 Force bit 1 of physical address 0x0410 to zero, signaling that the system
1137 BIOS assumes system has FPU but some games use that bit to detect FPU,
1138 trying to use it if it is
1139 \begin_inset Quotes eld
1143 \begin_inset Quotes erd
1147 Try this if game startup hangs with lots of trying to use FPU but not present
1149 Don't use if there is FPU present.
1150 Needed to get games like Blake Stone to work (FPU emulator allows it to
1151 start but causes graphical glitches).
1154 \begin_layout Subsection
1158 \begin_layout Standard
1159 Update basic VGA parameters before vretrace, not after it.
1161 Commander Keen 4) don't like if this isn't done and some games (e.g.
1162 Mario & Luigi) don't like if it is done.
1163 Wrong value manifests as jerky scrolling (scrolling back and forth and
1164 fixed statusbars move).
1167 \begin_layout Section
1168 Some error messages and explanations
1171 \begin_layout Itemize
1172 <filename> is Not a valid image file
1175 \begin_layout Itemize
1176 <filename> is not image file
1179 \begin_layout Itemize
1180 <filename> claims to be floppy with illegal geometry: <x> tracks, <y> sides
1184 \begin_layout Itemize
1185 <filename> claims to be HDD with illegal geometry: <x> tracks, <y> sides
1189 \begin_layout Itemize
1190 Can't read disk image sector map.
1193 \begin_layout Itemize
1194 Can't read disk image extent.
1197 \begin_layout Standard
1198 Code expects <filename> to be valid JPC-RR format image, but it isn't JPC-RR
1199 image at all or its corrupt.
1202 \begin_layout Itemize
1203 <filename> is image of unknown type.
1206 \begin_layout Itemize
1207 <filename> has unrecognized geometry <x> <y> <z>
1210 \begin_layout Standard
1211 Possibly corrupt image, not JPC-RR image, or JPC-RR image from future version
1212 containing something current version can't comprehend.
1215 \begin_layout Itemize
1216 Invalid format specifier <something>.
1219 \begin_layout Itemize
1220 Invalid syntax of --floppy= or --HDD= option.
1223 \begin_layout Itemize
1224 Invalid format specifier/option <something>.
1227 \begin_layout Standard
1228 Invalid option or format specifier was given.
1232 \begin_layout Itemize
1233 java ImageMaker [<options>...] <format> <destination> <source> <diskname>
1236 \begin_layout Standard
1237 Check syntax of command.
1238 Especially that diskname is present!
1241 \begin_layout Itemize
1242 The image has <nnn> sectors while it should have <yyy> according to selected
1246 \begin_layout Itemize
1247 Raw image file length not divisible by 512.
1250 \begin_layout Itemize
1251 Trying to read sector out of range.
1254 \begin_layout Standard
1255 The selected geometry is wrong or raw image is incomplete.
1258 \begin_layout Itemize
1259 Invalid disk name (Should not happen!).
1262 \begin_layout Itemize
1263 Invalid geometry to be written.
1266 \begin_layout Standard
1267 This is a very likely a bug in program.
1270 \begin_layout Itemize
1271 What the heck <filename> is? It's not regular file nor directory.
1274 \begin_layout Standard
1275 That sort of file can't be used as input for image making, or the file just
1279 \begin_layout Itemize
1280 BIOS images can only be made out of regular files.
1283 \begin_layout Itemize
1284 CD images can only be made out of regular files.
1287 \begin_layout Standard
1288 Source image specified is not regular file, but image of that type can't
1289 be made of anything else.
1292 \begin_layout Itemize
1293 Can't read raw bios image file.
1296 \begin_layout Itemize
1297 Can't read sector <nnn> from image.
1300 \begin_layout Standard
1301 Reading the raw image file failed for some reason.
1304 \begin_layout Itemize
1305 Bad library line: "<something>".
1309 \begin_layout Standard
1310 Syntax error in image library.
1313 \begin_layout Itemize
1314 Removing image <something> a.k.a.
1315 "<something>" as it no longer exists.
1318 \begin_layout Standard
1319 The image file no longer exists so it gets removed from library.
1322 \begin_layout Itemize
1323 Removing image <something> a.k.a.
1324 "<something>" due to <some> conflict.
1327 \begin_layout Standard
1328 Image library code killed some image from library due to some kind of conflict
1329 with image being added.
1332 \begin_layout Itemize
1333 Too much data to fit into given space.
1336 \begin_layout Standard
1337 The tree you gave contains takes just too much space to fit into disk of
1341 \begin_layout Section
1342 Advanced: Savestate/movie format
1345 \begin_layout Subsection
1346 Special character classes
1349 \begin_layout Subsubsection
1353 \begin_layout Standard
1354 Following Unicode codepoints (encoded as UTF-8) are interpretted as space
1358 \begin_layout Itemize
1359 Codepoints 0x20, and 0x09.
1362 \begin_layout Itemize
1363 Codepoints 0x1680, 0x180E, 0x2028, 0x205F and 0x3000
1366 \begin_layout Itemize
1367 Codepoints 0x2000-0x200A.
1370 \begin_layout Subsubsection
1374 \begin_layout Standard
1375 Following byte sequences are interpretted as linefeeds (line change):
1378 \begin_layout Itemize
1382 \begin_layout Itemize
1386 \begin_layout Itemize
1387 Bytes 0x0D 0x0A (interpretted as single line change, not two!)
1390 \begin_layout Itemize
1391 Bytes 0xC2 0x85 (UTF-8 for unicode control character NL)
1394 \begin_layout Subsection
1398 \begin_layout Standard
1399 JRSR archive format packs multiple text archive members to text archive.
1400 It does not support binary members.
1401 JRSR archives have first five or six bytes form the magic.
1403 \begin_inset Quotes eld
1407 \begin_inset Quotes erd
1410 followed by LINEFEED character There are four kinds of lines after that
1411 (lines are terminated by LINEFEED byte/bytes):
1414 \begin_layout Itemize
1418 \begin_layout Itemize
1422 \begin_layout Itemize
1426 \begin_layout Itemize
1430 \begin_layout Standard
1431 Sequencing rules are as follows: Start member is allowed anywhere (after
1433 Member line is allowed only inside member (member started but not ended).
1434 End member is only allowed inside member.
1435 End of file is only allowed outside member.
1436 Blank line is allowed anywhere after magic.
1439 \begin_layout Subsubsection
1443 \begin_layout Standard
1444 Start member line is given as
1445 \begin_inset Quotes eld
1449 \begin_inset Quotes erd
1452 <SPACE>+ <membername> <LINEFEED>.
1453 <SPACE>+ any number of SPACE characters at least one and <LINEFEED> is
1455 The member name is UTF-8 encoded and maximum allowed line length is 2048
1456 bytes (including LINEFEED, which means name is limited to 509-2040 codepoints
1457 depending on characters used).
1458 Starting member inside another implicitly ends the previous member.
1461 \begin_layout Subsubsection
1465 \begin_layout Standard
1466 Member line is given as
1467 \begin_inset Quotes eld
1471 \begin_inset Quotes erd
1474 <content><LINEFEED>.
1475 It gives another line for member contents.
1476 <content> is passed raw to layers above (followed by line termination)
1479 \begin_layout Subsubsection
1483 \begin_layout Standard
1484 End member line is given as
1485 \begin_inset Quotes eld
1489 \begin_inset Quotes erd
1493 It ends the current member.
1494 The following line can only be start member line or file may end.
1497 \begin_layout Subsubsection
1501 \begin_layout Standard
1502 Blank line is given as <LINEFEED>.
1503 Lines like that are ignored.
1506 \begin_layout Subsection
1507 Four-to-Five encoding
1510 \begin_layout Standard
1511 Binary members are encoded into text by so-called four-to-five encoding.
1512 This encoding can encode single byte to two, two bytes to three, three
1513 bytes to four and four bytes to five.
1514 Four-to-five encoding has five kinds of blocks.
1515 All SPACE and LINEFEED characters are completely ignored, even in middle
1519 \begin_layout Subsubsection
1523 \begin_layout Standard
1524 End stream block is encoded as '!'.
1525 It ends the stream instantly.
1526 There is also implicit end of stream at end of input to decoding.
1529 \begin_layout Subsubsection
1530 Other four block types
1533 \begin_layout Standard
1534 Other four block types take the value to be encoded, read it as big-endian
1536 Then they write it as base-93 big-endian value.
1537 Then length specific constants are added to digits of that number to yield
1538 ASCII values for characters (those are stored in order):
1541 \begin_layout Standard
1542 \begin_inset Tabular
1543 <lyxtabular version="3" rows="5" columns="6">
1545 <column alignment="center" valignment="top" width="0">
1546 <column alignment="center" valignment="top" width="0">
1547 <column alignment="center" valignment="top" width="0">
1548 <column alignment="center" valignment="top" width="0">
1549 <column alignment="center" valignment="top" width="0">
1550 <column alignment="center" valignment="top" width="0">
1552 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1555 \begin_layout Plain Layout
1561 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1564 \begin_layout Plain Layout
1570 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1573 \begin_layout Plain Layout
1579 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1582 \begin_layout Plain Layout
1588 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1591 \begin_layout Plain Layout
1597 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1600 \begin_layout Plain Layout
1608 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1611 \begin_layout Plain Layout
1617 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1620 \begin_layout Plain Layout
1626 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1629 \begin_layout Plain Layout
1635 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1638 \begin_layout Plain Layout
1644 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1647 \begin_layout Plain Layout
1653 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1656 \begin_layout Plain Layout
1664 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1667 \begin_layout Plain Layout
1673 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1676 \begin_layout Plain Layout
1682 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1685 \begin_layout Plain Layout
1691 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1694 \begin_layout Plain Layout
1700 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1703 \begin_layout Plain Layout
1709 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1712 \begin_layout Plain Layout
1720 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1723 \begin_layout Plain Layout
1729 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1732 \begin_layout Plain Layout
1738 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1741 \begin_layout Plain Layout
1747 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1750 \begin_layout Plain Layout
1756 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1759 \begin_layout Plain Layout
1765 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1768 \begin_layout Plain Layout
1776 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1779 \begin_layout Plain Layout
1785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1788 \begin_layout Plain Layout
1794 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1797 \begin_layout Plain Layout
1803 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1806 \begin_layout Plain Layout
1812 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1815 \begin_layout Plain Layout
1821 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1824 \begin_layout Plain Layout
1838 \begin_layout Standard
1839 Blocks which encode values greater than what is possible for value of that
1840 length are fatal errors.
1844 \begin_layout Subsection
1845 Line component encoing
1848 \begin_layout Standard
1849 Line component encoding sits on top of UTF-8 encoding.
1850 Line component encoding encodes non-empty 1-D array of non-empty strings
1851 into line, and thus array of those into member.
1852 Empty lines or lines that don't contain any components are ignored.
1853 Line starts with depth value of 0 and must end with depth value of zero.
1856 \begin_layout Standard
1857 Components are seperated by component separators.
1858 Empty components are ignored.
1859 Following codepoints are separators on depth 0 if not escaped:
1862 \begin_layout Itemize
1864 The depth is read pre-increment.
1867 \begin_layout Itemize
1869 The depth is read post-decrement.
1872 \begin_layout Itemize
1876 \begin_layout Standard
1877 The following characters are special:
1880 \begin_layout Itemize
1882 Increments depth by 1 if not escaped (and appears in component).
1885 \begin_layout Itemize
1887 Decrements depth by 1 if not escaped (and appears in component).
1888 Depth going negative is an error.
1891 \begin_layout Itemize
1895 Next character is interpretted as literal.
1896 Error if at end of line.
1899 \begin_layout Standard
1900 Otherwise, characters are interpretted as literals and appear in components.
1901 Depth must be zero at end of line.
1904 \begin_layout Subsection
1908 \begin_layout Standard
1909 Header section is in archive member "header".
1910 It uses line component encoding.
1911 The first component of each line is name of header, and subsequent ones
1913 How many parameters are expected is dependent on what header it is:
1916 \begin_layout Subsubsection
1920 \begin_layout Itemize
1921 Header name: "PROJECTID"
1924 \begin_layout Itemize
1928 \begin_layout Itemize
1929 Argument #1: <project-id-string>
1932 \begin_layout Itemize
1936 \begin_layout Standard
1938 Project ID is generated when PC is assembled and is then preserved in save
1940 It is used for computing rerecord counts.
1941 Emulator treats it as opaque string, the IDs it generates are formed by
1942 48 random hexadecimal digits.
1945 \begin_layout Subsubsection
1949 \begin_layout Itemize
1950 Header name: "SAVESTATEID"
1953 \begin_layout Itemize
1957 \begin_layout Itemize
1958 Argument #1: <savestate-id-string>
1961 \begin_layout Itemize
1965 \begin_layout Standard
1966 Gives save state ID.
1967 Each save state has its own save state ID.
1968 Treated as opaque string, but generated as 48 random hexadecimal digits.
1969 The presence of this header signals whether there is save state to be loaded.
1970 If this header is present, save state load will be attempted.
1971 If absent, save state is not to be loaded even if present (and correct
1972 savestate load would be technically impossible anyway).
1975 \begin_layout Standard
1976 The value is used to prevent loading incompatible save states in preserve
1977 event stream mode and also to find the point in event stream where one
1981 \begin_layout Subsubsection
1985 \begin_layout Itemize
1986 Header name: "RERECORDS"
1989 \begin_layout Itemize
1993 \begin_layout Itemize
1994 Argument #1: <rerecords>
1997 \begin_layout Itemize
2001 \begin_layout Standard
2002 Gives rerecord count.
2003 PC assembly (except when loading save state) initializes current rerecord
2005 Must be non-negative and decimal number using ASCII digit characters.
2008 \begin_layout LyX-Code
2009 On loading save state:
2012 \begin_layout LyX-Code
2013 1) If project ID matches with previous:
2016 \begin_layout LyX-Code
2017 1a) If loaded rerecord count is larger or equal to current rerecord count:
2020 \begin_layout LyX-Code
2021 1a-a) Current rerecord count is loaded rerecord count + 1.
2024 \begin_layout LyX-Code
2028 \begin_layout LyX-Code
2029 1b-a) Current rerecord count increments by 1.
2032 \begin_layout LyX-Code
2036 \begin_layout LyX-Code
2037 2a) Current rerecord count is loaded rerecord count + 1.
2040 \begin_layout Standard
2041 The current rerecord count at time of save is saved to save state.
2044 \begin_layout Subsubsection
2048 \begin_layout Itemize
2049 Header name: "AUTHORS"
2052 \begin_layout Itemize
2053 Components: 2 or more
2056 \begin_layout Itemize
2057 Arguments: free form
2060 \begin_layout Itemize
2064 \begin_layout Standard
2065 Gives authors of run.
2066 Each argument gives one author.
2067 May be present multiple times.
2070 \begin_layout Subsubsection
2074 \begin_layout Itemize
2075 Header name: "COMMENT"
2078 \begin_layout Itemize
2079 Components: 2 or more
2082 \begin_layout Itemize
2083 Arguments: free form
2086 \begin_layout Itemize
2090 \begin_layout Standard
2091 Various kinds of free form data.
2092 Not parsed further by emulator.
2095 \begin_layout Subsection
2096 Initialization segment:
2099 \begin_layout Standard
2100 If SAVESTATEID header isn't present (not a save state), member "initialization"
2101 gives PC initialization parameters for assembling the PC.
2102 It is present anyway even if SAVESTATEID is present (savestate).
2105 \begin_layout Standard
2106 Following parameters are used (space separates components):
2109 \begin_layout LyX-Code
2113 \begin_layout Standard
2114 Gives Image ID of main system BIOS (mandatory)
2117 \begin_layout LyX-Code
2121 \begin_layout Standard
2122 Gives Image ID of VGA BIOS (mandatory).
2125 \begin_layout LyX-Code
2129 \begin_layout Standard
2130 Gives Image ID of hda.
2131 Present only if system has hard disk hda.
2134 \begin_layout LyX-Code
2138 \begin_layout Standard
2139 Gives Image ID of hdb.
2140 Present only if system has hard disk hdb.
2143 \begin_layout LyX-Code
2147 \begin_layout Standard
2148 Gives Image ID of hdc.
2149 Present only if system has hard disk hdc.
2152 \begin_layout LyX-Code
2156 \begin_layout Standard
2157 Gives Image ID of hdd.
2158 Present only if system has hard disk hdd.
2161 \begin_layout LyX-Code
2165 \begin_layout Standard
2166 Gives Image ID of disk in slot <num>.
2167 Slot number must be non-negative.
2170 \begin_layout LyX-Code
2171 \begin_inset Quotes eld
2175 \begin_inset Quotes erd
2181 \begin_layout Standard
2182 kGives image name of disk in slot <num>.
2183 Slot number must be non-negative.
2184 The slot must be previously declared using
2185 \begin_inset Quotes eld
2189 \begin_inset Quotes erd
2195 \begin_layout LyX-Code
2199 \begin_layout Standard
2200 Gives Image slot to initially put into floppy drive fda.
2201 Disk must be of floppy type.
2202 If none present, no disk is initially put there.
2205 \begin_layout LyX-Code
2209 \begin_layout Standard
2210 Gives Image slot to initially put into floppy drive fdb.
2211 Disk must be of floppy type.
2212 If none present, no disk is initially put there.
2215 \begin_layout LyX-Code
2219 \begin_layout Standard
2220 Gives Image slot to initially put into CD-ROM drive hdc.
2221 Not allowed if hard disk hdc is present.
2222 Disk must be of CD-ROM type.
2223 If none present no disk is initially put there.
2226 \begin_layout LyX-Code
2227 "INITIALTIME" <time>
2230 \begin_layout Standard
2231 Number of milliseconds since Unix epoch to system start up time.
2235 \begin_layout Standard
2240 \begin_layout LyX-Code
2241 "CPUDIVIDER" <divider>
2244 \begin_layout Standard
2245 Set CPU frequency divider (dividing the 1GHz master clock).
2246 Allowed range is 1-256.
2250 \begin_layout LyX-Code
2251 "MEMORYSIZE" <pages>
2254 \begin_layout Standard
2255 Number of 4KiB pages of RAM memory.
2256 Allowed range 256-262144.
2260 \begin_layout LyX-Code
2264 \begin_layout Standard
2266 Valid devices are "FLOPPY" (boot from fda), "HDD" (boot from hda) and "CDROM"
2270 \begin_layout LyX-Code
2271 "LOADMODULEA" <module> <parameters>
2274 \begin_layout Standard
2275 Load module <module> with parameters <parameters>.
2278 \begin_layout LyX-Code
2279 "LOADMODULE" <module>
2282 \begin_layout Standard
2283 Load module <module> with no parameters
2286 \begin_layout LyX-Code
2287 \begin_inset Quotes eld
2291 \begin_inset Quotes erd
2297 \begin_layout Standard
2298 Use class <fpu> as FPU emulator.
2301 \begin_layout LyX-Code
2302 \begin_inset Quotes eld
2306 \begin_inset Quotes erd
2312 \begin_layout Standard
2313 Use I/O port delay emulation (each I/O port read/write takes 666ns).
2316 \begin_layout LyX-Code
2317 \begin_inset Quotes eld
2321 \begin_inset Quotes erd
2327 \begin_layout Standard
2328 Emulate VGA horizontal retrace.
2331 \begin_layout Subsection
2332 Event record format:
2335 \begin_layout Standard
2336 Event record is in archive member "events".
2337 It uses line component encoding.
2338 Each line gives an event.
2339 First component of each line gives time stamp.
2340 These timestamps MUST be in increasing order and all MUST be non-negative.
2341 Time stamp time unit is exactly 1 nanosecond of emulated time.
2344 \begin_layout Standard
2345 The second component of each line is name of class to dispatch to.
2346 Further components are passed as-is to event handlers.
2347 Classes with names consisting only of uppercase A-Z and 0-9 are special
2349 It is error to encounter unknown such special class.
2352 \begin_layout Subsubsection
2356 \begin_layout Itemize
2357 Dispatch to: SAVESTATE
2360 \begin_layout Itemize
2361 Argument #1: Savestate id
2364 \begin_layout Itemize
2365 Argument #2 (optional): Rerecord count at time of saving savestate
2368 \begin_layout Standard
2369 Signals that savestate has occured here.
2370 The save state IDs MUST be unique in entire event stream.
2371 The second argument to savestate (if present) is rerecord count at time
2372 of saving that savestate (useful for calulating rerecord count of movie
2373 starting from savestate).
2374 No time restrictions
2377 \begin_layout Subsubsection
2381 \begin_layout Itemize
2385 \begin_layout Itemize
2387 \begin_inset Quotes eld
2391 \begin_inset Quotes erd
2395 \begin_inset Quotes eld
2399 \begin_inset Quotes erd
2405 \begin_layout Standard
2406 Controls various options.
2408 \begin_inset Quotes eld
2412 \begin_inset Quotes erd
2415 turns on absolute mode (default) where event timestamps are absolute.
2417 \begin_inset Quotes eld
2421 \begin_inset Quotes erd
2424 turns on relative mode where event timestamps are relative to last event
2426 The OPTION event itself is not affected by timing change.
2427 No time restrictions.
2428 Unknown arguments are errors.
2431 \begin_layout Subsubsection
2432 Keyboard keypress/keyrelease event:
2435 \begin_layout Itemize
2436 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2439 \begin_layout Itemize
2440 Argument #1: Fixed: "KEYEDGE"
2443 \begin_layout Itemize
2444 Argument #2: Key number.
2445 Valid values are 1-83, 85-95, 129-197 and 199-223
2448 \begin_layout Standard
2449 Send key press or key release.
2450 Keys work in toggle button manner.
2451 The event time must be multiple of 66 666, and must not be less than 60
2452 * 66 666 TUs after last PAUSE event, 20 * 66 666 TUs after last KEYEDGE
2453 on key >128 and 10 * 66 666 TUs after last KEYEDGE on key <128.
2456 \begin_layout Subsubsection
2460 \begin_layout Itemize
2461 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2464 \begin_layout Itemize
2465 Argument #1: Fixed: "PAUSE"
2468 \begin_layout Standard
2469 Send pause key event.
2470 The time restrictions are identical to KEYEDGE event.
2473 \begin_layout Subsubsection
2474 Joystick button event:
2477 \begin_layout Itemize
2478 Dispatch to: org.jpc.modules.Joystick
2481 \begin_layout Itemize
2483 \begin_inset Quotes eld
2487 \begin_inset Quotes erd
2491 \begin_inset Quotes eld
2495 \begin_inset Quotes erd
2499 \begin_inset Quotes eld
2503 \begin_inset Quotes erd
2507 \begin_inset Quotes eld
2511 \begin_inset Quotes erd
2517 \begin_layout Itemize
2519 \begin_inset Quotes eld
2523 \begin_inset Quotes erd
2527 \begin_inset Quotes eld
2531 \begin_inset Quotes erd
2537 \begin_layout Standard
2538 Send button down/up event.
2539 No time restrictions.
2542 \begin_layout Subsubsection
2543 Joystick axis event:
2546 \begin_layout Itemize
2547 Dispatch to: org.jpc.modules.Joystick
2550 \begin_layout Itemize
2552 \begin_inset Quotes eld
2556 \begin_inset Quotes erd
2560 \begin_inset Quotes eld
2564 \begin_inset Quotes erd
2568 \begin_inset Quotes eld
2572 \begin_inset Quotes erd
2576 \begin_inset Quotes eld
2580 \begin_inset Quotes erd
2586 \begin_layout Itemize
2587 Argument #2: Multivibrator unstable state length in ns.
2590 \begin_layout Standard
2591 Set amount of time multivibrator remains in unstable state.
2592 No time restrictions.
2595 \begin_layout Subsubsection
2599 \begin_layout Itemize
2600 Dispatch to: org.jpc.emulator.PC$ResetButton
2603 \begin_layout Itemize
2607 \begin_layout Standard
2611 \begin_layout Subsubsection
2615 \begin_layout Itemize
2616 Dispatch to: org.jpc.emulator.PC$DiskChanger
2619 \begin_layout Itemize
2620 Argument #1: Fixed: "FDA"
2623 \begin_layout Itemize
2624 Argument #2: Number of image slot to put there.
2628 \begin_layout Standard
2629 The disk number MUST be -1 or valid disk number.
2630 -1 MUST NOT be used if there is no disk in floppy drive A.
2631 This event causes specified disk to be placed to FDA or FDA disk to be
2632 ejected with no replacement if disk number is -1.
2633 The specified disk if not -1 must be of floppy type.
2634 The specified disk if valid must not be in any other drive.
2637 \begin_layout Subsubsection
2641 \begin_layout Itemize
2642 Dispatch to: org.jpc.emulator.PC$DiskChanger
2645 \begin_layout Itemize
2646 Argument #1: Fixed: "FDB"
2649 \begin_layout Itemize
2650 Argument #2: Number of image slot to put there.
2654 \begin_layout Standard
2655 The disk number MUST be -1 or valid disk number.
2656 -1 MUST NOT be used if there is no disk in floppy drive B.
2657 This event causes specified disk to be placed to FDB or FDB disk to be
2658 ejected with no replacement if disk number is -1.
2659 The specified disk if not -1 must be of floppy type.
2660 The specified disk if valid must not be in any other drive.
2663 \begin_layout Subsubsection
2667 \begin_layout Itemize
2668 Dispatch to: org.jpc.emulator.PC$DiskChanger
2671 \begin_layout Itemize
2672 Argument #1: Fixed: "CDROM"
2675 \begin_layout Itemize
2676 Argument #2: Number of image slot to put there.
2680 \begin_layout Standard
2681 The disk number MUST be -1 or valid disk number.
2682 -1 MUST NOT be used if there is no disk in CD-ROM.
2683 This event causes specified disk to be placed to CD-ROM or CD-ROM disk
2684 to be ejected with no replacement if disk number is -1.
2685 The specified disk if not -1 must be of CD-ROM type.
2688 \begin_layout Standard
2689 This event has no effect if CD-ROM is locked.
2692 \begin_layout Subsubsection
2693 Write protect floppy:
2696 \begin_layout Itemize
2697 Dispatch to: org.jpc.emulator.PC$DiskChanger
2700 \begin_layout Itemize
2701 Argument #1: Fixed: "WRITEPROTECT"
2704 \begin_layout Itemize
2705 Argument #2: Number of image slot to manipulate
2708 \begin_layout Standard
2709 Write protects specified disk.
2710 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2713 \begin_layout Subsubsection
2714 Write unprotect floppy:
2717 \begin_layout Itemize
2718 Dispatch to: org.jpc.emulator.PC$DiskChanger
2721 \begin_layout Itemize
2722 Argument #1: Fixed: "WRITEUNPROTECT"
2725 \begin_layout Itemize
2726 Argument #2: Number of image slot to manipulate
2729 \begin_layout Standard
2730 Disables write protection specified disk.
2731 The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2734 \begin_layout Subsection
2738 \begin_layout Standard
2739 Diskinfo sections are named
2740 \begin_inset Quotes eld
2744 \begin_inset Quotes erd
2748 They use line component encoding, fieldtype being first component on each
2749 line (value being the second).
2750 Following fields are defined:
2753 \begin_layout Subsubsection
2757 \begin_layout Standard
2758 Gives type of image.
2762 \begin_layout Itemize
2763 \begin_inset Quotes eld
2767 \begin_inset Quotes erd
2773 \begin_layout Itemize
2774 \begin_inset Quotes eld
2778 \begin_inset Quotes erd
2784 \begin_layout Itemize
2785 \begin_inset Quotes eld
2789 \begin_inset Quotes erd
2795 \begin_layout Itemize
2796 \begin_inset Quotes eld
2800 \begin_inset Quotes erd
2803 (BIOS/VGABIOS image)
2806 \begin_layout Itemize
2807 \begin_inset Quotes eld
2811 \begin_inset Quotes erd
2814 (what the heck is this???)
2817 \begin_layout Subsubsection
2821 \begin_layout Standard
2825 \begin_layout Subsubsection
2829 \begin_layout Standard
2830 (BIOS images only) Gives length of BIOS image
2833 \begin_layout Subsubsection
2837 \begin_layout Standard
2838 MD5 of raw disk/BIOS image without any headers or trailers.
2841 \begin_layout Subsubsection
2845 \begin_layout Standard
2846 (FLOPPY/HDD/CDROM images only) Number of total sectors on disk.
2849 \begin_layout Subsubsection
2853 \begin_layout Standard
2854 (FLOPPY/HDD images only) Number of tracks on disk per side (1-256 for floppy,
2858 \begin_layout Subsubsection
2862 \begin_layout Standard
2863 (FLOPPY/HDD images only) Number of sides on disk (1 or 2 for floppy, 1-16
2867 \begin_layout Subsubsection
2871 \begin_layout Standard
2872 (FLOPPY/HDD images only) Number of sectors per track (1-255 for floppy,
2876 \begin_layout Subsubsection
2880 \begin_layout Standard
2881 Line from image comment block.
2882 Usually give data about files image has.
2883 May or may not be present (multiple times)
2886 \begin_layout Subsection
2890 \begin_layout Standard
2891 Actual savestate format is not documented here.
2892 It is close to impossible to comprehend without access to emulator source
2896 \begin_layout Section
2897 Advanced: Making class dumpable
2900 \begin_layout Standard
2901 Class is made dumpable by implementing interface org.jpc.emulator.SRDumpable
2902 and implementing method dumpSRPartial(org.jpc.emulator.SRDumper) and constructor
2903 <init>(org.jpc.emulator.SRLoader).
2904 Non-static inner classes can not be dumpable (make them static using tricks
2905 similar to what javac uses).
2908 \begin_layout Standard
2909 If dumped class has dumpable superclass, the first thing dumping function
2910 needs to do is to call dumper function of superclass and first thing loading
2911 constructor needs to do is to call loading constructor of superclass.
2912 If class has no dumpable superclass, dumper doesn't need to do anything
2913 special, while loader needs to call objectCreated(this) on SRLoader object
2914 passed as parameter.
2918 \begin_layout Standard
2919 Following these fixed parts, dump all members that are part of mutable state
2923 \begin_layout Subsection
2924 Member dumping/loading functions
2927 \begin_layout Standard
2928 There is dumping/loading function for following (all functions dumping/loading
2929 reference types can handle null):
2932 \begin_layout Itemize
2933 boolean: SRDumper.dumpBoolean, SRLoader.loadBoolean
2936 \begin_layout Itemize
2937 byte: SRDumper.dumpByte, SRLoader.loadByte
2940 \begin_layout Itemize
2941 short: SRDumper.dumpShort, SRLoader.loadShort
2944 \begin_layout Itemize
2945 int: SRDumper.dumpInt, SRLoader.loadInt
2948 \begin_layout Itemize
2949 long: SRDumper.dumpLong, SRLoader.loadLong
2952 \begin_layout Itemize
2953 String: SRDumper.dumpString, SRLoader.loadString
2956 \begin_layout Itemize
2957 boolean[]: SRDumper.dumpArray, SRLoader.loadArrayBoolean
2960 \begin_layout Itemize
2961 byte[]: SRDumper.dumpArray, SRLoader.loadArrayByte
2964 \begin_layout Itemize
2965 short[]: SRDumper.dumpArray, SRLoader.loadArrayShort
2968 \begin_layout Itemize
2969 int[]: SRDumper.dumpArray, SRLoader.loadArrayInt
2972 \begin_layout Itemize
2973 long[]: SRDumper.dumpArray, SRLoader.loadArrayLong
2976 \begin_layout Itemize
2977 double[]: SRDumper.dumpArray, SRLoader.loadArrayDouble
2980 \begin_layout Itemize
2981 <dumpable type>: SRDumper.dumpObject, SRLoader.loadObject
2984 \begin_layout Itemize
2985 special object: SRDumper.specialObject, SRLoader.specialObject
2988 \begin_layout Subsubsection
2992 \begin_layout Itemize
2993 Dumpable objects come out as type of org.jpc.emulator.SRDumpable.
2996 \begin_layout Itemize
2997 Special objects are various static objects that don't need to be stored
2998 because they don't have mutable fields.
3001 \begin_layout Itemize
3002 Don't dump fields related to event state feedback.
3005 \begin_layout Itemize
3006 Don't dump temporary flags that are only used while PC is running.
3007 Savestate when PC is running isn't possible anyway.
3010 \begin_layout Itemize
3011 Some connectors dump fields related to connector output, some don't.
3014 \begin_layout Section
3015 Advanced: Making output connectors
3018 \begin_layout Standard
3019 Implementing interface org.jpc.emulator.DisplayController signals that this
3020 is display controller, inhibiting loading of the standard VGA display controlle
3021 r if loaded as module.
3025 \begin_layout Subsection
3026 Interface org.jpc.emulator.OutputConnector
3029 \begin_layout Standard
3030 Class is made to be output connector by implementing this interface.
3031 This interface specifies the methods used for output hold locking.
3032 Class org.jpc.emulator.OutputConnectorLocking has implementations of these
3033 that are suitable for calling.
3037 \begin_layout Subsubsection
3038 Method subscribeOutput(Object)
3041 \begin_layout Standard
3042 Subscribes the output, with specified object as handle.
3045 \begin_layout Subsubsection
3046 Method unsubscribeOutput(Object)
3049 \begin_layout Standard
3050 Unsubscribe the specified handle object from output.
3053 \begin_layout Subsubsection
3054 Method waitOutput(Object)
3057 \begin_layout Standard
3058 Wait for output on specified connector using specified handle object.
3059 Returns true on success, false if wait was interrupted by thread interrupt.
3063 \begin_layout Subsubsection
3064 Method releaseOutput(Object)
3067 \begin_layout Standard
3068 Release connector from p.o.v.
3073 \begin_layout Subsubsection
3077 \begin_layout Standard
3078 Release threads waiting on waitOutput() and block until all subscribers
3079 have returned from waitOutput() and enteired releaseOutput().
3082 \begin_layout Subsubsection
3083 Method releaseOutputWaitAll(object)
3086 \begin_layout Standard
3087 Like releaseOutput(), but waits until all handles have released their output.
3090 \begin_layout Subsection
3091 Class org.jpc.emulator.VGADigtalOut
3094 \begin_layout Standard
3095 Class org.jpc.emulator.VGADigtalOut (already implements OutputConnector) implements
3096 VGA output connector.
3097 If module provodes output connector, it needs to implement org.jpc.emulator.Displa
3101 \begin_layout Subsubsection
3105 \begin_layout Standard
3106 Get width of display (watch out, can return 0).
3109 \begin_layout Subsubsection
3113 \begin_layout Standard
3114 Get height of display (watch out, can return 0).
3117 \begin_layout Subsubsection
3118 Methods getDirtyXMin(), getDirtyXMax(), getDirtyYMin(), getDirtyYMax()
3121 \begin_layout Standard
3122 Returns the dirty region (region modified since last output).
3125 \begin_layout Subsubsection
3129 \begin_layout Standard
3130 Get buffer of ints, at least width * height elements (left-to-right, top-down,
3131 one value per pixel) giving pixel data.
3132 Value for each pixel is 65536 * <red-component> + 256 * <green-component>
3136 \begin_layout Subsubsection
3137 Method resizeDisplay(int _width, int _height)
3140 \begin_layout Standard
3141 Resize the display to be of specified size.
3144 \begin_layout Subsubsection
3145 Method dirtyDisplayRegion(int x, int y, int w, int h)
3148 \begin_layout Standard
3149 Mark the specified region as dirty.
3152 \begin_layout Subsubsection
3153 Method resetDirtyRegion()
3156 \begin_layout Standard
3157 Resets the dirty region to be empty.
3160 \begin_layout Subsection
3161 Class org.jpc.emulator.PC method getVideoOutput()
3164 \begin_layout Standard
3165 Get VGA output connector for PC.
3168 \begin_layout Subsection
3169 Interface org.jpc.emulator.DisplayController.
3172 \begin_layout Standard
3173 Implementing this class signals that module is VGA controller.
3174 There can be only one such module active at time and presence of such module
3175 prevents loading builtin VGA controller emulation code.
3178 \begin_layout Subsubsection
3179 Method getOutputDevice()
3182 \begin_layout Standard
3183 Get VGA output connector for this VGA device.
3186 \begin_layout Subsection
3187 Class org.jpc.emulator.SoundDigitalOut
3190 \begin_layout Standard
3191 Class org.jpc.emulator.SoundDigitalOut provodes output connector for sound.
3192 Each connector can transfer stereo signal at arbitiary sampling rate.
3193 Modules that have audio connectors need to implement interface org.jpc.emulator.So
3194 undOutputDevice, as this signals that output connectors should be created.
3197 \begin_layout Subsubsection
3198 Method addSample(long, short, short)
3201 \begin_layout Standard
3202 Add stereo sample at time given by first argument.
3203 The second and third arguments give volume on left and right channels.
3206 \begin_layout Subsubsection
3207 Method addSample(long, short)
3210 \begin_layout Standard
3211 Add mono sample at time given by first argument.
3212 The second argument give volume on both channels.
3215 \begin_layout Subsubsection
3216 Method readBlock(Block)
3219 \begin_layout Standard
3220 Reads block of output (atomic versus addSample).
3221 Block structure has following fields which are filled:
3224 \begin_layout Itemize
3225 timeBase: Time base for block.
3228 \begin_layout Itemize
3229 baseLeft: Left volume at time base.
3232 \begin_layout Itemize
3233 baseRight: Right volume at time base
3236 \begin_layout Itemize
3237 blockNo: Sequence number of block filled.
3240 \begin_layout Itemize
3241 samples: Number of samples in block
3244 \begin_layout Itemize
3245 sampleTiming: Number of nanoseconds since last sample
3248 \begin_layout Itemize
3249 sampleLeft: Left channel samples
3252 \begin_layout Itemize
3253 sampleRight: Right channel samples
3256 \begin_layout Subsection
3257 Interface org.jpc.emulator.SoundOutputDevice
3260 \begin_layout Standard
3261 Implementing this interface signals that module has audio output channels.
3264 \begin_layout Subsubsection
3265 Method org.jpc.emulator.SoundOutputDevice.requestedSoundChannels()
3268 \begin_layout Standard
3269 Return the number of sound channels module has.
3272 \begin_layout Subsubsection
3273 Method org.jpc.emulator.SoundOutputDevice.soundChannelCallback(SoundDigitalOut)
3276 \begin_layout Standard
3277 This is called once per sound channel requested giving precreated sound
3281 \begin_layout Subsection
3282 Class org.jpc.emulator.PC method getSoundOut(String)
3285 \begin_layout Standard
3286 Get sound output with specified name.
3289 \begin_layout Section
3290 Advanced: Writing event targets
3293 \begin_layout Standard
3294 Whereas output connectors are the way output is dispatched, input is dispatched
3296 Event targets need to implement interface org.jpc.emulator.EventDispatchTarget.
3299 \begin_layout Standard
3300 Event targets also provode methods which then encode events and dispatch
3301 them forward (without doing anything else) to event recorder.
3302 Also, event targets may have methods for obtaining state.
3305 \begin_layout Subsection
3306 Interface org.jpc.emulator.EventDispatchTarget
3309 \begin_layout Standard
3310 Interface that marks class capable of receiving events.
3313 \begin_layout Subsubsection
3314 Method setEventRecorder(EventRecorder)
3317 \begin_layout Standard
3318 Set the event recorder input events are sent to.
3321 \begin_layout Subsubsection
3322 Method startEventCheck()
3325 \begin_layout Standard
3326 Signals target to reset all state related to event checking and state feedback.
3327 This may be called at any time in order to reinitialialize event checking/feedb
3331 \begin_layout Subsubsection
3332 Method doEvent(long, String[], int) throws IOException
3335 \begin_layout Standard
3336 Event dispatch handler.
3337 The first argument is event time, second is parameters and third is what
3339 If target doesn't like the event, throw IOException.
3340 Following types (the integer parameter) are used:
3343 \begin_layout LyX-Code
3344 0 (EventRecorder.EVENT_TIMED): Time has been assigned for event.
3347 \begin_layout LyX-Code
3348 1 (EventRecorder.EVENT_STATE_EFFECT_FUTURE): Future event in event replay
3349 for reinitialization
3352 \begin_layout LyX-Code
3353 2 (EventRecorder.EVENT_STATE_EFFECT): Past event in event replay reinitialization
3356 \begin_layout LyX-Code
3357 3 (EventRecorder.EVENT_EXECUTE): This event occurs now.
3361 \begin_layout Subsubsection
3362 Method endEventCheock()
3365 \begin_layout Standard
3366 End event reinitialization.
3370 \begin_layout Subsubsection
3371 Method getEventTimeLowBound(long, String[]) throws IOException
3374 \begin_layout Standard
3375 Return the time value that's the earliest possiblity for this event to occur.
3376 Returning any time in past (including -1) causes event to fire as soon
3378 The long parameter gives the current scheduled time for event.
3381 \begin_layout Section
3385 \begin_layout Standard
3386 Modules are various extensions that run inside emulator core.
3387 As such, they affect sync.
3388 Modules must implement interface org.jpc.emulator.HardwareComponent (they
3389 are hardware components) and must be dumpable.
3390 Additionally, they need either constructor <init>() or <init>(String).
3391 The first is if no parameters are passed, the second is for case where
3392 parameters are passed.
3395 \begin_layout Standard
3396 Aside of the constructors, modules need to obey the ordinary conventions
3397 for hardware components.
3398 No code outside modules needs to know that module exists.
3401 \begin_layout Section
3405 \begin_layout Standard
3406 Plugins handle various UI tasks.
3407 They need to implement interface org.jpc.Plugin.
3410 \begin_layout Subsection
3411 Interface org.jpc.pluginsbase.Plugin
3414 \begin_layout Subsubsection
3415 Method systemShutdown()
3418 \begin_layout Standard
3419 Called when emulator shuts down.
3420 Either called in dedicated thread or in thread that called emulatorShutdown().
3421 These handlers should do the bare minimum to get files on disk to consistent
3423 After these calls from all plugins have finished, emulator exits.
3424 Do not try to manipulate UI from these methods, as doing that easily leads
3428 \begin_layout Subsubsection
3429 Method reconnect(PC)
3432 \begin_layout Standard
3433 Gives new PC to connect to.
3434 Null is passed if plugin should disconnect.
3437 \begin_layout Subsubsection
3441 \begin_layout Standard
3442 Called in dedicated thread after plugin is initialized.
3445 \begin_layout Subsubsection
3449 \begin_layout Standard
3450 Called after PC has stopped.
3453 \begin_layout Subsubsection
3457 \begin_layout Standard
3458 Called before PC starts.
3461 \begin_layout Subsubsection
3462 Method notifyArguments(String[])
3465 \begin_layout Standard
3466 Pass arguments from command line.
3469 \begin_layout Subsubsection
3470 Constructor <init>(Plugins)
3473 \begin_layout Standard
3474 This constructor is used to initialize plugins that don't take parameters.
3477 \begin_layout Subsubsection
3478 Constructor <init>(Plugins, String)
3481 \begin_layout Standard
3482 This constructor is used to initialize plugins that take parameters.
3485 \begin_layout Subsection
3486 Class org.jpc.pluginsbase.Plugins
3489 \begin_layout Standard
3490 This class provodes various methods for manipulating plugins.
3493 \begin_layout Subsubsection
3494 Method isShuttingDown()
3497 \begin_layout Standard
3498 Returns true if Plugins.shutdownEmulator() has been called somehow, either
3499 via VM exit, CTRL+C or explicitly.
3500 Useful to skip cleanups involving GUI, as these are too deadlock-prone.
3503 \begin_layout Subsubsection
3504 Method shutdownEmulator()
3507 \begin_layout Standard
3508 Shut down and exit the emulator.
3509 All plugin shutdown functions are called in this thread.
3512 \begin_layout Subsubsection
3513 Method reconnectPC(PC)
3516 \begin_layout Standard
3517 Signal reconnectPC event to all plugins.
3520 \begin_layout Subsubsection
3524 \begin_layout Standard
3525 Signal pcStarting() event to all plugins.
3528 \begin_layout Subsubsection
3532 \begin_layout Standard
3533 Signal pcStopping() event to all plugins.
3536 \begin_layout Section
3537 Inter-plugin communication
3540 \begin_layout Subsection
3541 Receiving communications
3544 \begin_layout Standard
3545 To receive invocation/call by name 'foo-bar', declare public method named
3547 Arguments to this method can currently be String, Integer (int) or Long
3549 Last argument may be array over these types to get variable number of arguments.
3550 On call, each argument gets value from call.
3551 If last argument is array, it gets all overflowing arguments.
3552 If return type is void or method returns boolean false, call is assumed
3554 If return value is boolean true, it is assumed that there is more processing.
3557 \begin_layout Subsection
3558 void org.jpc.pluginsbase.Plugins.invokeExternalCommand(String cmd, Object[]
3562 \begin_layout Standard
3563 Invoke command asynchronously, broadcasting to all plugins.
3564 Does not wait for slow commands to complete.
3565 cmd is the name to send and args are the arguments to pass.
3568 \begin_layout Subsection
3569 void org.jpc.pluginsbase.Plugins.invokeExternalCommandSynchronous(String cmd,
3573 \begin_layout Standard
3574 Same as invokeExternalCommand, but waits for slow commands to complete.
3577 \begin_layout Subsection
3578 Object[] org.jpc.pluginsbase.Plugins.invokeExternalCommandReturn(String cmd,
3582 \begin_layout Standard
3583 Similar to invokeExternalCommandSynchornous, but:
3586 \begin_layout Itemize
3587 Quits calling more plugins when it gets successful reply.
3590 \begin_layout Itemize
3594 \begin_layout Subsection
3595 void org.jpc.pluginsbase.Plugins.returnValue(Object...
3599 \begin_layout Standard
3600 Gives return value to return from call and signals that command has completed.
3603 \begin_layout Subsection
3604 void org.jpc.pluginsbase.Plugins.signalCommandCompletion()
3607 \begin_layout Standard
3608 Signals that command has completed.
3609 Only needed if there is no return value and eci_ method returned false
3613 \begin_layout Section
3614 Lua kernel programming
3617 \begin_layout Standard
3618 At startup, kernel gets its arguments in 'args' table and the script name
3619 to run in 'scriptname' string.
3620 It should enter the named script in protected mode.
3623 \begin_layout Standard
3624 The Lua VM exports numerious callbacks to kernel.
3625 The kernel can then choose to omit, wrap or re-export these to Lua scripts.
3628 \begin_layout Itemize
3629 Always grab any functions used into local variables so nobody can mess with
3633 \begin_layout Itemize
3634 Don't use global variables in kernel (except for those passed).