From ba3db24f3024349ba5d088703fb6da7be8a25609 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 6 Dec 2023 02:39:55 +0200 Subject: [PATCH 1/2] [Kernel] Fix WaitSynchronization1 ABI --- src/core/kernel/events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/kernel/events.cpp b/src/core/kernel/events.cpp index 068417200..7da4788ec 100644 --- a/src/core/kernel/events.cpp +++ b/src/core/kernel/events.cpp @@ -96,7 +96,7 @@ void Kernel::svcSignalEvent() { // Result WaitSynchronization1(Handle handle, s64 timeout_nanoseconds) void Kernel::waitSynchronization1() { const Handle handle = regs[0]; - const s64 ns = s64(u64(regs[1]) | (u64(regs[2]) << 32)); + const s64 ns = s64(u64(regs[2]) | (u64(regs[3]) << 32)); logSVC("WaitSynchronization1(handle = %X, ns = %lld)\n", handle, ns); const auto object = getObject(handle); From 13d680e8b6e818224d0913e9a68a793c368d5281 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 6 Dec 2023 02:40:09 +0200 Subject: [PATCH 2/2] [IR] Report CPP as not plugged --- src/core/services/ir_user.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/services/ir_user.cpp b/src/core/services/ir_user.cpp index 47a2299a2..ce4f94c4c 100644 --- a/src/core/services/ir_user.cpp +++ b/src/core/services/ir_user.cpp @@ -120,9 +120,14 @@ void IRUserService::requireConnection(u32 messagePointer) { u32 sharedMemAddress = sharedMemory.value().addr; if (deviceID == u8(DeviceID::CirclePadPro)) { - mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionStatus), 2); // Citra uses 2 here but only 1 works?? - mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionRole), 2); - mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, isConnected), 1); + // Note: We temporarily pretend we don't have a CirclePad Pro. This code must change when we emulate it or N3DS C-stick + constexpr u8 status = 1; // Not connected. Any value other than 2 is considered not connected. + constexpr u8 role = 0; + constexpr u8 connected = 0; + + mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionStatus), status); + mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionRole), role); + mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, isConnected), connected); connectedDevice = true; if (connectionStatusEvent.has_value()) {