diff --git a/src/game/game_init.c b/src/game/game_init.c index 9819e790..1138aff2 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -598,7 +598,7 @@ void read_controller_inputs(s32 threadID) { // if we're receiving inputs, update the controller struct with the new button info. if (controller->controllerData != NULL) { // HackerSM64: Swaps Z and L, only on console, and only when playing with a GameCube controller. - if (controller->statusData->type & CONT_CONSOLE_GCN) { + if ((controller->statusData->type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) { u32 oldButton = controllerData->button; u32 newButton = oldButton & ~(Z_TRIG | L_TRIG); if (oldButton & Z_TRIG) { @@ -690,8 +690,8 @@ void init_controllers(void) { if ( (gEmulator & EMU_CONSOLE) && ((gControllerBits & 0b11) == 0b11) && // Only swap if the first two ports both have controllers plugged in. - ((gControllerStatuses[0].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_N64) && // If the first port's controller is N64. - ((gControllerStatuses[1].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) // If the second port's controller is GCN. + ((gControllerStatuses[0].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_N64) && // If the 1st port's controller is N64. + ((gControllerStatuses[1].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) // If the 2nd port's controller is GCN. ) { struct Controller temp = gControllers[0]; gControllers[0] = gControllers[1]; diff --git a/src/game/gamecube_controller.c b/src/game/gamecube_controller.c index 05ca0f57..1a44c7da 100644 --- a/src/game/gamecube_controller.c +++ b/src/game/gamecube_controller.c @@ -217,7 +217,7 @@ void osContGetReadDataEx(OSContPadEx* data) { int i; for (i = 0; i < __osMaxControllers; i++, data++) { - if (gControllerStatuses[i].type & CONT_CONSOLE_GCN) { + if ((gControllerStatuses[i].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) { s32 stick_x, stick_y, c_stick_x, c_stick_y; readformatgcn = *(__OSContGCNShortPollFormat*)ptr; data->errno = CHNL_ERR(readformatgcn); @@ -293,7 +293,7 @@ static void __osPackReadData(void) { readformatgcn.stick_y = -1; for (i = 0; i < __osMaxControllers; i++) { - if (gControllerStatuses[i].type & CONT_CONSOLE_GCN) { + if ((gControllerStatuses[i].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) { readformatgcn.rumble = __osGamecubeRumbleEnabled[i]; *(__OSContGCNShortPollFormat*)ptr = readformatgcn; ptr += sizeof(__OSContGCNShortPollFormat); @@ -401,7 +401,7 @@ s32 __osMotorAccessEx(OSPfs* pfs, s32 flag) { return 5; } - if (gControllerStatuses[pfs->channel].type & CONT_CONSOLE_GCN) { + if ((gControllerStatuses[pfs->channel].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_GCN) { __osGamecubeRumbleEnabled[pfs->channel] = flag; __osContLastCmd = CONT_CMD_END; } else { @@ -472,7 +472,7 @@ s32 osMotorInitEx(OSMesgQueue *mq, OSPfs *pfs, int channel) pfs->activebank = 0xFF; pfs->status = 0; - if (gControllerStatuses[pfs->channel].type & CONT_CONSOLE_GCN) { + if ((gControllerStatuses[pfs->channel].type & CONT_CONSOLE_MASK) == CONT_CONSOLE_N64) { ret = __osPfsSelectBank(pfs, 0xFE); if (ret == PFS_ERR_NEW_PACK) {