Fix cursor

This commit is contained in:
Mathieu Maret 2018-11-15 13:29:05 +01:00
parent 146a06f0e6
commit ea9e5f7f23

View File

@ -174,7 +174,7 @@ void printChar(const char str)
line--; line--;
} }
} }
cursorMove(col - 1, line); cursorMove(col, line);
} }
void printStringDetails(const char *str, uint color, uint bgColor, int startX, int startY) void printStringDetails(const char *str, uint color, uint bgColor, int startX, int startY)
@ -206,7 +206,10 @@ void cursorDisable(void)
void cursorMove(int x, int y) void cursorMove(int x, int y)
{ {
volatile short *vga = (short *)VGA_ADDR;
long int colorAttr = (vgaBgColor << 4 | (vgaColor & 0x0f)) << 8;
uint16_t pos = y * VGA_WIDTH + x; uint16_t pos = y * VGA_WIDTH + x;
vga[pos] = colorAttr;
outb(0x3D4, 0x0F); outb(0x3D4, 0x0F);
outb(0x3D5, (uint8_t)(pos & 0xFF)); outb(0x3D5, (uint8_t)(pos & 0xFF));