diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-18 04:22:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 04:22:06 +0100 |
commit | e7146309dec4fab504977186571228571efed009 (patch) | |
tree | b1302cb237f91c5f0ccb9863a0b0a2fb427a3c14 /src/hid_core/frontend/emulated_controller.cpp | |
parent | Merge pull request #13017 from liamwhite/suspension (diff) | |
parent | android: Input mapping (diff) | |
download | yuzu-e7146309dec4fab504977186571228571efed009.tar yuzu-e7146309dec4fab504977186571228571efed009.tar.gz yuzu-e7146309dec4fab504977186571228571efed009.tar.bz2 yuzu-e7146309dec4fab504977186571228571efed009.tar.lz yuzu-e7146309dec4fab504977186571228571efed009.tar.xz yuzu-e7146309dec4fab504977186571228571efed009.tar.zst yuzu-e7146309dec4fab504977186571228571efed009.zip |
Diffstat (limited to 'src/hid_core/frontend/emulated_controller.cpp')
-rw-r--r-- | src/hid_core/frontend/emulated_controller.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index 819460eb5..3fa06d188 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp @@ -176,16 +176,19 @@ void EmulatedController::LoadDevices() { camera_params[1] = Common::ParamPackage{"engine:camera,camera:1"}; ring_params[1] = Common::ParamPackage{"engine:joycon,axis_x:100,axis_y:101"}; nfc_params[0] = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"}; + android_params = Common::ParamPackage{"engine:android,port:100"}; } output_params[LeftIndex] = left_joycon; output_params[RightIndex] = right_joycon; output_params[2] = camera_params[1]; output_params[3] = nfc_params[0]; + output_params[4] = android_params; output_params[LeftIndex].Set("output", true); output_params[RightIndex].Set("output", true); output_params[2].Set("output", true); output_params[3].Set("output", true); + output_params[4].Set("output", true); LoadTASParams(); LoadVirtualGamepadParams(); @@ -578,6 +581,9 @@ void EmulatedController::DisableConfiguration() { // Get Joycon colors before turning on the controller for (const auto& color_device : color_devices) { + if (color_device == nullptr) { + continue; + } color_device->ForceUpdate(); } @@ -1277,6 +1283,10 @@ bool EmulatedController::SetVibration(DeviceIndex device_index, const VibrationV .high_frequency = vibration.high_frequency, .type = type, }; + + // Send vibrations to Android's input overlay + output_devices[4]->SetVibration(status); + return output_devices[index]->SetVibration(status) == Common::Input::DriverResult::Success; } |