NES: Fixed OAM DMA getting skipped when DMC DMA was aborted on the same cycle as OAM DMA was triggered

This commit is contained in:
Sour 2024-09-29 11:42:43 +09:00
parent 8b6d7fce60
commit 31c545a680

View file

@ -377,8 +377,14 @@ void NesCpu::ProcessPendingDma(uint16_t readAddress)
if(_abortDmcDma) {
_dmcDmaRunning = false;
_abortDmcDma = false;
_needDummyRead = false;
return;
if(!_spriteDmaTransfer) {
//If DMC DMA was cancelled and OAM DMA isn't about to start,
//stop processing DMA entirely. Otherwise, OAM DMA needs to run,
//so the DMA process has to continue.
_needDummyRead = false;
return;
}
}
uint16_t spriteDmaCounter = 0;