add a debug information panel, disabled by default

This commit is contained in:
radius 2015-09-23 20:48:08 -05:00
parent 40c85eaaab
commit 4345320c85
10 changed files with 75 additions and 0 deletions

View File

@ -1631,6 +1631,7 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, network_cmd_enable, "network_cmd_enable");
CONFIG_GET_INT_BASE(conf, settings, network_cmd_port, "network_cmd_port");
CONFIG_GET_BOOL_BASE(conf, settings, stdin_cmd_enable, "stdin_cmd_enable");
CONFIG_GET_BOOL_BASE(conf, settings, debug_panel_enable, "debug_panel_enable");
CONFIG_GET_PATH_BASE(conf, settings, content_history_directory, "content_history_dir");

View File

@ -326,6 +326,7 @@ typedef struct settings
bool network_cmd_enable;
unsigned network_cmd_port;
bool stdin_cmd_enable;
bool debug_panel_enable;
char core_assets_directory[PATH_MAX_LENGTH];
char assets_directory[PATH_MAX_LENGTH];

View File

@ -40,6 +40,11 @@ static int deferred_push_system_information(menu_displaylist_info_t *info)
return menu_displaylist_push_list(info, DISPLAYLIST_SYSTEM_INFO);
}
static int deferred_push_debug_information(menu_displaylist_info_t *info)
{
return menu_displaylist_push_list(info, DISPLAYLIST_DEBUG_INFO);
}
static int deferred_push_rdb_collection(menu_displaylist_info_t *info)
{
return menu_displaylist_push_list(info, DISPLAYLIST_PLAYLIST_COLLECTION);
@ -628,6 +633,8 @@ static int menu_cbs_init_bind_deferred_push_compare_label(menu_file_list_cbs_t *
break;
case MENU_LABEL_SYSTEM_INFORMATION:
cbs->action_deferred_push = deferred_push_system_information;
case MENU_LABEL_DEBUG_INFORMATION:
cbs->action_deferred_push = deferred_push_debug_information;
break;
case MENU_LABEL_CORE_COUNTERS:
cbs->action_deferred_push = deferred_push_core_counters;

View File

@ -912,6 +912,9 @@ static void menu_action_setting_disp_set_label(file_list_t* list,
case MENU_LABEL_SYSTEM_INFORMATION:
*w = 2;
break;
case MENU_LABEL_DEBUG_INFORMATION:
*w = 2;
break;
}
if (type >= MENU_SETTINGS_CORE_OPTION_START)
@ -1009,6 +1012,7 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
case MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
case MENU_LABEL_CORE_INFORMATION:
case MENU_LABEL_SYSTEM_INFORMATION:
case MENU_LABEL_DEBUG_INFORMATION:
cbs->action_get_value =
menu_action_setting_disp_set_label_menu_more;
break;

View File

@ -1807,6 +1807,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
case MENU_LABEL_CORE_INFORMATION:
case MENU_LABEL_SYSTEM_INFORMATION:
case MENU_LABEL_DEBUG_INFORMATION:
case MENU_LABEL_DISK_OPTIONS:
case MENU_LABEL_SETTINGS:
case MENU_LABEL_FRONTEND_COUNTERS:

View File

@ -617,6 +617,7 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_LOAD_CONTENT_HISTORY:
case MENU_LABEL_INFO_SCREEN:
case MENU_LABEL_SYSTEM_INFORMATION:
case MENU_LABEL_DEBUG_INFORMATION:
case MENU_LABEL_CORE_INFORMATION:
case MENU_LABEL_VIDEO_SHADER_PARAMETERS:
case MENU_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:

View File

@ -540,6 +540,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
return "menu_navigation_browser_filter_supported_extensions_enable";
case MENU_LABEL_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE:
return "core_updater_auto_extract_archive";
case MENU_LABEL_DEBUG_INFORMATION:
return "debug_information";
case MENU_LABEL_SYSTEM_INFORMATION:
return "system_information";
case MENU_LABEL_ONLINE_UPDATER:
@ -1170,6 +1172,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
return "Automatically extract downloaded archive";
case MENU_LABEL_VALUE_SYSTEM_INFORMATION:
return "System Information";
case MENU_LABEL_VALUE_DEBUG_INFORMATION:
return "Debug Information";
case MENU_LABEL_VALUE_ONLINE_UPDATER:
return "Online Updater";
case MENU_LABEL_VALUE_CORE_INFORMATION:

View File

@ -401,6 +401,46 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
return 0;
}
static int menu_displaylist_parse_debug_info(menu_displaylist_info_t *info)
{
char tmp[PATH_MAX_LENGTH] = {0};
char tmp2[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
snprintf(tmp, sizeof(tmp), "%s", menu_hash_to_str(MENU_LABEL_VALUE_SAVEFILE_DIRECTORY));
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", global->dir.savefile);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", global->name.savefile);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", menu_hash_to_str(MENU_LABEL_VALUE_SAVESTATE_DIRECTORY));
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", global->dir.savestate);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", global->name.savestate);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", menu_hash_to_str(MENU_LABEL_VALUE_SYSTEM_DIRECTORY));
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", settings->system_directory);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
snprintf(tmp, sizeof(tmp), "%s", global->dir.systemdir);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
return 0;
}
static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
{
int controller;
@ -1833,6 +1873,7 @@ static int menu_displaylist_parse_horizontal_content_actions(menu_displaylist_in
static int menu_displaylist_parse_information_list(menu_displaylist_info_t *info)
{
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_CORE_INFORMATION),
@ -1844,6 +1885,12 @@ static int menu_displaylist_parse_information_list(menu_displaylist_info_t *info
menu_hash_to_str(MENU_LABEL_SYSTEM_INFORMATION),
MENU_SETTING_ACTION, 0, 0);
if(settings->debug_panel_enable)
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_DEBUG_INFORMATION),
menu_hash_to_str(MENU_LABEL_DEBUG_INFORMATION),
MENU_SETTING_ACTION, 0, 0);
#ifdef HAVE_LIBRETRODB
menu_list_push(info->list, menu_hash_to_str(MENU_LABEL_VALUE_DATABASE_MANAGER),
menu_hash_to_str(MENU_LABEL_DATABASE_MANAGER_LIST),
@ -2359,6 +2406,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_HISTORY:
case DISPLAYLIST_OPTIONS_DISK:
case DISPLAYLIST_SYSTEM_INFO:
case DISPLAYLIST_DEBUG_INFO:
case DISPLAYLIST_CORES:
case DISPLAYLIST_CORES_DETECTED:
case DISPLAYLIST_CORES_UPDATER:
@ -2703,6 +2751,11 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
need_push = true;
need_refresh = true;
break;
case DISPLAYLIST_DEBUG_INFO:
menu_displaylist_parse_debug_info(info);
need_push = true;
need_refresh = true;
break;
case DISPLAYLIST_CORES_SUPPORTED:
case DISPLAYLIST_CORES_COLLECTION_SUPPORTED:
need_sort = true;

View File

@ -77,6 +77,7 @@ enum
DISPLAYLIST_SHADER_PARAMETERS,
DISPLAYLIST_SHADER_PARAMETERS_PRESET,
DISPLAYLIST_SYSTEM_INFO,
DISPLAYLIST_DEBUG_INFO,
DISPLAYLIST_LOAD_CONTENT_LIST,
DISPLAYLIST_INFORMATION_LIST,
DISPLAYLIST_CONTENT_SETTINGS,

View File

@ -658,7 +658,9 @@ extern "C" {
#define MENU_LABEL_LOAD_CONTENT_HISTORY 0xfe1d79e5U
#define MENU_LABEL_VALUE_LOAD_CONTENT_HISTORY 0x5b362286U
#define MENU_LABEL_SYSTEM_INFORMATION 0x206ebf0fU
#define MENU_LABEL_DEBUG_INFORMATION 0xeb0d82b1U
#define MENU_LABEL_VALUE_SYSTEM_INFORMATION 0xa62fd7f0U
#define MENU_LABEL_VALUE_DEBUG_INFORMATION 0xd8569f92U
#define MENU_LABEL_CORE_INFORMATION 0xb638e0d3U
#define MENU_LABEL_VALUE_CORE_INFORMATION 0x781981b4U
#define MENU_LABEL_VALUE_VIDEO_SHADER_PARAMETERS 0x5ace99b3U