mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 09:49:34 -10:00
Every console joypad driver now takes stick values only from a report that carries them, and a pad that is gone, unreadable, or of a kind the driver does not read holds nothing and reads centred: - PSP: a failed read is skipped as on Vita. - PS3: a disconnected pad's sticks are centred. Rumble keeps each pad's motor values and sends both, so setting one leaves the other as it was; the large motor scales across its 0-255 range. - PS4: a report is read only from a pad reporting itself connected; the handle is kept for when it reports again. - GameCube/Wii (libogc): sticks are centred before each pad is read, so a pad pulled out, a bare Wiimote or a Nunchuk in place of a Classic leaves nothing held. - Switch: a lone Joy-Con centres the right stick. - Wii U Wiimote: a device type the driver does not read holds nothing. - Original Xbox: the device handle is kept across polls, a pad that cannot be read or is removed holds nothing, handles are closed before the state is cleared, and the X button case is terminated. The PSP read macro evaluates its port argument, and the touched files are MSVC C89 clean (INLINE, no trailing enum comma, unsigned for uint). samples/input psp_pad_read, ps3_joypad, ps4_joypad, gx_pad_sticks, switch_joypad, wiiu_kpad and xdk_joypad build each driver against stand-ins for its SDK and hold it to the above: a stick held when the pad goes away, changes extension or fails a read reads centred, and PS3 rumble sets one motor without disturbing the other. The PS3 and PS4 stand-ins are added to tools/platform_stubs.