diff --git a/dynamic.c b/dynamic.c index 2a5af5ade5..e0dffbd67c 100644 --- a/dynamic.c +++ b/dynamic.c @@ -665,18 +665,55 @@ bool rarch_environment_cb(unsigned cmd, void *data) for (; desc->description; desc++) { + unsigned port = desc->port; + unsigned id = desc->id; if (desc->port >= MAX_PLAYERS) continue; /* Ignore all others for now. */ - if (desc->device != RETRO_DEVICE_JOYPAD) + if (desc->device != RETRO_DEVICE_JOYPAD && + desc->device != RETRO_DEVICE_ANALOG) continue; if (desc->id >= RARCH_FIRST_CUSTOM_BIND) continue; - g_extern.system.input_desc_btn[desc->port][desc->id] = - desc->description; + if (desc->device == RETRO_DEVICE_ANALOG) + { + switch (id) + { + case RETRO_DEVICE_ID_ANALOG_X: + switch (desc->index) + { + case RETRO_DEVICE_INDEX_ANALOG_LEFT: + g_extern.system.input_desc_btn[port][RARCH_ANALOG_LEFT_X_PLUS] = desc->description; + g_extern.system.input_desc_btn[port][RARCH_ANALOG_LEFT_X_MINUS] = desc->description; + break; + case RETRO_DEVICE_INDEX_ANALOG_RIGHT: + g_extern.system.input_desc_btn[port][RARCH_ANALOG_RIGHT_X_PLUS] = desc->description; + g_extern.system.input_desc_btn[port][RARCH_ANALOG_RIGHT_X_MINUS] = desc->description; + break; + } + break; + case RETRO_DEVICE_ID_ANALOG_Y: + switch (desc->index) + { + case RETRO_DEVICE_INDEX_ANALOG_LEFT: + g_extern.system.input_desc_btn[port][RARCH_ANALOG_LEFT_Y_PLUS] = desc->description; + g_extern.system.input_desc_btn[port][RARCH_ANALOG_LEFT_Y_MINUS] = desc->description; + break; + case RETRO_DEVICE_INDEX_ANALOG_RIGHT: + g_extern.system.input_desc_btn[port][RARCH_ANALOG_RIGHT_Y_PLUS] = desc->description; + g_extern.system.input_desc_btn[port][RARCH_ANALOG_RIGHT_Y_MINUS] = desc->description; + break; + } + break; + } + } + else + { + g_extern.system.input_desc_btn[port][id] = desc->description; + } } static const char *libretro_btn_desc[] = { diff --git a/general.h b/general.h index 5de5819e58..6020b90ad2 100644 --- a/general.h +++ b/general.h @@ -562,7 +562,7 @@ struct global bool force_nonblock; bool no_content; - const char *input_desc_btn[MAX_PLAYERS][RARCH_FIRST_CUSTOM_BIND]; + const char *input_desc_btn[MAX_PLAYERS][RARCH_FIRST_META_KEY]; char valid_extensions[PATH_MAX]; retro_keyboard_event_t key_event; diff --git a/settings_data.c b/settings_data.c index d05b7a4ffb..525642c564 100644 --- a/settings_data.c +++ b/settings_data.c @@ -4539,8 +4539,9 @@ static bool setting_data_append_list_input_options( if ( g_settings.input.input_descriptor_label_show - && (i < RARCH_FIRST_CUSTOM_BIND) + && (i < RARCH_FIRST_META_KEY) && (g_extern.has_set_input_descriptors) + && (i != RARCH_TURBO_ENABLE) ) snprintf(label, sizeof(label), "%s %s", buffer[player], g_extern.system.input_desc_btn[player][i] ? g_extern.system.input_desc_btn[player][i] : "N/A");