PABMessaging - jedimatt42/tipi GitHub Wiki

PAB Messaging

TIPI uses a messaging model to provide IO services to the TI-99/4A.

Details on sending and receiving messages to TIPI directly are detailed in the documentation for RawExtensions

The DSR ROM routines in TIPI for Level 3 IO operations and LVL2 IO or file management operations all use this same messaging mechanism.

Below are outlines of the message flow for each operations

  • To be filled in as interest allows. The details are also in the assembly source for the TIPI ROM

Where each RawExtension has a message type, for the PAB routines, the opcode (0-15) is used as the message type. For level 2 IO, the single byte subprogram name (16-31) is used as the message type. This is why RawExtensions start at 32 or 0x20. This is extremely convenient for a PAB as the first byte is the opcode.

Unlike the RawExtensions send, receive pairing, it is common for these workflows to break up data into multiple messages depending on source or destination in memory.

Note: TIPI python side does not enforce that the length of the devicename is limited to the single byte length specified in the last byte of the PAB. The devicename is sent as the payload of a message. The message sending has it's own message length handling.

OPEN opcode 0

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A <- TIPI : Receive single byte record length of the opened file.

By convention, if you open a file with a 0 record length in the PAB the 4A Disk Controller should open the file and update the PAB to the discovered recordlength. If you open a file with a specified record length, then the found file must match the record length. If it does not match, the 4A Disk Controller should produce an error.

CLOSE opcode 1

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.

READ opcode 2

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A <- TIPI : Receive the record data as the payload of a single message.

WRITE opcode 3

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A -> TIPI : Send the record data as the payload of a single message.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred.

RESTORE opcode 4

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.

LOAD opcode 5

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A <- TIPI : Receive the image data as the payload of a single message.

SAVE opcode 6

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A -> TIPI : Send the image data as the payload of a single message.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred.

DELETE opcode 7

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.

STATUS opcode 9

  • 4A -> TIPI : Send 10 byte PAB - The length of the message is 10 bytes.
  • 4A -> TIPI : Send the full devicename/filepath - The length of the message is the length of the devicename.
  • 4A <- TIPI : Receive a single byte result code - If not SUCCESS(0xFF) then an error occurred or TIPI chose not to handle the request.
  • 4A <- TIPI : Receive a single byte status value.