diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-19 02:29:22 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-19 02:29:22 +0100 |
commit | 85fad639f02176e2dbf47869abb227ad3f34672b (patch) | |
tree | 15d542e6b1dc92442cae4def085f3fcbbcefc44e /stage3/font.c | |
parent | 5d4670ce3e2f075eca07fc6ba8a2065db0e56df3 (diff) | |
download | cuddles-85fad639f02176e2dbf47869abb227ad3f34672b.tar.xz |
add clear command
Diffstat (limited to 'stage3/font.c')
-rw-r--r-- | stage3/font.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/stage3/font.c b/stage3/font.c index 67127f6..82b407b 100644 --- a/stage3/font.c +++ b/stage3/font.c @@ -68,6 +68,12 @@ void font_load_classic() free(cfont); } +void font_clear_screen() +{ + cursor_x = cursor_y = 0; + gfx_set_area(0, 0, gfx_info->width, gfx_info->height, 0xFF000000); +} + static void render_char(u8 c) { u16 base_x = cursor_x * outer_width; @@ -94,10 +100,8 @@ static void fix_cursor() cursor_y++; } - while (cursor_y >= screen_height) { - gfx_set_area(0, 0, gfx_info->width, gfx_info->height, 0xFF000000); - cursor_y -= screen_height; - } + if (cursor_y >= screen_height) + font_clear_screen(); } void print_char(char c) |