(menu_displaylist.c) Cleanups
This commit is contained in:
parent
167ddb75ef
commit
a87b674ab7
|
@ -201,133 +201,133 @@ static void menu_displaylist_parse_drive_list(file_list_t *list)
|
||||||
static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
|
static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
settings_t *settings = config_get_ptr();
|
char tmp[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
core_info_t *core_info = (core_info_t*)global->core_info_current;
|
global_t *global = global_get_ptr();
|
||||||
|
core_info_t *core_info = global ? (core_info_t*)global->core_info_current : NULL;
|
||||||
|
|
||||||
if (core_info && core_info->data)
|
if (!core_info || !core_info->data)
|
||||||
{
|
{
|
||||||
char tmp[PATH_MAX_LENGTH] = {0};
|
menu_list_push(info->list,
|
||||||
|
"No information available.", "",
|
||||||
|
0, 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "Core name: %s",
|
snprintf(tmp, sizeof(tmp), "Core name: %s",
|
||||||
core_info->core_name ? core_info->core_name : "");
|
core_info->core_name ? core_info->core_name : "");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "Core label: %s",
|
||||||
|
core_info->display_name ? core_info->display_name : "");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
|
||||||
|
if (core_info->systemname)
|
||||||
|
{
|
||||||
|
snprintf(tmp, sizeof(tmp), "System name: %s",
|
||||||
|
core_info->systemname);
|
||||||
menu_list_push(info->list, tmp, "",
|
menu_list_push(info->list, tmp, "",
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "Core label: %s",
|
if (core_info->system_manufacturer)
|
||||||
core_info->display_name ? core_info->display_name : "");
|
{
|
||||||
|
snprintf(tmp, sizeof(tmp), "System manufacturer: %s",
|
||||||
|
core_info->system_manufacturer);
|
||||||
menu_list_push(info->list, tmp, "",
|
menu_list_push(info->list, tmp, "",
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (core_info->systemname)
|
if (core_info->categories_list)
|
||||||
|
{
|
||||||
|
strlcpy(tmp, "Categories: ", sizeof(tmp));
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_info->categories_list, ", ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core_info->authors_list)
|
||||||
|
{
|
||||||
|
strlcpy(tmp, "Authors: ", sizeof(tmp));
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_info->authors_list, ", ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core_info->permissions_list)
|
||||||
|
{
|
||||||
|
strlcpy(tmp, "Permissions: ", sizeof(tmp));
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_info->permissions_list, ", ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core_info->licenses_list)
|
||||||
|
{
|
||||||
|
strlcpy(tmp, "License(s): ", sizeof(tmp));
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_info->licenses_list, ", ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core_info->supported_extensions_list)
|
||||||
|
{
|
||||||
|
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_info->supported_extensions_list, ", ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core_info->firmware_count > 0)
|
||||||
|
{
|
||||||
|
core_info_list_update_missing_firmware(
|
||||||
|
global->core_info, core_info->path,
|
||||||
|
settings->system_directory);
|
||||||
|
|
||||||
|
menu_list_push(info->list, "Firmware: ", "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
for (i = 0; i < core_info->firmware_count; i++)
|
||||||
{
|
{
|
||||||
snprintf(tmp, sizeof(tmp), "System name: %s",
|
if (core_info->firmware[i].desc)
|
||||||
core_info->systemname);
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->system_manufacturer)
|
|
||||||
{
|
|
||||||
snprintf(tmp, sizeof(tmp), "System manufacturer: %s",
|
|
||||||
core_info->system_manufacturer);
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->categories_list)
|
|
||||||
{
|
|
||||||
strlcpy(tmp, "Categories: ", sizeof(tmp));
|
|
||||||
string_list_join_concat(tmp, sizeof(tmp),
|
|
||||||
core_info->categories_list, ", ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->authors_list)
|
|
||||||
{
|
|
||||||
strlcpy(tmp, "Authors: ", sizeof(tmp));
|
|
||||||
string_list_join_concat(tmp, sizeof(tmp),
|
|
||||||
core_info->authors_list, ", ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->permissions_list)
|
|
||||||
{
|
|
||||||
strlcpy(tmp, "Permissions: ", sizeof(tmp));
|
|
||||||
string_list_join_concat(tmp, sizeof(tmp),
|
|
||||||
core_info->permissions_list, ", ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->licenses_list)
|
|
||||||
{
|
|
||||||
strlcpy(tmp, "License(s): ", sizeof(tmp));
|
|
||||||
string_list_join_concat(tmp, sizeof(tmp),
|
|
||||||
core_info->licenses_list, ", ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->supported_extensions_list)
|
|
||||||
{
|
|
||||||
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
|
|
||||||
string_list_join_concat(tmp, sizeof(tmp),
|
|
||||||
core_info->supported_extensions_list, ", ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->firmware_count > 0)
|
|
||||||
{
|
|
||||||
core_info_list_update_missing_firmware(
|
|
||||||
global->core_info, core_info->path,
|
|
||||||
settings->system_directory);
|
|
||||||
|
|
||||||
menu_list_push(info->list, "Firmware: ", "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
for (i = 0; i < core_info->firmware_count; i++)
|
|
||||||
{
|
{
|
||||||
if (core_info->firmware[i].desc)
|
snprintf(tmp, sizeof(tmp), " name: %s",
|
||||||
{
|
core_info->firmware[i].desc ?
|
||||||
snprintf(tmp, sizeof(tmp), " name: %s",
|
core_info->firmware[i].desc : "");
|
||||||
core_info->firmware[i].desc ?
|
menu_list_push(info->list, tmp, "",
|
||||||
core_info->firmware[i].desc : "");
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), " status: %s, %s",
|
snprintf(tmp, sizeof(tmp), " status: %s, %s",
|
||||||
core_info->firmware[i].missing ?
|
core_info->firmware[i].missing ?
|
||||||
"missing" : "present",
|
"missing" : "present",
|
||||||
core_info->firmware[i].optional ?
|
core_info->firmware[i].optional ?
|
||||||
"optional" : "required");
|
"optional" : "required");
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_info->notes)
|
|
||||||
{
|
|
||||||
snprintf(tmp, sizeof(tmp), "Core notes: ");
|
|
||||||
menu_list_push(info->list, tmp, "",
|
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
|
||||||
|
|
||||||
for (i = 0; i < core_info->note_list->size; i++)
|
|
||||||
{
|
|
||||||
snprintf(tmp, sizeof(tmp), " %s",
|
|
||||||
core_info->note_list->elems[i].data);
|
|
||||||
menu_list_push(info->list, tmp, "",
|
menu_list_push(info->list, tmp, "",
|
||||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
menu_list_push(info->list,
|
if (core_info->notes)
|
||||||
"No information available.", "",
|
{
|
||||||
0, 0, 0);
|
snprintf(tmp, sizeof(tmp), "Core notes: ");
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
|
||||||
|
for (i = 0; i < core_info->note_list->size; i++)
|
||||||
|
{
|
||||||
|
snprintf(tmp, sizeof(tmp), " %s",
|
||||||
|
core_info->note_list->elems[i].data);
|
||||||
|
menu_list_push(info->list, tmp, "",
|
||||||
|
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue