mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 07:20:34 +00:00
Add option to disable core option categories
This commit is contained in:
parent
1c4895b8bf
commit
c4880ca840
@ -276,6 +276,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
|
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
|
||||||
|
|
||||||
|
/* Specifies whether cores are allowed to
|
||||||
|
* present core options in category submenus */
|
||||||
|
#define DEFAULT_CORE_OPTION_CATEGORY_ENABLE true
|
||||||
|
|
||||||
/* Specifies whether to cache core info
|
/* Specifies whether to cache core info
|
||||||
* into a single (compressed) file for improved
|
* into a single (compressed) file for improved
|
||||||
* load times on platforms with slow IO */
|
* load times on platforms with slow IO */
|
||||||
|
@ -1523,6 +1523,7 @@ static struct config_bool_setting *populate_settings_bool(
|
|||||||
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);
|
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);
|
||||||
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false);
|
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false);
|
||||||
SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false);
|
SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false);
|
||||||
|
SETTING_BOOL("core_option_category_enable", &settings->bools.core_option_category_enable, true, DEFAULT_CORE_OPTION_CATEGORY_ENABLE, false);
|
||||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||||
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, false, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, false, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
||||||
#else
|
#else
|
||||||
|
@ -794,6 +794,7 @@ typedef struct settings
|
|||||||
bool network_remote_enable_user[MAX_USERS];
|
bool network_remote_enable_user[MAX_USERS];
|
||||||
bool load_dummy_on_core_shutdown;
|
bool load_dummy_on_core_shutdown;
|
||||||
bool check_firmware_before_loading;
|
bool check_firmware_before_loading;
|
||||||
|
bool core_option_category_enable;
|
||||||
bool core_info_cache_enable;
|
bool core_info_cache_enable;
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
bool always_reload_core_on_run_content;
|
bool always_reload_core_on_run_content;
|
||||||
|
@ -1051,16 +1051,22 @@ static bool core_option_manager_parse_option(
|
|||||||
* @src_conf_path : Filesystem path from which to load
|
* @src_conf_path : Filesystem path from which to load
|
||||||
* initial config settings.
|
* initial config settings.
|
||||||
* @options_v2 : Pointer to retro_core_options_v2 struct
|
* @options_v2 : Pointer to retro_core_options_v2 struct
|
||||||
|
* @categorized : Flag specifying whether core option
|
||||||
|
* category information should be read
|
||||||
|
* from @options_v2
|
||||||
*
|
*
|
||||||
* Creates and initializes a core manager handle. Parses
|
* Creates and initializes a core manager handle. Parses
|
||||||
* information from a retro_core_options_v2 struct.
|
* information from a retro_core_options_v2 struct.
|
||||||
|
* If @categorized is false, all option category
|
||||||
|
* assignments will be ignored.
|
||||||
*
|
*
|
||||||
* Returns: handle to new core manager handle if successful,
|
* Returns: handle to new core manager handle if successful,
|
||||||
* otherwise NULL.
|
* otherwise NULL.
|
||||||
**/
|
**/
|
||||||
core_option_manager_t *core_option_manager_new(
|
core_option_manager_t *core_option_manager_new(
|
||||||
const char *conf_path, const char *src_conf_path,
|
const char *conf_path, const char *src_conf_path,
|
||||||
const struct retro_core_options_v2 *options_v2)
|
const struct retro_core_options_v2 *options_v2,
|
||||||
|
bool categorized)
|
||||||
{
|
{
|
||||||
const struct retro_core_option_v2_category *option_cat = NULL;
|
const struct retro_core_option_v2_category *option_cat = NULL;
|
||||||
const struct retro_core_option_v2_definition *option_def = NULL;
|
const struct retro_core_option_v2_definition *option_def = NULL;
|
||||||
@ -1107,9 +1113,9 @@ core_option_manager_t *core_option_manager_new(
|
|||||||
if (!string_is_empty(src_conf_path))
|
if (!string_is_empty(src_conf_path))
|
||||||
config_src = config_file_new_from_path_to_string(src_conf_path);
|
config_src = config_file_new_from_path_to_string(src_conf_path);
|
||||||
|
|
||||||
/* Get number of categories
|
/* Get number of categories, if required
|
||||||
* > Note: 'option_cat->info == NULL' is valid */
|
* > Note: 'option_cat->info == NULL' is valid */
|
||||||
if (option_cats)
|
if (categorized && option_cats)
|
||||||
{
|
{
|
||||||
for (option_cat = option_cats;
|
for (option_cat = option_cats;
|
||||||
!string_is_empty(option_cat->key) &&
|
!string_is_empty(option_cat->key) &&
|
||||||
|
@ -174,16 +174,22 @@ core_option_manager_t *core_option_manager_new_vars(
|
|||||||
* @src_conf_path : Filesystem path from which to load
|
* @src_conf_path : Filesystem path from which to load
|
||||||
* initial config settings.
|
* initial config settings.
|
||||||
* @options_v2 : Pointer to retro_core_options_v2 struct
|
* @options_v2 : Pointer to retro_core_options_v2 struct
|
||||||
|
* @categorized : Flag specifying whether core option
|
||||||
|
* category information should be read
|
||||||
|
* from @options_v2
|
||||||
*
|
*
|
||||||
* Creates and initializes a core manager handle. Parses
|
* Creates and initializes a core manager handle. Parses
|
||||||
* information from a retro_core_options_v2 struct.
|
* information from a retro_core_options_v2 struct.
|
||||||
|
* If @categorized is false, all option category
|
||||||
|
* assignments will be ignored.
|
||||||
*
|
*
|
||||||
* Returns: handle to new core manager handle if successful,
|
* Returns: handle to new core manager handle if successful,
|
||||||
* otherwise NULL.
|
* otherwise NULL.
|
||||||
**/
|
**/
|
||||||
core_option_manager_t *core_option_manager_new(
|
core_option_manager_t *core_option_manager_new(
|
||||||
const char *conf_path, const char *src_conf_path,
|
const char *conf_path, const char *src_conf_path,
|
||||||
const struct retro_core_options_v2 *options_v2);
|
const struct retro_core_options_v2 *options_v2,
|
||||||
|
bool categorized);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* core_option_manager_free:
|
* core_option_manager_free:
|
||||||
|
@ -1180,6 +1180,10 @@ MSG_HASH(
|
|||||||
MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE,
|
MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE,
|
||||||
"check_for_missing_firmware"
|
"check_for_missing_firmware"
|
||||||
)
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_LABEL_CORE_OPTION_CATEGORY_ENABLE,
|
||||||
|
"core_option_category_enable"
|
||||||
|
)
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE,
|
MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE,
|
||||||
"core_info_cache_enable"
|
"core_info_cache_enable"
|
||||||
|
@ -2948,6 +2948,14 @@ MSG_HASH(
|
|||||||
MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE,
|
MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE,
|
||||||
"Check if all the required firmware is present before attempting to load content."
|
"Check if all the required firmware is present before attempting to load content."
|
||||||
)
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_LABEL_VALUE_CORE_OPTION_CATEGORY_ENABLE,
|
||||||
|
"Core Option Categories"
|
||||||
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_SUBLABEL_CORE_OPTION_CATEGORY_ENABLE,
|
||||||
|
"Allow cores to present options in category-based submenus. NOTE: Core must be reloaded for changes to take effect."
|
||||||
|
)
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_LABEL_VALUE_CORE_INFO_CACHE_ENABLE,
|
MENU_ENUM_LABEL_VALUE_CORE_INFO_CACHE_ENABLE,
|
||||||
"Cache Core Info Files"
|
"Cache Core Info Files"
|
||||||
|
@ -361,6 +361,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_adaptive_vsync, MENU_
|
|||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_allow_rotate, MENU_ENUM_SUBLABEL_VIDEO_ALLOW_ROTATE)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_allow_rotate, MENU_ENUM_SUBLABEL_VIDEO_ALLOW_ROTATE)
|
||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_dummy_on_core_shutdown, MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_dummy_on_core_shutdown, MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN)
|
||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_dummy_check_missing_firmware, MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_dummy_check_missing_firmware, MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE)
|
||||||
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_option_category_enable, MENU_ENUM_SUBLABEL_CORE_OPTION_CATEGORY_ENABLE)
|
||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_info_cache_enable, MENU_ENUM_SUBLABEL_CORE_INFO_CACHE_ENABLE)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_info_cache_enable, MENU_ENUM_SUBLABEL_CORE_INFO_CACHE_ENABLE)
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_always_reload_core_on_run_content, MENU_ENUM_SUBLABEL_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_always_reload_core_on_run_content, MENU_ENUM_SUBLABEL_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT)
|
||||||
@ -3528,6 +3529,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE:
|
case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_dummy_check_missing_firmware);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_dummy_check_missing_firmware);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_CORE_OPTION_CATEGORY_ENABLE:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_option_category_enable);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE:
|
case MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_info_cache_enable);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_info_cache_enable);
|
||||||
break;
|
break;
|
||||||
|
@ -8913,6 +8913,7 @@ unsigned menu_displaylist_build_list(
|
|||||||
{MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN, PARSE_ONLY_BOOL},
|
||||||
{MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE, PARSE_ONLY_BOOL},
|
||||||
{MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE, PARSE_ONLY_BOOL},
|
||||||
|
{MENU_ENUM_LABEL_CORE_OPTION_CATEGORY_ENABLE, PARSE_ONLY_BOOL},
|
||||||
{MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE, PARSE_ONLY_BOOL},
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
{MENU_ENUM_LABEL_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT, PARSE_ONLY_BOOL},
|
||||||
|
@ -9636,9 +9636,9 @@ static bool setting_append_list(
|
|||||||
{
|
{
|
||||||
unsigned i, listing = 0;
|
unsigned i, listing = 0;
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
struct bool_entry bool_entries[8];
|
struct bool_entry bool_entries[9];
|
||||||
#else
|
#else
|
||||||
struct bool_entry bool_entries[7];
|
struct bool_entry bool_entries[8];
|
||||||
#endif
|
#endif
|
||||||
START_GROUP(list, list_info, &group_info,
|
START_GROUP(list, list_info, &group_info,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS), parent_group);
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS), parent_group);
|
||||||
@ -9693,6 +9693,13 @@ static bool setting_append_list(
|
|||||||
bool_entries[listing].flags = SD_FLAG_ADVANCED;
|
bool_entries[listing].flags = SD_FLAG_ADVANCED;
|
||||||
listing++;
|
listing++;
|
||||||
|
|
||||||
|
bool_entries[listing].target = &settings->bools.core_option_category_enable;
|
||||||
|
bool_entries[listing].name_enum_idx = MENU_ENUM_LABEL_CORE_OPTION_CATEGORY_ENABLE;
|
||||||
|
bool_entries[listing].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CORE_OPTION_CATEGORY_ENABLE;
|
||||||
|
bool_entries[listing].default_value = DEFAULT_CORE_OPTION_CATEGORY_ENABLE;
|
||||||
|
bool_entries[listing].flags = SD_FLAG_NONE;
|
||||||
|
listing++;
|
||||||
|
|
||||||
bool_entries[listing].target = &settings->bools.core_info_cache_enable;
|
bool_entries[listing].target = &settings->bools.core_info_cache_enable;
|
||||||
bool_entries[listing].name_enum_idx = MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE;
|
bool_entries[listing].name_enum_idx = MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE;
|
||||||
bool_entries[listing].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CORE_INFO_CACHE_ENABLE;
|
bool_entries[listing].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CORE_INFO_CACHE_ENABLE;
|
||||||
|
@ -2152,6 +2152,7 @@ enum msg_hash_enums
|
|||||||
|
|
||||||
MENU_LABEL(DUMMY_ON_CORE_SHUTDOWN),
|
MENU_LABEL(DUMMY_ON_CORE_SHUTDOWN),
|
||||||
MENU_LABEL(CHECK_FOR_MISSING_FIRMWARE),
|
MENU_LABEL(CHECK_FOR_MISSING_FIRMWARE),
|
||||||
|
MENU_LABEL(CORE_OPTION_CATEGORY_ENABLE),
|
||||||
MENU_LABEL(CORE_INFO_CACHE_ENABLE),
|
MENU_LABEL(CORE_INFO_CACHE_ENABLE),
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
MENU_LABEL(ALWAYS_RELOAD_CORE_ON_RUN_CONTENT),
|
MENU_LABEL(ALWAYS_RELOAD_CORE_ON_RUN_CONTENT),
|
||||||
|
25
retroarch.c
25
retroarch.c
@ -16601,6 +16601,8 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
{
|
{
|
||||||
const struct retro_core_options_v2 *options_v2 =
|
const struct retro_core_options_v2 *options_v2 =
|
||||||
(const struct retro_core_options_v2 *)data;
|
(const struct retro_core_options_v2 *)data;
|
||||||
|
bool categories_enabled =
|
||||||
|
settings->bools.core_option_category_enable;
|
||||||
|
|
||||||
if (runloop_state.core_options)
|
if (runloop_state.core_options)
|
||||||
retroarch_deinit_core_options(p_rarch,
|
retroarch_deinit_core_options(p_rarch,
|
||||||
@ -16608,6 +16610,12 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
|
|
||||||
if (options_v2)
|
if (options_v2)
|
||||||
rarch_init_core_options(p_rarch, options_v2);
|
rarch_init_core_options(p_rarch, options_v2);
|
||||||
|
|
||||||
|
/* Return value does not indicate success.
|
||||||
|
* Callback returns 'true' if core option
|
||||||
|
* categories are supported/enabled,
|
||||||
|
* otherwise 'false'. */
|
||||||
|
return categories_enabled;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -16620,6 +16628,8 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
struct retro_core_options_v2 *options_v2 =
|
struct retro_core_options_v2 *options_v2 =
|
||||||
core_option_manager_convert_v2_intl(
|
core_option_manager_convert_v2_intl(
|
||||||
(const struct retro_core_options_v2_intl*)data);
|
(const struct retro_core_options_v2_intl*)data);
|
||||||
|
bool categories_enabled =
|
||||||
|
settings->bools.core_option_category_enable;
|
||||||
|
|
||||||
if (runloop_state.core_options)
|
if (runloop_state.core_options)
|
||||||
retroarch_deinit_core_options(p_rarch,
|
retroarch_deinit_core_options(p_rarch,
|
||||||
@ -16633,6 +16643,12 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
/* Clean up */
|
/* Clean up */
|
||||||
core_option_manager_free_converted(options_v2);
|
core_option_manager_free_converted(options_v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return value does not indicate success.
|
||||||
|
* Callback returns 'true' if core option
|
||||||
|
* categories are supported/enabled,
|
||||||
|
* otherwise 'false'. */
|
||||||
|
return categories_enabled;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -36010,12 +36026,14 @@ static void rarch_init_core_options(
|
|||||||
struct rarch_state *p_rarch,
|
struct rarch_state *p_rarch,
|
||||||
const struct retro_core_options_v2 *options_v2)
|
const struct retro_core_options_v2 *options_v2)
|
||||||
{
|
{
|
||||||
|
settings_t *settings = p_rarch->configuration_settings;
|
||||||
|
bool categories_enabled = settings->bools.core_option_category_enable;
|
||||||
char options_path[PATH_MAX_LENGTH];
|
char options_path[PATH_MAX_LENGTH];
|
||||||
char src_options_path[PATH_MAX_LENGTH];
|
char src_options_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
/* Ensure these are NULL-terminated */
|
/* Ensure these are NULL-terminated */
|
||||||
options_path[0] = '\0';
|
options_path[0] = '\0';
|
||||||
src_options_path[0] = '\0';
|
src_options_path[0] = '\0';
|
||||||
|
|
||||||
/* Get core options file path */
|
/* Get core options file path */
|
||||||
rarch_init_core_options_path(p_rarch,
|
rarch_init_core_options_path(p_rarch,
|
||||||
@ -36025,7 +36043,8 @@ static void rarch_init_core_options(
|
|||||||
if (!string_is_empty(options_path))
|
if (!string_is_empty(options_path))
|
||||||
runloop_state.core_options =
|
runloop_state.core_options =
|
||||||
core_option_manager_new(options_path,
|
core_option_manager_new(options_path,
|
||||||
src_options_path, options_v2);
|
src_options_path, options_v2,
|
||||||
|
categories_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void retroarch_init_task_queue(void)
|
void retroarch_init_task_queue(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user