diff options
| author | 2024-02-16 21:09:42 -0500 | |
|---|---|---|
| committer | 2024-02-16 21:09:42 -0500 | |
| commit | 18494b0ad6b62bf0de677b8e443edd6c86804eca (patch) | |
| tree | ebfc7881516553576e879e93b6898be2e65e904e /src/hid_core | |
| parent | config: Reset per-game profile name on load if empty (diff) | |
| download | yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.gz yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.xz yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.zip | |
hid_core: Use dedicated "port" for android's input overlay
Diffstat (limited to 'src/hid_core')
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.cpp | 9 | ||||
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index 819460eb5..b4b6fa7c8 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp | |||
| @@ -176,16 +176,19 @@ void EmulatedController::LoadDevices() { | |||
| 176 | camera_params[1] = Common::ParamPackage{"engine:camera,camera:1"}; | 176 | camera_params[1] = Common::ParamPackage{"engine:camera,camera:1"}; |
| 177 | ring_params[1] = Common::ParamPackage{"engine:joycon,axis_x:100,axis_y:101"}; | 177 | ring_params[1] = Common::ParamPackage{"engine:joycon,axis_x:100,axis_y:101"}; |
| 178 | nfc_params[0] = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"}; | 178 | nfc_params[0] = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"}; |
| 179 | android_params = Common::ParamPackage{"engine:android,port:100"}; | ||
| 179 | } | 180 | } |
| 180 | 181 | ||
| 181 | output_params[LeftIndex] = left_joycon; | 182 | output_params[LeftIndex] = left_joycon; |
| 182 | output_params[RightIndex] = right_joycon; | 183 | output_params[RightIndex] = right_joycon; |
| 183 | output_params[2] = camera_params[1]; | 184 | output_params[2] = camera_params[1]; |
| 184 | output_params[3] = nfc_params[0]; | 185 | output_params[3] = nfc_params[0]; |
| 186 | output_params[4] = android_params; | ||
| 185 | output_params[LeftIndex].Set("output", true); | 187 | output_params[LeftIndex].Set("output", true); |
| 186 | output_params[RightIndex].Set("output", true); | 188 | output_params[RightIndex].Set("output", true); |
| 187 | output_params[2].Set("output", true); | 189 | output_params[2].Set("output", true); |
| 188 | output_params[3].Set("output", true); | 190 | output_params[3].Set("output", true); |
| 191 | output_params[4].Set("output", true); | ||
| 189 | 192 | ||
| 190 | LoadTASParams(); | 193 | LoadTASParams(); |
| 191 | LoadVirtualGamepadParams(); | 194 | LoadVirtualGamepadParams(); |
| @@ -1277,6 +1280,12 @@ bool EmulatedController::SetVibration(DeviceIndex device_index, const VibrationV | |||
| 1277 | .high_frequency = vibration.high_frequency, | 1280 | .high_frequency = vibration.high_frequency, |
| 1278 | .type = type, | 1281 | .type = type, |
| 1279 | }; | 1282 | }; |
| 1283 | |||
| 1284 | // Send vibrations to Android's input overlay | ||
| 1285 | if (npad_id_type == NpadIdType::Handheld || npad_id_type == NpadIdType::Player1) { | ||
| 1286 | output_devices[4]->SetVibration(status); | ||
| 1287 | } | ||
| 1288 | |||
| 1280 | return output_devices[index]->SetVibration(status) == Common::Input::DriverResult::Success; | 1289 | return output_devices[index]->SetVibration(status) == Common::Input::DriverResult::Success; |
| 1281 | } | 1290 | } |
| 1282 | 1291 | ||
diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 701b38300..ab3c6fcd3 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | namespace Core::HID { | 22 | namespace Core::HID { |
| 23 | const std::size_t max_emulated_controllers = 2; | 23 | const std::size_t max_emulated_controllers = 2; |
| 24 | const std::size_t output_devices_size = 4; | 24 | const std::size_t output_devices_size = 5; |
| 25 | struct ControllerMotionInfo { | 25 | struct ControllerMotionInfo { |
| 26 | Common::Input::MotionStatus raw_status{}; | 26 | Common::Input::MotionStatus raw_status{}; |
| 27 | MotionInput emulated{}; | 27 | MotionInput emulated{}; |
| @@ -597,6 +597,7 @@ private: | |||
| 597 | CameraParams camera_params; | 597 | CameraParams camera_params; |
| 598 | RingAnalogParams ring_params; | 598 | RingAnalogParams ring_params; |
| 599 | NfcParams nfc_params; | 599 | NfcParams nfc_params; |
| 600 | Common::ParamPackage android_params; | ||
| 600 | OutputParams output_params; | 601 | OutputParams output_params; |
| 601 | 602 | ||
| 602 | ButtonDevices button_devices; | 603 | ButtonDevices button_devices; |