fix: reimplement DMA ticking

This commit is contained in:
2022-06-16 01:46:37 -03:00
parent dba8873f76
commit f5e401a4ee
4 changed files with 28 additions and 24 deletions

View File

@@ -52,8 +52,8 @@ pub fn runFrame(sched: *Scheduler, cpu: *Arm7tdmi) void {
while (true) {
while (sched.tick < std.math.min(frame_end, sched.nextTimestamp())) {
if (cpu.stepDmaTransfer()) continue; // DMA is blocking, ticks scheduler
if (!cpu.isHalted()) cpu.step() else sched.tick += 1;
cpu.handleDMATransfers();
}
if (sched.tick >= frame_end) break;