From f57da6655c92fb379d8ac1dc1f3a208dee95691b Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 5 Jun 2022 14:03:00 +0200 Subject: [PATCH] DualSense: Fix firmware report on newer versions Newer versions of the DualSense return 64, while old versions return 65. --- rpcs3/Input/dualsense_pad_handler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpcs3/Input/dualsense_pad_handler.cpp b/rpcs3/Input/dualsense_pad_handler.cpp index e86eb14aa7..c2d733fa11 100644 --- a/rpcs3/Input/dualsense_pad_handler.cpp +++ b/rpcs3/Input/dualsense_pad_handler.cpp @@ -218,10 +218,11 @@ void dualsense_pad_handler::check_add_device(hid_device* hidDevice, std::string_ u32 hw_version{}; u32 fw_version{}; + buf = {}; buf[0] = 0x20; 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]); fw_version = read_u32(&buf[28]); @@ -417,7 +418,8 @@ bool dualsense_pad_handler::get_calibration_data(DualSenseDevice* dualsense_devi return false; } - std::array buf; + std::array buf{}; + if (dualsense_device->bt_controller) { for (int tries = 0; tries < 3; ++tries)