mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-10 03:21:30 -10:00
Every hid pad handler that lights the pad - the DualShock 3, DualSense and Edge, Switch Pro, Switch 2 Pro and Wii Remote - lit its hid slot, once, when it started. After a driver restart the pads can come back in other slots and are moved back to the ports they had, and a port can be pointed at another pad in the menu or by a reservation: the lights then showed the wrong player, and a pad no port reads was still lit. The frontend now tells the joypad driver which port reads each pad, and the hid drivers pass it to the pad's handler, which relights from its packet handler - the pad's own thread - so nothing waits. The lowest port reading a pad is shown; on none, the lights go out. The Switch pads take the console's patterns past player 4. It costs one countdown a poll: every 32 polls the ports are compared with what the driver was last told, and only a change, a driver start or a pad starting beside the joypad driver tells it again. The player is kept for each slot, so a pad plugged in is lit for its port as it starts. A handler never told, under a hid driver that does not pass it on, lights its slot as before. joypad_slots covers the slot's player across pads and threads; connect_parity the DualSense and Switch Pro relighting.