2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
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;
|
|
|
|
bool CRecompilerSettings::m_bProfiling;
|
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)
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
2010-10-29 03:20:25 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
2010-10-29 03:20:25 +00:00
|
|
|
}
|
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-11-17 01:02:04 +00:00
|
|
|
m_bShowRecompMemSize = g_Settings->LoadBool(Debugger_ShowRecompMemSize);
|
|
|
|
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|