From abf71cdd1a3f4f2067ce4fbbc0fc83044ab110b4 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 2 Sep 2015 22:44:24 -0700 Subject: [PATCH] Add support for ViWidthChanged in LoadState Calls ViWidthChanged if the value of VI_WIDTH_REG changes after loading a save state. --- Source/Project64/N64 System/N64 Class.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 13e28b0de..3887a952a 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1576,9 +1576,10 @@ bool CN64System::LoadState() bool CN64System::LoadState(LPCSTR FileName) { - DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status; + DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width; bool LoadedZipFile = false, AudioResetOnLoad; old_status = g_Reg->VI_STATUS_REG; + old_width = g_Reg->VI_WIDTH_REG; WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName); @@ -1759,6 +1760,11 @@ bool CN64System::LoadState(LPCSTR FileName) g_Plugins->Gfx()->ViStatusChanged(); } + if (old_width != g_Reg->VI_WIDTH_REG) + { + g_Plugins->Gfx()->ViWidthChanged(); + } + //Fix Random Register while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) {