diff options
| author | 2021-11-29 21:10:02 -0600 | |
|---|---|---|
| committer | 2021-11-29 21:10:02 -0600 | |
| commit | 46e3ed5a483eac404ff1e2103ecc4e93e815d45b (patch) | |
| tree | b5317954b6692942ba01b262616a7979141c95fc /src/core/hle | |
| parent | input_common: Fix error with thread name (diff) | |
| parent | input_interpreter: Make use of NpadButton instead of a u64 (diff) | |
| download | yuzu-46e3ed5a483eac404ff1e2103ecc4e93e815d45b.tar.gz yuzu-46e3ed5a483eac404ff1e2103ecc4e93e815d45b.tar.xz yuzu-46e3ed5a483eac404ff1e2103ecc4e93e815d45b.zip | |
Merge pull request #7472 from Morph1984/post-kraken-cleanup
core: hid: Post kraken cleanup
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 04b3a68c3..6916930f7 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -510,7 +510,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* | |||
| 510 | libnx_state.r_stick = pad_state.r_stick; | 510 | libnx_state.r_stick = pad_state.r_stick; |
| 511 | npad.system_ext_lifo.WriteNextEntry(pad_state); | 511 | npad.system_ext_lifo.WriteNextEntry(pad_state); |
| 512 | 512 | ||
| 513 | press_state |= static_cast<u32>(pad_state.npad_buttons.raw); | 513 | press_state |= static_cast<u64>(pad_state.npad_buttons.raw); |
| 514 | 514 | ||
| 515 | std::memcpy(data + NPAD_OFFSET + (i * sizeof(NpadInternalState)), | 515 | std::memcpy(data + NPAD_OFFSET + (i * sizeof(NpadInternalState)), |
| 516 | &controller.shared_memory_entry, sizeof(NpadInternalState)); | 516 | &controller.shared_memory_entry, sizeof(NpadInternalState)); |
| @@ -635,7 +635,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing | |||
| 635 | // This buffer only is updated on handheld on HW | 635 | // This buffer only is updated on handheld on HW |
| 636 | npad.sixaxis_handheld_lifo.WriteNextEntry(sixaxis_handheld_state); | 636 | npad.sixaxis_handheld_lifo.WriteNextEntry(sixaxis_handheld_state); |
| 637 | } else { | 637 | } else { |
| 638 | // Hanheld doesn't update this buffer on HW | 638 | // Handheld doesn't update this buffer on HW |
| 639 | npad.sixaxis_fullkey_lifo.WriteNextEntry(sixaxis_fullkey_state); | 639 | npad.sixaxis_fullkey_lifo.WriteNextEntry(sixaxis_fullkey_state); |
| 640 | } | 640 | } |
| 641 | 641 | ||
| @@ -1149,8 +1149,8 @@ void Controller_NPad::ClearAllControllers() { | |||
| 1149 | } | 1149 | } |
| 1150 | } | 1150 | } |
| 1151 | 1151 | ||
| 1152 | u32 Controller_NPad::GetAndResetPressState() { | 1152 | Core::HID::NpadButton Controller_NPad::GetAndResetPressState() { |
| 1153 | return press_state.exchange(0); | 1153 | return static_cast<Core::HID::NpadButton>(press_state.exchange(0)); |
| 1154 | } | 1154 | } |
| 1155 | 1155 | ||
| 1156 | bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const { | 1156 | bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const { |
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 9fa113bb6..de5fa5a64 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -179,7 +179,7 @@ public: | |||
| 179 | 179 | ||
| 180 | // Logical OR for all buttons presses on all controllers | 180 | // Logical OR for all buttons presses on all controllers |
| 181 | // Specifically for cheat engine and other features. | 181 | // Specifically for cheat engine and other features. |
| 182 | u32 GetAndResetPressState(); | 182 | Core::HID::NpadButton GetAndResetPressState(); |
| 183 | 183 | ||
| 184 | static bool IsNpadIdValid(Core::HID::NpadIdType npad_id); | 184 | static bool IsNpadIdValid(Core::HID::NpadIdType npad_id); |
| 185 | static bool IsDeviceHandleValid(const Core::HID::SixAxisSensorHandle& device_handle); | 185 | static bool IsDeviceHandleValid(const Core::HID::SixAxisSensorHandle& device_handle); |
| @@ -503,7 +503,7 @@ private: | |||
| 503 | NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id); | 503 | NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id); |
| 504 | const NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id) const; | 504 | const NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id) const; |
| 505 | 505 | ||
| 506 | std::atomic<u32> press_state{}; | 506 | std::atomic<u64> press_state{}; |
| 507 | 507 | ||
| 508 | std::array<NpadControllerData, 10> controller_data{}; | 508 | std::array<NpadControllerData, 10> controller_data{}; |
| 509 | KernelHelpers::ServiceContext& service_context; | 509 | KernelHelpers::ServiceContext& service_context; |