Extra JOYCE ED xx operations                      for JOYCE v1.35, 13 May 2000
==============================================================================

ED FD: If executed at 0xFC4E, reads the PC's real-time clock and sets the
      time fields of the SCB. Thus the BIOS "TIME" routine can be replaced
      by ED FD C9. This is done by RTC.COM.
      (v1.28+) Also works at 0xFC0F (LIST) and 0xFC2D (LISTST) to capture
      printing - done by CENPORT.COM.
       In the future, other functions may be replaced in this way.

ED FE: API. This is the main entry point for JOYCE functions.
      Some of these calls will be marked (v1.10+) or similar. If a program
      wants to use such a call, it must first check that the JOYCE version
      is greater than or equal to this number.

       A=0:  Test for JOYCE. Returns A=0FFh,
              HL=JOYCE version number BCD. If A is not 0 and not 0FFh,
                 then JOYCE has been changed in a way that would break
                 existing programs.
       A=1:  Boot. Read sector 1 from image .\BOOT\BOOTn.DSK and
                           enter it, where n is passed in B.
       A=2:  Set screen colours. BCD = RGB for "white"
                                 EHL = RGB for "black"
       A=3,4,5,6: FID_D_LOGIN, FID_D_READ, FID_D_WRITE, FID_D_FLUSH
		Entered with parameters as for the corresponding FID
                routine.
		Return Carry set or clear; .

       A=7: FID_EMS. Called with:

		BC= flag word at FID+32. If C=0FFh, driver does not
                    support floppies.
		D = reason for call:  0 => drive successfully added.
				      1 => no memory to add drive
				      2 => no drive letters to add drive
				      3 => incorrect system version
				      4 => start of FID_EMS
		E = if D=0, E=drive number added (2=C: 3=D: etc)
		HL = address of message buffer; messages can be copied
	            to here by JOYCE.

		Returns:
		 A=0: return with carry clear and message at HL.
		 A=1: return with carry set and message at HL.
		 A=2: Attempt to add a drive. B=drive number; 
			HL IX IY hold SVC_D_HOOK parameters

       A=8: Save JOYCE settings.

       A=9: Switch to LPT port given in DE (0, 1 or 2). Returns previous
            port in HL. Set DE to 0FFFFh not to change.

       A=10: File operations...
              C=0Fh: Open file to read/write. DE->pathname. Returns
                    HL=handle or 0 if failed.
              C=10h: Close file. DE=handle. Returns HL=0 if failed,
                    1 if OK.
              C=15h: Write a byte to open file. DE=handle, B=byte.
                    Returns HL=0 if failed, 1 if OK.
              C=16h: Create file for read/write, DE->name. Returns HL=0 if
                    failed, file handle if succeeded.
              C=69h: Get the time from the PC clock - as for BDOS 69h.
              C=91h: Expand filename with wildcards.
                     DE->PC afn with path
                     HL->result buffer
                     B = which file (0=first, 1=second...)

                     returns HL=0 if not found, 1 if found
                     First 11 bytes of buffer hold filename in FCB form
                     Remainder of buffer holds ASCIIZ filename with path

       A=11:   Screen operations (v1.10+)
               C = 0: Select PCW screen
               C = 1: Select 800x600x256 screen
               C = 2: Write character in E
               C = 3: Write status line character in E
               C = 4: (v1.20+) GSX call, DE->GSX PB
               C = 5: FID_EMS for screen driver FID
               C = 6: (v1.20+) Get capabilities bitmap for screen into HL. 
                        Bit 0 set if 800x600 mode is possible.
                        Bit 1 set if GSX is possible.
                        Bit 2 set if LIOS is possible.
                       Other bits of HL, DE BC IX IY all zero
                       (reserved)
                       For versions < 1.10, none of these is possible.
                       For versions < 1.20 & UNIX versions, 800x600 mode 
                                            (only) is possible.

       A=12:   (v1.12+) Keyboard operations
               C = 0: Get mapping for key DE, into HL.
               C = 1: Set mapping for key DE, in HL.
               C = 2: Set mapping for <DE> keys, at (IX):
                                                   DW DEvalue,HLvalue, ...

              In each case: E = keynumber, 1-7Fh
                            D = modifier flags, bit 0 set for "extended"
                            L = offset in PCW key map, 0-16
                            H = bitmask.
              In UNIX versions, DE = SDL keynumber 0 - SDLK_LAST.

       A=13:   (v1.21+) Serial port operations (untested)
               C = 0: Reset buffers
               C = 1: Set handshaking lines. E=lines:
                                  d0 => DTR
                                  d1 => RTS
                                  d2 => USER
                                  d4 => LOOPBACK
               C = 2: Set Baud rate & stop bits
                                  HL=Baud rate, encoded.
                                     1:50     2:75     3:110   4:134    5:150
                                     6:300    7:600    8:1200  9:1800  10:2400
                                    11:3600  12:4800  13:7200  14:9600
                                    15:19200 16:14400 17:28800 18:33600
                                    19:38400 20:57600 21:115200
                                   E=settings:
                                      d0 set for 8-bits, reset for 7
                                      d1 = 1
                                      d2 set for 2 stop bits, reset for 1
                                      d3 set if parity, else 0
                                      d4 set if parity even, clear if odd
               C = 3: Character input status. Returns A=0 if no character
                      available, 1 if there is.
               C = 4: Poll for character, return it in A (A=0 if none)
               C = 5: Character output status. Returns A=0 if no, 1 if yes
               C = 6: Output character in E
               C = 7: FID_EMS for COM port FID
               C = 8: Switch to using COM port no. E
               C = 9: Get COM port no. into A

       A=14:   (v1.22+) FID_D_MESSAGE. All parameters as for its Z80 namesake.

       A=15:   (v1.22+) Call the Logo I/O system.
                                         E = function
                                         SP->parameters
                                  results returned in HL
                                  E=0FFh to initialise, param 1 = info
                                         area. Ret HL=0 if error, 1 if OK
                                         passed HL->message area

       A=16:    (v1.22+) Parse BOOT\BOOT.CFG. B=boot number (0-9); HL->16-byte
               buffer for name. Returns A=1 if entry exists, else 0.

       A=0FCh: (v1.30+) BDOS filter for REDIR.COM and its programs. Entered
              with:
              Carry set.
               C = BDOS function
              DE = BDOS parameter
              HL = address of resident portion of REDIR.

               Returns Carry set to continue BDOS call, Carry clear to return
              to caller.

       A=0FEh: Set / Get timing parameters.
            A:=Screen refresh cycles.
           HL:=Cycles between 900Hz signals.
            C = if nonzero, new refresh cycles
           DE = if nonzero, new cycles between 900Hz signals.

