diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-04-19 22:30:32 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2022-04-23 22:41:42 +0200 |
commit | 61582efeb976b0852e73b734835d60c73b38f3cf (patch) | |
tree | b5ac72746de0533cd292ad5cb962d0e663326b0e /src/core/hle/service/hid/controllers/npad.h | |
parent | Merge pull request #8249 from german77/queued (diff) | |
download | yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar.gz yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar.bz2 yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar.lz yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar.xz yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.tar.zst yuzu-61582efeb976b0852e73b734835d60c73b38f3cf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index b42532b68..425b84abd 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -35,7 +35,7 @@ namespace Service::HID { class Controller_NPad final : public ControllerBase { public: - explicit Controller_NPad(Core::HID::HIDCore& hid_core_, + explicit Controller_NPad(Core::HID::HIDCore& hid_core_, u8* raw_shared_memory_, KernelHelpers::ServiceContext& service_context_); ~Controller_NPad() override; @@ -46,11 +46,10 @@ public: void OnRelease() override; // When the controller is requesting an update for the shared memory - void OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data, std::size_t size) override; + void OnUpdate(const Core::Timing::CoreTiming& core_timing) override; // When the controller is requesting a motion update for the shared memory - void OnMotionUpdate(const Core::Timing::CoreTiming& core_timing, u8* data, - std::size_t size) override; + void OnMotionUpdate(const Core::Timing::CoreTiming& core_timing) override; // This is nn::hid::GyroscopeZeroDriftMode enum class GyroscopeZeroDriftMode : u32 { @@ -188,6 +187,8 @@ public: static bool IsDeviceHandleValid(const Core::HID::VibrationDeviceHandle& device_handle); private: + static const std::size_t NPAD_COUNT = 10; + // This is nn::hid::detail::ColorAttribute enum class ColorAttribute : u32 { Ok = 0, @@ -409,6 +410,13 @@ private: U, }; + struct AppletNfcXcd { + union { + AppletFooterUi applet_footer{}; + Lifo<NfcXcdDeviceHandleStateImpl, 0x2> nfc_xcd_device_lifo; + }; + }; + // This is nn::hid::detail::NpadInternalState struct NpadInternalState { Core::HID::NpadStyleTag style_tag{Core::HID::NpadStyleSet::None}; @@ -435,10 +443,7 @@ private: Core::HID::NpadBatteryLevel battery_level_dual{}; Core::HID::NpadBatteryLevel battery_level_left{}; Core::HID::NpadBatteryLevel battery_level_right{}; - union { - AppletFooterUi applet_footer{}; - Lifo<NfcXcdDeviceHandleStateImpl, 0x2> nfc_xcd_device_lifo; - }; + AppletNfcXcd applet_nfc_xcd{}; INSERT_PADDING_BYTES(0x20); // Unknown Lifo<NpadGcTriggerState, hid_entry_count> gc_trigger_lifo{}; NpadLarkType lark_type_l_and_main{}; @@ -467,7 +472,7 @@ private: struct NpadControllerData { Core::HID::EmulatedController* device; Kernel::KEvent* styleset_changed_event{}; - NpadInternalState shared_memory_entry{}; + NpadInternalState* shared_memory; std::array<VibrationData, 2> vibration{}; bool unintended_home_button_input_protection{}; @@ -505,7 +510,7 @@ private: void InitNewlyAddedController(Core::HID::NpadIdType npad_id); bool IsControllerSupported(Core::HID::NpadStyleIndex controller) const; void RequestPadStateUpdate(Core::HID::NpadIdType npad_id); - void WriteEmptyEntry(NpadInternalState& npad); + void WriteEmptyEntry(NpadInternalState* npad); NpadControllerData& GetControllerFromHandle( const Core::HID::SixAxisSensorHandle& device_handle); @@ -520,7 +525,7 @@ private: std::atomic<u64> press_state{}; - std::array<NpadControllerData, 10> controller_data{}; + std::array<NpadControllerData, NPAD_COUNT> controller_data{}; KernelHelpers::ServiceContext& service_context; std::mutex mutex; std::vector<Core::HID::NpadIdType> supported_npad_id_types{}; |