Kernel: TTY now handles keeping terminal buffer

VESA Driver cannot scroll anymore, this is handled by tty
This commit is contained in:
Bananymous
2022-12-27 17:06:33 +02:00
parent f7eb85babd
commit 2535eb1c4c
4 changed files with 64 additions and 112 deletions

View File

@@ -19,13 +19,19 @@ private:
void ResetAnsiEscape();
void HandleAnsiSGR();
void HandleAnsiEscape(uint16_t ch);
void PutCharAt(uint16_t ch, size_t x, size_t y);
inline void RenderFromBuffer(size_t x, size_t y)
{
const auto& cell = m_buffer[y * m_width + x];
VESA::PutEntryAt(cell.character, x, y, cell.foreground, cell.background);
}
private:
struct Cell
{
VESA::Color foreground = VESA::Color::BRIGHT_WHITE;
VESA::Color background = VESA::Color::BLACK;
uint8_t character = ' ';
uint16_t character = ' ';
};
struct AnsiState
@@ -39,7 +45,7 @@ private:
uint32_t m_height { 0 };
uint32_t m_row { 0 };
uint32_t m_column { 0 };
VESA::Color m_foreground { VESA::Color::BRIGHT_WHITE};
VESA::Color m_foreground { VESA::Color::BRIGHT_WHITE };
VESA::Color m_background { VESA::Color::BLACK };
Cell* m_buffer { nullptr };
AnsiState m_ansi_state;

View File

@@ -28,7 +28,6 @@ namespace VESA
bool Initialize();
void PutEntryAt(uint16_t, uint32_t, uint32_t, Color, Color);
void Clear(Color);
void Scroll();
uint32_t GetTerminalWidth();
uint32_t GetTerminalHeight();