From dd8c010755a3044f0832c7e732e1e3cdedb4a2ac Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 7 Nov 2019 22:03:47 +0100 Subject: Some improvements Artifacts still not fixed though --- src/kernel/graphics/vesa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kernel/graphics/vesa.c') diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index 24f3311..a43d486 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -6,7 +6,6 @@ #include #include #include -#include void switch_to_vga() { serial_write("Force switch to VGA!\n"); @@ -92,6 +91,7 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode) { } void set_optimal_resolution() { + asm volatile ("sti"); vga_log("Switching to graphics mode", 9); vga_log("Trying to detect available modes", 10); uint16_t *video_modes = vbe_get_modes(); @@ -346,10 +346,10 @@ int prev_coords[2] = {}; void vesa_draw_cursor(int x, int y) { // Reset previous area - char *reset = (char *) &fb[prev_coords[0] * vbe_bpl + prev_coords[1] * vbe_pitch]; if (prev != 0) { + char *reset = (char *) &fb[prev_coords[0] * vbe_bpl + prev_coords[1] * vbe_pitch]; for (int cy = 0; cy <= 19; cy++) { - for (int cx = 0; cx <= 12 + 1; cx++) { + for (int cx = 0; cx <= 12; cx++) { reset[vbe_bpl * cx] = prev[vbe_bpl * cx]; reset[vbe_bpl * cx + 1] = prev[vbe_bpl * cx + 1]; reset[vbe_bpl * cx + 2] = prev[vbe_bpl * cx + 2]; @@ -366,7 +366,7 @@ void vesa_draw_cursor(int x, int y) { prev_coords[0] = x; prev_coords[1] = y; for (int cy = 0; cy <= 19; cy++) { - for (int cx = 0; cx <= 12 + 1; cx++) { + for (int cx = 0; cx <= 12; cx++) { // Performance issue? prev[vbe_bpl * cx] = draw[vbe_bpl * cx]; prev[vbe_bpl * cx + 1] = draw[vbe_bpl * cx + 1]; -- cgit v1.2.3