mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Rename RARCH_ACTION_STATE_ to RARCH_CTL_
This commit is contained in:
parent
1e8d666758
commit
ca71e1a5bb
@ -319,7 +319,7 @@ void event_disk_control_append_image(const char *path)
|
||||
* started out in a single disk case, and that this way
|
||||
* of doing it makes the most sense. */
|
||||
rarch_set_paths(path);
|
||||
rarch_ctl(RARCH_ACTION_STATE_FILL_PATHNAMES, NULL);
|
||||
rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
|
||||
}
|
||||
|
||||
event_command(EVENT_CMD_AUTOSAVE_INIT);
|
||||
@ -638,7 +638,7 @@ static bool event_init_content(void)
|
||||
return true;
|
||||
|
||||
if (!global->inited.core.no_content)
|
||||
rarch_ctl(RARCH_ACTION_STATE_FILL_PATHNAMES, NULL);
|
||||
rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
|
||||
|
||||
if (!init_content_file())
|
||||
return false;
|
||||
@ -687,7 +687,7 @@ static bool event_init_core(void)
|
||||
if((settings->sort_savestates_enable || settings->sort_savefiles_enable) && !global->inited.core.no_content)
|
||||
set_paths_redirect(global->name.base);
|
||||
|
||||
rarch_ctl(RARCH_ACTION_STATE_VERIFY_API_VERSION, NULL);
|
||||
rarch_ctl(RARCH_CTL_VERIFY_API_VERSION, NULL);
|
||||
core.retro_init();
|
||||
|
||||
global->sram.use = (global->inited.core.type == CORE_TYPE_PLAIN) &&
|
||||
@ -1026,15 +1026,15 @@ bool event_command(enum event_command cmd)
|
||||
#ifdef HAVE_DYNAMIC
|
||||
event_command(EVENT_CMD_LOAD_CORE);
|
||||
#endif
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
|
||||
break;
|
||||
#ifdef HAVE_FFMPEG
|
||||
case EVENT_CMD_LOAD_CONTENT_FFMPEG:
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT_FFMPEG, NULL);
|
||||
break;
|
||||
#endif
|
||||
case EVENT_CMD_LOAD_CONTENT_IMAGEVIEWER:
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER, NULL);
|
||||
break;
|
||||
case EVENT_CMD_LOAD_CONTENT:
|
||||
{
|
||||
@ -1103,9 +1103,9 @@ bool event_command(enum event_command cmd)
|
||||
case EVENT_CMD_MENU_TOGGLE:
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_driver_alive())
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
else
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_CONTROLLERS_INIT:
|
||||
@ -1147,7 +1147,7 @@ bool event_command(enum event_command cmd)
|
||||
event_command(EVENT_CMD_LOAD_CORE_DEINIT);
|
||||
break;
|
||||
case EVENT_CMD_QUIT:
|
||||
rarch_ctl(RARCH_ACTION_STATE_QUIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
break;
|
||||
case EVENT_CMD_REINIT:
|
||||
{
|
||||
@ -1400,17 +1400,17 @@ bool event_command(enum event_command cmd)
|
||||
event_command(EVENT_CMD_DRIVERS_INIT);
|
||||
break;
|
||||
case EVENT_CMD_QUIT_RETROARCH:
|
||||
rarch_ctl(RARCH_ACTION_STATE_FORCE_QUIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_FORCE_QUIT, NULL);
|
||||
break;
|
||||
case EVENT_CMD_SHUTDOWN:
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
rarch_main_msg_queue_push("Shutting down...", 1, 180, true);
|
||||
rarch_ctl(RARCH_ACTION_STATE_FORCE_QUIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_FORCE_QUIT, NULL);
|
||||
system("shutdown -P now");
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_RESUME:
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
break;
|
||||
case EVENT_CMD_RESTART_RETROARCH:
|
||||
{
|
||||
|
@ -1306,7 +1306,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
if (driver->frontend_ctx && driver->frontend_ctx->set_fork)
|
||||
driver->frontend_ctx->set_fork(true, true);
|
||||
#elif defined(HAVE_DYNAMIC)
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
|
||||
#endif
|
||||
|
||||
if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE)
|
||||
|
@ -679,7 +679,7 @@ static int generic_action_ok(const char *path,
|
||||
msg_force = true;
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
|
||||
|
||||
if (rarch_ctl(RARCH_ACTION_STATE_REPLACE_CONFIG, action_path))
|
||||
if (rarch_ctl(RARCH_CTL_REPLACE_CONFIG, action_path))
|
||||
{
|
||||
bool pending_push = false;
|
||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
||||
@ -1362,7 +1362,7 @@ static int action_ok_file_load_or_resume(const char *path,
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_CONTENT_PATH, menu->deferred_path);
|
||||
event_command(EVENT_CMD_LOAD_CORE);
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
36
retroarch.c
36
retroarch.c
@ -1174,7 +1174,7 @@ int rarch_main_init(int argc, char *argv[])
|
||||
RARCH_LOG_OUTPUT("=================================================\n");
|
||||
}
|
||||
|
||||
rarch_ctl(RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES, NULL);
|
||||
rarch_ctl(RARCH_CTL_VALIDATE_CPU_FEATURES, NULL);
|
||||
config_load();
|
||||
rarch_task_init();
|
||||
|
||||
@ -1329,7 +1329,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case RARCH_ACTION_STATE_REPLACE_CONFIG:
|
||||
case RARCH_CTL_REPLACE_CONFIG:
|
||||
{
|
||||
char *path = (char*)data;
|
||||
|
||||
@ -1350,7 +1350,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
}
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_PREPARE_DUMMY, NULL);
|
||||
return true;
|
||||
case RARCH_ACTION_STATE_MENU_RUNNING:
|
||||
case RARCH_CTL_MENU_RUNNING:
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_toggle(true);
|
||||
#endif
|
||||
@ -1359,36 +1359,36 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
event_command(EVENT_CMD_OVERLAY_DEINIT);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_ACTION_STATE_LOAD_CONTENT:
|
||||
case RARCH_CTL_LOAD_CONTENT:
|
||||
#ifdef HAVE_MENU
|
||||
/* If content loading fails, we go back to menu. */
|
||||
if (!menu_load_content(CORE_TYPE_PLAIN))
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
#endif
|
||||
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
|
||||
driver->frontend_ctx->content_loaded();
|
||||
break;
|
||||
#ifdef HAVE_FFMPEG
|
||||
case RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG:
|
||||
case RARCH_CTL_LOAD_CONTENT_FFMPEG:
|
||||
#ifdef HAVE_MENU
|
||||
/* If content loading fails, we go back to menu. */
|
||||
if (!menu_load_content(CORE_TYPE_FFMPEG))
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
#endif
|
||||
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
|
||||
driver->frontend_ctx->content_loaded();
|
||||
break;
|
||||
#endif
|
||||
case RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER:
|
||||
case RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER:
|
||||
#ifdef HAVE_MENU
|
||||
/* If content loading fails, we go back to menu. */
|
||||
if (!menu_load_content(CORE_TYPE_IMAGEVIEWER))
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
#endif
|
||||
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
|
||||
driver->frontend_ctx->content_loaded();
|
||||
break;
|
||||
case RARCH_ACTION_STATE_MENU_RUNNING_FINISHED:
|
||||
case RARCH_CTL_MENU_RUNNING_FINISHED:
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_toggle(false);
|
||||
#endif
|
||||
@ -1398,15 +1398,15 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_ACTION_STATE_QUIT:
|
||||
case RARCH_CTL_QUIT:
|
||||
if (global)
|
||||
system->shutdown = true;
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_FORCE_QUIT:
|
||||
rarch_ctl(RARCH_ACTION_STATE_QUIT, NULL);
|
||||
case RARCH_CTL_FORCE_QUIT:
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES:
|
||||
case RARCH_CTL_VALIDATE_CPU_FEATURES:
|
||||
{
|
||||
uint64_t cpu = retro_get_cpu_features();
|
||||
(void)cpu;
|
||||
@ -1425,14 +1425,14 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case RARCH_ACTION_STATE_VERIFY_API_VERSION:
|
||||
case RARCH_CTL_VERIFY_API_VERSION:
|
||||
RARCH_LOG("Version of libretro API: %u\n", core.retro_api_version());
|
||||
RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION);
|
||||
|
||||
if (core.retro_api_version() != RETRO_API_VERSION)
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
|
||||
break;
|
||||
case RARCH_ACTION_STATE_FILL_PATHNAMES:
|
||||
case RARCH_CTL_FILL_PATHNAMES:
|
||||
rarch_init_savefile_paths();
|
||||
strlcpy(global->bsv.movie_path, global->name.savefile,
|
||||
sizeof(global->bsv.movie_path));
|
||||
@ -1450,7 +1450,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
fill_pathname_noext(global->name.ips, global->name.base, ".ips",
|
||||
sizeof(global->name.ips));
|
||||
break;
|
||||
case RARCH_ACTION_STATE_NONE:
|
||||
case RARCH_CTL_NONE:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
24
retroarch.h
24
retroarch.h
@ -55,28 +55,28 @@ extern "C" {
|
||||
|
||||
enum rarch_ctl_state
|
||||
{
|
||||
RARCH_ACTION_STATE_NONE = 0,
|
||||
RARCH_CTL_NONE = 0,
|
||||
|
||||
RARCH_ACTION_STATE_LOAD_CONTENT,
|
||||
RARCH_CTL_LOAD_CONTENT,
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG,
|
||||
RARCH_CTL_LOAD_CONTENT_FFMPEG,
|
||||
#endif
|
||||
|
||||
RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER,
|
||||
RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER,
|
||||
|
||||
RARCH_ACTION_STATE_MENU_RUNNING,
|
||||
RARCH_CTL_MENU_RUNNING,
|
||||
|
||||
RARCH_ACTION_STATE_MENU_RUNNING_FINISHED,
|
||||
RARCH_CTL_MENU_RUNNING_FINISHED,
|
||||
|
||||
/* Replaces currently loaded configuration file with
|
||||
* another one. Will load a dummy core to flush state
|
||||
* properly. */
|
||||
RARCH_ACTION_STATE_REPLACE_CONFIG,
|
||||
RARCH_CTL_REPLACE_CONFIG,
|
||||
|
||||
RARCH_ACTION_STATE_QUIT,
|
||||
RARCH_CTL_QUIT,
|
||||
|
||||
RARCH_ACTION_STATE_FORCE_QUIT,
|
||||
RARCH_CTL_FORCE_QUIT,
|
||||
|
||||
/* Compare libretro core API version against API version
|
||||
* used by RetroArch.
|
||||
@ -84,16 +84,16 @@ enum rarch_ctl_state
|
||||
* TODO - when libretro v2 gets added, allow for switching
|
||||
* between libretro version backend dynamically.
|
||||
*/
|
||||
RARCH_ACTION_STATE_VERIFY_API_VERSION,
|
||||
RARCH_CTL_VERIFY_API_VERSION,
|
||||
|
||||
/* Validates CPU features for given processor architecture.
|
||||
*
|
||||
* Make sure we haven't compiled for something we cannot run.
|
||||
* Ideally, code would get swapped out depending on CPU support,
|
||||
* but this will do for now. */
|
||||
RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES,
|
||||
RARCH_CTL_VALIDATE_CPU_FEATURES,
|
||||
|
||||
RARCH_ACTION_STATE_FILL_PATHNAMES
|
||||
RARCH_CTL_FILL_PATHNAMES
|
||||
};
|
||||
|
||||
enum rarch_content_type
|
||||
|
@ -794,7 +794,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_CLEAR_CONTENT_PATH, NULL);
|
||||
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL);
|
||||
rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
|
||||
}
|
||||
break;
|
||||
case RARCH_MAIN_CTL_SET_CORE_SHUTDOWN:
|
||||
@ -1062,10 +1062,10 @@ int rarch_main_iterate(unsigned *sleep_ms)
|
||||
if (menu_driver_alive())
|
||||
{
|
||||
if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY))
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
}
|
||||
else
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1086,7 +1086,7 @@ int rarch_main_iterate(unsigned *sleep_ms)
|
||||
bool is_idle = rarch_main_ctl(RARCH_MAIN_CTL_IS_IDLE, NULL);
|
||||
|
||||
if (menu_driver_iterate((enum menu_action)menu_input_frame_retropad(input, trigger_input)) == -1)
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
|
||||
if (focused || !is_idle)
|
||||
menu_iterate_render();
|
||||
|
@ -47,7 +47,7 @@ static void rarch_enable_ui(void)
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
}
|
||||
|
||||
static void rarch_disable_ui(void)
|
||||
@ -58,7 +58,7 @@ static void rarch_disable_ui(void)
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
}
|
||||
|
||||
static void ui_companion_cocoatouch_event_command(
|
||||
|
Loading…
Reference in New Issue
Block a user