1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-11-28 00:20:47 +01:00

piubtn: Fix order in process outputs

This commit is contained in:
Cube 2022-06-21 14:03:45 -07:00 committed by voidderef
parent 8968725a4b
commit d8a745d6e3

View File

@ -268,52 +268,52 @@ static enum cnh_result _patch_piubtn_process_outputs(struct cnh_iobuf *buffer)
/*
byte 0:
bit 0: p1 start (green)
bit 1: p1 right
bit 2: p1 left
bit 3: p1 back (red)
bit 4: p2 start (green)
bit 5: p2 right
bit 6: p2 left
bit 7: p2 back (red)
bit 0: p2 start (green)
bit 1: p2 right
bit 2: p2 left
bit 3: p2 back (red)
bit 4: p1 start (green)
bit 5: p1 right
bit 6: p1 left
bit 7: p1 back (red)
*/
/* Player 1 */
if (buffer->bytes[0] & (1 << 0)) {
p1.start = true;
}
if (buffer->bytes[0] & (1 << 1)) {
p1.back = true;
}
if (buffer->bytes[0] & (1 << 2)) {
p1.left = true;
}
if (buffer->bytes[0] & (1 << 3)) {
p1.right = true;
}
/* Player 2 */
if (buffer->bytes[0] & (1 << 4)) {
if (buffer->bytes[0] & (1 << 0)) {
p2.start = true;
}
if (buffer->bytes[0] & (1 << 5)) {
if (buffer->bytes[0] & (1 << 1)) {
p2.right = true;
}
if (buffer->bytes[0] & (1 << 6)) {
if (buffer->bytes[0] & (1 << 2)) {
p2.left = true;
}
if (buffer->bytes[0] & (1 << 7)) {
if (buffer->bytes[0] & (1 << 3)) {
p2.back = true;
}
/* Player 1 */
if (buffer->bytes[0] & (1 << 4)) {
p1.start = true;
}
if (buffer->bytes[0] & (1 << 5)) {
p1.right = true;
}
if (buffer->bytes[0] & (1 << 6)) {
p1.left = true;
}
if (buffer->bytes[0] & (1 << 7)) {
p1.back = true;
}
_patch_piubtn_ptapi_io_piubtn_set_output(0, &p1);
_patch_piubtn_ptapi_io_piubtn_set_output(1, &p2);