From a6447d17586be7de1f9f7460294ae6ad7fbef8dd Mon Sep 17 00:00:00 2001 From: nakeee Date: Sun, 18 Jan 2009 01:45:53 +0000 Subject: [PATCH] some clean up but there are too many references to g_CoreStartupParameter directly:( git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1912 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/ActionReplay.cpp | 6 ++- Source/Core/Core/Src/Boot/Boot.cpp | 15 +++--- Source/Core/Core/Src/Boot/Boot.h | 2 +- Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp | 10 ++-- Source/Core/Core/Src/Core.cpp | 50 ++++++++++--------- Source/Core/Core/Src/Core.h | 41 +++++++-------- Source/Core/Core/Src/HW/CommandProcessor.cpp | 12 ++--- Source/Core/Core/Src/HW/DSP.cpp | 9 ++-- Source/Core/Core/Src/HW/EXI_Device.cpp | 6 +-- Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp | 8 +-- Source/Core/Core/Src/HW/HW.cpp | 5 +- Source/Core/Core/Src/HW/Memmap.cpp | 4 +- Source/Core/Core/Src/HW/PixelEngine.cpp | 3 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 8 +-- Source/Core/Core/Src/PluginManager.cpp | 8 +-- Source/Core/DolphinWX/Src/BootManager.cpp | 8 +-- 16 files changed, 102 insertions(+), 93 deletions(-) diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index 4dc69ec6cc..2b1c18eb63 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -36,6 +36,7 @@ #include "Core.h" #include "ARDecrypt.h" #include "LogManager.h" +#include "ConfigManager.h" namespace ActionReplay { @@ -73,7 +74,8 @@ bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount); void LoadCodes(IniFile &ini, bool forceLoad) { // Parses the Action Replay section of a game ini file. - if (!Core::GetStartupParameter().bEnableCheats && !forceLoad) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats + && !forceLoad) return; std::vector lines; @@ -197,7 +199,7 @@ void LogInfo(const char *format, ...) void RunAllActive() { - if (Core::GetStartupParameter().bEnableCheats) { + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) { for (std::vector::iterator i = activeCodes.begin(); i != activeCodes.end(); ++i) { if (i->active) diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index e858df55b5..d0d4f33b3a 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -45,6 +45,7 @@ #include "../PowerPC/SymbolDB.h" #include "../MemTools.h" +#include "ConfigManager.h" #include "VolumeCreator.h" // DiscIO void CBoot::Load_FST(bool _bIsWii) @@ -91,7 +92,7 @@ std::string CBoot::GenerateMapFilename() std::string strMapFilename; BuildCompleteFilename(strMapFilename, strDriveDirectory, strFullfilename); */ - return FULL_MAPS_DIR + Core::GetStartupParameter().GetUniqueID() + ".map"; + return FULL_MAPS_DIR + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".map"; } bool CBoot::LoadMapFromFilename(const std::string &_rFilename, const char *_gameID) @@ -154,9 +155,11 @@ bool CBoot::Load_BIOS(const std::string& _rBiosFilename) ////////////////////////////////////////////////////////////////////////////////////////// // Third boot step after BootManager and Core. See Call schedule in BootManager.cpp // ŻŻŻŻŻŻŻŻŻŻŻŻŻ -bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara) +bool CBoot::BootUp() { const bool bDebugIsoBootup = false; + SCoreStartupParameter& _StartupPara = + SConfig::GetInstance().m_LocalCoreStartupParameter; g_symbolDB.Clear(); VideoInterface::PreInit(_StartupPara.bNTSC); @@ -171,7 +174,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara) break; bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume); - if (isoWii != Core::GetStartupParameter().bWii) + if (isoWii != _StartupPara.bWii) { PanicAlert("Warning - starting ISO in wrong console mode!"); } @@ -192,7 +195,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara) EmulatedBIOS(bDebugIsoBootup); else { - Core::g_CoreStartupParameter.bWii = true; + _StartupPara.bWii = true; EmulatedBIOS_Wii(bDebugIsoBootup); } } @@ -206,7 +209,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara) EmulatedBIOS(bDebugIsoBootup); else { - Core::g_CoreStartupParameter.bWii = true; + _StartupPara.bWii = true; EmulatedBIOS_Wii(bDebugIsoBootup); } } @@ -248,7 +251,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara) // Check if we have gotten a Wii file or not bool elfWii = IsElfWii(_StartupPara.m_strFilename.c_str()); - if (elfWii != Core::GetStartupParameter().bWii) + if (elfWii != _StartupPara.bWii) { PanicAlert("Warning - starting ELF in wrong console mode!"); } diff --git a/Source/Core/Core/Src/Boot/Boot.h b/Source/Core/Core/Src/Boot/Boot.h index 015e78a9c9..6388e802da 100644 --- a/Source/Core/Core/Src/Boot/Boot.h +++ b/Source/Core/Core/Src/Boot/Boot.h @@ -36,7 +36,7 @@ public: BOOT_BIOS }; - static bool BootUp(const SCoreStartupParameter& _StartupPara); + static bool BootUp(); static bool IsElfWii(const char *filename); static std::string GenerateMapFilename(); diff --git a/Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp b/Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp index f3f54f16bf..01295993cf 100644 --- a/Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp +++ b/Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp @@ -29,6 +29,7 @@ #include "../PatchEngine.h" #include "../MemTools.h" +#include "ConfigManager.h" #include "VolumeCreator.h" #include "Boot.h" @@ -152,10 +153,11 @@ void CBoot::EmulatedBIOS(bool _bDebug) Memory::Write_U32(0x1cf7c580, 0x800000FC); // fake the VI Init of the BIOS - Memory::Write_U32(Core::g_CoreStartupParameter.bNTSC ? 0 : 1, 0x800000CC); + Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC + ? 0 : 1, 0x800000CC); // preset time base ticks - Memory::Write_U64( (u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8); + Memory::Write_U64( (u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8); } @@ -289,8 +291,8 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug) Memory::Write_U8(0x00, 0x00000007); // DVDInit Memory::Write_U16(0x0000, 0x000030e0); // PADInit - // Fake the VI Init of the BIOS - Memory::Write_U32(Core::g_CoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC); + // Fake the VI Init of the BIOS + Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC); // Clear exception handler. Why? Don't we begin with only zeroes? for (int i = 0x3000; i <= 0x3038; i += 4) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index da4e23a7eb..b9d369098f 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -106,9 +106,7 @@ bool g_bHwInit = false; bool g_bRealWiimote = false; HWND g_pWindowHandle = NULL; Common::Thread* g_pThread = NULL; - -SCoreStartupParameter g_CoreStartupParameter; //uck - +SCoreStartupParameter g_CoreStartupParameter; Common::Event emuThreadGoing; ////////////////////////////////////// @@ -139,11 +137,6 @@ void Callback_DebuggerBreak() CCPU::EnableStepping(true); } -const SCoreStartupParameter& GetStartupParameter() -{ - return g_CoreStartupParameter; -} - void* GetWindowHandle() { return g_pWindowHandle; @@ -159,7 +152,7 @@ bool GetRealWiimote() ////////////////////////////////////////////////////////////////////////////////////////// // This is called from the GUI thread. See the booting call schedule in BootManager.cpp // -bool Init(const SCoreStartupParameter _CoreParameter) +bool Init() { if (g_pThread != NULL) { PanicAlert("ERROR: Emu Thread already running. Report this bug."); @@ -167,7 +160,9 @@ bool Init(const SCoreStartupParameter _CoreParameter) } CPluginManager &pManager = CPluginManager::GetInstance(); - + SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; + + g_CoreStartupParameter = _CoreParameter; LogManager::Init(); Host_SetWaitCursor(true); @@ -177,11 +172,9 @@ bool Init(const SCoreStartupParameter _CoreParameter) if (!pManager.InitPlugins()) return false; - g_CoreStartupParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; - emuThreadGoing.Init(); // This will execute EmuThread() further down in this file - g_pThread = new Common::Thread(EmuThread, (void*)&g_CoreStartupParameter); + g_pThread = new Common::Thread(EmuThread, NULL); emuThreadGoing.Wait(); emuThreadGoing.Shutdown(); // all right ... here we go @@ -237,8 +230,9 @@ THREAD_RETURN CpuThread(void *pArg) { Common::SetCurrentThreadName("CPU thread"); - const SCoreStartupParameter& _CoreParameter = g_CoreStartupParameter; - if (!g_CoreStartupParameter.bUseDualCore) + const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; + + if (!_CoreParameter.bUseDualCore) { //wglMakeCurrent CPluginManager::GetInstance().GetVideo()->Video_Prepare(); @@ -287,7 +281,8 @@ THREAD_RETURN CpuThread(void *pArg) THREAD_RETURN EmuThread(void *pArg) { Common::SetCurrentThreadName("Emuthread - starting"); - const SCoreStartupParameter _CoreParameter = *(SCoreStartupParameter*)pArg; + const SCoreStartupParameter _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; + CPluginManager &pm = CPluginManager::GetInstance(); if (_CoreParameter.bLockThreads) Common::Thread::SetCurrentThreadAffinity(2); // Force to second core @@ -359,7 +354,7 @@ THREAD_RETURN EmuThread(void *pArg) // Load GCM/DOL/ELF whatever ... we boot with the interpreter core PowerPC::SetMode(PowerPC::MODE_INTERPRETER); - CBoot::BootUp(_CoreParameter); + CBoot::BootUp(); if( g_pUpdateFPSDisplay != NULL ) g_pUpdateFPSDisplay("Loading..."); @@ -387,7 +382,7 @@ THREAD_RETURN EmuThread(void *pArg) // ENTER THE VIDEO THREAD LOOP ////////////////////////////////////////////////////////////////////////// - if (!Core::GetStartupParameter().bUseDualCore) + if (!_CoreParameter.bUseDualCore) { #ifdef _WIN32 cpuThread = new Common::Thread(CpuThread, pArg); @@ -528,11 +523,13 @@ void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak) // We do not touch anything outside this function here void Callback_VideoCopiedToXFB() { + SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; //count FPS static Common::Timer Timer; static u32 frames = 0; static u64 ticks = 0; static u64 idleTicks = 0; + frames++; if (Timer.GetTimeDifference() >= 1000) @@ -550,15 +547,15 @@ void Callback_VideoCopiedToXFB() char temp[256]; sprintf(temp, "FPS:%8.2f - Core: %s | %s - Speed: %i MHz [Real: %i + IdleSkip: %i] / %i MHz", (float)frames / t, - g_CoreStartupParameter.bUseJIT ? "JIT" : "Interpreter", - g_CoreStartupParameter.bUseDualCore ? "DC" : "SC", + _CoreParameter.bUseJIT ? "JIT" : "Interpreter", + _CoreParameter.bUseDualCore ? "DC" : "SC", (int)(diff), (int)(diff-idleDiff), (int)(idleDiff), SystemTimers::GetTicksPerSecond()/1000000); if (g_pUpdateFPSDisplay != NULL) - g_pUpdateFPSDisplay(temp); + g_pUpdateFPSDisplay(temp); Host_UpdateStatusBar(temp); @@ -600,8 +597,9 @@ void Callback_PADLog(const TCHAR* _szMessage) //std::string Callback_ISOName(void) const char *Callback_ISOName(void) { - if (g_CoreStartupParameter.m_strName.length() > 0) - return (const char *)g_CoreStartupParameter.m_strName.c_str(); + SCoreStartupParameter& params = SConfig::GetInstance().m_LocalCoreStartupParameter; + if (params.m_strName.length() > 0) + return (const char *)params.m_strName.c_str(); else return (const char *)""; } @@ -630,4 +628,10 @@ void Callback_WiimoteLog(const TCHAR* _szMessage, int _v) LOGV(WII_IPC_WIIMOTE, _v, _szMessage); } +// TODO: Get rid of at some point +const SCoreStartupParameter& GetStartupParameter() { + return SConfig::GetInstance().m_LocalCoreStartupParameter; +} + } // end of namespace Core + diff --git a/Source/Core/Core/Src/Core.h b/Source/Core/Core/Src/Core.h index c24a688a3b..d784882e6f 100644 --- a/Source/Core/Core/Src/Core.h +++ b/Source/Core/Core/Src/Core.h @@ -41,35 +41,36 @@ namespace Core }; // Init core - bool Init(const SCoreStartupParameter _CoreParameter); + bool Init(); void Stop(); - + bool SetState(EState _State); EState GetState(); - // Save/Load state - void SaveState(); - void LoadState(); - - // Get core parameters - extern SCoreStartupParameter g_CoreStartupParameter; //uck + // Save/Load state + void SaveState(); + void LoadState(); + + // Get core parameters kill use SConfig instead const SCoreStartupParameter& GetStartupParameter(); + extern SCoreStartupParameter g_CoreStartupParameter; + // Make a screen shot bool MakeScreenshot(const std::string& _rFilename); void* GetWindowHandle(); - bool GetRealWiimote(); - - extern bool bReadTrace; - extern bool bWriteTrace; - - void StartTrace(bool write); - void DisplayMessage(const std::string &message, int time_in_ms); // This displays messages in a user-visible way. - void DisplayMessage(const char *message, int time_in_ms); // This displays messages in a user-visible way. - - int SyncTrace(); - void SetBlockStart(u32 addr); - void StopTrace(); + bool GetRealWiimote(); + + extern bool bReadTrace; + extern bool bWriteTrace; + + void StartTrace(bool write); + void DisplayMessage(const std::string &message, int time_in_ms); // This displays messages in a user-visible way. + void DisplayMessage(const char *message, int time_in_ms); // This displays messages in a user-visible way. + + int SyncTrace(); + void SetBlockStart(u32 addr); + void StopTrace(); } // namespace #endif diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp index f647f2beaf..e1b0845556 100644 --- a/Source/Core/Core/Src/HW/CommandProcessor.cpp +++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp @@ -71,7 +71,7 @@ #include "../PowerPC/PowerPC.h" #include "../CoreTiming.h" #include "../PluginManager.h" - +#include "../ConfigManager.h" #include "MathUtil.h" #include "Thread.h" @@ -332,7 +332,7 @@ void Read16(u16& _rReturnValue, const u32 _Address) bool AllowIdleSkipping() { - return !Core::g_CoreStartupParameter.bUseDualCore || (!m_CPCtrlReg.CPIntEnable && !m_CPCtrlReg.BPEnable); + return !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore || (!m_CPCtrlReg.CPIntEnable && !m_CPCtrlReg.BPEnable); } void Write16(const u16 _Value, const u32 _Address) @@ -342,7 +342,7 @@ void Write16(const u16 _Value, const u32 _Address) //Spin until queue is empty - it WILL become empty because this is the only thread //that submits data - if (Core::g_CoreStartupParameter.bUseDualCore) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore) { // Force complete fifo flush if we attempt to set/reset the fifo (API GXSetGPFifo or equivalent) // It's kind of an API hack but it works for lots of games... and I hope it's the same way for every games. @@ -551,7 +551,7 @@ void Write16(const u16 _Value, const u32 _Address) } // TODO(mb2): better. Check if it help: avoid CPReadPointer overwrites when stupidly done like in Super Monkey Ball - if ((!fifo.bFF_GPReadEnable && fifo.CPReadIdle) || !Core::g_CoreStartupParameter.bUseDualCore) // TOCHECK(mb2): check again if thread safe? + if ((!fifo.bFF_GPReadEnable && fifo.CPReadIdle) || !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore) // TOCHECK(mb2): check again if thread safe? UpdateFifoRegister(); } @@ -572,7 +572,7 @@ void STACKALIGN GatherPipeBursted() if (!fifo.bFF_GPLinkEnable) return; - if (Core::g_CoreStartupParameter.bUseDualCore) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore) { // update the fifo-pointer fifo.CPWritePointer += GPFifo::GATHER_PIPE_SIZE; @@ -703,7 +703,7 @@ void UpdateFifoRegister() //fifo.CPReadWriteDistance = dist; Common::SyncInterlockedExchange((LONG*)&fifo.CPReadWriteDistance, dist); - if (!Core::g_CoreStartupParameter.bUseDualCore) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore) CatchUpGPU(); } diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 523b936f8e..d96ca515b8 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -41,6 +41,7 @@ #include "AudioInterface.h" #include "../PowerPC/PowerPC.h" #include "../PluginManager.h" +#include "../ConfigManager.h" namespace DSP { @@ -178,7 +179,7 @@ u16 g_AR_MODE = 0x43; // 0x23 -> Zelda standard mode (standard ARAM access ??) void DoState(PointerWrap &p) { - if (!Core::GetStartupParameter().bWii) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) p.DoArray(g_ARAM, ARAM_SIZE); p.Do(g_dspState); p.Do(g_audioDMA); @@ -203,7 +204,7 @@ void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate) void Init() { - if (Core::GetStartupParameter().bWii) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) { // On the Wii, ARAM is simply mapped to EXRAM. g_ARAM = Memory::GetPointer(0x00000000); @@ -220,7 +221,7 @@ void Init() void Shutdown() { - if (!Core::GetStartupParameter().bWii) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) FreeMemoryPages(g_ARAM, ARAM_SIZE); g_ARAM = NULL; } @@ -626,7 +627,7 @@ u8 ReadARAM(u32 _iAddress) //LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x", _iAddress); // _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE); - if(Core::GetStartupParameter().bWii) + if(SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) { //LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x 0x%08x 0x%08x", WII_MASK, _iAddress, (_iAddress & WII_MASK)); diff --git a/Source/Core/Core/Src/HW/EXI_Device.cpp b/Source/Core/Core/Src/HW/EXI_Device.cpp index 4fa4b5f1cc..5406984386 100644 --- a/Source/Core/Core/Src/HW/EXI_Device.cpp +++ b/Source/Core/Core/Src/HW/EXI_Device.cpp @@ -25,7 +25,7 @@ #include "EXI_DeviceEthernet.h" #include "../Core.h" - +#include "../ConfigManager.h" ///////////////////////////////////////////////////////////////////////////////////////////////////// // --- interface IEXIDevice --- ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -131,11 +131,11 @@ IEXIDevice* EXIDevice_Create(TEXIDevices _EXIDevice) break; case EXIDEVICE_MEMORYCARD_A: - return new CEXIMemoryCard("MemoryCardA", Core::GetStartupParameter().m_strMemoryCardA, 0); + return new CEXIMemoryCard("MemoryCardA", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strMemoryCardA, 0); break; case EXIDEVICE_MEMORYCARD_B: - return new CEXIMemoryCard("MemoryCardB", Core::GetStartupParameter().m_strMemoryCardB, 1); + return new CEXIMemoryCard("MemoryCardB", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strMemoryCardB, 1); break; case EXIDEVICE_IPL: diff --git a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp index fedea174c8..3dc9e20fce 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp @@ -19,6 +19,8 @@ #include "EXI_DeviceIPL.h" #include "../Core.h" +#include "../ConfigManager.h" + #include "MemoryUtil.h" // english @@ -109,7 +111,7 @@ CEXIIPL::CEXIIPL() : memset(m_RTC, 0, sizeof(m_RTC)); // SRAM - pStream = fopen(Core::GetStartupParameter().m_strSRAM.c_str(), "rb"); + pStream = fopen(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM.c_str(), "rb"); if (pStream != NULL) { fread(m_SRAM, 1, 64, pStream); @@ -120,7 +122,7 @@ CEXIIPL::CEXIIPL() : memcpy(m_SRAM, sram_dump, sizeof(m_SRAM)); } // We Overwrite it here since it's possible on the GC to change the language as you please - m_SRAM[0x12] = Core::GetStartupParameter().SelectedLanguage; + m_SRAM[0x12] = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage; WriteProtectMemory(m_pIPL, ROM_SIZE); m_uAddress = 0; @@ -140,7 +142,7 @@ CEXIIPL::~CEXIIPL() } // SRAM - FILE *file = fopen(Core::GetStartupParameter().m_strSRAM.c_str(), "wb"); + FILE *file = fopen(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM.c_str(), "wb"); if (file) { fwrite(m_SRAM, 1, 64, file); diff --git a/Source/Core/Core/Src/HW/HW.cpp b/Source/Core/Core/Src/HW/HW.cpp index b4ca7819e6..d861f77082 100644 --- a/Source/Core/Core/Src/HW/HW.cpp +++ b/Source/Core/Core/Src/HW/HW.cpp @@ -34,6 +34,7 @@ #include "VideoInterface.h" #include "WII_IPC.h" #include "../PluginManager.h" +#include "../ConfigManager.h" #include "../CoreTiming.h" #include "SystemTimers.h" #include "../IPC_HLE/WII_IPC_HLE.h" @@ -63,7 +64,7 @@ namespace HW ExpansionInterface::Init(); CCPU::Init(); SystemTimers::Init(); - if (Core::GetStartupParameter().bWii) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) { WII_IPC_HLE_Interface::Init(); WII_IPCInterface::Init(); @@ -81,7 +82,7 @@ namespace HW SerialInterface::Shutdown(); AudioInterface::Shutdown(); - if (Core::GetStartupParameter().bWii) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) { WII_IPC_HLE_Interface::Shutdown(); WII_IPCInterface::Shutdown(); diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index 5e630e6152..b991b65bd2 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -39,7 +39,7 @@ #include "MemoryInterface.h" #include "WII_IOB.h" #include "WII_IPC.h" - +#include "../ConfigManager.h" #include "../Debugger/Debugger_BreakPoints.h" #include "../Debugger/Debugger_SymbolMap.h" @@ -1091,7 +1091,7 @@ bool IsRAMAddress(const u32 addr, bool allow_locked_cache) case 0x10: case 0x90: case 0xD0: - if (Core::g_CoreStartupParameter.bWii && (addr & 0x0FFFFFFF) < EXRAM_SIZE) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && (addr & 0x0FFFFFFF) < EXRAM_SIZE) return true; else return false; diff --git a/Source/Core/Core/Src/HW/PixelEngine.cpp b/Source/Core/Core/Src/HW/PixelEngine.cpp index 9324e05e07..2fdd6111f1 100644 --- a/Source/Core/Core/Src/HW/PixelEngine.cpp +++ b/Source/Core/Core/Src/HW/PixelEngine.cpp @@ -26,6 +26,7 @@ #include "CommandProcessor.h" #include "CPU.h" #include "../Core.h" +#include "../ConfigManager.h" namespace PixelEngine { @@ -145,7 +146,7 @@ void Write16(const u16 _iValue, const u32 _iAddress) bool AllowIdleSkipping() { - return !Core::g_CoreStartupParameter.bUseDualCore || (!g_ctrlReg.PETokenEnable && !g_ctrlReg.PEFinishEnable); + return !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore || (!g_ctrlReg.PETokenEnable && !g_ctrlReg.PEFinishEnable); } void UpdateInterrupts() diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index 2d33e129ea..27a88026cb 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -21,6 +21,7 @@ #include "WII_IPC_HLE_WiiMote.h" // Core #include "WII_IPC_HLE_Device_usb.h" #include "../PluginManager.h" +#include "../ConfigManager.h" #include "../Host.h" #include "../Core.h" @@ -385,8 +386,9 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size) void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData) { // Check if it's enabled - bool LedsOn = Core::g_CoreStartupParameter.bWiiLeds; - bool SpeakersOn = Core::g_CoreStartupParameter.bWiiSpeakers; + SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter; + bool LedsOn = StartUp.bWiiLeds; + bool SpeakersOn = StartUp.bWiiSpeakers; const u8* data = (const u8*)_pData; @@ -438,7 +440,7 @@ void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData) void CWII_IPC_HLE_WiiMote::UpdateStatus() { // Check if it's enabled - if (!Core::g_CoreStartupParameter.bWiiSpeakers) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers) return; Host_UpdateStatus(); } diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 1da69bf1b3..8e0b9cb5c1 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -250,13 +250,9 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename) void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show) { if (Type == PLUGIN_TYPE_VIDEO) { - if(!m_video) - m_video = (Common::PluginVideo*)LoadPlugin(_rFilename); - m_video->Debug((HWND)_Parent, Show); + GetVideo()->Debug((HWND)_Parent, Show); } else if (Type == PLUGIN_TYPE_DSP) { - if (!m_dsp) - m_dsp = (Common::PluginDSP*)LoadPlugin(_rFilename); - m_dsp->Debug((HWND)_Parent, Show); + GetDSP()->Debug((HWND)_Parent, Show); } } diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index 03e0a6bdb9..7d73e6d3dc 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -100,7 +100,6 @@ bool BootCore(const std::string& _rFilename) StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO; StartUp.m_strFilename = _rFilename; - // SConfig::GetInstance().m_LastFilename = StartUp.m_strFilename; StartUp.bRunCompareClient = false; StartUp.bRunCompareServer = false; std::string BaseDataPath; @@ -183,11 +182,6 @@ bool BootCore(const std::string& _rFilename) } // --------- - // Save some values to our local version of SCoreStartupParameter - // SConfig::GetInstance().m_LocalCoreStartupParameter.bWii = StartUp.bWii; - // SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC = StartUp.bNTSC; - // SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID = StartUp.m_strUniqueID; - #if defined(HAVE_WX) && HAVE_WX if(main_frame) { @@ -198,7 +192,7 @@ bool BootCore(const std::string& _rFilename) } #endif // init the core - if (!Core::Init(StartUp)) + if (!Core::Init()) { PanicAlert("Couldn't init the core.\nCheck your configuration."); return false;