The PS2 backend sends SDL_EVENT_GAMEPAD_ADDED events for all 8 gamepad slots immediately on startup, regardless of whether the corresponding controller is actually connected. Attempting to call SDL_OpenGamepad on them causes PS2_InitializePad to wait until the controller is actually plugged in.
Note: I do not own a physical PS2 to confirm the issue on. This behavior was observed in PCSX2 v2.6.3
Steps to reproduce
- Poll for SDL_EVENT_GAMEPAD_ADDED events;
- Call SDL_OpenGamepad on the added controllers.
Expected result
Controllers that are plugged in are opened.
Controllers that are not plugged in on startup are opened once they are plugged in.
Actual result
The application hangs and does not recover until all 8 controller slots are occupied.
Suggested fix
Send SDL_EVENT_GAMEPAD_ADDED events when controllers are plugged in, rather than on startup.
Minimal reproduction
main.c
CMakeLists.txt
The PS2 backend sends SDL_EVENT_GAMEPAD_ADDED events for all 8 gamepad slots immediately on startup, regardless of whether the corresponding controller is actually connected. Attempting to call SDL_OpenGamepad on them causes PS2_InitializePad to wait until the controller is actually plugged in.
Note: I do not own a physical PS2 to confirm the issue on. This behavior was observed in PCSX2 v2.6.3
Steps to reproduce
Expected result
Controllers that are plugged in are opened.
Controllers that are not plugged in on startup are opened once they are plugged in.
Actual result
The application hangs and does not recover until all 8 controller slots are occupied.
Suggested fix
Send SDL_EVENT_GAMEPAD_ADDED events when controllers are plugged in, rather than on startup.
Minimal reproduction
main.c
CMakeLists.txt