summaryrefslogtreecommitdiffstats
path: root/src/hid_core
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-19 15:33:16 +0100
committerGitHub <noreply@github.com>2024-01-19 15:33:16 +0100
commit932bd988243626a673abfffba6d9efd65e0b2a96 (patch)
treeaeaf33521d3e9df37bd0ca97e474a59fe781f56b /src/hid_core
parentMerge pull request #12678 from german77/settings_impl (diff)
parentservice: hid: Clear controller status when aruid is no longer used (diff)
downloadyuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar.gz
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar.bz2
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar.lz
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar.xz
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.tar.zst
yuzu-932bd988243626a673abfffba6d9efd65e0b2a96.zip
Diffstat (limited to 'src/hid_core')
-rw-r--r--src/hid_core/resources/npad/npad.cpp7
1 files changed, 7 insertions, 0 deletions
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);
}