From 7debdc490d6d5eee663c11b4371bac028945f2fa Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 29 Oct 2022 05:23:05 -0300 Subject: [PATCH] fix(io): resovle off-by-one errors in i/o register ranges --- src/core/bus/io.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/bus/io.zig b/src/core/bus/io.zig index e00a15b..21c6f47 100644 --- a/src/core/bus/io.zig +++ b/src/core/bus/io.zig @@ -99,16 +99,16 @@ pub fn read(bus: *const Bus, comptime T: type, address: u32) ?T { }, u8 => return switch (address) { // Display - 0x0400_0000...0x0400_0054 => ppu.read(T, &bus.ppu, address), + 0x0400_0000...0x0400_0055 => ppu.read(T, &bus.ppu, address), // Sound 0x0400_0060...0x0400_00A7 => apu.read(T, &bus.apu, address), // DMA Transfers - 0x0400_00B0...0x0400_00DE => dma.read(T, &bus.dma, address), + 0x0400_00B0...0x0400_00DF => dma.read(T, &bus.dma, address), // Timers - 0x0400_0100...0x0400_010E => timer.read(T, &bus.tim, address), + 0x0400_0100...0x0400_010F => timer.read(T, &bus.tim, address), // Serial Communication 1 0x0400_0128 => util.io.read.todo(log, "Read {} from SIOCNT_L", .{T}),