From 67245a7eebeb135427d50171fda7af58770afc6d Mon Sep 17 00:00:00 2001 From: Xander Date: Thu, 13 Jul 2023 00:52:37 +0200 Subject: Full restructure --- lib/SATS/writer.sats | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/SATS/writer.sats (limited to 'lib/SATS/writer.sats') diff --git a/lib/SATS/writer.sats b/lib/SATS/writer.sats new file mode 100644 index 0000000..65a2ea9 --- /dev/null +++ b/lib/SATS/writer.sats @@ -0,0 +1,32 @@ +#define BUFFER_HEIGHT 23 +#define BUFFER_WIDTH 80 +#define N BUFFER_HEIGHT * BUFFER_WIDTH + +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 buffer = [l : agz] (@[screenChar][N] @ l | ptr l) +typedef writer = @{position = [a:int | a >= 0 && a < N] int (a), color_code = uint8} + +castfn i2u8 {n: nat} (i: int n): uint8 n + +fun put_string (str : string) : void +fun clear_screen() : void -- cgit v1.2.3