feat(apu): impelement all apu i/o reads
This commit is contained in:
@@ -53,7 +53,7 @@ pub fn read(comptime T: type, dma: *const DmaTuple, addr: u32) ?T {
|
||||
0xD2, 0xD3 => @truncate(T, dma.*[2].cnt.raw >> shift(byte)),
|
||||
0xD4...0xDD => null, // DMA3SAD, DMA3DAD, DMA3CNT_L
|
||||
0xDE, 0xDF => @truncate(T, dma.*[3].cnt.raw >> shift(byte)),
|
||||
else => util.io.read.err(T, log, "unaligned {} read from 0x{X:0>8}", .{ T, addr }),
|
||||
else => util.io.read.err(T, log, "unexpected {} read from 0x{X:0>8}", .{ T, addr }),
|
||||
},
|
||||
else => @compileError("DMA: Unsupported read width"),
|
||||
};
|
||||
|
||||
@@ -45,6 +45,9 @@ pub fn read(bus: *const Bus, comptime T: type, address: u32) ?T {
|
||||
// Display
|
||||
0x0400_0000...0x0400_0054 => ppu.read(T, &bus.ppu, address),
|
||||
|
||||
// Sound
|
||||
0x0400_0060...0x0400_00A4 => apu.read(T, &bus.apu, address),
|
||||
|
||||
// DMA Transfers
|
||||
0x0400_00B0...0x0400_00DC => dma.read(T, &bus.dma, address),
|
||||
|
||||
@@ -70,7 +73,7 @@ pub fn read(bus: *const Bus, comptime T: type, address: u32) ?T {
|
||||
0x0400_0000...0x0400_0054 => ppu.read(T, &bus.ppu, address),
|
||||
|
||||
// Sound
|
||||
0x0400_0060...0x0400_009E => apu.read(T, &bus.apu, address),
|
||||
0x0400_0060...0x0400_00A6 => apu.read(T, &bus.apu, address),
|
||||
|
||||
// DMA Transfers
|
||||
0x0400_00B0...0x0400_00DE => dma.read(T, &bus.dma, address),
|
||||
@@ -101,6 +104,12 @@ pub fn read(bus: *const Bus, comptime T: type, address: u32) ?T {
|
||||
// Sound
|
||||
0x0400_0060...0x0400_00A7 => apu.read(T, &bus.apu, address),
|
||||
|
||||
// DMA Transfers
|
||||
0x0400_00B0...0x0400_00DE => dma.read(T, &bus.dma, address),
|
||||
|
||||
// Timers
|
||||
0x0400_0100...0x0400_010E => timer.read(T, &bus.tim, address),
|
||||
|
||||
// Serial Communication 1
|
||||
0x0400_0128 => util.io.read.todo(log, "Read {} from SIOCNT_L", .{T}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user