Global Variable: Rename _Recompiler to g_Recompiler

This commit is contained in:
zilmar 2012-11-17 12:15:55 +11:00
parent 4e1d29d322
commit 278f99cf39
12 changed files with 34 additions and 34 deletions

View File

@ -145,9 +145,9 @@ void CDMA::PI_DMA_WRITE (void) {
g_System->SetDmaUsed(true);
OnFirstDMA();
}
if (_Recompiler && _Recompiler->bSMM_PIDMA())
if (g_Recompiler && g_Recompiler->bSMM_PIDMA())
{
_Recompiler->ClearRecompCode_Phys(_Reg->PI_DRAM_ADDR_REG, _Reg->PI_WR_LEN_REG,CRecompiler::Remove_DMA);
g_Recompiler->ClearRecompCode_Phys(_Reg->PI_DRAM_ADDR_REG, _Reg->PI_WR_LEN_REG,CRecompiler::Remove_DMA);
}
_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
_Reg->MI_INTR_REG |= MI_INTR_PI;

View File

@ -1331,7 +1331,7 @@ void CMipsMemoryVM::ResetMemoryStack ( void)
AndConstToX86Reg(Reg,0x1FFFFFFF);
AddConstToX86Reg(Reg,(DWORD)m_RDRAM);
}
MoveX86regToVariable(Reg,&(_Recompiler->MemoryStackPos()), "MemoryStack");
MoveX86regToVariable(Reg,&(g_Recompiler->MemoryStackPos()), "MemoryStack");
}
int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
@ -1382,12 +1382,12 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
{
for (DWORD count = (Start & ~0xFFF); count < End; count += 0x1000 )
{
_Recompiler->ClearRecompCode_Phys(count,0x1000,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(count,0x1000,CRecompiler::Remove_ProtectedMem);
}
return EXCEPTION_CONTINUE_EXECUTION;
}
if (Start >= 0x04000000 && End < 0x04002000) {
_Recompiler->ClearRecompCode_Phys(Start & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(Start & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
return EXCEPTION_CONTINUE_EXECUTION;
}
if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__,__LINE__); }
@ -1932,7 +1932,7 @@ int CMipsMemoryVM::SB_NonMemory ( DWORD PAddr, BYTE Value ) {
if (PAddr < RdramSize())
{
DWORD OldProtect;
_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(BYTE *)(m_RDRAM+PAddr) = Value;
}
@ -1968,7 +1968,7 @@ int CMipsMemoryVM::SH_NonMemory ( DWORD PAddr, WORD Value ) {
#endif
if (PAddr < RdramSize()) {
DWORD OldProtect;
_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(WORD *)(m_RDRAM+PAddr) = Value;
}
@ -2020,7 +2020,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
#endif
if (PAddr < RdramSize()) {
DWORD OldProtect;
_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0x1000,CRecompiler::Remove_ProtectedMem);
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(DWORD *)(m_RDRAM+PAddr) = Value;
}
@ -2049,7 +2049,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
break;
case 0x04000000:
if (PAddr < 0x04002000) {
_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0xFFF,CRecompiler::Remove_ProtectedMem);
g_Recompiler->ClearRecompCode_Phys(PAddr & ~0xFFF,0xFFF,CRecompiler::Remove_ProtectedMem);
*(DWORD *)(m_RDRAM+PAddr) = Value;
} else {
switch (PAddr) {
@ -3554,7 +3554,7 @@ void CMipsMemoryVM::Compile_SWR (void)
void CMipsMemoryVM::Compile_StoreInstructClean (x86Reg AddressReg, int Length )
{
if (!_Recompiler->bSMM_StoreInstruc())
if (!g_Recompiler->bSMM_StoreInstruc())
{
return;
}
@ -3571,7 +3571,7 @@ void CMipsMemoryVM::Compile_StoreInstructClean (x86Reg AddressReg, int Length )
PushImm32("CRecompiler::Remove_StoreInstruc",CRecompiler::Remove_StoreInstruc);
PushImm32(Length);
Push(AddressReg);
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
MoveConstToX86reg((DWORD)g_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::ClearRecompCode_Virt), "CRecompiler::ClearRecompCode_Virt");
AfterCallDirect(m_RegWorkingSet);
/*JmpLabel8("MemCheckDone",0);
@ -3583,7 +3583,7 @@ void CMipsMemoryVM::Compile_StoreInstructClean (x86Reg AddressReg, int Length )
MoveX86RegToX86Reg(AddressReg, StoreTemp1);
ShiftRightUnsignImmed(StoreTemp1,12);
LeaRegReg(StoreTemp1,StoreTemp1,(ULONG)&(_Recompiler->FunctionTable()[0]),Multip_x4);
LeaRegReg(StoreTemp1,StoreTemp1,(ULONG)&(g_Recompiler->FunctionTable()[0]),Multip_x4);
CompConstToX86regPointer(StoreTemp1,0);
JeLabel8("MemCheckDone",0);
BYTE * MemCheckDone2 = m_RecompPos - 1;
@ -3592,7 +3592,7 @@ void CMipsMemoryVM::Compile_StoreInstructClean (x86Reg AddressReg, int Length )
PushImm32("CRecompiler::Remove_StoreInstruc",CRecompiler::Remove_StoreInstruc);
PushImm32(strLen.c_str(),Length);
Push(AddressReg);
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
MoveConstToX86reg((DWORD)g_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::ClearRecompCode_Virt), "CRecompiler::ClearRecompCode_Virt");
AfterCallDirect(m_RegWorkingSet);

View File

@ -284,9 +284,9 @@ void CRegisters::CheckInterrupts ( void )
if (m_FirstInterupt)
{
m_FirstInterupt = false;
if (_Recompiler)
if (g_Recompiler)
{
_Recompiler->ClearRecompCode_Virt(0x80000000,0x200,CRecompiler::Remove_InitialCode);
g_Recompiler->ClearRecompCode_Virt(0x80000000,0x200,CRecompiler::Remove_InitialCode);
}
}
_SystemEvents->QueueEvent(SysEvent_ExecuteInterrupt);

View File

@ -216,5 +216,5 @@ void CSystemEvents::ChangePluginFunc ( void )
g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT);
g_BaseSystem->m_EndEmulation = true;
}
_Recompiler->ResetRecompCode();
g_Recompiler->ResetRecompCode();
}

View File

@ -526,7 +526,7 @@ bool CN64System::SetActiveSystem( bool bActive )
{
g_SyncSystem = m_SyncCPU;
}
_Recompiler = m_Recomp;
g_Recompiler = m_Recomp;
_MMU = &m_MMU_VM;
_TLB = &m_TLB;
_Reg = &m_Reg;
@ -558,7 +558,7 @@ bool CN64System::SetActiveSystem( bool bActive )
{
g_System = NULL;
g_SyncSystem = NULL;
_Recompiler = NULL;
g_Recompiler = NULL;
_MMU = NULL;
_TLB = NULL;
_Reg = NULL;

View File

@ -396,7 +396,7 @@ void CCodeSection::GenerateSectionLinkage (void)
// check if there is an existing section
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
MoveConstToX86reg((DWORD)g_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::CompileDelaySlot), "CRecompiler::CompileDelaySlot");
JmpDirectReg(x86_EAX);
ExitCodeBlock();
@ -635,7 +635,7 @@ void CCodeSection::SyncRegState ( const CRegInfo & SyncTo )
UnMap_X86reg(TargetStackReg);
CPU_Message(" regcache: allocate %s as Memory Stack",x86_Name(TargetStackReg));
m_RegWorkingSet.SetX86Mapped(TargetStackReg,CRegInfo::Stack_Mapped);
MoveVariableToX86reg(&_Recompiler->MemoryStackPos(),"MemoryStack",TargetStackReg);
MoveVariableToX86reg(&g_Recompiler->MemoryStackPos(),"MemoryStack",TargetStackReg);
} else {
UnMap_X86reg(TargetStackReg);
CPU_Message(" regcache: change allocation of Memory Stack from %s to %s",x86_Name(MemStackReg),x86_Name(TargetStackReg));

View File

@ -13,7 +13,7 @@ CFunctionMap::~CFunctionMap()
bool CFunctionMap::AllocateMemory()
{
if (_Recompiler->LookUpMode() == FuncFind_VirtualLookup)
if (g_Recompiler->LookUpMode() == FuncFind_VirtualLookup)
{
if (m_FunctionTable == NULL)
{
@ -26,7 +26,7 @@ bool CFunctionMap::AllocateMemory()
memset(m_FunctionTable,0,0xFFFFF * sizeof(CCompiledFunc *));
}
}
if (_Recompiler->LookUpMode() == FuncFind_PhysicalLookup)
if (g_Recompiler->LookUpMode() == FuncFind_PhysicalLookup)
{
m_JumpTable = new PCCompiledFunc[_MMU->RdramSize() >> 2];
if (m_JumpTable == NULL) {
@ -62,8 +62,8 @@ void CFunctionMap::CleanBuffers ( void )
void CFunctionMap::Reset ( void )
{
bool bAllocate = (_Recompiler->LookUpMode() == FuncFind_VirtualLookup && m_FunctionTable != NULL) ||
(_Recompiler->LookUpMode() == FuncFind_PhysicalLookup && m_JumpTable != NULL);
bool bAllocate = (g_Recompiler->LookUpMode() == FuncFind_VirtualLookup && m_FunctionTable != NULL) ||
(g_Recompiler->LookUpMode() == FuncFind_PhysicalLookup && m_JumpTable != NULL);
CleanBuffers();
if (bAllocate)
{

View File

@ -50,7 +50,7 @@ void CRecompMemory::CheckRecompMem ( void )
}
if (m_RecompSize == MaxCompileBufferSize)
{
_Recompiler->ResetRecompCode();
g_Recompiler->ResetRecompCode();
return;
}
LPVOID MemAddr = VirtualAlloc( m_RecompCode + m_RecompSize , IncreaseCompileBufferSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);

View File

@ -1652,7 +1652,7 @@ void CRecompilerOps::LUI (void) {
_TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address);
if (Reg < 0) {
MoveConstToVariable((DWORD)(Address + _MMU->Rdram()), &(_Recompiler->MemoryStackPos()), "MemoryStack");
MoveConstToVariable((DWORD)(Address + _MMU->Rdram()), &(g_Recompiler->MemoryStackPos()), "MemoryStack");
} else {
MoveConstToX86reg((DWORD)(Address + _MMU->Rdram()), Reg);
}
@ -1699,7 +1699,7 @@ void CRecompilerOps::CACHE (void){
AddConstToX86Reg(x86_EAX,(short)m_Opcode.offset);
Push(x86_EAX);
}
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
MoveConstToX86reg((DWORD)g_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::ClearRecompCode_Virt), "CRecompiler::ClearRecompCode_Virt");
AfterCallDirect(m_RegWorkingSet);
break;
@ -5193,9 +5193,9 @@ void CRecompilerOps::OverflowDelaySlot (BOOL TestTimer)
PushImm32("CountPerOp()",CountPerOp());
Call_Direct(CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps");
AddConstToX86Reg(x86_ESP,4);
if (bFastSP() && _Recompiler)
if (bFastSP() && g_Recompiler)
{
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
MoveConstToX86reg((DWORD)g_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos");
}

View File

@ -514,7 +514,7 @@ CRegInfo::x86Reg CRegInfo::Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool
CPU_Message(" regcache: allocate %s as Memory Stack",x86_Name(Reg));
if (LoadValue)
{
MoveVariableToX86reg(&_Recompiler->MemoryStackPos(),"MemoryStack",Reg);
MoveVariableToX86reg(&g_Recompiler->MemoryStackPos(),"MemoryStack",Reg);
}
return Reg;
}
@ -532,7 +532,7 @@ CRegInfo::x86Reg CRegInfo::Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool
CPU_Message(" regcache: allocate %s as Memory Stack",x86_Name(Reg));
if (LoadValue)
{
MoveVariableToX86reg(&_Recompiler->MemoryStackPos(),"MemoryStack",Reg);
MoveVariableToX86reg(&g_Recompiler->MemoryStackPos(),"MemoryStack",Reg);
}
}
return Reg;
@ -1113,7 +1113,7 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
}
} else if (GetX86Mapped(Reg) == CRegInfo::Stack_Mapped) {
CPU_Message(" regcache: unallocate %s from Memory Stack",x86_Name(Reg));
MoveX86regToVariable(Reg,&(_Recompiler->MemoryStackPos()),"MemoryStack");
MoveX86regToVariable(Reg,&(g_Recompiler->MemoryStackPos()),"MemoryStack");
SetX86Mapped(Reg,NotMapped);
return TRUE;
}

View File

@ -3,7 +3,7 @@
CN64System * g_System = NULL;
CN64System * g_BaseSystem = NULL;
CN64System * g_SyncSystem = NULL;
CRecompiler * _Recompiler = NULL;
CRecompiler * g_Recompiler = NULL;
CMipsMemory * _MMU = NULL; //Memory of the n64
CTLB * _TLB = NULL; //TLB Unit
CRegisters * _Reg = NULL; //Current Register Set attacted to the _MMU

View File

@ -4,7 +4,7 @@ extern CSettings * g_Settings;
extern CN64System * g_System;
extern CN64System * g_BaseSystem;
extern CN64System * g_SyncSystem;
extern CRecompiler * _Recompiler;
extern CRecompiler * g_Recompiler;
extern CMipsMemory * _MMU; //Memory of the n64
extern CTLB * _TLB; //TLB Unit
extern CRegisters * _Reg; //Current Register Set attacted to the _MMU