From 05730af7244fc3ce98f7475f4ebe906234ef1789 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 5 May 2012 22:55:24 +1000 Subject: [PATCH] Added some IOS version checks and code to clear memory before loading the dol. --- Source/Core/Core/Src/Boot/Boot.cpp | 2 +- Source/Core/Core/Src/HLE/HLE_Misc.cpp | 6 ++++++ Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index ef3ae2a4fb..0fa89a28cc 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -258,7 +258,7 @@ bool CBoot::BootUp() } // Scan for common HLE functions - if (!_StartupPara.bEnableDebugging) + if (!_StartupPara.bEnableDebugging && Memory::Read_U16(0x00003140) >= 30) { PPCAnalyst::FindFunctions(0x80004000, 0x811fffff, &g_symbolDB); SignatureDB db; diff --git a/Source/Core/Core/Src/HLE/HLE_Misc.cpp b/Source/Core/Core/Src/HLE/HLE_Misc.cpp index 40073d401e..b04e8004fd 100644 --- a/Source/Core/Core/Src/HLE/HLE_Misc.cpp +++ b/Source/Core/Core/Src/HLE/HLE_Misc.cpp @@ -301,6 +301,12 @@ void HBReload() void ExecuteDOL(u8* dolFile, u32 fileSize) { + // Clear memory before loading the dol + for (int i = 0x80004000; i < Memory::Read_U32(0x00000034); i += 4) + { + // TODO: Should not write over the "save region" + Memory::Write_U32(0x00000000, i); + } CDolLoader dolLoader(dolFile, fileSize); dolLoader.Load(); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index f409c88c83..f15dc81ce7 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -780,7 +780,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) // someone with an affected game should test IOSv = TitleID & 0xffff; } - if (!bSuccess) + if (!bSuccess && IOSv >= 30 && IOSv != 0xffff) { PanicAlertT("IOCTL_ES_LAUNCH: Game tried to reload ios or a title that is not available in your nand dump\n" "TitleID %016llx.\n Dolphin will likely hang now", TitleID);