mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Add load_dummy_on_core_shutdown option to cfg and RGUI
This commit is contained in:
parent
f0f615c38a
commit
125d9e837e
@ -253,6 +253,12 @@ static const unsigned monitor_index = 0; // Which monitor to prefer. 0 is any mo
|
||||
static const unsigned fullscreen_x = 0; // Fullscreen resolution. A value of 0 uses the desktop resolution.
|
||||
static const unsigned fullscreen_y = 0;
|
||||
|
||||
#if defined(RARCH_CONSOLE) || defined(__APPLE__)
|
||||
static const bool load_dummy_on_core_shutdown = false;
|
||||
#else
|
||||
static const bool load_dummy_on_core_shutdown = true;
|
||||
#endif
|
||||
|
||||
// Forcibly disable composition. Only valid on Windows Vista/7 for now.
|
||||
static const bool disable_composition = false;
|
||||
|
||||
|
@ -117,12 +117,6 @@ static void rarch_get_environment_console(void)
|
||||
#define attempt_load_game_fails (1ULL << MODE_EXIT)
|
||||
#endif
|
||||
|
||||
#if defined(RARCH_CONSOLE) || defined(__APPLE__)
|
||||
#define load_dummy_on_core_shutdown false
|
||||
#else
|
||||
#define load_dummy_on_core_shutdown true
|
||||
#endif
|
||||
|
||||
#define frontend_init_enable true
|
||||
#define menu_init_enable true
|
||||
#define initial_lifecycle_state_preinit false
|
||||
@ -136,7 +130,7 @@ int main_entry_iterate(signature(), args_type() args)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
// Load dummy core instead of exiting RetroArch completely.
|
||||
if (load_dummy_on_core_shutdown)
|
||||
if (g_settings.load_dummy_on_core_shutdown)
|
||||
load_menu_game_prepare_dummy();
|
||||
else
|
||||
#endif
|
||||
|
@ -74,6 +74,7 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
|
||||
#ifdef HAVE_SCREENSHOTS
|
||||
file_list_push(rgui->selection_buf, "GPU Screenshots", RGUI_SETTINGS_GPU_SCREENSHOT, 0);
|
||||
#endif
|
||||
file_list_push(rgui->selection_buf, "Load Dummy On Core Shutdown", RGUI_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN, 0);
|
||||
file_list_push(rgui->selection_buf, "Show Framerate", RGUI_SETTINGS_DEBUG_TEXT, 0);
|
||||
file_list_push(rgui->selection_buf, "Rewind", RGUI_SETTINGS_REWIND_ENABLE, 0);
|
||||
file_list_push(rgui->selection_buf, "Rewind Granularity", RGUI_SETTINGS_REWIND_GRANULARITY, 0);
|
||||
|
@ -93,6 +93,7 @@ typedef enum
|
||||
RGUI_SETTINGS_FONT_ENABLE,
|
||||
RGUI_SETTINGS_FONT_SCALE,
|
||||
RGUI_SETTINGS_FONT_SIZE,
|
||||
RGUI_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN,
|
||||
RGUI_SETTINGS_SHADER_OPTIONS,
|
||||
RGUI_SETTINGS_SHADER_FILTER,
|
||||
RGUI_SETTINGS_SHADER_PRESET,
|
||||
|
@ -1945,6 +1945,12 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
||||
g_settings.video.font_size = font_size;
|
||||
g_settings.video.font_size = roundf(max(g_settings.video.font_size, 1.0f));
|
||||
break;
|
||||
case RGUI_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN:
|
||||
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT)
|
||||
g_settings.load_dummy_on_core_shutdown = !g_settings.load_dummy_on_core_shutdown;
|
||||
else if (action == RGUI_ACTION_START)
|
||||
g_settings.load_dummy_on_core_shutdown = load_dummy_on_core_shutdown;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2411,6 +2417,9 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
||||
case RGUI_SETTINGS_FONT_SIZE:
|
||||
snprintf(type_str, type_str_size, "%.1f", g_settings.video.font_size);
|
||||
break;
|
||||
case RGUI_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN:
|
||||
snprintf(type_str, type_str_size, g_settings.load_dummy_on_core_shutdown ? "ON" : "OFF");
|
||||
break;
|
||||
default:
|
||||
*type_str = '\0';
|
||||
*w = 0;
|
||||
|
@ -316,6 +316,7 @@ struct settings
|
||||
bool rgui_show_start_screen;
|
||||
#endif
|
||||
bool fps_show;
|
||||
bool load_dummy_on_core_shutdown;
|
||||
|
||||
bool core_specific_config;
|
||||
};
|
||||
|
@ -236,6 +236,8 @@ void config_set_defaults(void)
|
||||
if (def_input)
|
||||
strlcpy(g_settings.input.driver, def_input, sizeof(g_settings.input.driver));
|
||||
|
||||
g_settings.load_dummy_on_core_shutdown = load_dummy_on_core_shutdown;
|
||||
|
||||
g_settings.video.xscale = xscale;
|
||||
g_settings.video.yscale = yscale;
|
||||
g_settings.video.fullscreen = g_extern.force_fullscreen ? true : fullscreen;
|
||||
@ -927,6 +929,7 @@ bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_PATH(libretro, "libretro_path");
|
||||
|
||||
CONFIG_GET_BOOL(fps_show, "fps_show");
|
||||
CONFIG_GET_BOOL(load_dummy_on_core_shutdown, "load_dummy_on_core_shutdown");
|
||||
|
||||
CONFIG_GET_PATH(libretro_info_path, "libretro_info_path");
|
||||
|
||||
@ -1251,6 +1254,7 @@ bool config_save_file(const char *path)
|
||||
|
||||
RARCH_LOG("Saving config at path: \"%s\"\n", path);
|
||||
|
||||
config_set_bool(conf, "load_dummy_on_core_shutdown", g_settings.load_dummy_on_core_shutdown);
|
||||
config_set_bool(conf, "fps_show", g_settings.fps_show);
|
||||
config_set_path(conf, "libretro_path", g_settings.libretro);
|
||||
config_set_path(conf, "libretro_info_path", g_settings.libretro_info_path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user