diff options
| author | 2022-04-02 19:43:49 -0600 | |
|---|---|---|
| committer | 2022-04-02 19:43:49 -0600 | |
| commit | 3e5469a974b979d113b056d9fc3b0b9beff96ab7 (patch) | |
| tree | cd28db1479104b2d4608a151d1a44ca4372f334a | |
| parent | service: hid: Remove inaccurate behavior on initialization (diff) | |
| download | yuzu-3e5469a974b979d113b056d9fc3b0b9beff96ab7.tar.gz yuzu-3e5469a974b979d113b056d9fc3b0b9beff96ab7.tar.xz yuzu-3e5469a974b979d113b056d9fc3b0b9beff96ab7.zip | |
service: npad: Default initialize shared memory
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index c417a36bb..967379f05 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -191,16 +191,16 @@ private: | |||
| 191 | 191 | ||
| 192 | // This is nn::hid::detail::NpadFullKeyColorState | 192 | // This is nn::hid::detail::NpadFullKeyColorState |
| 193 | struct NpadFullKeyColorState { | 193 | struct NpadFullKeyColorState { |
| 194 | ColorAttribute attribute; | 194 | ColorAttribute attribute{ColorAttribute::NoController}; |
| 195 | Core::HID::NpadControllerColor fullkey; | 195 | Core::HID::NpadControllerColor fullkey{}; |
| 196 | }; | 196 | }; |
| 197 | static_assert(sizeof(NpadFullKeyColorState) == 0xC, "NpadFullKeyColorState is an invalid size"); | 197 | static_assert(sizeof(NpadFullKeyColorState) == 0xC, "NpadFullKeyColorState is an invalid size"); |
| 198 | 198 | ||
| 199 | // This is nn::hid::detail::NpadJoyColorState | 199 | // This is nn::hid::detail::NpadJoyColorState |
| 200 | struct NpadJoyColorState { | 200 | struct NpadJoyColorState { |
| 201 | ColorAttribute attribute; | 201 | ColorAttribute attribute{ColorAttribute::NoController}; |
| 202 | Core::HID::NpadControllerColor left; | 202 | Core::HID::NpadControllerColor left{}; |
| 203 | Core::HID::NpadControllerColor right; | 203 | Core::HID::NpadControllerColor right{}; |
| 204 | }; | 204 | }; |
| 205 | static_assert(sizeof(NpadJoyColorState) == 0x14, "NpadJoyColorState is an invalid size"); | 205 | static_assert(sizeof(NpadJoyColorState) == 0x14, "NpadJoyColorState is an invalid size"); |
| 206 | 206 | ||
| @@ -226,11 +226,11 @@ private: | |||
| 226 | // This is nn::hid::NpadPalmaState | 226 | // This is nn::hid::NpadPalmaState |
| 227 | // This is nn::hid::NpadSystemExtState | 227 | // This is nn::hid::NpadSystemExtState |
| 228 | struct NPadGenericState { | 228 | struct NPadGenericState { |
| 229 | s64_le sampling_number; | 229 | s64_le sampling_number{}; |
| 230 | Core::HID::NpadButtonState npad_buttons; | 230 | Core::HID::NpadButtonState npad_buttons{}; |
| 231 | Core::HID::AnalogStickState l_stick; | 231 | Core::HID::AnalogStickState l_stick{}; |
| 232 | Core::HID::AnalogStickState r_stick; | 232 | Core::HID::AnalogStickState r_stick{}; |
| 233 | NpadAttribute connection_status; | 233 | NpadAttribute connection_status{}; |
| 234 | INSERT_PADDING_BYTES(4); // Reserved | 234 | INSERT_PADDING_BYTES(4); // Reserved |
| 235 | }; | 235 | }; |
| 236 | static_assert(sizeof(NPadGenericState) == 0x28, "NPadGenericState is an invalid size"); | 236 | static_assert(sizeof(NPadGenericState) == 0x28, "NPadGenericState is an invalid size"); |
| @@ -253,7 +253,7 @@ private: | |||
| 253 | Common::Vec3f gyro{}; | 253 | Common::Vec3f gyro{}; |
| 254 | Common::Vec3f rotation{}; | 254 | Common::Vec3f rotation{}; |
| 255 | std::array<Common::Vec3f, 3> orientation{}; | 255 | std::array<Common::Vec3f, 3> orientation{}; |
| 256 | SixAxisSensorAttribute attribute; | 256 | SixAxisSensorAttribute attribute{}; |
| 257 | INSERT_PADDING_BYTES(4); // Reserved | 257 | INSERT_PADDING_BYTES(4); // Reserved |
| 258 | }; | 258 | }; |
| 259 | static_assert(sizeof(SixAxisSensorState) == 0x60, "SixAxisSensorState is an invalid size"); | 259 | static_assert(sizeof(SixAxisSensorState) == 0x60, "SixAxisSensorState is an invalid size"); |
| @@ -325,11 +325,11 @@ private: | |||
| 325 | 325 | ||
| 326 | // This is nn::hid::detail::NfcXcdDeviceHandleStateImpl | 326 | // This is nn::hid::detail::NfcXcdDeviceHandleStateImpl |
| 327 | struct NfcXcdDeviceHandleStateImpl { | 327 | struct NfcXcdDeviceHandleStateImpl { |
| 328 | u64 handle; | 328 | u64 handle{}; |
| 329 | bool is_available; | 329 | bool is_available{}; |
| 330 | bool is_activated; | 330 | bool is_activated{}; |
| 331 | INSERT_PADDING_BYTES(0x6); // Reserved | 331 | INSERT_PADDING_BYTES(0x6); // Reserved |
| 332 | u64 sampling_number; | 332 | u64 sampling_number{}; |
| 333 | }; | 333 | }; |
| 334 | static_assert(sizeof(NfcXcdDeviceHandleStateImpl) == 0x18, | 334 | static_assert(sizeof(NfcXcdDeviceHandleStateImpl) == 0x18, |
| 335 | "NfcXcdDeviceHandleStateImpl is an invalid size"); | 335 | "NfcXcdDeviceHandleStateImpl is an invalid size"); |
| @@ -366,8 +366,8 @@ private: | |||
| 366 | }; | 366 | }; |
| 367 | 367 | ||
| 368 | struct AppletFooterUi { | 368 | struct AppletFooterUi { |
| 369 | AppletFooterUiAttributes attributes; | 369 | AppletFooterUiAttributes attributes{}; |
| 370 | AppletFooterUiType type; | 370 | AppletFooterUiType type{AppletFooterUiType::None}; |
| 371 | INSERT_PADDING_BYTES(0x5B); // Reserved | 371 | INSERT_PADDING_BYTES(0x5B); // Reserved |
| 372 | }; | 372 | }; |
| 373 | static_assert(sizeof(AppletFooterUi) == 0x60, "AppletFooterUi is an invalid size"); | 373 | static_assert(sizeof(AppletFooterUi) == 0x60, "AppletFooterUi is an invalid size"); |
| @@ -404,41 +404,41 @@ private: | |||
| 404 | 404 | ||
| 405 | // This is nn::hid::detail::NpadInternalState | 405 | // This is nn::hid::detail::NpadInternalState |
| 406 | struct NpadInternalState { | 406 | struct NpadInternalState { |
| 407 | Core::HID::NpadStyleTag style_tag; | 407 | Core::HID::NpadStyleTag style_tag{Core::HID::NpadStyleSet::None}; |
| 408 | NpadJoyAssignmentMode assignment_mode; | 408 | NpadJoyAssignmentMode assignment_mode{NpadJoyAssignmentMode::Dual}; |
| 409 | NpadFullKeyColorState fullkey_color; | 409 | NpadFullKeyColorState fullkey_color{}; |
| 410 | NpadJoyColorState joycon_color; | 410 | NpadJoyColorState joycon_color{}; |
| 411 | Lifo<NPadGenericState, hid_entry_count> fullkey_lifo; | 411 | Lifo<NPadGenericState, hid_entry_count> fullkey_lifo{}; |
| 412 | Lifo<NPadGenericState, hid_entry_count> handheld_lifo; | 412 | Lifo<NPadGenericState, hid_entry_count> handheld_lifo{}; |
| 413 | Lifo<NPadGenericState, hid_entry_count> joy_dual_lifo; | 413 | Lifo<NPadGenericState, hid_entry_count> joy_dual_lifo{}; |
| 414 | Lifo<NPadGenericState, hid_entry_count> joy_left_lifo; | 414 | Lifo<NPadGenericState, hid_entry_count> joy_left_lifo{}; |
| 415 | Lifo<NPadGenericState, hid_entry_count> joy_right_lifo; | 415 | Lifo<NPadGenericState, hid_entry_count> joy_right_lifo{}; |
| 416 | Lifo<NPadGenericState, hid_entry_count> palma_lifo; | 416 | Lifo<NPadGenericState, hid_entry_count> palma_lifo{}; |
| 417 | Lifo<NPadGenericState, hid_entry_count> system_ext_lifo; | 417 | Lifo<NPadGenericState, hid_entry_count> system_ext_lifo{}; |
| 418 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_fullkey_lifo; | 418 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_fullkey_lifo{}; |
| 419 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_handheld_lifo; | 419 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_handheld_lifo{}; |
| 420 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_dual_left_lifo; | 420 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_dual_left_lifo{}; |
| 421 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_dual_right_lifo; | 421 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_dual_right_lifo{}; |
| 422 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_left_lifo; | 422 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_left_lifo{}; |
| 423 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_right_lifo; | 423 | Lifo<SixAxisSensorState, hid_entry_count> sixaxis_right_lifo{}; |
| 424 | DeviceType device_type; | 424 | DeviceType device_type{}; |
| 425 | INSERT_PADDING_BYTES(0x4); // Reserved | 425 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 426 | NPadSystemProperties system_properties; | 426 | NPadSystemProperties system_properties{}; |
| 427 | NpadSystemButtonProperties button_properties; | 427 | NpadSystemButtonProperties button_properties{}; |
| 428 | Core::HID::NpadBatteryLevel battery_level_dual; | 428 | Core::HID::NpadBatteryLevel battery_level_dual{}; |
| 429 | Core::HID::NpadBatteryLevel battery_level_left; | 429 | Core::HID::NpadBatteryLevel battery_level_left{}; |
| 430 | Core::HID::NpadBatteryLevel battery_level_right; | 430 | Core::HID::NpadBatteryLevel battery_level_right{}; |
| 431 | union { | 431 | union { |
| 432 | Lifo<NfcXcdDeviceHandleStateImpl, 0x2> nfc_xcd_device_lifo{}; | 432 | AppletFooterUi applet_footer{}; |
| 433 | AppletFooterUi applet_footer; | 433 | Lifo<NfcXcdDeviceHandleStateImpl, 0x2> nfc_xcd_device_lifo; |
| 434 | }; | 434 | }; |
| 435 | INSERT_PADDING_BYTES(0x20); // Unknown | 435 | INSERT_PADDING_BYTES(0x20); // Unknown |
| 436 | Lifo<NpadGcTriggerState, hid_entry_count> gc_trigger_lifo; | 436 | Lifo<NpadGcTriggerState, hid_entry_count> gc_trigger_lifo{}; |
| 437 | NpadLarkType lark_type_l_and_main; | 437 | NpadLarkType lark_type_l_and_main{}; |
| 438 | NpadLarkType lark_type_r; | 438 | NpadLarkType lark_type_r{}; |
| 439 | NpadLuciaType lucia_type; | 439 | NpadLuciaType lucia_type{}; |
| 440 | NpadLagonType lagon_type; | 440 | NpadLagonType lagon_type{}; |
| 441 | NpadLagerType lager_type; | 441 | NpadLagerType lager_type{}; |
| 442 | // FW 13.x Investigate there is some sort of bitflag related to joycons | 442 | // FW 13.x Investigate there is some sort of bitflag related to joycons |
| 443 | INSERT_PADDING_BYTES(0x4); | 443 | INSERT_PADDING_BYTES(0x4); |
| 444 | INSERT_PADDING_BYTES(0xc08); // Unknown | 444 | INSERT_PADDING_BYTES(0xc08); // Unknown |