diff --git a/drivers/vga.c b/drivers/vga.c index 6d2a9e1..064fa15 100644 --- a/drivers/vga.c +++ b/drivers/vga.c @@ -25,6 +25,15 @@ void clearScreen(uint bgColor) } } +void clearScreenLine(uint bgColor, uint line) +{ + volatile short *vga = (short *)VGA_ADDR; + long int colorAttr = bgColor << 12; + for (uint i = VGA_WIDTH * line; i < VGA_WIDTH * (line + 1); i++) { + vga[i] = colorAttr; + } +} + void printInt(int integer) { char num[sizeof(int) * diff --git a/drivers/vga.h b/drivers/vga.h index 19d676e..fd041fc 100644 --- a/drivers/vga.h +++ b/drivers/vga.h @@ -20,6 +20,7 @@ void vprintf(const char *format, va_list ap); void printf(const char *format, ...); int VGASetup(uint bgColor, uint color); void clearScreen(uint bgColor); +void clearScreenLine(uint bgColor, uint line); void printInt(int integer); void printIntDetails(int integer, uint color, uint bgColor, int startX, int startY); void printCharDetails(char str, uint color, uint bgColor, int startX, int startY);