The RetroPad Abstraction¶
The RetroPad is a joypad abstraction interface defined by the Libretro API. It is the primary input device for a libretro frontend. Unless a core absolutely requires the use of a keyboard with no possible fallback for gamepad-type controls, a [[Libretro core]] should always be implemented as such that it is directly controllable by the RetroPad.
In terms of button layout and functionality, the RetroPad is based on a PlayStation/Super Nintendo joypad.
Above: An example of the RetroPad joypad abstraction mapped to the Xbox 360 gamepad.
A joypad must fulfill the following criteria to meet the requirements of the RetroPad joypad abstraction:
- It must have at least two shoulder buttons - two additional extra shoulder buttons are also supported.
- It must have at least four face buttons.
- It must have at least one D-pad.
- It must have at least one analogue stick - two analogue sticks are most common.
- It must have at least a Start button and a Select/Back button.
Parallel port joypads in Linux¶
RetroArch supports parallel port joypads on Linux via the "parport" joypad driver. It uses an extended version of the Linux Multisystem 2-button joystick protocol.
(*) Pin is hardware inverted, but RetroArch inverts it back again so the same pullup scheme may be used for all pins. Pin 1 is set high so it can be used for pullups.
RetroArch does not perform debouncing, and so long as the button settling time is less than the frame time no bouncing will be observed. This replicates the latching behavior common in old games consoles. For optimum latency and jitter a high performance debouncing routine should be implemented in the controller hardware.
Parallel port hardware does not provide a way to detect non-connected pins. To avoid rendering the menu usable with spurious button presses, RetroArch checks each pin on startup and assumes any active pin is not connected. Avoid holding joypad buttons while starting RetroArch or those buttons will be disabled.