diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp index 667b355f9..2c1a3b200 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" R4300iOp::Func * CInterpreterCPU::m_R4300i_Opcode = NULL; -DWORD CInterpreterCPU::m_CountPerOp = 2; void ExecuteInterpreterOps (DWORD /*Cycles*/) { @@ -167,23 +166,12 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) { return FALSE; } -CInterpreterCPU::CInterpreterCPU () -{ - -} - -CInterpreterCPU::~CInterpreterCPU() -{ -} - void CInterpreterCPU::BuildCPU (void ) { R4300iOp::m_TestTimer = FALSE; R4300iOp::m_NextInstruction = NORMAL; R4300iOp::m_JumpToLocation = 0; - m_CountPerOp = g_Settings->LoadDword(Game_CounterFactor); - if (g_Settings->LoadBool(Game_32Bit)) { m_R4300i_Opcode = R4300iOp32::BuildInterpreter(); @@ -216,7 +204,7 @@ void CInterpreterCPU::InPermLoop (void) { /* check RDP running */ if (*g_NextTimer > 0) { - *g_NextTimer = 0 - m_CountPerOp; + *g_NextTimer = 0 - CountPerOp(); g_SystemTimer->UpdateTimers(); } } @@ -245,7 +233,7 @@ void CInterpreterCPU::ExecuteCPU (void ) //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType()); }*/ m_R4300i_Opcode[ Opcode.op ](); - NextTimer -= m_CountPerOp; + NextTimer -= CountPerOp(); switch (R4300iOp::m_NextInstruction) { @@ -340,8 +328,8 @@ void CInterpreterCPU::ExecuteOps ( int Cycles ) m_R4300i_Opcode[ Opcode.op ](); _GPR[0].DW = 0; - Cycles -= m_CountPerOp; - *g_NextTimer -= m_CountPerOp; + Cycles -= CountPerOp(); + *g_NextTimer -= CountPerOp(); /*static DWORD TestAddress = 0x80077B0C, TestValue = 0, CurrentValue = 0; if (g_MMU->LW_VAddr(TestAddress, TestValue)) diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.h b/Source/Project64/N64 System/Interpreter/Interpreter CPU.h index 358d9651c..d686d4ce4 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.h +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.h @@ -1,15 +1,16 @@ class CInterpreterCPU : private R4300iOp { - CInterpreterCPU(); - ~CInterpreterCPU(); - public: static void BuildCPU ( void ); static void ExecuteCPU ( void ); static void ExecuteOps ( int Cycles ); static void InPermLoop ( void ); + private: + CInterpreterCPU(void); // Disable default constructor + CInterpreterCPU(const CInterpreterCPU&); // Disable copy constructor + CInterpreterCPU& operator=(const CInterpreterCPU&); // Disable assignment + static R4300iOp::Func * m_R4300i_Opcode; - static DWORD m_CountPerOp; };