From 5c0d8c3ff6d02eec309463982df9e53f44f4359c Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Dec 2009 21:25:05 +0100 Subject: Same optimisation for VESADisplay --- Source/Kernel/Devices/Display/GraphicDisplay.proto.h | 1 + Source/Kernel/Devices/Display/VESADisplay.class.cpp | 17 +++++++++++++++++ Source/Kernel/Devices/Display/VESADisplay.class.h | 1 + 3 files changed, 19 insertions(+) (limited to 'Source/Kernel') 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 -- cgit v1.2.3