Skip to content

Commit

Permalink
NES: Fixed OAM DMA getting skipped when DMC DMA was aborted on the sa…
Browse files Browse the repository at this point in the history
…me cycle as OAM DMA was triggered
  • Loading branch information
SourMesen committed Sep 29, 2024
1 parent 8b6d7fc commit 31c545a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Core/NES/NesCpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 31c545a

Please sign in to comment.