cellPad: allow opening the home menu with ldd pads

Speculative
This commit is contained in:
Megamouse 2023-02-10 03:35:47 +01:00
parent 38c7cf474d
commit c3e4b6da46
2 changed files with 18 additions and 5 deletions

View File

@ -52,6 +52,11 @@ enum Digital2Flags : u32
CELL_PAD_CTRL_PS = 0x00000100, // Speculative
};
enum
{
CELL_PAD_CTRL_LDD_PS = 0x00000001
};
enum DeviceCapability
{
CELL_PAD_CAPABILITY_PS3_CONFORMITY = 0x00000001, // PS3 Conformity Controller

View File

@ -422,21 +422,29 @@ void pad_thread::operator()()
if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED))
continue;
// Check if an LDD pad pressed the PS button (bit 0 of the first button)
if (pad->ldd && !!(static_cast<be_t<u16>>(pad->ldd_data[sizeof(be_t<u32>)]) & CELL_PAD_CTRL_LDD_PS))
{
ps_button_pressed = true;
break;
}
for (const auto& button : pad->m_buttons)
{
if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2 && button.m_outKeyCode == CELL_PAD_CTRL_PS && button.m_pressed)
{
// Make sure we call this function only once per button press
if (!m_ps_button_pressed)
{
open_home_menu();
}
ps_button_pressed = true;
break;
}
}
}
// Make sure we call this function only once per button press
if (ps_button_pressed && !m_ps_button_pressed)
{
open_home_menu();
}
m_ps_button_pressed = ps_button_pressed;
}