diff --git a/sources/Debugger/CPU/CPUDebug.cpp b/sources/Debugger/CPU/CPUDebug.cpp index d677158..ce5118d 100644 --- a/sources/Debugger/CPU/CPUDebug.cpp +++ b/sources/Debugger/CPU/CPUDebug.cpp @@ -79,6 +79,10 @@ namespace ComSquare::Debugger try { unsigned cycles = 0; + for (auto &channel : this->_dmaChannels) + if (channel.enabled) + cycles += channel.run(INT_MAX); + if (this->_isPaused) return 0xFF; if (this->_isStepping) { diff --git a/tests/CPU/testDMA.cpp b/tests/CPU/testDMA.cpp index 828f30a..412c295 100644 --- a/tests/CPU/testDMA.cpp +++ b/tests/CPU/testDMA.cpp @@ -54,6 +54,7 @@ Test(DMA, RomToVRAM) uint16_t value = snes.ppu->vram->_data[0x2000 * 2 + i * 2] | (snes.ppu->vram->_data[0x2000 * 2 + i * 2 + 1] << 8); cr_assert_eq(value, i, "The memory at %x should be %x but it was %x", 0x2000 + i, i, snes.ppu->vram->_data[i]); } + cr_assert_eq(snes.cpu->_dmaChannels[0].enabled, false, "The DMA channel should be disabled."); } Test(DMA, VramWrite)