diff options
| author | 2023-07-02 19:21:16 -0600 | |
|---|---|---|
| committer | 2023-07-02 19:21:16 -0600 | |
| commit | 9cd698e8ad584a199048f072ed65986ee10ba31a (patch) | |
| tree | 2959ccd4fd535565d4b7aa28d289ca3ecce461fa /src/core/hid/emulated_controller.cpp | |
| parent | Merge pull request #10998 from Morph1984/qt-stop-messing-with-me (diff) | |
| download | yuzu-9cd698e8ad584a199048f072ed65986ee10ba31a.tar.gz yuzu-9cd698e8ad584a199048f072ed65986ee10ba31a.tar.xz yuzu-9cd698e8ad584a199048f072ed65986ee10ba31a.zip | |
service: nfc: Ensure controller is in the correct mode
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 1ebc32c1e..94bd656fe 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -1243,10 +1243,12 @@ Common::Input::DriverResult EmulatedController::SetPollingMode( | |||
| 1243 | auto& nfc_output_device = output_devices[3]; | 1243 | auto& nfc_output_device = output_devices[3]; |
| 1244 | 1244 | ||
| 1245 | if (device_index == EmulatedDeviceIndex::LeftIndex) { | 1245 | if (device_index == EmulatedDeviceIndex::LeftIndex) { |
| 1246 | controller.left_polling_mode = polling_mode; | ||
| 1246 | return left_output_device->SetPollingMode(polling_mode); | 1247 | return left_output_device->SetPollingMode(polling_mode); |
| 1247 | } | 1248 | } |
| 1248 | 1249 | ||
| 1249 | if (device_index == EmulatedDeviceIndex::RightIndex) { | 1250 | if (device_index == EmulatedDeviceIndex::RightIndex) { |
| 1251 | controller.right_polling_mode = polling_mode; | ||
| 1250 | const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode); | 1252 | const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode); |
| 1251 | const auto mapped_nfc_result = right_output_device->SetPollingMode(polling_mode); | 1253 | const auto mapped_nfc_result = right_output_device->SetPollingMode(polling_mode); |
| 1252 | 1254 | ||
| @@ -1261,12 +1263,22 @@ Common::Input::DriverResult EmulatedController::SetPollingMode( | |||
| 1261 | return mapped_nfc_result; | 1263 | return mapped_nfc_result; |
| 1262 | } | 1264 | } |
| 1263 | 1265 | ||
| 1266 | controller.left_polling_mode = polling_mode; | ||
| 1267 | controller.right_polling_mode = polling_mode; | ||
| 1264 | left_output_device->SetPollingMode(polling_mode); | 1268 | left_output_device->SetPollingMode(polling_mode); |
| 1265 | right_output_device->SetPollingMode(polling_mode); | 1269 | right_output_device->SetPollingMode(polling_mode); |
| 1266 | nfc_output_device->SetPollingMode(polling_mode); | 1270 | nfc_output_device->SetPollingMode(polling_mode); |
| 1267 | return Common::Input::DriverResult::Success; | 1271 | return Common::Input::DriverResult::Success; |
| 1268 | } | 1272 | } |
| 1269 | 1273 | ||
| 1274 | Common::Input::PollingMode EmulatedController::GetPollingMode( | ||
| 1275 | EmulatedDeviceIndex device_index) const { | ||
| 1276 | if (device_index == EmulatedDeviceIndex::LeftIndex) { | ||
| 1277 | return controller.left_polling_mode; | ||
| 1278 | } | ||
| 1279 | return controller.right_polling_mode; | ||
| 1280 | } | ||
| 1281 | |||
| 1270 | bool EmulatedController::SetCameraFormat( | 1282 | bool EmulatedController::SetCameraFormat( |
| 1271 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { | 1283 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { |
| 1272 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); | 1284 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); |