From 8d112ac6c87a4071de6e7c6144ece6228e8ce69b Mon Sep 17 00:00:00 2001 From: thesource Date: Wed, 30 Oct 2024 08:43:50 +0300 Subject: [PATCH] Add joystick count function --- desmume/src/frontend/posix/shared/ctrlssdl.cpp | 9 +++++++++ desmume/src/frontend/posix/shared/ctrlssdl.h | 1 + 2 files changed, 10 insertions(+) diff --git a/desmume/src/frontend/posix/shared/ctrlssdl.cpp b/desmume/src/frontend/posix/shared/ctrlssdl.cpp index 416f4650b..bbf8d2ab8 100644 --- a/desmume/src/frontend/posix/shared/ctrlssdl.cpp +++ b/desmume/src/frontend/posix/shared/ctrlssdl.cpp @@ -547,6 +547,15 @@ int get_joystick_number_by_id(SDL_JoystickID id) return -1; } +int get_number_of_joysticks() +{ + int i, n=0; + for(i=0; i