mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Merge pull request #7864 from fr500/master
[info] use sublabels for controller information
This commit is contained in:
commit
e7befaba37
@ -4937,6 +4937,10 @@ MSG_HASH(
|
|||||||
MENU_ENUM_SUBLABEL_CORE_LIST,
|
MENU_ENUM_SUBLABEL_CORE_LIST,
|
||||||
"Select which core to use."
|
"Select which core to use."
|
||||||
)
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_SUBLABEL_START_CORE,
|
||||||
|
"Start core without content."
|
||||||
|
)
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_SUBLABEL_DOWNLOAD_CORE,
|
MENU_ENUM_SUBLABEL_DOWNLOAD_CORE,
|
||||||
"Install a core from the online updater."
|
"Install a core from the online updater."
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
#include "../../dynamic.h"
|
#include "../../dynamic.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../managers/cheat_manager.h"
|
#include "../../managers/cheat_manager.h"
|
||||||
|
#include "../input/input_driver.h"
|
||||||
|
#include "../tasks/tasks_internal.h"
|
||||||
|
|
||||||
#define default_sublabel_macro(func_name, lbl) \
|
#define default_sublabel_macro(func_name, lbl) \
|
||||||
static int (func_name)(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) \
|
static int (func_name)(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) \
|
||||||
@ -187,6 +189,7 @@ default_sublabel_macro(action_bind_sublabel_netplay_nickname, MENU_
|
|||||||
default_sublabel_macro(action_bind_sublabel_cheevos_username, MENU_ENUM_SUBLABEL_CHEEVOS_USERNAME)
|
default_sublabel_macro(action_bind_sublabel_cheevos_username, MENU_ENUM_SUBLABEL_CHEEVOS_USERNAME)
|
||||||
default_sublabel_macro(action_bind_sublabel_cheevos_password, MENU_ENUM_SUBLABEL_CHEEVOS_PASSWORD)
|
default_sublabel_macro(action_bind_sublabel_cheevos_password, MENU_ENUM_SUBLABEL_CHEEVOS_PASSWORD)
|
||||||
default_sublabel_macro(action_bind_sublabel_video_post_filter_record, MENU_ENUM_SUBLABEL_VIDEO_POST_FILTER_RECORD)
|
default_sublabel_macro(action_bind_sublabel_video_post_filter_record, MENU_ENUM_SUBLABEL_VIDEO_POST_FILTER_RECORD)
|
||||||
|
default_sublabel_macro(action_bind_sublabel_start_core, MENU_ENUM_SUBLABEL_START_CORE)
|
||||||
default_sublabel_macro(action_bind_sublabel_core_list, MENU_ENUM_SUBLABEL_CORE_LIST)
|
default_sublabel_macro(action_bind_sublabel_core_list, MENU_ENUM_SUBLABEL_CORE_LIST)
|
||||||
default_sublabel_macro(action_bind_sublabel_download_core, MENU_ENUM_SUBLABEL_DOWNLOAD_CORE)
|
default_sublabel_macro(action_bind_sublabel_download_core, MENU_ENUM_SUBLABEL_DOWNLOAD_CORE)
|
||||||
default_sublabel_macro(action_bind_sublabel_sideload_core_list, MENU_ENUM_SUBLABEL_SIDELOAD_CORE_LIST)
|
default_sublabel_macro(action_bind_sublabel_sideload_core_list, MENU_ENUM_SUBLABEL_SIDELOAD_CORE_LIST)
|
||||||
@ -499,6 +502,36 @@ default_sublabel_macro(action_bind_sublabel_switch_gpu_profile, MENU
|
|||||||
default_sublabel_macro(action_bind_sublabel_switch_backlight_control, MENU_ENUM_SUBLABEL_SWITCH_BACKLIGHT_CONTROL)
|
default_sublabel_macro(action_bind_sublabel_switch_backlight_control, MENU_ENUM_SUBLABEL_SWITCH_BACKLIGHT_CONTROL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int action_bind_sublabel_systeminfo_controller_entry(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
|
{
|
||||||
|
char tmp[len];
|
||||||
|
unsigned controller;
|
||||||
|
|
||||||
|
for(controller = 0; controller < MAX_USERS; controller++)
|
||||||
|
{
|
||||||
|
if (input_is_autoconfigured(controller))
|
||||||
|
{
|
||||||
|
snprintf(tmp, sizeof(tmp), "Port #%d device name: %s (#%d)",
|
||||||
|
controller,
|
||||||
|
input_config_get_device_name(controller),
|
||||||
|
input_autoconfigure_get_device_name_index(controller));
|
||||||
|
|
||||||
|
if (string_is_equal(path, tmp))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
snprintf(tmp, sizeof(tmp), "Device display name: %s\nDevice config name: %s\nDevice identifiers: %d/%d",
|
||||||
|
input_config_get_device_display_name(controller) ? input_config_get_device_display_name(controller) : "N/A",
|
||||||
|
input_config_get_device_display_name(controller) ? input_config_get_device_config_name(controller) : "N/A",
|
||||||
|
input_config_get_vid(controller), input_config_get_pid(controller));
|
||||||
|
strlcpy(s, tmp, len);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
static int action_bind_sublabel_cheevos_entry(
|
static int action_bind_sublabel_cheevos_entry(
|
||||||
file_list_t *list,
|
file_list_t *list,
|
||||||
unsigned type, unsigned i,
|
unsigned type, unsigned i,
|
||||||
@ -1672,6 +1705,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_LOAD_CONTENT_SPECIAL:
|
case MENU_ENUM_LABEL_LOAD_CONTENT_SPECIAL:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_special);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_special);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_START_CORE:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_start_core);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_CORE_LIST:
|
case MENU_ENUM_LABEL_CORE_LIST:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_list);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_list);
|
||||||
break;
|
break;
|
||||||
@ -1859,6 +1895,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_CPU_CORES:
|
case MENU_ENUM_LABEL_CPU_CORES:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_systeminfo_cpu_cores);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_systeminfo_cpu_cores);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_systeminfo_controller_entry);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_BLACK_FRAME_INSERTION:
|
case MENU_ENUM_LABEL_VIDEO_BLACK_FRAME_INSERTION:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_black_frame_insertion);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_black_frame_insertion);
|
||||||
break;
|
break;
|
||||||
|
@ -387,6 +387,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
|
|||||||
#endif
|
#endif
|
||||||
const char *tmp_string = NULL;
|
const char *tmp_string = NULL;
|
||||||
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
tmp[0] = feat_str[0] = '\0';
|
tmp[0] = feat_str[0] = '\0';
|
||||||
|
|
||||||
@ -504,40 +505,39 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
|
|||||||
MENU_ENUM_LABEL_CPU_CORES, MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_ENUM_LABEL_CPU_CORES, MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(controller = 0; controller < MAX_USERS; controller++)
|
for(controller = 0; controller < MAX_USERS; controller++)
|
||||||
{
|
{
|
||||||
if (input_is_autoconfigured(controller))
|
if (input_is_autoconfigured(controller))
|
||||||
{
|
{
|
||||||
snprintf(tmp, sizeof(tmp), "Port #%d device name: %s (#%d)",
|
snprintf(tmp, sizeof(tmp), "Port #%d device name: %s (#%d)",
|
||||||
controller,
|
controller,
|
||||||
input_config_get_device_name(controller),
|
input_config_get_device_name(controller),
|
||||||
input_autoconfigure_get_device_name_index(controller));
|
input_autoconfigure_get_device_name_index(controller));
|
||||||
menu_entries_append_enum(info->list, tmp, "",
|
menu_entries_append_enum(info->list, tmp, "",
|
||||||
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
snprintf(tmp, sizeof(tmp), "Port #%d device display name: %s",
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
controller,
|
{
|
||||||
input_config_get_device_display_name(controller) ?
|
snprintf(tmp, sizeof(tmp), " Device display name: %s",
|
||||||
input_config_get_device_display_name(controller) : "N/A");
|
input_config_get_device_display_name(controller) ?
|
||||||
menu_entries_append_enum(info->list, tmp, "",
|
input_config_get_device_display_name(controller) : "N/A");
|
||||||
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
menu_entries_append_enum(info->list, tmp, "",
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
|
||||||
snprintf(tmp, sizeof(tmp), "Port #%d device config name: %s",
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
controller,
|
snprintf(tmp, sizeof(tmp), " Device config name: %s",
|
||||||
input_config_get_device_display_name(controller) ?
|
input_config_get_device_display_name(controller) ?
|
||||||
input_config_get_device_config_name(controller) : "N/A");
|
input_config_get_device_config_name(controller) : "N/A");
|
||||||
menu_entries_append_enum(info->list, tmp, "",
|
menu_entries_append_enum(info->list, tmp, "",
|
||||||
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
snprintf(tmp, sizeof(tmp), "Port #%d device VID/PID: %d/%d",
|
snprintf(tmp, sizeof(tmp), " Device VID/PID: %d/%d",
|
||||||
controller,
|
input_config_get_vid(controller),
|
||||||
input_config_get_vid(controller),
|
input_config_get_pid(controller));
|
||||||
input_config_get_pid(controller));
|
menu_entries_append_enum(info->list, tmp, "",
|
||||||
menu_entries_append_enum(info->list, tmp, "",
|
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
|
||||||
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frontend)
|
if (frontend)
|
||||||
|
@ -540,6 +540,7 @@ enum msg_hash_enums
|
|||||||
MENU_ENUM_LABEL_CORE_OPTION_ENTRY,
|
MENU_ENUM_LABEL_CORE_OPTION_ENTRY,
|
||||||
MENU_ENUM_LABEL_NETWORK_INFO_ENTRY,
|
MENU_ENUM_LABEL_NETWORK_INFO_ENTRY,
|
||||||
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
|
||||||
|
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
|
||||||
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
|
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
|
||||||
MENU_ENUM_LABEL_PLAYLIST_ENTRY,
|
MENU_ENUM_LABEL_PLAYLIST_ENTRY,
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user