From 86a6d74218d7efbd381a746cd70fe3439d51f43c Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:41:00 +0300 Subject: [PATCH] Update APT::AppletUtility --- src/core/services/apt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/services/apt.cpp b/src/core/services/apt.cpp index 124e5c95..1cdebc88 100644 --- a/src/core/services/apt.cpp +++ b/src/core/services/apt.cpp @@ -96,6 +96,13 @@ void APTService::appletUtility(u32 messagePointer) { log("APT::AppletUtility(utility = %d, input size = %x, output size = %x, inputPointer = %08X) (Stubbed)\n", utility, inputSize, outputSize, inputPointer); + + const u32 outputBuffer = messagePointer + 0x104; + if (outputSize >= 1 && utility == 6) { + // TryLockTransition expects a bool indicating success in the output buffer. Set it to true to avoid games panicking (Thanks to Citra) + mem.write8(outputBuffer, true); + } + mem.write32(messagePointer, IPC::responseHeader(0x4B, 2, 2)); mem.write32(messagePointer + 4, Result::Success); }