From 662ed217d73d27dc2f959ca677cba51f10bfc318 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 9 Apr 2016 22:34:53 +1200 Subject: [PATCH] "Instant" ARAM DMA shouldn't schedule and event too soon. Now that the accuracy of ScheduleEvent has changed, 0 cycles will schedule an event as soon as possible. But this breaks ATV 2. So we schedule it 100 cycles out (unless it's a really short copy) --- Source/Core/Core/HW/DSP.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index a7b3641e81..6ff53a3858 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -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;