mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
DualSense: Fix firmware report on newer versions
Newer versions of the DualSense return 64, while old versions return 65.
This commit is contained in:
parent
ac34714837
commit
f57da6655c
@ -218,10 +218,11 @@ void dualsense_pad_handler::check_add_device(hid_device* hidDevice, std::string_
|
|||||||
u32 hw_version{};
|
u32 hw_version{};
|
||||||
u32 fw_version{};
|
u32 fw_version{};
|
||||||
|
|
||||||
|
buf = {};
|
||||||
buf[0] = 0x20;
|
buf[0] = 0x20;
|
||||||
|
|
||||||
res = hid_get_feature_report(hidDevice, buf.data(), DUALSENSE_VERSION_REPORT_SIZE);
|
res = hid_get_feature_report(hidDevice, buf.data(), DUALSENSE_VERSION_REPORT_SIZE);
|
||||||
if (res == 65)
|
if (res > 0) // Old versions return 65, newer versions return 64
|
||||||
{
|
{
|
||||||
hw_version = read_u32(&buf[24]);
|
hw_version = read_u32(&buf[24]);
|
||||||
fw_version = read_u32(&buf[28]);
|
fw_version = read_u32(&buf[28]);
|
||||||
@ -417,7 +418,8 @@ bool dualsense_pad_handler::get_calibration_data(DualSenseDevice* dualsense_devi
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u8, 64> buf;
|
std::array<u8, 64> buf{};
|
||||||
|
|
||||||
if (dualsense_device->bt_controller)
|
if (dualsense_device->bt_controller)
|
||||||
{
|
{
|
||||||
for (int tries = 0; tries < 3; ++tries)
|
for (int tries = 0; tries < 3; ++tries)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user