Overlays: allow ldd input even if len is 0

Rock Band 3 doesn't seem to care about the len. It's always 0.
This commit is contained in:
Megamouse 2024-05-25 17:38:26 +02:00
parent c0ed56cba0
commit a3457c29cb
2 changed files with 6 additions and 7 deletions

View File

@ -250,7 +250,8 @@ namespace rsx
{ {
// LDD pads get passed input data from the game itself. // LDD pads get passed input data from the game itself.
if (pad->ldd_data.len > CELL_PAD_BTN_OFFSET_DIGITAL1) // NOTE: Rock Band 3 doesn't seem to care about the len. It's always 0.
//if (pad->ldd_data.len > CELL_PAD_BTN_OFFSET_DIGITAL1)
{ {
const u16 digital1 = pad->ldd_data.button[CELL_PAD_BTN_OFFSET_DIGITAL1]; const u16 digital1 = pad->ldd_data.button[CELL_PAD_BTN_OFFSET_DIGITAL1];
@ -264,7 +265,7 @@ namespace rsx
handle_button_press(pad_button::start, !!(digital1 & CELL_PAD_CTRL_START), pad_index); handle_button_press(pad_button::start, !!(digital1 & CELL_PAD_CTRL_START), pad_index);
} }
if (pad->ldd_data.len > CELL_PAD_BTN_OFFSET_DIGITAL2) //if (pad->ldd_data.len > CELL_PAD_BTN_OFFSET_DIGITAL2)
{ {
const u16 digital2 = pad->ldd_data.button[CELL_PAD_BTN_OFFSET_DIGITAL2]; const u16 digital2 = pad->ldd_data.button[CELL_PAD_BTN_OFFSET_DIGITAL2];
@ -281,10 +282,7 @@ namespace rsx
const auto handle_ldd_stick_input = [&](s32 offset, pad_button id_small, pad_button id_large) const auto handle_ldd_stick_input = [&](s32 offset, pad_button id_small, pad_button id_large)
{ {
if (pad->ldd_data.len <= offset) //if (pad->ldd_data.len <= offset) return;
{
return;
}
constexpr u16 threshold = 20; // Let's be careful and use some threshold here constexpr u16 threshold = 20; // Let's be careful and use some threshold here
const u16 value = pad->ldd_data.button[offset]; const u16 value = pad->ldd_data.button[offset];

View File

@ -400,7 +400,8 @@ void pad_thread::operator()()
continue; continue;
// Check if an LDD pad pressed the PS button (bit 0 of the first button) // Check if an LDD pad pressed the PS button (bit 0 of the first button)
if (pad->ldd && pad->ldd_data.len >= 1 && !!(pad->ldd_data.button[0] & CELL_PAD_CTRL_LDD_PS)) // NOTE: Rock Band 3 doesn't seem to care about the len. It's always 0.
if (pad->ldd /*&& pad->ldd_data.len >= 1 */&& !!(pad->ldd_data.button[0] & CELL_PAD_CTRL_LDD_PS))
{ {
ps_button_pressed = true; ps_button_pressed = true;
break; break;