,nj
,pc @
2.1.1.3.17 Read Directory Entry

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $1C              Read Directory Entry ID
Byte 4        : DOS FCBN         File Control Block No.
Byte 5 .. 6   : direntry         Directory entry no.

Status Message

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : status           Status byte
Byte 4        : byte count       Length of pathname
Byte 5 .. nn  : entry name       Filename/directory name

This message returns information about a given directory entry of a DOS directory. The directory must have previously been opened with the open command with read directory access and the directory entry number must be an integer number from 0 to total no. of entries. A status byte of EOF is returned if an entry higher than the number of directory entries is supplied. 

If the operation is successful, a byte count is returned indicating the length of the directory entry to be returned, followed by the entry information. For Windows 3.1 this can be up to 13 characters (8 dot 3 filenames), for Windows 95/NT a maximum of 255 characters can be returned.

2.1.1.3.18 Test Device Ready

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $1F              Test Device Ready ID
Byte 4        : $01              Byte count
Byte 5        : DOS FCBN         File Control Block No.

Status Message

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : status           Status byte

This message tests if a DOS serial device opened in PCShare serial mode has data available for the host computer. The Status Byte returns 00 (Okay) if data is available and 07 (Device Not Ready) if no data is available. For non serial device, a Device Not Ready is always returned.

2.1.1.3.19 Set COM Port Configuration

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $20              Set COM Port Config ID
Byte 4        : $05              Byte count
Byte 5        : COMn             COM Port ID (1-4)
Byte 6        : Baud Rate Id     Baud Rate Id (0-10) - see below.
Byte 7        : Data Bits        No. of data bits (5-8)
Byte 8        : Parity Id        Parity Id(0=None,1=Odd,2=Even,3=Mark,4=Spc)
Byte 9        : Stop Bits        No. of stop bits (1-2).

Baud Rate Settings are as follows: 0 - 110, 1 - 150, 2 - 300, 3 - 1200, 4 - 2400, 5 - 4800, 6 - 9600, 7 - 19200, 8 - 38400, 9 - 57600, 10 - 115200.

This message configures a PC's COM port ready for serial IO with the host computer. All 4 ports can be configured. The settings supplied in this message only take effect when the port is opened in PCShare serial mode (see File Open message) otherwise they revert to the DOS MODE command settings. 

2.1.1.3.18 Status Byte

The following status byte values are defined:

 00 = OK
 01 = File Not Available. File could not be found or is unable to be created or opened. 
 02 = Buffer Allocate Failure. A file read/write transfer buffer could not be allocated.
 03 = Read Failure. 
 04 = Write Failure. 
 05 = End of File.
 06 = General IO failure. Other error condition prevented the function from being performed correctly.
 07 = Device Not Ready. Device has no data available.

2.1.1.3.19 Open/Create Access Modes

The following access modes are permitted for Open/Create calls:

 01 = Read (not create)
 02 = Write
 03 = Update
 8x = Open directory file (combined with either read,write or update).

2.1.1.4 Miscellaneous Messages

The following messages request the PCRSS to perform various miscellaneous functions.

2.1.1.4.1 Obsolete

2.1.1.4.2 Emulation Select Message

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $16              Emulation message id
Byte 4        : $01              Byte count
Byte 5        : Emulation byte   Select code      

This message selects the terminal emulation which will be performed by the PCRSS within the current active window or screen. Currently defined modes are:

 0 = No Emulation
 1 = VT100
 2 = Dragon OS9 GO51 codes

2.1.1.4.3 Set Text Attributes Message

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $1D              Text Attributes message id
Byte 4        : $02              Byte count
Byte 5        : Fore Colour      Text colour
Byte 6        : Back Colour      Text background colour

This message sets the text colours displayed for the current active window. See paragraph 2.1.1.2.3.1 for EGA/VGA colour palette values valid for this message. Only the 16 predefined colours may be used in this message.

2.1.1.4.4 Obsolete
 
2.1.1.4.5 Read PC Clock

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $21              Read Clock Message Id
Byte 4        : $00

Status Message

Byte 0 .. 2   : $AA,$FF,$FF      Message Header
Byte 3        : $07              Byte Count
Byte 4 .. 5   : Year             Time/date packet
Byte 6        : Month
Byte 7        : Day
Byte 8        : Hour
Byte 9        : Minutes
Byte 10       : Seconds

This message reads the current system time and date from the PC and returns it in a 7 byte packet to the host computer.

2.1.2 Text Data

Bytes arriving at the input port that are not recognized as valid messages are treated as textual data to be displayed. All textual data is sent to the current active window (see 2.1.4.3). Prior to displaying, the data may be passed through a piece of terminal emulation software depending on the emulation mode selected for the window. The emulation mode will interpret special escape sequences and perform screen handling operations (such as cursor positions) accordingly.

2.1.2.2 Recognized & Processed VT100 Escape Sequences (Release 3.0)

Recognized & processed VT100 escape codes are detailed in the table below. Any escape sequence not listed as recognized will be output to the PCs screen or active window as text allowing any other external peice of software to handle it if required. Any escape sequence listed as recognized but not processed will not be sent to the screen. 

Notes: ^[ = escape character (27)
      <v> = ASCII single or double digit character. Vertical coord.
      <h> = ASCII single or double digit character. Horizontal co-ord.
      <n> = ASCII single or double digit character.

VT100 Sequence   Description             Processed
                                         

     ^G          Bell.                   Yes.          
     ^H          Backspace.              Yes.          
     ^K          Home.                   Yes.          
     ^L          Clear Screen.           Yes.          
     ^I          Tab.                    Yes.          
     ^[[20h      Set new line mode.      No.          
     ^[[?1h      Set cursor key to app.  No.          
     ^[[?3h      Set number of cols 132. Yes.
     ^[[?4h      Set smooth scrolling.   No.          
     ^[[?5h      Set reverse video.      Yes.         
     ^[[?6h      Set origin to relative. No.          
     ^[[?7h      Set auto wrap mode.     Yes.         
