Use more runloop flags

This commit is contained in:
LibretroAdmin 2022-10-10 08:59:27 +02:00
parent c9bbe7683f
commit d100e73780
14 changed files with 110 additions and 115 deletions

View File

@ -4594,6 +4594,7 @@ bool config_save_file(const char *path)
struct config_float_setting *float_settings = NULL;
struct config_array_setting *array_settings = NULL;
struct config_path_setting *path_settings = NULL;
uint32_t flags = runloop_get_flags();
config_file_t *conf = config_file_new_from_path_to_string(path);
settings_t *settings = config_st;
global_t *global = global_get_ptr();
@ -4608,7 +4609,7 @@ bool config_save_file(const char *path)
if (!conf)
conf = config_file_new_alloc();
if (!conf || retroarch_ctl(RARCH_CTL_IS_OVERRIDES_ACTIVE, NULL))
if (!conf || (flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE))
{
if (conf)
config_file_free(conf);

View File

@ -44,6 +44,7 @@
#include "../../driver.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../verbosity.h"
#include "../common/ctr_common.h"
@ -461,6 +462,7 @@ static void bottom_menu_control(void* data, bool lcd_bottom)
ctr_video_t *ctr = (ctr_video_t*)data;
settings_t *settings = config_get_ptr();
int config_slot = settings->ints.state_slot;
uint32_t flags = runloop_get_flags();
if (!ctr->init_bottom_menu)
{
@ -475,7 +477,7 @@ static void bottom_menu_control(void* data, bool lcd_bottom)
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
if (!retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (!(flags & RUNLOOP_FLAG_CORE_RUNNING))
{
if (!ctr->bottom_is_idle)
{
@ -618,8 +620,8 @@ static void bottom_menu_control(void* data, bool lcd_bottom)
ctr->refresh_bottom_menu = true;
}
if (ctr->bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE ||
!retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if ( ctr->bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE
|| (!(flags & RUNLOOP_FLAG_CORE_RUNNING)))
return;
@ -1308,6 +1310,7 @@ static bool ctr_frame(void* data, const void* frame,
#endif
bool overlay_behind_menu = video_info->overlay_behind_menu;
bool lcd_bottom = false;
uint32_t flags = runloop_get_flags();
if (!width || !height || !settings)
{
@ -1318,7 +1321,7 @@ static bool ctr_frame(void* data, const void* frame,
lcd_bottom = settings->bools.video_3ds_lcd_bottom;
if (lcd_bottom != ctr_bottom_screen_enabled)
{
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
{
ctr_set_bottom_screen_enable(lcd_bottom, false);
if (lcd_bottom)
@ -1676,8 +1679,8 @@ static bool ctr_frame(void* data, const void* frame,
#endif
#ifndef CONSOLE_LOG
if (ctr_bottom_screen_enabled &&
retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if ( ctr_bottom_screen_enabled
&& (flags & RUNLOOP_FLAG_CORE_RUNNING))
{
if ( !ctr->bottom_is_idle )
{

View File

@ -167,9 +167,9 @@ static void gfx_ctx_mali_fbdev_destroy_really(void)
static void gfx_ctx_mali_fbdev_maybe_restart(void)
{
runloop_state_t *runloop_st = runloop_state_get_ptr();
uint32_t flags = runloop_get_flags();
if (!runloop_st->shutdown_initiated)
if (!(flags & RUNLOOP_FLAG_SHUTDOWN_INITIATED))
frontend_driver_set_fork(FRONTEND_FORK_RESTART);
}
@ -183,9 +183,9 @@ All these workarounds should be reverted when and if egl_destroy issues in libma
*/
static void gfx_ctx_mali_fbdev_destroy(void *data)
{
runloop_state_t *runloop_st = runloop_state_get_ptr();
uint32_t flags = runloop_get_flags();
if (runloop_st->shutdown_initiated)
if (flags & RUNLOOP_FLAG_SHUTDOWN_INITIATED)
{
if (!gfx_ctx_mali_fbdev_restart_pending)
{

View File

@ -77,6 +77,7 @@
#include "../../paths.h"
#include "../../playlist.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../verbosity.h"
#include "../../lakka.h"
#ifdef HAVE_BLUETOOTH
@ -3556,24 +3557,25 @@ static int generic_action_ok_remap_file_operation(const char *path,
if (!string_is_empty(remap_file_path) &&
(filestream_delete(remap_file_path) == 0))
{
uint32_t flags = runloop_get_flags();
switch (action_type)
{
case ACTION_OK_REMAP_FILE_REMOVE_CORE:
if (retroarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL))
if (flags & RUNLOOP_FLAG_REMAPS_CORE_ACTIVE)
{
input_remapping_deinit(false);
input_remapping_set_defaults(false);
}
break;
case ACTION_OK_REMAP_FILE_REMOVE_GAME:
if (retroarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL))
if (flags & RUNLOOP_FLAG_REMAPS_GAME_ACTIVE)
{
input_remapping_deinit(false);
input_remapping_set_defaults(false);
}
break;
case ACTION_OK_REMAP_FILE_REMOVE_CONTENT_DIR:
if (retroarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL))
if (flags & RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE)
{
input_remapping_deinit(false);
input_remapping_set_defaults(false);
@ -6922,13 +6924,14 @@ static int action_ok_contentless_core_run(const char *path,
* the current selection here, and reapply it manually
* when building the contentless cores list... */
size_t selection = menu_navigation_get_selection();
uint32_t flags = runloop_get_flags();
if (string_is_empty(core_path))
return menu_cbs_exit();
/* If core is already running, open quick menu */
if (retroarch_ctl(RARCH_CTL_IS_CORE_LOADED, (void*)core_path) &&
retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if ( retroarch_ctl(RARCH_CTL_IS_CORE_LOADED, (void*)core_path)
&& (flags & RUNLOOP_FLAG_CORE_RUNNING))
{
bool flush_menu = false;
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, &flush_menu);

View File

@ -9412,6 +9412,7 @@ static int materialui_list_push(void *data, void *userdata,
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
uint32_t flags = runloop_get_flags();
/* If navigation bar is hidden, use default
* main menu */
@ -9420,7 +9421,7 @@ static int materialui_list_push(void *data, void *userdata,
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
{
if (!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{

View File

@ -8667,9 +8667,11 @@ static int ozone_list_push(void *data, void *userdata,
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
uint32_t flags = runloop_get_flags();
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
{
if (!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{

View File

@ -7445,9 +7445,10 @@ static int xmb_list_push(void *data, void *userdata,
case DISPLAYLIST_MAIN_MENU:
{
rarch_system_info_t *system = &runloop_state_get_ptr()->system;
uint32_t flags = runloop_get_flags();
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
{
if (!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{

View File

@ -98,6 +98,7 @@
#include "../core_option_manager.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../core.h"
#include "../frontend/frontend_driver.h"
#include "../ui/ui_companion_driver.h"
@ -1235,10 +1236,11 @@ static unsigned menu_displaylist_parse_core_option_override_list(
menu_displaylist_info_t *info, settings_t *settings)
{
unsigned count = 0;
uint32_t flags = runloop_get_flags();
bool core_has_options = !retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) &&
retroarch_ctl(RARCH_CTL_HAS_CORE_OPTIONS, NULL);
bool game_options_active = retroarch_ctl(RARCH_CTL_IS_GAME_OPTIONS_ACTIVE, NULL);
bool folder_options_active = retroarch_ctl(RARCH_CTL_IS_FOLDER_OPTIONS_ACTIVE, NULL);
bool game_options_active = flags & RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE;
bool folder_options_active = flags & RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE;
bool show_core_options_flush = settings ?
settings->bools.quick_menu_show_core_options_flush : false;
@ -1332,16 +1334,17 @@ static unsigned menu_displaylist_parse_remap_file_manager_list(
menu_displaylist_info_t *info, settings_t *settings)
{
unsigned count = 0;
uint32_t flags = runloop_get_flags();
bool has_content = !string_is_empty(path_get(RARCH_PATH_CONTENT));
bool core_remap_active = retroarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL);
bool content_dir_remap_active = retroarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL);
bool game_remap_active = retroarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL);
bool core_remap_active = flags & RUNLOOP_FLAG_REMAPS_CORE_ACTIVE;
bool content_dir_remap_active = flags & RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE;
bool game_remap_active = flags & RUNLOOP_FLAG_REMAPS_GAME_ACTIVE;
bool remap_save_on_exit = settings->bools.remap_save_on_exit;
/* Sanity check - cannot handle remap files
* unless a valid core is running */
if (!retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL) ||
retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if ( !(flags & RUNLOOP_FLAG_CORE_RUNNING)
|| retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
goto end;
/* Show currently 'active' remap file */
@ -6140,6 +6143,7 @@ unsigned menu_displaylist_build_list(
{
unsigned i;
unsigned count = 0;
uint32_t flags = runloop_get_flags();
switch (type)
{
@ -9203,8 +9207,8 @@ unsigned menu_displaylist_build_list(
}
#ifdef HAVE_RUNAHEAD
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL) &&
!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if ( (flags & RUNLOOP_FLAG_CORE_RUNNING)
&& !retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
runahead_supported = core_info_current_supports_runahead();
if (runahead_supported)
@ -10194,8 +10198,8 @@ unsigned menu_displaylist_build_list(
};
#ifdef HAVE_REWIND
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL) &&
!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if ( (flags & RUNLOOP_FLAG_CORE_RUNNING)
&& !retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
rewind_supported = core_info_current_supports_rewind();
if (rewind_supported)
@ -13548,8 +13552,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI) || defined(HAVE_OZONE) || defined(HAVE_XMB)
const char *menu_ident = menu_driver_ident();
#endif
uint32_t flags = runloop_get_flags();
if (retroarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
{
if (!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,

View File

@ -6680,7 +6680,8 @@ void menu_driver_toggle(
bool pause_libretro = false;
bool audio_enable_menu = false;
runloop_state_t *runloop_st = runloop_state_get_ptr();
bool runloop_shutdown_initiated = runloop_st->shutdown_initiated;
bool runloop_shutdown_initiated = runloop_st->flags &
RUNLOOP_FLAG_SHUTDOWN_INITIATED;
#ifdef HAVE_OVERLAY
bool input_overlay_hide_in_menu = false;
bool input_overlay_enable = false;

View File

@ -1755,8 +1755,8 @@ bool command_event(enum event_command cmd, void *data)
break;
#if defined(HAVE_RUNAHEAD) && (defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB))
case CMD_EVENT_LOAD_SECOND_CORE:
if (!runloop_st->core_running ||
!runloop_st->runahead_secondary_core_available)
if (!(runloop_st->flags & RUNLOOP_FLAG_CORE_RUNNING) ||
!(runloop_st->runahead_secondary_core_available))
return false;
if (runloop_st->secondary_lib_handle)
return true;
@ -1885,7 +1885,7 @@ bool command_event(enum event_command cmd, void *data)
rarch_system_info_t *sys_info = &runloop_st->system;
uint8_t flags = content_get_flags();
runloop_st->core_running = false;
runloop_st->flags &= ~RUNLOOP_FLAG_CORE_RUNNING;
/* The platform that uses ram_state_save calls it when the content
* ends and writes it to a file */
@ -2082,7 +2082,12 @@ bool command_event(enum event_command cmd, void *data)
&& !netplay_driver_ctl(
RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
#endif
runloop_st->autosave = autosave_init();
{
if (autosave_init())
runloop_st->flags |= RUNLOOP_FLAG_AUTOSAVE;
else
runloop_st->flags &= ~RUNLOOP_FLAG_AUTOSAVE;
}
}
#endif
break;
@ -2092,7 +2097,8 @@ bool command_event(enum event_command cmd, void *data)
return false;
break;
case CMD_EVENT_AUDIO_START:
if (!audio_driver_start(runloop_st->shutdown_initiated))
if (!audio_driver_start(runloop_st->flags &
RUNLOOP_FLAG_SHUTDOWN_INITIATED))
return false;
break;
case CMD_EVENT_AUDIO_MUTE_TOGGLE:
@ -3613,17 +3619,16 @@ static void global_free(struct rarch_state *p_rarch)
retro_main_log_file_deinit();
runloop_st->flags &= ~(
RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED
| RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED
| RUNLOOP_FLAG_USE_SRAM
);
runloop_st->flags &= ~(
RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED
| RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED
| RUNLOOP_FLAG_USE_SRAM);
#ifdef HAVE_PATCH
p_rarch->flags &= ~(
RARCH_FLAGS_BPS_PREF
| RARCH_FLAGS_IPS_PREF
| RARCH_FLAGS_UPS_PREF);
runloop_st->flags &= ~RUNLOOP_FLAG_PATCH_BLOCKED;
p_rarch->flags &= ~(
RARCH_FLAGS_BPS_PREF
| RARCH_FLAGS_IPS_PREF
| RARCH_FLAGS_UPS_PREF);
runloop_st->flags &= ~RUNLOOP_FLAG_PATCH_BLOCKED;
#endif
#ifdef HAVE_CONFIGFILE
@ -3631,8 +3636,7 @@ static void global_free(struct rarch_state *p_rarch)
runloop_st->flags &= ~(RUNLOOP_FLAG_OVERRIDES_ACTIVE
| RUNLOOP_FLAG_REMAPS_CORE_ACTIVE
| RUNLOOP_FLAG_REMAPS_GAME_ACTIVE
| RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE
);
| RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE);
#endif
runloop_st->current_core.has_set_input_descriptors = false;
@ -5586,8 +5590,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
{
case RARCH_CTL_HAS_SET_SUBSYSTEMS:
return runloop_st->current_core.has_set_subsystems;
case RARCH_CTL_CORE_IS_RUNNING:
return runloop_st->core_running;
#ifdef HAVE_BSV_MOVIE
case RARCH_CTL_BSV_MOVIE_IS_INITED:
return (input_state_get_ptr()->bsv_movie_state_handle != NULL);
@ -5631,12 +5633,12 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
#if defined(HAVE_RUNAHEAD) && (defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB))
case RARCH_CTL_IS_SECOND_CORE_AVAILABLE:
return
runloop_st->core_running
&& runloop_st->runahead_secondary_core_available;
(runloop_st->flags & RUNLOOP_FLAG_CORE_RUNNING)
&& (runloop_st->runahead_secondary_core_available);
case RARCH_CTL_IS_SECOND_CORE_LOADED:
return
runloop_st->core_running
&& (runloop_st->secondary_lib_handle != NULL);
(runloop_st->flags & RUNLOOP_FLAG_CORE_RUNNING)
&& (runloop_st->secondary_lib_handle != NULL);
#endif
case RARCH_CTL_HAS_SET_USERNAME:
return ((p_rarch->flags & RARCH_FLAGS_HAS_SET_USERNAME) > 0);
@ -5756,14 +5758,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
| RUNLOOP_FLAG_REMAPS_GAME_ACTIVE);
runloop_st->flags |= RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE;
break;
case RARCH_CTL_IS_OVERRIDES_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE) > 0);
case RARCH_CTL_IS_REMAPS_CORE_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_REMAPS_CORE_ACTIVE) > 0);
case RARCH_CTL_IS_REMAPS_GAME_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_REMAPS_GAME_ACTIVE) > 0);
case RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE) > 0);
#endif
case RARCH_CTL_SET_MISSING_BIOS:
runloop_st->missing_bios = true;
@ -5773,10 +5767,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
break;
case RARCH_CTL_IS_MISSING_BIOS:
return runloop_st->missing_bios;
case RARCH_CTL_IS_GAME_OPTIONS_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE) > 0);
case RARCH_CTL_IS_FOLDER_OPTIONS_ACTIVE:
return ((runloop_st->flags & RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE) > 0);
case RARCH_CTL_GET_PERFCNT:
{
bool **perfcnt = (bool**)data;
@ -5804,14 +5794,14 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
case RARCH_CTL_STATE_FREE:
{
input_driver_state_t *input_st = input_state_get_ptr();
runloop_st->perfcnt_enable = false;
runloop_st->idle = false;
runloop_st->paused = false;
runloop_st->slowmotion = false;
runloop_st->perfcnt_enable = false;
runloop_st->idle = false;
runloop_st->paused = false;
runloop_st->slowmotion = false;
#ifdef HAVE_CONFIGFILE
runloop_st->flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE;
runloop_st->flags &= ~RUNLOOP_FLAG_OVERRIDES_ACTIVE;
#endif
runloop_st->autosave = false;
runloop_st->flags &= ~RUNLOOP_FLAG_AUTOSAVE;
runloop_frame_time_free();
runloop_audio_buffer_status_free();
input_game_focus_free();
@ -5843,7 +5833,7 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
case RARCH_CTL_IS_PAUSED:
return runloop_st->paused;
case RARCH_CTL_SET_SHUTDOWN:
runloop_st->shutdown_initiated = true;
runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED;
break;
case RARCH_CTL_CORE_OPTION_PREV:
/*
@ -5871,8 +5861,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
*idx, 1, true);
}
break;
case RARCH_CTL_NONE:
default:
return false;
@ -6206,7 +6194,7 @@ bool retroarch_main_quit(void)
if (video_st->video_refresh_rate_original)
video_display_server_restore_refresh_rate();
if (!runloop_st->shutdown_initiated)
if (!(runloop_st->flags & RUNLOOP_FLAG_SHUTDOWN_INITIATED))
{
command_event_save_auto_state(
settings->bools.savestate_auto_save,
@ -6242,7 +6230,7 @@ bool retroarch_main_quit(void)
#endif
}
runloop_st->shutdown_initiated = true;
runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED;
#ifdef HAVE_MENU
retroarch_menu_running_finished(true);
#endif

View File

@ -87,15 +87,8 @@ enum rarch_ctl_state
RARCH_CTL_SET_WINDOWED_SCALE,
#ifdef HAVE_CONFIGFILE
RARCH_CTL_IS_OVERRIDES_ACTIVE,
RARCH_CTL_IS_REMAPS_CORE_ACTIVE,
RARCH_CTL_SET_REMAPS_CORE_ACTIVE,
RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE,
RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE,
RARCH_CTL_IS_REMAPS_GAME_ACTIVE,
RARCH_CTL_SET_REMAPS_GAME_ACTIVE,
#endif
@ -103,9 +96,6 @@ enum rarch_ctl_state
RARCH_CTL_SET_MISSING_BIOS,
RARCH_CTL_UNSET_MISSING_BIOS,
RARCH_CTL_IS_GAME_OPTIONS_ACTIVE,
RARCH_CTL_IS_FOLDER_OPTIONS_ACTIVE,
RARCH_CTL_IS_PAUSED,
RARCH_CTL_SET_PAUSED,
@ -127,7 +117,6 @@ enum rarch_ctl_state
RARCH_CTL_CORE_OPTION_PREV,
RARCH_CTL_CORE_OPTION_NEXT,
RARCH_CTL_CORE_OPTION_UPDATE_DISPLAY,
RARCH_CTL_CORE_IS_RUNNING,
/* BSV Movie */
RARCH_CTL_BSV_MOVIE_IS_INITED

View File

@ -1541,15 +1541,15 @@ bool runloop_environment_cb(unsigned cmd, void *data)
runloop_st->flags & RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE,
path_get(RARCH_PATH_CORE_OPTIONS),
runloop_st->core_options);
runloop_st->flags &=
runloop_st->flags &=
~(RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE
| RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE);
runloop_st->core_options = NULL;
runloop_st->core_options = NULL;
}
if ((new_vars = runloop_init_core_variables(
settings,
(const struct retro_variable *)data)))
runloop_st->core_options = new_vars;
runloop_st->core_options = new_vars;
}
break;
@ -1913,8 +1913,8 @@ bool runloop_environment_cb(unsigned cmd, void *data)
* requests a shutdown event */
RARCH_LOG("[Environ]: SHUTDOWN.\n");
runloop_st->shutdown_initiated = true;
runloop_st->core_shutdown_initiated = true;
runloop_st->flags |= RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED
| RUNLOOP_FLAG_SHUTDOWN_INITIATED;
#ifdef HAVE_MENU
/* Ensure that menu stack is flushed appropriately
* after the core has stopped running */
@ -5609,7 +5609,7 @@ bool runloop_event_init_core(
if (!event_init_content(settings, input_st))
{
runloop_st->core_running = false;
runloop_st->flags &= ~RUNLOOP_FLAG_CORE_RUNNING;
return false;
}
@ -6757,27 +6757,27 @@ MENU_ST_FLAG_IS_BINDING;
if (runloop_exec)
runloop_exec = false;
if (runloop_st->core_shutdown_initiated)
if (runloop_st->flags & RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED)
{
bool load_dummy_core = false;
runloop_st->core_shutdown_initiated = false;
runloop_st->flags &= ~RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED;
/* Check whether dummy core should be loaded
* instead of exiting RetroArch completely
* (aborts shutdown if invoked) */
if (settings->bools.load_dummy_on_core_shutdown)
{
load_dummy_core = true;
runloop_st->shutdown_initiated = false;
load_dummy_core = true;
runloop_st->flags &= ~RUNLOOP_FLAG_SHUTDOWN_INITIATED;
}
/* Unload current core, and load dummy if
* required */
if (!command_event(CMD_EVENT_UNLOAD_CORE, &load_dummy_core))
{
runloop_st->shutdown_initiated = true;
quit_runloop = true;
runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED;
quit_runloop = true;
}
if (!load_dummy_core)
@ -6786,7 +6786,7 @@ MENU_ST_FLAG_IS_BINDING;
else
quit_runloop = true;
runloop_st->core_running = false;
runloop_st->flags &= ~RUNLOOP_FLAG_CORE_RUNNING;
if (quit_runloop)
{
@ -7748,7 +7748,7 @@ int runloop_iterate(void)
{
case RUNLOOP_STATE_QUIT:
runloop_st->frame_limit_last_time = 0.0;
runloop_st->core_running = false;
runloop_st->flags &= ~RUNLOOP_FLAG_CORE_RUNNING;
command_event(CMD_EVENT_QUIT, NULL);
return -1;
case RUNLOOP_STATE_POLLED_AND_SLEEP:
@ -7779,12 +7779,12 @@ int runloop_iterate(void)
#endif
return 0;
case RUNLOOP_STATE_ITERATE:
runloop_st->core_running = true;
runloop_st->flags |= RUNLOOP_FLAG_CORE_RUNNING;
break;
}
#ifdef HAVE_THREADS
if (runloop_st->autosave)
if (runloop_st->flags & RUNLOOP_FLAG_AUTOSAVE)
autosave_lock();
#endif
@ -8015,7 +8015,7 @@ int runloop_iterate(void)
#endif
#ifdef HAVE_THREADS
if (runloop_st->autosave)
if (runloop_st->flags & RUNLOOP_FLAG_AUTOSAVE)
autosave_unlock();
#endif

View File

@ -147,7 +147,11 @@ enum runloop_flags
RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE = (1 << 11),
RUNLOOP_FLAG_REMAPS_CORE_ACTIVE = (1 << 12),
RUNLOOP_FLAG_REMAPS_GAME_ACTIVE = (1 << 13),
RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1 << 14)
RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1 << 14),
RUNLOOP_FLAG_SHUTDOWN_INITIATED = (1 << 15),
RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED = (1 << 16),
RUNLOOP_FLAG_CORE_RUNNING = (1 << 17),
RUNLOOP_FLAG_AUTOSAVE = (1 << 18)
};
struct runloop
@ -289,11 +293,7 @@ struct runloop
bool focused;
bool slowmotion;
bool fastmotion;
bool shutdown_initiated;
bool core_shutdown_initiated;
bool core_running;
bool perfcnt_enable;
bool autosave;
#ifdef HAVE_RUNAHEAD
bool has_variable_update;
bool input_is_dirty;
@ -321,7 +321,7 @@ input_st->bsv_movie_state.eof_exit)
* d) Video driver no longer alive.
* e) End of BSV movie and BSV EOF exit is true. (TODO/FIXME - explain better)
*/
#define RUNLOOP_TIME_TO_EXIT(quit_key_pressed) (runloop_state.shutdown_initiated || quit_key_pressed || !is_alive BSV_MOVIE_IS_EOF() || ((runloop_state.max_frames != 0) && (frame_count >= runloop_state.max_frames)) || runloop_exec)
#define RUNLOOP_TIME_TO_EXIT(quit_key_pressed) ((runloop_state.flags & RUNLOOP_FLAG_SHUTDOWN_INITIATED) || quit_key_pressed || !is_alive BSV_MOVIE_IS_EOF() || ((runloop_state.max_frames != 0) && (frame_count >= runloop_state.max_frames)) || runloop_exec)
RETRO_BEGIN_DECLS

View File

@ -1121,10 +1121,11 @@ void CoreOptionsDialog::buildLayout()
if (!contentLabel.isEmpty())
{
if (!retroarch_ctl(RARCH_CTL_IS_GAME_OPTIONS_ACTIVE, NULL))
label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE);
else
uint32_t flags = runloop_get_flags();
if (flags & RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE)
label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_IN_USE);
else
label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE);
if (!label.isEmpty())
{