From bc938ce630def96e532fe902ba43341f90dab70c Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 9 Feb 2021 02:24:33 +0100 Subject: [PATCH] dualsense: implement player LEDs --- rpcs3/Emu/Io/PadHandler.h | 3 +++ rpcs3/Input/dualsense_pad_handler.cpp | 14 +++++++++++++- rpcs3/Input/pad_thread.cpp | 1 + rpcs3/rpcs3qt/tooltips.h | 6 +++--- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index 887123fddf..081960287a 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -68,6 +68,7 @@ protected: std::array last_connection_status{{ false, false, false, false, false, false, false }}; std::string m_name_string; + u32 m_player_id = 0; usz m_max_devices = 0; int m_trigger_threshold = 0; int m_thumb_threshold = 0; @@ -145,6 +146,8 @@ public: bool has_led() const; bool has_battery() const; + void set_player(u32 player_id) { m_player_id = player_id; } + static std::string get_config_dir(pad_handler type, const std::string& title_id = ""); static std::string get_config_filename(int i, const std::string& title_id = ""); diff --git a/rpcs3/Input/dualsense_pad_handler.cpp b/rpcs3/Input/dualsense_pad_handler.cpp index e0c5d3c43f..bf0c94ba72 100644 --- a/rpcs3/Input/dualsense_pad_handler.cpp +++ b/rpcs3/Input/dualsense_pad_handler.cpp @@ -954,7 +954,19 @@ int dualsense_pad_handler::send_output_report(const std::shared_ptrbtCon) diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index b433762392..f39b2259bc 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -145,6 +145,7 @@ void pad_thread::Init() } handlers.emplace(handler_type, cur_pad_handler); } + cur_pad_handler->set_player(i); cur_pad_handler->Init(); m_pads[i] = std::make_shared(CELL_PAD_STATUS_DISCONNECTED, pad_settings[i].device_capability, pad_settings[i].device_type); diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index 1d4ce81e13..364858c464 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -211,9 +211,9 @@ public: const QString ds4_windows = tr("If you have any issues with the DualShock 4 handler, it might be caused by third-party tools such as DS4Windows. It's recommended that you disable them while using this handler."); const QString ds4_linux = tr("In order to use the DualShock 4 handler, you might need to add udev rules to let RPCS3 access the controller.
See the RPCS3 Wiki for instructions."); const QString ds4_other = tr("The DualShock 4 handler is recommended for official DualShock 4 controllers."); - const QString dualsense_windows = tr("The DualSense handler is recommended for official DualSense controllers.

Player LEDs and battery settings are not supported yet."); - const QString dualsense_linux = tr("The DualSense handler is recommended for official DualSense controllers.

Player LEDs and battery settings are not supported yet."); - const QString dualsense_other = tr("The DualSense handler is recommended for official DualSense controllers.

Player LEDs and battery settings are not supported yet."); + const QString dualsense_windows = tr("The DualSense handler is recommended for official DualSense controllers.

Battery settings are not supported yet."); + const QString dualsense_linux = tr("The DualSense handler is recommended for official DualSense controllers.

Battery settings are not supported yet."); + const QString dualsense_other = tr("The DualSense handler is recommended for official DualSense controllers.

Battery settings are not supported yet."); const QString xinput = tr("The XInput handler will work with Xbox controllers and many third-party PC-compatible controllers. Pressure sensitive buttons from SCP are supported when SCP's XInput1_3.dll is placed in the main RPCS3 directory. For more details, see the RPCS3 Wiki."); const QString evdev = tr("The evdev handler should work with any controller that has linux support.
If your joystick is not being centered properly, read the RPCS3 Wiki for instructions."); const QString mmjoy = tr("The MMJoystick handler should work with almost any controller recognized by Windows. However, it is recommended that you use the more specific handlers if you have a controller that supports them.");