Input: Remove unused flush member

This commit is contained in:
Megamouse 2019-09-20 08:11:30 +02:00
parent 1a892c6b1b
commit 7193d407b9
4 changed files with 11 additions and 31 deletions

View File

@ -236,13 +236,6 @@ static bool map_to_ds3_input(const u32 port_no, be_t<u16>& digital_buttons, be_t
default: break;
}
}
if (button.m_flush)
{
button.m_pressed = false;
button.m_flush = false;
button.m_value = 0;
}
}
memset(&digital_buttons, 0, sizeof(digital_buttons));

View File

@ -142,7 +142,7 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
data->len = CELL_PAD_LEN_NO_CHANGE;
return CELL_OK;
}
if (pad->ldd)
{
memcpy(data.get_ptr(), pad->ldd_data, sizeof(CellPadData));
@ -153,9 +153,8 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
return CELL_OK;
}
u16 d1Initial, d2Initial;
d1Initial = pad->m_digital_1;
d2Initial = pad->m_digital_2;
u16 d1Initial = pad->m_digital_1;
u16 d2Initial = pad->m_digital_2;
bool btnChanged = false;
for (Button& button : pad->m_buttons)
@ -165,8 +164,10 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL1)
{
if (button.m_pressed) pad->m_digital_1 |= button.m_outKeyCode;
else pad->m_digital_1 &= ~button.m_outKeyCode;
if (button.m_pressed)
pad->m_digital_1 |= button.m_outKeyCode;
else
pad->m_digital_1 &= ~button.m_outKeyCode;
switch (button.m_outKeyCode)
{
@ -196,8 +197,10 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
}
else if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2)
{
if (button.m_pressed) pad->m_digital_2 |= button.m_outKeyCode;
else pad->m_digital_2 &= ~button.m_outKeyCode;
if (button.m_pressed)
pad->m_digital_2 |= button.m_outKeyCode;
else
pad->m_digital_2 &= ~button.m_outKeyCode;
switch (button.m_outKeyCode)
{
@ -236,13 +239,6 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
default: break;
}
}
if (button.m_flush)
{
button.m_pressed = false;
button.m_flush = false;
button.m_value = 0;
}
}
for (const AnalogStick& stick : pad->m_sticks)

View File

@ -115,11 +115,9 @@ struct Button
u32 m_outKeyCode;
u16 m_value;
bool m_pressed;
bool m_flush;
Button(u32 offset, u32 keyCode, u32 outKeyCode)
: m_pressed(false)
, m_flush(false)
, m_offset(offset)
, m_keyCode(keyCode)
, m_outKeyCode(outKeyCode)

View File

@ -286,13 +286,6 @@ namespace rsx
button_state[pad_index][button_id] = button.m_pressed;
}
if (button.m_flush)
{
button.m_pressed = false;
button.m_flush = false;
button.m_value = 0;
}
if (exit)
return 0;
}