diff options
| author | 2024-02-05 16:59:13 -0600 | |
|---|---|---|
| committer | 2024-02-05 17:17:21 -0600 | |
| commit | 372897aac42192bb0290e7ac74e1ae8d15f53a55 (patch) | |
| tree | 7cbd5f742c67fcfadd6d34ae807d940d178c1da2 | |
| parent | Merge pull request #12905 from liamwhite/hwc-release (diff) | |
| download | yuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.tar.gz yuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.tar.xz yuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.zip | |
service: hid: Ensure aruid data is initialized
Diffstat (limited to '')
| -rw-r--r-- | src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp | 2 | ||||
| -rw-r--r-- | src/hid_core/resources/npad/npad.cpp | 6 | ||||
| -rw-r--r-- | src/hid_core/resources/touch_screen/touch_screen_resource.cpp | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp b/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp index 6d759298e..0dde244ef 100644 --- a/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp +++ b/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp | |||
| @@ -57,7 +57,7 @@ Result NpadAbstractSixAxisHandler::UpdateSixAxisState() { | |||
| 57 | Core::HID::NpadIdType npad_id = properties_handler->GetNpadId(); | 57 | Core::HID::NpadIdType npad_id = properties_handler->GetNpadId(); |
| 58 | for (std::size_t i = 0; i < AruidIndexMax; i++) { | 58 | for (std::size_t i = 0; i < AruidIndexMax; i++) { |
| 59 | auto* data = applet_resource_holder->applet_resource->GetAruidDataByIndex(i); | 59 | auto* data = applet_resource_holder->applet_resource->GetAruidDataByIndex(i); |
| 60 | if (data->flag.is_assigned) { | 60 | if (data == nullptr || !data->flag.is_assigned) { |
| 61 | continue; | 61 | continue; |
| 62 | } | 62 | } |
| 63 | auto& npad_entry = data->shared_memory_format->npad.npad_entry[NpadIdTypeToIndex(npad_id)]; | 63 | auto& npad_entry = data->shared_memory_format->npad.npad_entry[NpadIdTypeToIndex(npad_id)]; |
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index fe3fdc5cd..053625b55 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp | |||
| @@ -131,7 +131,7 @@ void NPad::ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t c | |||
| 131 | 131 | ||
| 132 | auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); | 132 | auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); |
| 133 | 133 | ||
| 134 | if (!data->flag.is_assigned) { | 134 | if (data == nullptr || !data->flag.is_assigned) { |
| 135 | continue; | 135 | continue; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -463,13 +463,13 @@ void NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) { | |||
| 463 | std::scoped_lock lock{*applet_resource_holder.shared_mutex}; | 463 | std::scoped_lock lock{*applet_resource_holder.shared_mutex}; |
| 464 | for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) { | 464 | for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) { |
| 465 | const auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); | 465 | const auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); |
| 466 | const auto aruid = data->aruid; | ||
| 467 | 466 | ||
| 468 | if (!data->flag.is_assigned) { | 467 | if (data == nullptr || !data->flag.is_assigned) { |
| 469 | continue; | 468 | continue; |
| 470 | } | 469 | } |
| 471 | 470 | ||
| 472 | bool is_set{}; | 471 | bool is_set{}; |
| 472 | const auto aruid = data->aruid; | ||
| 473 | npad_resource.IsSupportedNpadStyleSet(is_set, aruid); | 473 | npad_resource.IsSupportedNpadStyleSet(is_set, aruid); |
| 474 | // Wait until style is defined | 474 | // Wait until style is defined |
| 475 | if (!is_set) { | 475 | if (!is_set) { |
diff --git a/src/hid_core/resources/touch_screen/touch_screen_resource.cpp b/src/hid_core/resources/touch_screen/touch_screen_resource.cpp index 56e8e8e51..c39321915 100644 --- a/src/hid_core/resources/touch_screen/touch_screen_resource.cpp +++ b/src/hid_core/resources/touch_screen/touch_screen_resource.cpp | |||
| @@ -63,7 +63,7 @@ Result TouchResource::ActivateTouch(u64 aruid) { | |||
| 63 | auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); | 63 | auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); |
| 64 | TouchAruidData& touch_data = aruid_data[aruid_index]; | 64 | TouchAruidData& touch_data = aruid_data[aruid_index]; |
| 65 | 65 | ||
| 66 | if (!applet_data->flag.is_assigned) { | 66 | if (applet_data == nullptr || !applet_data->flag.is_assigned) { |
| 67 | touch_data = {}; | 67 | touch_data = {}; |
| 68 | continue; | 68 | continue; |
| 69 | } | 69 | } |
| @@ -124,7 +124,7 @@ Result TouchResource::ActivateGesture(u64 aruid, u32 basic_gesture_id) { | |||
| 124 | auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); | 124 | auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); |
| 125 | TouchAruidData& touch_data = aruid_data[aruid_index]; | 125 | TouchAruidData& touch_data = aruid_data[aruid_index]; |
| 126 | 126 | ||
| 127 | if (!applet_data->flag.is_assigned) { | 127 | if (applet_data == nullptr || !applet_data->flag.is_assigned) { |
| 128 | touch_data = {}; | 128 | touch_data = {}; |
| 129 | continue; | 129 | continue; |
| 130 | } | 130 | } |
| @@ -324,7 +324,7 @@ Result TouchResource::SetTouchScreenConfiguration( | |||
| 324 | const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); | 324 | const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); |
| 325 | TouchAruidData& data = aruid_data[aruid_index]; | 325 | TouchAruidData& data = aruid_data[aruid_index]; |
| 326 | 326 | ||
| 327 | if (!applet_data->flag.is_assigned) { | 327 | if (applet_data == nullptr || !applet_data->flag.is_assigned) { |
| 328 | continue; | 328 | continue; |
| 329 | } | 329 | } |
| 330 | if (aruid != data.aruid) { | 330 | if (aruid != data.aruid) { |
| @@ -344,7 +344,7 @@ Result TouchResource::GetTouchScreenConfiguration( | |||
| 344 | const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); | 344 | const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index); |
| 345 | const TouchAruidData& data = aruid_data[aruid_index]; | 345 | const TouchAruidData& data = aruid_data[aruid_index]; |
| 346 | 346 | ||
| 347 | if (!applet_data->flag.is_assigned) { | 347 | if (applet_data == nullptr || !applet_data->flag.is_assigned) { |
| 348 | continue; | 348 | continue; |
| 349 | } | 349 | } |
| 350 | if (aruid != data.aruid) { | 350 | if (aruid != data.aruid) { |