Streamtools: Add FLAC output driver
[jpcrr.git] / docs / manual.lyx
blob98a8a24c38fa49ead2f2e4cefda6a3c1789ac1b9
1 #LyX 1.6.7 created this file. For more info see http://www.lyx.org/
2 \lyxformat 345
3 \begin_document
4 \begin_header
5 \textclass article
6 \use_default_options true
7 \language finnish
8 \inputencoding auto
9 \font_roman default
10 \font_sans default
11 \font_typewriter default
12 \font_default_family default
13 \font_sc false
14 \font_osf false
15 \font_sf_scale 100
16 \font_tt_scale 100
18 \graphics default
19 \paperfontsize default
20 \spacing single
21 \use_hyperref false
22 \papersize default
23 \use_geometry true
24 \use_amsmath 1
25 \use_esint 1
26 \cite_engine basic
27 \use_bibtopic false
28 \paperorientation portrait
29 \leftmargin 2cm
30 \topmargin 2cm
31 \rightmargin 1cm
32 \bottommargin 2cm
33 \headheight 1cm
34 \headsep 1cm
35 \footskip 1cm
36 \secnumdepth 3
37 \tocdepth 3
38 \paragraph_separation indent
39 \defskip medskip
40 \quotes_language english
41 \papercolumns 1
42 \papersides 1
43 \paperpagestyle default
44 \tracking_changes false
45 \output_changes false
46 \author "" 
47 \author "" 
48 \end_header
50 \begin_body
52 \begin_layout Title
53 JPC-RR: User's manual
54 \end_layout
56 \begin_layout Section
57 Licence
58 \end_layout
60 \begin_layout Standard
61 JPC-RR is licenced under GNU GPL v2.
62  See file 
63 \begin_inset Quotes eld
64 \end_inset
66 LICENSE
67 \begin_inset Quotes erd
68 \end_inset
71 \end_layout
73 \begin_layout Section
74 Getting started
75 \end_layout
77 \begin_layout Subsection
78 Prerequisites
79 \end_layout
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
84  also work).
85  Note: JRE is not enough.
87 \end_layout
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).
93 \end_layout
95 \begin_layout Subsection
96 Compiling
97 \end_layout
99 \begin_layout Standard
100 See compile.sh or compile.bat.
101  The streamtools stuff is only needed for dumping videos.
102 \end_layout
104 \begin_layout Subsection
105 Getting started
106 \end_layout
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).
113 \end_layout
115 \begin_layout Subsection
116 Running emulator
117 \end_layout
119 \begin_layout Standard
120 There is premade autoexec script called assemble.jpcrrinit that has fairly
121  reasonable defaults.
122  To use it:
123 \end_layout
125 \begin_layout LyX-Code
126 java JPCApplication -autoexec assemble.jpcrrinit
127 \end_layout
129 \begin_layout Standard
130 The script pops up settings for new emulated PC (if you want to load savestate,
131  click cancel).
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 
135 \end_layout
137 \begin_layout Subsection
138 Bootup tips
139 \end_layout
141 \begin_layout Itemize
142 Putting the game as hdd (the fourth hard disk slot) causes boot to be bit
143  faster.
144 \end_layout
146 \begin_layout Itemize
147 Some BIOS versions have 
148 \begin_inset Quotes eld
149 \end_inset
151 press F12 to select boot device
152 \begin_inset Quotes erd
153 \end_inset
156  Hit <enter> from emulated keyboard and that prompt will go away in about
157  half emulated second (it stays several emulated seconds otherwise).
159 \end_layout
161 \begin_layout Itemize
162 If game doesn't need lots of memory, hitting F5 to skip intialization files
163  is fastest.
164  If it does need more memory, run config.sys commands but not autoexec.bat.
166 \end_layout
168 \begin_layout Itemize
169 Some DOS disks have DOSIDLE with them, don't use it as it messes badly with
170  emulator.
171 \end_layout
173 \begin_layout Section
174 Making JPC-RR format images from raw images
175 \end_layout
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.
181 \end_layout
183 \begin_layout Subsection
184 Importing images from GUI:
185 \end_layout
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
192 \end_inset
194 standard geometry
195 \begin_inset Quotes erd
196 \end_inset
198  if possible, that enables geometry autodetection, which is reasonable virtually
199  all of the time it is offered.
200 \end_layout
202 \begin_layout Subsection
203 Notes
204 \end_layout
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.
211 \end_layout
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.
219 \end_layout
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.
224 \end_layout
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.
229 \end_layout
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.
236 \end_layout
238 \begin_layout Itemize
239 The geometry limits are: 2-1024 tracks per side for HDD, 1-256 tracks per
240  side for floppy.
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.
245 \end_layout
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.
250 \end_layout
252 \begin_layout Itemize
253 Note: Although the IDs are 128 bits long, they are not MD5 hashes.
255 \end_layout
257 \begin_layout Subsection
258 Importing from command line
259 \end_layout
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.
268 \end_layout
270 \begin_layout Subsubsection
271 Syntax
272 \end_layout
274 \begin_layout Standard
275 The syntax for ImageMaker when making images is:
276 \end_layout
278 \begin_layout LyX-Code
279 $ java ImageMaker <format> [<options>...] <destination> <source> <name>
280 \end_layout
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.
289  <format> is one of:
290 \end_layout
292 \begin_layout LyX-Code
293 --BIOS BIOS image (note: VGABIOS is also of this type).
294 \end_layout
296 \begin_layout LyX-Code
297 --CDROM CD-ROM image.
298 \end_layout
300 \begin_layout LyX-Code
301 --HDD=cylinders,sectors,heads Hard disk with specified geometry.
302 \end_layout
304 \begin_layout LyX-Code
305 --floppy=tracks,sectors,sides Floppy disk with specified geometry.
306 \end_layout
308 \begin_layout LyX-Code
309 --floppy160 160KiB floppy (40 tracks, 8 sectors, Single sided).
310 \end_layout
312 \begin_layout LyX-Code
313 --floppy180 180KiB floppy (40 tracks, 9 sectors, Single sided).
314 \end_layout
316 \begin_layout LyX-Code
317 --floppy320 320KiB floppy (40 tracks, 8 sectors, Double sided).
318 \end_layout
320 \begin_layout LyX-Code
321 --floppy360 360KiB floppy (40 tracks, 9 sectors, Double sided).
322 \end_layout
324 \begin_layout LyX-Code
325 --floppy410 410KiB floppy (41 tracks, 10 sectors, Double sided).
326 \end_layout
328 \begin_layout LyX-Code
329 --floppy420 420KiB floppy (42 tracks, 10 sectors, Double sided).
330 \end_layout
332 \begin_layout LyX-Code
333 --floppy720 720KiB floppy (80 tracks, 9 sectors, Double sided).
334 \end_layout
336 \begin_layout LyX-Code
337 --floppy800 800KiB floppy (80 tracks, 10 sectors, Double sided).
338 \end_layout
340 \begin_layout LyX-Code
341 --floppy820 820KiB floppy (82 tracks, 10 sectors, Double sided).
342 \end_layout
344 \begin_layout LyX-Code
345 --floppy830 830KiB floppy (83 tracks, 10 sectors, Double sided).
346 \end_layout
348 \begin_layout LyX-Code
349 --floppy880 880KiB floppy (80 tracks, 11 sectors, Double sided).
350 \end_layout
352 \begin_layout LyX-Code
353 --floppy1040 1040KiB floppy (80 tracks, 13 sectors, Double sided).
354 \end_layout
356 \begin_layout LyX-Code
357 --floppy1120 1120KiB floppy (80 tracks, 14 sectors, Double sided).
358 \end_layout
360 \begin_layout LyX-Code
361 --floppy1200 1200KiB floppy (80 tracks, 15 sectors, Double sided).
362 \end_layout
364 \begin_layout LyX-Code
365 --floppy1440 1440KiB floppy (80 tracks, 18 sectors, Double sided).
366 \end_layout
368 \begin_layout LyX-Code
369 --floppy1476 1476KiB floppy (82 tracks, 18 sectors, Double sided).
370 \end_layout
372 \begin_layout LyX-Code
373 --floppy1494 1494KiB floppy (83 tracks, 18 sectors, Double sided).
374 \end_layout
376 \begin_layout LyX-Code
377 --floppy1600 1600KiB floppy (80 tracks, 20 sectors, Double sided).
378 \end_layout
380 \begin_layout LyX-Code
381 --floppy1680 1680KiB floppy (80 tracks, 21 sectors, Double sided).
382 \end_layout
384 \begin_layout LyX-Code
385 --floppy1722 1722KiB floppy (82 tracks, 21 sectors, Double sided).
386 \end_layout
388 \begin_layout LyX-Code
389 --floppy1743 1743KiB floppy (83 tracks, 21 sectors, Double sided).
390 \end_layout
392 \begin_layout LyX-Code
393 --floppy1760 1760KiB floppy (80 tracks, 22 sectors, Double sided).
394 \end_layout
396 \begin_layout LyX-Code
397 --floppy1840 1840KiB floppy (80 tracks, 23 sectors, Double sided).
398 \end_layout
400 \begin_layout LyX-Code
401 --floppy1920 1920KiB floppy (80 tracks, 24 sectors, Double sided).
402 \end_layout
404 \begin_layout LyX-Code
405 --floppy2880 2880KiB floppy (80 tracks, 36 sectors, Double sided).
406 \end_layout
408 \begin_layout LyX-Code
409 --floppy3120 3120KiB floppy (80 tracks, 39 sectors, Double sided).
410 \end_layout
412 \begin_layout LyX-Code
413 --floppy3200 3200KiB floppy (80 tracks, 40 sectors, Double sided).
414 \end_layout
416 \begin_layout LyX-Code
417 --floppy3520 3520KiB floppy (80 tracks, 44 sectors, Double sided).
418 \end_layout
420 \begin_layout LyX-Code
421 --floppy3840 3840KiB floppy (80 tracks, 48 sectors, Double sided).
422 \end_layout
424 \begin_layout Subsubsection
425 Other options
426 \end_layout
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.
432 \end_layout
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.
438 \end_layout
440 \begin_layout Subsubsection
441 Image information
442 \end_layout
444 \begin_layout Standard
445 When invoked as:
446 \end_layout
448 \begin_layout LyX-Code
449 $ java ImageMaker <imagefile>
450 \end_layout
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).
458 \end_layout
460 \begin_layout Subsection
461 Advanced: The disk ID algorithm
462 \end_layout
464 \begin_layout Standard
465 The disk ID is calculated as:
466 \end_layout
468 \begin_layout LyX-Code
469 Skein-256-128-deprecated(<typecode>|<geometry>|<image>)
470 \end_layout
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:
478 \end_layout
480 \begin_layout Itemize
481 Changing the constants would change the IDs, which would invalidate existing
482  images
483 \end_layout
485 \begin_layout Itemize
486 This is not about cryptographic security
487 \end_layout
489 \begin_layout Itemize
490 The new constants don't improve security that much anyway.
491 \end_layout
493 \begin_layout Subsubsection
494 Floppies and HDDs
495 \end_layout
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
500  image header):
501 \end_layout
503 \begin_layout LyX-Code
504 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
505 \end_layout
507 \begin_layout LyX-Code
508 Byte 0 bits 2-5: Head count - 1.
509 \end_layout
511 \begin_layout LyX-Code
512 Byte 0 bits 6-7: Reserved, must be 0.
513 \end_layout
515 \begin_layout LyX-Code
516 Byte 1: Bits 0-7 of track count per side - 1.
517 \end_layout
519 \begin_layout LyX-Code
520 Byte 2: Sector count per track - 1.
521 \end_layout
523 \begin_layout Subsubsection
524 CD-ROM and BIOS images
525 \end_layout
527 \begin_layout Standard
528 CD-ROMs have <typecode> value 2 (single byte) and BIOS images have 3 (single
529  byte).
530  <geometry> is blank.
531 \end_layout
533 \begin_layout Subsection
534 Advanced: Disk Image format
535 \end_layout
537 \begin_layout Standard
538 The disk image consists of following parts, concatenated in this order without
539  padding:
540 \end_layout
542 \begin_layout Itemize
543 Magic
544 \end_layout
546 \begin_layout Itemize
547 Disk ID
548 \end_layout
550 \begin_layout Itemize
551 Type code
552 \end_layout
554 \begin_layout Itemize
555 Disk name length
556 \end_layout
558 \begin_layout Itemize
559 Disk name
560 \end_layout
562 \begin_layout Itemize
563 type-specific geometry/size data
564 \end_layout
566 \begin_layout Itemize
567 Actual image data
568 \end_layout
570 \begin_layout Itemize
571 Comments
572 \end_layout
574 \begin_layout Subsubsection
575 Magic
576 \end_layout
578 \begin_layout Standard
579 Magic in disk image files is following 5 bytes: 
580 \begin_inset Quotes eld
581 \end_inset
583 IMAGE
584 \begin_inset Quotes erd
585 \end_inset
588 \end_layout
590 \begin_layout Subsubsection
591 Disk ID
592 \end_layout
594 \begin_layout Standard
595 Disk ID is given as 16 bytes, encoding the 128-bit disk ID.
596 \end_layout
598 \begin_layout Subsubsection
599 Type code
600 \end_layout
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.
606 \end_layout
608 \begin_layout Subsubsection
609 Disk name length
610 \end_layout
612 \begin_layout Standard
613 Obsolete.
614  Disk name length is given as two-byte big-endian value.
615  New images should have 0 here.
616 \end_layout
618 \begin_layout Subsubsection
619 Disk name
620 \end_layout
622 \begin_layout Standard
623 Ignored.
624  Name field is there for backward compatiblity.
625  Disk name length gives length of this field in bytes.
626 \end_layout
628 \begin_layout Subsubsection
629 Type-specific geometry/size data (floppies and HDDs)
630 \end_layout
632 \begin_layout Standard
633 Floppies and HDDs have 3-byte geometry data:
634 \end_layout
636 \begin_layout LyX-Code
637 Byte 0 bits 0-1: Bits 8-9 of track count per side - 1.
638 \end_layout
640 \begin_layout LyX-Code
641 Byte 0 bits 2-5: Head count - 1.
642 \end_layout
644 \begin_layout LyX-Code
645 Byte 0 bits 6-7: Reserved, must be 0.
646 \end_layout
648 \begin_layout LyX-Code
649 Byte 1: Bits 0-7 of track count per side - 1.
650 \end_layout
652 \begin_layout LyX-Code
653 Byte 2: Sector count per track - 1.
654 \end_layout
656 \begin_layout Subsubsection
657 Type specific-geometry/size data (CD-ROMs)
658 \end_layout
660 \begin_layout Standard
661 CD-ROMs have 4-byte big-endian sector (512 bytes!) count.
662 \end_layout
664 \begin_layout Subsubsection
665 Type specific-geometry/size data (BIOS images)
666 \end_layout
668 \begin_layout Standard
669 BIOS images have 4-byte big-endian byte (not sector or block) count.
670 \end_layout
672 \begin_layout Subsubsection
673 Actual image data (floppy/HDD)
674 \end_layout
676 \begin_layout Standard
677 Floppy or HDD imagedata consists of following subparts:
678 \end_layout
680 \begin_layout Itemize
681 Storage method
682 \end_layout
684 \begin_layout Itemize
685 Sectors present
686 \end_layout
688 \begin_layout Itemize
689 Image data header
690 \end_layout
692 \begin_layout Itemize
693 Image data
694 \end_layout
696 \begin_layout Standard
697 Storage method is single byte.
698  Sectors present gives number of last nonzero sector + 1 (zero if image
699  is all zeroes)
700 \end_layout
702 \begin_layout Subsubsection
703 Floppy/HDD storage method 0: Raw storage
704 \end_layout
706 \begin_layout Standard
707 This storage method has empty header.
708  Image data is raw dump of first sectors present sectors.
709 \end_layout
711 \begin_layout Subsubsection
712 Floppy/HDD storage method 1: Sectormap
713 \end_layout
715 \begin_layout Standard
716 Image data header contains bitfield with just enough bytes to have one bit
717  per present sector.
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.
723 \end_layout
725 \begin_layout Standard
726 Image data contains dumps of all present sectors in order of increasing
727  sector number.
728 \end_layout
730 \begin_layout Subsubsection
731 Floppy/HDD storage method 2: Extent first sector zero
732 \end_layout
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.
740 \end_layout
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.
749 \end_layout
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.
754 \end_layout
756 \begin_layout Subsubsection
757 Floppy/HDD storage method 3: Extent first sector nonzero
758 \end_layout
760 \begin_layout Standard
761 Same as storage method 2 but first block is nonzero sector block.
762 \end_layout
764 \begin_layout Subsubsection
765 Actual image data (CD-ROMs and BIOS images)
766 \end_layout
768 \begin_layout Standard
769 These store image data raw.
770  The amount of data is specified by sector/byte count.
771 \end_layout
773 \begin_layout Subsubsection
774 Comments
775 \end_layout
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.
782 \end_layout
784 \begin_layout Section
785 The actual emulator
786 \end_layout
788 \begin_layout Standard
789 The actual emulator is invoked as:
790 \end_layout
792 \begin_layout LyX-Code
793 $ java JPCApplication <options>...
794 \end_layout
796 \begin_layout Standard
797 The valid options are:
798 \end_layout
800 \begin_layout LyX-Code
801 -autoexec <script> Execute contents of specified file as commands when starting
802  up.
803 \end_layout
805 \begin_layout LyX-Code
806 -noautoexec Don't run autoexec files.
807 \end_layout
809 \begin_layout LyX-Code
810 -norenames Copy&Delete files instead of renaming.
811  Mainly meant for debugging copy&delte code.
812 \end_layout
814 \begin_layout LyX-Code
815 -imagemaker <options> Run in image maker mode (run with parameter '-imagemaker'
816  with no further parameters for help)
817 \end_layout
819 \begin_layout Standard
820 If no arguments are given, defaults of autoexec file of 'assemble.jpcrrinit'
821  are used.
822 \end_layout
824 \begin_layout Subsection
825 Command line
826 \end_layout
828 \begin_layout Standard
829 When emulator is started, command line comes up.
830  Following commands are known:
831 \end_layout
833 \begin_layout Itemize
834 'exit': exit immediately.
835  Dumps in progress are gracefully closed.
836 \end_layout
838 \begin_layout Itemize
839 'kill': Save stack traces and kill the emulator (for debugging only).
840  Any dumps in progress are likely corrupted.
841 \end_layout
843 \begin_layout Itemize
844 'library <library>': set library directory to <library>.
845 \end_layout
847 \begin_layout Itemize
848 'load <plugin>': Load plugin (no arguments)
849 \end_layout
851 \begin_layout Itemize
852 'load <plugin>(<arguments>)': load plugin with arguments.
853 \end_layout
855 \begin_layout Itemize
856 'command <command> [<arguments>...]': Invoke command via external command interface.
857 \end_layout
859 \begin_layout Itemize
860 'call<command> [<arguments>...]': Invoke command via external command interface
861  and print return values.
862 \end_layout
864 \begin_layout Itemize
865 'lsdisks [<filename>]' Print listing of all known disks.
866  If <filename> is specified, save output to specified file.
867 \end_layout
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.
873 \end_layout
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.
880 \end_layout
882 \begin_layout Subsection
883 PC settings dialog notes
884 \end_layout
886 \begin_layout Itemize
887 CPU divider base frequency before division is 1GHz.
888 \end_layout
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.
895 \end_layout
897 \begin_layout Itemize
898 CD-ROM and hdc are mutually exclusive
899 \end_layout
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.
905 \end_layout
907 \begin_layout Itemize
908 Setting boot device doesn't work with some BIOS versions.
909  Those versions prompt the boot device anyway.
910 \end_layout
912 \begin_layout Subsection
913 Audio output channels
914 \end_layout
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
919 al.PCSpeaker-0'.
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
922  starting from zero.
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.
926 \end_layout
928 \begin_layout Subsection
929 Plugins
930 \end_layout
932 \begin_layout Standard
933 Plugins actually execute the tasks of the emulator.
934  They can be loaded using 
935 \begin_inset Quotes eld
936 \end_inset
938 load <plugin>
939 \begin_inset Quotes erd
940 \end_inset
942  or 'load <plugin>(<arguments>)
943 \begin_inset Quotes erd
944 \end_inset
946  from command line.
947 \end_layout
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.
953 \end_layout
955 \begin_layout Standard
956 If no plugin used requires GUI, then the emulator can be run without having
957  GUI available.
958 \end_layout
960 \begin_layout Subsubsection
961 plugin: org.jpc.plugins.PCControl
962 \end_layout
964 \begin_layout Standard
965 Takes optionally 'extramenu=<file>' and 'uncompressedsave=1', requires and
966  uses GUI.
967 \end_layout
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.
976 \end_layout
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).
982 \end_layout
984 \begin_layout Subsubsection
985 plugin: org.jpc.plugins.PCRunner
986 \end_layout
988 \begin_layout Standard
989 Takes 'movie=<file>' as argument and optionally 'stoptime=<time>' Does not
990  require nor use GUI.
991 \end_layout
993 \begin_layout Standard
994 Loads PC from savestate and just runs it.
995  CTRL+C to quit.
996  Also automatically quits once stoptime is reached.
997 \end_layout
999 \begin_layout Subsubsection
1000 plugin: org.jpc.plugins.PCMonitor
1001 \end_layout
1003 \begin_layout Standard
1004 No arguments, requires and uses GUI.
1005 \end_layout
1007 \begin_layout Standard
1008 VGA monitor for emulated PC.
1009 \end_layout
1011 \begin_layout Subsubsection
1012 plugin: org.jpc.plugins.VirtualKeyboard
1013 \end_layout
1015 \begin_layout Standard
1016 No arguments, requires and uses GUI.
1017 \end_layout
1019 \begin_layout Standard
1020 On-screen keyboard for emulated PC.
1021 \end_layout
1023 \begin_layout Subsubsection
1024 plugin: org.jpc.plugins.PCStartStopTest
1025 \end_layout
1027 \begin_layout Standard
1028 No arguments, requires and uses GUI.
1029 \end_layout
1031 \begin_layout Standard
1032 Small plugin testing remote PC start/stop.
1033  Also supports sending some common keypresses.
1034 \end_layout
1036 \begin_layout Subsubsection
1037 plugin: org.jpc.plugins.RAWVideoDumper
1038 \end_layout
1040 \begin_layout Standard
1041 Takes 'rawoutput=<file>' as argument.
1042  Does not require nor use GUI.
1043 \end_layout
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.
1058 \end_layout
1060 \begin_layout Standard
1061 Dumping to pipe is supported.
1062 \end_layout
1064 \begin_layout Subsubsection
1065 plugin: org.jpc.plugins.RAWAudioDumper
1066 \end_layout
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.
1072 \end_layout
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
1079  time delta by 
1080 \begin_inset Formula $2^{32}-1$
1081 \end_inset
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
1087  be smaller than 
1088 \begin_inset Formula $2^{32}-1$
1089 \end_inset
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
1094  the audio by.
1095 \end_layout
1097 \begin_layout Subsubsection
1098 plugin: org.jpc.plugins.LuaPlugin
1099 \end_layout
1101 \begin_layout Standard
1102 Takes 'kernel=<name of lua kernel file>', other parameters are passed to
1103  kernel, requires and uses GUI.
1104 \end_layout
1106 \begin_layout Standard
1107 Lua VM for executing scripts.
1108 \end_layout
1110 \begin_layout Subsubsection
1111 plugin: org.jpc.plugins.JoystickInput
1112 \end_layout
1114 \begin_layout Standard
1115 No parameters.
1116  Displays window for sending joystick input.
1117 \end_layout
1119 \begin_layout Section
1120 Modules
1121 \end_layout
1123 \begin_layout Subsection
1124 org.jpc.modules.Joystick:
1125 \end_layout
1127 \begin_layout Itemize
1128 Arguments: none.
1129 \end_layout
1131 \begin_layout Itemize
1132 Resources: I/O port 0x201
1133 \end_layout
1135 \begin_layout Standard
1136 Emulates joystick game port.
1137 \end_layout
1139 \begin_layout Subsection
1140 org.jpc.modules.SoundCard
1141 \end_layout
1143 \begin_layout Itemize
1144 Arguments: Optional resources specification
1145 \end_layout
1147 \begin_layout Itemize
1148 Resources (defaults): I/O port 0x220-0x22F, IRQ 5, DMA 1, DMA 5
1149 \end_layout
1151 \begin_layout Standard
1152 Emulates Sound card.
1153 \end_layout
1155 \begin_layout Subsection
1156 org.jpc.modules.GMIDIInterface
1157 \end_layout
1159 \begin_layout Itemize
1160 Arguments: Optional resources specification
1161 \end_layout
1163 \begin_layout Itemize
1164 Resources (defaults): I/O port 0x330-0x331, IRQ 9
1165 \end_layout
1167 \begin_layout Standard
1168 Emulates General MIDI interface.
1169 \end_layout
1171 \begin_layout Subsection
1172 org.jpc.modules.FMCard
1173 \end_layout
1175 \begin_layout Itemize
1176 Arguments: Optional resources specification
1177 \end_layout
1179 \begin_layout Itemize
1180 Resources (defaults): I/O port 0x338-0x33B
1181 \end_layout
1183 \begin_layout Standard
1184 Emulates FM card.
1185 \end_layout
1187 \begin_layout Subsection
1188 org.jpc.modules.BasicFPU:
1189 \end_layout
1191 \begin_layout Itemize
1192 Arguments: none.
1193 \end_layout
1195 \begin_layout Itemize
1196 Resources: None.
1197 \end_layout
1199 \begin_layout Standard
1200 Crude FPU (x87) emulator.
1201 \end_layout
1203 \begin_layout Section
1204 Hacks
1205 \end_layout
1207 \begin_layout Standard
1208 Hacks are saved to savestates but not movies.
1209 \end_layout
1211 \begin_layout Subsection
1212 NO_FPU
1213 \end_layout
1215 \begin_layout Standard
1216 Force bit 1 of physical address 0x0410 to zero, signaling that the system
1217  has no FPU.
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
1221 \end_inset
1223 present
1224 \begin_inset Quotes erd
1225 \end_inset
1228  Try this if game startup hangs with lots of trying to use FPU but not present
1229  errors.
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).
1233 \end_layout
1235 \begin_layout Subsection
1236 VGA_DRAW
1237 \end_layout
1239 \begin_layout Standard
1240 Update basic VGA parameters before vretrace, not after it.
1241  Some games (e.g.
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).
1246 \end_layout
1248 \begin_layout Section
1249 Some error messages and explanations
1250 \end_layout
1252 \begin_layout Itemize
1253 <filename> is Not a valid image file
1254 \end_layout
1256 \begin_layout Itemize
1257 <filename> is not image file
1258 \end_layout
1260 \begin_layout Itemize
1261 <filename> claims to be floppy with illegal geometry: <x> tracks, <y> sides
1262  and <z> sectors.
1263 \end_layout
1265 \begin_layout Itemize
1266 <filename> claims to be HDD with illegal geometry: <x> tracks, <y> sides
1267  and <z> sectors.
1268 \end_layout
1270 \begin_layout Itemize
1271 Can't read disk image sector map.
1272 \end_layout
1274 \begin_layout Itemize
1275 Can't read disk image extent.
1276 \end_layout
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.
1281 \end_layout
1283 \begin_layout Itemize
1284 <filename> is image of unknown type.
1285 \end_layout
1287 \begin_layout Itemize
1288 <filename> has unrecognized geometry <x> <y> <z>
1289 \end_layout
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.
1294 \end_layout
1296 \begin_layout Itemize
1297 Invalid format specifier <something>.
1298 \end_layout
1300 \begin_layout Itemize
1301 Invalid syntax of --floppy= or --HDD= option.
1302 \end_layout
1304 \begin_layout Itemize
1305 Invalid format specifier/option <something>.
1306 \end_layout
1308 \begin_layout Standard
1309 Invalid option or format specifier was given.
1310  Check for typos.
1311 \end_layout
1313 \begin_layout Itemize
1314 java ImageMaker [<options>...] <format> <destination> <source> <diskname>
1315 \end_layout
1317 \begin_layout Standard
1318 Check syntax of command.
1319  Especially that diskname is present!
1320 \end_layout
1322 \begin_layout Itemize
1323 The image has <nnn> sectors while it should have <yyy> according to selected
1324  geometry.
1325 \end_layout
1327 \begin_layout Itemize
1328 Raw image file length not divisible by 512.
1329 \end_layout
1331 \begin_layout Itemize
1332 Trying to read sector out of range.
1333 \end_layout
1335 \begin_layout Standard
1336 The selected geometry is wrong or raw image is incomplete.
1337 \end_layout
1339 \begin_layout Itemize
1340 Invalid disk name (Should not happen!).
1341 \end_layout
1343 \begin_layout Itemize
1344 Invalid geometry to be written.
1345 \end_layout
1347 \begin_layout Standard
1348 This is a very likely a bug in program.
1349 \end_layout
1351 \begin_layout Itemize
1352 What the heck <filename> is? It's not regular file nor directory.
1353 \end_layout
1355 \begin_layout Standard
1356 That sort of file can't be used as input for image making, or the file just
1357  doesn't exist.
1358 \end_layout
1360 \begin_layout Itemize
1361 BIOS images can only be made out of regular files.
1362 \end_layout
1364 \begin_layout Itemize
1365 CD images can only be made out of regular files.
1366 \end_layout
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.
1371 \end_layout
1373 \begin_layout Itemize
1374 Can't read raw bios image file.
1375 \end_layout
1377 \begin_layout Itemize
1378 Can't read sector <nnn> from image.
1379 \end_layout
1381 \begin_layout Standard
1382 Reading the raw image file failed for some reason.
1383 \end_layout
1385 \begin_layout Itemize
1386 Bad library line: "<something>".
1387  Ignored.
1388 \end_layout
1390 \begin_layout Standard
1391 Syntax error in image library.
1392 \end_layout
1394 \begin_layout Itemize
1395 Removing image <something> a.k.a.
1396  "<something>" as it no longer exists.
1397 \end_layout
1399 \begin_layout Standard
1400 The image file no longer exists so it gets removed from library.
1401 \end_layout
1403 \begin_layout Itemize
1404 Removing image <something> a.k.a.
1405  "<something>" due to <some> conflict.
1406 \end_layout
1408 \begin_layout Standard
1409 Image library code killed some image from library due to some kind of conflict
1410  with image being added.
1411 \end_layout
1413 \begin_layout Itemize
1414 Too much data to fit into given space.
1415 \end_layout
1417 \begin_layout Standard
1418 The tree you gave contains takes just too much space to fit into disk of
1419  this size.
1420 \end_layout
1422 \begin_layout Section
1423 Advanced: Savestate/movie format
1424 \end_layout
1426 \begin_layout Subsection
1427 Special character classes
1428 \end_layout
1430 \begin_layout Subsubsection
1431 SPACE
1432 \end_layout
1434 \begin_layout Standard
1435 Following Unicode codepoints (encoded as UTF-8) are interpretted as space
1436  characters:
1437 \end_layout
1439 \begin_layout Itemize
1440 Codepoints 0x20, and 0x09.
1441 \end_layout
1443 \begin_layout Itemize
1444 Codepoints 0x1680, 0x180E, 0x2028, 0x205F and 0x3000
1445 \end_layout
1447 \begin_layout Itemize
1448 Codepoints 0x2000-0x200A.
1449 \end_layout
1451 \begin_layout Subsubsection
1452 LINEFEED
1453 \end_layout
1455 \begin_layout Standard
1456 Following byte sequences are interpretted as linefeeds (line change):
1457 \end_layout
1459 \begin_layout Itemize
1460 Byte 0x0A (UTF-8 encoded codepoint 0x0A)
1461 \end_layout
1463 \begin_layout Itemize
1464 Byte 0x0D (UTF-8 encoded codepoint 0x0D)
1465 \end_layout
1467 \begin_layout Itemize
1468 Byte 0x1C (UTF-8 encoded codepoint 0x1C)
1469 \end_layout
1471 \begin_layout Itemize
1472 Byte 0x1D (UTF-8 encoded codepoint 0x1D)
1473 \end_layout
1475 \begin_layout Itemize
1476 Byte 0x1E (UTF-8 encoded codepoint 0x1E)
1477 \end_layout
1479 \begin_layout Itemize
1480 Bytes 0xC2 0x85 (UTF-8 for unicode control character NL, codepoint 0x85)
1481 \end_layout
1483 \begin_layout Itemize
1484 Bytes 0xE2 0x80 0xA9 (UTF-8 encoded codepoint 0x2029)
1485 \end_layout
1487 \begin_layout Subsection
1488 JRSR archive
1489 \end_layout
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.
1495  It is 
1496 \begin_inset Quotes eld
1497 \end_inset
1499 JRSR
1500 \begin_inset Quotes erd
1501 \end_inset
1503  followed by LINEFEED character There are four kinds of lines after that
1504  (lines are terminated by LINEFEED byte/bytes):
1505 \end_layout
1507 \begin_layout Itemize
1508 Start member
1509 \end_layout
1511 \begin_layout Itemize
1512 Member line
1513 \end_layout
1515 \begin_layout Itemize
1516 End member
1517 \end_layout
1519 \begin_layout Itemize
1520 Blank line
1521 \end_layout
1523 \begin_layout Standard
1524 Sequencing rules are as follows: Start member is allowed anywhere (after
1525  magic).
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.
1530 \end_layout
1532 \begin_layout Subsubsection
1533 Start member
1534 \end_layout
1536 \begin_layout Standard
1537 Start member line is given as 
1538 \begin_inset Quotes eld
1539 \end_inset
1541 !BEGIN
1542 \begin_inset Quotes erd
1543 \end_inset
1545  <SPACE>+ <membername> <LINEFEED>.
1546  <SPACE>+ any number of SPACE characters at least one and <LINEFEED> is
1547  LINEFEED chacter.
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.
1552 \end_layout
1554 \begin_layout Subsubsection
1555 Member line:
1556 \end_layout
1558 \begin_layout Standard
1559 Member line is given as 
1560 \begin_inset Quotes eld
1561 \end_inset
1564 \begin_inset Quotes erd
1565 \end_inset
1567 <content><LINEFEED>.
1568  It gives another line for member contents.
1569  <content> is passed raw to layers above (followed by line termination)
1570 \end_layout
1572 \begin_layout Subsubsection
1573 End member
1574 \end_layout
1576 \begin_layout Standard
1577 End member line is given as 
1578 \begin_inset Quotes eld
1579 \end_inset
1581 !END
1582 \begin_inset Quotes erd
1583 \end_inset
1585 <LINEFEED>.
1586  It ends the current member.
1587  The following line can only be start member line or file may end.
1588 \end_layout
1590 \begin_layout Subsubsection
1591 Blank line
1592 \end_layout
1594 \begin_layout Standard
1595 Blank line is given as <LINEFEED>.
1596  Lines like that are ignored.
1597 \end_layout
1599 \begin_layout Subsection
1600 Four-to-Five encoding
1601 \end_layout
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
1609  of blocks.
1610 \end_layout
1612 \begin_layout Subsubsection
1613 End stream block
1614 \end_layout
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.
1620 \end_layout
1622 \begin_layout Subsubsection
1623 Other four block types
1624 \end_layout
1626 \begin_layout Standard
1627 Other four block types take the value to be encoded, read it as big-endian
1628  value.
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):
1632 \end_layout
1634 \begin_layout Standard
1635 \begin_inset Tabular
1636 <lyxtabular version="3" rows="5" columns="6">
1637 <features>
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">
1644 <row>
1645 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1646 \begin_inset Text
1648 \begin_layout Plain Layout
1649 To encode
1650 \end_layout
1652 \end_inset
1653 </cell>
1654 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1655 \begin_inset Text
1657 \begin_layout Plain Layout
1658 1st char.
1659 \end_layout
1661 \end_inset
1662 </cell>
1663 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1664 \begin_inset Text
1666 \begin_layout Plain Layout
1667 2nd char.
1668 \end_layout
1670 \end_inset
1671 </cell>
1672 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1673 \begin_inset Text
1675 \begin_layout Plain Layout
1676 3rd char.
1677 \end_layout
1679 \end_inset
1680 </cell>
1681 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1682 \begin_inset Text
1684 \begin_layout Plain Layout
1685 4th char.
1686 \end_layout
1688 \end_inset
1689 </cell>
1690 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1691 \begin_inset Text
1693 \begin_layout Plain Layout
1694 5th char.
1695 \end_layout
1697 \end_inset
1698 </cell>
1699 </row>
1700 <row>
1701 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1702 \begin_inset Text
1704 \begin_layout Plain Layout
1705 1 byte
1706 \end_layout
1708 \end_inset
1709 </cell>
1710 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1711 \begin_inset Text
1713 \begin_layout Plain Layout
1715 \end_layout
1717 \end_inset
1718 </cell>
1719 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1720 \begin_inset Text
1722 \begin_layout Plain Layout
1724 \end_layout
1726 \end_inset
1727 </cell>
1728 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1729 \begin_inset Text
1731 \begin_layout Plain Layout
1733 \end_layout
1735 \end_inset
1736 </cell>
1737 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1738 \begin_inset Text
1740 \begin_layout Plain Layout
1742 \end_layout
1744 \end_inset
1745 </cell>
1746 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1747 \begin_inset Text
1749 \begin_layout Plain Layout
1751 \end_layout
1753 \end_inset
1754 </cell>
1755 </row>
1756 <row>
1757 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1758 \begin_inset Text
1760 \begin_layout Plain Layout
1761 2 bytes
1762 \end_layout
1764 \end_inset
1765 </cell>
1766 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1767 \begin_inset Text
1769 \begin_layout Plain Layout
1771 \end_layout
1773 \end_inset
1774 </cell>
1775 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1776 \begin_inset Text
1778 \begin_layout Plain Layout
1780 \end_layout
1782 \end_inset
1783 </cell>
1784 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1785 \begin_inset Text
1787 \begin_layout Plain Layout
1789 \end_layout
1791 \end_inset
1792 </cell>
1793 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1794 \begin_inset Text
1796 \begin_layout Plain Layout
1798 \end_layout
1800 \end_inset
1801 </cell>
1802 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1803 \begin_inset Text
1805 \begin_layout Plain Layout
1807 \end_layout
1809 \end_inset
1810 </cell>
1811 </row>
1812 <row>
1813 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1814 \begin_inset Text
1816 \begin_layout Plain Layout
1817 3 bytes
1818 \end_layout
1820 \end_inset
1821 </cell>
1822 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1823 \begin_inset Text
1825 \begin_layout Plain Layout
1827 \end_layout
1829 \end_inset
1830 </cell>
1831 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1832 \begin_inset Text
1834 \begin_layout Plain Layout
1836 \end_layout
1838 \end_inset
1839 </cell>
1840 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1841 \begin_inset Text
1843 \begin_layout Plain Layout
1845 \end_layout
1847 \end_inset
1848 </cell>
1849 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1850 \begin_inset Text
1852 \begin_layout Plain Layout
1854 \end_layout
1856 \end_inset
1857 </cell>
1858 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1859 \begin_inset Text
1861 \begin_layout Plain Layout
1863 \end_layout
1865 \end_inset
1866 </cell>
1867 </row>
1868 <row>
1869 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1870 \begin_inset Text
1872 \begin_layout Plain Layout
1873 4 bytes
1874 \end_layout
1876 \end_inset
1877 </cell>
1878 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1879 \begin_inset Text
1881 \begin_layout Plain Layout
1883 \end_layout
1885 \end_inset
1886 </cell>
1887 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1888 \begin_inset Text
1890 \begin_layout Plain Layout
1892 \end_layout
1894 \end_inset
1895 </cell>
1896 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1897 \begin_inset Text
1899 \begin_layout Plain Layout
1901 \end_layout
1903 \end_inset
1904 </cell>
1905 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1906 \begin_inset Text
1908 \begin_layout Plain Layout
1910 \end_layout
1912 \end_inset
1913 </cell>
1914 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1915 \begin_inset Text
1917 \begin_layout Plain Layout
1919 \end_layout
1921 \end_inset
1922 </cell>
1923 </row>
1924 </lyxtabular>
1926 \end_inset
1929 \end_layout
1931 \begin_layout Standard
1932 Blocks which encode values greater than what is possible for value of that
1933  length are fatal errors.
1935 \end_layout
1937 \begin_layout Subsection
1938 Line component encoing
1939 \end_layout
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.
1947 \end_layout
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:
1953 \end_layout
1955 \begin_layout Itemize
1956 Codepoint of '('.
1957  The depth is read pre-increment.
1958 \end_layout
1960 \begin_layout Itemize
1961 Codepoint of ')'.
1962  The depth is read post-decrement.
1963 \end_layout
1965 \begin_layout Itemize
1966 Any SPACE character
1967 \end_layout
1969 \begin_layout Standard
1970 The following characters are special:
1971 \end_layout
1973 \begin_layout Itemize
1974 '('.
1975  Increments depth by 1 if not escaped (and appears in component).
1976 \end_layout
1978 \begin_layout Itemize
1979 ')'.
1980  Decrements depth by 1 if not escaped (and appears in component).
1981  Depth going negative is an error.
1982 \end_layout
1984 \begin_layout Itemize
1986 \backslash
1988  Next character is interpretted as literal.
1989  Error if at end of line.
1990 \end_layout
1992 \begin_layout Standard
1993 Otherwise, characters are interpretted as literals and appear in components.
1994  Depth must be zero at end of line.
1995 \end_layout
1997 \begin_layout Subsection
1998 Header section:
1999 \end_layout
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
2005  are arguments.
2006  How many parameters are expected is dependent on what header it is:
2007 \end_layout
2009 \begin_layout Subsubsection
2010 PROJECTID header:
2011 \end_layout
2013 \begin_layout Itemize
2014 Header name: "PROJECTID"
2015 \end_layout
2017 \begin_layout Itemize
2018 Components: 2
2019 \end_layout
2021 \begin_layout Itemize
2022 Argument #1: <project-id-string>
2023 \end_layout
2025 \begin_layout Itemize
2026 Mandatory: Yes
2027 \end_layout
2029 \begin_layout Standard
2030 Gives project ID.
2031  Project ID is generated when PC is assembled and is then preserved in save
2032  states.
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.
2036 \end_layout
2038 \begin_layout Subsubsection
2039 SAVESTATEID header:
2040 \end_layout
2042 \begin_layout Itemize
2043 Header name: "SAVESTATEID"
2044 \end_layout
2046 \begin_layout Itemize
2047 Components: 2
2048 \end_layout
2050 \begin_layout Itemize
2051 Argument #1: <savestate-id-string>
2052 \end_layout
2054 \begin_layout Itemize
2055 Mandatory: No
2056 \end_layout
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).
2066 \end_layout
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
2071  left off.
2072 \end_layout
2074 \begin_layout Subsubsection
2075 RERECORDS header:
2076 \end_layout
2078 \begin_layout Itemize
2079 Header name: "RERECORDS"
2080 \end_layout
2082 \begin_layout Itemize
2083 Components: 2
2084 \end_layout
2086 \begin_layout Itemize
2087 Argument #1: <rerecords>
2088 \end_layout
2090 \begin_layout Itemize
2091 Mandatory: Yes
2092 \end_layout
2094 \begin_layout Standard
2095 Gives rerecord count.
2096  PC assembly (except when loading save state) initializes current rerecord
2097  count to zero.
2098  Must be non-negative and decimal number using ASCII digit characters.
2099 \end_layout
2101 \begin_layout LyX-Code
2102 On loading save state:
2103 \end_layout
2105 \begin_layout LyX-Code
2106 1) If project ID matches with previous:
2107 \end_layout
2109 \begin_layout LyX-Code
2110 1a) If loaded rerecord count is larger or equal to current rerecord count:
2111 \end_layout
2113 \begin_layout LyX-Code
2114 1a-a) Current rerecord count is loaded rerecord count + 1.
2115 \end_layout
2117 \begin_layout LyX-Code
2118 1b) Otherwise
2119 \end_layout
2121 \begin_layout LyX-Code
2122 1b-a) Current rerecord count increments by 1.
2123 \end_layout
2125 \begin_layout LyX-Code
2126 2) Otherwise
2127 \end_layout
2129 \begin_layout LyX-Code
2130 2a) Current rerecord count is loaded rerecord count + 1.
2131 \end_layout
2133 \begin_layout Standard
2134 The current rerecord count at time of save is saved to save state.
2135 \end_layout
2137 \begin_layout Subsubsection
2138 SYSTEM header:
2139 \end_layout
2141 \begin_layout Itemize
2142 Header name: "SYSTEM"
2143 \end_layout
2145 \begin_layout Itemize
2146 Components: 2
2147 \end_layout
2149 \begin_layout Itemize
2150 Argument #1: <system-id-string>
2151 \end_layout
2153 \begin_layout Itemize
2154 Mandatory: No
2155 \end_layout
2157 \begin_layout Standard
2158 Gives system this movie/save is for.
2159  The only currently recognized value is 
2160 \begin_inset Quotes eld
2161 \end_inset
2163 PC-JPC-RR-r10
2164 \begin_inset Quotes erd
2165 \end_inset
2167  (if this header is absent, use default system).
2168  Invalid values trigger error on load time.
2169 \end_layout
2171 \begin_layout Subsubsection
2172 AUTHORS header:
2173 \end_layout
2175 \begin_layout Itemize
2176 Header name: "AUTHORS"
2177 \end_layout
2179 \begin_layout Itemize
2180 Components: 2 or more
2181 \end_layout
2183 \begin_layout Itemize
2184 Arguments: free form
2185 \end_layout
2187 \begin_layout Itemize
2188 Mandatory: No
2189 \end_layout
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.
2195 \end_layout
2197 \begin_layout Subsubsection
2198 AUTHORNICKS header:
2199 \end_layout
2201 \begin_layout Itemize
2202 Header name: "AUTHORNICKS"
2203 \end_layout
2205 \begin_layout Itemize
2206 Components: 2 or more
2207 \end_layout
2209 \begin_layout Itemize
2210 Arguments: free form
2211 \end_layout
2213 \begin_layout Itemize
2214 Mandatory: No
2215 \end_layout
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.
2221 \end_layout
2223 \begin_layout Subsubsection
2224 AUTHORFULL header:
2225 \end_layout
2227 \begin_layout Itemize
2228 Header name: "AUTHORFULL"
2229 \end_layout
2231 \begin_layout Itemize
2232 Components: 3
2233 \end_layout
2235 \begin_layout Itemize
2236 Arguments: free form
2237 \end_layout
2239 \begin_layout Itemize
2240 Mandatory: No
2241 \end_layout
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.
2247 \end_layout
2249 \begin_layout Subsubsection
2250 COMMENT header:
2251 \end_layout
2253 \begin_layout Itemize
2254 Header name: "COMMENT"
2255 \end_layout
2257 \begin_layout Itemize
2258 Components: 2 or more
2259 \end_layout
2261 \begin_layout Itemize
2262 Arguments: free form
2263 \end_layout
2265 \begin_layout Itemize
2266 Mandatory: No
2267 \end_layout
2269 \begin_layout Standard
2270 Various kinds of free form data.
2271  Not parsed further by emulator.
2272 \end_layout
2274 \begin_layout Subsection
2275 Initialization segment:
2276 \end_layout
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).
2282 \end_layout
2284 \begin_layout Standard
2285 Following parameters are used (space separates components):
2286 \end_layout
2288 \begin_layout LyX-Code
2289 "BIOS" <id>
2290 \end_layout
2292 \begin_layout Standard
2293 Gives Image ID of main system BIOS (mandatory)
2294 \end_layout
2296 \begin_layout LyX-Code
2297 "VGABIOS" <id>
2298 \end_layout
2300 \begin_layout Standard
2301 Gives Image ID of VGA BIOS (mandatory).
2302 \end_layout
2304 \begin_layout LyX-Code
2305 "HDA" <id>
2306 \end_layout
2308 \begin_layout Standard
2309 Gives Image ID of hda.
2310  Present only if system has hard disk hda.
2311 \end_layout
2313 \begin_layout LyX-Code
2314 "HDB" <id>
2315 \end_layout
2317 \begin_layout Standard
2318 Gives Image ID of hdb.
2319  Present only if system has hard disk hdb.
2320 \end_layout
2322 \begin_layout LyX-Code
2323 "HDC" <id>
2324 \end_layout
2326 \begin_layout Standard
2327 Gives Image ID of hdc.
2328  Present only if system has hard disk hdc.
2329 \end_layout
2331 \begin_layout LyX-Code
2332 "HDD" <id>
2333 \end_layout
2335 \begin_layout Standard
2336 Gives Image ID of hdd.
2337  Present only if system has hard disk hdd.
2338 \end_layout
2340 \begin_layout LyX-Code
2341 "DISK" <num> <id>
2342 \end_layout
2344 \begin_layout Standard
2345 Gives Image ID of disk in slot <num>.
2346  Slot number must be non-negative.
2347 \end_layout
2349 \begin_layout LyX-Code
2350 \begin_inset Quotes eld
2351 \end_inset
2353 DISKNAME
2354 \begin_inset Quotes erd
2355 \end_inset
2357  <num> <name>
2358 \end_layout
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
2365 \end_inset
2367 DISK
2368 \begin_inset Quotes erd
2369 \end_inset
2372 \end_layout
2374 \begin_layout LyX-Code
2375 "FDA" <num>
2376 \end_layout
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.
2382 \end_layout
2384 \begin_layout LyX-Code
2385 "FDB" <num>
2386 \end_layout
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.
2392 \end_layout
2394 \begin_layout LyX-Code
2395 "CDROM" <num>
2396 \end_layout
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.
2403 \end_layout
2405 \begin_layout LyX-Code
2406 "INITIALTIME" <time>
2407 \end_layout
2409 \begin_layout Standard
2410 Number of milliseconds since Unix epoch to system start up time.
2411  Allowed range:
2412 \end_layout
2414 \begin_layout Standard
2415 0-4102444799999.
2416  Mandatory.
2417 \end_layout
2419 \begin_layout LyX-Code
2420 "CPUDIVIDER" <divider>
2421 \end_layout
2423 \begin_layout Standard
2424 Set CPU frequency divider (dividing the 1GHz master clock).
2425  Allowed range is 1-256.
2426  Mandatory.
2427 \end_layout
2429 \begin_layout LyX-Code
2430 "MEMORYSIZE" <pages>
2431 \end_layout
2433 \begin_layout Standard
2434 Number of 4KiB pages of RAM memory.
2435  Allowed range 256-262144.
2436  Mandatory.
2437 \end_layout
2439 \begin_layout LyX-Code
2440 "BOOT" <device>
2441 \end_layout
2443 \begin_layout Standard
2444 Set boot device.
2445  Valid devices are "FLOPPY" (boot from fda), "HDD" (boot from hda) and "CDROM"
2446  (boot from CD).
2447 \end_layout
2449 \begin_layout LyX-Code
2450 "LOADMODULEA" <module> <parameters>
2451 \end_layout
2453 \begin_layout Standard
2454 Load module <module> with parameters <parameters>.
2455 \end_layout
2457 \begin_layout LyX-Code
2458 "LOADMODULE" <module>
2459 \end_layout
2461 \begin_layout Standard
2462 Load module <module> with no parameters
2463 \end_layout
2465 \begin_layout LyX-Code
2466 \begin_inset Quotes eld
2467 \end_inset
2470 \begin_inset Quotes erd
2471 \end_inset
2473  <fpu>
2474 \end_layout
2476 \begin_layout Standard
2477 Use class <fpu> as FPU emulator.
2478 \end_layout
2480 \begin_layout LyX-Code
2481 \begin_inset Quotes eld
2482 \end_inset
2484 IOPORTDELAY
2485 \begin_inset Quotes erd
2486 \end_inset
2489 \end_layout
2491 \begin_layout Standard
2492 Use I/O port delay emulation (each I/O port read/write takes 666ns).
2493 \end_layout
2495 \begin_layout LyX-Code
2496 \begin_inset Quotes eld
2497 \end_inset
2499 VGAHRETRACE
2500 \begin_inset Quotes erd
2501 \end_inset
2504 \end_layout
2506 \begin_layout Standard
2507 Emulate VGA horizontal retrace.
2508 \end_layout
2510 \begin_layout Subsection
2511 Event record format:
2512 \end_layout
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.
2521 \end_layout
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
2527  and reserved.
2528  It is error to encounter unknown such special class.
2529 \end_layout
2531 \begin_layout Subsubsection
2532 Savestate event
2533 \end_layout
2535 \begin_layout Itemize
2536 Dispatch to: SAVESTATE
2537 \end_layout
2539 \begin_layout Itemize
2540 Argument #1: Savestate id
2541 \end_layout
2543 \begin_layout Itemize
2544 Argument #2 (optional): Rerecord count at time of saving savestate
2545 \end_layout
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
2554 \end_layout
2556 \begin_layout Subsubsection
2557 Option event
2558 \end_layout
2560 \begin_layout Itemize
2561 Dispatch to: OPTION
2562 \end_layout
2564 \begin_layout Itemize
2565 Argument #1: 
2566 \begin_inset Quotes eld
2567 \end_inset
2569 ABSOLUTE
2570 \begin_inset Quotes erd
2571 \end_inset
2573  or 
2574 \begin_inset Quotes eld
2575 \end_inset
2577 RELATIVE
2578 \begin_inset Quotes erd
2579 \end_inset
2582 \end_layout
2584 \begin_layout Standard
2585 Controls various options.
2587 \begin_inset Quotes eld
2588 \end_inset
2590 ABSOLUTE
2591 \begin_inset Quotes erd
2592 \end_inset
2594  turns on absolute mode (default) where event timestamps are absolute.
2596 \begin_inset Quotes eld
2597 \end_inset
2599 RELATIVE
2600 \begin_inset Quotes erd
2601 \end_inset
2603  turns on relative mode where event timestamps are relative to last event
2604  in stream.
2605  The OPTION event itself is not affected by timing change.
2606  No time restrictions.
2607  Unknown arguments are errors.
2608 \end_layout
2610 \begin_layout Subsubsection
2611 Keyboard keypress/keyrelease event:
2612 \end_layout
2614 \begin_layout Itemize
2615 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2616 \end_layout
2618 \begin_layout Itemize
2619 Argument #1: Fixed: "KEYEDGE"
2620 \end_layout
2622 \begin_layout Itemize
2623 Argument #2: Key number.
2624  Valid values are 1-83, 85-95, 129-197 and 199-223
2625 \end_layout
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.
2633 \end_layout
2635 \begin_layout Subsubsection
2636 Pause event:
2637 \end_layout
2639 \begin_layout Itemize
2640 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2641 \end_layout
2643 \begin_layout Itemize
2644 Argument #1: Fixed: "PAUSE"
2645 \end_layout
2647 \begin_layout Standard
2648 Send pause key event.
2649  The time restrictions are identical to KEYEDGE event.
2650 \end_layout
2652 \begin_layout Subsubsection
2653 Mouse button event:
2654 \end_layout
2656 \begin_layout Itemize
2657 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2658 \end_layout
2660 \begin_layout Itemize
2661 Argument #1: Fixed: "MOUSEBUTTON"
2662 \end_layout
2664 \begin_layout Itemize
2665 Argument #2: Number of button to release or press (0-4)
2666 \end_layout
2668 \begin_layout Standard
2669 Presses or releases the designated mouse button.
2670 \end_layout
2672 \begin_layout Subsubsection
2673 X mouse motion event:
2674 \end_layout
2676 \begin_layout Itemize
2677 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2678 \end_layout
2680 \begin_layout Itemize
2681 Argument #1: Fixed: "XMOUSEMOTION"
2682 \end_layout
2684 \begin_layout Itemize
2685 Argument #2: Number of units to move (-255 - 255)
2686 \end_layout
2688 \begin_layout Standard
2689 Move the mouse in X direction by specified amount.
2690  Positive is right.
2691 \end_layout
2693 \begin_layout Subsubsection
2694 Y mouse motion event:
2695 \end_layout
2697 \begin_layout Itemize
2698 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2699 \end_layout
2701 \begin_layout Itemize
2702 Argument #1: Fixed: "YMOUSEMOTION"
2703 \end_layout
2705 \begin_layout Itemize
2706 Argument #2: Number of units to move (-255 - 255)
2707 \end_layout
2709 \begin_layout Standard
2710 Move the mouse in Y direction by specified amount.
2711  Positive is up.
2712 \end_layout
2714 \begin_layout Subsubsection
2715 Z mouse motion event:
2716 \end_layout
2718 \begin_layout Itemize
2719 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2720 \end_layout
2722 \begin_layout Itemize
2723 Argument #1: Fixed: "ZMOUSEMOTION"
2724 \end_layout
2726 \begin_layout Itemize
2727 Argument #2: Number of units to move (-7 - 7)
2728 \end_layout
2730 \begin_layout Standard
2731 Move the mouse in Z direction (scrollwheel) by specified amount.
2732 \end_layout
2734 \begin_layout Subsubsection
2735 Joystick button event:
2736 \end_layout
2738 \begin_layout Itemize
2739 Dispatch to: org.jpc.modules.Joystick
2740 \end_layout
2742 \begin_layout Itemize
2743 Argument #1: 
2744 \begin_inset Quotes eld
2745 \end_inset
2747 BUTTONA
2748 \begin_inset Quotes erd
2749 \end_inset
2752 \begin_inset Quotes eld
2753 \end_inset
2755 BUTTONB
2756 \begin_inset Quotes erd
2757 \end_inset
2760 \begin_inset Quotes eld
2761 \end_inset
2763 BUTTONC
2764 \begin_inset Quotes erd
2765 \end_inset
2767  or 
2768 \begin_inset Quotes eld
2769 \end_inset
2771 BUTTOND
2772 \begin_inset Quotes erd
2773 \end_inset
2776 \end_layout
2778 \begin_layout Itemize
2779 Argument #2: 
2780 \begin_inset Quotes eld
2781 \end_inset
2784 \begin_inset Quotes erd
2785 \end_inset
2787  if released, 
2788 \begin_inset Quotes eld
2789 \end_inset
2792 \begin_inset Quotes erd
2793 \end_inset
2795  if pressed
2796 \end_layout
2798 \begin_layout Standard
2799 Send button down/up event.
2800  No time restrictions.
2801 \end_layout
2803 \begin_layout Subsubsection
2804 Joystick axis event:
2805 \end_layout
2807 \begin_layout Itemize
2808 Dispatch to: org.jpc.modules.Joystick
2809 \end_layout
2811 \begin_layout Itemize
2812 Argument #1: 
2813 \begin_inset Quotes eld
2814 \end_inset
2816 AXISA
2817 \begin_inset Quotes erd
2818 \end_inset
2821 \begin_inset Quotes eld
2822 \end_inset
2824 AXISB
2825 \begin_inset Quotes erd
2826 \end_inset
2829 \begin_inset Quotes eld
2830 \end_inset
2832 AXISC
2833 \begin_inset Quotes erd
2834 \end_inset
2836  or 
2837 \begin_inset Quotes eld
2838 \end_inset
2840 AXISD
2841 \begin_inset Quotes erd
2842 \end_inset
2845 \end_layout
2847 \begin_layout Itemize
2848 Argument #2: Multivibrator unstable state length in ns.
2849 \end_layout
2851 \begin_layout Standard
2852 Set amount of time multivibrator remains in unstable state.
2853  No time restrictions.
2854 \end_layout
2856 \begin_layout Subsubsection
2857 Reboot:
2858 \end_layout
2860 \begin_layout Itemize
2861 Dispatch to: org.jpc.emulator.PC$ResetButton
2862 \end_layout
2864 \begin_layout Itemize
2865 No arguments
2866 \end_layout
2868 \begin_layout Standard
2869 Reboots the PC.
2870 \end_layout
2872 \begin_layout Subsubsection
2873 Fda disk change:
2874 \end_layout
2876 \begin_layout Itemize
2877 Dispatch to: org.jpc.emulator.PC$DiskChanger
2878 \end_layout
2880 \begin_layout Itemize
2881 Argument #1: Fixed: "FDA"
2882 \end_layout
2884 \begin_layout Itemize
2885 Argument #2: Number of image slot to put there.
2887 \end_layout
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.
2896 \end_layout
2898 \begin_layout Subsubsection
2899 Fdb disk change:
2900 \end_layout
2902 \begin_layout Itemize
2903 Dispatch to: org.jpc.emulator.PC$DiskChanger
2904 \end_layout
2906 \begin_layout Itemize
2907 Argument #1: Fixed: "FDB"
2908 \end_layout
2910 \begin_layout Itemize
2911 Argument #2: Number of image slot to put there.
2913 \end_layout
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.
2922 \end_layout
2924 \begin_layout Subsubsection
2925 Change CDROM:
2926 \end_layout
2928 \begin_layout Itemize
2929 Dispatch to: org.jpc.emulator.PC$DiskChanger
2930 \end_layout
2932 \begin_layout Itemize
2933 Argument #1: Fixed: "CDROM"
2934 \end_layout
2936 \begin_layout Itemize
2937 Argument #2: Number of image slot to put there.
2939 \end_layout
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.
2947 \end_layout
2949 \begin_layout Standard
2950 This event has no effect if CD-ROM is locked.
2951 \end_layout
2953 \begin_layout Subsubsection
2954 Write protect floppy:
2955 \end_layout
2957 \begin_layout Itemize
2958 Dispatch to: org.jpc.emulator.PC$DiskChanger
2959 \end_layout
2961 \begin_layout Itemize
2962 Argument #1: Fixed: "WRITEPROTECT"
2963 \end_layout
2965 \begin_layout Itemize
2966 Argument #2: Number of image slot to manipulate 
2967 \end_layout
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.
2972 \end_layout
2974 \begin_layout Subsubsection
2975 Write unprotect floppy:
2976 \end_layout
2978 \begin_layout Itemize
2979 Dispatch to: org.jpc.emulator.PC$DiskChanger
2980 \end_layout
2982 \begin_layout Itemize
2983 Argument #1: Fixed: "WRITEUNPROTECT"
2984 \end_layout
2986 \begin_layout Itemize
2987 Argument #2: Number of image slot to manipulate 
2988 \end_layout
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.
2993 \end_layout
2995 \begin_layout Subsection
2996 Diskinfo sections
2997 \end_layout
2999 \begin_layout Standard
3000 Diskinfo sections are named 
3001 \begin_inset Quotes eld
3002 \end_inset
3004 diskinfo-
3005 \begin_inset Quotes erd
3006 \end_inset
3008 <id of disk>.
3009  They use line component encoding, fieldtype being first component on each
3010  line (value being the second).
3011  Following fields are defined:
3012 \end_layout
3014 \begin_layout Subsubsection
3015 TYPE
3016 \end_layout
3018 \begin_layout Standard
3019 Gives type of image.
3020  Possible values are
3021 \end_layout
3023 \begin_layout Itemize
3024 \begin_inset Quotes eld
3025 \end_inset
3027 FLOPPY
3028 \begin_inset Quotes erd
3029 \end_inset
3031  (floppy disk)
3032 \end_layout
3034 \begin_layout Itemize
3035 \begin_inset Quotes eld
3036 \end_inset
3039 \begin_inset Quotes erd
3040 \end_inset
3042  (Hard disk)
3043 \end_layout
3045 \begin_layout Itemize
3046 \begin_inset Quotes eld
3047 \end_inset
3049 CDROM
3050 \begin_inset Quotes erd
3051 \end_inset
3053  (CD-ROM)
3054 \end_layout
3056 \begin_layout Itemize
3057 \begin_inset Quotes eld
3058 \end_inset
3060 BIOS
3061 \begin_inset Quotes erd
3062 \end_inset
3064  (BIOS/VGABIOS image)
3065 \end_layout
3067 \begin_layout Itemize
3068 \begin_inset Quotes eld
3069 \end_inset
3071 UNKNOWN
3072 \begin_inset Quotes erd
3073 \end_inset
3075  (what the heck is this???)
3076 \end_layout
3078 \begin_layout Subsubsection
3080 \end_layout
3082 \begin_layout Standard
3083 Gives ID of disk.
3084 \end_layout
3086 \begin_layout Subsubsection
3087 IMAGELENGTH
3088 \end_layout
3090 \begin_layout Standard
3091 (BIOS images only) Gives length of BIOS image
3092 \end_layout
3094 \begin_layout Subsubsection
3095 IMAGEMD5
3096 \end_layout
3098 \begin_layout Standard
3099 MD5 of raw disk/BIOS image without any headers or trailers.
3100 \end_layout
3102 \begin_layout Subsubsection
3103 TOTALSECTORS
3104 \end_layout
3106 \begin_layout Standard
3107 (FLOPPY/HDD/CDROM images only) Number of total sectors on disk.
3108 \end_layout
3110 \begin_layout Subsubsection
3111 TRACKS
3112 \end_layout
3114 \begin_layout Standard
3115 (FLOPPY/HDD images only) Number of tracks on disk per side (1-256 for floppy,
3116  1-1024 for HDD).
3117 \end_layout
3119 \begin_layout Subsubsection
3120 SIDES
3121 \end_layout
3123 \begin_layout Standard
3124 (FLOPPY/HDD images only) Number of sides on disk (1 or 2 for floppy, 1-16
3125  for HDD).
3126 \end_layout
3128 \begin_layout Subsubsection
3129 SECTORS
3130 \end_layout
3132 \begin_layout Standard
3133 (FLOPPY/HDD images only) Number of sectors per track (1-255 for floppy,
3134  1-63 for HDD).
3135 \end_layout
3137 \begin_layout Subsubsection
3138 COMMENT
3139 \end_layout
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)
3145 \end_layout
3147 \begin_layout Subsection
3148 Output info
3149 \end_layout
3151 \begin_layout Standard
3152 Output info is stored in section 
3153 \begin_inset Quotes eld
3154 \end_inset
3156 output-info
3157 \begin_inset Quotes erd
3158 \end_inset
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
3164  of output.
3165 \end_layout
3167 \begin_layout Subsubsection
3168 Video output
3169 \end_layout
3171 \begin_layout Standard
3172 For video output, there are no parameters so line is just 
3173 \begin_inset Quotes eld
3174 \end_inset
3176 VIDEO
3177 \begin_inset Quotes erd
3178 \end_inset
3180  (one component).
3181 \end_layout
3183 \begin_layout Subsubsection
3184 Audio output
3185 \end_layout
3187 \begin_layout Standard
3188 For audio output, the only parameter is name of output, so first component
3189  is 
3190 \begin_inset Quotes eld
3191 \end_inset
3193 AUDIO
3194 \begin_inset Quotes erd
3195 \end_inset
3197  and second component is name of audio output.
3198 \end_layout
3200 \begin_layout Subsection
3201 Savestates
3202 \end_layout
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
3207  anyway.
3208 \end_layout
3210 \begin_layout Section
3211 Advanced: Making class dumpable
3212 \end_layout
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).
3220 \end_layout
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.
3230 \end_layout
3232 \begin_layout Standard
3233 Following these fixed parts, dump all members that are part of mutable state
3234  in emulator core.
3235 \end_layout
3237 \begin_layout Subsection
3238 Member dumping/loading functions
3239 \end_layout
3241 \begin_layout Standard
3242 There is dumping/loading function for following (all functions dumping/loading
3243  reference types can handle null):
3244 \end_layout
3246 \begin_layout Itemize
3247 boolean: SRDumper.dumpBoolean, SRLoader.loadBoolean
3248 \end_layout
3250 \begin_layout Itemize
3251 byte: SRDumper.dumpByte, SRLoader.loadByte
3252 \end_layout
3254 \begin_layout Itemize
3255 short: SRDumper.dumpShort, SRLoader.loadShort
3256 \end_layout
3258 \begin_layout Itemize
3259 int: SRDumper.dumpInt, SRLoader.loadInt
3260 \end_layout
3262 \begin_layout Itemize
3263 long: SRDumper.dumpLong, SRLoader.loadLong
3264 \end_layout
3266 \begin_layout Itemize
3267 String: SRDumper.dumpString, SRLoader.loadString
3268 \end_layout
3270 \begin_layout Itemize
3271 boolean[]: SRDumper.dumpArray, SRLoader.loadArrayBoolean
3272 \end_layout
3274 \begin_layout Itemize
3275 byte[]: SRDumper.dumpArray, SRLoader.loadArrayByte
3276 \end_layout
3278 \begin_layout Itemize
3279 short[]: SRDumper.dumpArray, SRLoader.loadArrayShort
3280 \end_layout
3282 \begin_layout Itemize
3283 int[]: SRDumper.dumpArray, SRLoader.loadArrayInt
3284 \end_layout
3286 \begin_layout Itemize
3287 long[]: SRDumper.dumpArray, SRLoader.loadArrayLong
3288 \end_layout
3290 \begin_layout Itemize
3291 double[]: SRDumper.dumpArray, SRLoader.loadArrayDouble
3292 \end_layout
3294 \begin_layout Itemize
3295 <dumpable type>: SRDumper.dumpObject, SRLoader.loadObject
3296 \end_layout
3298 \begin_layout Itemize
3299 special object: SRDumper.specialObject, SRLoader.specialObject
3300 \end_layout
3302 \begin_layout Subsubsection
3303 Notes:
3304 \end_layout
3306 \begin_layout Itemize
3307 Dumpable objects come out as type of org.jpc.emulator.SRDumpable.
3308 \end_layout
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.
3313 \end_layout
3315 \begin_layout Itemize
3316 Don't dump fields related to event state feedback.
3317 \end_layout
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.
3322 \end_layout
3324 \begin_layout Itemize
3325 Some connectors dump fields related to connector output, some don't.
3326 \end_layout
3328 \begin_layout Section
3329 Advanced: Writing event targets
3330 \end_layout
3332 \begin_layout Standard
3333 Whereas output connectors are the way output is dispatched, input is dispatched
3334  via event targets.
3335  Event targets need to implement interface org.jpc.emulator.EventDispatchTarget.
3336 \end_layout
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.
3342 \end_layout
3344 \begin_layout Subsection
3345 Interface org.jpc.emulator.EventDispatchTarget
3346 \end_layout
3348 \begin_layout Standard
3349 Interface that marks class capable of receiving events.
3350 \end_layout
3352 \begin_layout Subsubsection
3353 Method setEventRecorder(EventRecorder)
3354 \end_layout
3356 \begin_layout Standard
3357 Set the event recorder input events are sent to.
3358 \end_layout
3360 \begin_layout Subsubsection
3361 Method startEventCheck()
3362 \end_layout
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
3367 ack state.
3368 \end_layout
3370 \begin_layout Subsubsection
3371 Method doEvent(long, String[], int) throws IOException
3372 \end_layout
3374 \begin_layout Standard
3375 Event dispatch handler.
3376  The first argument is event time, second is parameters and third is what
3377  to do with it.
3378  If target doesn't like the event, throw IOException.
3379  Following types (the integer parameter) are used:
3380 \end_layout
3382 \begin_layout LyX-Code
3383 0 (EventRecorder.EVENT_TIMED): Time has been assigned for event.
3384 \end_layout
3386 \begin_layout LyX-Code
3387 1 (EventRecorder.EVENT_STATE_EFFECT_FUTURE): Future event in event replay
3388  for reinitialization
3389 \end_layout
3391 \begin_layout LyX-Code
3392 2 (EventRecorder.EVENT_STATE_EFFECT): Past event in event replay reinitialization
3393 \end_layout
3395 \begin_layout LyX-Code
3396 3 (EventRecorder.EVENT_EXECUTE): This event occurs now.
3397  Execute the effect.
3398 \end_layout
3400 \begin_layout Subsubsection
3401 Method endEventCheock()
3402 \end_layout
3404 \begin_layout Standard
3405 End event reinitialization.
3406  Usually unused.
3407 \end_layout
3409 \begin_layout Subsubsection
3410 Method getEventTimeLowBound(long, String[]) throws IOException
3411 \end_layout
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
3416  as possible.
3417  The long parameter gives the current scheduled time for event.
3418 \end_layout
3420 \begin_layout Section
3421 Writing modules
3422 \end_layout
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.
3432 \end_layout
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.
3438 \end_layout
3440 \begin_layout Section
3441 Writing plugins
3442 \end_layout
3444 \begin_layout Standard
3445 Plugins handle various UI tasks.
3446  They need to implement interface org.jpc.Plugin.
3447 \end_layout
3449 \begin_layout Subsection
3450 Interface org.jpc.pluginsbase.Plugin
3451 \end_layout
3453 \begin_layout Subsubsection
3454 Method systemShutdown()
3455 \end_layout
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
3461  state.
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
3464  into deadlock.
3465 \end_layout
3467 \begin_layout Subsubsection
3468 Method reconnect(PC) 
3469 \end_layout
3471 \begin_layout Standard
3472 Gives new PC to connect to.
3473  Null is passed if plugin should disconnect.
3474 \end_layout
3476 \begin_layout Subsubsection
3477 Method main()
3478 \end_layout
3480 \begin_layout Standard
3481 Called in dedicated thread after plugin is initialized.
3482 \end_layout
3484 \begin_layout Subsubsection
3485 Method pcStopping()
3486 \end_layout
3488 \begin_layout Standard
3489 Called after PC has stopped.
3490 \end_layout
3492 \begin_layout Subsubsection
3493 Method pcStarting()
3494 \end_layout
3496 \begin_layout Standard
3497 Called before PC starts.
3498 \end_layout
3500 \begin_layout Subsubsection
3501 Method notifyArguments(String[])
3502 \end_layout
3504 \begin_layout Standard
3505 Pass arguments from command line.
3506 \end_layout
3508 \begin_layout Subsubsection
3509 Constructor <init>(Plugins)
3510 \end_layout
3512 \begin_layout Standard
3513 This constructor is used to initialize plugins that don't take parameters.
3514 \end_layout
3516 \begin_layout Subsubsection
3517 Constructor <init>(Plugins, String)
3518 \end_layout
3520 \begin_layout Standard
3521 This constructor is used to initialize plugins that take parameters.
3522 \end_layout
3524 \begin_layout Subsection
3525 Class org.jpc.pluginsbase.Plugins
3526 \end_layout
3528 \begin_layout Standard
3529 This class provodes various methods for manipulating plugins.
3530 \end_layout
3532 \begin_layout Subsubsection
3533 Method isShuttingDown()
3534 \end_layout
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.
3540 \end_layout
3542 \begin_layout Subsubsection
3543 Method shutdownEmulator()
3544 \end_layout
3546 \begin_layout Standard
3547 Shut down and exit the emulator.
3548  All plugin shutdown functions are called in this thread.
3549 \end_layout
3551 \begin_layout Subsubsection
3552 Method reconnectPC(PC)
3553 \end_layout
3555 \begin_layout Standard
3556 Signal reconnectPC event to all plugins.
3557 \end_layout
3559 \begin_layout Subsubsection
3560 Method pcStarted()
3561 \end_layout
3563 \begin_layout Standard
3564 Signal pcStarting() event to all plugins.
3565 \end_layout
3567 \begin_layout Subsubsection
3568 Method pcStopped()
3569 \end_layout
3571 \begin_layout Standard
3572 Signal pcStopping() event to all plugins.
3573 \end_layout
3575 \begin_layout Section
3576 Inter-plugin communication
3577 \end_layout
3579 \begin_layout Subsection
3580 Receiving communications
3581 \end_layout
3583 \begin_layout Standard
3584 To receive invocation/call by name 'foo-bar', declare public method named
3585  'eci_foo_bar'.
3586  Arguments to this method can currently be String, Integer (int) or Long
3587  (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
3592  to have completed.
3593  If return value is boolean true, it is assumed that there is more processing.
3594 \end_layout
3596 \begin_layout Subsection
3597 void org.jpc.pluginsbase.Plugins.invokeExternalCommand(String cmd, Object[]
3598  args) 
3599 \end_layout
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.
3605 \end_layout
3607 \begin_layout Subsection
3608 void org.jpc.pluginsbase.Plugins.invokeExternalCommandSynchronous(String cmd,
3609  Object[] args) 
3610 \end_layout
3612 \begin_layout Standard
3613 Same as invokeExternalCommand, but waits for slow commands to complete.
3614 \end_layout
3616 \begin_layout Subsection
3617 Object[] org.jpc.pluginsbase.Plugins.invokeExternalCommandReturn(String cmd,
3618  Object[] args) 
3619 \end_layout
3621 \begin_layout Standard
3622 Similar to invokeExternalCommandSynchornous, but:
3623 \end_layout
3625 \begin_layout Itemize
3626 Quits calling more plugins when it gets successful reply.
3627 \end_layout
3629 \begin_layout Itemize
3630 Returns said reply
3631 \end_layout
3633 \begin_layout Subsection
3634 void org.jpc.pluginsbase.Plugins.returnValue(Object...
3635  ret)
3636 \end_layout
3638 \begin_layout Standard
3639 Gives return value to return from call and signals that command has completed.
3640 \end_layout
3642 \begin_layout Subsection
3643 void org.jpc.pluginsbase.Plugins.signalCommandCompletion()
3644 \end_layout
3646 \begin_layout Standard
3647 Signals that command has completed.
3648  Only needed if there is no return value and eci_ method returned false
3649  (not done yet).
3650 \end_layout
3652 \begin_layout Section
3653 Lua kernel programming
3654 \end_layout
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.
3660 \end_layout
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.
3665 \end_layout
3667 \begin_layout Itemize
3668 Always grab any functions used into local variables so nobody can mess with
3669  them
3670 \end_layout
3672 \begin_layout Itemize
3673 Don't use global variables in kernel (except for those passed).
3674 \end_layout
3676 \end_body
3677 \end_document