From d976aaf22bb7e9114631a7ffabfb7f129f840f71 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 11 Apr 2022 09:26:11 +0930 Subject: [PATCH] [Core] Better updating of controller in sync core --- Source/Project64-core/N64System/N64System.cpp | 3 ++- Source/Project64-core/Settings/N64SystemSettings.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64-core/N64System/N64System.cpp b/Source/Project64-core/N64System/N64System.cpp index d1370b105..eb4c2ffa4 100644 --- a/Source/Project64-core/N64System/N64System.cpp +++ b/Source/Project64-core/N64System/N64System.cpp @@ -54,6 +54,7 @@ CN64System::CN64System(CPlugins * Plugins, uint32_t randomizer_seed, bool SavesR { WriteTrace(TraceN64System, TraceDebug, "Start"); memset(m_LastSuccessSyncPC, 0, sizeof(m_LastSuccessSyncPC)); + memset(m_Buttons, 0, sizeof(m_Buttons)); uint32_t gameHertz = g_Settings->LoadDword(Game_ScreenHertz); if (gameHertz == 0) @@ -2475,7 +2476,7 @@ void CN64System::RefreshScreen() for (int Control = 0; Control < 4; Control++) { m_Plugins->Control()->GetKeys(Control, &Keys); - m_Buttons[Control] = Keys.Value; + m_Buttons[Control] = m_SyncSystem ? g_BaseSystem->m_Buttons[Control] : Keys.Value; } } diff --git a/Source/Project64-core/Settings/N64SystemSettings.cpp b/Source/Project64-core/Settings/N64SystemSettings.cpp index e22b5b124..39904d694 100644 --- a/Source/Project64-core/Settings/N64SystemSettings.cpp +++ b/Source/Project64-core/Settings/N64SystemSettings.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "N64SystemSettings.h" +#include int32_t CN64SystemSettings::m_RefCount = 0; @@ -46,4 +47,8 @@ void CN64SystemSettings::RefreshSettings(void *) m_bShowDListAListCount = g_Settings->LoadBool(Debugger_ShowDListAListCount); m_bLimitFPS = g_Settings->LoadBool(GameRunning_LimitFPS); m_UpdateControllerOnRefresh = g_Settings->LoadBool(Setting_UpdateControllerOnRefresh); + if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) + { + m_UpdateControllerOnRefresh = true; + } } \ No newline at end of file