Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

General IO

James Coon edited this page Mar 21, 2017 · 2 revisions

The General IO region is used for basic input/output and for reading/queuing signals.

Address Name
$E000 Input Status
$E001 Keyboard Input
$E002 Output Status
$E003 Terminal Output
$E004 Signal Status
$E005 Signal Input
$E006 Queue Status
$E007 Queue Output
$E008 IRQ Mask
$E009 NMI Mask

Input Status:
Read: Number of byte available in buffer

Keyboard Input:
Read: Read data from input buffer
Write: Drop # of bytes from buffer (0 = All)
Characters are non zero and UTF-8 encoded
Scancodes are a zero byte followed by the scancode byte

Output Status:
(Unimplemented oops)

Terminal Output:
Write: Output data to the built in Terminal Driver
Thistle features a built in VT100 like terminal driver for OC's Graphics Card. Various ANSI escape codes are supported.

Signal Status:
Read: Number of signals available in buffer, automatically decreases when a full signal has been read

Signal Input:
Read: Read data from the signal buffer
Write: Drop # of signals from buffer (0 = All)
Data is TSF serialized

Queue Status:
Read: Shows the result of the last queued signal
Write: Queue the contents of the buffer as a signal
0=Signal was successfully queued
1=Signal could not be queued
2=Bad Input
255=Bad queue command

Queue Output:
Write: Add TSF serialized data to Queue buffer

IRQ Mask:
Read: Get current IRQ Mask
Write: Set IRQ Mask

NMI Mask:
Read: Get current NMI Mask
Write: Set NMI Mask

IRQ and NMI mask can be used to trigger an interrupt on keyboard input and received signal:
[00000001] Fire interrupt on keyboard input
[00000010] Fire interrupt on signal receive

Clone this wiki locally