diff options
| author | 2021-10-31 10:41:44 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:26 -0600 | |
| commit | 730f07830247cfcdc551c253d30c6717fc16316c (patch) | |
| tree | 9a0d7dbee51ad20e4a174c1be08816289a586d6a /src/core/hid | |
| parent | kraken: Address comments from review (diff) | |
| download | yuzu-730f07830247cfcdc551c253d30c6717fc16316c.tar.gz yuzu-730f07830247cfcdc551c253d30c6717fc16316c.tar.xz yuzu-730f07830247cfcdc551c253d30c6717fc16316c.zip | |
settings: Fix Debug controller type options
Diffstat (limited to 'src/core/hid')
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 3 | ||||
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 11 | ||||
| -rw-r--r-- | src/core/hid/input_converter.cpp | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index c259de0f1..012909954 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -166,9 +166,10 @@ void EmulatedConsole::SetTouch(Common::Input::CallbackStatus callback, | |||
| 166 | return; | 166 | return; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | // TODO(german77): Remap touch id in sequential order | ||
| 169 | console.touch_state[index] = { | 170 | console.touch_state[index] = { |
| 170 | .position = {console.touch_values[index].x.value, console.touch_values[index].y.value}, | 171 | .position = {console.touch_values[index].x.value, console.touch_values[index].y.value}, |
| 171 | .id = console.touch_values[index].id, | 172 | .id = static_cast<u32>(console.touch_values[index].id), |
| 172 | .pressed = console.touch_values[index].pressed.value, | 173 | .pressed = console.touch_values[index].pressed.value, |
| 173 | }; | 174 | }; |
| 174 | 175 | ||
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 49893cdbd..9a1864279 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -77,7 +77,12 @@ void EmulatedController::ReloadFromSettings() { | |||
| 77 | 77 | ||
| 78 | controller.colors_state.fullkey = controller.colors_state.left; | 78 | controller.colors_state.fullkey = controller.colors_state.left; |
| 79 | 79 | ||
| 80 | SetNpadType(MapSettingsTypeToNPad(player.controller_type)); | 80 | // Other or debug controller should always be a pro controller |
| 81 | if (npad_id_type != NpadIdType::Other) { | ||
| 82 | SetNpadType(MapSettingsTypeToNPad(player.controller_type)); | ||
| 83 | } else { | ||
| 84 | SetNpadType(NpadType::ProController); | ||
| 85 | } | ||
| 81 | 86 | ||
| 82 | if (player.connected) { | 87 | if (player.connected) { |
| 83 | Connect(); | 88 | Connect(); |
| @@ -606,12 +611,12 @@ void EmulatedController::SetTrigger(Common::Input::CallbackStatus callback, std: | |||
| 606 | switch (index) { | 611 | switch (index) { |
| 607 | case Settings::NativeTrigger::LTrigger: | 612 | case Settings::NativeTrigger::LTrigger: |
| 608 | controller.gc_trigger_state.left = static_cast<s32>(trigger.analog.value * HID_TRIGGER_MAX); | 613 | controller.gc_trigger_state.left = static_cast<s32>(trigger.analog.value * HID_TRIGGER_MAX); |
| 609 | controller.npad_button_state.zl.Assign(trigger.pressed); | 614 | controller.npad_button_state.zl.Assign(trigger.pressed.value); |
| 610 | break; | 615 | break; |
| 611 | case Settings::NativeTrigger::RTrigger: | 616 | case Settings::NativeTrigger::RTrigger: |
| 612 | controller.gc_trigger_state.right = | 617 | controller.gc_trigger_state.right = |
| 613 | static_cast<s32>(trigger.analog.value * HID_TRIGGER_MAX); | 618 | static_cast<s32>(trigger.analog.value * HID_TRIGGER_MAX); |
| 614 | controller.npad_button_state.zr.Assign(trigger.pressed); | 619 | controller.npad_button_state.zr.Assign(trigger.pressed.value); |
| 615 | break; | 620 | break; |
| 616 | } | 621 | } |
| 617 | 622 | ||
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index 14204917e..5b123bd3a 100644 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp | |||
| @@ -53,7 +53,7 @@ Common::Input::ButtonStatus TransformToButton(const Common::Input::CallbackStatu | |||
| 53 | switch (callback.type) { | 53 | switch (callback.type) { |
| 54 | case Common::Input::InputType::Analog: | 54 | case Common::Input::InputType::Analog: |
| 55 | case Common::Input::InputType::Trigger: | 55 | case Common::Input::InputType::Trigger: |
| 56 | status.value = TransformToTrigger(callback).pressed; | 56 | status.value = TransformToTrigger(callback).pressed.value; |
| 57 | break; | 57 | break; |
| 58 | case Common::Input::InputType::Button: | 58 | case Common::Input::InputType::Button: |
| 59 | status = callback.button_status; | 59 | status = callback.button_status; |
| @@ -222,7 +222,7 @@ Common::Input::TriggerStatus TransformToTrigger(const Common::Input::CallbackSta | |||
| 222 | 222 | ||
| 223 | // Set button status | 223 | // Set button status |
| 224 | if (calculate_button_value) { | 224 | if (calculate_button_value) { |
| 225 | status.pressed = value > properties.threshold; | 225 | status.pressed.value = value > properties.threshold; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | // Adjust if value is inverted | 228 | // Adjust if value is inverted |