Global Variable: Rename _Plugins to g_Plugins

This commit is contained in:
zilmar 2012-11-17 13:20:21 +11:00
parent 3a73b759ad
commit 1992505c7f
12 changed files with 101 additions and 101 deletions

View File

@ -202,7 +202,7 @@ void CInterpreterCPU::InPermLoop (void) {
( g_Reg->STATUS_REGISTER & STATUS_ERL ) != 0 || ( g_Reg->STATUS_REGISTER & STATUS_ERL ) != 0 ||
( g_Reg->STATUS_REGISTER & 0xFF00) == 0) ( g_Reg->STATUS_REGISTER & 0xFF00) == 0)
{ {
if (_Plugins->Gfx()->UpdateScreen != NULL) { _Plugins->Gfx()->UpdateScreen(); } if (g_Plugins->Gfx()->UpdateScreen != NULL) { g_Plugins->Gfx()->UpdateScreen(); }
//CurrentFrame = 0; //CurrentFrame = 0;
//CurrentPercent = 0; //CurrentPercent = 0;
//DisplayFPS(); //DisplayFPS();

View File

@ -66,9 +66,9 @@ void CAudio::LenChanged ( void )
m_Status = 0; m_Status = 0;
} }
if (_Plugins->Audio()->LenChanged != NULL) if (g_Plugins->Audio()->LenChanged != NULL)
{ {
_Plugins->Audio()->LenChanged(); g_Plugins->Audio()->LenChanged();
} }
WriteTraceF(TraceAudio,__FUNCTION__ ": Done"); WriteTraceF(TraceAudio,__FUNCTION__ ": Done");
} }

View File

@ -463,9 +463,9 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
MoveVariableToX86reg(&m_TempValue,"m_TempValue",Reg); MoveVariableToX86reg(&m_TempValue,"m_TempValue",Reg);
} else { } else {
if (_Plugins->Audio()->ReadLength != NULL) { if (g_Plugins->Audio()->ReadLength != NULL) {
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(_Plugins->Audio()->ReadLength,"AiReadLength"); Call_Direct(g_Plugins->Audio()->ReadLength,"AiReadLength");
MoveX86regToVariable(x86_EAX,&m_TempValue,"m_TempValue"); MoveX86regToVariable(x86_EAX,&m_TempValue,"m_TempValue");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
MoveVariableToX86reg(&m_TempValue,"m_TempValue",Reg); MoveVariableToX86reg(&m_TempValue,"m_TempValue",Reg);
@ -833,13 +833,13 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x04400000: case 0x04400000:
switch (PAddr) { switch (PAddr) {
case 0x04400000: case 0x04400000:
if (_Plugins->Gfx()->ViStatusChanged != NULL) { if (g_Plugins->Gfx()->ViStatusChanged != NULL) {
CompConstToVariable(Value,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG"); CompConstToVariable(Value,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG");
JeLabel8("Continue",0); JeLabel8("Continue",0);
Jump = m_RecompPos - 1; Jump = m_RecompPos - 1;
MoveConstToVariable(Value,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG"); MoveConstToVariable(Value,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG");
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(_Plugins->Gfx()->ViStatusChanged,"ViStatusChanged"); Call_Direct(g_Plugins->Gfx()->ViStatusChanged,"ViStatusChanged");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
CPU_Message(""); CPU_Message("");
CPU_Message(" Continue:"); CPU_Message(" Continue:");
@ -848,13 +848,13 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
break; break;
case 0x04400004: MoveConstToVariable((Value & 0xFFFFFF),&g_Reg->VI_ORIGIN_REG,"VI_ORIGIN_REG"); break; case 0x04400004: MoveConstToVariable((Value & 0xFFFFFF),&g_Reg->VI_ORIGIN_REG,"VI_ORIGIN_REG"); break;
case 0x04400008: case 0x04400008:
if (_Plugins->Gfx()->ViWidthChanged != NULL) { if (g_Plugins->Gfx()->ViWidthChanged != NULL) {
CompConstToVariable(Value,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG"); CompConstToVariable(Value,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG");
JeLabel8("Continue",0); JeLabel8("Continue",0);
Jump = m_RecompPos - 1; Jump = m_RecompPos - 1;
MoveConstToVariable(Value,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG"); MoveConstToVariable(Value,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG");
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(_Plugins->Gfx()->ViWidthChanged,"ViWidthChanged"); Call_Direct(g_Plugins->Gfx()->ViWidthChanged,"ViWidthChanged");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
CPU_Message(""); CPU_Message("");
CPU_Message(" Continue:"); CPU_Message(" Continue:");
@ -894,7 +894,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
MoveConstToX86reg((DWORD)_Audio,x86_ECX); MoveConstToX86reg((DWORD)_Audio,x86_ECX);
Call_Direct(AddressOf(&CAudio::LenChanged),"LenChanged"); Call_Direct(AddressOf(&CAudio::LenChanged),"LenChanged");
} else { } else {
Call_Direct(_Plugins->Audio()->LenChanged,"AiLenChanged"); Call_Direct(g_Plugins->Audio()->LenChanged,"AiLenChanged");
} }
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
@ -1109,13 +1109,13 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
case 0x04400000: case 0x04400000:
switch (PAddr) { switch (PAddr) {
case 0x04400000: case 0x04400000:
if (_Plugins->Gfx()->ViStatusChanged != NULL) { if (g_Plugins->Gfx()->ViStatusChanged != NULL) {
CompX86regToVariable(Reg,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG"); CompX86regToVariable(Reg,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG");
JeLabel8("Continue",0); JeLabel8("Continue",0);
Jump = m_RecompPos - 1; Jump = m_RecompPos - 1;
MoveX86regToVariable(Reg,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG"); MoveX86regToVariable(Reg,&g_Reg->VI_STATUS_REG,"VI_STATUS_REG");
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(_Plugins->Gfx()->ViStatusChanged,"ViStatusChanged"); Call_Direct(g_Plugins->Gfx()->ViStatusChanged,"ViStatusChanged");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
CPU_Message(""); CPU_Message("");
CPU_Message(" Continue:"); CPU_Message(" Continue:");
@ -1127,13 +1127,13 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AndConstToVariable(0xFFFFFF,&g_Reg->VI_ORIGIN_REG,"VI_ORIGIN_REG"); AndConstToVariable(0xFFFFFF,&g_Reg->VI_ORIGIN_REG,"VI_ORIGIN_REG");
break; break;
case 0x04400008: case 0x04400008:
if (_Plugins->Gfx()->ViWidthChanged != NULL) { if (g_Plugins->Gfx()->ViWidthChanged != NULL) {
CompX86regToVariable(Reg,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG"); CompX86regToVariable(Reg,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG");
JeLabel8("Continue",0); JeLabel8("Continue",0);
Jump = m_RecompPos - 1; Jump = m_RecompPos - 1;
MoveX86regToVariable(Reg,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG"); MoveX86regToVariable(Reg,&g_Reg->VI_WIDTH_REG,"VI_WIDTH_REG");
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(_Plugins->Gfx()->ViWidthChanged,"ViWidthChanged"); Call_Direct(g_Plugins->Gfx()->ViWidthChanged,"ViWidthChanged");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
CPU_Message(""); CPU_Message("");
CPU_Message(" Continue:"); CPU_Message(" Continue:");
@ -1176,7 +1176,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
MoveConstToX86reg((DWORD)_Audio,x86_ECX); MoveConstToX86reg((DWORD)_Audio,x86_ECX);
Call_Direct(AddressOf(&CAudio::LenChanged),"LenChanged"); Call_Direct(AddressOf(&CAudio::LenChanged),"LenChanged");
} else { } else {
Call_Direct(_Plugins->Audio()->LenChanged,"_Plugins->Audio()->LenChanged"); Call_Direct(g_Plugins->Audio()->LenChanged,"g_Plugins->Audio()->LenChanged");
} }
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
@ -1798,8 +1798,8 @@ int CMipsMemoryVM::LW_NonMemory ( DWORD PAddr, DWORD * Value ) {
{ {
*Value = _Audio->GetLength(); *Value = _Audio->GetLength();
} else { } else {
if (_Plugins->Audio()->ReadLength != NULL) { if (g_Plugins->Audio()->ReadLength != NULL) {
*Value = _Plugins->Audio()->ReadLength(); *Value = g_Plugins->Audio()->ReadLength();
} else { } else {
*Value = 0; *Value = 0;
} }
@ -2125,7 +2125,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
break; break;
case 0x04100004: case 0x04100004:
g_Reg->DPC_END_REG = Value; g_Reg->DPC_END_REG = Value;
if (_Plugins->Gfx()->ProcessRDPList) { _Plugins->Gfx()->ProcessRDPList(); } if (g_Plugins->Gfx()->ProcessRDPList) { g_Plugins->Gfx()->ProcessRDPList(); }
break; break;
//case 0x04100008: g_Reg->DPC_CURRENT_REG = Value; break; //case 0x04100008: g_Reg->DPC_CURRENT_REG = Value; break;
case 0x0410000C: case 0x0410000C:
@ -2202,7 +2202,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
case 0x04400000: case 0x04400000:
if (g_Reg->VI_STATUS_REG != Value) { if (g_Reg->VI_STATUS_REG != Value) {
g_Reg->VI_STATUS_REG = Value; g_Reg->VI_STATUS_REG = Value;
if (_Plugins->Gfx()->ViStatusChanged != NULL ) { _Plugins->Gfx()->ViStatusChanged(); } if (g_Plugins->Gfx()->ViStatusChanged != NULL ) { g_Plugins->Gfx()->ViStatusChanged(); }
} }
break; break;
case 0x04400004: case 0x04400004:
@ -2217,7 +2217,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
case 0x04400008: case 0x04400008:
if (g_Reg->VI_WIDTH_REG != Value) { if (g_Reg->VI_WIDTH_REG != Value) {
g_Reg->VI_WIDTH_REG = Value; g_Reg->VI_WIDTH_REG = Value;
if (_Plugins->Gfx()->ViWidthChanged != NULL ) { _Plugins->Gfx()->ViWidthChanged(); } if (g_Plugins->Gfx()->ViWidthChanged != NULL ) { g_Plugins->Gfx()->ViWidthChanged(); }
} }
break; break;
case 0x0440000C: g_Reg->VI_INTR_REG = Value; break; case 0x0440000C: g_Reg->VI_INTR_REG = Value; break;
@ -2247,7 +2247,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
{ {
_Audio->LenChanged(); _Audio->LenChanged();
} else { } else {
if (_Plugins->Audio()->LenChanged != NULL) { _Plugins->Audio()->LenChanged(); } if (g_Plugins->Audio()->LenChanged != NULL) { g_Plugins->Audio()->LenChanged(); }
} }
break; break;
case 0x04500008: g_Reg->AI_CONTROL_REG = (Value & 1); break; case 0x04500008: g_Reg->AI_CONTROL_REG = (Value & 1); break;
@ -2259,7 +2259,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
break; break;
case 0x04500010: case 0x04500010:
g_Reg->AI_DACRATE_REG = Value; g_Reg->AI_DACRATE_REG = Value;
_Plugins->Audio()->DacrateChanged(g_System->m_SystemType); g_Plugins->Audio()->DacrateChanged(g_System->m_SystemType);
if (bFixedAudio()) if (bFixedAudio())
{ {
_Audio->SetFrequency(Value,g_System->m_SystemType); _Audio->SetFrequency(Value,g_System->m_SystemType);

View File

@ -78,7 +78,7 @@ void CPifRam::PifRamRead (void)
return; return;
} }
CONTROL * Controllers = _Plugins->Control()->PluginControllers(); CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
int Channel = 0; int Channel = 0;
for (int CurPos = 0; CurPos < 0x40; CurPos ++) for (int CurPos = 0; CurPos < 0x40; CurPos ++)
@ -99,7 +99,7 @@ void CPifRam::PifRamRead (void)
{ {
if (Channel < 4) { if (Channel < 4) {
if (Controllers[Channel].Present && Controllers[Channel].RawData) { if (Controllers[Channel].Present && Controllers[Channel].RawData) {
if (_Plugins->Control()->ReadController) { _Plugins->Control()->ReadController(Channel,&m_PifRam[CurPos]); } if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Channel,&m_PifRam[CurPos]); }
} else { } else {
ReadControllerCommand(Channel,&m_PifRam[CurPos]); ReadControllerCommand(Channel,&m_PifRam[CurPos]);
} }
@ -113,11 +113,11 @@ void CPifRam::PifRamRead (void)
break; break;
} }
} }
if (_Plugins->Control()->ReadController) { _Plugins->Control()->ReadController(-1,NULL); } if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(-1,NULL); }
} }
void CPifRam::PifRamWrite (void) { void CPifRam::PifRamWrite (void) {
CONTROL * Controllers = _Plugins->Control()->PluginControllers(); CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
int Channel, CurPos; int Channel, CurPos;
char Challenge[30], Response[30]; char Challenge[30], Response[30];
@ -176,7 +176,7 @@ void CPifRam::PifRamWrite (void) {
if ((m_PifRam[CurPos] & 0xC0) == 0) { if ((m_PifRam[CurPos] & 0xC0) == 0) {
if (Channel < 4) { if (Channel < 4) {
if (Controllers[Channel].Present && Controllers[Channel].RawData) { if (Controllers[Channel].Present && Controllers[Channel].RawData) {
if (_Plugins->Control()->ControllerCommand) { _Plugins->Control()->ControllerCommand(Channel,&m_PifRam[CurPos]); } if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Channel,&m_PifRam[CurPos]); }
} else { } else {
ProcessControllerCommand(Channel,&m_PifRam[CurPos]); ProcessControllerCommand(Channel,&m_PifRam[CurPos]);
} }
@ -198,7 +198,7 @@ void CPifRam::PifRamWrite (void) {
} }
} }
m_PifRam[0x3F] = 0; m_PifRam[0x3F] = 0;
if (_Plugins->Control()->ControllerCommand) { _Plugins->Control()->ControllerCommand(-1,NULL); } if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(-1,NULL); }
} }
void CPifRam::SI_DMA_READ (void) void CPifRam::SI_DMA_READ (void)
@ -392,7 +392,7 @@ void CPifRam::SI_DMA_WRITE (void)
void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
{ {
CONTROL * Controllers = _Plugins->Control()->PluginControllers(); CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
switch (Command[2]) { switch (Command[2]) {
case 0x00: // check case 0x00: // check
@ -444,7 +444,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
Command[0x25] = Mempak::CalculateCrc(&Command[5]); Command[0x25] = Mempak::CalculateCrc(&Command[5]);
break; break;
case PLUGIN_MEMPAK: Mempak::ReadFrom(Control, address, &Command[5]); break; case PLUGIN_MEMPAK: Mempak::ReadFrom(Control, address, &Command[5]); break;
case PLUGIN_RAW: if (_Plugins->Control()->ControllerCommand) { _Plugins->Control()->ControllerCommand(Control, Command); } break; case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break;
default: default:
memset(&Command[5], 0, 0x20); memset(&Command[5], 0, 0x20);
Command[0x25] = 0; Command[0x25] = 0;
@ -469,10 +469,10 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
DWORD address = ((Command[3] << 8) | Command[4]); DWORD address = ((Command[3] << 8) | Command[4]);
switch (Controllers[Control].Plugin) { switch (Controllers[Control].Plugin) {
case PLUGIN_MEMPAK: Mempak::WriteTo(Control, address, &Command[5]); break; case PLUGIN_MEMPAK: Mempak::WriteTo(Control, address, &Command[5]); break;
case PLUGIN_RAW: if (_Plugins->Control()->ControllerCommand) { _Plugins->Control()->ControllerCommand(Control, Command); } break; case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break;
case PLUGIN_RUMBLE_PAK: case PLUGIN_RUMBLE_PAK:
if ((address & 0xFFE0) == 0xC000 && _Plugins->Control()->RumbleCommand != NULL) { if ((address & 0xFFE0) == 0xC000 && g_Plugins->Control()->RumbleCommand != NULL) {
_Plugins->Control()->RumbleCommand(Control, *(BOOL *)(&Command[5])); g_Plugins->Control()->RumbleCommand(Control, *(BOOL *)(&Command[5]));
} }
default: default:
Command[0x25] = Mempak::CalculateCrc(&Command[5]); Command[0x25] = Mempak::CalculateCrc(&Command[5]);
@ -490,7 +490,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
} }
void CPifRam::ReadControllerCommand (int Control, BYTE * Command) { void CPifRam::ReadControllerCommand (int Control, BYTE * Command) {
CONTROL * Controllers = _Plugins->Control()->PluginControllers(); CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
switch (Command[2]) { switch (Command[2]) {
case 0x01: // read controller case 0x01: // read controller
@ -507,14 +507,14 @@ void CPifRam::ReadControllerCommand (int Control, BYTE * Command) {
case 0x02: //read from controller pack case 0x02: //read from controller pack
if (Controllers[Control].Present == TRUE) { if (Controllers[Control].Present == TRUE) {
switch (Controllers[Control].Plugin) { switch (Controllers[Control].Plugin) {
case PLUGIN_RAW: if (_Plugins->Control()->ReadController) { _Plugins->Control()->ReadController(Control, Command); } break; case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break;
} }
} }
break; break;
case 0x03: //write controller pak case 0x03: //write controller pak
if (Controllers[Control].Present == TRUE) { if (Controllers[Control].Present == TRUE) {
switch (Controllers[Control].Plugin) { switch (Controllers[Control].Plugin) {
case PLUGIN_RAW: if (_Plugins->Control()->ReadController) { _Plugins->Control()->ReadController(Control, Command); } break; case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break;
} }
} }
break; break;

View File

@ -46,10 +46,10 @@ void CSystemEvents::ExecuteEvents ( void )
break; break;
case SysEvent_ResetCPU_Soft: case SysEvent_ResetCPU_Soft:
_SystemTimer->SetTimer(CSystemTimer::SoftResetTimer,0x3000000,false); _SystemTimer->SetTimer(CSystemTimer::SoftResetTimer,0x3000000,false);
_Plugins->Gfx()->ShowCFB(); g_Plugins->Gfx()->ShowCFB();
g_Reg->FAKE_CAUSE_REGISTER |= CAUSE_IP4; g_Reg->FAKE_CAUSE_REGISTER |= CAUSE_IP4;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
_Plugins->Gfx()->SoftReset(); g_Plugins->Gfx()->SoftReset();
break; break;
case SysEvent_ResetCPU_SoftDone: case SysEvent_ResetCPU_SoftDone:
g_System->Reset(true,false); g_System->Reset(true,false);
@ -190,28 +190,28 @@ void CSystemEvents::ChangePluginFunc ( void )
g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT); g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT);
if (g_Settings->LoadBool(Plugin_GFX_Changed)) if (g_Settings->LoadBool(Plugin_GFX_Changed))
{ {
_Plugins->Reset(PLUGIN_TYPE_GFX); g_Plugins->Reset(PLUGIN_TYPE_GFX);
} }
if (g_Settings->LoadBool(Plugin_AUDIO_Changed)) if (g_Settings->LoadBool(Plugin_AUDIO_Changed))
{ {
_Plugins->Reset(PLUGIN_TYPE_AUDIO); g_Plugins->Reset(PLUGIN_TYPE_AUDIO);
} }
if (g_Settings->LoadBool(Plugin_CONT_Changed)) if (g_Settings->LoadBool(Plugin_CONT_Changed))
{ {
_Plugins->Reset(PLUGIN_TYPE_CONTROLLER); g_Plugins->Reset(PLUGIN_TYPE_CONTROLLER);
} }
if (g_Settings->LoadBool(Plugin_RSP_Changed) || if (g_Settings->LoadBool(Plugin_RSP_Changed) ||
g_Settings->LoadBool(Plugin_AUDIO_Changed) || g_Settings->LoadBool(Plugin_AUDIO_Changed) ||
g_Settings->LoadBool(Plugin_GFX_Changed)) g_Settings->LoadBool(Plugin_GFX_Changed))
{ {
_Plugins->Reset(PLUGIN_TYPE_RSP); g_Plugins->Reset(PLUGIN_TYPE_RSP);
} }
g_Settings->SaveBool(Plugin_RSP_Changed, false); g_Settings->SaveBool(Plugin_RSP_Changed, false);
g_Settings->SaveBool(Plugin_AUDIO_Changed,false); g_Settings->SaveBool(Plugin_AUDIO_Changed,false);
g_Settings->SaveBool(Plugin_GFX_Changed, false); g_Settings->SaveBool(Plugin_GFX_Changed, false);
g_Settings->SaveBool(Plugin_CONT_Changed, false); g_Settings->SaveBool(Plugin_CONT_Changed, false);
g_Notify->RefreshMenu(); g_Notify->RefreshMenu();
if (!_Plugins->Initiate()) if (!g_Plugins->Initiate())
{ {
g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT); g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT);
g_BaseSystem->m_EndEmulation = true; g_BaseSystem->m_EndEmulation = true;

View File

@ -178,7 +178,7 @@ bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId )
WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Hide Rom Browser"); WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Hide Rom Browser");
g_Notify->HideRomBrowser(); g_Notify->HideRomBrowser();
WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Creating N64 system"); WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Creating N64 system");
g_BaseSystem = new CN64System(_Plugins,false); g_BaseSystem = new CN64System(g_Plugins,false);
WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Setting N64 system as active"); WriteTrace(TraceDebug,"CN64System::stLoadFileImage: Setting N64 system as active");
if (g_BaseSystem->SetActiveSystem(true)) if (g_BaseSystem->SetActiveSystem(true))
{ {
@ -466,7 +466,7 @@ bool CN64System::IsDialogMsg( MSG * msg )
void CN64System::Reset (bool bInitReg, bool ClearMenory) void CN64System::Reset (bool bInitReg, bool ClearMenory)
{ {
if (_Plugins) { _Plugins->GameReset(); } if (g_Plugins) { g_Plugins->GameReset(); }
m_Audio.Reset(); m_Audio.Reset();
m_MMU_VM.Reset(ClearMenory); m_MMU_VM.Reset(ClearMenory);
Debug_Reset(); Debug_Reset();
@ -502,7 +502,7 @@ void CN64System::Reset (bool bInitReg, bool ClearMenory)
{ {
m_Recomp->Reset(); m_Recomp->Reset();
} }
if (_Plugins) { _Plugins->GameReset(); } if (g_Plugins) { g_Plugins->GameReset(); }
} }
bool CN64System::SetActiveSystem( bool bActive ) bool CN64System::SetActiveSystem( bool bActive )
@ -536,7 +536,7 @@ bool CN64System::SetActiveSystem( bool bActive )
_TransVaddr = &m_MMU_VM; _TransVaddr = &m_MMU_VM;
_SystemEvents = this; _SystemEvents = this;
_NextTimer = &m_NextTimer; _NextTimer = &m_NextTimer;
_Plugins = m_Plugins; g_Plugins = m_Plugins;
_TLBLoadAddress = &m_TLBLoadAddress; _TLBLoadAddress = &m_TLBLoadAddress;
_TLBStoreAddress = &m_TLBStoreAddress; _TLBStoreAddress = &m_TLBStoreAddress;
R4300iOp::m_TestTimer = m_TestTimer; R4300iOp::m_TestTimer = m_TestTimer;
@ -568,7 +568,7 @@ bool CN64System::SetActiveSystem( bool bActive )
_TransVaddr = NULL; _TransVaddr = NULL;
_SystemEvents = NULL; _SystemEvents = NULL;
_NextTimer = NULL; _NextTimer = NULL;
_Plugins = m_Plugins; g_Plugins = m_Plugins;
_TLBLoadAddress = NULL; _TLBLoadAddress = NULL;
_TLBStoreAddress = NULL; _TLBStoreAddress = NULL;
} }
@ -578,11 +578,11 @@ bool CN64System::SetActiveSystem( bool bActive )
{ {
WriteTrace(TraceDebug,"CN64System::SetActiveSystem: Reseting Plugins"); WriteTrace(TraceDebug,"CN64System::SetActiveSystem: Reseting Plugins");
g_Notify->DisplayMessage(5,MSG_PLUGIN_INIT); g_Notify->DisplayMessage(5,MSG_PLUGIN_INIT);
_Plugins->Reset(); g_Plugins->Reset();
bRes = _Plugins->Initiate(); bRes = g_Plugins->Initiate();
if (!bRes) if (!bRes)
{ {
WriteTrace(TraceError,"CN64System::SetActiveSystem: _Plugins->Initiate Failed"); WriteTrace(TraceError,"CN64System::SetActiveSystem: g_Plugins->Initiate Failed");
} }
} }
return bRes; return bRes;
@ -760,7 +760,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
void CN64System::ExecuteCPU ( void ) void CN64System::ExecuteCPU ( void )
{ {
if (_Plugins) { _Plugins->GameReset(); } if (g_Plugins) { g_Plugins->GameReset(); }
//reset code //reset code
g_Settings->SaveBool(GameRunning_CPU_Running,true); g_Settings->SaveBool(GameRunning_CPU_Running,true);
@ -803,7 +803,7 @@ void CN64System::ExecuteRecompiler ()
void CN64System::ExecuteSyncCPU () void CN64System::ExecuteSyncCPU ()
{ {
g_Notify->DisplayMessage(5,"Copy Plugins"); g_Notify->DisplayMessage(5,"Copy Plugins");
_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync)); g_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync));
CMainGui SyncWindow(false); CMainGui SyncWindow(false);
CPlugins SyncPlugins ( g_Settings->LoadString(Directory_PluginSync) ); CPlugins SyncPlugins ( g_Settings->LoadString(Directory_PluginSync) );
SyncPlugins.SetRenderWindows(&SyncWindow,&SyncWindow); SyncPlugins.SetRenderWindows(&SyncWindow,&SyncWindow);
@ -828,9 +828,9 @@ void CN64System::CpuStopped ( void ) {
if (!m_InReset) if (!m_InReset)
{ {
CloseCpu(); CloseCpu();
if (_Plugins) if (g_Plugins)
{ {
_Plugins->ShutDownPlugins(); g_Plugins->ShutDownPlugins();
} }
if (m_hPauseEvent) if (m_hPauseEvent)
{ {
@ -1578,7 +1578,7 @@ void CN64System::RunRSP ( void ) {
// } // }
__try { __try {
WriteTrace(TraceRSP, "RunRSP: do cycles - starting"); WriteTrace(TraceRSP, "RunRSP: do cycles - starting");
_Plugins->RSP()->DoRspCycles(100); g_Plugins->RSP()->DoRspCycles(100);
WriteTrace(TraceRSP, "RunRSP: do cycles - Done"); WriteTrace(TraceRSP, "RunRSP: do cycles - Done");
} __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) { } __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) {
WriteTrace(TraceError, "RunRSP: exception generated"); WriteTrace(TraceError, "RunRSP: exception generated");
@ -1624,7 +1624,7 @@ void CN64System::SyncToAudio ( void ) {
return; return;
} }
DWORD (__cdecl* AiReadLength) ( void ); DWORD (__cdecl* AiReadLength) ( void );
AiReadLength = _Plugins->Audio()->ReadLength; AiReadLength = g_Plugins->Audio()->ReadLength;
if (AiReadLength() == 0) if (AiReadLength() == 0)
{ {
return; return;
@ -1671,13 +1671,13 @@ void CN64System::RefreshScreen ( void ) {
{ {
_Audio->SetViIntr (VI_INTR_TIME); _Audio->SetViIntr (VI_INTR_TIME);
} }
if (_Plugins->Control()->GetKeys) if (g_Plugins->Control()->GetKeys)
{ {
BUTTONS Keys; BUTTONS Keys;
for (int Control = 0; Control < 4; Control++) for (int Control = 0; Control < 4; Control++)
{ {
_Plugins->Control()->GetKeys(Control,&Keys); g_Plugins->Control()->GetKeys(Control,&Keys);
m_Buttons[Control] = Keys.Value; m_Buttons[Control] = Keys.Value;
} }
} }
@ -1688,7 +1688,7 @@ void CN64System::RefreshScreen ( void ) {
__try __try
{ {
WriteTrace(TraceGfxPlugin,"UpdateScreen: Starting"); WriteTrace(TraceGfxPlugin,"UpdateScreen: Starting");
_Plugins->Gfx()->UpdateScreen(); g_Plugins->Gfx()->UpdateScreen();
WriteTrace(TraceGfxPlugin,"UpdateScreen: Done"); WriteTrace(TraceGfxPlugin,"UpdateScreen: Done");
} __except (g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation())) { } __except (g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation())) {
WriteTrace(TraceGfxPlugin,"UpdateScreen: Exception caught"); WriteTrace(TraceGfxPlugin,"UpdateScreen: Exception caught");

View File

@ -8,7 +8,7 @@ CMipsMemory * g_MMU = NULL; //Memory of the n64
CTLB * g_TLB = NULL; //TLB Unit CTLB * g_TLB = NULL; //TLB Unit
CRegisters * g_Reg = NULL; //Current Register Set attacted to the g_MMU CRegisters * g_Reg = NULL; //Current Register Set attacted to the g_MMU
CNotification * g_Notify = NULL; CNotification * g_Notify = NULL;
CPlugins * _Plugins = NULL; CPlugins * g_Plugins = NULL;
CN64Rom * _Rom = NULL; //The current rom that this system is executing.. it can only execute one file at the time CN64Rom * _Rom = NULL; //The current rom that this system is executing.. it can only execute one file at the time
CAudio * _Audio = NULL; CAudio * _Audio = NULL;
CMemoryLabel * _Labels = NULL; CMemoryLabel * _Labels = NULL;

View File

@ -8,7 +8,7 @@ extern CRecompiler * g_Recompiler;
extern CMipsMemory * g_MMU; //Memory of the n64 extern CMipsMemory * g_MMU; //Memory of the n64
extern CTLB * g_TLB; //TLB Unit extern CTLB * g_TLB; //TLB Unit
extern CRegisters * g_Reg; //Current Register Set attached to the g_MMU extern CRegisters * g_Reg; //Current Register Set attached to the g_MMU
extern CPlugins * _Plugins; extern CPlugins * g_Plugins;
extern CN64Rom * _Rom; //The current rom that this system is executing.. it can only execute one file at the time extern CN64Rom * _Rom; //The current rom that this system is executing.. it can only execute one file at the time
extern CAudio * _Audio; extern CAudio * _Audio;
extern CMemoryLabel * _Labels; extern CMemoryLabel * _Labels;

View File

@ -523,9 +523,9 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
} }
} }
if (CGuiSettings::bCPURunning() && g_BaseSystem) { if (CGuiSettings::bCPURunning() && g_BaseSystem) {
if (_Plugins->Gfx() && _Plugins->Gfx()->MoveScreen) { if (g_Plugins->Gfx() && g_Plugins->Gfx()->MoveScreen) {
WriteTrace(TraceGfxPlugin,"MoveScreen: Starting"); WriteTrace(TraceGfxPlugin,"MoveScreen: Starting");
_Plugins->Gfx()->MoveScreen((int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam)); g_Plugins->Gfx()->MoveScreen((int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam));
WriteTrace(TraceGfxPlugin,"MoveScreen: Done"); WriteTrace(TraceGfxPlugin,"MoveScreen: Done");
} }
} }
@ -617,8 +617,8 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
if (g_BaseSystem) if (g_BaseSystem)
{ {
if (_Plugins && _Plugins->Control()->WM_KeyUp) { if (g_Plugins && g_Plugins->Control()->WM_KeyUp) {
_Plugins->Control()->WM_KeyUp(wParam, lParam); g_Plugins->Control()->WM_KeyUp(wParam, lParam);
} }
} }
} }
@ -632,9 +632,9 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
if (g_BaseSystem) if (g_BaseSystem)
{ {
if (_Plugins && _Plugins->Control()->WM_KeyDown) if (g_Plugins && g_Plugins->Control()->WM_KeyDown)
{ {
_Plugins->Control()->WM_KeyDown(wParam, lParam); g_Plugins->Control()->WM_KeyDown(wParam, lParam);
} }
} }
} }
@ -721,7 +721,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
break; break;
case WM_INIATE_PLUGIN: case WM_INIATE_PLUGIN:
{ {
return _Plugins->InitiateMainThread(); return g_Plugins->InitiateMainThread();
} }
break; break;
case WM_COMMAND: case WM_COMMAND:
@ -772,19 +772,19 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
default: default:
if (_this->m_Menu) { if (_this->m_Menu) {
if (LOWORD(wParam) > 5000 && LOWORD(wParam) <= 5100 ) { if (LOWORD(wParam) > 5000 && LOWORD(wParam) <= 5100 ) {
if (_Plugins->RSP()) if (g_Plugins->RSP())
{ {
_Plugins->RSP()->ProcessMenuItem(LOWORD(wParam)); g_Plugins->RSP()->ProcessMenuItem(LOWORD(wParam));
} }
} else if (LOWORD(wParam) > 5100 && LOWORD(wParam) <= 5200 ) { } else if (LOWORD(wParam) > 5100 && LOWORD(wParam) <= 5200 ) {
if (_Plugins->Gfx()) if (g_Plugins->Gfx())
{ {
WriteTrace(TraceGfxPlugin,"ProcessMenuItem: Starting"); WriteTrace(TraceGfxPlugin,"ProcessMenuItem: Starting");
_Plugins->Gfx()->ProcessMenuItem(LOWORD(wParam)); g_Plugins->Gfx()->ProcessMenuItem(LOWORD(wParam));
WriteTrace(TraceGfxPlugin,"ProcessMenuItem: Done"); WriteTrace(TraceGfxPlugin,"ProcessMenuItem: Done");
} }
} else if (LOWORD(wParam) > 5200 && LOWORD(wParam) <= 5300 ) { } else if (LOWORD(wParam) > 5200 && LOWORD(wParam) <= 5300 ) {
if (_Plugins->Gfx() && _Plugins->Gfx()->OnRomBrowserMenuItem != NULL) if (g_Plugins->Gfx() && g_Plugins->Gfx()->OnRomBrowserMenuItem != NULL)
{ {
CN64Rom Rom; CN64Rom Rom;
if (!Rom.LoadN64Image(_this->CurrentedSelectedRom(),true)) if (!Rom.LoadN64Image(_this->CurrentedSelectedRom(),true))
@ -795,7 +795,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
g_Notify->DisplayMessage(0,""); g_Notify->DisplayMessage(0,"");
BYTE * RomHeader = Rom.GetRomAddress(); BYTE * RomHeader = Rom.GetRomAddress();
WriteTrace(TraceGfxPlugin,"OnRomBrowserMenuItem: Starting"); WriteTrace(TraceGfxPlugin,"OnRomBrowserMenuItem: Starting");
_Plugins->Gfx()->OnRomBrowserMenuItem(LOWORD(wParam),hWnd,RomHeader); g_Plugins->Gfx()->OnRomBrowserMenuItem(LOWORD(wParam),hWnd,RomHeader);
WriteTrace(TraceGfxPlugin,"OnRomBrowserMenuItem: Done"); WriteTrace(TraceGfxPlugin,"OnRomBrowserMenuItem: Done");
if (_Rom) { if (_Rom) {
_Rom->SaveRomSettingID(); _Rom->SaveRomSettingID();

View File

@ -116,7 +116,7 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD
{ {
stdstr Dir(g_Settings->LoadString(Directory_SnapShot)); stdstr Dir(g_Settings->LoadString(Directory_SnapShot));
WriteTraceF(TraceGfxPlugin,"CaptureScreen(%s): Starting",Dir.c_str()); WriteTraceF(TraceGfxPlugin,"CaptureScreen(%s): Starting",Dir.c_str());
_Plugins->Gfx()->CaptureScreen(Dir.c_str()); g_Plugins->Gfx()->CaptureScreen(Dir.c_str());
WriteTrace(TraceGfxPlugin,"CaptureScreen: Done"); WriteTrace(TraceGfxPlugin,"CaptureScreen: Done");
} }
break; break;
@ -243,7 +243,7 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD
_Gui->MakeWindowOnTop(false); _Gui->MakeWindowOnTop(false);
Notify().SetGfxPlugin(NULL); Notify().SetGfxPlugin(NULL);
WriteTrace(TraceGfxPlugin,"ChangeWindow: Starting"); WriteTrace(TraceGfxPlugin,"ChangeWindow: Starting");
_Plugins->Gfx()->ChangeWindow(); g_Plugins->Gfx()->ChangeWindow();
WriteTrace(TraceGfxPlugin,"ChangeWindow: Done"); WriteTrace(TraceGfxPlugin,"ChangeWindow: Done");
ShowCursor(true); ShowCursor(true);
_Gui->ShowStatusBar(true); _Gui->ShowStatusBar(true);
@ -257,7 +257,7 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD
WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 2"); WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 2");
try { try {
WriteTrace(TraceGfxPlugin,"ChangeWindow: Starting"); WriteTrace(TraceGfxPlugin,"ChangeWindow: Starting");
_Plugins->Gfx()->ChangeWindow(); g_Plugins->Gfx()->ChangeWindow();
WriteTrace(TraceGfxPlugin,"ChangeWindow: Done"); WriteTrace(TraceGfxPlugin,"ChangeWindow: Done");
} }
catch (...) catch (...)
@ -270,7 +270,7 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD
WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 4"); WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 4");
_Gui->MakeWindowOnTop(false); _Gui->MakeWindowOnTop(false);
WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 5"); WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 5");
Notify().SetGfxPlugin(_Plugins->Gfx()); Notify().SetGfxPlugin(g_Plugins->Gfx());
WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 3"); WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 3");
g_Settings->SaveBool(UserInterface_InFullScreen,true); g_Settings->SaveBool(UserInterface_InFullScreen,true);
WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 6"); WriteTrace(TraceDebug,"ID_OPTIONS_FULLSCREEN b 6");
@ -286,10 +286,10 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD
_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); _Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running));
} }
break; break;
case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_RSP"); _Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_RSP); break; case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_RSP); break;
case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_GFX"); _Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_GFX); break; case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_GFX"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_GFX); break;
case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_AUDIO"); _Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_AUDIO); break; case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_AUDIO"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_AUDIO); break;
case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_CONT"); _Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_CONTROLLER); break; case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug,"ID_OPTIONS_CONFIG_CONT"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_CONTROLLER); break;
case ID_OPTIONS_CPU_USAGE: case ID_OPTIONS_CPU_USAGE:
WriteTrace(TraceDebug,"ID_OPTIONS_CPU_USAGE"); WriteTrace(TraceDebug,"ID_OPTIONS_CPU_USAGE");
if (g_Settings->LoadBool(UserInterface_ShowCPUPer)) if (g_Settings->LoadBool(UserInterface_ShowCPUPer))
@ -870,7 +870,7 @@ void CMainMenu::FillOutMenu ( MENU_HANDLE hMenu ) {
MenuItemList OptionMenu; MenuItemList OptionMenu;
Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN,m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN,AccessLevel) ); Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN,m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN,AccessLevel) );
Item.ItemEnabled = CPURunning; Item.ItemEnabled = CPURunning;
if (_Plugins->Gfx() && _Plugins->Gfx()->ChangeWindow == NULL) { if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) {
Item.ItemEnabled = false; Item.ItemEnabled = false;
} }
OptionMenu.push_back(Item); OptionMenu.push_back(Item);
@ -883,24 +883,24 @@ void CMainMenu::FillOutMenu ( MENU_HANDLE hMenu ) {
OptionMenu.push_back(MENU_ITEM(SPLITER )); OptionMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX,AccessLevel)); Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX,AccessLevel));
if (_Plugins->Gfx() == NULL || _Plugins->Gfx()->Config == NULL) { if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->Config == NULL) {
Item.ItemEnabled = false; Item.ItemEnabled = false;
} }
OptionMenu.push_back(Item); OptionMenu.push_back(Item);
Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO,AccessLevel)); Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO,AccessLevel));
if (_Plugins->Audio() == NULL || _Plugins->Audio()->Config == NULL) { if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->Config == NULL) {
Item.ItemEnabled = false; Item.ItemEnabled = false;
} }
OptionMenu.push_back(Item); OptionMenu.push_back(Item);
if (!inBasicMode) { if (!inBasicMode) {
Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP,AccessLevel)); Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP,AccessLevel));
if (_Plugins->RSP() == NULL || _Plugins->RSP()->Config == NULL) { if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->Config == NULL) {
Item.ItemEnabled = false; Item.ItemEnabled = false;
} }
OptionMenu.push_back(Item); OptionMenu.push_back(Item);
} }
Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT,AccessLevel)); Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT,AccessLevel));
if (_Plugins->Control() == NULL || _Plugins->Control()->Config == NULL) { if (g_Plugins->Control() == NULL || g_Plugins->Control()->Config == NULL) {
Item.ItemEnabled = false; Item.ItemEnabled = false;
} }
OptionMenu.push_back(Item); OptionMenu.push_back(Item);
@ -1051,17 +1051,17 @@ void CMainMenu::FillOutMenu ( MENU_HANDLE hMenu ) {
/* Debug - RSP /* Debug - RSP
*******************/ *******************/
if (_Plugins->RSP() != NULL && IsMenu((HMENU)_Plugins->RSP()->GetDebugMenu())) if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
{ {
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,_Plugins->RSP()->GetDebugMenu(),"&RSP" ); Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->RSP()->GetDebugMenu(),"&RSP" );
DebugMenu.push_back(Item); DebugMenu.push_back(Item);
} }
/* Debug - RDP /* Debug - RDP
*******************/ *******************/
if (_Plugins->Gfx() != NULL && IsMenu((HMENU)_Plugins->Gfx()->GetDebugMenu())) if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
{ {
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,_Plugins->Gfx()->GetDebugMenu(),"&RDP" ); Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->Gfx()->GetDebugMenu(),"&RDP" );
DebugMenu.push_back(Item); DebugMenu.push_back(Item);
} }
@ -1214,13 +1214,13 @@ void CMainMenu::ResetMenu(void) {
_Gui->SetWindowMenu(this); _Gui->SetWindowMenu(this);
WriteTrace(TraceDebug,"CMainMenu::ResetMenu - Remove plugin menu"); WriteTrace(TraceDebug,"CMainMenu::ResetMenu - Remove plugin menu");
if (_Plugins->Gfx() != NULL && IsMenu((HMENU)_Plugins->Gfx()->GetDebugMenu())) if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
{ {
RemoveMenu((HMENU)OldMenuHandle,(DWORD)_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND); RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND);
} }
if (_Plugins->RSP() != NULL && IsMenu((HMENU)_Plugins->RSP()->GetDebugMenu())) if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
{ {
RemoveMenu((HMENU)OldMenuHandle,(DWORD)_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND); RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND);
} }
WriteTrace(TraceDebug,"CMainMenu::ResetMenu - Destroy Old Menu"); WriteTrace(TraceDebug,"CMainMenu::ResetMenu - Destroy Old Menu");

View File

@ -1389,9 +1389,9 @@ void CRomBrowser::RomList_PopupMenu(DWORD /*pnmh*/)
if (inBasicMode) { DeleteMenu((HMENU)hPopupMenu,8,MF_BYPOSITION); } if (inBasicMode) { DeleteMenu((HMENU)hPopupMenu,8,MF_BYPOSITION); }
if (inBasicMode && !CheatsRemembered) { DeleteMenu((HMENU)hPopupMenu,7,MF_BYPOSITION); } if (inBasicMode && !CheatsRemembered) { DeleteMenu((HMENU)hPopupMenu,7,MF_BYPOSITION); }
DeleteMenu((HMENU)hPopupMenu,6,MF_BYPOSITION); DeleteMenu((HMENU)hPopupMenu,6,MF_BYPOSITION);
if (!inBasicMode && _Plugins && _Plugins->Gfx() && _Plugins->Gfx()->GetRomBrowserMenu != NULL) if (!inBasicMode && g_Plugins && g_Plugins->Gfx() && g_Plugins->Gfx()->GetRomBrowserMenu != NULL)
{ {
HMENU GfxMenu = (HMENU)_Plugins->Gfx()->GetRomBrowserMenu(); HMENU GfxMenu = (HMENU)g_Plugins->Gfx()->GetRomBrowserMenu();
if (GfxMenu) if (GfxMenu)
{ {
MENUITEMINFO lpmii; MENUITEMINFO lpmii;

View File

@ -267,7 +267,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lps
//Create the plugin container //Create the plugin container
WriteTrace(TraceDebug,"WinMain - Create Plugins"); WriteTrace(TraceDebug,"WinMain - Create Plugins");
_Plugins = new CPlugins(g_Settings->LoadString(Directory_Plugin)); g_Plugins = new CPlugins(g_Settings->LoadString(Directory_Plugin));
//Select the language //Select the language
_Lang->LoadCurrentStrings(true); _Lang->LoadCurrentStrings(true);
@ -281,7 +281,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lps
} }
CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false); CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false);
CMainMenu MainMenu(&MainWindow); CMainMenu MainMenu(&MainWindow);
_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow); g_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow);
g_Notify->SetMainWindow(&MainWindow); g_Notify->SetMainWindow(&MainWindow);
{ {
@ -337,7 +337,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lps
WriteTrace(TraceDebug,"WinMain - cleaning up global objects"); WriteTrace(TraceDebug,"WinMain - cleaning up global objects");
if (_Rom) { delete _Rom; _Rom = NULL; } if (_Rom) { delete _Rom; _Rom = NULL; }
if (_Plugins) { delete _Plugins; _Plugins = NULL; } if (g_Plugins) { delete g_Plugins; g_Plugins = NULL; }
if (g_Settings) { delete g_Settings; g_Settings = NULL; } if (g_Settings) { delete g_Settings; g_Settings = NULL; }
if (_Lang) { delete _Lang; _Lang = NULL; } if (_Lang) { delete _Lang; _Lang = NULL; }