feat: vt additions

This commit is contained in:
2026-02-21 02:31:31 +01:00
parent 24cfbc08fd
commit 28efc562d5
3 changed files with 32 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ impl ColorNibble {
pub const MAGENTA: Self = Self(0b0101);
pub const GRAY: Self = Self(0b1000);
pub const GRAY2: Self = Self(0b0111);
pub const LIGHT_GRAY: Self = Self(0b0111);
pub const LIGHT_RED: Self = Self(0b1100);
pub const LIGHT_GREEN: Self = Self(0b1010);

View File

@@ -39,6 +39,19 @@ where
self.pos = (M::WIDTH.min(col), M::HEIGHT.min(row));
}
pub fn set_color(&mut self, color: VgaColor) {
self.cur_color = color;
}
pub fn reset_screen(&mut self) {
for row in self.vga.as_cell_array() {
for cell in row {
cell.0 = b' ';
cell.1 = *self.cur_color;
}
}
}
pub fn write(&mut self, data: &[u8]) {
const BAD_CHAR_COL: VgaColor = VgaColor::new(ColorNibble::WHITE, ColorNibble::RED);