From 11a72949c8ab4a5b8fa5d7c131b7f36cd0243f52 Mon Sep 17 00:00:00 2001 From: Namonay Date: Mon, 17 Jun 2024 16:53:41 +0200 Subject: [PATCH] added reserve scrolling --- sources/drivers/vga/vga.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sources/drivers/vga/vga.zig b/sources/drivers/vga/vga.zig index e143686..513135c 100644 --- a/sources/drivers/vga/vga.zig +++ b/sources/drivers/vga/vga.zig @@ -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|