diff --git a/desmume/src/frontend/interface/interface.cpp b/desmume/src/frontend/interface/interface.cpp index bb731db2c..7a1c003cf 100644 --- a/desmume/src/frontend/interface/interface.cpp +++ b/desmume/src/frontend/interface/interface.cpp @@ -546,7 +546,7 @@ EXPORTED void desmume_input_joy_uninit(void) EXPORTED u16 desmume_input_joy_number_connected(void) { - return nbr_joy; + return get_number_of_joysticks(); } EXPORTED u16 desmume_input_joy_get_key(int index) diff --git a/desmume/src/frontend/posix/shared/ctrlssdl.cpp b/desmume/src/frontend/posix/shared/ctrlssdl.cpp index bbf8d2ab8..ff8edde54 100644 --- a/desmume/src/frontend/posix/shared/ctrlssdl.cpp +++ b/desmume/src/frontend/posix/shared/ctrlssdl.cpp @@ -35,7 +35,6 @@ u32 joypad_cfg[NB_KEYS]; static_assert(sizeof(keyboard_cfg) == sizeof(joypad_cfg), ""); -u16 nbr_joy; mouse_status mouse; static int fullscreen; @@ -120,7 +119,7 @@ BOOL init_joy( void) { for(i=0; i 0) { printf("Found %d joysticks\n", nbr_joy); @@ -156,7 +155,6 @@ void uninit_joy( void) } } - nbr_joy = 0; SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } diff --git a/desmume/src/frontend/posix/shared/ctrlssdl.h b/desmume/src/frontend/posix/shared/ctrlssdl.h index b4ab623eb..a7a2980b9 100644 --- a/desmume/src/frontend/posix/shared/ctrlssdl.h +++ b/desmume/src/frontend/posix/shared/ctrlssdl.h @@ -69,8 +69,6 @@ extern const char *key_names[NB_KEYS]; extern u32 keyboard_cfg[NB_KEYS]; /* Current joypad configuration */ extern u32 joypad_cfg[NB_KEYS]; -/* Number of detected joypads */ -extern u16 nbr_joy; #ifndef GTK_UI struct mouse_status