vga: add clearScreenLine

This commit is contained in:
Mathieu Maret 2018-11-16 19:56:38 +01:00
parent 27293c805c
commit 0bd91897b7
2 changed files with 10 additions and 0 deletions

View File

@ -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) void printInt(int integer)
{ {
char num[sizeof(int) * char num[sizeof(int) *

View File

@ -20,6 +20,7 @@ void vprintf(const char *format, va_list ap);
void printf(const char *format, ...); void printf(const char *format, ...);
int VGASetup(uint bgColor, uint color); int VGASetup(uint bgColor, uint color);
void clearScreen(uint bgColor); void clearScreen(uint bgColor);
void clearScreenLine(uint bgColor, uint line);
void printInt(int integer); void printInt(int integer);
void printIntDetails(int integer, uint color, uint bgColor, int startX, int startY); void printIntDetails(int integer, uint color, uint bgColor, int startX, int startY);
void printCharDetails(char str, uint color, uint bgColor, int startX, int startY); void printCharDetails(char str, uint color, uint bgColor, int startX, int startY);