From 61f80d3b55f379249a36498a17aa9eaee752b985 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 12 Apr 2015 13:11:39 -0700 Subject: [PATCH] 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. --- Source/Project64/N64 System/N64 Class.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index de59a2f5d..9cd97e810 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -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) {