summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2023-01-13 13:39:33 -0600
committerGravatar Narr the Reg2023-01-19 18:05:23 -0600
commit4a307a7b3aa3afea7d62674f6cf40b76f3ffb5e3 (patch)
treec104ff9a8a48cf29fd3dc67c84f5af71224744f7 /src/core/hid/emulated_controller.cpp
parentinput_common: Drop Pro controller support from custom driver (diff)
downloadyuzu-4a307a7b3aa3afea7d62674f6cf40b76f3ffb5e3.tar.gz
yuzu-4a307a7b3aa3afea7d62674f6cf40b76f3ffb5e3.tar.xz
yuzu-4a307a7b3aa3afea7d62674f6cf40b76f3ffb5e3.zip
core: hid: Only set the polling mode to the correct side
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index faf9e7c4e..f83abad05 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -1208,19 +1208,31 @@ bool EmulatedController::IsVibrationEnabled(std::size_t device_index) {
1208} 1208}
1209 1209
1210Common::Input::DriverResult EmulatedController::SetPollingMode( 1210Common::Input::DriverResult EmulatedController::SetPollingMode(
1211 Common::Input::PollingMode polling_mode) { 1211 EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) {
1212 LOG_INFO(Service_HID, "Set polling mode {}", polling_mode); 1212 LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index);
1213 auto& output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)]; 1213
1214 auto& left_output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Left)];
1215 auto& right_output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)];
1214 auto& nfc_output_device = output_devices[3]; 1216 auto& nfc_output_device = output_devices[3];
1215 1217
1216 const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode); 1218 if (device_index == EmulatedDeviceIndex::LeftIndex) {
1217 const auto mapped_nfc_result = output_device->SetPollingMode(polling_mode); 1219 return left_output_device->SetPollingMode(polling_mode);
1220 }
1218 1221
1219 if (virtual_nfc_result == Common::Input::DriverResult::Success) { 1222 if (device_index == EmulatedDeviceIndex::RightIndex) {
1220 return virtual_nfc_result; 1223 const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode);
1224 const auto mapped_nfc_result = right_output_device->SetPollingMode(polling_mode);
1225
1226 if (virtual_nfc_result == Common::Input::DriverResult::Success) {
1227 return virtual_nfc_result;
1228 }
1229 return mapped_nfc_result;
1221 } 1230 }
1222 1231
1223 return mapped_nfc_result; 1232 left_output_device->SetPollingMode(polling_mode);
1233 right_output_device->SetPollingMode(polling_mode);
1234 nfc_output_device->SetPollingMode(polling_mode);
1235 return Common::Input::DriverResult::Success;
1224} 1236}
1225 1237
1226bool EmulatedController::SetCameraFormat( 1238bool EmulatedController::SetCameraFormat(