fix(dma): implement obscure behaviour for DMAs from ROM
This commit is contained in:
parent
f31699d921
commit
4ed4f8e143
|
@ -256,11 +256,16 @@ fn DmaController(comptime id: u2) type {
|
||||||
cpu.bus.write(u16, dad_addr, @truncate(u16, rotr(u32, self.data_latch, 8 * (dad_addr & 3))));
|
cpu.bus.write(u16, dad_addr, @truncate(u16, rotr(u32, self.data_latch, 8 * (dad_addr & 3))));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sad_adj) {
|
switch (@truncate(u8, sad_addr >> 24)) {
|
||||||
.Increment => self.sad_latch +%= offset,
|
// according to fleroviux, DMAs with a source address in ROM misbehave
|
||||||
.Decrement => self.sad_latch -%= offset,
|
// the resultant behaviour is that the source address will increment despite what DMAXCNT says
|
||||||
.IncrementReload => log.err("{} is a prohibited adjustment on SAD", .{sad_adj}),
|
0x08...0x0D => self.sad_latch +%= offset, // obscure behaviour
|
||||||
.Fixed => {},
|
else => switch (sad_adj) {
|
||||||
|
.Increment => self.sad_latch +%= offset,
|
||||||
|
.Decrement => self.sad_latch -%= offset,
|
||||||
|
.IncrementReload => log.err("{} is a prohibited adjustment on SAD", .{sad_adj}),
|
||||||
|
.Fixed => {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (dad_adj) {
|
switch (dad_adj) {
|
||||||
|
|
Loading…
Reference in New Issue