diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/graphics/vga.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/graphics/vga.c b/src/graphics/vga.c index 22e1255..cf04027 100644 --- a/src/graphics/vga.c +++ b/src/graphics/vga.c @@ -54,7 +54,23 @@ void terminal_clear() { } } +void terminal_enable_cursor(uint8_t cursor_start, uint8_t cursor_end) { + send(0x3D4, 0x0A); + send(0x3D5, (receive(0x3D5) & 0xC0) | cursor_start); + send(0x3D4, 0x0B); + send(0x3D5, (receive(0x3D5) & 0xE0) | cursor_end); +} + +void terminal_update_cursor(void) { + unsigned temp = terminal_row * VGA_WIDTH + terminal_column; + send(0x3D4, 14); + send(0x3D5, temp >> 8); + send(0x3D4, 15); + send(0x3D5, temp); +} + void terminal_initialize(void) { + terminal_enable_cursor(0, 15); terminal_row = 0; terminal_column = 0; terminal_color = vga_entry_color(VGA_COLOR_LIGHT_GREY, VGA_COLOR_BLACK); @@ -74,14 +90,6 @@ void terminal_scroll(void) { } } -void terminal_update_cursor(void) { - unsigned temp = terminal_row * VGA_WIDTH + terminal_column; - send(0x3D4, 14); - send(0x3D5, temp >> 8); - send(0x3D4, 15); - send(0x3D5, temp); -} - void terminal_set_color(uint8_t color) { terminal_color = color; } @@ -126,4 +134,4 @@ void terminal_write(const char *data, size_t size) { void terminal_write_string(const char *data) { terminal_write(data, strlen(data)); -}
\ No newline at end of file +} |