Minor VGA cleanup.

This commit is contained in:
Andreas Kling 2018-10-30 23:49:06 +01:00
parent b833aa4162
commit b4f3bc078f

View file

@ -5,8 +5,7 @@
#include "StdLib.h"
#include "Task.h"
PRIVATE BYTE *vga_mem = 0L;
PRIVATE BYTE current_attr = 0x07;
static byte* vga_mem = nullptr;
void vga_scroll_up()
{
@ -38,14 +37,8 @@ void vga_putch_at(byte row, byte column, byte ch, byte attr)
vga_mem[cur + 1] = attr;
}
byte vga_get_attr()
{
return current_attr;
}
void vga_init()
{
current_attr = 0x07;
vga_mem = (byte*)0xb8000;
for (word i = 0; i < (80 * 25); ++i) {
@ -69,9 +62,7 @@ WORD vga_get_cursor()
void vga_set_cursor(WORD value)
{
if (value >= (80 * 25)) {
/* XXX: If you try to move the cursor off the screen, I will go reddish pink! */
vga_set_cursor(0);
current_attr = 0x0C;
return;
}
IO::out8(0x3d4, 0x0e);