mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
XInput: fix usage of one controller for 2 players
This commit is contained in:
parent
76f94940cd
commit
2e7e2bb07e
1 changed files with 6 additions and 5 deletions
|
@ -315,8 +315,9 @@ void xinput_pad_handler::Close()
|
||||||
|
|
||||||
void xinput_pad_handler::ThreadProc()
|
void xinput_pad_handler::ThreadProc()
|
||||||
{
|
{
|
||||||
for (auto &bind : bindings)
|
for (int i = 0; i < static_cast<int>(bindings.size()); ++i)
|
||||||
{
|
{
|
||||||
|
auto& bind = bindings[i];
|
||||||
m_dev = bind.first;
|
m_dev = bind.first;
|
||||||
auto padnum = m_dev->deviceNumber;
|
auto padnum = m_dev->deviceNumber;
|
||||||
auto profile = m_dev->config;
|
auto profile = m_dev->config;
|
||||||
|
@ -327,23 +328,23 @@ void xinput_pad_handler::ThreadProc()
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
case ERROR_DEVICE_NOT_CONNECTED:
|
case ERROR_DEVICE_NOT_CONNECTED:
|
||||||
if (last_connection_status[padnum] == true)
|
if (last_connection_status[i] == true)
|
||||||
{
|
{
|
||||||
LOG_ERROR(HLE, "XInput device %d disconnected", padnum);
|
LOG_ERROR(HLE, "XInput device %d disconnected", padnum);
|
||||||
pad->m_port_status &= ~CELL_PAD_STATUS_CONNECTED;
|
pad->m_port_status &= ~CELL_PAD_STATUS_CONNECTED;
|
||||||
pad->m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
|
pad->m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
|
||||||
last_connection_status[padnum] = false;
|
last_connection_status[i] = false;
|
||||||
connected--;
|
connected--;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case ERROR_SUCCESS:
|
case ERROR_SUCCESS:
|
||||||
if (last_connection_status[padnum] == false)
|
if (last_connection_status[i] == false)
|
||||||
{
|
{
|
||||||
LOG_SUCCESS(HLE, "XInput device %d reconnected", padnum);
|
LOG_SUCCESS(HLE, "XInput device %d reconnected", padnum);
|
||||||
pad->m_port_status |= CELL_PAD_STATUS_CONNECTED;
|
pad->m_port_status |= CELL_PAD_STATUS_CONNECTED;
|
||||||
pad->m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
|
pad->m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
|
||||||
last_connection_status[padnum] = true;
|
last_connection_status[i] = true;
|
||||||
connected++;
|
connected++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue