From 9f376cd901447ad371f23ef14ce195ecc8d435f4 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Fri, 19 Jan 2024 00:09:49 -0600 Subject: service: hid: Clear controller status when aruid is no longer used --- src/hid_core/resources/npad/npad.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/hid_core/resources') diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index 97537a2e2..de0f9cbb9 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp @@ -1232,6 +1232,13 @@ Result NPad::RegisterAppletResourceUserId(u64 aruid) { } void NPad::UnregisterAppletResourceUserId(u64 aruid) { + // TODO: Remove this once abstract pad is emulated properly + const auto aruid_index = npad_resource.GetIndexFromAruid(aruid); + for (auto& controller : controller_data[aruid_index]) { + controller.is_connected = false; + controller.shared_memory = nullptr; + } + npad_resource.UnregisterAppletResourceUserId(aruid); } -- cgit v1.2.3