Kernel: If wrapping a line at screen bottom, scroll properly

This commit is contained in:
apio 2022-10-26 20:14:24 +02:00
parent 6892fd96d0
commit e1f58c0163

View File

@ -79,7 +79,7 @@ void TextRenderer::putchar(char chr)
{ {
xpos = 0; xpos = 0;
ypos += FONT_HEIGHT; ypos += FONT_HEIGHT;
if (ypos > bootboot.fb_height) if ((ypos + FONT_HEIGHT) >= bootboot.fb_height)
{ {
memcpy((void*)bootboot.fb_ptr, (char*)bootboot.fb_ptr + (bootboot.fb_scanline * FONT_HEIGHT), memcpy((void*)bootboot.fb_ptr, (char*)bootboot.fb_ptr + (bootboot.fb_scanline * FONT_HEIGHT),
bootboot.fb_size - (bootboot.fb_scanline * FONT_HEIGHT)); bootboot.fb_size - (bootboot.fb_scanline * FONT_HEIGHT));