Global Variable: Rename _TransVaddr to g_TransVaddr

This commit is contained in:
zilmar 2012-11-17 13:35:36 +11:00
parent 2bebce913e
commit e8b96dd915
7 changed files with 22 additions and 22 deletions

View File

@ -176,7 +176,7 @@ void Log_LW (DWORD PC, DWORD VAddr) {
if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 )
{ {
DWORD PAddr; DWORD PAddr;
if (!_TransVaddr->TranslateVaddr(VAddr,PAddr)) if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr))
{ {
if (LogOptions.LogUnknown) if (LogOptions.LogUnknown)
{ {
@ -398,7 +398,7 @@ void Log_SW (DWORD PC, DWORD VAddr, DWORD Value) {
if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 )
{ {
DWORD PAddr; DWORD PAddr;
if (!_TransVaddr->TranslateVaddr(VAddr,PAddr)) if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr))
{ {
if (LogOptions.LogUnknown) if (LogOptions.LogUnknown)
{ {

View File

@ -532,7 +532,7 @@ bool CN64System::SetActiveSystem( bool bActive )
g_Reg = &m_Reg; g_Reg = &m_Reg;
g_Audio = &m_Audio; g_Audio = &m_Audio;
g_SystemTimer = &m_SystemTimer; g_SystemTimer = &m_SystemTimer;
_TransVaddr = &m_MMU_VM; g_TransVaddr = &m_MMU_VM;
_SystemEvents = this; _SystemEvents = this;
_NextTimer = &m_NextTimer; _NextTimer = &m_NextTimer;
g_Plugins = m_Plugins; g_Plugins = m_Plugins;
@ -563,7 +563,7 @@ bool CN64System::SetActiveSystem( bool bActive )
g_Reg = NULL; g_Reg = NULL;
g_Audio = NULL; g_Audio = NULL;
g_SystemTimer = NULL; g_SystemTimer = NULL;
_TransVaddr = NULL; g_TransVaddr = NULL;
_SystemEvents = NULL; _SystemEvents = NULL;
_NextTimer = NULL; _NextTimer = NULL;
g_Plugins = m_Plugins; g_Plugins = m_Plugins;

View File

@ -33,7 +33,7 @@ CCodeBlock::CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos) :
m_Sections.push_back(m_EnterSection); m_Sections.push_back(m_EnterSection);
m_SectionMap.insert(SectionMap::value_type(VAddrEnter,m_EnterSection)); m_SectionMap.insert(SectionMap::value_type(VAddrEnter,m_EnterSection));
if (_TransVaddr->VAddrToRealAddr(VAddrEnter,*(reinterpret_cast<void **>(&m_MemLocation[0])))) if (g_TransVaddr->VAddrToRealAddr(VAddrEnter,*(reinterpret_cast<void **>(&m_MemLocation[0]))))
{ {
m_MemLocation[1] = m_MemLocation[0] + 1; m_MemLocation[1] = m_MemLocation[0] + 1;
m_MemContents[0] = *m_MemLocation[0]; m_MemContents[0] = *m_MemLocation[0];
@ -651,7 +651,7 @@ bool CCodeBlock::Compile()
CompileExitCode(); CompileExitCode();
DWORD PAddr; DWORD PAddr;
_TransVaddr->TranslateVaddr(VAddrFirst(),PAddr); g_TransVaddr->TranslateVaddr(VAddrFirst(),PAddr);
MD5(g_MMU->Rdram() + PAddr,(VAddrLast() - VAddrFirst()) + 4).get_digest(m_Hash); MD5(g_MMU->Rdram() + PAddr,(VAddrLast() - VAddrFirst()) + 4).get_digest(m_Hash);
return true; return true;

View File

@ -83,10 +83,10 @@ void CRecompiler::RecompilerMain_VirtualTable ( void )
while(!Done) while(!Done)
{ {
if (!_TransVaddr->ValidVaddr(PC)) if (!g_TransVaddr->ValidVaddr(PC))
{ {
g_Reg->DoTLBReadMiss(false,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); g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PC);
return; return;
@ -331,7 +331,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
} else { } else {
DWORD opsExecuted = 0; DWORD opsExecuted = 0;
while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize())
{ {
CInterpreterCPU::ExecuteOps(CountPerOp()); CInterpreterCPU::ExecuteOps(CountPerOp());
opsExecuted += CountPerOp(); opsExecuted += CountPerOp();
@ -502,10 +502,10 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void )
while(!m_EndEmulation) while(!m_EndEmulation)
{ {
if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr))
{ {
g_Reg->DoTLBReadMiss(false,PROGRAM_COUNTER); 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); g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
m_EndEmulation = true; m_EndEmulation = true;
@ -533,7 +533,7 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void )
} else { } else {
DWORD opsExecuted = 0; DWORD opsExecuted = 0;
while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize())
{ {
CInterpreterCPU::ExecuteOps(CountPerOp()); CInterpreterCPU::ExecuteOps(CountPerOp());
opsExecuted += CountPerOp(); opsExecuted += CountPerOp();
@ -581,7 +581,7 @@ void CRecompiler::RecompilerMain_Lookup_validate( void )
} else { } else {
DWORD opsExecuted = 0; DWORD opsExecuted = 0;
while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize())
{ {
CInterpreterCPU::ExecuteOps(CountPerOp()); CInterpreterCPU::ExecuteOps(CountPerOp());
opsExecuted += CountPerOp(); opsExecuted += CountPerOp();
@ -602,10 +602,10 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void )
while(!m_EndEmulation) while(!m_EndEmulation)
{ {
if (!_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr))
{ {
g_Reg->DoTLBReadMiss(false,PROGRAM_COUNTER); 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); g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
m_EndEmulation = true; m_EndEmulation = true;
@ -651,7 +651,7 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void )
} else { } else {
DWORD opsExecuted = 0; DWORD opsExecuted = 0;
while (_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize()) while (g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr) && PhysicalAddr >= RdramSize())
{ {
CInterpreterCPU::ExecuteOps(CountPerOp()); CInterpreterCPU::ExecuteOps(CountPerOp());
opsExecuted += CountPerOp(); opsExecuted += CountPerOp();
@ -835,7 +835,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
CCompiledFunc * CRecompiler::CompilerCode ( void ) CCompiledFunc * CRecompiler::CompilerCode ( void )
{ {
DWORD pAddr = 0; 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); WriteTraceF(TraceError,"CRecompiler::CompilerCode: Failed to translate %X",PROGRAM_COUNTER);
return NULL; return NULL;
@ -847,7 +847,7 @@ CCompiledFunc * CRecompiler::CompilerCode ( void )
for (CCompiledFunc * Func = iter->second; Func != NULL; Func = Func->Next()) for (CCompiledFunc * Func = iter->second; Func != NULL; Func = Func->Next())
{ {
DWORD PAddr; DWORD PAddr;
if (_TransVaddr->TranslateVaddr(Func->MinPC(),PAddr)) if (g_TransVaddr->TranslateVaddr(Func->MinPC(),PAddr))
{ {
MD5Digest Hash; MD5Digest Hash;
MD5(g_MMU->Rdram() + PAddr,(Func->MaxPC() - Func->MinPC())+ 4).get_digest(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: case FuncFind_PhysicalLookup:
{ {
DWORD pAddr = 0; DWORD pAddr = 0;
if (_TransVaddr->TranslateVaddr(Address,pAddr)) if (g_TransVaddr->TranslateVaddr(Address,pAddr))
{ {
ClearRecompCode_Phys(pAddr,length,Reason); ClearRecompCode_Phys(pAddr,length,Reason);
} }

View File

@ -1650,7 +1650,7 @@ void CRecompilerOps::LUI (void) {
x86Reg Reg = Map_MemoryStack(x86_Any, true, false); x86Reg Reg = Map_MemoryStack(x86_Any, true, false);
DWORD Address; DWORD Address;
_TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address); g_TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address);
if (Reg < 0) { if (Reg < 0) {
MoveConstToVariable((DWORD)(Address + g_MMU->Rdram()), &(g_Recompiler->MemoryStackPos()), "MemoryStack"); MoveConstToVariable((DWORD)(Address + g_MMU->Rdram()), &(g_Recompiler->MemoryStackPos()), "MemoryStack");
} else { } else {

View File

@ -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 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; CAudio * g_Audio = NULL;
CSystemTimer * g_SystemTimer = NULL; CSystemTimer * g_SystemTimer = NULL;
CTransVaddr * _TransVaddr = NULL; CTransVaddr * g_TransVaddr = NULL;
CSystemEvents * _SystemEvents = NULL; CSystemEvents * _SystemEvents = NULL;
DWORD * _TLBLoadAddress = NULL; DWORD * _TLBLoadAddress = NULL;
DWORD * _TLBStoreAddress = NULL; DWORD * _TLBStoreAddress = NULL;

View File

@ -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 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 CAudio * g_Audio;
extern CSystemTimer * g_SystemTimer; extern CSystemTimer * g_SystemTimer;
extern CTransVaddr * _TransVaddr; extern CTransVaddr * g_TransVaddr;
extern CSystemEvents * _SystemEvents; extern CSystemEvents * _SystemEvents;
extern int * _NextTimer; extern int * _NextTimer;
extern DWORD * _TLBLoadAddress; extern DWORD * _TLBLoadAddress;