mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Forced the exception check only for ARAM DMA transfers.
Removed the Eternal Darkness boot hack and replaced it with an exception check.
This commit is contained in:
parent
dfa1845ae1
commit
0ccaaee38c
@ -250,8 +250,6 @@ void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata
|
||||
if(tsLast)
|
||||
tsLast->next = ne;
|
||||
tsLast = ne;
|
||||
|
||||
SetDowncount(ne->type, cyclesIntoFuture);
|
||||
}
|
||||
|
||||
// Same as ScheduleEvent_Threadsafe(0, ...) EXCEPT if we are already on the CPU thread
|
||||
@ -262,7 +260,6 @@ void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lk(externalEventSection);
|
||||
event_types[event_type].callback(userdata, 0);
|
||||
SetDowncount(event_type, 0);
|
||||
}
|
||||
else
|
||||
ScheduleEvent_Threadsafe(0, event_type, userdata);
|
||||
@ -416,14 +413,8 @@ void SetMaximumSlice(int maximumSliceLength)
|
||||
maxSliceLength = maximumSliceLength;
|
||||
}
|
||||
|
||||
void SetDowncount(int event_type, int cycles)
|
||||
void ForceExceptionCheck(int cycles)
|
||||
{
|
||||
if (event_types[event_type].name == "SetToken")
|
||||
return;
|
||||
|
||||
if (cycles == 0)
|
||||
cycles = 100; // External Exception latency. Paper Mario TTYD freezes in fight scenes if this is zero.
|
||||
|
||||
if (downcount > cycles)
|
||||
{
|
||||
slicelength -= (downcount - cycles); // Account for cycles already executed by adjusting the slicelength
|
||||
@ -486,7 +477,6 @@ void MoveEvents()
|
||||
|
||||
void Advance()
|
||||
{
|
||||
|
||||
MoveEvents();
|
||||
|
||||
int cyclesExecuted = slicelength - downcount;
|
||||
|
@ -92,7 +92,7 @@ void SetFakeTBStartValue(u64 val);
|
||||
u64 GetFakeTBStartTicks();
|
||||
void SetFakeTBStartTicks(u64 val);
|
||||
|
||||
void SetDowncount(int event_type, int cycles);
|
||||
void ForceExceptionCheck(int cycles);
|
||||
|
||||
extern int downcount;
|
||||
extern int slicelength;
|
||||
|
@ -696,6 +696,10 @@ void Do_ARAM_DMA()
|
||||
g_dspState.DSPControl.DMAState = 1;
|
||||
CoreTiming::ScheduleEvent_Threadsafe(0, et_GenerateDSPInterrupt, INT_ARAM | (1<<16));
|
||||
|
||||
// Force an early exception check. Fixes RE2 audio.
|
||||
if (g_arDMA.Cnt.count == 4096)
|
||||
CoreTiming::ForceExceptionCheck(100);
|
||||
|
||||
// Real hardware DMAs in 32byte chunks, but we can get by with 8byte chunks
|
||||
if (g_arDMA.Cnt.dir)
|
||||
{
|
||||
|
@ -642,14 +642,11 @@ void SetCpStatusRegister()
|
||||
|
||||
void SetCpControlRegister()
|
||||
{
|
||||
// If the new fifo is being attached We make sure there wont be SetFinish event pending.
|
||||
// This protection fix eternal darkness booting, because the second SetFinish event when it is booting
|
||||
// seems invalid or has a bug and hang the game.
|
||||
|
||||
// If the new fifo is being attached, force an exception check
|
||||
// This fixes the hang while booting Eternal Darkness
|
||||
if (!fifo.bFF_GPReadEnable && m_CPCtrlReg.GPReadEnable && !m_CPCtrlReg.BPEnable)
|
||||
{
|
||||
ProcessFifoEvents();
|
||||
PixelEngine::ResetSetFinish();
|
||||
CoreTiming::ForceExceptionCheck(0);
|
||||
}
|
||||
|
||||
fifo.bFF_BPInt = m_CPCtrlReg.BPInt;
|
||||
|
Loading…
Reference in New Issue
Block a user