forked from CHatingPython/towos
feat: separate VGA
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include "vga.hpp"
|
||||
|
||||
static volatile u16* const s_vga = reinterpret_cast<volatile u16*>(0xB8000);
|
||||
|
||||
void vga::clear(void) {
|
||||
for (u32 i = 0; i < ROWS * COLS; ++i)
|
||||
s_vga[i] = 0;
|
||||
}
|
||||
|
||||
void vga::putc(char ch, u8 col, u8 row) {
|
||||
s_vga[col + (COLS * row)] = 0x0700 | ch;
|
||||
}
|
||||
|
||||
void vga::puts(const char* str, u8 col, u8 row) {
|
||||
for (u32 off = 0; str[off] != '\0'; ++off)
|
||||
putc(str[off], col + off, row);
|
||||
}
|
||||
Reference in New Issue
Block a user