From 89a8fe403b19c7fb7c257e48ca3933ccbd710db4 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 10 Jan 2022 02:55:41 -0400 Subject: [PATCH] feat(bus): have VCOUNT be addressable on the bus --- src/bus/io.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bus/io.zig b/src/bus/io.zig index 4ea4e06..12e82ab 100644 --- a/src/bus/io.zig +++ b/src/bus/io.zig @@ -22,6 +22,7 @@ pub const Io = struct { return switch (addr) { 0x0400_0000 => @as(u32, self.dispcnt.raw), 0x0400_0004 => @as(u32, self.dispstat.raw), + 0x0400_0006 => @as(u32, self.vcount.raw), else => std.debug.panic("[I/O:32] tried to read from {X:}", .{addr}), }; } @@ -30,6 +31,7 @@ pub const Io = struct { return switch (addr) { 0x0400_0000 => self.dispcnt.raw, 0x0400_0004 => self.dispstat.raw, + 0x0400_0006 => self.vcount.raw, else => std.debug.panic("[I/O:16] tried to read from {X:}", .{addr}), }; } @@ -46,6 +48,7 @@ pub const Io = struct { return switch (addr) { 0x0400_0000 => @truncate(u8, self.dispcnt.raw), 0x0400_0004 => @truncate(u8, self.dispstat.raw), + 0x0400_0006 => @truncate(u8, self.vcount.raw), else => std.debug.panic("[I/O:8] tried to read from {X:}", .{addr}), }; }