CPU: Convert CCPU into a namespace

There's not much point to a class with only static member functions.
This commit is contained in:
Lioncash
2015-10-04 15:06:31 -04:00
parent e076de137b
commit ef1cc2cec4
9 changed files with 70 additions and 68 deletions

View File

@ -24,19 +24,22 @@ namespace
static std::mutex m_csCpuOccupied;
}
void CCPU::Init(int cpu_core)
namespace CPU
{
void Init(int cpu_core)
{
PowerPC::Init(cpu_core);
m_SyncEvent = nullptr;
}
void CCPU::Shutdown()
void Shutdown()
{
PowerPC::Shutdown();
m_SyncEvent = nullptr;
}
void CCPU::Run()
void Run()
{
std::lock_guard<std::mutex> lk(m_csCpuOccupied);
Host_UpdateDisasmDialog();
@ -81,22 +84,22 @@ void CCPU::Run()
}
}
void CCPU::Stop()
void Stop()
{
PowerPC::Stop();
m_StepEvent.Set();
}
bool CCPU::IsStepping()
bool IsStepping()
{
return PowerPC::GetState() == PowerPC::CPU_STEPPING;
}
void CCPU::Reset()
void Reset()
{
}
void CCPU::StepOpcode(Common::Event *event)
void StepOpcode(Common::Event* event)
{
m_StepEvent.Set();
if (PowerPC::GetState() == PowerPC::CPU_STEPPING)
@ -105,9 +108,9 @@ void CCPU::StepOpcode(Common::Event *event)
}
}
void CCPU::EnableStepping(const bool _bStepping)
void EnableStepping(const bool stepping)
{
if (_bStepping)
if (stepping)
{
PowerPC::Pause();
m_StepEvent.Reset();
@ -139,15 +142,15 @@ void CCPU::EnableStepping(const bool _bStepping)
}
}
void CCPU::Break()
void Break()
{
EnableStepping(true);
}
bool CCPU::PauseAndLock(bool doLock, bool unpauseOnUnlock)
bool PauseAndLock(bool do_lock, bool unpause_on_unlock)
{
bool wasUnpaused = !IsStepping();
if (doLock)
if (do_lock)
{
// we can't use EnableStepping, that would causes deadlocks with both audio and video
PowerPC::Pause();
@ -156,7 +159,7 @@ bool CCPU::PauseAndLock(bool doLock, bool unpauseOnUnlock)
}
else
{
if (unpauseOnUnlock)
if (unpause_on_unlock)
{
PowerPC::Start();
m_StepEvent.Set();
@ -167,3 +170,5 @@ bool CCPU::PauseAndLock(bool doLock, bool unpauseOnUnlock)
}
return wasUnpaused;
}
}