diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 07:42:23 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 17:51:01 +0100 |
commit | 865abfc37c5b3e8945d833bd44db428ad720bd58 (patch) | |
tree | af37ccf552aad0403898fb371e639393efe7b9d4 /src/core/hle/service/hid/controllers/six_axis.cpp | |
parent | Merge pull request #12509 from liamwhite/ktrace (diff) | |
download | yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.gz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.bz2 yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.lz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.xz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.zst yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/six_axis.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/core/hle/service/hid/controllers/six_axis.cpp b/src/core/hle/service/hid/controllers/six_axis.cpp index 36b72f9ea..a5a67dea6 100644 --- a/src/core/hle/service/hid/controllers/six_axis.cpp +++ b/src/core/hle/service/hid/controllers/six_axis.cpp @@ -6,8 +6,8 @@ #include "core/hid/emulated_controller.h" #include "core/hid/hid_core.h" #include "core/hle/service/hid/controllers/npad.h" -#include "core/hle/service/hid/controllers/shared_memory_format.h" #include "core/hle/service/hid/controllers/six_axis.h" +#include "core/hle/service/hid/controllers/types/shared_memory_format.h" #include "core/hle/service/hid/errors.h" #include "core/hle/service/hid/hid_util.h" @@ -27,14 +27,20 @@ void SixAxis::OnInit() {} void SixAxis::OnRelease() {} void SixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) { + const u64 aruid = applet_resource->GetActiveAruid(); + auto* data = applet_resource->GetAruidData(aruid); + + if (data == nullptr) { + return; + } + if (!IsControllerActivated()) { return; } for (std::size_t i = 0; i < controller_data.size(); ++i) { + NpadSharedMemoryEntry& shared_memory = data->shared_memory_format->npad.npad_entry[i]; auto& controller = controller_data[i]; - - const auto npad_id = IndexToNpadIdType(i); const auto& controller_type = controller.device->GetNpadStyleIndex(); if (controller_type == Core::HID::NpadStyleIndex::None || @@ -50,12 +56,12 @@ void SixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) { auto& sixaxis_left_lifo_state = controller.sixaxis_left_lifo_state; auto& sixaxis_right_lifo_state = controller.sixaxis_right_lifo_state; - auto& sixaxis_fullkey_lifo = npad->GetSixAxisFullkeyLifo(npad_id); - auto& sixaxis_handheld_lifo = npad->GetSixAxisHandheldLifo(npad_id); - auto& sixaxis_dual_left_lifo = npad->GetSixAxisDualLeftLifo(npad_id); - auto& sixaxis_dual_right_lifo = npad->GetSixAxisDualRightLifo(npad_id); - auto& sixaxis_left_lifo = npad->GetSixAxisLeftLifo(npad_id); - auto& sixaxis_right_lifo = npad->GetSixAxisRightLifo(npad_id); + auto& sixaxis_fullkey_lifo = shared_memory.internal_state.sixaxis_fullkey_lifo; + auto& sixaxis_handheld_lifo = shared_memory.internal_state.sixaxis_handheld_lifo; + auto& sixaxis_dual_left_lifo = shared_memory.internal_state.sixaxis_dual_left_lifo; + auto& sixaxis_dual_right_lifo = shared_memory.internal_state.sixaxis_dual_right_lifo; + auto& sixaxis_left_lifo = shared_memory.internal_state.sixaxis_left_lifo; + auto& sixaxis_right_lifo = shared_memory.internal_state.sixaxis_right_lifo; // Clear previous state sixaxis_fullkey_state = {}; |