diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Kernel/Devices/Display/GraphicDisplay.proto.h | 1 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/VESADisplay.class.cpp | 17 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/VESADisplay.class.h | 1 |
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 |