Skip to content

Commit

Permalink
Disables PS2 controller when using pademu
Browse files Browse the repository at this point in the history
  • Loading branch information
belek666 committed May 2, 2020
1 parent 361883d commit 9a3dcde
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/pademu/pademu.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,31 @@ void pademu_hookSio2man(sio2_transfer_data_t *td, Sio2McProc sio2proc)
if (port2 == 1) { //2 sio cmds
if (mtap_inited) {
if (pad[0].enabled) {
td->in[0] = 0x00;
sio2proc(td);
sio2proc = pademu;
}
} else {
if (pad[0].enabled && pad[1].enabled) { //emulating 2 pads
sio2proc = pademu;
} else if (pad[0].enabled || pad[1].enabled) { //only one
sio2proc(td);
if (pad[0].enabled) {
td->in[0] = 0x00;
} else if (pad[1].enabled) {
for (ctrl = 5; ctrl < td->in_size - 3; ctrl++) {
if (td->in[ctrl] == 0x01 && (td->in[ctrl + 1] & 0xF0) == 0x40 && td->in[ctrl + 2] == 0x00) {
if (ctrl != 5 && ctrl != 9 && ctrl != 21)
continue;
else
break;
}
}
if (ctrl + 3 != td->in_size) {
td->in[ctrl] = 0x00;
}
}
sio2proc(td);
td->in[ctrl] = 0x01;
sio2proc = pademu;
}
}
Expand Down

0 comments on commit 9a3dcde

Please sign in to comment.