diff options
author | Xander <xander@icth.xyz> | 2023-06-30 21:25:18 +0200 |
---|---|---|
committer | Xander <xander@icth.xyz> | 2023-06-30 21:27:18 +0200 |
commit | e9b14562b46f230e7208ea3dad8d836f73e8f100 (patch) | |
tree | 3cfa4355c7e48e295e4b362e6266936a20b2274b /kernel/writer.sats | |
parent | 3f846ecba11a66d7679a68c187d4f6e3560af5e6 (diff) | |
download | ats-os-e9b14562b46f230e7208ea3dad8d836f73e8f100.tar.xz ats-os-e9b14562b46f230e7208ea3dad8d836f73e8f100.zip |
Modulating print
Diffstat (limited to 'kernel/writer.sats')
-rw-r--r-- | kernel/writer.sats | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kernel/writer.sats b/kernel/writer.sats new file mode 100644 index 0000000..c9b8814 --- /dev/null +++ b/kernel/writer.sats @@ -0,0 +1,27 @@ +#define N 80 * 25 + +datatype color = + | Black + | Blue + | Green + | Cyan + | Red + | Magenta + | Brown + | LightGray + | DarkGray + | LightBlue + | LightGreen + | LightCyan + | LightRed + | Pink + | Yellow + | White + + +typedef screenChar = @{ ascii_character = char, color_code = uint8} + +vtypedef tptr (a: t@ype, l:addr) = (a @ l | ptr l) +vtypedef writer = [l: addr] [n:nat | n < N] @{ column_position = size_t n, color_code = uint8 , buffer = tptr(@[screenChar][N],l)} + +fun print_char(c : char) : void |