diff options
Diffstat (limited to 'kc/core')
| -rw-r--r-- | kc/core/video.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kc/core/video.c b/kc/core/video.c index 94ee1f2..1eb3ce4 100644 --- a/kc/core/video.c +++ b/kc/core/video.c @@ -148,6 +148,8 @@ static const unsigned char ascii_characters[][13] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00} }; +static const char ascii_test[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + struct video_color { uint8_t red; @@ -188,6 +190,7 @@ static struct video_bitmap framebuffer_bitmap; static struct console_state console_state; int pixel_put(struct video_color color, int xpos, int ypos); +int character_put(int c); int video_init(void) { @@ -220,6 +223,8 @@ int video_init(void) } } + character_put('A'); + return 0; } @@ -232,3 +237,18 @@ int pixel_put(struct video_color color, int xpos, int ypos) return 0; } +int character_put(int c) +{ + for (int i = 0; i < FONT_HEIGHT; i++) + { + 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); + } + } + + console_state.cursor_column++; + + return 0; +} + |
