1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00

Dualsense: Release LEDs on when the handler is destroyed

This commit is contained in:
Megamouse 2022-10-22 01:58:45 +02:00
parent 3320d1e1c7
commit 615ff08d1a
2 changed files with 8 additions and 1 deletions

View File

@ -913,6 +913,7 @@ dualsense_pad_handler::~dualsense_pad_handler()
// Disable vibration // Disable vibration
controller.second->small_motor = 0; controller.second->small_motor = 0;
controller.second->large_motor = 0; controller.second->large_motor = 0;
controller.second->release_leds = true;
send_output_report(controller.second.get()); send_output_report(controller.second.get());
} }
} }
@ -939,6 +940,11 @@ int dualsense_pad_handler::send_output_report(DualSenseDevice* device)
common.valid_flag_2 |= VALID_FLAG_2_LIGHTBAR_SETUP_CONTROL_ENABLE; common.valid_flag_2 |= VALID_FLAG_2_LIGHTBAR_SETUP_CONTROL_ENABLE;
common.lightbar_setup = LIGHTBAR_SETUP_LIGHT_OUT; // Fade light out. common.lightbar_setup = LIGHTBAR_SETUP_LIGHT_OUT; // Fade light out.
} }
else if (device->release_leds)
{
common.valid_flag_1 |= VALID_FLAG_1_RELEASE_LEDS;
device->release_leds = false;
}
else else
{ {
common.valid_flag_0 |= VALID_FLAG_0_COMPATIBLE_VIBRATION; common.valid_flag_0 |= VALID_FLAG_0_COMPATIBLE_VIBRATION;
@ -1109,7 +1115,7 @@ void dualsense_pad_handler::apply_pad_data(const pad_ensemble& binding)
dualsense_dev->update_player_leds = true; dualsense_dev->update_player_leds = true;
} }
dualsense_dev->new_output_data |= dualsense_dev->update_player_leds || dualsense_dev->update_lightbar || dualsense_dev->large_motor != speed_large || dualsense_dev->small_motor != speed_small; dualsense_dev->new_output_data |= dualsense_dev->release_leds || dualsense_dev->update_player_leds || dualsense_dev->update_lightbar || dualsense_dev->large_motor != speed_large || dualsense_dev->small_motor != speed_small;
dualsense_dev->large_motor = speed_large; dualsense_dev->large_motor = speed_large;
dualsense_dev->small_motor = speed_small; dualsense_dev->small_motor = speed_small;

View File

@ -21,6 +21,7 @@ public:
bool init_lightbar{true}; bool init_lightbar{true};
bool update_lightbar{true}; bool update_lightbar{true};
bool update_player_leds{true}; bool update_player_leds{true};
bool release_leds{false};
// Controls for lightbar pulse. This seems somewhat hacky for now, as I haven't found out a nicer way. // Controls for lightbar pulse. This seems somewhat hacky for now, as I haven't found out a nicer way.
bool lightbar_on{false}; bool lightbar_on{false};