diff options
| author | 2021-12-29 22:15:08 -0600 | |
|---|---|---|
| committer | 2021-12-29 22:51:53 -0600 | |
| commit | 9ee5c4ec5629c185d29dd41468047004acef2e29 (patch) | |
| tree | 997dd6a3916e3bd84cf5a109421d18f72d678fc4 /src/core/hid/emulated_controller.cpp | |
| parent | Merge pull request #7620 from bunnei/kernel-thread-x18 (diff) | |
| download | yuzu-9ee5c4ec5629c185d29dd41468047004acef2e29.tar.gz yuzu-9ee5c4ec5629c185d29dd41468047004acef2e29.tar.xz yuzu-9ee5c4ec5629c185d29dd41468047004acef2e29.zip | |
core/hid: Fix controller type validation
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index ff9d7a7e3..2d3fce276 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -886,8 +886,9 @@ void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles) | |||
| 886 | } | 886 | } |
| 887 | } | 887 | } |
| 888 | 888 | ||
| 889 | bool EmulatedController::IsControllerSupported() const { | 889 | bool EmulatedController::IsControllerSupported(bool use_temporary_value) const { |
| 890 | switch (npad_type) { | 890 | const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; |
| 891 | switch (type) { | ||
| 891 | case NpadStyleIndex::ProController: | 892 | case NpadStyleIndex::ProController: |
| 892 | return supported_style_tag.fullkey; | 893 | return supported_style_tag.fullkey; |
| 893 | case NpadStyleIndex::Handheld: | 894 | case NpadStyleIndex::Handheld: |
| @@ -915,9 +916,10 @@ bool EmulatedController::IsControllerSupported() const { | |||
| 915 | } | 916 | } |
| 916 | } | 917 | } |
| 917 | 918 | ||
| 918 | void EmulatedController::Connect() { | 919 | void EmulatedController::Connect(bool use_temporary_value) { |
| 919 | if (!IsControllerSupported()) { | 920 | if (!IsControllerSupported(use_temporary_value)) { |
| 920 | LOG_ERROR(Service_HID, "Controller type {} is not supported", npad_type); | 921 | const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; |
| 922 | LOG_ERROR(Service_HID, "Controller type {} is not supported", type); | ||
| 921 | return; | 923 | return; |
| 922 | } | 924 | } |
| 923 | { | 925 | { |