From 71df7b14516d7f86f1ecf484751825faa768a85f Mon Sep 17 00:00:00 2001 From: MaranBr Date: Tue, 27 May 2025 11:58:01 +0000 Subject: [PATCH] mk8d-fix (#129) Removes the workaround and properly fixes the controller applet stuck on Mario Kart 8 Deluxe and possibly other games as well Co-authored-by: MaranBr Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/129 --- src/core/hle/service/am/applet.cpp | 4 ++-- src/core/hle/service/am/service/library_applet_accessor.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/am/applet.cpp b/src/core/hle/service/am/applet.cpp index 6847f250c2..f94d528da7 100644 --- a/src/core/hle/service/am/applet.cpp +++ b/src/core/hle/service/am/applet.cpp @@ -30,13 +30,12 @@ void Applet::UpdateSuspensionStateLocked(bool force_message) { const bool curr_activity_runnable = lifecycle_manager.IsRunnable(); const bool prev_activity_runnable = is_activity_runnable; const bool was_changed = curr_activity_runnable != prev_activity_runnable; - + if (was_changed) { if (curr_activity_runnable) { process->Suspend(false); } else { process->Suspend(true); - lifecycle_manager.RequestResumeNotification(); } is_activity_runnable = curr_activity_runnable; @@ -49,6 +48,7 @@ void Applet::UpdateSuspensionStateLocked(bool force_message) { // Signal if the focus state was changed or the process state was changed. if (lifecycle_manager.UpdateRequestedFocusState() || was_changed || force_message) { + lifecycle_manager.RequestResumeNotification(); lifecycle_manager.SignalSystemEventIfNeeded(); } } diff --git a/src/core/hle/service/am/service/library_applet_accessor.cpp b/src/core/hle/service/am/service/library_applet_accessor.cpp index 10a8bac218..974e43812d 100644 --- a/src/core/hle/service/am/service/library_applet_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_accessor.cpp @@ -61,6 +61,12 @@ Result ILibraryAppletAccessor::IsCompleted(Out out_is_completed) { Result ILibraryAppletAccessor::GetResult() { LOG_DEBUG(Service_AM, "called"); std::scoped_lock lk{m_applet->lock}; + if (auto caller_applet = m_applet->caller_applet.lock(); caller_applet) { + caller_applet->UpdateSuspensionStateLocked(true); + } else { + LOG_ERROR(Service_AM, "No caller applet available"); + R_THROW(ResultUnknown); + } R_RETURN(m_applet->terminate_result); }