Skip to content

Commit

Permalink
Merge pull request #262 from belek666/test
Browse files Browse the repository at this point in the history
Disables PS2 controller when using pademu
  • Loading branch information
ElPatas1 authored May 11, 2020
2 parents db35e0b + 5050873 commit a1bcd72
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/pademu/pademu.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,32 @@ 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
if (pad[0].enabled) {
ctrl = 0;
} 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) {
return;
}
}
td->in[ctrl] = 0x00;
sio2proc(td);
td->in[ctrl] = 0x01;
sio2proc = pademu;
}
}
Expand Down

0 comments on commit a1bcd72

Please sign in to comment.