2010-06-07 02:23:58 +00:00
|
|
|
#include "stdafx.h"
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
int CN64SystemSettings::m_RefCount = 0;
|
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CN64SystemSettings::m_bShowCPUPer;
|
|
|
|
bool CN64SystemSettings::m_bProfiling;
|
|
|
|
bool CN64SystemSettings::m_bBasicMode;
|
|
|
|
bool CN64SystemSettings::m_bLimitFPS;
|
|
|
|
bool CN64SystemSettings::m_bShowDListAListCount;
|
|
|
|
bool CN64SystemSettings::m_bFixedAudio;
|
|
|
|
bool CN64SystemSettings::m_bSyncToAudio;
|
|
|
|
bool CN64SystemSettings::m_bDisplayFrameRate;
|
2010-07-23 10:45:35 +00:00
|
|
|
bool CN64SystemSettings::m_bFastSP;
|
2008-12-04 10:41:51 +00:00
|
|
|
DWORD CN64SystemSettings::m_ViRefreshRate;
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
CN64SystemSettings::CN64SystemSettings()
|
|
|
|
{
|
2010-06-04 06:25:07 +00:00
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
|
|
|
_Settings->RegisterChangeCB(UserInterface_BasicMode,NULL,RefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(UserInterface_ShowCPUPer,NULL,RefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(UserInterface_DisplayFrameRate,NULL,RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->RegisterChangeCB(Debugger_ProfileCode,NULL,RefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Debugger_ShowDListAListCount,NULL,RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->RegisterChangeCB(GameRunning_LimitFPS,NULL,RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->RegisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
2010-07-23 10:45:35 +00:00
|
|
|
_Settings->RegisterChangeCB(Game_FastSP,NULL,RefreshSettings);
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->RegisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
|
|
|
RefreshSettings(NULL);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CN64SystemSettings::~CN64SystemSettings()
|
|
|
|
{
|
2010-06-04 06:25:07 +00:00
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
|
|
|
_Settings->UnregisterChangeCB(UserInterface_BasicMode,NULL,RefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate,NULL,RefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(UserInterface_ShowCPUPer,NULL,RefreshSettings);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->UnregisterChangeCB(Debugger_ProfileCode,NULL,RefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Debugger_ShowDListAListCount,NULL,RefreshSettings);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->UnregisterChangeCB(GameRunning_LimitFPS,NULL,RefreshSettings);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->UnregisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
2010-07-23 10:45:35 +00:00
|
|
|
_Settings->UnregisterChangeCB(Game_FastSP,NULL,RefreshSettings);
|
2010-06-04 06:25:07 +00:00
|
|
|
_Settings->UnregisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
void CN64SystemSettings::RefreshSettings(void *)
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2008-11-14 20:51:06 +00:00
|
|
|
m_bBasicMode = _Settings->LoadBool(UserInterface_BasicMode);
|
|
|
|
m_bDisplayFrameRate = _Settings->LoadBool(UserInterface_DisplayFrameRate);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
m_bShowCPUPer = _Settings->LoadBool(UserInterface_ShowCPUPer);
|
|
|
|
m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
|
|
|
|
m_bShowDListAListCount = _Settings->LoadBool(Debugger_ShowDListAListCount);
|
|
|
|
m_bLimitFPS = _Settings->LoadBool(GameRunning_LimitFPS);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
m_bFixedAudio = _Settings->LoadBool(Game_FixedAudio);
|
|
|
|
m_bSyncToAudio = m_bFixedAudio ? _Settings->LoadBool(Game_SyncViaAudio) : false;
|
2010-07-23 10:45:35 +00:00
|
|
|
m_bFastSP = _Settings->LoadBool(Game_FastSP);
|
2008-12-04 10:41:51 +00:00
|
|
|
m_ViRefreshRate = _Settings->LoadDword(Game_ViRefreshRate);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|