Solved screen scroll and cursor bugs

This commit is contained in:
lucic71 2022-06-28 19:40:51 +03:00
parent bf9ced8721
commit e9bc2a8d0c
1 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ void _screen_scroll_up(void) {
fbuffer[i] = fbuffer[i + 80];
for (i = 0; i < VGA_WIDTH; i++)
fbuffer[(VGA_HEIGHT - 1) * VGA_WIDTH + 1] = vga_entry(' ', screen_color);
fbuffer[(VGA_HEIGHT - 1) * VGA_WIDTH + i] = vga_entry(' ', screen_color);
}
@ -68,9 +68,13 @@ void _screen_putchar(char c) {
}
if (c == '\n')
if (c == '\n') {
_screen_move_cursor(screen_column, screen_row);
return;
}
_screen_putchar_at(c, screen_color, screen_column++, screen_row);
_screen_move_cursor(screen_column, screen_row);