diff options
| author | 2021-10-24 23:23:54 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:26 -0600 | |
| commit | 064ddacf49aa7155e26add55983b81fdda997077 (patch) | |
| tree | 17f6d767233c10578d84d2029014a3dfa4b55396 /src/core/hle | |
| parent | input_common: Add manual update options to input devices (diff) | |
| download | yuzu-064ddacf49aa7155e26add55983b81fdda997077.tar.gz yuzu-064ddacf49aa7155e26add55983b81fdda997077.tar.xz yuzu-064ddacf49aa7155e26add55983b81fdda997077.zip | |
core/hid: Rework battery mappings
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 7bf31f63a..9f84e20c2 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -101,8 +101,9 @@ Controller_NPad::Controller_NPad(Core::System& system_, | |||
| 101 | for (std::size_t i = 0; i < controller_data.size(); ++i) { | 101 | for (std::size_t i = 0; i < controller_data.size(); ++i) { |
| 102 | auto& controller = controller_data[i]; | 102 | auto& controller = controller_data[i]; |
| 103 | controller.device = system.HIDCore().GetEmulatedControllerByIndex(i); | 103 | controller.device = system.HIDCore().GetEmulatedControllerByIndex(i); |
| 104 | controller.vibration[0].latest_vibration_value = DEFAULT_VIBRATION_VALUE; | 104 | controller.vibration[Core::HID::DeviceIndex::LeftIndex].latest_vibration_value = DEFAULT_VIBRATION_VALUE; |
| 105 | controller.vibration[1].latest_vibration_value = DEFAULT_VIBRATION_VALUE; | 105 | controller.vibration[Core::HID::DeviceIndex::RightIndex].latest_vibration_value = |
| 106 | DEFAULT_VIBRATION_VALUE; | ||
| 106 | Core::HID::ControllerUpdateCallback engine_callback{ | 107 | Core::HID::ControllerUpdateCallback engine_callback{ |
| 107 | .on_change = [this, | 108 | .on_change = [this, |
| 108 | i](Core::HID::ControllerTriggerType type) { ControllerUpdate(type, i); }, | 109 | i](Core::HID::ControllerTriggerType type) { ControllerUpdate(type, i); }, |
| @@ -285,9 +286,12 @@ void Controller_NPad::OnInit() { | |||
| 285 | auto& npad = controller.shared_memory_entry; | 286 | auto& npad = controller.shared_memory_entry; |
| 286 | npad.fullkey_color = { | 287 | npad.fullkey_color = { |
| 287 | .attribute = ColorAttribute::NoController, | 288 | .attribute = ColorAttribute::NoController, |
| 289 | .fullkey = {}, | ||
| 288 | }; | 290 | }; |
| 289 | npad.joycon_color = { | 291 | npad.joycon_color = { |
| 290 | .attribute = ColorAttribute::NoController, | 292 | .attribute = ColorAttribute::NoController, |
| 293 | .left = {}, | ||
| 294 | .right = {}, | ||
| 291 | }; | 295 | }; |
| 292 | // HW seems to initialize the first 19 entries | 296 | // HW seems to initialize the first 19 entries |
| 293 | for (std::size_t i = 0; i < 19; ++i) { | 297 | for (std::size_t i = 0; i < 19; ++i) { |
| @@ -907,9 +911,12 @@ void Controller_NPad::DisconnectNpadAtIndex(std::size_t npad_index) { | |||
| 907 | shared_memory_entry.battery_level_right = 0; | 911 | shared_memory_entry.battery_level_right = 0; |
| 908 | shared_memory_entry.fullkey_color = { | 912 | shared_memory_entry.fullkey_color = { |
| 909 | .attribute = ColorAttribute::NoController, | 913 | .attribute = ColorAttribute::NoController, |
| 914 | .fullkey = {}, | ||
| 910 | }; | 915 | }; |
| 911 | shared_memory_entry.joycon_color = { | 916 | shared_memory_entry.joycon_color = { |
| 912 | .attribute = ColorAttribute::NoController, | 917 | .attribute = ColorAttribute::NoController, |
| 918 | .left = {}, | ||
| 919 | .right = {}, | ||
| 913 | }; | 920 | }; |
| 914 | shared_memory_entry.assignment_mode = NpadJoyAssignmentMode::Dual; | 921 | shared_memory_entry.assignment_mode = NpadJoyAssignmentMode::Dual; |
| 915 | shared_memory_entry.footer_type = AppletFooterUiType::None; | 922 | shared_memory_entry.footer_type = AppletFooterUiType::None; |