From 4e1d29d3221c01a4ce4c0263c5e9173a3f0b98ac Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 17 Nov 2012 12:12:54 +1100 Subject: [PATCH] Global Variable: Rename _SyncSystem to g_SyncSystem --- Source/Project64/N64 System/N64 Class.cpp | 8 ++--- .../N64 System/Recompiler/Code Block.cpp | 2 +- .../N64 System/Recompiler/Code Section.cpp | 32 +++++++++---------- .../Recompiler/Recompiler Class.cpp | 24 +++++++------- .../N64 System/Recompiler/Recompiler Ops.cpp | 12 +++---- .../Project64/N64 System/System Globals.cpp | 2 +- Source/Project64/N64 System/System Globals.h | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index d2f86e283..4c61ea761 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -524,7 +524,7 @@ bool CN64System::SetActiveSystem( bool bActive ) g_System = this; if (g_BaseSystem == this) { - _SyncSystem = m_SyncCPU; + g_SyncSystem = m_SyncCPU; } _Recompiler = m_Recomp; _MMU = &m_MMU_VM; @@ -557,7 +557,7 @@ bool CN64System::SetActiveSystem( bool bActive ) if (this == g_BaseSystem) { g_System = NULL; - _SyncSystem = NULL; + g_SyncSystem = NULL; _Recompiler = NULL; _MMU = NULL; _TLB = NULL; @@ -980,12 +980,12 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) void CN64System::SyncSystem() { - SyncCPU(_SyncSystem); + SyncCPU(g_SyncSystem); } void CN64System::SyncSystemPC() { - SyncCPUPC(_SyncSystem); + SyncCPUPC(g_SyncSystem); } void CN64System::DumpSyncErrors (CN64System * SecondCPU) { diff --git a/Source/Project64/N64 System/Recompiler/Code Block.cpp b/Source/Project64/N64 System/Recompiler/Code Block.cpp index 51125e450..8ea6902ad 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Block.cpp @@ -635,7 +635,7 @@ bool CCodeBlock::Compile() EnterCodeBlock(); - if (_SyncSystem) { + if (g_SyncSystem) { //if ((DWORD)BlockInfo.CompiledLocation == 0x60A7B73B) { X86BreakPoint(__FILE__,__LINE__); } //MoveConstToVariable((DWORD)BlockInfo.CompiledLocation,&CurrentBlock,"CurrentBlock"); } diff --git a/Source/Project64/N64 System/Recompiler/Code Section.cpp b/Source/Project64/N64 System/Recompiler/Code Section.cpp index cbfdc7204..ef69abdef 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Section.cpp @@ -148,7 +148,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg CompileSystemCheck((DWORD)-1,ExitRegSet); } } - if (_SyncSystem) + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); @@ -244,11 +244,11 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg case CExitInfo::DoCPU_Action: MoveConstToX86reg((DWORD)_SystemEvents,x86_ECX); Call_Direct(AddressOf(&CSystemEvents::ExecuteEvents),"CSystemEvents::ExecuteEvents"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } - //g_System->SyncCPU(_SyncSystem); + //g_System->SyncCPU(g_SyncSystem); ExitCodeBlock(); break; case CExitInfo::DoSysCall: @@ -257,7 +257,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg PushImm32(bDelay ? "true" : "false", bDelay); MoveConstToX86reg((DWORD)_Reg,x86_ECX); Call_Direct(AddressOf(&CRegisters::DoSysCallException), "CRegisters::DoSysCallException"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -271,7 +271,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg PushImm32(bDelay ? "true" : "false", bDelay); MoveConstToX86reg((DWORD)_Reg,x86_ECX); Call_Direct(AddressOf(&CRegisters::DoCopUnusableException), "CRegisters::DoCopUnusableException"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -284,7 +284,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg if (m_NextInstruction == JUMP || m_NextInstruction == DELAY_SLOT) { X86BreakPoint(__FILE__,__LINE__); } - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -300,7 +300,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg PushImm32(m_NextInstruction == JUMP || m_NextInstruction == DELAY_SLOT); MoveConstToX86reg((DWORD)_Reg,x86_ECX); Call_Direct(AddressOf(&CRegisters::DoTLBReadMiss),"CRegisters::DoTLBReadMiss"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -315,7 +315,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg } MoveConstToVariable(0,&_RegHI->UW[0],"_RegHI->UW[0]"); MoveConstToVariable(0,&_RegLO->UW[0],"_RegLO->UW[0]"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -387,7 +387,7 @@ void CCodeSection::GenerateSectionLinkage (void) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); // WriteBackRegisters(Section); - // if (_SyncSystem) { + // if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -483,7 +483,7 @@ void CCodeSection::GenerateSectionLinkage (void) CPU_Message("PermLoop *** 1"); MoveConstToVariable(JumpInfo[i]->TargetPC,_PROGRAM_COUNTER,"PROGRAM_COUNTER"); UpdateCounters(JumpInfo[i]->RegSet,false, true); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -937,7 +937,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -950,7 +950,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -967,7 +967,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) { UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { BeforeCallDirect(m_RegWorkingSet); MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystemPC), "CN64System::SyncSystemPC"); @@ -985,7 +985,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -1000,7 +1000,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -1010,7 +1010,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test ) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp index 351716254..1ae7394ba 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp @@ -337,10 +337,10 @@ void CRecompiler::RecompilerMain_Lookup( void ) opsExecuted += CountPerOp(); } - if (_SyncSystem) + if (g_SyncSystem) { - g_System->UpdateSyncCPU(_SyncSystem,opsExecuted); - g_System->SyncCPU(_SyncSystem); + g_System->UpdateSyncCPU(g_SyncSystem,opsExecuted); + g_System->SyncCPU(g_SyncSystem); } } } @@ -539,10 +539,10 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void ) opsExecuted += CountPerOp(); } - if (_SyncSystem) + if (g_SyncSystem) { - g_System->UpdateSyncCPU(_SyncSystem,opsExecuted); - g_System->SyncCPU(_SyncSystem); + g_System->UpdateSyncCPU(g_SyncSystem,opsExecuted); + g_System->SyncCPU(g_SyncSystem); } } } @@ -587,10 +587,10 @@ void CRecompiler::RecompilerMain_Lookup_validate( void ) opsExecuted += CountPerOp(); } - if (_SyncSystem) + if (g_SyncSystem) { - g_System->UpdateSyncCPU(_SyncSystem,opsExecuted); - g_System->SyncCPU(_SyncSystem); + g_System->UpdateSyncCPU(g_SyncSystem,opsExecuted); + g_System->SyncCPU(g_SyncSystem); } } } @@ -657,10 +657,10 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void ) opsExecuted += CountPerOp(); } - if (_SyncSystem) + if (g_SyncSystem) { - g_System->UpdateSyncCPU(_SyncSystem,opsExecuted); - g_System->SyncCPU(_SyncSystem); + g_System->UpdateSyncCPU(g_SyncSystem,opsExecuted); + g_System->SyncCPU(g_SyncSystem); } } } diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 84c52d7b3..2f643e44b 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -5058,7 +5058,7 @@ void CRecompilerOps::UnknownOpcode (void) { m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(m_CompilePC,&_Reg->m_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -5107,7 +5107,7 @@ void CRecompilerOps::ExitCodeBlock ( void ) void CRecompilerOps::UpdateSyncCPU ( CRegInfo & RegSet, DWORD Cycles ) { - if (!_SyncSystem) + if (!g_SyncSystem) { return; } @@ -5115,7 +5115,7 @@ void CRecompilerOps::UpdateSyncCPU ( CRegInfo & RegSet, DWORD Cycles ) WriteX86Comment("Updating Sync CPU"); BeforeCallDirect(RegSet); PushImm32(stdstr_f("%d",Cycles).c_str(),Cycles); - PushImm32("_SyncSystem",(DWORD)_SyncSystem); + PushImm32("g_SyncSystem",(DWORD)g_SyncSystem); MoveConstToX86reg((DWORD)g_System,x86_ECX); Call_Direct(AddressOf(&CN64System::UpdateSyncCPU),"CN64System::UpdateSyncCPU"); AfterCallDirect(RegSet); @@ -5166,7 +5166,7 @@ void CRecompilerOps::CompileSystemCheck (DWORD TargetPC, const CRegInfo & RegSet MoveConstToX86reg((DWORD)_SystemEvents,x86_ECX); Call_Direct(AddressOf(&CSystemEvents::ExecuteEvents),"CSystemEvents::ExecuteEvents"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -5181,7 +5181,7 @@ void CRecompilerOps::OverflowDelaySlot (BOOL TestTimer) m_RegWorkingSet.WriteBackRegisters(); UpdateCounters(m_RegWorkingSet,false,true); MoveConstToVariable(CompilePC() + 4,_PROGRAM_COUNTER,"PROGRAM_COUNTER"); - if (_SyncSystem) { + if (g_SyncSystem) { MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); Call_Direct(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } @@ -5199,7 +5199,7 @@ void CRecompilerOps::OverflowDelaySlot (BOOL TestTimer) Call_Direct(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos"); } - if (_SyncSystem) + if (g_SyncSystem) { UpdateSyncCPU(m_RegWorkingSet,CountPerOp()); MoveConstToX86reg((DWORD)g_BaseSystem,x86_ECX); diff --git a/Source/Project64/N64 System/System Globals.cpp b/Source/Project64/N64 System/System Globals.cpp index 27fdbee22..33b241b2d 100644 --- a/Source/Project64/N64 System/System Globals.cpp +++ b/Source/Project64/N64 System/System Globals.cpp @@ -2,7 +2,7 @@ CN64System * g_System = NULL; CN64System * g_BaseSystem = NULL; -CN64System * _SyncSystem = NULL; +CN64System * g_SyncSystem = NULL; CRecompiler * _Recompiler = NULL; CMipsMemory * _MMU = NULL; //Memory of the n64 CTLB * _TLB = NULL; //TLB Unit diff --git a/Source/Project64/N64 System/System Globals.h b/Source/Project64/N64 System/System Globals.h index 964f4ebd5..df0db9d67 100644 --- a/Source/Project64/N64 System/System Globals.h +++ b/Source/Project64/N64 System/System Globals.h @@ -3,7 +3,7 @@ extern CSettings * g_Settings; extern CN64System * g_System; extern CN64System * g_BaseSystem; -extern CN64System * _SyncSystem; +extern CN64System * g_SyncSystem; extern CRecompiler * _Recompiler; extern CMipsMemory * _MMU; //Memory of the n64 extern CTLB * _TLB; //TLB Unit