summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar german772022-12-26 12:49:49 -0600
committerGravatar Narr the Reg2023-01-19 18:05:22 -0600
commit5cb437703fa441a08db295f8a916caedc3a581f2 (patch)
tree148c35e47d18462f0b8f8e116e2247b4cbfdbde2 /src/core
parentinput_common: Use DriverResult on all engines (diff)
downloadyuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.gz
yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.tar.xz
yuzu-5cb437703fa441a08db295f8a916caedc3a581f2.zip
yuzu: Add ring controller test button
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hid/emulated_controller.cpp10
-rw-r--r--src/core/hid/emulated_controller.h4
-rw-r--r--src/core/hle/service/nfc/nfc_device.cpp3
-rw-r--r--src/core/hle/service/nfp/nfp_device.cpp3
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) {
1200 return output_devices[device_index]->IsVibrationEnabled(); 1200 return output_devices[device_index]->IsVibrationEnabled();
1201} 1201}
1202 1202
1203bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) { 1203Common::Input::DriverResult EmulatedController::SetPollingMode(
1204 Common::Input::PollingMode polling_mode) {
1204 LOG_INFO(Service_HID, "Set polling mode {}", polling_mode); 1205 LOG_INFO(Service_HID, "Set polling mode {}", polling_mode);
1205 auto& output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)]; 1206 auto& output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)];
1206 auto& nfc_output_device = output_devices[3]; 1207 auto& nfc_output_device = output_devices[3];
@@ -1208,8 +1209,11 @@ bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode)
1208 const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode); 1209 const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode);
1209 const auto mapped_nfc_result = output_device->SetPollingMode(polling_mode); 1210 const auto mapped_nfc_result = output_device->SetPollingMode(polling_mode);
1210 1211
1211 return virtual_nfc_result == Common::Input::DriverResult::Success || 1212 if (virtual_nfc_result == Common::Input::DriverResult::Success) {
1212 mapped_nfc_result == Common::Input::DriverResult::Success; 1213 return virtual_nfc_result;
1214 }
1215
1216 return mapped_nfc_result;
1213} 1217}
1214 1218
1215bool EmulatedController::SetCameraFormat( 1219bool 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:
363 /** 363 /**
364 * Sets the desired data to be polled from a controller 364 * Sets the desired data to be polled from a controller
365 * @param polling_mode type of input desired buttons, gyro, nfc, ir, etc. 365 * @param polling_mode type of input desired buttons, gyro, nfc, ir, etc.
366 * @return true if SetPollingMode was successfull 366 * @return driver result from this command
367 */ 367 */
368 bool SetPollingMode(Common::Input::PollingMode polling_mode); 368 Common::Input::DriverResult SetPollingMode(Common::Input::PollingMode polling_mode);
369 369
370 /** 370 /**
371 * Sets the desired camera format to be polled from a controller 371 * 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) {
130 return WrongDeviceState; 130 return WrongDeviceState;
131 } 131 }
132 132
133 if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) { 133 if (npad_device->SetPollingMode(Common::Input::PollingMode::NFC) !=
134 Common::Input::DriverResult::Success) {
134 LOG_ERROR(Service_NFC, "Nfc not supported"); 135 LOG_ERROR(Service_NFC, "Nfc not supported");
135 return NfcDisabled; 136 return NfcDisabled;
136 } 137 }
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) {
152 return WrongDeviceState; 152 return WrongDeviceState;
153 } 153 }
154 154
155 if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) { 155 if (npad_device->SetPollingMode(Common::Input::PollingMode::NFC) !=
156 Common::Input::DriverResult::Success) {
156 LOG_ERROR(Service_NFP, "Nfc not supported"); 157 LOG_ERROR(Service_NFP, "Nfc not supported");
157 return NfcDisabled; 158 return NfcDisabled;
158 } 159 }