diff options
Diffstat (limited to 'Source/Kernel/Devices/Display/VGATextOutput.class.cpp')
-rw-r--r-- | Source/Kernel/Devices/Display/VGATextOutput.class.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp index 3265a7d..d307f60 100644 --- a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp +++ b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp @@ -21,19 +21,23 @@ String VGATextOutput::getName() { void VGATextOutput::getModes(Vector<mode_t> &to) { mode_t m; - m.textCols = 80; + m.textCols = 40; m.textRows = 25; - m.identifier = 3; + m.identifier = 1; m.graphWidth = 0; m.graphHeight = 0; m.device = this; to.push(m); + m.textCols = 80; + m.identifier = 3; //3 = text 80x25 16color, just what we want + to.push(m); } bool VGATextOutput::setMode(mode_t& mode) { - if (mode.device == this && mode.identifier == 3) { + if (mode.device == this && (mode.identifier == 3 or mode.identifier == 1)) { registers_t r; - r.eax = 3; //3 = text 80x25 16color, just what we want + r.eax = mode.identifier; + m_cols = mode.textCols; V86::run(setvgamode, r, 0); clear(); return true; @@ -43,11 +47,11 @@ bool VGATextOutput::setMode(mode_t& mode) { void VGATextOutput::putChar(u16int line, u16int col, WChar c, u8int color) { u16int* where = (u16int*)RAM_ADDR; - where[(80 * line) + col] = (color << 8) | c.toAscii(); + where[(m_cols * line) + col] = (color << 8) | c.toAscii(); } void VGATextOutput::moveCursor(u16int line, u16int col) { - u16int csrLoc = (line * 80) + col; + u16int csrLoc = (line * m_cols) + col; outb(0x3D4, 14); outb(0x3D5, csrLoc >> 8); outb(0x3D4, 15); |