tmp: some debug logs for dmas lol

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-12-14 21:14:58 -06:00
parent b903f2c4a8
commit 334cd432d4
2 changed files with 18 additions and 2 deletions

View File

@ -214,6 +214,16 @@ fn Controller(comptime id: u2) type {
// Only a Start Timing of 00 has a DMA Transfer immediately begin
self.in_progress = new.start_timing.read() == 0b00;
// this is just for debug purposes
const start_timing: Kind = @enumFromInt(new.start_timing.read());
switch (start_timing) {
.immediate, .vblank => {},
else => log.err("TODO: Implement DMA({}) {s} mode", .{ id, @tagName(start_timing) }),
}
log.debug("configured {s} transfer from 0x{X:0>8} -> 0x{X:0>8} ({} words) for DMA{}", .{ @tagName(start_timing), self.sad_latch, self.dad_latch, self._word_count, id });
}
self.cnt.raw = halfword;

View File

@ -215,9 +215,15 @@ fn Controller(comptime id: u2) type {
// Only a Start Timing of 00 has a DMA Transfer immediately begin
self.in_progress = new.start_timing.read() == 0b00;
if (self.in_progress) {
log.debug("Immediate DMA9({}): 0x{X:0>8} -> 0x{X:0>8} {} words", .{ id, self.sad_latch, self.dad_latch, self._word_count });
// this is just for debug purposes
const start_timing: Kind = @enumFromInt(new.start_timing.read());
switch (start_timing) {
.immediate, .vblank => {},
else => log.err("TODO: Implement DMA({}) {s} mode", .{ id, @tagName(start_timing) }),
}
log.debug("configured {s} transfer from 0x{X:0>8} -> 0x{X:0>8} ({} words) for DMA{}", .{ @tagName(start_timing), self.sad_latch, self.dad_latch, self._word_count, id });
}
self.cnt.raw = halfword;