mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Create task_push_content_load_nothing_with_new_core_from_menu
This commit is contained in:
parent
e075ade748
commit
0b5118423d
@ -1076,15 +1076,21 @@ static int generic_action_ok(const char *path,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_LOAD_CORE:
|
case ACTION_OK_LOAD_CORE:
|
||||||
flush_type = MENU_SETTINGS;
|
|
||||||
|
|
||||||
if (generic_action_ok_file_load(action_path,
|
|
||||||
NULL, CORE_TYPE_PLAIN,
|
|
||||||
CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU) == 0)
|
|
||||||
{
|
{
|
||||||
|
content_ctx_info_t content_info = {0};
|
||||||
|
|
||||||
|
flush_type = MENU_SETTINGS;
|
||||||
|
|
||||||
|
if (!task_push_content_load_nothing_with_new_core_from_menu(
|
||||||
|
action_path, NULL,
|
||||||
|
&content_info,
|
||||||
|
CORE_TYPE_PLAIN,
|
||||||
|
NULL, NULL))
|
||||||
|
{
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
ret = -1;
|
ret = -1;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_LOAD_CONFIG_FILE:
|
case ACTION_OK_LOAD_CONFIG_FILE:
|
||||||
|
@ -1256,6 +1256,36 @@ error:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool task_push_content_load_nothing_with_new_core_from_menu(
|
||||||
|
const char *core_path,
|
||||||
|
const char *fullpath,
|
||||||
|
content_ctx_info_t *content_info,
|
||||||
|
enum rarch_core_type type,
|
||||||
|
retro_task_callback_t cb,
|
||||||
|
void *user_data)
|
||||||
|
{
|
||||||
|
if (!content_info)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* Set libretro core path */
|
||||||
|
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
||||||
|
|
||||||
|
/* Load core */
|
||||||
|
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||||
|
|
||||||
|
#ifndef HAVE_DYNAMIC
|
||||||
|
/* Fork core? */
|
||||||
|
if (!frontend_driver_set_fork(FRONTEND_FORK_CORE))
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Preliminary stuff that has to be done before we
|
||||||
|
* load the actual content. Can differ per mode. */
|
||||||
|
retroarch_set_current_core_type(type, true);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool task_push_content_load_default(
|
bool task_push_content_load_default(
|
||||||
const char *core_path,
|
const char *core_path,
|
||||||
const char *fullpath,
|
const char *fullpath,
|
||||||
@ -1297,7 +1327,6 @@ bool task_push_content_load_default(
|
|||||||
/* First we determine if we are loading from a menu */
|
/* First we determine if we are loading from a menu */
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
#if defined(HAVE_VIDEO_PROCESSOR)
|
#if defined(HAVE_VIDEO_PROCESSOR)
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_VIDEO_PROCESSOR_CORE_FROM_MENU:
|
case CONTENT_MODE_LOAD_NOTHING_WITH_VIDEO_PROCESSOR_CORE_FROM_MENU:
|
||||||
#endif
|
#endif
|
||||||
@ -1366,7 +1395,6 @@ bool task_push_content_load_default(
|
|||||||
/* Set libretro core path */
|
/* Set libretro core path */
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU:
|
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU:
|
||||||
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI:
|
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI:
|
||||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
||||||
@ -1378,7 +1406,6 @@ bool task_push_content_load_default(
|
|||||||
/* Load core */
|
/* Load core */
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
#ifdef HAVE_DYNAMIC
|
#ifdef HAVE_DYNAMIC
|
||||||
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU:
|
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU:
|
||||||
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI:
|
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI:
|
||||||
@ -1389,26 +1416,10 @@ bool task_push_content_load_default(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_DYNAMIC
|
|
||||||
/* Fork core? */
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
if (!frontend_driver_set_fork(FRONTEND_FORK_CORE))
|
|
||||||
goto cleanup;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Preliminary stuff that has to be done before we
|
/* Preliminary stuff that has to be done before we
|
||||||
* load the actual content. Can differ per mode. */
|
* load the actual content. Can differ per mode. */
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
retroarch_set_current_core_type(type, true);
|
|
||||||
break;
|
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU:
|
case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU:
|
||||||
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORKGAMEPAD)
|
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORKGAMEPAD)
|
||||||
retroarch_set_current_core_type(CORE_TYPE_NETRETROPAD, true);
|
retroarch_set_current_core_type(CORE_TYPE_NETRETROPAD, true);
|
||||||
@ -1465,17 +1476,10 @@ bool task_push_content_load_default(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Push quick menu onto menu stack */
|
/* Push quick menu onto menu stack */
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
if (type != CORE_TYPE_DUMMY && mode != CONTENT_MODE_LOAD_FROM_CLI)
|
if (type != CORE_TYPE_DUMMY && mode != CONTENT_MODE_LOAD_FROM_CLI)
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL);
|
||||||
#endif
|
#endif
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content_ctx.directory_system)
|
if (content_ctx.directory_system)
|
||||||
free(content_ctx.directory_system);
|
free(content_ctx.directory_system);
|
||||||
@ -1517,14 +1521,6 @@ skip:
|
|||||||
RARCH_LOG("Load content blocked. Reason: %s\n", msg_hash_to_str(MSG_FIRMWARE));
|
RARCH_LOG("Load content blocked. Reason: %s\n", msg_hash_to_str(MSG_FIRMWARE));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#ifndef HAVE_DYNAMIC
|
|
||||||
cleanup:
|
|
||||||
if (content_ctx.directory_system)
|
|
||||||
free(content_ctx.directory_system);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void content_get_status(
|
void content_get_status(
|
||||||
|
@ -75,11 +75,10 @@ static void netplay_crc_scan_callback(void *task_data,
|
|||||||
content_ctx_info_t content_info = {0};
|
content_ctx_info_t content_info = {0};
|
||||||
|
|
||||||
command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED, state->hostname);
|
command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED, state->hostname);
|
||||||
task_push_content_load_default(
|
task_push_content_load_nothing_with_new_core_from_menu(
|
||||||
state->core_path, NULL,
|
state->core_path, NULL,
|
||||||
&content_info,
|
&content_info,
|
||||||
CORE_TYPE_PLAIN,
|
CORE_TYPE_PLAIN,
|
||||||
CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU,
|
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
task_push_content_load_nothing_with_current_core_from_menu(&content_info);
|
task_push_content_load_nothing_with_current_core_from_menu(&content_info);
|
||||||
|
@ -40,7 +40,6 @@ enum content_mode_load
|
|||||||
{
|
{
|
||||||
CONTENT_MODE_LOAD_NONE = 0,
|
CONTENT_MODE_LOAD_NONE = 0,
|
||||||
CONTENT_MODE_LOAD_FROM_CLI,
|
CONTENT_MODE_LOAD_FROM_CLI,
|
||||||
CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU,
|
|
||||||
CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU,
|
CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU,
|
||||||
CONTENT_MODE_LOAD_NOTHING_WITH_VIDEO_PROCESSOR_CORE_FROM_MENU,
|
CONTENT_MODE_LOAD_NOTHING_WITH_VIDEO_PROCESSOR_CORE_FROM_MENU,
|
||||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
||||||
@ -143,6 +142,14 @@ bool task_push_decompress(
|
|||||||
retro_task_callback_t cb,
|
retro_task_callback_t cb,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
|
bool task_push_content_load_nothing_with_new_core_from_menu(
|
||||||
|
const char *core_path,
|
||||||
|
const char *fullpath,
|
||||||
|
content_ctx_info_t *content_info,
|
||||||
|
enum rarch_core_type type,
|
||||||
|
retro_task_callback_t cb,
|
||||||
|
void *user_data);
|
||||||
|
|
||||||
bool task_push_content_load_nothing_with_current_core_from_menu(content_ctx_info_t *content_info);
|
bool task_push_content_load_nothing_with_current_core_from_menu(content_ctx_info_t *content_info);
|
||||||
|
|
||||||
bool task_push_content_load_nothing_with_dummy_core(content_ctx_info_t *content_info);
|
bool task_push_content_load_nothing_with_dummy_core(content_ctx_info_t *content_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user