Hide 'Load Core' when a core is already loaded and the libretro

core has started running its runloop
This commit is contained in:
twinaphex 2019-08-24 06:36:33 +02:00
parent de0aa8ad69
commit d492f1acaf
6 changed files with 105 additions and 95 deletions

View File

@ -2127,9 +2127,7 @@ static int materialui_list_push(void *data, void *userdata,
entry.parse_type = PARSE_ACTION;
entry.add_empty_entry = false;
if (!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
{
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
@ -2137,21 +2135,23 @@ static int materialui_list_push(void *data, void *userdata,
menu_displaylist_setting(&entry);
}
}
if (system->load_no_content)
else
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
if (frontend_driver_has_fork())
if (frontend_driver_has_fork())
#endif
{
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
}
}
}

View File

@ -4194,9 +4194,7 @@ static int stripes_list_push(void *data, void *userdata,
entry.parse_type = PARSE_ACTION;
entry.add_empty_entry = false;
if (!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
{
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
@ -4204,21 +4202,23 @@ static int stripes_list_push(void *data, void *userdata,
menu_displaylist_setting(&entry);
}
}
if (system->load_no_content)
else
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
if (frontend_driver_has_fork())
if (frontend_driver_has_fork())
#endif
{
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
}
}
}

View File

@ -5728,9 +5728,7 @@ static int xmb_list_push(void *data, void *userdata,
entry.parse_type = PARSE_ACTION;
entry.add_empty_entry = false;
if (!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
{
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
@ -5738,21 +5736,23 @@ static int xmb_list_push(void *data, void *userdata,
menu_displaylist_setting(&entry);
}
}
if (system->load_no_content)
else
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
if (frontend_driver_has_fork())
if (frontend_driver_has_fork())
#endif
{
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_setting(&entry);
}
}
}

View File

@ -4678,40 +4678,40 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
break;
case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST:
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_QUICK_MENU_VIEWS_SETTINGS, PARSE_ACTION },
{MENU_ENUM_LABEL_SETTINGS_VIEWS_SETTINGS, PARSE_ACTION },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_DISC, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_DUMP_DISC, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_CORE_UPDATER, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_LEGACY_THUMBNAIL_UPDATER, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_HELP, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_SHOW_WIMP, PARSE_ONLY_UINT },
{MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_RESTART_RETROARCH, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_REBOOT, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_SHUTDOWN, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS_PASSWORD, PARSE_ONLY_STRING},
{MENU_ENUM_LABEL_CONTENT_SHOW_FAVORITES, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_IMAGES, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_MUSIC, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_VIDEO, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_NETPLAY, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_HISTORY, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_ADD, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLISTS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_TIMEDATE_ENABLE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_TIMEDATE_STYLE, PARSE_ONLY_UINT },
{MENU_ENUM_LABEL_BATTERY_LEVEL_ENABLE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_CORE_ENABLE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_RGUI_SHOW_START_SCREEN, PARSE_ONLY_BOOL },
menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_QUICK_MENU_VIEWS_SETTINGS, PARSE_ACTION, true },
{MENU_ENUM_LABEL_SETTINGS_VIEWS_SETTINGS, PARSE_ACTION, true },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_LOAD_DISC, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_DUMP_DISC, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_CORE_UPDATER, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_LEGACY_THUMBNAIL_UPDATER, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_HELP, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_SHOW_WIMP, PARSE_ONLY_UINT, true },
{MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_RESTART_RETROARCH, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_REBOOT, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_SHUTDOWN, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS_PASSWORD, PARSE_ONLY_STRING, true},
{MENU_ENUM_LABEL_CONTENT_SHOW_FAVORITES, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_IMAGES, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_MUSIC, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_VIDEO, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_NETPLAY, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_HISTORY, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_ADD, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLISTS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_TIMEDATE_ENABLE, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_TIMEDATE_STYLE, PARSE_ONLY_UINT, true },
{MENU_ENUM_LABEL_BATTERY_LEVEL_ENABLE, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CORE_ENABLE, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_RGUI_SHOW_START_SCREEN, PARSE_ONLY_BOOL, true },
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
@ -8330,33 +8330,32 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
if (sys_info)
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
{
struct retro_system_info *system = runloop_get_libretro_system_info();
if (!string_is_empty(system->library_name) &&
!string_is_equal(system->library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if (menu_displaylist_parse_settings_enum(info->list,
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if (menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_CONTENT_SETTINGS,
PARSE_ACTION, false) == 0)
count++;
if (sys_info->load_no_content)
if (menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_START_CORE, PARSE_ACTION, false) == 0)
count++;
}
else
{
if (sys_info && sys_info->load_no_content)
if (menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_START_CORE, PARSE_ACTION, false) == 0)
count++;
#ifndef HAVE_DYNAMIC
if (frontend_driver_has_fork())
if (frontend_driver_has_fork())
#endif
{
if (settings->bools.menu_show_load_core)
if (menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_CORE_LIST, PARSE_ACTION, false) == 0)
count++;
{
if (settings->bools.menu_show_load_core)
{
if (menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_CORE_LIST, PARSE_ACTION, false) == 0)
count++;
}
}
}
if (settings->bools.menu_show_load_content)

View File

@ -888,6 +888,7 @@ static bool runloop_slowmotion = false;
static bool runloop_fastmotion = false;
static bool runloop_shutdown_initiated = false;
static bool runloop_core_shutdown_initiated = false;
static bool runloop_core_running = false;
static bool runloop_perfcnt_enable = false;
static bool runloop_overrides_active = false;
static bool runloop_remaps_core_active = false;
@ -4785,6 +4786,8 @@ bool command_event(enum event_command cmd, void *data)
content_get_status(&contentless, &is_inited);
runloop_core_running = false;
command_event_runtime_log_deinit();
command_event_save_auto_state();
command_event_disable_overrides();
@ -22944,6 +22947,8 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
{
switch(state)
{
case RARCH_CTL_CORE_IS_RUNNING:
return runloop_core_running;
case RARCH_CTL_BSV_MOVIE_IS_INITED:
return (bsv_movie_state_handle != NULL);
case RARCH_CTL_IS_PATCH_BLOCKED:
@ -24148,7 +24153,8 @@ static enum runloop_state runloop_check_state(void)
if (runloop_exec)
runloop_exec = false;
if (runloop_core_shutdown_initiated && settings->bools.load_dummy_on_core_shutdown)
if (runloop_core_shutdown_initiated &&
settings->bools.load_dummy_on_core_shutdown)
{
content_ctx_info_t content_info;
@ -24165,10 +24171,12 @@ static enum runloop_state runloop_check_state(void)
runloop_core_shutdown_initiated = false;
}
else
quit_runloop = true;
quit_runloop = true;
}
else
quit_runloop = true;
quit_runloop = true;
runloop_core_running = false;
if (quit_runloop)
{
@ -24831,6 +24839,7 @@ int runloop_iterate(void)
{
case RUNLOOP_STATE_QUIT:
frame_limit_last_time = 0.0;
runloop_core_running = false;
command_event(CMD_EVENT_QUIT, NULL);
return -1;
case RUNLOOP_STATE_POLLED_AND_SLEEP:
@ -24859,6 +24868,7 @@ int runloop_iterate(void)
#endif
return 0;
case RUNLOOP_STATE_ITERATE:
runloop_core_running = true;
break;
}

View File

@ -160,6 +160,7 @@ enum rarch_ctl_state
RARCH_CTL_CORE_OPTIONS_INTL_INIT,
RARCH_CTL_CORE_OPTIONS_DEINIT,
RARCH_CTL_CORE_OPTIONS_DISPLAY,
RARCH_CTL_CORE_IS_RUNNING,
/* BSV Movie */
RARCH_CTL_BSV_MOVIE_IS_INITED