Move VGA cursor when writing to screen
This commit is contained in:
parent
055c41adb3
commit
b50b32afa9
@ -1,5 +1,6 @@
|
||||
#include <vga.h>
|
||||
#include <memory.h>
|
||||
#include <ports.h>
|
||||
|
||||
void *vidmem;
|
||||
struct vga_cell{
|
||||
@ -20,6 +21,14 @@ void vga_init()
|
||||
format = 0x7;
|
||||
}
|
||||
|
||||
void movecursor()
|
||||
{
|
||||
outb(0x3D4, 0x0F);
|
||||
outb(0x3D5, (uint8_t)(cursor & 0xFF));
|
||||
outb(0x3D4, 0x0E);
|
||||
outb(0x3D5, (uint8_t)((cursor >> 8) & 0xFF));
|
||||
}
|
||||
|
||||
void flush()
|
||||
{
|
||||
memcpy(vidmem, buffer, sizeof(buffer));
|
||||
@ -53,4 +62,5 @@ void vga_write(char c)
|
||||
}
|
||||
scroll();
|
||||
flush();
|
||||
movecursor();
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
// vim: ft=c
|
||||
#include <ttest.h>
|
||||
|
||||
#include <ports.h>
|
||||
#undef outb
|
||||
#define outb(...)
|
||||
#include <vga.h>
|
||||
#undef VGA_MEMORY
|
||||
#define VGA_MEMORY calloc(80*24,3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user