From 7894e6c9e957d77bde5c112615e19a2e7c798b61 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 29 Jul 2008 21:16:33 +0000 Subject: [PATCH] Fix bug that made it impossible to even try to boot LLE bios (not tested). Also add ability for Patches/ INI files to override dual core and optimizequant. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@94 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Boot/Boot.cpp | 2 +- Source/Core/Core/Src/Core.cpp | 1 - Source/Core/Core/Src/CoreParameter.cpp | 2 +- Source/Core/Core/Src/CoreParameter.h | 2 ++ Source/Core/DolphinWX/src/BootManager.cpp | 15 ++++++++++++--- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index 8e7b575b55..c17d76fe66 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -168,7 +168,7 @@ void CBoot::EmulatedBIOS(bool _bDebug) u32 iLength = Memory::ReadUnchecked_U32(0x81300008); u32 iDVDOffset = Memory::ReadUnchecked_U32(0x8130000c); - LOG(MASTER_LOG, "DVDRead: offset: %08x memOffse: %08x length: %i", iDVDOffset, iRamAddress, iLength); + LOG(MASTER_LOG, "DVDRead: offset: %08x memOffset: %08x length: %i", iDVDOffset, iRamAddress, iLength); DVDInterface::DVDRead(iDVDOffset, iRamAddress, iLength); } while(PowerPC::ppcState.gpr[3] != 0x00); diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 0ef99a73ed..260094ad6d 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -103,7 +103,6 @@ bool Init(const SCoreStartupParameter _CoreParameter) Host_SetWaitCursor(true); g_CoreStartupParameter = _CoreParameter; - // Init the Hardware // start the thread again _dbg_assert_(HLE, g_pThread == NULL); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index 7f9dd4a06b..9d2ae243fd 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -64,7 +64,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBios _BootBios) PanicAlert("Your GCM/ISO file seems to be invalid, or not a GC/Wii ISO."); return false; } - + m_strUniqueID = pVolume->GetUniqueID(); bWii = DiscIO::IsVolumeWiiDisc(*pVolume); switch (pVolume->GetCountry()) diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 0a2fab16a8..ac8b704bfe 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -79,12 +79,14 @@ struct SCoreStartupParameter std::string m_strMemoryCardB; std::string m_strSRAM; std::string m_strDefaultGCM; + std::string m_strUniqueID; // SCoreStartupParameter(); void LoadDefaults(); bool AutoSetup(EBootBios _BootBios); + const std::string &GetUniqueID() const { return m_strUniqueID; } }; #endif diff --git a/Source/Core/DolphinWX/src/BootManager.cpp b/Source/Core/DolphinWX/src/BootManager.cpp index 60a4f435a3..c3635b5c99 100644 --- a/Source/Core/DolphinWX/src/BootManager.cpp +++ b/Source/Core/DolphinWX/src/BootManager.cpp @@ -20,6 +20,7 @@ #include "Globals.h" #include "Common.h" +#include "IniFile.h" #include "BootManager.h" #include "ISOFile.h" #include "Volume.h" @@ -57,11 +58,10 @@ bool BootCore(const std::string& _rFilename) StartUp.bUseDynarec = true; } #ifndef _WIN32 - StartUp.bUseDynarec = false;//Never use Dynarec in Linux, crashes + StartUp.bUseDynarec = false;//Never use Dynarec in Linux, crashes #endif StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO; StartUp.m_strFilename = _rFilename; - StartUp.bHLEBios = true; StartUp.bRunCompareClient = false; StartUp.bRunCompareServer = false; StartUp.bEnableDebugging = g_pCodeWindow ? true : false; // RUNNING_DEBUG @@ -70,8 +70,17 @@ bool BootCore(const std::string& _rFilename) StartUp.hInstance = wxGetInstance(); #endif - // StartUp.AutoSetup(SCoreStartupParameter::BOOT_DEFAULT); + + // Load overrides + IniFile ini; + std::string unique_id = StartUp.GetUniqueID(); + if (unique_id.size() == 6 && ini.Load(("Patches/" + unique_id + ".ini").c_str())) + { + ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore); + ini.Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers); + } + StartUp.hMainWindow = main_frame->GetRenderHandle(); // init the core