diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp index 250fa42e8..667b355f9 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp @@ -215,8 +215,8 @@ void CInterpreterCPU::InPermLoop (void) { /* check RSP running */ /* check RDP running */ - if (*_NextTimer > 0) { - *_NextTimer = 0 - m_CountPerOp; + if (*g_NextTimer > 0) { + *g_NextTimer = 0 - m_CountPerOp; g_SystemTimer->UpdateTimers(); } } @@ -230,7 +230,7 @@ void CInterpreterCPU::ExecuteCPU (void ) DWORD & JumpToLocation = R4300iOp::m_JumpToLocation; BOOL & TestTimer = R4300iOp::m_TestTimer; const BOOL & bDoSomething= g_SystemEvents->DoSomething(); - int & NextTimer = *_NextTimer; + int & NextTimer = *g_NextTimer; __try { @@ -242,7 +242,7 @@ void CInterpreterCPU::ExecuteCPU (void ) { WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER)); //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s t9: %08X v1: %08X",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER),_GPR[0x19].UW[0],_GPR[0x03].UW[0]); - //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*_NextTimer,g_SystemTimer->CurrentType()); + //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType()); }*/ m_R4300i_Opcode[ Opcode.op ](); NextTimer -= m_CountPerOp; @@ -329,19 +329,19 @@ void CInterpreterCPU::ExecuteOps ( int Cycles ) { WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER)); //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s t9: %08X v1: %08X",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER),_GPR[0x19].UW[0],_GPR[0x03].UW[0]); - //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*_NextTimer,g_SystemTimer->CurrentType()); + //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType()); }*/ /*if (PROGRAM_COUNTER > 0x80323000 && PROGRAM_COUNTER< 0x80380000) { WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER)); //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s t9: %08X v1: %08X",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER),_GPR[0x19].UW[0],_GPR[0x03].UW[0]); - //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*_NextTimer,g_SystemTimer->CurrentType()); + //WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType()); }*/ m_R4300i_Opcode[ Opcode.op ](); _GPR[0].DW = 0; Cycles -= m_CountPerOp; - *_NextTimer -= m_CountPerOp; + *g_NextTimer -= m_CountPerOp; /*static DWORD TestAddress = 0x80077B0C, TestValue = 0, CurrentValue = 0; if (g_MMU->LW_VAddr(TestAddress, TestValue)) @@ -374,7 +374,7 @@ void CInterpreterCPU::ExecuteOps ( int Cycles ) if (CheckTimer) { TestTimer = FALSE; - if (*_NextTimer < 0) + if (*g_NextTimer < 0) { g_SystemTimer->TimerDone(); } diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index b16403825..2c5b50d1e 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -2369,11 +2369,11 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) { void CMipsMemoryVM::UpdateHalfLine (void) { - if (*_NextTimer < 0) { + if (*g_NextTimer < 0) { m_HalfLine = 0; return; } - m_HalfLine = (DWORD)(*_NextTimer / ViRefreshRate()); + m_HalfLine = (DWORD)(*g_NextTimer / ViRefreshRate()); m_HalfLine &= ~1; } diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index e0356c6fb..512668b55 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -534,7 +534,7 @@ bool CN64System::SetActiveSystem( bool bActive ) g_SystemTimer = &m_SystemTimer; g_TransVaddr = &m_MMU_VM; g_SystemEvents = this; - _NextTimer = &m_NextTimer; + g_NextTimer = &m_NextTimer; g_Plugins = m_Plugins; _TLBLoadAddress = &m_TLBLoadAddress; _TLBStoreAddress = &m_TLBStoreAddress; @@ -565,7 +565,7 @@ bool CN64System::SetActiveSystem( bool bActive ) g_SystemTimer = NULL; g_TransVaddr = NULL; g_SystemEvents = NULL; - _NextTimer = NULL; + g_NextTimer = NULL; g_Plugins = m_Plugins; _TLBLoadAddress = NULL; _TLBStoreAddress = NULL; diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 1f01289d3..8e8ae57e7 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -5127,13 +5127,13 @@ void CRecompilerOps::UpdateCounters ( CRegInfo & RegSet, bool CheckTimer, bool C { UpdateSyncCPU(RegSet,RegSet.GetBlockCycleCount()); WriteX86Comment("Update Counter"); - SubConstFromVariable(RegSet.GetBlockCycleCount(),_NextTimer,"_NextTimer"); // updates compare flag + SubConstFromVariable(RegSet.GetBlockCycleCount(),g_NextTimer,"g_NextTimer"); // updates compare flag if (ClearValues) { RegSet.SetBlockCycleCount(0); } } else if (CheckTimer) { - CompConstToVariable(0,_NextTimer,"_NextTimer"); + CompConstToVariable(0,g_NextTimer,"g_NextTimer"); } if (CheckTimer) diff --git a/Source/Project64/N64 System/System Globals.cpp b/Source/Project64/N64 System/System Globals.cpp index 60617ae93..b0c49efe2 100644 --- a/Source/Project64/N64 System/System Globals.cpp +++ b/Source/Project64/N64 System/System Globals.cpp @@ -17,6 +17,6 @@ CSystemEvents * g_SystemEvents = NULL; DWORD * _TLBLoadAddress = NULL; DWORD * _TLBStoreAddress = NULL; -int * _NextTimer; +int * g_NextTimer; diff --git a/Source/Project64/N64 System/System Globals.h b/Source/Project64/N64 System/System Globals.h index 790b25c83..e3da4f582 100644 --- a/Source/Project64/N64 System/System Globals.h +++ b/Source/Project64/N64 System/System Globals.h @@ -14,6 +14,6 @@ extern CAudio * g_Audio; extern CSystemTimer * g_SystemTimer; extern CTransVaddr * g_TransVaddr; extern CSystemEvents * g_SystemEvents; -extern int * _NextTimer; +extern int * g_NextTimer; extern DWORD * _TLBLoadAddress; extern DWORD * _TLBStoreAddress;