diff options
author | german77 <juangerman-13@hotmail.com> | 2022-12-26 19:49:49 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-20 01:05:22 +0100 |
commit | 5cb437703fa441a08db295f8a916caedc3a581f2 (patch) | |
tree | 148c35e47d18462f0b8f8e116e2247b4cbfdbde2 /src/core | |
parent | input_common: Use DriverResult on all engines (diff) | |
download | yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.gz yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.bz2 yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.lz yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.xz yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.zst yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 10 | ||||
-rw-r--r-- | src/core/hid/emulated_controller.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/nfc/nfc_device.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/service/nfp/nfp_device.cpp | 3 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 62da5be6c..915ffa490 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -1200,7 +1200,8 @@ bool EmulatedController::IsVibrationEnabled(std::size_t device_index) { return output_devices[device_index]->IsVibrationEnabled(); } -bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) { +Common::Input::DriverResult EmulatedController::SetPollingMode( + Common::Input::PollingMode polling_mode) { LOG_INFO(Service_HID, "Set polling mode {}", polling_mode); auto& output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)]; auto& nfc_output_device = output_devices[3]; @@ -1208,8 +1209,11 @@ bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode); const auto mapped_nfc_result = output_device->SetPollingMode(polling_mode); - return virtual_nfc_result == Common::Input::DriverResult::Success || - mapped_nfc_result == Common::Input::DriverResult::Success; + if (virtual_nfc_result == Common::Input::DriverResult::Success) { + return virtual_nfc_result; + } + + return mapped_nfc_result; } bool EmulatedController::SetCameraFormat( diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index c517aa5d7..fb931fc0a 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -363,9 +363,9 @@ public: /** * Sets the desired data to be polled from a controller * @param polling_mode type of input desired buttons, gyro, nfc, ir, etc. - * @return true if SetPollingMode was successfull + * @return driver result from this command */ - bool SetPollingMode(Common::Input::PollingMode polling_mode); + Common::Input::DriverResult SetPollingMode(Common::Input::PollingMode polling_mode); /** * Sets the desired camera format to be polled from a controller diff --git a/src/core/hle/service/nfc/nfc_device.cpp b/src/core/hle/service/nfc/nfc_device.cpp index 78578f723..c9815edbc 100644 --- a/src/core/hle/service/nfc/nfc_device.cpp +++ b/src/core/hle/service/nfc/nfc_device.cpp @@ -130,7 +130,8 @@ Result NfcDevice::StartDetection(NFP::TagProtocol allowed_protocol) { return WrongDeviceState; } - if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) { + if (npad_device->SetPollingMode(Common::Input::PollingMode::NFC) != + Common::Input::DriverResult::Success) { LOG_ERROR(Service_NFC, "Nfc not supported"); return NfcDisabled; } diff --git a/src/core/hle/service/nfp/nfp_device.cpp b/src/core/hle/service/nfp/nfp_device.cpp index c860fd1a1..7b8013961 100644 --- a/src/core/hle/service/nfp/nfp_device.cpp +++ b/src/core/hle/service/nfp/nfp_device.cpp @@ -152,7 +152,8 @@ Result NfpDevice::StartDetection(TagProtocol allowed_protocol) { return WrongDeviceState; } - if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) { + if (npad_device->SetPollingMode(Common::Input::PollingMode::NFC) != + Common::Input::DriverResult::Success) { LOG_ERROR(Service_NFP, "Nfc not supported"); return NfcDisabled; } |