diff options
| author | Ada Christine <adachristine18@gmail.com> | 2023-01-30 04:20:35 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2023-01-30 04:20:35 +0000 |
| commit | 5d12eae3d61c91735f09cc1956732629190d6f13 (patch) | |
| tree | 1e4f501cb8261d9c564753d2df7239b59cdf7b01 /kc | |
| parent | 8acb41611b556959c3e5d9db8074c3b871ed3df1 (diff) | |
keming
Diffstat (limited to 'kc')
| -rw-r--r-- | kc/core/video.c | 11 |
1 files changed, 9 insertions, 2 deletions
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); } } |
