Merge pull request #3773 from phire/if_you_want_100_cycles_ask_for_100_cycles

"Instant" ARAM DMA shouldn't schedule and event too soon.
This commit is contained in:
Pierre Bourdon 2016-04-11 21:46:43 +02:00
commit 58d8c734b8
1 changed files with 3 additions and 4 deletions

View File

@ -212,6 +212,7 @@ void EnableInstantDMA()
CoreTiming::RemoveEvent(et_CompleteARAM);
CompleteARAM(0, 0);
instant_dma = true;
ERROR_LOG(DSPINTERFACE, "Enabling Instant ARAM DMA hack");
}
void FlushInstantDMA(u32 address)
@ -544,14 +545,12 @@ static void Do_ARAM_DMA()
// ARAM DMA transfer rate has been measured on real hw
int ticksToTransfer = (g_arDMA.Cnt.count / 32) * 246;
// This is a huge hack that appears to be here only to fix Resident Evil 2/3
if (instant_dma)
ticksToTransfer = 0;
ticksToTransfer = std::min(ticksToTransfer, 100);
CoreTiming::ScheduleEvent(ticksToTransfer, et_CompleteARAM);
if (instant_dma)
CoreTiming::ForceExceptionCheck(100);
last_mmaddr = g_arDMA.MMAddr;
last_aram_dma_count = g_arDMA.Cnt.count;