diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-20 21:12:56 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-20 21:12:56 +0100 |
commit | 4333fd5847818d7c7509f1cd3651edf0bf58df86 (patch) | |
tree | 896b5f81936fd69bf9132bc623591794b57e7e4f /Source/Kernel | |
parent | 09353da6e91a0968ae24d4b4d97ed434520e6217 (diff) | |
download | Melon-4333fd5847818d7c7509f1cd3651edf0bf58df86.tar.gz Melon-4333fd5847818d7c7509f1cd3651edf0bf58df86.zip |
Text scrolling optimisation for VGATextOutput
Diffstat (limited to 'Source/Kernel')
-rw-r--r-- | Source/Kernel/Devices/Display/VGATextOutput.class.cpp | 11 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/VGATextOutput.class.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp index 50a57b2..c597696 100644 --- a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp +++ b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp @@ -24,6 +24,7 @@ void VGATextOutput::getModes(Vector<mode_t> &to) { m.identifier = 1; m.graphWidth = 0; m.graphHeight = 0; + m.graphDepth = 0; m.device = this; to.push(m); m.textCols = 80; @@ -60,3 +61,13 @@ void VGATextOutput::clear() { u16int* where = (u16int*)RAM_ADDR; for (int i = 0; i < 25 * 80; i++) where[i] = 0; } + +bool VGATextOutput::textScroll(u16int line, u16int col, u16int height, u16int width, u8int color) { + u8int* where = (u8int*)RAM_ADDR; + for (u32int i = 1; i < height; i++) { + memcpy(where + ((line + i - 1) * (m_cols * 2)) + (col * 2), where + ((line + i) * (m_cols * 2)) + (col * 2), width * 2); + } + u16int* w = (u16int*)where; + memsetw(w + ((line + height - 1) * m_cols) + col, 0x20 | (color << 8), width); + return true; +} diff --git a/Source/Kernel/Devices/Display/VGATextOutput.class.h b/Source/Kernel/Devices/Display/VGATextOutput.class.h index 2c72d40..0b0ba94 100644 --- a/Source/Kernel/Devices/Display/VGATextOutput.class.h +++ b/Source/Kernel/Devices/Display/VGATextOutput.class.h @@ -18,6 +18,8 @@ class VGATextOutput : public Display { void putChar(u16int line, u16int col, WChar c, u8int color); void moveCursor(u16int line, u16int col); void clear(); + + bool textScroll(u16int line, u16int col, u16int height, u16int width, u8int color); }; #endif |