2016-01-27 09:11:59 +00:00
|
|
|
#include "stdafx.h"
|
2022-10-10 00:22:17 +00:00
|
|
|
|
2016-01-27 09:11:59 +00:00
|
|
|
#include "N64SystemSettings.h"
|
2022-04-10 23:56:11 +00:00
|
|
|
#include <Project64-core/N64System/N64Types.h>
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
int32_t CN64SystemSettings::m_RefCount = 0;
|
|
|
|
|
|
|
|
bool CN64SystemSettings::m_bShowCPUPer;
|
|
|
|
bool CN64SystemSettings::m_bBasicMode;
|
|
|
|
bool CN64SystemSettings::m_bLimitFPS;
|
|
|
|
bool CN64SystemSettings::m_bShowDListAListCount;
|
|
|
|
bool CN64SystemSettings::m_bDisplayFrameRate;
|
2021-06-15 05:00:38 +00:00
|
|
|
bool CN64SystemSettings::m_UpdateControllerOnRefresh;
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
CN64SystemSettings::CN64SystemSettings()
|
|
|
|
{
|
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
2021-04-12 11:35:39 +00:00
|
|
|
g_Settings->RegisterChangeCB(UserInterface_BasicMode, nullptr, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(UserInterface_ShowCPUPer, nullptr, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(UserInterface_DisplayFrameRate, nullptr, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(Debugger_ShowDListAListCount, nullptr, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(GameRunning_LimitFPS, nullptr, RefreshSettings);
|
2016-01-27 09:11:59 +00:00
|
|
|
|
2021-04-12 11:35:39 +00:00
|
|
|
RefreshSettings(nullptr);
|
2016-01-27 09:11:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CN64SystemSettings::~CN64SystemSettings()
|
|
|
|
{
|
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
2021-04-12 11:35:39 +00:00
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_BasicMode, nullptr, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate, nullptr, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_ShowCPUPer, nullptr, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(Debugger_ShowDListAListCount, nullptr, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(GameRunning_LimitFPS, nullptr, RefreshSettings);
|
2016-01-27 09:11:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CN64SystemSettings::RefreshSettings(void *)
|
|
|
|
{
|
|
|
|
m_bBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
|
|
|
|
m_bDisplayFrameRate = g_Settings->LoadBool(UserInterface_DisplayFrameRate);
|
|
|
|
m_bShowCPUPer = g_Settings->LoadBool(UserInterface_ShowCPUPer);
|
|
|
|
m_bShowDListAListCount = g_Settings->LoadBool(Debugger_ShowDListAListCount);
|
|
|
|
m_bLimitFPS = g_Settings->LoadBool(GameRunning_LimitFPS);
|
2021-06-15 05:00:38 +00:00
|
|
|
m_UpdateControllerOnRefresh = g_Settings->LoadBool(Setting_UpdateControllerOnRefresh);
|
2022-04-10 23:56:11 +00:00
|
|
|
if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores)
|
|
|
|
{
|
|
|
|
m_UpdateControllerOnRefresh = true;
|
|
|
|
}
|
2015-11-14 21:10:55 +00:00
|
|
|
}
|