diff --git a/frontend/info/core_info.c b/frontend/info/core_info.c index 5d32e90f7c..6af5fc0e85 100644 --- a/frontend/info/core_info.c +++ b/frontend/info/core_info.c @@ -79,7 +79,7 @@ static void core_info_list_resolve_all_firmware(core_info_list_t *core_info_list snprintf(desc_key, sizeof(desc_key), "firmware%u_desc", c); config_get_string(info->data, path_key, &info->firmware[c].path); - config_get_string(info->data, path_key, &info->firmware[c].desc); + config_get_string(info->data, desc_key, &info->firmware[c].desc); } } } @@ -132,7 +132,10 @@ core_info_list_t *core_info_list_new(const char *modules_path) if (core_info[i].data) { + unsigned count=0; config_get_string(core_info[i].data, "display_name", &core_info[i].display_name); + config_get_uint(core_info[i].data, "firmware_count", &count); + core_info[i].firmware_count=count; if (config_get_string(core_info[i].data, "supported_extensions", &core_info[i].supported_extensions) && core_info[i].supported_extensions) core_info[i].supported_extensions_list = string_split(core_info[i].supported_extensions, "|"); @@ -144,6 +147,9 @@ core_info_list_t *core_info_list_new(const char *modules_path) if (config_get_string(core_info[i].data, "permissions", &core_info[i].permissions) && core_info[i].permissions) core_info[i].permissions_list = string_split(core_info[i].permissions, "|"); + if (config_get_string(core_info[i].data, "notes", &core_info[i].notes) && + core_info[i].notes) + core_info[i].note_list = string_split(core_info[i].notes, "|"); } if (!core_info[i].display_name) @@ -178,8 +184,10 @@ void core_info_list_free(core_info_list_t *core_info_list) free(info->supported_extensions); free(info->authors); free(info->permissions); + free(info->notes); string_list_free(info->supported_extensions_list); string_list_free(info->authors_list); + string_list_free(info->note_list); string_list_free(info->permissions_list); config_file_free(info->data); diff --git a/frontend/info/core_info.h b/frontend/info/core_info.h index 3572824c81..12da74609d 100644 --- a/frontend/info/core_info.h +++ b/frontend/info/core_info.h @@ -39,6 +39,8 @@ typedef struct char *supported_extensions; char *authors; char *permissions; + char *notes; + struct string_list *note_list; struct string_list *supported_extensions_list; struct string_list *authors_list; struct string_list *permissions_list; diff --git a/frontend/menu/disp/rgui.c b/frontend/menu/disp/rgui.c index 5aca48de34..d2ac655465 100644 --- a/frontend/menu/disp/rgui.c +++ b/frontend/menu/disp/rgui.c @@ -320,6 +320,8 @@ static void rgui_render(void *data) strlcpy(title, "DISK OPTIONS", sizeof(title)); else if (menu_type == RGUI_SETTINGS_CORE_OPTIONS) strlcpy(title, "CORE OPTIONS", sizeof(title)); + else if (menu_type == RGUI_SETTINGS_CORE_INFO) + strlcpy(title, "CORE INFO", sizeof(title)); #ifdef HAVE_SHADER_MANAGER else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS) snprintf(title, sizeof(title), "SHADER %s", dir); diff --git a/frontend/menu/disp/rmenu.c b/frontend/menu/disp/rmenu.c index 21c9a6c0b4..2e545890e6 100644 --- a/frontend/menu/disp/rmenu.c +++ b/frontend/menu/disp/rmenu.c @@ -180,6 +180,8 @@ static void rmenu_render(void *data) strlcpy(title, "DISK OPTIONS", sizeof(title)); else if (menu_type == RGUI_SETTINGS_CORE_OPTIONS) strlcpy(title, "CORE OPTIONS", sizeof(title)); + else if (menu_type == RGUI_SETTINGS_CORE_INFO) + strlcpy(title, "CORE INFO", sizeof(title)); #ifdef HAVE_SHADER_MANAGER else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS) snprintf(title, sizeof(title), "SHADER %s", dir); diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index 9d3ef4de75..daeda8bc35 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -974,6 +974,7 @@ static int menu_settings_iterate(void *data, unsigned action) || menu_type == RGUI_SETTINGS_NETPLAY_OPTIONS || menu_type == RGUI_SETTINGS_OPTIONS || menu_type == RGUI_SETTINGS_DRIVERS + || menu_type == RGUI_SETTINGS_CORE_INFO || menu_type == RGUI_SETTINGS_CORE_OPTIONS || menu_type == RGUI_SETTINGS_AUDIO_OPTIONS || menu_type == RGUI_SETTINGS_DISK_OPTIONS @@ -1815,7 +1816,7 @@ void menu_populate_entries(void *data, unsigned menu_type) { rgui_handle_t *rgui = (rgui_handle_t*)data; unsigned i, last; - + char tmp[256]; switch (menu_type) { #ifdef HAVE_SHADER_MANAGER @@ -1909,7 +1910,7 @@ void menu_populate_entries(void *data, unsigned menu_type) file_list_push(rgui->selection_buf, "Crop Overscan (reload)", RGUI_SETTINGS_VIDEO_CROP_OVERSCAN, 0); file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0); break; - case RGUI_SETTINGS_CORE_OPTIONS: + case RGUI_SETTINGS_CORE_OPTIONS: file_list_clear(rgui->selection_buf); if (g_extern.system.core_options) @@ -1923,7 +1924,51 @@ void menu_populate_entries(void *data, unsigned menu_type) } else file_list_push(rgui->selection_buf, "No options available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0); - break; + break; + case RGUI_SETTINGS_CORE_INFO: + + if(rgui->core_info_current.data) + { + + file_list_clear(rgui->selection_buf); + 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); + snprintf(tmp, sizeof(tmp), "Authors: %s", rgui->core_info_current.authors ? rgui->core_info_current.authors : ""); + file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0); + snprintf(tmp, sizeof(tmp), "Permissions: %s", rgui->core_info_current.permissions ? rgui->core_info_current.permissions : ""); + file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0); + snprintf(tmp, sizeof(tmp), "Supported extensions: %s", rgui->core_info_current.supported_extensions ? rgui->core_info_current.supported_extensions : ""); + file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0); + + if(rgui->core_info_current.firmware_count>0) + { + file_list_push(rgui->selection_buf, "Required firmware:", RGUI_SETTINGS_CORE_INFO_NONE, 0); + for(i=0;icore_info_current.firmware_count;i++) + { + snprintf(tmp, sizeof(tmp), " Name: %s, %s", rgui->core_info_current.firmware[i].desc ? rgui->core_info_current.firmware[i].desc : "",rgui->core_info_current.firmware[i].missing ? "missing" : "present"); + file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0); + } + } + printf("test2 \n"); + 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;icore_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_clear(rgui->selection_buf); + 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); file_list_push(rgui->selection_buf, "General Options", RGUI_SETTINGS_GENERAL_OPTIONS, 0); @@ -2058,6 +2103,7 @@ void menu_populate_entries(void *data, unsigned menu_type) } file_list_push(rgui->selection_buf, "Core Options", RGUI_SETTINGS_CORE_OPTIONS, 0); + file_list_push(rgui->selection_buf, "Core Information", RGUI_SETTINGS_CORE_INFO, 0); file_list_push(rgui->selection_buf, "Settings", RGUI_SETTINGS_OPTIONS, 0); file_list_push(rgui->selection_buf, "Drivers", RGUI_SETTINGS_DRIVERS, 0); diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index ea5667e264..248aa87585 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -103,6 +103,7 @@ typedef enum RGUI_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE, RGUI_SETTINGS_OPEN_HISTORY, RGUI_SETTINGS_CORE, + RGUI_SETTINGS_CORE_INFO, RGUI_SETTINGS_DEFERRED_CORE, RGUI_SETTINGS_CONFIG, RGUI_SETTINGS_SAVE_CONFIG, @@ -242,8 +243,7 @@ typedef enum RGUI_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, RGUI_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, RGUI_SETTINGS_BIND_LAST = RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS, - - + RGUI_SETTINGS_CORE_INFO_NONE = 0xffff, RGUI_SETTINGS_CORE_OPTION_NONE = 0xffff, RGUI_SETTINGS_CORE_OPTION_START = 0x10000 } rgui_file_type_t; diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index 2b0c5ab103..8e500795d8 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -93,6 +93,7 @@ unsigned menu_type_is(unsigned type) type == RGUI_SETTINGS || type == RGUI_SETTINGS_GENERAL_OPTIONS || type == RGUI_SETTINGS_CORE_OPTIONS || + type == RGUI_SETTINGS_CORE_INFO || type == RGUI_SETTINGS_VIDEO_OPTIONS || type == RGUI_SETTINGS_SHADER_OPTIONS || type == RGUI_SETTINGS_AUDIO_OPTIONS ||