Fix losing audio while loading a save state

This fixes the losing audio after loading a save state issue with
certain plugins in certain games. I was hesitant to submit this, since
the fault is the audio plugin itself, but this also fixes bad save
states. This will not fix games like Top Gear Rally.

Any plugin that initially had this problem, can still lose audio at any
given time, due to flaws in the audio plugin itself. It is best to
simply use a plugin that doesn't have this issue to begin with, for such
games.
This commit is contained in:
LegendOfDragoon 2015-04-12 13:11:39 -07:00
parent b6e2cece00
commit 61f80d3b55
1 changed files with 5 additions and 1 deletions

View File

@ -1725,7 +1725,11 @@ bool CN64System::LoadState(LPCSTR FileName)
ReadFile( hSaveFile,m_MMU_VM.Imem(),0x1000,&dwRead,NULL);
CloseHandle(hSaveFile);
}
//Fix losing audio in certain games with certain plugins
m_Reg.m_AudioIntrReg |= MI_INTR_AI;
m_Reg.AI_STATUS_REG &= ~AI_STATUS_FIFO_FULL;
//Fix Random Register
while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER)
{