Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Immediately process ARAM DMA transfers if they are 1 block in length.…
… Fixes the teleportation in Beyond Good and Evil.

Fixes issue 6289.
  • Loading branch information
skidau committed May 3, 2013
1 parent c80309e commit 18b0556
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions Source/Core/Core/Src/HW/DSP.cpp
Expand Up @@ -687,12 +687,27 @@ void UpdateAudioDMA()

void Do_ARAM_DMA()
{
g_dspState.DSPControl.DMAState = 1;
CoreTiming::ScheduleEvent_Threadsafe(0, et_GenerateDSPInterrupt, INT_ARAM | (1<<16));

// Force an early exception check on large transfers. Fixes RE2 audio.
if (g_arDMA.Cnt.count > 2048 && g_arDMA.Cnt.count <= 6144)
CoreTiming::ForceExceptionCheck(100);
if (g_arDMA.Cnt.count == 32)
{
// Beyond Good and Evil (GGEE41) sends count 32
GenerateDSPInterrupt(INT_ARAM);
}
else
{
g_dspState.DSPControl.DMAState = 1;
CoreTiming::ScheduleEvent_Threadsafe(0, et_GenerateDSPInterrupt, INT_ARAM | (1<<16));

// Force an early exception check on large transfers. Fixes RE2 audio.
// NFS:HP2 (<= 6144)
// Viewtiful Joe (<= 6144)
// Sonic Mega Collection (> 2048)
// Paper Mario battles (> 32)
// Mario Super Baseball (> 32)
// Knockout Kings 2003 loading (> 32)
// WWE DOR (> 32)
if (g_arDMA.Cnt.count > 2048 && g_arDMA.Cnt.count <= 6144)
CoreTiming::ForceExceptionCheck(100);
}

// Real hardware DMAs in 32byte chunks, but we can get by with 8byte chunks
if (g_arDMA.Cnt.dir)
Expand Down

0 comments on commit 18b0556

Please sign in to comment.