mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Menu) Turn core_info_current into void*
This commit is contained in:
parent
d3c36ad5ad
commit
8f8f757d65
@ -213,70 +213,74 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
|
||||
file_list_push(rgui->selection_buf, "No options available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0);
|
||||
break;
|
||||
case RGUI_SETTINGS_CORE_INFO:
|
||||
file_list_clear(rgui->selection_buf);
|
||||
if (rgui->core_info_current.data)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "Core name: %s",
|
||||
rgui->core_info_current.display_name ? rgui->core_info_current.display_name : "");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
core_info_t *info = (core_info_t*)rgui->core_info_current;
|
||||
file_list_clear(rgui->selection_buf);
|
||||
|
||||
if (rgui->core_info_current.authors_list)
|
||||
if (info->data)
|
||||
{
|
||||
strlcpy(tmp, "Authors: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.authors_list, ", ");
|
||||
snprintf(tmp, sizeof(tmp), "Core name: %s",
|
||||
info->display_name ? info->display_name : "");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
if (rgui->core_info_current.permissions_list)
|
||||
{
|
||||
strlcpy(tmp, "Permissions: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.permissions_list, ", ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
if (rgui->core_info_current.supported_extensions_list)
|
||||
{
|
||||
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.supported_extensions_list, ", ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
if (rgui->core_info_current.firmware_count > 0)
|
||||
{
|
||||
core_info_list_update_missing_firmware(rgui->core_info, rgui->core_info_current.path,
|
||||
g_settings.system_directory);
|
||||
|
||||
file_list_push(rgui->selection_buf, "Firmware: ", RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
for (i = 0; i < rgui->core_info_current.firmware_count; i++)
|
||||
if (info->authors_list)
|
||||
{
|
||||
if (rgui->core_info_current.firmware[i].desc)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), " name: %s",
|
||||
rgui->core_info_current.firmware[i].desc ? rgui->core_info_current.firmware[i].desc : "");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
strlcpy(tmp, "Authors: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), info->authors_list, ", ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
snprintf(tmp, sizeof(tmp), " status: %s, %s",
|
||||
rgui->core_info_current.firmware[i].missing ? "missing" : "present",
|
||||
rgui->core_info_current.firmware[i].optional ? "optional" : "required");
|
||||
if (info->permissions_list)
|
||||
{
|
||||
strlcpy(tmp, "Permissions: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), info->permissions_list, ", ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
if (info->supported_extensions_list)
|
||||
{
|
||||
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
|
||||
string_list_join_concat(tmp, sizeof(tmp), info->supported_extensions_list, ", ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
|
||||
if (info->firmware_count > 0)
|
||||
{
|
||||
core_info_list_update_missing_firmware(rgui->core_info, info->path,
|
||||
g_settings.system_directory);
|
||||
|
||||
file_list_push(rgui->selection_buf, "Firmware: ", RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
for (i = 0; i < info->firmware_count; i++)
|
||||
{
|
||||
if (info->firmware[i].desc)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), " name: %s",
|
||||
info->firmware[i].desc ? info->firmware[i].desc : "");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
|
||||
snprintf(tmp, sizeof(tmp), " status: %s, %s",
|
||||
info->firmware[i].missing ? "missing" : "present",
|
||||
info->firmware[i].optional ? "optional" : "required");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (info->notes)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "Core notes: ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
|
||||
for (i = 0; i < info->note_list->size; i++)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), " %s", info->note_list->elems[i].data);
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rgui->core_info_current.notes)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "Core notes: ");
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
|
||||
for (i = 0; i < rgui->core_info_current.note_list->size; i++)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), " %s", rgui->core_info_current.note_list->elems[i].data);
|
||||
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
file_list_push(rgui->selection_buf, "No information available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0);
|
||||
}
|
||||
else
|
||||
file_list_push(rgui->selection_buf, "No information available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0);
|
||||
break;
|
||||
case RGUI_SETTINGS_OPTIONS:
|
||||
file_list_clear(rgui->selection_buf);
|
||||
|
@ -29,9 +29,9 @@ void menu_update_system_info(void *data, bool *load_no_rom)
|
||||
// Keep track of info for the currently selected core.
|
||||
if (rgui->core_info)
|
||||
{
|
||||
if (core_info_list_get_info(rgui->core_info, &rgui->core_info_current, g_settings.libretro))
|
||||
if (core_info_list_get_info(rgui->core_info, rgui->core_info_current, g_settings.libretro))
|
||||
{
|
||||
const core_info_t *info = &rgui->core_info_current;
|
||||
const core_info_t *info = (const core_info_t*)rgui->core_info_current;
|
||||
|
||||
RARCH_LOG("[Core Info]:\n");
|
||||
if (info->display_name)
|
||||
@ -229,7 +229,6 @@ static void menu_update_libretro_info(void *data)
|
||||
retro_get_system_info(&rgui->info);
|
||||
#endif
|
||||
|
||||
memset(&rgui->core_info_current, 0, sizeof(rgui->core_info_current));
|
||||
core_info_list_free(rgui->core_info);
|
||||
rgui->core_info = NULL;
|
||||
if (*g_settings.libretro_directory)
|
||||
@ -323,6 +322,7 @@ void *menu_init(const void *data)
|
||||
|
||||
rgui->menu_stack = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
rgui->selection_buf = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
rgui->core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
|
||||
file_list_push(rgui->menu_stack, "", RGUI_SETTINGS, 0);
|
||||
menu_clear_navigation(rgui);
|
||||
rgui->push_start_screen = g_settings.rgui_show_start_screen;
|
||||
@ -368,6 +368,9 @@ void menu_free(void *data)
|
||||
rom_history_free(rgui->history);
|
||||
core_info_list_free(rgui->core_info);
|
||||
|
||||
if (rgui->core_info_current)
|
||||
free(rgui->core_info_current);
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ typedef struct
|
||||
bool push_start_screen;
|
||||
|
||||
void *core_info;
|
||||
core_info_t core_info_current;
|
||||
void *core_info_current;
|
||||
bool defer_core;
|
||||
char deferred_path[PATH_MAX];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user