From 884a9080b5bb86f6fb1dbb0b3d2f51c5e7bd09b0 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Tue, 1 Mar 2022 20:40:56 +0000 Subject: [PATCH] hle: detect when patches fail to apply --- src/core/hle/Patches.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/hle/Patches.cpp b/src/core/hle/Patches.cpp index 3236914b2..9af7930fe 100644 --- a/src/core/hle/Patches.cpp +++ b/src/core/hle/Patches.cpp @@ -438,8 +438,14 @@ inline void EmuInstallPatch(const std::string FunctionName, const xbox::addr_xt return; } - g_FunctionHooks[FunctionName].Install((void*)(FunctionAddr), (void*)patch.patchFunc); - printf("HLE: %s Patched\n", FunctionName.c_str()); + auto result = g_FunctionHooks[FunctionName].Install((void*)(FunctionAddr), (void*)patch.patchFunc); + if (!result) { + printf("HLE: %s Patch Failed\n", FunctionName.c_str()); + } + else { + printf("HLE: %s Patched\n", FunctionName.c_str()); + } + } void EmuInstallPatches()