Add support for DacrateChanged in LoadState

Calls DacrateChanged if the value of AI_DACRATE_REG changes after
loading a save state.
This commit is contained in:
LegendOfDragoon 2015-09-02 22:47:21 -07:00
parent abf71cdd1a
commit 6adb89e041
1 changed files with 7 additions and 1 deletions

View File

@ -1576,10 +1576,11 @@ bool CN64System::LoadState()
bool CN64System::LoadState(LPCSTR FileName)
{
DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width;
DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width, old_dacrate;
bool LoadedZipFile = false, AudioResetOnLoad;
old_status = g_Reg->VI_STATUS_REG;
old_width = g_Reg->VI_WIDTH_REG;
old_dacrate = g_Reg->AI_DACRATE_REG;
WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName);
@ -1765,6 +1766,11 @@ bool CN64System::LoadState(LPCSTR FileName)
g_Plugins->Gfx()->ViWidthChanged();
}
if (old_dacrate != g_Reg->AI_DACRATE_REG)
{
g_Plugins->Audio()->DacrateChanged(g_System->SystemType());
}
//Fix Random Register
while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER)
{