From e8b96dd915e84b8588a776f83ea45231f2633bfa Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 17 Nov 2012 13:35:36 +1100 Subject: [PATCH] Global Variable: Rename _TransVaddr to g_TransVaddr --- .../Project64/N64 System/C Core/Logging.cpp | 4 +-- Source/Project64/N64 System/N64 Class.cpp | 4 +-- .../N64 System/Recompiler/Code Block.cpp | 4 +-- .../Recompiler/Recompiler Class.cpp | 26 +++++++++---------- .../N64 System/Recompiler/Recompiler Ops.cpp | 2 +- .../Project64/N64 System/System Globals.cpp | 2 +- Source/Project64/N64 System/System Globals.h | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Source/Project64/N64 System/C Core/Logging.cpp b/Source/Project64/N64 System/C Core/Logging.cpp index 77c70284d..01c84fc34 100644 --- a/Source/Project64/N64 System/C Core/Logging.cpp +++ b/Source/Project64/N64 System/C Core/Logging.cpp @@ -176,7 +176,7 @@ void Log_LW (DWORD PC, DWORD VAddr) { if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) { DWORD PAddr; - if (!_TransVaddr->TranslateVaddr(VAddr,PAddr)) + if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr)) { if (LogOptions.LogUnknown) { @@ -398,7 +398,7 @@ void Log_SW (DWORD PC, DWORD VAddr, DWORD Value) { if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) { DWORD PAddr; - if (!_TransVaddr->TranslateVaddr(VAddr,PAddr)) + if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr)) { if (LogOptions.LogUnknown) { diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 2fc2892b2..8a4101891 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -532,7 +532,7 @@ bool CN64System::SetActiveSystem( bool bActive ) g_Reg = &m_Reg; g_Audio = &m_Audio; g_SystemTimer = &m_SystemTimer; - _TransVaddr = &m_MMU_VM; + g_TransVaddr = &m_MMU_VM; _SystemEvents = this; _NextTimer = &m_NextTimer; g_Plugins = m_Plugins; @@ -563,7 +563,7 @@ bool CN64System::SetActiveSystem( bool bActive ) g_Reg = NULL; g_Audio = NULL; g_SystemTimer = NULL; - _TransVaddr = NULL; + g_TransVaddr = NULL; _SystemEvents = NULL; _NextTimer = NULL; g_Plugins = m_Plugins; diff --git a/Source/Project64/N64 System/Recompiler/Code Block.cpp b/Source/Project64/N64 System/Recompiler/Code Block.cpp index c6b60d947..a2203a776 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Block.cpp @@ -33,7 +33,7 @@ CCodeBlock::CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos) : m_Sections.push_back(m_EnterSection); m_SectionMap.insert(SectionMap::value_type(VAddrEnter,m_EnterSection)); - if (_TransVaddr->VAddrToRealAddr(VAddrEnter,*(reinterpret_cast(&m_MemLocation[0])))) + if (g_TransVaddr->VAddrToRealAddr(VAddrEnter,*(reinterpret_cast(&m_MemLocation[0])))) { m_MemLocation[1] = m_MemLocation[0] + 1; m_MemContents[0] = *m_MemLocation[0]; @@ -651,7 +651,7 @@ bool CCodeBlock::Compile() CompileExitCode(); DWORD PAddr; - _TransVaddr->TranslateVaddr(VAddrFirst(),PAddr); + g_TransVaddr->TranslateVaddr(VAddrFirst(),PAddr); MD5(g_MMU->Rdram() + PAddr,(VAddrLast() - VAddrFirst()) + 4).get_digest(m_Hash); return true; diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp index 87ff47a7e..676680191 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp @@ -83,10 +83,10 @@ void CRecompiler::RecompilerMain_VirtualTable ( void ) while(!Done) { - if (!_TransVaddr->ValidVaddr(PC)) + if (!g_TransVaddr->ValidVaddr(PC)) { g_Reg->DoTLBReadMiss(false,PC); - if (!_TransVaddr->ValidVaddr(PC)) + if (!g_TransVaddr->ValidVaddr(PC)) { g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PC); return; @@ -331,7 +331,7 @@ void CRecompiler::RecompilerMain_Lookup( void ) } else { DWORD opsExecuted = 0; - while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) + while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) { CInterpreterCPU::ExecuteOps(CountPerOp()); opsExecuted += CountPerOp(); @@ -502,10 +502,10 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void ) while(!m_EndEmulation) { - if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) + if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) { g_Reg->DoTLBReadMiss(false,PROGRAM_COUNTER); - if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) + if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) { g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER); m_EndEmulation = true; @@ -533,7 +533,7 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void ) } else { DWORD opsExecuted = 0; - while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) + while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) { CInterpreterCPU::ExecuteOps(CountPerOp()); opsExecuted += CountPerOp(); @@ -581,7 +581,7 @@ void CRecompiler::RecompilerMain_Lookup_validate( void ) } else { DWORD opsExecuted = 0; - while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) + while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) { CInterpreterCPU::ExecuteOps(CountPerOp()); opsExecuted += CountPerOp(); @@ -602,10 +602,10 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void ) while(!m_EndEmulation) { - if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) + if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) { g_Reg->DoTLBReadMiss(false,PROGRAM_COUNTER); - if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) + if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) { g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER); m_EndEmulation = true; @@ -651,7 +651,7 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void ) } else { DWORD opsExecuted = 0; - while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) + while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) { CInterpreterCPU::ExecuteOps(CountPerOp()); opsExecuted += CountPerOp(); @@ -835,7 +835,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void ) CCompiledFunc * CRecompiler::CompilerCode ( void ) { DWORD pAddr = 0; - if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER,pAddr)) + if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER,pAddr)) { WriteTraceF(TraceError,"CRecompiler::CompilerCode: Failed to translate %X",PROGRAM_COUNTER); return NULL; @@ -847,7 +847,7 @@ CCompiledFunc * CRecompiler::CompilerCode ( void ) for (CCompiledFunc * Func = iter->second; Func != NULL; Func = Func->Next()) { DWORD PAddr; - if (_TransVaddr->TranslateVaddr(Func->MinPC(),PAddr)) + if (g_TransVaddr->TranslateVaddr(Func->MinPC(),PAddr)) { MD5Digest Hash; MD5(g_MMU->Rdram() + PAddr,(Func->MaxPC() - Func->MinPC())+ 4).get_digest(Hash); @@ -961,7 +961,7 @@ void CRecompiler::ClearRecompCode_Virt(DWORD Address, int length,REMOVE_REASON R case FuncFind_PhysicalLookup: { DWORD pAddr = 0; - if (_TransVaddr->TranslateVaddr(Address,pAddr)) + if (g_TransVaddr->TranslateVaddr(Address,pAddr)) { ClearRecompCode_Phys(pAddr,length,Reason); } diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index acee21106..6d6f1612e 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -1650,7 +1650,7 @@ void CRecompilerOps::LUI (void) { x86Reg Reg = Map_MemoryStack(x86_Any, true, false); DWORD Address; - _TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address); + g_TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address); if (Reg < 0) { MoveConstToVariable((DWORD)(Address + g_MMU->Rdram()), &(g_Recompiler->MemoryStackPos()), "MemoryStack"); } else { diff --git a/Source/Project64/N64 System/System Globals.cpp b/Source/Project64/N64 System/System Globals.cpp index d76634246..ec027615a 100644 --- a/Source/Project64/N64 System/System Globals.cpp +++ b/Source/Project64/N64 System/System Globals.cpp @@ -12,7 +12,7 @@ CPlugins * g_Plugins = NULL; CN64Rom * g_Rom = NULL; //The current rom that this system is executing.. it can only execute one file at the time CAudio * g_Audio = NULL; CSystemTimer * g_SystemTimer = NULL; -CTransVaddr * _TransVaddr = NULL; +CTransVaddr * g_TransVaddr = NULL; CSystemEvents * _SystemEvents = NULL; DWORD * _TLBLoadAddress = NULL; DWORD * _TLBStoreAddress = NULL; diff --git a/Source/Project64/N64 System/System Globals.h b/Source/Project64/N64 System/System Globals.h index 222a4af3f..0ed7cd888 100644 --- a/Source/Project64/N64 System/System Globals.h +++ b/Source/Project64/N64 System/System Globals.h @@ -12,7 +12,7 @@ extern CPlugins * g_Plugins; extern CN64Rom * g_Rom; //The current rom that this system is executing.. it can only execute one file at the time extern CAudio * g_Audio; extern CSystemTimer * g_SystemTimer; -extern CTransVaddr * _TransVaddr; +extern CTransVaddr * g_TransVaddr; extern CSystemEvents * _SystemEvents; extern int * _NextTimer; extern DWORD * _TLBLoadAddress;