diff options
author | bunnei <bunneidev@gmail.com> | 2021-12-31 01:54:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-31 01:54:35 +0100 |
commit | 667a8ae163681f68d90010bc7dd05eb7398524d6 (patch) | |
tree | dea803db312fc0e36c5ed2c9000cacf3bd4df7c3 /src/core/hid/emulated_controller.cpp | |
parent | Merge pull request #7635 from bunnei/set-heap-size (diff) | |
parent | core/hid: Fix controller type validation (diff) | |
download | yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar.gz yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar.bz2 yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar.lz yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar.xz yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.tar.zst yuzu-667a8ae163681f68d90010bc7dd05eb7398524d6.zip |
Diffstat (limited to '')
-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) } } -bool EmulatedController::IsControllerSupported() const { - switch (npad_type) { +bool EmulatedController::IsControllerSupported(bool use_temporary_value) const { + const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; + switch (type) { case NpadStyleIndex::ProController: return supported_style_tag.fullkey; case NpadStyleIndex::Handheld: @@ -915,9 +916,10 @@ bool EmulatedController::IsControllerSupported() const { } } -void EmulatedController::Connect() { - if (!IsControllerSupported()) { - LOG_ERROR(Service_HID, "Controller type {} is not supported", npad_type); +void EmulatedController::Connect(bool use_temporary_value) { + if (!IsControllerSupported(use_temporary_value)) { + const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; + LOG_ERROR(Service_HID, "Controller type {} is not supported", type); return; } { |