🐛 修复了printk在输出\t时,背景颜色不正确的bug,以及屏幕滚动的bug

This commit is contained in:
fslongjin 2022-03-16 23:45:01 +08:00
parent 832442af6a
commit f95fa63972

View File

@ -114,7 +114,7 @@ void auto_newline()
pos.y = pos.max_y;
int lines_to_scroll = 2;
scroll(true, lines_to_scroll * pos.char_size_y, false);
pos.y -= lines_to_scroll;
pos.y -= (lines_to_scroll-1);
}
}
@ -674,7 +674,7 @@ int printk_color(unsigned int FRcolor, unsigned int BKcolor, const char *fmt, ..
while (space_to_print--)
{
putchar(pos.FB_address, pos.width, pos.x * pos.char_size_x, pos.y * pos.char_size_y, BLACK, BLACK, ' ');
putchar(pos.FB_address, pos.width, pos.x * pos.char_size_x, pos.y * pos.char_size_y, FRcolor, BKcolor, ' ');
++pos.x;
auto_newline();
@ -723,6 +723,9 @@ int do_scroll(bool direction, int pixels)
memcpy(pos.FB_address, (pos.FB_address + src), sizeof(unsigned int) * (pos.FB_length - src));
memset(pos.FB_address + (pos.FB_length - src), 0, sizeof(unsigned int) * (src));
for (int i = 0; i < 1000; ++i)
for (int j = 0; j < 1000; ++j)
;
return 0;
}
else