diff --git a/content.h b/content.h index 6f2997358a..eb42714131 100644 --- a/content.h +++ b/content.h @@ -82,10 +82,13 @@ bool content_reset_savestate_backups(void); bool content_undo_load_buf_is_empty(void); bool content_undo_save_buf_is_empty(void); -/* Clears the pending subsystem rom buffer*/ +/* Checks if launched from the commandline */ +bool content_launched_from_cli(void); + +/* Clears the pending subsystem rom buffer */ bool content_is_subsystem_pending_load(void); -/* Clears the pending subsystem rom buffer*/ +/* Clears the pending subsystem rom buffer */ void content_clear_subsystem(void); /* Set the current subsystem*/ diff --git a/retroarch.c b/retroarch.c index 410e284f35..d91d90c48d 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1406,9 +1406,12 @@ bool retroarch_main_init(int argc, char *argv[]) /* Handle core initialization failure */ if (init_failed) { -#ifdef HAVE_MENU /* Check if menu was active prior to core initialization */ - if (menu_driver_is_alive()) + if (!content_launched_from_cli() +#ifdef HAVE_MENU + || menu_driver_is_alive() +#endif + ) { /* Attempt initializing dummy core */ current_core_type = CORE_TYPE_DUMMY; @@ -1416,7 +1419,6 @@ bool retroarch_main_init(int argc, char *argv[]) goto error; } else -#endif { /* Fall back to regular error handling */ goto error; diff --git a/tasks/task_content.c b/tasks/task_content.c index da1f02dc9c..25bed6a350 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -138,6 +138,7 @@ struct content_information_ctx }; static struct string_list *temporary_content = NULL; +static bool _launched_from_cli = true; static bool _content_is_inited = false; static bool core_does_not_need_content = false; static uint32_t content_rom_crc = 0; @@ -1603,6 +1604,8 @@ bool task_push_load_content_with_new_core_from_companion_ui( command_event(CMD_EVENT_LOAD_CORE, NULL); #endif + _launched_from_cli = false; + /* Load content */ if (!task_load_content_callback(content_info, true, false)) return false; @@ -1758,6 +1761,12 @@ void content_clear_subsystem(void) } } +/* Checks if launched from the commandline */ +bool content_launched_from_cli() +{ + return _launched_from_cli; +} + /* Get the current subsystem */ int content_get_subsystem() {