[vga] Actually convert VGA colors to ANSI colors

This commit is contained in:
Kevin Lange 2011-03-29 15:02:20 -05:00
parent 1ce1ab9aaf
commit 0e43b3007f
1 changed files with 7 additions and 0 deletions

View File

@ -206,6 +206,11 @@ puts(
}
}
char vga_to_ansi[] = {
0, 4, 2, 6, 1, 5, 3, 7,
8,12,10,14, 9,13,11,15
};
/*
* settextcolor
* Sets the foreground and background color
@ -216,6 +221,8 @@ settextcolor(
unsigned char backcolor
) {
attrib = (backcolor << 4) | (forecolor & 0x0F);
forecolor = vga_to_ansi[forecolor];
backcolor = vga_to_ansi[backcolor];
if (use_serial) {
serial_send('\033');
serial_send('[');