mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
Minor VGA cleanup.
This commit is contained in:
parent
b833aa4162
commit
b4f3bc078f
1 changed files with 1 additions and 10 deletions
|
@ -5,8 +5,7 @@
|
||||||
#include "StdLib.h"
|
#include "StdLib.h"
|
||||||
#include "Task.h"
|
#include "Task.h"
|
||||||
|
|
||||||
PRIVATE BYTE *vga_mem = 0L;
|
static byte* vga_mem = nullptr;
|
||||||
PRIVATE BYTE current_attr = 0x07;
|
|
||||||
|
|
||||||
void vga_scroll_up()
|
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;
|
vga_mem[cur + 1] = attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte vga_get_attr()
|
|
||||||
{
|
|
||||||
return current_attr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void vga_init()
|
void vga_init()
|
||||||
{
|
{
|
||||||
current_attr = 0x07;
|
|
||||||
vga_mem = (byte*)0xb8000;
|
vga_mem = (byte*)0xb8000;
|
||||||
|
|
||||||
for (word i = 0; i < (80 * 25); ++i) {
|
for (word i = 0; i < (80 * 25); ++i) {
|
||||||
|
@ -69,9 +62,7 @@ WORD vga_get_cursor()
|
||||||
void vga_set_cursor(WORD value)
|
void vga_set_cursor(WORD value)
|
||||||
{
|
{
|
||||||
if (value >= (80 * 25)) {
|
if (value >= (80 * 25)) {
|
||||||
/* XXX: If you try to move the cursor off the screen, I will go reddish pink! */
|
|
||||||
vga_set_cursor(0);
|
vga_set_cursor(0);
|
||||||
current_attr = 0x0C;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IO::out8(0x3d4, 0x0e);
|
IO::out8(0x3d4, 0x0e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue