Skip to content

Commit

Permalink
Cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
belek666 committed May 2, 2020
1 parent 9a3dcde commit 5050873
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/pademu/pademu.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void pademu_hookSio2man(sio2_transfer_data_t *td, Sio2McProc sio2proc)
sio2proc = pademu;
} else if (pad[0].enabled || pad[1].enabled) { //only one
if (pad[0].enabled) {
td->in[0] = 0x00;
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) {
Expand All @@ -233,11 +233,12 @@ void pademu_hookSio2man(sio2_transfer_data_t *td, Sio2McProc sio2proc)
break;
}
}
if (ctrl + 3 != td->in_size) {
td->in[ctrl] = 0x00;
if (ctrl + 3 == td->in_size) {
return;
}
}
sio2proc(td);
td->in[ctrl] = 0x00;
sio2proc(td);
td->in[ctrl] = 0x01;
sio2proc = pademu;
}
Expand Down

0 comments on commit 5050873

Please sign in to comment.