From 2ab37b3d4a4d7e76b1f758669623473edbb483ea Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:16:46 +0300 Subject: [PATCH] Don't sleep on service handles for the time being --- src/core/kernel/events.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/kernel/events.cpp b/src/core/kernel/events.cpp index ca72add1a..068417200 100644 --- a/src/core/kernel/events.cpp +++ b/src/core/kernel/events.cpp @@ -153,6 +153,14 @@ void Kernel::waitSynchronizationN() { if (handleCount <= 0) Helpers::panic("WaitSyncN: Invalid handle count"); + // Temporary hack: Until we implement service sessions properly, don't bother sleeping when WaitSyncN targets a service handle + // This is necessary because a lot of games use WaitSyncN with eg the CECD service + if (handleCount == 1 && KernelHandles::isServiceHandle(mem.read32(handles))) { + regs[0] = Result::Success; + regs[1] = 0; + return; + } + using WaitObject = std::pair; std::vector waitObjects(handleCount);