From 3f265b3f1c743cbf46471ede2fc57d5db8a8a036 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 16 Sep 2021 07:52:00 +1000 Subject: [PATCH] Config: Get rid of subset mutators and const global --- pcsx2/Config.h | 8 +------- pcsx2/System.cpp | 36 +----------------------------------- pcsx2/gui/GlobalCommands.cpp | 4 ++-- 3 files changed, 4 insertions(+), 44 deletions(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 5418ac705c..5b0b1745f8 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -526,13 +526,7 @@ struct Pcsx2Config } }; -extern const Pcsx2Config EmuConfig; - -Pcsx2Config::GSOptions& SetGSConfig(); -Pcsx2Config::RecompilerOptions& SetRecompilerConfig(); -Pcsx2Config::GamefixOptions& SetGameFixConfig(); -TraceLogFilters& SetTraceConfig(); - +extern Pcsx2Config EmuConfig; ///////////////////////////////////////////////////////////////////////////////////////// // Helper Macros for Reading Emu Configurations. diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 9791e2fb65..bcb48c2bae 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -148,41 +148,7 @@ void SysOutOfMemory_EmergencyResponse(uptr blocksize) #include "svnrev.h" -const Pcsx2Config EmuConfig; - -// Provides an accessor for quick modification of GS options. All GS options are allowed to be -// changed "on the fly" by the *main/gui thread only*. -Pcsx2Config::GSOptions& SetGSConfig() -{ - //DbgCon.WriteLn( "Direct modification of EmuConfig.GS detected" ); - AffinityAssert_AllowFrom_MainUI(); - return const_cast(EmuConfig.GS); -} - -// Provides an accessor for quick modification of Recompiler options. -// Used by loadGameSettings() to set clamp modes via database at game startup. -Pcsx2Config::RecompilerOptions& SetRecompilerConfig() -{ - //DbgCon.WriteLn( "Direct modification of EmuConfig.Gamefixes detected" ); - AffinityAssert_AllowFrom_MainUI(); - return const_cast(EmuConfig.Cpu.Recompiler); -} - -// Provides an accessor for quick modification of Gamefix options. -// Used by loadGameSettings() to set gamefixes via database at game startup. -Pcsx2Config::GamefixOptions& SetGameFixConfig() -{ - //DbgCon.WriteLn( "Direct modification of EmuConfig.Gamefixes detected" ); - AffinityAssert_AllowFrom_MainUI(); - return const_cast(EmuConfig.Gamefixes); -} - -TraceLogFilters& SetTraceConfig() -{ - //DbgCon.WriteLn( "Direct modification of EmuConfig.TraceLog detected" ); - AffinityAssert_AllowFrom_MainUI(); - return const_cast(EmuConfig.Trace); -} +Pcsx2Config EmuConfig; // This function should be called once during program execution. diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index dd3c728cd6..de033c2a71 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -74,7 +74,7 @@ namespace Implementations void Frameskip_Toggle() { g_Conf->EmuOptions.GS.FrameSkipEnable = !g_Conf->EmuOptions.GS.FrameSkipEnable; - SetGSConfig().FrameSkipEnable = g_Conf->EmuOptions.GS.FrameSkipEnable; + EmuConfig.GS.FrameSkipEnable = g_Conf->EmuOptions.GS.FrameSkipEnable; if (EmuConfig.GS.FrameSkipEnable) { @@ -408,7 +408,7 @@ namespace Implementations // FIXME: Some of the trace logs will require recompiler resets to be activated properly. #ifdef PCSX2_DEVBUILD - SetTraceConfig().Enabled = !EmuConfig.Trace.Enabled; + EmuConfig.Trace.Enabled = !EmuConfig.Trace.Enabled; Console.WriteLn(EmuConfig.Trace.Enabled ? "Logging Enabled." : "Logging Disabled."); #endif }