Skip to content

Commit

Permalink
added reserve scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Namonay committed Jun 17, 2024
1 parent aac16e6 commit 11a7294
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sources/drivers/vga/vga.zig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ fn putEntry(c: u8, color: u8, x: usize, y: usize) void
vga.buffer[y * vga.width + x] = getVal(c, color);
}

pub fn reverseScroll() void
{
for (0..(vga.height - 1)) |x|
{
for (0..vga.width) |y|
{
vga.buffer[x * vga.width + y] = vga.buffer[(x + 1) * vga.width + y];
}
}
for (0..vga.width) |y|
{
vga.buffer[y] = 0;
}
}
pub fn scroll() void
{
for (1..vga.height) |x|
Expand Down

0 comments on commit 11a7294

Please sign in to comment.