mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-11 03:11:33 -10:00
A port reads its controller by device number, and today that number is the joypad driver's own slot. A pad no joypad driver sees - a DualShock 3 bound to WinUSB - needs a number from the same pool, so that it can sit beside the driver's pads without either taking the other's. input_device_pool.h keeps that pool. The driver's pads keep their slots as their numbers, so nothing the driver reads changes. A source beside it claims free numbers from the top down, and a pad that comes back is given its number again if it is free. Where the driver's pad arrives on a number a pad beside it holds, the driver's pad keeps it and the other is named to move. The frontend marks the driver's numbers as it learns of its pads, and clears them when the driver reports its pads afresh. Nothing claims a number beside the driver yet; the WinUSB source will. samples/input/device_pool runs the pool through mixed arrivals and departures from the driver and two sources beside it.