Skip to content

Commit

Permalink
fixed going out of screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Namonay committed Jul 22, 2024
1 parent f0bdbc6 commit bf92165
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sources/drivers/vga/vga.zig
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub fn putChar(c: u8) void
{
if(c == 0)
return;
if(c >= ' ' and c <= 126)
if(c >= ' ' and c <= 126 and vga.x != vga.width)
{
putEntry(c, vga.color, vga.x, vga.y);
vga.x += 1;
Expand All @@ -244,6 +244,8 @@ pub fn putChar(c: u8) void
}
if(vga.y == vga.height)
scroll();
if (vga.x == vga.width and vga.y == vga.height - 1 and canScroll() == false)
return ;
}
updateCursor();
}
Expand Down

0 comments on commit bf92165

Please sign in to comment.