Add support for ViStatusChanged in LoadState

Calls ViStatusChanged if the value of VI_STATUS_REG changes after
loading a save state.
This commit is contained in:
LegendOfDragoon 2015-09-02 22:41:40 -07:00
parent 8d7c7d91a1
commit a4a69a8a3a
1 changed files with 8 additions and 2 deletions

View File

@ -1576,9 +1576,10 @@ bool CN64System::LoadState()
bool CN64System::LoadState(LPCSTR FileName)
{
DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0;
DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status;
bool LoadedZipFile = false, AudioResetOnLoad;
old_status = g_Reg->VI_STATUS_REG;
WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName);
char drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT];
@ -1753,6 +1754,11 @@ bool CN64System::LoadState(LPCSTR FileName)
m_Audio.SetFrequency(m_Reg.AI_DACRATE_REG, g_System->SystemType());
}
if (old_status != g_Reg->VI_STATUS_REG)
{
g_Plugins->Gfx()->ViStatusChanged();
}
//Fix Random Register
while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER)
{