From 5d12eae3d61c91735f09cc1956732629190d6f13 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Mon, 30 Jan 2023 04:20:35 +0000 Subject: keming --- kc/core/video.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'kc') diff --git a/kc/core/video.c b/kc/core/video.c index 1eb3ce4..619dba2 100644 --- a/kc/core/video.c +++ b/kc/core/video.c @@ -49,6 +49,8 @@ static const int FONT_WIDTH = 8; static const int FONT_HEIGHT = 13; +static const int CELL_WIDTH = 9; +static const int CELL_HEIGHT = 14; static const unsigned char ascii_characters[][13] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, @@ -223,7 +225,10 @@ int video_init(void) } } - character_put('A'); + for (size_t i = 0; i < sizeof(ascii_test); i++) + { + character_put(ascii_test[i]); + } return 0; } @@ -243,7 +248,9 @@ int character_put(int c) { for (int j = 0; j < FONT_WIDTH; j++) { - pixel_put(ascii_characters[c - 32][i] & (1 << j) ? console_state.foreground : console_state.background, FONT_WIDTH - j, FONT_HEIGHT - i); + int top = console_state.cursor_line * CELL_HEIGHT; + int left = console_state.cursor_column * CELL_WIDTH; + pixel_put(ascii_characters[c - 32][i] & (1 << j) ? console_state.foreground : console_state.background, left + FONT_WIDTH - j, top + FONT_HEIGHT - i); } } -- cgit v1.3.1-1-g115d