From d3d7cc6f96a38a9d03bab352d2054d810d0f85d9 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Fri, 29 Jul 2022 12:16:20 -0700 Subject: [PATCH] Boot_BS2Emu: Create an actual function for AppLoaderReport Before, we used a replace hook and didn't write anything there. Now, we write a BLR instruction to immediately return, and then use a start hook. This makes the behavior a bit clearer (though it shoudln't matter in practice). --- Source/Core/Core/Boot/Boot_BS2Emu.cpp | 3 ++- Source/Core/Core/HLE/HLE.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index f8a283144e..8f7fce39f5 100644 --- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp +++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp @@ -160,7 +160,8 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume, // iAppLoaderInit DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderInit"); - HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader + PowerPC::HostWrite_U32(0x4E800020, 0x81300000); // Write BLR + HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader PowerPC::ppcState.gpr[3] = 0x81300000; RunFunction(iAppLoaderInit); diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp index 264a3013d7..fef1cad648 100644 --- a/Source/Core/Core/HLE/HLE.cpp +++ b/Source/Core/Core/HLE/HLE.cpp @@ -58,7 +58,7 @@ constexpr std::array os_patches{{ {"GeckoCodehandler", HLE_Misc::GeckoCodeHandlerICacheFlush, HookType::Start, HookFlag::Fixed}, {"GeckoHandlerReturnTrampoline", HLE_Misc::GeckoReturnTrampoline, HookType::Replace, HookFlag::Fixed}, - {"AppLoaderReport", HLE_OS::HLE_GeneralDebugPrint, HookType::Replace, HookFlag::Fixed} // apploader needs OSReport-like function + {"AppLoaderReport", HLE_OS::HLE_GeneralDebugPrint, HookType::Start, HookFlag::Fixed} // apploader needs OSReport-like function }}; // clang-format on