summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-20 21:25:05 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-20 21:25:05 +0100
commit5c0d8c3ff6d02eec309463982df9e53f44f4359c (patch)
tree6c70549dfb9da05698a569637860665af0803d45 /Source
parent4333fd5847818d7c7509f1cd3651edf0bf58df86 (diff)
downloadMelon-5c0d8c3ff6d02eec309463982df9e53f44f4359c.tar.gz
Melon-5c0d8c3ff6d02eec309463982df9e53f44f4359c.zip
Same optimisation for VESADisplay
Diffstat (limited to 'Source')
-rw-r--r--Source/Kernel/Devices/Display/GraphicDisplay.proto.h1
-rw-r--r--Source/Kernel/Devices/Display/VESADisplay.class.cpp17
-rw-r--r--Source/Kernel/Devices/Display/VESADisplay.class.h1
3 files changed, 19 insertions, 0 deletions
diff --git a/Source/Kernel/Devices/Display/GraphicDisplay.proto.h b/Source/Kernel/Devices/Display/GraphicDisplay.proto.h
index 9608ada..f58f5cf 100644
--- a/Source/Kernel/Devices/Display/GraphicDisplay.proto.h
+++ b/Source/Kernel/Devices/Display/GraphicDisplay.proto.h
@@ -10,6 +10,7 @@ extern u32int consoleColor[16];
#define C_FONT_HEIGHT 16
class GraphicDisplay : public Display {
+ protected:
struct {
int line, col;
u32int buff[C_FONT_WIDTH][C_FONT_HEIGHT];
diff --git a/Source/Kernel/Devices/Display/VESADisplay.class.cpp b/Source/Kernel/Devices/Display/VESADisplay.class.cpp
index 7c4adca..2992910 100644
--- a/Source/Kernel/Devices/Display/VESADisplay.class.cpp
+++ b/Source/Kernel/Devices/Display/VESADisplay.class.cpp
@@ -300,3 +300,20 @@ void VESADisplay::drawChar(u16int line, u16int col, WChar c, u8int color) {
y++;
}
}
+
+bool VESADisplay::textScroll(u16int line, u16int col, u16int height, u16int width, u8int color) {
+ u8int* start = memPos(col * C_FONT_WIDTH, line * C_FONT_HEIGHT);
+ u32int count = width * C_FONT_WIDTH * m_pixWidth;
+ u32int diff = C_FONT_HEIGHT * m_currMode.pitch;
+ putCsrBuff();
+ for (int i = 0; i < (height - 1) * C_FONT_HEIGHT; i++) {
+ memcpy(start, start + diff, count);
+ start += m_currMode.pitch;
+ }
+ for (u32int i = 0; i < width; i++) {
+ drawChar(line + height - 1, col + i, " ", color);
+ }
+ m_csrBuff.line--;
+ drawCsr();
+ return true;
+}
diff --git a/Source/Kernel/Devices/Display/VESADisplay.class.h b/Source/Kernel/Devices/Display/VESADisplay.class.h
index a6001e2..c3bae82 100644
--- a/Source/Kernel/Devices/Display/VESADisplay.class.h
+++ b/Source/Kernel/Devices/Display/VESADisplay.class.h
@@ -77,6 +77,7 @@ class VESADisplay : public GraphicDisplay {
//Advanced graphical functions, recoded for being optimized
virtual void drawChar(u16int line, u16int col, WChar c, u8int color);
+ bool textScroll(u16int line, u16int col, u16int height, u16int width, u8int color);
};
#endif