Exapand the comment on compute_coeffs method.
[jpcrr.git] / docs / manual.lyx
blob86e0a85cece13ea73d8a19139677f08fee4e91f7
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.FMCard
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 0x338-0x33B
1165 \end_layout
1167 \begin_layout Standard
1168 Emulates FM card.
1169 \end_layout
1171 \begin_layout Subsection
1172 org.jpc.modules.BasicFPU:
1173 \end_layout
1175 \begin_layout Itemize
1176 Arguments: none.
1177 \end_layout
1179 \begin_layout Itemize
1180 Resources: None.
1181 \end_layout
1183 \begin_layout Standard
1184 Crude FPU (x87) emulator.
1185 \end_layout
1187 \begin_layout Section
1188 Hacks
1189 \end_layout
1191 \begin_layout Standard
1192 Hacks are saved to savestates but not movies.
1193 \end_layout
1195 \begin_layout Subsection
1196 NO_FPU
1197 \end_layout
1199 \begin_layout Standard
1200 Force bit 1 of physical address 0x0410 to zero, signaling that the system
1201  has no FPU.
1202  BIOS assumes system has FPU but some games use that bit to detect FPU,
1203  trying to use it if it is 
1204 \begin_inset Quotes eld
1205 \end_inset
1207 present
1208 \begin_inset Quotes erd
1209 \end_inset
1212  Try this if game startup hangs with lots of trying to use FPU but not present
1213  errors.
1214  Don't use if there is FPU present.
1215  Needed to get games like Blake Stone / Wolfenstein 3-D to work (FPU emulator
1216  allows it to start but causes graphical glitches).
1217 \end_layout
1219 \begin_layout Subsection
1220 VGA_DRAW
1221 \end_layout
1223 \begin_layout Standard
1224 Update basic VGA parameters before vretrace, not after it.
1225  Some games (e.g.
1226  Commander Keen 4) don't like if this isn't done and some games (e.g.
1227  Mario & Luigi) don't like if it is done.
1228  Wrong value manifests as jerky scrolling (scrolling back and forth and
1229  fixed statusbars move).
1230 \end_layout
1232 \begin_layout Section
1233 Some error messages and explanations
1234 \end_layout
1236 \begin_layout Itemize
1237 <filename> is Not a valid image file
1238 \end_layout
1240 \begin_layout Itemize
1241 <filename> is not image file
1242 \end_layout
1244 \begin_layout Itemize
1245 <filename> claims to be floppy with illegal geometry: <x> tracks, <y> sides
1246  and <z> sectors.
1247 \end_layout
1249 \begin_layout Itemize
1250 <filename> claims to be HDD with illegal geometry: <x> tracks, <y> sides
1251  and <z> sectors.
1252 \end_layout
1254 \begin_layout Itemize
1255 Can't read disk image sector map.
1256 \end_layout
1258 \begin_layout Itemize
1259 Can't read disk image extent.
1260 \end_layout
1262 \begin_layout Standard
1263 Code expects <filename> to be valid JPC-RR format image, but it isn't JPC-RR
1264  image at all or its corrupt.
1265 \end_layout
1267 \begin_layout Itemize
1268 <filename> is image of unknown type.
1269 \end_layout
1271 \begin_layout Itemize
1272 <filename> has unrecognized geometry <x> <y> <z>
1273 \end_layout
1275 \begin_layout Standard
1276 Possibly corrupt image, not JPC-RR image, or JPC-RR image from future version
1277  containing something current version can't comprehend.
1278 \end_layout
1280 \begin_layout Itemize
1281 Invalid format specifier <something>.
1282 \end_layout
1284 \begin_layout Itemize
1285 Invalid syntax of --floppy= or --HDD= option.
1286 \end_layout
1288 \begin_layout Itemize
1289 Invalid format specifier/option <something>.
1290 \end_layout
1292 \begin_layout Standard
1293 Invalid option or format specifier was given.
1294  Check for typos.
1295 \end_layout
1297 \begin_layout Itemize
1298 java ImageMaker [<options>...] <format> <destination> <source> <diskname>
1299 \end_layout
1301 \begin_layout Standard
1302 Check syntax of command.
1303  Especially that diskname is present!
1304 \end_layout
1306 \begin_layout Itemize
1307 The image has <nnn> sectors while it should have <yyy> according to selected
1308  geometry.
1309 \end_layout
1311 \begin_layout Itemize
1312 Raw image file length not divisible by 512.
1313 \end_layout
1315 \begin_layout Itemize
1316 Trying to read sector out of range.
1317 \end_layout
1319 \begin_layout Standard
1320 The selected geometry is wrong or raw image is incomplete.
1321 \end_layout
1323 \begin_layout Itemize
1324 Invalid disk name (Should not happen!).
1325 \end_layout
1327 \begin_layout Itemize
1328 Invalid geometry to be written.
1329 \end_layout
1331 \begin_layout Standard
1332 This is a very likely a bug in program.
1333 \end_layout
1335 \begin_layout Itemize
1336 What the heck <filename> is? It's not regular file nor directory.
1337 \end_layout
1339 \begin_layout Standard
1340 That sort of file can't be used as input for image making, or the file just
1341  doesn't exist.
1342 \end_layout
1344 \begin_layout Itemize
1345 BIOS images can only be made out of regular files.
1346 \end_layout
1348 \begin_layout Itemize
1349 CD images can only be made out of regular files.
1350 \end_layout
1352 \begin_layout Standard
1353 Source image specified is not regular file, but image of that type can't
1354  be made of anything else.
1355 \end_layout
1357 \begin_layout Itemize
1358 Can't read raw bios image file.
1359 \end_layout
1361 \begin_layout Itemize
1362 Can't read sector <nnn> from image.
1363 \end_layout
1365 \begin_layout Standard
1366 Reading the raw image file failed for some reason.
1367 \end_layout
1369 \begin_layout Itemize
1370 Bad library line: "<something>".
1371  Ignored.
1372 \end_layout
1374 \begin_layout Standard
1375 Syntax error in image library.
1376 \end_layout
1378 \begin_layout Itemize
1379 Removing image <something> a.k.a.
1380  "<something>" as it no longer exists.
1381 \end_layout
1383 \begin_layout Standard
1384 The image file no longer exists so it gets removed from library.
1385 \end_layout
1387 \begin_layout Itemize
1388 Removing image <something> a.k.a.
1389  "<something>" due to <some> conflict.
1390 \end_layout
1392 \begin_layout Standard
1393 Image library code killed some image from library due to some kind of conflict
1394  with image being added.
1395 \end_layout
1397 \begin_layout Itemize
1398 Too much data to fit into given space.
1399 \end_layout
1401 \begin_layout Standard
1402 The tree you gave contains takes just too much space to fit into disk of
1403  this size.
1404 \end_layout
1406 \begin_layout Section
1407 Advanced: Savestate/movie format
1408 \end_layout
1410 \begin_layout Subsection
1411 Special character classes
1412 \end_layout
1414 \begin_layout Subsubsection
1415 SPACE
1416 \end_layout
1418 \begin_layout Standard
1419 Following Unicode codepoints (encoded as UTF-8) are interpretted as space
1420  characters:
1421 \end_layout
1423 \begin_layout Itemize
1424 Codepoints 0x20, and 0x09.
1425 \end_layout
1427 \begin_layout Itemize
1428 Codepoints 0x1680, 0x180E, 0x2028, 0x205F and 0x3000
1429 \end_layout
1431 \begin_layout Itemize
1432 Codepoints 0x2000-0x200A.
1433 \end_layout
1435 \begin_layout Subsubsection
1436 LINEFEED
1437 \end_layout
1439 \begin_layout Standard
1440 Following byte sequences are interpretted as linefeeds (line change):
1441 \end_layout
1443 \begin_layout Itemize
1444 Byte 0x0A (UTF-8 encoded codepoint 0x0A)
1445 \end_layout
1447 \begin_layout Itemize
1448 Byte 0x0D (UTF-8 encoded codepoint 0x0D)
1449 \end_layout
1451 \begin_layout Itemize
1452 Byte 0x1C (UTF-8 encoded codepoint 0x1C)
1453 \end_layout
1455 \begin_layout Itemize
1456 Byte 0x1D (UTF-8 encoded codepoint 0x1D)
1457 \end_layout
1459 \begin_layout Itemize
1460 Byte 0x1E (UTF-8 encoded codepoint 0x1E)
1461 \end_layout
1463 \begin_layout Itemize
1464 Bytes 0xC2 0x85 (UTF-8 for unicode control character NL, codepoint 0x85)
1465 \end_layout
1467 \begin_layout Itemize
1468 Bytes 0xE2 0x80 0xA9 (UTF-8 encoded codepoint 0x2029)
1469 \end_layout
1471 \begin_layout Subsection
1472 JRSR archive
1473 \end_layout
1475 \begin_layout Standard
1476 JRSR archive format packs multiple text archive members to text archive.
1477  It does not support binary members.
1478  JRSR archives have first five or six bytes form the magic.
1479  It is 
1480 \begin_inset Quotes eld
1481 \end_inset
1483 JRSR
1484 \begin_inset Quotes erd
1485 \end_inset
1487  followed by LINEFEED character There are four kinds of lines after that
1488  (lines are terminated by LINEFEED byte/bytes):
1489 \end_layout
1491 \begin_layout Itemize
1492 Start member
1493 \end_layout
1495 \begin_layout Itemize
1496 Member line
1497 \end_layout
1499 \begin_layout Itemize
1500 End member
1501 \end_layout
1503 \begin_layout Itemize
1504 Blank line
1505 \end_layout
1507 \begin_layout Standard
1508 Sequencing rules are as follows: Start member is allowed anywhere (after
1509  magic).
1510  Member line is allowed only inside member (member started but not ended).
1511  End member is only allowed inside member.
1512  End of file is only allowed outside member.
1513  Blank line is allowed anywhere after magic.
1514 \end_layout
1516 \begin_layout Subsubsection
1517 Start member
1518 \end_layout
1520 \begin_layout Standard
1521 Start member line is given as 
1522 \begin_inset Quotes eld
1523 \end_inset
1525 !BEGIN
1526 \begin_inset Quotes erd
1527 \end_inset
1529  <SPACE>+ <membername> <LINEFEED>.
1530  <SPACE>+ any number of SPACE characters at least one and <LINEFEED> is
1531  LINEFEED chacter.
1532  The member name is UTF-8 encoded and maximum allowed line length is 2048
1533  bytes (including LINEFEED, which means name is limited to 509-2040 codepoints
1534  depending on characters used).
1535  Starting member inside another implicitly ends the previous member.
1536 \end_layout
1538 \begin_layout Subsubsection
1539 Member line:
1540 \end_layout
1542 \begin_layout Standard
1543 Member line is given as 
1544 \begin_inset Quotes eld
1545 \end_inset
1548 \begin_inset Quotes erd
1549 \end_inset
1551 <content><LINEFEED>.
1552  It gives another line for member contents.
1553  <content> is passed raw to layers above (followed by line termination)
1554 \end_layout
1556 \begin_layout Subsubsection
1557 End member
1558 \end_layout
1560 \begin_layout Standard
1561 End member line is given as 
1562 \begin_inset Quotes eld
1563 \end_inset
1565 !END
1566 \begin_inset Quotes erd
1567 \end_inset
1569 <LINEFEED>.
1570  It ends the current member.
1571  The following line can only be start member line or file may end.
1572 \end_layout
1574 \begin_layout Subsubsection
1575 Blank line
1576 \end_layout
1578 \begin_layout Standard
1579 Blank line is given as <LINEFEED>.
1580  Lines like that are ignored.
1581 \end_layout
1583 \begin_layout Subsection
1584 Four-to-Five encoding
1585 \end_layout
1587 \begin_layout Standard
1588 Binary members are encoded into text by so-called four-to-five encoding.
1589  This encoding can encode single byte to two, two bytes to three, three
1590  bytes to four and four bytes to five.
1591  Four-to-five encoding has five kinds of blocks.
1592  All SPACE and LINEFEED characters are completely ignored, even in middle
1593  of blocks.
1594 \end_layout
1596 \begin_layout Subsubsection
1597 End stream block
1598 \end_layout
1600 \begin_layout Standard
1601 End stream block is encoded as '!'.
1602  It ends the stream instantly.
1603  There is also implicit end of stream at end of input to decoding.
1604 \end_layout
1606 \begin_layout Subsubsection
1607 Other four block types
1608 \end_layout
1610 \begin_layout Standard
1611 Other four block types take the value to be encoded, read it as big-endian
1612  value.
1613  Then they write it as base-93 big-endian value.
1614  Then length specific constants are added to digits of that number to yield
1615  ASCII values for characters (those are stored in order):
1616 \end_layout
1618 \begin_layout Standard
1619 \begin_inset Tabular
1620 <lyxtabular version="3" rows="5" columns="6">
1621 <features>
1622 <column alignment="center" valignment="top" width="0">
1623 <column alignment="center" valignment="top" width="0">
1624 <column alignment="center" valignment="top" width="0">
1625 <column alignment="center" valignment="top" width="0">
1626 <column alignment="center" valignment="top" width="0">
1627 <column alignment="center" valignment="top" width="0">
1628 <row>
1629 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1630 \begin_inset Text
1632 \begin_layout Plain Layout
1633 To encode
1634 \end_layout
1636 \end_inset
1637 </cell>
1638 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1639 \begin_inset Text
1641 \begin_layout Plain Layout
1642 1st char.
1643 \end_layout
1645 \end_inset
1646 </cell>
1647 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1648 \begin_inset Text
1650 \begin_layout Plain Layout
1651 2nd char.
1652 \end_layout
1654 \end_inset
1655 </cell>
1656 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1657 \begin_inset Text
1659 \begin_layout Plain Layout
1660 3rd char.
1661 \end_layout
1663 \end_inset
1664 </cell>
1665 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1666 \begin_inset Text
1668 \begin_layout Plain Layout
1669 4th char.
1670 \end_layout
1672 \end_inset
1673 </cell>
1674 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1675 \begin_inset Text
1677 \begin_layout Plain Layout
1678 5th char.
1679 \end_layout
1681 \end_inset
1682 </cell>
1683 </row>
1684 <row>
1685 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1686 \begin_inset Text
1688 \begin_layout Plain Layout
1689 1 byte
1690 \end_layout
1692 \end_inset
1693 </cell>
1694 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1695 \begin_inset Text
1697 \begin_layout Plain Layout
1699 \end_layout
1701 \end_inset
1702 </cell>
1703 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1704 \begin_inset Text
1706 \begin_layout Plain Layout
1708 \end_layout
1710 \end_inset
1711 </cell>
1712 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1713 \begin_inset Text
1715 \begin_layout Plain Layout
1717 \end_layout
1719 \end_inset
1720 </cell>
1721 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1722 \begin_inset Text
1724 \begin_layout Plain Layout
1726 \end_layout
1728 \end_inset
1729 </cell>
1730 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1731 \begin_inset Text
1733 \begin_layout Plain Layout
1735 \end_layout
1737 \end_inset
1738 </cell>
1739 </row>
1740 <row>
1741 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1742 \begin_inset Text
1744 \begin_layout Plain Layout
1745 2 bytes
1746 \end_layout
1748 \end_inset
1749 </cell>
1750 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1751 \begin_inset Text
1753 \begin_layout Plain Layout
1755 \end_layout
1757 \end_inset
1758 </cell>
1759 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1760 \begin_inset Text
1762 \begin_layout Plain Layout
1764 \end_layout
1766 \end_inset
1767 </cell>
1768 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1769 \begin_inset Text
1771 \begin_layout Plain Layout
1773 \end_layout
1775 \end_inset
1776 </cell>
1777 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1778 \begin_inset Text
1780 \begin_layout Plain Layout
1782 \end_layout
1784 \end_inset
1785 </cell>
1786 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1787 \begin_inset Text
1789 \begin_layout Plain Layout
1791 \end_layout
1793 \end_inset
1794 </cell>
1795 </row>
1796 <row>
1797 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1798 \begin_inset Text
1800 \begin_layout Plain Layout
1801 3 bytes
1802 \end_layout
1804 \end_inset
1805 </cell>
1806 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1807 \begin_inset Text
1809 \begin_layout Plain Layout
1811 \end_layout
1813 \end_inset
1814 </cell>
1815 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1816 \begin_inset Text
1818 \begin_layout Plain Layout
1820 \end_layout
1822 \end_inset
1823 </cell>
1824 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1825 \begin_inset Text
1827 \begin_layout Plain Layout
1829 \end_layout
1831 \end_inset
1832 </cell>
1833 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1834 \begin_inset Text
1836 \begin_layout Plain Layout
1838 \end_layout
1840 \end_inset
1841 </cell>
1842 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1843 \begin_inset Text
1845 \begin_layout Plain Layout
1847 \end_layout
1849 \end_inset
1850 </cell>
1851 </row>
1852 <row>
1853 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1854 \begin_inset Text
1856 \begin_layout Plain Layout
1857 4 bytes
1858 \end_layout
1860 \end_inset
1861 </cell>
1862 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1863 \begin_inset Text
1865 \begin_layout Plain Layout
1867 \end_layout
1869 \end_inset
1870 </cell>
1871 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1872 \begin_inset Text
1874 \begin_layout Plain Layout
1876 \end_layout
1878 \end_inset
1879 </cell>
1880 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1881 \begin_inset Text
1883 \begin_layout Plain Layout
1885 \end_layout
1887 \end_inset
1888 </cell>
1889 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1890 \begin_inset Text
1892 \begin_layout Plain Layout
1894 \end_layout
1896 \end_inset
1897 </cell>
1898 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1899 \begin_inset Text
1901 \begin_layout Plain Layout
1903 \end_layout
1905 \end_inset
1906 </cell>
1907 </row>
1908 </lyxtabular>
1910 \end_inset
1913 \end_layout
1915 \begin_layout Standard
1916 Blocks which encode values greater than what is possible for value of that
1917  length are fatal errors.
1919 \end_layout
1921 \begin_layout Subsection
1922 Line component encoing
1923 \end_layout
1925 \begin_layout Standard
1926 Line component encoding sits on top of UTF-8 encoding.
1927  Line component encoding encodes non-empty 1-D array of non-empty strings
1928  into line, and thus array of those into member.
1929  Empty lines or lines that don't contain any components are ignored.
1930  Line starts with depth value of 0 and must end with depth value of zero.
1931 \end_layout
1933 \begin_layout Standard
1934 Components are seperated by component separators.
1935  Empty components are ignored.
1936  Following codepoints are separators on depth 0 if not escaped:
1937 \end_layout
1939 \begin_layout Itemize
1940 Codepoint of '('.
1941  The depth is read pre-increment.
1942 \end_layout
1944 \begin_layout Itemize
1945 Codepoint of ')'.
1946  The depth is read post-decrement.
1947 \end_layout
1949 \begin_layout Itemize
1950 Any SPACE character
1951 \end_layout
1953 \begin_layout Standard
1954 The following characters are special:
1955 \end_layout
1957 \begin_layout Itemize
1958 '('.
1959  Increments depth by 1 if not escaped (and appears in component).
1960 \end_layout
1962 \begin_layout Itemize
1963 ')'.
1964  Decrements depth by 1 if not escaped (and appears in component).
1965  Depth going negative is an error.
1966 \end_layout
1968 \begin_layout Itemize
1970 \backslash
1972  Next character is interpretted as literal.
1973  Error if at end of line.
1974 \end_layout
1976 \begin_layout Standard
1977 Otherwise, characters are interpretted as literals and appear in components.
1978  Depth must be zero at end of line.
1979 \end_layout
1981 \begin_layout Subsection
1982 Header section:
1983 \end_layout
1985 \begin_layout Standard
1986 Header section is in archive member "header".
1987  It uses line component encoding.
1988  The first component of each line is name of header, and subsequent ones
1989  are arguments.
1990  How many parameters are expected is dependent on what header it is:
1991 \end_layout
1993 \begin_layout Subsubsection
1994 PROJECTID header:
1995 \end_layout
1997 \begin_layout Itemize
1998 Header name: "PROJECTID"
1999 \end_layout
2001 \begin_layout Itemize
2002 Components: 2
2003 \end_layout
2005 \begin_layout Itemize
2006 Argument #1: <project-id-string>
2007 \end_layout
2009 \begin_layout Itemize
2010 Mandatory: Yes
2011 \end_layout
2013 \begin_layout Standard
2014 Gives project ID.
2015  Project ID is generated when PC is assembled and is then preserved in save
2016  states.
2017  It is used for computing rerecord counts.
2018  Emulator treats it as opaque string, the IDs it generates are formed by
2019  48 random hexadecimal digits.
2020 \end_layout
2022 \begin_layout Subsubsection
2023 SAVESTATEID header:
2024 \end_layout
2026 \begin_layout Itemize
2027 Header name: "SAVESTATEID"
2028 \end_layout
2030 \begin_layout Itemize
2031 Components: 2
2032 \end_layout
2034 \begin_layout Itemize
2035 Argument #1: <savestate-id-string>
2036 \end_layout
2038 \begin_layout Itemize
2039 Mandatory: No
2040 \end_layout
2042 \begin_layout Standard
2043 Gives save state ID.
2044  Each save state has its own save state ID.
2045  Treated as opaque string, but generated as 48 random hexadecimal digits.
2046  The presence of this header signals whether there is save state to be loaded.
2047  If this header is present, save state load will be attempted.
2048  If absent, save state is not to be loaded even if present (and correct
2049  savestate load would be technically impossible anyway).
2050 \end_layout
2052 \begin_layout Standard
2053 The value is used to prevent loading incompatible save states in preserve
2054  event stream mode and also to find the point in event stream where one
2055  left off.
2056 \end_layout
2058 \begin_layout Subsubsection
2059 RERECORDS header:
2060 \end_layout
2062 \begin_layout Itemize
2063 Header name: "RERECORDS"
2064 \end_layout
2066 \begin_layout Itemize
2067 Components: 2
2068 \end_layout
2070 \begin_layout Itemize
2071 Argument #1: <rerecords>
2072 \end_layout
2074 \begin_layout Itemize
2075 Mandatory: Yes
2076 \end_layout
2078 \begin_layout Standard
2079 Gives rerecord count.
2080  PC assembly (except when loading save state) initializes current rerecord
2081  count to zero.
2082  Must be non-negative and decimal number using ASCII digit characters.
2083 \end_layout
2085 \begin_layout LyX-Code
2086 On loading save state:
2087 \end_layout
2089 \begin_layout LyX-Code
2090 1) If project ID matches with previous:
2091 \end_layout
2093 \begin_layout LyX-Code
2094 1a) If loaded rerecord count is larger or equal to current rerecord count:
2095 \end_layout
2097 \begin_layout LyX-Code
2098 1a-a) Current rerecord count is loaded rerecord count + 1.
2099 \end_layout
2101 \begin_layout LyX-Code
2102 1b) Otherwise
2103 \end_layout
2105 \begin_layout LyX-Code
2106 1b-a) Current rerecord count increments by 1.
2107 \end_layout
2109 \begin_layout LyX-Code
2110 2) Otherwise
2111 \end_layout
2113 \begin_layout LyX-Code
2114 2a) Current rerecord count is loaded rerecord count + 1.
2115 \end_layout
2117 \begin_layout Standard
2118 The current rerecord count at time of save is saved to save state.
2119 \end_layout
2121 \begin_layout Subsubsection
2122 SYSTEM header:
2123 \end_layout
2125 \begin_layout Itemize
2126 Header name: "SYSTEM"
2127 \end_layout
2129 \begin_layout Itemize
2130 Components: 2
2131 \end_layout
2133 \begin_layout Itemize
2134 Argument #1: <system-id-string>
2135 \end_layout
2137 \begin_layout Itemize
2138 Mandatory: No
2139 \end_layout
2141 \begin_layout Standard
2142 Gives system this movie/save is for.
2143  The only currently recognized value is 
2144 \begin_inset Quotes eld
2145 \end_inset
2147 PC-JPC-RR-r10
2148 \begin_inset Quotes erd
2149 \end_inset
2151  (if this header is absent, use default system).
2152  Invalid values trigger error on load time.
2153 \end_layout
2155 \begin_layout Subsubsection
2156 AUTHORS header:
2157 \end_layout
2159 \begin_layout Itemize
2160 Header name: "AUTHORS"
2161 \end_layout
2163 \begin_layout Itemize
2164 Components: 2 or more
2165 \end_layout
2167 \begin_layout Itemize
2168 Arguments: free form
2169 \end_layout
2171 \begin_layout Itemize
2172 Mandatory: No
2173 \end_layout
2175 \begin_layout Standard
2176 Gives authors of run.
2177  Each argument gives one author (who has full name but no nickname).
2178  May be present multiple times.
2179 \end_layout
2181 \begin_layout Subsubsection
2182 AUTHORNICKS header:
2183 \end_layout
2185 \begin_layout Itemize
2186 Header name: "AUTHORNICKS"
2187 \end_layout
2189 \begin_layout Itemize
2190 Components: 2 or more
2191 \end_layout
2193 \begin_layout Itemize
2194 Arguments: free form
2195 \end_layout
2197 \begin_layout Itemize
2198 Mandatory: No
2199 \end_layout
2201 \begin_layout Standard
2202 Gives authors of run.
2203  Each argument gives one author (who has nickname but no full name).
2204  May be present multiple times.
2205 \end_layout
2207 \begin_layout Subsubsection
2208 AUTHORFULL header:
2209 \end_layout
2211 \begin_layout Itemize
2212 Header name: "AUTHORFULL"
2213 \end_layout
2215 \begin_layout Itemize
2216 Components: 3
2217 \end_layout
2219 \begin_layout Itemize
2220 Arguments: free form
2221 \end_layout
2223 \begin_layout Itemize
2224 Mandatory: No
2225 \end_layout
2227 \begin_layout Standard
2228 Gives author of run.
2229  First argument is full name of author, and second is nickname of author.
2230  May be present multiple times.
2231 \end_layout
2233 \begin_layout Subsubsection
2234 COMMENT header:
2235 \end_layout
2237 \begin_layout Itemize
2238 Header name: "COMMENT"
2239 \end_layout
2241 \begin_layout Itemize
2242 Components: 2 or more
2243 \end_layout
2245 \begin_layout Itemize
2246 Arguments: free form
2247 \end_layout
2249 \begin_layout Itemize
2250 Mandatory: No
2251 \end_layout
2253 \begin_layout Standard
2254 Various kinds of free form data.
2255  Not parsed further by emulator.
2256 \end_layout
2258 \begin_layout Subsection
2259 Initialization segment:
2260 \end_layout
2262 \begin_layout Standard
2263 If SAVESTATEID header isn't present (not a save state), member "initialization"
2264  gives PC initialization parameters for assembling the PC.
2265  It is present anyway even if SAVESTATEID is present (savestate).
2266 \end_layout
2268 \begin_layout Standard
2269 Following parameters are used (space separates components):
2270 \end_layout
2272 \begin_layout LyX-Code
2273 "BIOS" <id>
2274 \end_layout
2276 \begin_layout Standard
2277 Gives Image ID of main system BIOS (mandatory)
2278 \end_layout
2280 \begin_layout LyX-Code
2281 "VGABIOS" <id>
2282 \end_layout
2284 \begin_layout Standard
2285 Gives Image ID of VGA BIOS (mandatory).
2286 \end_layout
2288 \begin_layout LyX-Code
2289 "HDA" <id>
2290 \end_layout
2292 \begin_layout Standard
2293 Gives Image ID of hda.
2294  Present only if system has hard disk hda.
2295 \end_layout
2297 \begin_layout LyX-Code
2298 "HDB" <id>
2299 \end_layout
2301 \begin_layout Standard
2302 Gives Image ID of hdb.
2303  Present only if system has hard disk hdb.
2304 \end_layout
2306 \begin_layout LyX-Code
2307 "HDC" <id>
2308 \end_layout
2310 \begin_layout Standard
2311 Gives Image ID of hdc.
2312  Present only if system has hard disk hdc.
2313 \end_layout
2315 \begin_layout LyX-Code
2316 "HDD" <id>
2317 \end_layout
2319 \begin_layout Standard
2320 Gives Image ID of hdd.
2321  Present only if system has hard disk hdd.
2322 \end_layout
2324 \begin_layout LyX-Code
2325 "DISK" <num> <id>
2326 \end_layout
2328 \begin_layout Standard
2329 Gives Image ID of disk in slot <num>.
2330  Slot number must be non-negative.
2331 \end_layout
2333 \begin_layout LyX-Code
2334 \begin_inset Quotes eld
2335 \end_inset
2337 DISKNAME
2338 \begin_inset Quotes erd
2339 \end_inset
2341  <num> <name>
2342 \end_layout
2344 \begin_layout Standard
2345 kGives image name of disk in slot <num>.
2346  Slot number must be non-negative.
2347  The slot must be previously declared using 
2348 \begin_inset Quotes eld
2349 \end_inset
2351 DISK
2352 \begin_inset Quotes erd
2353 \end_inset
2356 \end_layout
2358 \begin_layout LyX-Code
2359 "FDA" <num>
2360 \end_layout
2362 \begin_layout Standard
2363 Gives Image slot to initially put into floppy drive fda.
2364  Disk must be of floppy type.
2365  If none present, no disk is initially put there.
2366 \end_layout
2368 \begin_layout LyX-Code
2369 "FDB" <num>
2370 \end_layout
2372 \begin_layout Standard
2373 Gives Image slot to initially put into floppy drive fdb.
2374  Disk must be of floppy type.
2375  If none present, no disk is initially put there.
2376 \end_layout
2378 \begin_layout LyX-Code
2379 "CDROM" <num>
2380 \end_layout
2382 \begin_layout Standard
2383 Gives Image slot to initially put into CD-ROM drive hdc.
2384  Not allowed if hard disk hdc is present.
2385  Disk must be of CD-ROM type.
2386  If none present no disk is initially put there.
2387 \end_layout
2389 \begin_layout LyX-Code
2390 "INITIALTIME" <time>
2391 \end_layout
2393 \begin_layout Standard
2394 Number of milliseconds since Unix epoch to system start up time.
2395  Allowed range:
2396 \end_layout
2398 \begin_layout Standard
2399 0-4102444799999.
2400  Mandatory.
2401 \end_layout
2403 \begin_layout LyX-Code
2404 "CPUDIVIDER" <divider>
2405 \end_layout
2407 \begin_layout Standard
2408 Set CPU frequency divider (dividing the 1GHz master clock).
2409  Allowed range is 1-256.
2410  Mandatory.
2411 \end_layout
2413 \begin_layout LyX-Code
2414 "MEMORYSIZE" <pages>
2415 \end_layout
2417 \begin_layout Standard
2418 Number of 4KiB pages of RAM memory.
2419  Allowed range 256-262144.
2420  Mandatory.
2421 \end_layout
2423 \begin_layout LyX-Code
2424 "BOOT" <device>
2425 \end_layout
2427 \begin_layout Standard
2428 Set boot device.
2429  Valid devices are "FLOPPY" (boot from fda), "HDD" (boot from hda) and "CDROM"
2430  (boot from CD).
2431 \end_layout
2433 \begin_layout LyX-Code
2434 "LOADMODULEA" <module> <parameters>
2435 \end_layout
2437 \begin_layout Standard
2438 Load module <module> with parameters <parameters>.
2439 \end_layout
2441 \begin_layout LyX-Code
2442 "LOADMODULE" <module>
2443 \end_layout
2445 \begin_layout Standard
2446 Load module <module> with no parameters
2447 \end_layout
2449 \begin_layout LyX-Code
2450 \begin_inset Quotes eld
2451 \end_inset
2454 \begin_inset Quotes erd
2455 \end_inset
2457  <fpu>
2458 \end_layout
2460 \begin_layout Standard
2461 Use class <fpu> as FPU emulator.
2462 \end_layout
2464 \begin_layout LyX-Code
2465 \begin_inset Quotes eld
2466 \end_inset
2468 IOPORTDELAY
2469 \begin_inset Quotes erd
2470 \end_inset
2473 \end_layout
2475 \begin_layout Standard
2476 Use I/O port delay emulation (each I/O port read/write takes 666ns).
2477 \end_layout
2479 \begin_layout LyX-Code
2480 \begin_inset Quotes eld
2481 \end_inset
2483 VGAHRETRACE
2484 \begin_inset Quotes erd
2485 \end_inset
2488 \end_layout
2490 \begin_layout Standard
2491 Emulate VGA horizontal retrace.
2492 \end_layout
2494 \begin_layout Subsection
2495 Event record format:
2496 \end_layout
2498 \begin_layout Standard
2499 Event record is in archive member "events".
2500  It uses line component encoding.
2501  Each line gives an event.
2502  First component of each line gives time stamp.
2503  These timestamps MUST be in increasing order and all MUST be non-negative.
2504  Time stamp time unit is exactly 1 nanosecond of emulated time.
2505 \end_layout
2507 \begin_layout Standard
2508 The second component of each line is name of class to dispatch to.
2509  Further components are passed as-is to event handlers.
2510  Classes with names consisting only of uppercase A-Z and 0-9 are special
2511  and reserved.
2512  It is error to encounter unknown such special class.
2513 \end_layout
2515 \begin_layout Subsubsection
2516 Savestate event
2517 \end_layout
2519 \begin_layout Itemize
2520 Dispatch to: SAVESTATE
2521 \end_layout
2523 \begin_layout Itemize
2524 Argument #1: Savestate id
2525 \end_layout
2527 \begin_layout Itemize
2528 Argument #2 (optional): Rerecord count at time of saving savestate
2529 \end_layout
2531 \begin_layout Standard
2532 Signals that savestate has occured here.
2533  The save state IDs MUST be unique in entire event stream.
2534  The second argument to savestate (if present) is rerecord count at time
2535  of saving that savestate (useful for calulating rerecord count of movie
2536  starting from savestate).
2537  No time restrictions
2538 \end_layout
2540 \begin_layout Subsubsection
2541 Option event
2542 \end_layout
2544 \begin_layout Itemize
2545 Dispatch to: OPTION
2546 \end_layout
2548 \begin_layout Itemize
2549 Argument #1: 
2550 \begin_inset Quotes eld
2551 \end_inset
2553 ABSOLUTE
2554 \begin_inset Quotes erd
2555 \end_inset
2557  or 
2558 \begin_inset Quotes eld
2559 \end_inset
2561 RELATIVE
2562 \begin_inset Quotes erd
2563 \end_inset
2566 \end_layout
2568 \begin_layout Standard
2569 Controls various options.
2571 \begin_inset Quotes eld
2572 \end_inset
2574 ABSOLUTE
2575 \begin_inset Quotes erd
2576 \end_inset
2578  turns on absolute mode (default) where event timestamps are absolute.
2580 \begin_inset Quotes eld
2581 \end_inset
2583 RELATIVE
2584 \begin_inset Quotes erd
2585 \end_inset
2587  turns on relative mode where event timestamps are relative to last event
2588  in stream.
2589  The OPTION event itself is not affected by timing change.
2590  No time restrictions.
2591  Unknown arguments are errors.
2592 \end_layout
2594 \begin_layout Subsubsection
2595 Keyboard keypress/keyrelease event:
2596 \end_layout
2598 \begin_layout Itemize
2599 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2600 \end_layout
2602 \begin_layout Itemize
2603 Argument #1: Fixed: "KEYEDGE"
2604 \end_layout
2606 \begin_layout Itemize
2607 Argument #2: Key number.
2608  Valid values are 1-83, 85-95, 129-197 and 199-223
2609 \end_layout
2611 \begin_layout Standard
2612 Send key press or key release.
2613  Keys work in toggle button manner.
2614  The event time must be multiple of 66 666, and must not be less than 60
2615  * 66 666 TUs after last PAUSE event, 20 * 66 666 TUs after last KEYEDGE
2616  on key >128 and 10 * 66 666 TUs after last KEYEDGE on key <128.
2617 \end_layout
2619 \begin_layout Subsubsection
2620 Pause event:
2621 \end_layout
2623 \begin_layout Itemize
2624 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2625 \end_layout
2627 \begin_layout Itemize
2628 Argument #1: Fixed: "PAUSE"
2629 \end_layout
2631 \begin_layout Standard
2632 Send pause key event.
2633  The time restrictions are identical to KEYEDGE event.
2634 \end_layout
2636 \begin_layout Subsubsection
2637 Mouse button event:
2638 \end_layout
2640 \begin_layout Itemize
2641 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2642 \end_layout
2644 \begin_layout Itemize
2645 Argument #1: Fixed: "MOUSEBUTTON"
2646 \end_layout
2648 \begin_layout Itemize
2649 Argument #2: Number of button to release or press (0-4)
2650 \end_layout
2652 \begin_layout Standard
2653 Presses or releases the designated mouse button.
2654 \end_layout
2656 \begin_layout Subsubsection
2657 X mouse motion event:
2658 \end_layout
2660 \begin_layout Itemize
2661 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2662 \end_layout
2664 \begin_layout Itemize
2665 Argument #1: Fixed: "XMOUSEMOTION"
2666 \end_layout
2668 \begin_layout Itemize
2669 Argument #2: Number of units to move (-255 - 255)
2670 \end_layout
2672 \begin_layout Standard
2673 Move the mouse in X direction by specified amount.
2674  Positive is right.
2675 \end_layout
2677 \begin_layout Subsubsection
2678 Y mouse motion event:
2679 \end_layout
2681 \begin_layout Itemize
2682 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2683 \end_layout
2685 \begin_layout Itemize
2686 Argument #1: Fixed: "YMOUSEMOTION"
2687 \end_layout
2689 \begin_layout Itemize
2690 Argument #2: Number of units to move (-255 - 255)
2691 \end_layout
2693 \begin_layout Standard
2694 Move the mouse in Y direction by specified amount.
2695  Positive is up.
2696 \end_layout
2698 \begin_layout Subsubsection
2699 Z mouse motion event:
2700 \end_layout
2702 \begin_layout Itemize
2703 Dispatch to: org.jpc.emulator.peripheral.Keyboard
2704 \end_layout
2706 \begin_layout Itemize
2707 Argument #1: Fixed: "ZMOUSEMOTION"
2708 \end_layout
2710 \begin_layout Itemize
2711 Argument #2: Number of units to move (-7 - 7)
2712 \end_layout
2714 \begin_layout Standard
2715 Move the mouse in Z direction (scrollwheel) by specified amount.
2716 \end_layout
2718 \begin_layout Subsubsection
2719 Joystick button event:
2720 \end_layout
2722 \begin_layout Itemize
2723 Dispatch to: org.jpc.modules.Joystick
2724 \end_layout
2726 \begin_layout Itemize
2727 Argument #1: 
2728 \begin_inset Quotes eld
2729 \end_inset
2731 BUTTONA
2732 \begin_inset Quotes erd
2733 \end_inset
2736 \begin_inset Quotes eld
2737 \end_inset
2739 BUTTONB
2740 \begin_inset Quotes erd
2741 \end_inset
2744 \begin_inset Quotes eld
2745 \end_inset
2747 BUTTONC
2748 \begin_inset Quotes erd
2749 \end_inset
2751  or 
2752 \begin_inset Quotes eld
2753 \end_inset
2755 BUTTOND
2756 \begin_inset Quotes erd
2757 \end_inset
2760 \end_layout
2762 \begin_layout Itemize
2763 Argument #2: 
2764 \begin_inset Quotes eld
2765 \end_inset
2768 \begin_inset Quotes erd
2769 \end_inset
2771  if released, 
2772 \begin_inset Quotes eld
2773 \end_inset
2776 \begin_inset Quotes erd
2777 \end_inset
2779  if pressed
2780 \end_layout
2782 \begin_layout Standard
2783 Send button down/up event.
2784  No time restrictions.
2785 \end_layout
2787 \begin_layout Subsubsection
2788 Joystick axis event:
2789 \end_layout
2791 \begin_layout Itemize
2792 Dispatch to: org.jpc.modules.Joystick
2793 \end_layout
2795 \begin_layout Itemize
2796 Argument #1: 
2797 \begin_inset Quotes eld
2798 \end_inset
2800 AXISA
2801 \begin_inset Quotes erd
2802 \end_inset
2805 \begin_inset Quotes eld
2806 \end_inset
2808 AXISB
2809 \begin_inset Quotes erd
2810 \end_inset
2813 \begin_inset Quotes eld
2814 \end_inset
2816 AXISC
2817 \begin_inset Quotes erd
2818 \end_inset
2820  or 
2821 \begin_inset Quotes eld
2822 \end_inset
2824 AXISD
2825 \begin_inset Quotes erd
2826 \end_inset
2829 \end_layout
2831 \begin_layout Itemize
2832 Argument #2: Multivibrator unstable state length in ns.
2833 \end_layout
2835 \begin_layout Standard
2836 Set amount of time multivibrator remains in unstable state.
2837  No time restrictions.
2838 \end_layout
2840 \begin_layout Subsubsection
2841 Reboot:
2842 \end_layout
2844 \begin_layout Itemize
2845 Dispatch to: org.jpc.emulator.PC$ResetButton
2846 \end_layout
2848 \begin_layout Itemize
2849 No arguments
2850 \end_layout
2852 \begin_layout Standard
2853 Reboots the PC.
2854 \end_layout
2856 \begin_layout Subsubsection
2857 Fda disk change:
2858 \end_layout
2860 \begin_layout Itemize
2861 Dispatch to: org.jpc.emulator.PC$DiskChanger
2862 \end_layout
2864 \begin_layout Itemize
2865 Argument #1: Fixed: "FDA"
2866 \end_layout
2868 \begin_layout Itemize
2869 Argument #2: Number of image slot to put there.
2871 \end_layout
2873 \begin_layout Standard
2874 The disk number MUST be -1 or valid disk number.
2875  -1 MUST NOT be used if there is no disk in floppy drive A.
2876  This event causes specified disk to be placed to FDA or FDA disk to be
2877  ejected with no replacement if disk number is -1.
2878  The specified disk if not -1 must be of floppy type.
2879  The specified disk if valid must not be in any other drive.
2880 \end_layout
2882 \begin_layout Subsubsection
2883 Fdb disk change:
2884 \end_layout
2886 \begin_layout Itemize
2887 Dispatch to: org.jpc.emulator.PC$DiskChanger
2888 \end_layout
2890 \begin_layout Itemize
2891 Argument #1: Fixed: "FDB"
2892 \end_layout
2894 \begin_layout Itemize
2895 Argument #2: Number of image slot to put there.
2897 \end_layout
2899 \begin_layout Standard
2900 The disk number MUST be -1 or valid disk number.
2901  -1 MUST NOT be used if there is no disk in floppy drive B.
2902  This event causes specified disk to be placed to FDB or FDB disk to be
2903  ejected with no replacement if disk number is -1.
2904  The specified disk if not -1 must be of floppy type.
2905  The specified disk if valid must not be in any other drive.
2906 \end_layout
2908 \begin_layout Subsubsection
2909 Change CDROM:
2910 \end_layout
2912 \begin_layout Itemize
2913 Dispatch to: org.jpc.emulator.PC$DiskChanger
2914 \end_layout
2916 \begin_layout Itemize
2917 Argument #1: Fixed: "CDROM"
2918 \end_layout
2920 \begin_layout Itemize
2921 Argument #2: Number of image slot to put there.
2923 \end_layout
2925 \begin_layout Standard
2926 The disk number MUST be -1 or valid disk number.
2927  -1 MUST NOT be used if there is no disk in CD-ROM.
2928  This event causes specified disk to be placed to CD-ROM or CD-ROM disk
2929  to be ejected with no replacement if disk number is -1.
2930  The specified disk if not -1 must be of CD-ROM type.
2931 \end_layout
2933 \begin_layout Standard
2934 This event has no effect if CD-ROM is locked.
2935 \end_layout
2937 \begin_layout Subsubsection
2938 Write protect floppy:
2939 \end_layout
2941 \begin_layout Itemize
2942 Dispatch to: org.jpc.emulator.PC$DiskChanger
2943 \end_layout
2945 \begin_layout Itemize
2946 Argument #1: Fixed: "WRITEPROTECT"
2947 \end_layout
2949 \begin_layout Itemize
2950 Argument #2: Number of image slot to manipulate 
2951 \end_layout
2953 \begin_layout Standard
2954 Write protects specified disk.
2955  The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2956 \end_layout
2958 \begin_layout Subsubsection
2959 Write unprotect floppy:
2960 \end_layout
2962 \begin_layout Itemize
2963 Dispatch to: org.jpc.emulator.PC$DiskChanger
2964 \end_layout
2966 \begin_layout Itemize
2967 Argument #1: Fixed: "WRITEUNPROTECT"
2968 \end_layout
2970 \begin_layout Itemize
2971 Argument #2: Number of image slot to manipulate 
2972 \end_layout
2974 \begin_layout Standard
2975 Disables write protection specified disk.
2976  The disk MUST NOT be in any drive and MUST be valid floppy-type disk.
2977 \end_layout
2979 \begin_layout Subsection
2980 Diskinfo sections
2981 \end_layout
2983 \begin_layout Standard
2984 Diskinfo sections are named 
2985 \begin_inset Quotes eld
2986 \end_inset
2988 diskinfo-
2989 \begin_inset Quotes erd
2990 \end_inset
2992 <id of disk>.
2993  They use line component encoding, fieldtype being first component on each
2994  line (value being the second).
2995  Following fields are defined:
2996 \end_layout
2998 \begin_layout Subsubsection
2999 TYPE
3000 \end_layout
3002 \begin_layout Standard
3003 Gives type of image.
3004  Possible values are
3005 \end_layout
3007 \begin_layout Itemize
3008 \begin_inset Quotes eld
3009 \end_inset
3011 FLOPPY
3012 \begin_inset Quotes erd
3013 \end_inset
3015  (floppy disk)
3016 \end_layout
3018 \begin_layout Itemize
3019 \begin_inset Quotes eld
3020 \end_inset
3023 \begin_inset Quotes erd
3024 \end_inset
3026  (Hard disk)
3027 \end_layout
3029 \begin_layout Itemize
3030 \begin_inset Quotes eld
3031 \end_inset
3033 CDROM
3034 \begin_inset Quotes erd
3035 \end_inset
3037  (CD-ROM)
3038 \end_layout
3040 \begin_layout Itemize
3041 \begin_inset Quotes eld
3042 \end_inset
3044 BIOS
3045 \begin_inset Quotes erd
3046 \end_inset
3048  (BIOS/VGABIOS image)
3049 \end_layout
3051 \begin_layout Itemize
3052 \begin_inset Quotes eld
3053 \end_inset
3055 UNKNOWN
3056 \begin_inset Quotes erd
3057 \end_inset
3059  (what the heck is this???)
3060 \end_layout
3062 \begin_layout Subsubsection
3064 \end_layout
3066 \begin_layout Standard
3067 Gives ID of disk.
3068 \end_layout
3070 \begin_layout Subsubsection
3071 IMAGELENGTH
3072 \end_layout
3074 \begin_layout Standard
3075 (BIOS images only) Gives length of BIOS image
3076 \end_layout
3078 \begin_layout Subsubsection
3079 IMAGEMD5
3080 \end_layout
3082 \begin_layout Standard
3083 MD5 of raw disk/BIOS image without any headers or trailers.
3084 \end_layout
3086 \begin_layout Subsubsection
3087 TOTALSECTORS
3088 \end_layout
3090 \begin_layout Standard
3091 (FLOPPY/HDD/CDROM images only) Number of total sectors on disk.
3092 \end_layout
3094 \begin_layout Subsubsection
3095 TRACKS
3096 \end_layout
3098 \begin_layout Standard
3099 (FLOPPY/HDD images only) Number of tracks on disk per side (1-256 for floppy,
3100  1-1024 for HDD).
3101 \end_layout
3103 \begin_layout Subsubsection
3104 SIDES
3105 \end_layout
3107 \begin_layout Standard
3108 (FLOPPY/HDD images only) Number of sides on disk (1 or 2 for floppy, 1-16
3109  for HDD).
3110 \end_layout
3112 \begin_layout Subsubsection
3113 SECTORS
3114 \end_layout
3116 \begin_layout Standard
3117 (FLOPPY/HDD images only) Number of sectors per track (1-255 for floppy,
3118  1-63 for HDD).
3119 \end_layout
3121 \begin_layout Subsubsection
3122 COMMENT
3123 \end_layout
3125 \begin_layout Standard
3126 Line from image comment block.
3127  Usually give data about files image has.
3128  May or may not be present (multiple times)
3129 \end_layout
3131 \begin_layout Subsection
3132 Output info
3133 \end_layout
3135 \begin_layout Standard
3136 Output info is stored in section 
3137 \begin_inset Quotes eld
3138 \end_inset
3140 output-info
3141 \begin_inset Quotes erd
3142 \end_inset
3145  Its relatively new, so it might not be present (then the contents have
3146  to be guessed based on modules present).
3147  Each line gives information about one output, first field being the type
3148  of output.
3149 \end_layout
3151 \begin_layout Subsubsection
3152 Video output
3153 \end_layout
3155 \begin_layout Standard
3156 For video output, there are no parameters so line is just 
3157 \begin_inset Quotes eld
3158 \end_inset
3160 VIDEO
3161 \begin_inset Quotes erd
3162 \end_inset
3164  (one component).
3165 \end_layout
3167 \begin_layout Subsubsection
3168 Audio output
3169 \end_layout
3171 \begin_layout Standard
3172 For audio output, the only parameter is name of output, so first component
3173  is 
3174 \begin_inset Quotes eld
3175 \end_inset
3177 AUDIO
3178 \begin_inset Quotes erd
3179 \end_inset
3181  and second component is name of audio output.
3182 \end_layout
3184 \begin_layout Subsection
3185 Savestates
3186 \end_layout
3188 \begin_layout Standard
3189 Actual savestate format is not documented here.
3190  It is close to impossible to comprehend without access to emulator source
3191  anyway.
3192 \end_layout
3194 \begin_layout Section
3195 Advanced: Making class dumpable
3196 \end_layout
3198 \begin_layout Standard
3199 Class is made dumpable by implementing interface org.jpc.emulator.SRDumpable
3200  and implementing method dumpSRPartial(org.jpc.emulator.SRDumper) and constructor
3201  <init>(org.jpc.emulator.SRLoader).
3202  Non-static inner classes can not be dumpable (make them static using tricks
3203  similar to what javac uses).
3204 \end_layout
3206 \begin_layout Standard
3207 If dumped class has dumpable superclass, the first thing dumping function
3208  needs to do is to call dumper function of superclass and first thing loading
3209  constructor needs to do is to call loading constructor of superclass.
3210  If class has no dumpable superclass, dumper doesn't need to do anything
3211  special, while loader needs to call objectCreated(this) on SRLoader object
3212  passed as parameter.
3214 \end_layout
3216 \begin_layout Standard
3217 Following these fixed parts, dump all members that are part of mutable state
3218  in emulator core.
3219 \end_layout
3221 \begin_layout Subsection
3222 Member dumping/loading functions
3223 \end_layout
3225 \begin_layout Standard
3226 There is dumping/loading function for following (all functions dumping/loading
3227  reference types can handle null):
3228 \end_layout
3230 \begin_layout Itemize
3231 boolean: SRDumper.dumpBoolean, SRLoader.loadBoolean
3232 \end_layout
3234 \begin_layout Itemize
3235 byte: SRDumper.dumpByte, SRLoader.loadByte
3236 \end_layout
3238 \begin_layout Itemize
3239 short: SRDumper.dumpShort, SRLoader.loadShort
3240 \end_layout
3242 \begin_layout Itemize
3243 int: SRDumper.dumpInt, SRLoader.loadInt
3244 \end_layout
3246 \begin_layout Itemize
3247 long: SRDumper.dumpLong, SRLoader.loadLong
3248 \end_layout
3250 \begin_layout Itemize
3251 String: SRDumper.dumpString, SRLoader.loadString
3252 \end_layout
3254 \begin_layout Itemize
3255 boolean[]: SRDumper.dumpArray, SRLoader.loadArrayBoolean
3256 \end_layout
3258 \begin_layout Itemize
3259 byte[]: SRDumper.dumpArray, SRLoader.loadArrayByte
3260 \end_layout
3262 \begin_layout Itemize
3263 short[]: SRDumper.dumpArray, SRLoader.loadArrayShort
3264 \end_layout
3266 \begin_layout Itemize
3267 int[]: SRDumper.dumpArray, SRLoader.loadArrayInt
3268 \end_layout
3270 \begin_layout Itemize
3271 long[]: SRDumper.dumpArray, SRLoader.loadArrayLong
3272 \end_layout
3274 \begin_layout Itemize
3275 double[]: SRDumper.dumpArray, SRLoader.loadArrayDouble
3276 \end_layout
3278 \begin_layout Itemize
3279 <dumpable type>: SRDumper.dumpObject, SRLoader.loadObject
3280 \end_layout
3282 \begin_layout Itemize
3283 special object: SRDumper.specialObject, SRLoader.specialObject
3284 \end_layout
3286 \begin_layout Subsubsection
3287 Notes:
3288 \end_layout
3290 \begin_layout Itemize
3291 Dumpable objects come out as type of org.jpc.emulator.SRDumpable.
3292 \end_layout
3294 \begin_layout Itemize
3295 Special objects are various static objects that don't need to be stored
3296  because they don't have mutable fields.
3297 \end_layout
3299 \begin_layout Itemize
3300 Don't dump fields related to event state feedback.
3301 \end_layout
3303 \begin_layout Itemize
3304 Don't dump temporary flags that are only used while PC is running.
3305  Savestate when PC is running isn't possible anyway.
3306 \end_layout
3308 \begin_layout Itemize
3309 Some connectors dump fields related to connector output, some don't.
3310 \end_layout
3312 \begin_layout Section
3313 Advanced: Writing event targets
3314 \end_layout
3316 \begin_layout Standard
3317 Whereas output connectors are the way output is dispatched, input is dispatched
3318  via event targets.
3319  Event targets need to implement interface org.jpc.emulator.EventDispatchTarget.
3320 \end_layout
3322 \begin_layout Standard
3323 Event targets also provode methods which then encode events and dispatch
3324  them forward (without doing anything else) to event recorder.
3325  Also, event targets may have methods for obtaining state.
3326 \end_layout
3328 \begin_layout Subsection
3329 Interface org.jpc.emulator.EventDispatchTarget
3330 \end_layout
3332 \begin_layout Standard
3333 Interface that marks class capable of receiving events.
3334 \end_layout
3336 \begin_layout Subsubsection
3337 Method setEventRecorder(EventRecorder)
3338 \end_layout
3340 \begin_layout Standard
3341 Set the event recorder input events are sent to.
3342 \end_layout
3344 \begin_layout Subsubsection
3345 Method startEventCheck()
3346 \end_layout
3348 \begin_layout Standard
3349 Signals target to reset all state related to event checking and state feedback.
3350  This may be called at any time in order to reinitialialize event checking/feedb
3351 ack state.
3352 \end_layout
3354 \begin_layout Subsubsection
3355 Method doEvent(long, String[], int) throws IOException
3356 \end_layout
3358 \begin_layout Standard
3359 Event dispatch handler.
3360  The first argument is event time, second is parameters and third is what
3361  to do with it.
3362  If target doesn't like the event, throw IOException.
3363  Following types (the integer parameter) are used:
3364 \end_layout
3366 \begin_layout LyX-Code
3367 0 (EventRecorder.EVENT_TIMED): Time has been assigned for event.
3368 \end_layout
3370 \begin_layout LyX-Code
3371 1 (EventRecorder.EVENT_STATE_EFFECT_FUTURE): Future event in event replay
3372  for reinitialization
3373 \end_layout
3375 \begin_layout LyX-Code
3376 2 (EventRecorder.EVENT_STATE_EFFECT): Past event in event replay reinitialization
3377 \end_layout
3379 \begin_layout LyX-Code
3380 3 (EventRecorder.EVENT_EXECUTE): This event occurs now.
3381  Execute the effect.
3382 \end_layout
3384 \begin_layout Subsubsection
3385 Method endEventCheock()
3386 \end_layout
3388 \begin_layout Standard
3389 End event reinitialization.
3390  Usually unused.
3391 \end_layout
3393 \begin_layout Subsubsection
3394 Method getEventTimeLowBound(long, String[]) throws IOException
3395 \end_layout
3397 \begin_layout Standard
3398 Return the time value that's the earliest possiblity for this event to occur.
3399  Returning any time in past (including -1) causes event to fire as soon
3400  as possible.
3401  The long parameter gives the current scheduled time for event.
3402 \end_layout
3404 \begin_layout Section
3405 Writing modules
3406 \end_layout
3408 \begin_layout Standard
3409 Modules are various extensions that run inside emulator core.
3410  As such, they affect sync.
3411  Modules must implement interface org.jpc.emulator.HardwareComponent (they
3412  are hardware components) and must be dumpable.
3413  Additionally, they need either constructor <init>() or <init>(String).
3414  The first is if no parameters are passed, the second is for case where
3415  parameters are passed.
3416 \end_layout
3418 \begin_layout Standard
3419 Aside of the constructors, modules need to obey the ordinary conventions
3420  for hardware components.
3421  No code outside modules needs to know that module exists.
3422 \end_layout
3424 \begin_layout Section
3425 Writing plugins
3426 \end_layout
3428 \begin_layout Standard
3429 Plugins handle various UI tasks.
3430  They need to implement interface org.jpc.Plugin.
3431 \end_layout
3433 \begin_layout Subsection
3434 Interface org.jpc.pluginsbase.Plugin
3435 \end_layout
3437 \begin_layout Subsubsection
3438 Method systemShutdown()
3439 \end_layout
3441 \begin_layout Standard
3442 Called when emulator shuts down.
3443  Either called in dedicated thread or in thread that called emulatorShutdown().
3444  These handlers should do the bare minimum to get files on disk to consistent
3445  state.
3446  After these calls from all plugins have finished, emulator exits.
3447  Do not try to manipulate UI from these methods, as doing that easily leads
3448  into deadlock.
3449 \end_layout
3451 \begin_layout Subsubsection
3452 Method reconnect(PC) 
3453 \end_layout
3455 \begin_layout Standard
3456 Gives new PC to connect to.
3457  Null is passed if plugin should disconnect.
3458 \end_layout
3460 \begin_layout Subsubsection
3461 Method main()
3462 \end_layout
3464 \begin_layout Standard
3465 Called in dedicated thread after plugin is initialized.
3466 \end_layout
3468 \begin_layout Subsubsection
3469 Method pcStopping()
3470 \end_layout
3472 \begin_layout Standard
3473 Called after PC has stopped.
3474 \end_layout
3476 \begin_layout Subsubsection
3477 Method pcStarting()
3478 \end_layout
3480 \begin_layout Standard
3481 Called before PC starts.
3482 \end_layout
3484 \begin_layout Subsubsection
3485 Method notifyArguments(String[])
3486 \end_layout
3488 \begin_layout Standard
3489 Pass arguments from command line.
3490 \end_layout
3492 \begin_layout Subsubsection
3493 Constructor <init>(Plugins)
3494 \end_layout
3496 \begin_layout Standard
3497 This constructor is used to initialize plugins that don't take parameters.
3498 \end_layout
3500 \begin_layout Subsubsection
3501 Constructor <init>(Plugins, String)
3502 \end_layout
3504 \begin_layout Standard
3505 This constructor is used to initialize plugins that take parameters.
3506 \end_layout
3508 \begin_layout Subsection
3509 Class org.jpc.pluginsbase.Plugins
3510 \end_layout
3512 \begin_layout Standard
3513 This class provodes various methods for manipulating plugins.
3514 \end_layout
3516 \begin_layout Subsubsection
3517 Method isShuttingDown()
3518 \end_layout
3520 \begin_layout Standard
3521 Returns true if Plugins.shutdownEmulator() has been called somehow, either
3522  via VM exit, CTRL+C or explicitly.
3523  Useful to skip cleanups involving GUI, as these are too deadlock-prone.
3524 \end_layout
3526 \begin_layout Subsubsection
3527 Method shutdownEmulator()
3528 \end_layout
3530 \begin_layout Standard
3531 Shut down and exit the emulator.
3532  All plugin shutdown functions are called in this thread.
3533 \end_layout
3535 \begin_layout Subsubsection
3536 Method reconnectPC(PC)
3537 \end_layout
3539 \begin_layout Standard
3540 Signal reconnectPC event to all plugins.
3541 \end_layout
3543 \begin_layout Subsubsection
3544 Method pcStarted()
3545 \end_layout
3547 \begin_layout Standard
3548 Signal pcStarting() event to all plugins.
3549 \end_layout
3551 \begin_layout Subsubsection
3552 Method pcStopped()
3553 \end_layout
3555 \begin_layout Standard
3556 Signal pcStopping() event to all plugins.
3557 \end_layout
3559 \begin_layout Section
3560 Inter-plugin communication
3561 \end_layout
3563 \begin_layout Subsection
3564 Receiving communications
3565 \end_layout
3567 \begin_layout Standard
3568 To receive invocation/call by name 'foo-bar', declare public method named
3569  'eci_foo_bar'.
3570  Arguments to this method can currently be String, Integer (int) or Long
3571  (long).
3572  Last argument may be array over these types to get variable number of arguments.
3573  On call, each argument gets value from call.
3574  If last argument is array, it gets all overflowing arguments.
3575  If return type is void or method returns boolean false, call is assumed
3576  to have completed.
3577  If return value is boolean true, it is assumed that there is more processing.
3578 \end_layout
3580 \begin_layout Subsection
3581 void org.jpc.pluginsbase.Plugins.invokeExternalCommand(String cmd, Object[]
3582  args) 
3583 \end_layout
3585 \begin_layout Standard
3586 Invoke command asynchronously, broadcasting to all plugins.
3587  Does not wait for slow commands to complete.
3588  cmd is the name to send and args are the arguments to pass.
3589 \end_layout
3591 \begin_layout Subsection
3592 void org.jpc.pluginsbase.Plugins.invokeExternalCommandSynchronous(String cmd,
3593  Object[] args) 
3594 \end_layout
3596 \begin_layout Standard
3597 Same as invokeExternalCommand, but waits for slow commands to complete.
3598 \end_layout
3600 \begin_layout Subsection
3601 Object[] org.jpc.pluginsbase.Plugins.invokeExternalCommandReturn(String cmd,
3602  Object[] args) 
3603 \end_layout
3605 \begin_layout Standard
3606 Similar to invokeExternalCommandSynchornous, but:
3607 \end_layout
3609 \begin_layout Itemize
3610 Quits calling more plugins when it gets successful reply.
3611 \end_layout
3613 \begin_layout Itemize
3614 Returns said reply
3615 \end_layout
3617 \begin_layout Subsection
3618 void org.jpc.pluginsbase.Plugins.returnValue(Object...
3619  ret)
3620 \end_layout
3622 \begin_layout Standard
3623 Gives return value to return from call and signals that command has completed.
3624 \end_layout
3626 \begin_layout Subsection
3627 void org.jpc.pluginsbase.Plugins.signalCommandCompletion()
3628 \end_layout
3630 \begin_layout Standard
3631 Signals that command has completed.
3632  Only needed if there is no return value and eci_ method returned false
3633  (not done yet).
3634 \end_layout
3636 \begin_layout Section
3637 Lua kernel programming
3638 \end_layout
3640 \begin_layout Standard
3641 At startup, kernel gets its arguments in 'args' table and the script name
3642  to run in 'scriptname' string.
3643  It should enter the named script in protected mode.
3644 \end_layout
3646 \begin_layout Standard
3647 The Lua VM exports numerious callbacks to kernel.
3648  The kernel can then choose to omit, wrap or re-export these to Lua scripts.
3649 \end_layout
3651 \begin_layout Itemize
3652 Always grab any functions used into local variables so nobody can mess with
3653  them
3654 \end_layout
3656 \begin_layout Itemize
3657 Don't use global variables in kernel (except for those passed).
3658 \end_layout
3660 \end_body
3661 \end_document