From 52b6f5d7e03f6918d56f80fab2deaa807d08764a Mon Sep 17 00:00:00 2001 From: Xander Date: Mon, 3 Jul 2023 14:48:38 +0200 Subject: Now using static writer --- kernel/writer.sats | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'kernel/writer.sats') diff --git a/kernel/writer.sats b/kernel/writer.sats index 43881b1..e6baef5 100644 --- a/kernel/writer.sats +++ b/kernel/writer.sats @@ -1,4 +1,4 @@ -#define N 2000 +#define N 80 * 25 datatype color = | Black @@ -21,6 +21,9 @@ datatype color = typedef screenChar = @{ ascii_character = char, color_code = uint8} -vtypedef writer = [l : agz] @{position = [a:int | a >= 0 && a < N] int (a), color_code = uint8 , buffer = (@[screenChar][N] @ l | ptr l)} +vtypedef buffer = [l : agz] (@[screenChar][N] @ l | ptr l) +typedef writer = @{position = [a:int | a >= 0 && a < N] int (a), color_code = uint8} -fun print_char(c : char) : void +castfn i2u8 {n: nat} (i: int n): uint8 n + +fun put_string (str : string) : void -- cgit v1.2.3