Implement Core Settings and implement 'Core Supports No Content Enable'

This commit is contained in:
twinaphex 2015-04-28 03:22:04 +02:00
parent 560d28b188
commit f6586f7cde
5 changed files with 72 additions and 20 deletions

View File

@ -630,6 +630,8 @@ static void config_set_defaults(void)
settings->input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
}
settings->core.set_supports_no_game_enable = true;
global->console.screen.viewports.custom_vp.width = 0;
global->console.screen.viewports.custom_vp.height = 0;
global->console.screen.viewports.custom_vp.x = 0;
@ -1249,6 +1251,8 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, video.force_srgb_disable, "video_force_srgb_disable");
CONFIG_GET_BOOL_BASE(conf, settings, core.set_supports_no_game_enable, "core_set_supports_no_game_enable");
#ifdef RARCH_CONSOLE
/* TODO - will be refactored later to make it more clean - it's more
* important that it works for consoles right now */
@ -2489,6 +2493,8 @@ bool config_save_file(const char *path)
config_set_bool(conf, "log_verbosity", global->verbosity);
config_set_bool(conf, "perfcnt_enable", global->perfcnt_enable);
config_set_bool(conf, "core_set_supports_no_game_enable", settings->core.set_supports_no_game_enable);
config_set_int(conf, "archive_mode", settings->archive.mode);
ret = config_file_write(conf, path);

View File

@ -259,6 +259,11 @@ typedef struct settings
bool buildbot_auto_extract_archive;
} network;
struct
{
bool set_supports_no_game_enable;
} core;
int state_slot;
char core_options_path[PATH_MAX_LENGTH];

View File

@ -697,7 +697,8 @@ static int action_ok_core_load(const char *path,
menu_list_flush_stack(menu->menu_list, MENU_SETTINGS);
#if defined(HAVE_DYNAMIC)
/* No content needed for this core, load core immediately. */
if (menu->load_no_content)
if (menu->load_no_content && settings->core.set_supports_no_game_enable)
{
*global->fullpath = '\0';

View File

@ -3588,6 +3588,39 @@ static bool setting_append_list_driver_options(
return true;
}
static bool setting_append_list_core_options(
rarch_setting_t **list,
rarch_setting_info_t *list_info)
{
rarch_setting_group_info_t group_info;
rarch_setting_group_info_t subgroup_info;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
START_GROUP(group_info, "Core Settings");
START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info);
CONFIG_BOOL(
settings->core.set_supports_no_game_enable,
"core_set_supports_no_game_enable",
"Supports No Content Enable",
true,
"OFF",
"ON",
group_info.name,
subgroup_info.name,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
END_SUB_GROUP(list, list_info);
END_GROUP(list, list_info);
return true;
}
static bool setting_append_list_general_options(
rarch_setting_t **list,
rarch_setting_info_t *list_info)
@ -6448,6 +6481,12 @@ rarch_setting_t *setting_new(unsigned mask)
goto error;
}
if (mask & SL_FLAG_CORE_OPTIONS)
{
if (!setting_append_list_core_options(&list, list_info))
goto error;
}
if (mask & SL_FLAG_GENERAL_OPTIONS)
{
if (!setting_append_list_general_options(&list, list_info))

View File

@ -66,25 +66,26 @@ enum setting_list_flags
{
SL_FLAG_MAIN_MENU = (1 << 0),
SL_FLAG_DRIVER_OPTIONS = (1 << 1),
SL_FLAG_GENERAL_OPTIONS = (1 << 2),
SL_FLAG_VIDEO_OPTIONS = (1 << 3),
SL_FLAG_SHADER_OPTIONS = (1 << 4),
SL_FLAG_FONT_OPTIONS = (1 << 5),
SL_FLAG_AUDIO_OPTIONS = (1 << 6),
SL_FLAG_INPUT_OPTIONS = (1 << 7),
SL_FLAG_OVERLAY_OPTIONS = (1 << 8),
SL_FLAG_OSK_OVERLAY_OPTIONS = (1 << 9),
SL_FLAG_MENU_OPTIONS = (1 << 10),
SL_FLAG_UI_OPTIONS = (1 << 11),
SL_FLAG_CORE_UPDATER_OPTIONS = (1 << 12),
SL_FLAG_NETPLAY_OPTIONS = (1 << 13),
SL_FLAG_USER_OPTIONS = (1 << 14),
SL_FLAG_PATH_OPTIONS = (1 << 15),
SL_FLAG_PRIVACY_OPTIONS = (1 << 16),
SL_FLAG_PLAYLIST_OPTIONS = (1 << 17),
SL_FLAG_ARCHIVE_OPTIONS = (1 << 18),
SL_FLAG_PATCH_OPTIONS = (1 << 19),
SL_FLAG_ALL = (1 << 20),
SL_FLAG_CORE_OPTIONS = (1 << 2),
SL_FLAG_GENERAL_OPTIONS = (1 << 3),
SL_FLAG_VIDEO_OPTIONS = (1 << 4),
SL_FLAG_SHADER_OPTIONS = (1 << 5),
SL_FLAG_FONT_OPTIONS = (1 << 6),
SL_FLAG_AUDIO_OPTIONS = (1 << 7),
SL_FLAG_INPUT_OPTIONS = (1 << 8),
SL_FLAG_OVERLAY_OPTIONS = (1 << 9),
SL_FLAG_OSK_OVERLAY_OPTIONS = (1 << 10),
SL_FLAG_MENU_OPTIONS = (1 << 11),
SL_FLAG_UI_OPTIONS = (1 << 12),
SL_FLAG_CORE_UPDATER_OPTIONS = (1 << 13),
SL_FLAG_NETPLAY_OPTIONS = (1 << 14),
SL_FLAG_USER_OPTIONS = (1 << 15),
SL_FLAG_PATH_OPTIONS = (1 << 16),
SL_FLAG_PRIVACY_OPTIONS = (1 << 17),
SL_FLAG_PLAYLIST_OPTIONS = (1 << 18),
SL_FLAG_ARCHIVE_OPTIONS = (1 << 19),
SL_FLAG_PATCH_OPTIONS = (1 << 20),
SL_FLAG_ALL = (1 << 21),
};
#define SL_FLAG_ALL_SETTINGS (SL_FLAG_ALL - SL_FLAG_MAIN_MENU)