2010-06-07 02:23:58 +00:00
|
|
|
#include "stdafx.h"
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-10-29 03:20:25 +00:00
|
|
|
int CRecompilerSettings::m_RefCount = 0;
|
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CRecompilerSettings::m_bShowRecompMemSize;
|
2010-06-16 07:31:47 +00:00
|
|
|
bool CRecompilerSettings::m_bSMM_StoreInstruc;
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CRecompilerSettings::m_bSMM_Protect;
|
|
|
|
bool CRecompilerSettings::m_bSMM_ValidFunc;
|
|
|
|
bool CRecompilerSettings::m_bSMM_PIDMA;
|
|
|
|
bool CRecompilerSettings::m_bSMM_TLB;
|
|
|
|
bool CRecompilerSettings::m_bProfiling;
|
|
|
|
bool CRecompilerSettings::m_bRomInMemory;
|
2010-07-23 10:45:35 +00:00
|
|
|
bool CRecompilerSettings::m_bFastSP;
|
2010-10-23 18:53:01 +00:00
|
|
|
bool CRecompilerSettings::m_b32Bit;
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CRecompilerSettings::m_RegCaching;
|
|
|
|
bool CRecompilerSettings::m_bLinkBlocks;
|
|
|
|
DWORD CRecompilerSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
CRecompilerSettings::CRecompilerSettings()
|
|
|
|
{
|
2010-10-29 03:20:25 +00:00
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
|
|
|
_Settings->RegisterChangeCB(Game_SMM_StoreInstruc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_SMM_Protect,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_SMM_ValidFunc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_SMM_PIDMA,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_SMM_TLB,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_RegCache,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_BlockLinking,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_FuncLookupMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_32Bit,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Game_FastSP,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
|
|
|
|
RefreshSettings();
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CRecompilerSettings::~CRecompilerSettings()
|
|
|
|
{
|
2010-10-29 03:20:25 +00:00
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
|
|
|
_Settings->UnregisterChangeCB(Game_SMM_StoreInstruc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_SMM_Protect,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_SMM_ValidFunc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_SMM_PIDMA,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_SMM_TLB,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_RegCache,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_BlockLinking,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_FuncLookupMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_32Bit,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Game_FastSP,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
void CRecompilerSettings::RefreshSettings()
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-10-02 11:04:14 +00:00
|
|
|
m_bSMM_StoreInstruc = false /*_Settings->LoadBool(Game_SMM_StoreInstruc)*/;
|
2008-11-14 20:51:06 +00:00
|
|
|
m_bSMM_Protect = _Settings->LoadBool(Game_SMM_Protect);
|
|
|
|
m_bSMM_ValidFunc = _Settings->LoadBool(Game_SMM_ValidFunc);
|
|
|
|
m_bSMM_PIDMA = _Settings->LoadBool(Game_SMM_PIDMA);
|
|
|
|
m_bSMM_TLB = _Settings->LoadBool(Game_SMM_TLB);
|
|
|
|
m_bShowRecompMemSize = _Settings->LoadBool(Debugger_ShowRecompMemSize);
|
|
|
|
m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
|
|
|
|
m_bRomInMemory = _Settings->LoadBool(Game_LoadRomToMemory);
|
2010-07-23 10:45:35 +00:00
|
|
|
m_bFastSP = _Settings->LoadBool(Game_FastSP);
|
2010-10-23 18:53:01 +00:00
|
|
|
m_b32Bit = _Settings->LoadBool(Game_32Bit);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
m_RegCaching = _Settings->LoadBool(Game_RegCache);
|
|
|
|
m_bLinkBlocks = _Settings->LoadBool(Game_BlockLinking);
|
|
|
|
m_LookUpMode = _Settings->LoadDword(Game_FuncLookupMode);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|