From 4333fd5847818d7c7509f1cd3651edf0bf58df86 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Dec 2009 21:12:56 +0100 Subject: Text scrolling optimisation for VGATextOutput --- Source/Kernel/Devices/Display/VGATextOutput.class.cpp | 11 +++++++++++ Source/Kernel/Devices/Display/VGATextOutput.class.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'Source') 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 &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 -- cgit v1.2.3