diff options
author | t895 <clombardo169@gmail.com> | 2024-02-17 03:09:42 +0100 |
---|---|---|
committer | t895 <clombardo169@gmail.com> | 2024-02-17 03:09:42 +0100 |
commit | 18494b0ad6b62bf0de677b8e443edd6c86804eca (patch) | |
tree | ebfc7881516553576e879e93b6898be2e65e904e /src/hid_core | |
parent | config: Reset per-game profile name on load if empty (diff) | |
download | yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.gz yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.bz2 yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.lz yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.xz yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.tar.zst yuzu-18494b0ad6b62bf0de677b8e443edd6c86804eca.zip |
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() { 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(); @@ -1277,6 +1280,12 @@ bool EmulatedController::SetVibration(DeviceIndex device_index, const VibrationV .high_frequency = vibration.high_frequency, .type = type, }; + + // Send vibrations to Android's input overlay + if (npad_id_type == NpadIdType::Handheld || npad_id_type == NpadIdType::Player1) { + output_devices[4]->SetVibration(status); + } + return output_devices[index]->SetVibration(status) == Common::Input::DriverResult::Success; } 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 @@ namespace Core::HID { const std::size_t max_emulated_controllers = 2; -const std::size_t output_devices_size = 4; +const std::size_t output_devices_size = 5; struct ControllerMotionInfo { Common::Input::MotionStatus raw_status{}; MotionInput emulated{}; @@ -597,6 +597,7 @@ private: CameraParams camera_params; RingAnalogParams ring_params; NfcParams nfc_params; + Common::ParamPackage android_params; OutputParams output_params; ButtonDevices button_devices; |