u32 GetJoy(int pad) { pad = 0; s8 gc_px = PAD_SubStickX (0); s8 gc_py = PAD_SubStickY (0); #ifdef HW_RVL s8 wm_sx = WPAD_Stick (0,1,0); s8 wm_sy = WPAD_Stick (0,1,1); u32 wm_pb = WPAD_ButtonsHeld (0); // wiimote / expansion button info #endif // Check for video zoom if (GCSettings.Zoom) { if (gc_py < -36 || gc_py > 36) zoom ((float) gc_py / -36); #ifdef HW_RVL if (wm_sy < -36 || wm_sy > 36) zoom ((float) wm_sy / -36); #endif } // request to go back to menu if ((gc_px < -70) #ifdef HW_RVL || (wm_pb & WPAD_BUTTON_HOME) || (wm_pb & WPAD_CLASSIC_BUTTON_HOME) || (wm_sx < -70) #endif ) { StopAudio(); ConfigRequested = 1; return 0; } else { return DecodeJoy(pad); } }
u32 GetJoy(int pad) { UpdatePads(); // request to go back to menu if (MenuRequested()) { ScreenshotRequested = 1; updateRumbleFrame(); return 0; } u32 J = DecodeJoy(pad); // don't allow up+down or left+right if ((J & 48) == 48) J &= ~16; if ((J & 192) == 192) J &= ~128; updateRumbleFrame(); return J; }
void GetJoy() { JSReturn = 0; // reset buttons pressed unsigned char pad[4]; short i; UpdatePads(); // Turbo mode // RIGHT on c-stick and on classic ctrlr right joystick if(userInput[0].pad.substickX > 70 || userInput[0].WPAD_StickX(1) > 70) turbomode = 1; else turbomode = 0; // request to go back to menu if(MenuRequested()) ScreenshotRequested = 1; // go to the menu for (i = 0; i < 4; i++) pad[i] = DecodeJoy(i); JSReturn = pad[0] | pad[1] << 8 | pad[2] << 16 | pad[3] << 24; }