summaryrefslogtreecommitdiff
path: root/stage3/font.c
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-19 02:58:49 +0100
committerLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-19 02:58:49 +0100
commitbb31dd0d21fdfb39ac74faec9fc4eafaae6dd134 (patch)
tree154cc9e946d5d9effd08687ed2636fa5c541c550 /stage3/font.c
parenteb29366545ea0679eee057e8275a0457d9f8e556 (diff)
downloadcuddles-bb31dd0d21fdfb39ac74faec9fc4eafaae6dd134.tar.xz
render cursor
Diffstat (limited to 'stage3/font.c')
-rw-r--r--stage3/font.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/stage3/font.c b/stage3/font.c
index 82b407b..ca3a420 100644
--- a/stage3/font.c
+++ b/stage3/font.c
@@ -93,7 +93,7 @@ static void render_char(u8 c)
}
}
-static void fix_cursor()
+static void update_cursor()
{
while (cursor_x >= screen_width) {
cursor_x -= screen_width;
@@ -102,28 +102,34 @@ static void fix_cursor()
if (cursor_y >= screen_height)
font_clear_screen();
+
+ gfx_set_area(cursor_x * outer_width, cursor_y * outer_height,
+ outer_width, outer_height, 0xFFFFFFFF);
}
void print_char(char c)
{
switch (c) {
case '\n':
+ render_char(' ');
cursor_y++;
cursor_x = 0;
break;
- case '\t':
+ /*case '\t':
+ render_char(' ');
cursor_x = (cursor_x + TAB_SIZE) & ~(TAB_SIZE - 1);
- break;
+ break;*/
case '\b':
if (cursor_x > 0) {
- cursor_x--;
render_char(' ');
+ cursor_x--;
}
break;
case '\r':
+ render_char(' ');
cursor_x = 0;
break;
@@ -136,8 +142,7 @@ void print_char(char c)
break;
case '\f':
- cursor_y = 0;
- cursor_x = 0;
+ font_clear_screen();
break;
default:
@@ -145,7 +150,7 @@ void print_char(char c)
cursor_x++;
}
- fix_cursor();
+ update_cursor();
}
void print(str line)