Kernel: Debug temporary debug print just to beginning when full

This commit is contained in:
Bananymous 2023-10-13 12:43:52 +03:00
parent f842a9255f
commit 1d61bccfc3
1 changed files with 15 additions and 0 deletions

View File

@ -74,6 +74,8 @@ namespace Debug
static uint32_t col = 0;
static uint32_t row = 0;
uint32_t row_copy = row;
if (ch == '\n')
{
row++;
@ -96,6 +98,19 @@ namespace Debug
col = 0;
}
}
if (row >= g_terminal_driver->height())
row = 0;
if (row != row_copy)
{
for (uint32_t i = col; i < g_terminal_driver->width(); i++)
{
g_terminal_driver->putchar_at(' ', i, row, TerminalColor::BRIGHT_WHITE, TerminalColor::BLACK);
if (row + 1 < g_terminal_driver->height())
g_terminal_driver->putchar_at(' ', i, row + 1, TerminalColor::BRIGHT_WHITE, TerminalColor::BLACK);
}
}
}
}