diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-01 17:33:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 17:33:44 +0100 |
commit | 21138b6a867632c56330a48a7389430ae2b6e321 (patch) | |
tree | 6be048ee977f29f4c132d0cfb0bcdb79a7c5966d /src/hid_core/resources/npad | |
parent | Merge pull request #12870 from liamwhite/mac-ci (diff) | |
parent | service: hid: Restore active aruid (diff) | |
download | yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar.gz yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar.bz2 yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar.lz yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar.xz yuzu-21138b6a867632c56330a48a7389430ae2b6e321.tar.zst yuzu-21138b6a867632c56330a48a7389430ae2b6e321.zip |
Diffstat (limited to '')
-rw-r--r-- | src/hid_core/resources/npad/npad.cpp | 3 | ||||
-rw-r--r-- | src/hid_core/resources/npad/npad.h | 4 | ||||
-rw-r--r-- | src/hid_core/resources/npad/npad_resource.cpp | 6 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index 2823be348..1a58eff4a 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp @@ -1070,11 +1070,14 @@ void NPad::UnregisterAppletResourceUserId(u64 aruid) { void NPad::SetNpadExternals(std::shared_ptr<AppletResource> resource, std::recursive_mutex* shared_mutex, std::shared_ptr<HandheldConfig> handheld_config, + Kernel::KEvent* input_event, std::mutex* input_mutex, std::shared_ptr<Service::Set::ISystemSettingsServer> settings) { applet_resource_holder.applet_resource = resource; applet_resource_holder.shared_mutex = shared_mutex; applet_resource_holder.shared_npad_resource = &npad_resource; applet_resource_holder.handheld_config = handheld_config; + applet_resource_holder.input_event = input_event; + applet_resource_holder.input_mutex = input_mutex; vibration_handler.SetSettingsService(settings); diff --git a/src/hid_core/resources/npad/npad.h b/src/hid_core/resources/npad/npad.h index 3b1a69e7f..4e26ed2e8 100644 --- a/src/hid_core/resources/npad/npad.h +++ b/src/hid_core/resources/npad/npad.h @@ -131,6 +131,7 @@ public: void SetNpadExternals(std::shared_ptr<AppletResource> resource, std::recursive_mutex* shared_mutex, std::shared_ptr<HandheldConfig> handheld_config, + Kernel::KEvent* input_event, std::mutex* input_mutex, std::shared_ptr<Service::Set::ISystemSettingsServer> settings); AppletDetailedUiType GetAppletDetailedUiType(Core::HID::NpadIdType npad_id); @@ -204,9 +205,6 @@ private: std::array<AbstractPad, MaxSupportedNpadIdTypes> abstracted_pads; NpadVibration vibration_handler{}; - Kernel::KEvent* input_event{nullptr}; - std::mutex* input_mutex{nullptr}; - std::atomic<u64> press_state{}; std::array<std::array<NpadControllerData, MaxSupportedNpadIdTypes>, AruidIndexMax> controller_data{}; diff --git a/src/hid_core/resources/npad/npad_resource.cpp b/src/hid_core/resources/npad/npad_resource.cpp index ea9fc14ed..8dd86b58e 100644 --- a/src/hid_core/resources/npad/npad_resource.cpp +++ b/src/hid_core/resources/npad/npad_resource.cpp @@ -72,6 +72,12 @@ void NPadResource::UnregisterAppletResourceUserId(u64 aruid) { state[aruid_index] = {}; registration_list.flag[aruid_index] = RegistrationStatus::PendingDelete; } + + for (std::size_t i = 0; i < AruidIndexMax; i++) { + if (registration_list.flag[i] == RegistrationStatus::Initialized) { + active_data_aruid = registration_list.aruid[i]; + } + } } void NPadResource::DestroyStyleSetUpdateEvents(u64 aruid) { |