Rename rarch_main_command to event_command

This commit is contained in:
twinaphex 2015-04-13 11:26:02 +02:00
parent 7b44f2d158
commit 0818b178f9
22 changed files with 186 additions and 185 deletions

View File

@ -256,7 +256,7 @@ static void poll_iteration(void)
if (global && global->main_is_init) if (global && global->main_is_init)
reply = NSTerminateCancel; reply = NSTerminateCancel;
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
return reply; return reply;
} }
@ -274,7 +274,7 @@ static void poll_iteration(void)
strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath)); strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath));
if (core_name) if (core_name)
rarch_main_command(EVENT_CMD_LOAD_CONTENT); event_command(EVENT_CMD_LOAD_CONTENT);
else else
[self chooseCore]; [self chooseCore];
@ -306,7 +306,7 @@ static void poll_iteration(void)
strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath)); strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath));
if (core_name) if (core_name)
rarch_main_command(EVENT_CMD_LOAD_CONTENT); event_command(EVENT_CMD_LOAD_CONTENT);
else else
[self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f]; [self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f];
} }
@ -346,11 +346,11 @@ static void poll_iteration(void)
if (global && !global->main_is_init) if (global && !global->main_is_init)
{ {
/* TODO/FIXME: Set core/content here. */ /* TODO/FIXME: Set core/content here. */
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
rarch_main_command(EVENT_CMD_LOAD_CONTENT); event_command(EVENT_CMD_LOAD_CONTENT);
} }
else else
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
} }
#pragma mark RetroArch_Platform #pragma mark RetroArch_Platform
@ -429,7 +429,7 @@ static void poll_iteration(void)
cmd = EVENT_CMD_RESIZE_WINDOWED_SCALE; cmd = EVENT_CMD_RESIZE_WINDOWED_SCALE;
} }
rarch_main_command(cmd); event_command(cmd);
} }
- (void)alertDidEnd:(NSAlert *)alert returnCode:(int32_t)returnCode contextInfo:(void *)contextInfo - (void)alertDidEnd:(NSAlert *)alert returnCode:(int32_t)returnCode contextInfo:(void *)contextInfo

View File

@ -279,7 +279,7 @@ void uninit_audio(void)
free(global->audio_data.outsamples); free(global->audio_data.outsamples);
global->audio_data.outsamples = NULL; global->audio_data.outsamples = NULL;
rarch_main_command(EVENT_CMD_DSP_FILTER_DEINIT); event_command(EVENT_CMD_DSP_FILTER_DEINIT);
compute_audio_buffer_statistics(); compute_audio_buffer_statistics();
} }
@ -363,7 +363,7 @@ void init_audio(void)
if (!settings->audio.sync && driver->audio_active) if (!settings->audio.sync && driver->audio_active)
{ {
rarch_main_command(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE); event_command(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE);
global->audio_data.chunk_size = global->audio_data.chunk_size =
global->audio_data.nonblock_chunk_size; global->audio_data.nonblock_chunk_size;
} }
@ -421,7 +421,7 @@ void init_audio(void)
RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n"); RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n");
} }
rarch_main_command(EVENT_CMD_DSP_FILTER_INIT); event_command(EVENT_CMD_DSP_FILTER_INIT);
runloop->measure_data.buffer_free_samples_count = 0; runloop->measure_data.buffer_free_samples_count = 0;
@ -460,8 +460,8 @@ bool audio_driver_mute_toggle(void)
settings->audio.mute_enable = !settings->audio.mute_enable; settings->audio.mute_enable = !settings->audio.mute_enable;
if (settings->audio.mute_enable) if (settings->audio.mute_enable)
rarch_main_command(EVENT_CMD_AUDIO_STOP); event_command(EVENT_CMD_AUDIO_STOP);
else if (!rarch_main_command(EVENT_CMD_AUDIO_START)) else if (!event_command(EVENT_CMD_AUDIO_START))
{ {
driver->audio_active = false; driver->audio_active = false;
return false; return false;

View File

@ -346,7 +346,7 @@ static void event_deinit_core(bool reinit)
pretro_deinit(); pretro_deinit();
if (reinit) if (reinit)
rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); event_command(EVENT_CMD_DRIVERS_DEINIT);
if(global->overrides_active) if(global->overrides_active)
{ {
@ -501,8 +501,8 @@ static bool event_init_content(void)
RARCH_LOG("Skipping SRAM load.\n"); RARCH_LOG("Skipping SRAM load.\n");
event_load_auto_state(); event_load_auto_state();
rarch_main_command(EVENT_CMD_BSV_MOVIE_INIT); event_command(EVENT_CMD_BSV_MOVIE_INIT);
rarch_main_command(EVENT_CMD_NETPLAY_INIT); event_command(EVENT_CMD_NETPLAY_INIT);
return true; return true;
} }
@ -772,14 +772,14 @@ static bool event_update_system_info(struct retro_system_info *_info,
} }
/** /**
* rarch_main_command: * event_command:
* @cmd : Event command index. * @cmd : Event command index.
* *
* Performs RetroArch event command with index @cmd. * Performs RetroArch event command with index @cmd.
* *
* Returns: true (1) on success, otherwise false (0). * Returns: true (1) on success, otherwise false (0).
**/ **/
bool rarch_main_command(unsigned cmd) bool event_command(unsigned cmd)
{ {
unsigned i = 0; unsigned i = 0;
bool boolean = false; bool boolean = false;
@ -794,19 +794,19 @@ bool rarch_main_command(unsigned cmd)
{ {
case EVENT_CMD_LOAD_CONTENT_PERSIST: case EVENT_CMD_LOAD_CONTENT_PERSIST:
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
#endif #endif
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT); rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT);
break; break;
case EVENT_CMD_LOAD_CONTENT: case EVENT_CMD_LOAD_CONTENT:
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
rarch_main_command(EVENT_CMD_LOAD_CONTENT_PERSIST); event_command(EVENT_CMD_LOAD_CONTENT_PERSIST);
#else #else
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH,
(void*)settings->libretro); (void*)settings->libretro);
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, rarch_environment_cb(RETRO_ENVIRONMENT_EXEC,
(void*)global->fullpath); (void*)global->fullpath);
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
#endif #endif
break; break;
case EVENT_CMD_LOAD_CORE_DEINIT: case EVENT_CMD_LOAD_CORE_DEINIT:
@ -815,7 +815,7 @@ bool rarch_main_command(unsigned cmd)
#endif #endif
break; break;
case EVENT_CMD_LOAD_CORE_PERSIST: case EVENT_CMD_LOAD_CORE_PERSIST:
rarch_main_command(EVENT_CMD_LOAD_CORE_DEINIT); event_command(EVENT_CMD_LOAD_CORE_DEINIT);
{ {
#ifdef HAVE_MENU #ifdef HAVE_MENU
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
@ -826,9 +826,9 @@ bool rarch_main_command(unsigned cmd)
} }
break; break;
case EVENT_CMD_LOAD_CORE: case EVENT_CMD_LOAD_CORE:
rarch_main_command(EVENT_CMD_LOAD_CORE_PERSIST); event_command(EVENT_CMD_LOAD_CORE_PERSIST);
#ifndef HAVE_DYNAMIC #ifndef HAVE_DYNAMIC
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
#endif #endif
break; break;
case EVENT_CMD_LOAD_STATE: case EVENT_CMD_LOAD_STATE:
@ -850,7 +850,7 @@ bool rarch_main_command(unsigned cmd)
settings->video.scale = global->pending.windowed_scale; settings->video.scale = global->pending.windowed_scale;
if (!settings->video.fullscreen) if (!settings->video.fullscreen)
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
global->pending.windowed_scale = 0; global->pending.windowed_scale = 0;
break; break;
@ -870,7 +870,7 @@ bool rarch_main_command(unsigned cmd)
/* bSNES since v073r01 resets controllers to JOYPAD /* bSNES since v073r01 resets controllers to JOYPAD
* after a reset, so just enforce it here. */ * after a reset, so just enforce it here. */
rarch_main_command(EVENT_CMD_CONTROLLERS_INIT); event_command(EVENT_CMD_CONTROLLERS_INIT);
break; break;
case EVENT_CMD_SAVE_STATE: case EVENT_CMD_SAVE_STATE:
if (settings->savestate_auto_index) if (settings->savestate_auto_index)
@ -898,7 +898,7 @@ bool rarch_main_command(unsigned cmd)
} }
break; break;
case EVENT_CMD_UNLOAD_CORE: case EVENT_CMD_UNLOAD_CORE:
rarch_main_command(EVENT_CMD_PREPARE_DUMMY); event_command(EVENT_CMD_PREPARE_DUMMY);
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
libretro_free_system_info(&global->menu.info); libretro_free_system_info(&global->menu.info);
#endif #endif
@ -910,7 +910,7 @@ bool rarch_main_command(unsigned cmd)
driver->video_cache_context = driver->video_cache_context =
global->system.hw_render_callback.cache_context; global->system.hw_render_callback.cache_context;
driver->video_cache_context_ack = false; driver->video_cache_context_ack = false;
rarch_main_command(EVENT_CMD_RESET_CONTEXT); event_command(EVENT_CMD_RESET_CONTEXT);
driver->video_cache_context = false; driver->video_cache_context = false;
/* Poll input to avoid possibly stale data to corrupt things. */ /* Poll input to avoid possibly stale data to corrupt things. */
@ -919,7 +919,7 @@ bool rarch_main_command(unsigned cmd)
#ifdef HAVE_MENU #ifdef HAVE_MENU
runloop->frames.video.current.menu.framebuf.dirty = true; runloop->frames.video.current.menu.framebuf.dirty = true;
if (runloop->is_menu) if (runloop->is_menu)
rarch_main_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE); event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
#endif #endif
break; break;
case EVENT_CMD_CHEATS_DEINIT: case EVENT_CMD_CHEATS_DEINIT:
@ -931,13 +931,13 @@ bool rarch_main_command(unsigned cmd)
global->cheat = NULL; global->cheat = NULL;
break; break;
case EVENT_CMD_CHEATS_INIT: case EVENT_CMD_CHEATS_INIT:
rarch_main_command(EVENT_CMD_CHEATS_DEINIT); event_command(EVENT_CMD_CHEATS_DEINIT);
event_init_cheats(); event_init_cheats();
break; break;
case EVENT_CMD_REMAPPING_DEINIT: case EVENT_CMD_REMAPPING_DEINIT:
break; break;
case EVENT_CMD_REMAPPING_INIT: case EVENT_CMD_REMAPPING_INIT:
rarch_main_command(EVENT_CMD_REMAPPING_DEINIT); event_command(EVENT_CMD_REMAPPING_DEINIT);
event_init_remapping(); event_init_remapping();
break; break;
case EVENT_CMD_REWIND_DEINIT: case EVENT_CMD_REWIND_DEINIT:
@ -956,9 +956,9 @@ bool rarch_main_command(unsigned cmd)
break; break;
case EVENT_CMD_REWIND_TOGGLE: case EVENT_CMD_REWIND_TOGGLE:
if (settings->rewind_enable) if (settings->rewind_enable)
rarch_main_command(EVENT_CMD_REWIND_INIT); event_command(EVENT_CMD_REWIND_INIT);
else else
rarch_main_command(EVENT_CMD_REWIND_DEINIT); event_command(EVENT_CMD_REWIND_DEINIT);
break; break;
case EVENT_CMD_AUTOSAVE_DEINIT: case EVENT_CMD_AUTOSAVE_DEINIT:
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
@ -966,7 +966,7 @@ bool rarch_main_command(unsigned cmd)
#endif #endif
break; break;
case EVENT_CMD_AUTOSAVE_INIT: case EVENT_CMD_AUTOSAVE_INIT:
rarch_main_command(EVENT_CMD_AUTOSAVE_DEINIT); event_command(EVENT_CMD_AUTOSAVE_DEINIT);
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
event_init_autosave(); event_init_autosave();
#endif #endif
@ -1018,7 +1018,7 @@ bool rarch_main_command(unsigned cmd)
#endif #endif
break; break;
case EVENT_CMD_OVERLAY_INIT: case EVENT_CMD_OVERLAY_INIT:
rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
if (driver->osk_enable) if (driver->osk_enable)
{ {
@ -1052,7 +1052,7 @@ bool rarch_main_command(unsigned cmd)
global->audio_data.dsp = NULL; global->audio_data.dsp = NULL;
break; break;
case EVENT_CMD_DSP_FILTER_INIT: case EVENT_CMD_DSP_FILTER_INIT:
rarch_main_command(EVENT_CMD_DSP_FILTER_DEINIT); event_command(EVENT_CMD_DSP_FILTER_DEINIT);
if (!*settings->audio.dsp_plugin) if (!*settings->audio.dsp_plugin)
break; break;
@ -1075,7 +1075,7 @@ bool rarch_main_command(unsigned cmd)
return false; return false;
break; break;
case EVENT_CMD_RECORD_INIT: case EVENT_CMD_RECORD_INIT:
rarch_main_command(EVENT_CMD_HISTORY_DEINIT); event_command(EVENT_CMD_HISTORY_DEINIT);
if (!recording_init()) if (!recording_init())
return false; return false;
break; break;
@ -1085,7 +1085,7 @@ bool rarch_main_command(unsigned cmd)
g_defaults.history = NULL; g_defaults.history = NULL;
break; break;
case EVENT_CMD_HISTORY_INIT: case EVENT_CMD_HISTORY_INIT:
rarch_main_command(EVENT_CMD_HISTORY_DEINIT); event_command(EVENT_CMD_HISTORY_DEINIT);
if (!settings->history_list_enable) if (!settings->history_list_enable)
return false; return false;
RARCH_LOG("Loading history file: [%s].\n", settings->content_history_path); RARCH_LOG("Loading history file: [%s].\n", settings->content_history_path);
@ -1105,7 +1105,7 @@ bool rarch_main_command(unsigned cmd)
rarch_main_data_free(); rarch_main_data_free();
break; break;
case EVENT_CMD_CORE_INFO_INIT: case EVENT_CMD_CORE_INFO_INIT:
rarch_main_command(EVENT_CMD_CORE_INFO_DEINIT); event_command(EVENT_CMD_CORE_INFO_DEINIT);
if (*settings->libretro_directory) if (*settings->libretro_directory)
global->core_info = core_info_list_new(settings->libretro_directory); global->core_info = core_info_list_new(settings->libretro_directory);
@ -1156,8 +1156,8 @@ bool rarch_main_command(unsigned cmd)
init_drivers(DRIVER_AUDIO); init_drivers(DRIVER_AUDIO);
break; break;
case EVENT_CMD_RESET_CONTEXT: case EVENT_CMD_RESET_CONTEXT:
rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); event_command(EVENT_CMD_DRIVERS_DEINIT);
rarch_main_command(EVENT_CMD_DRIVERS_INIT); event_command(EVENT_CMD_DRIVERS_INIT);
break; break;
case EVENT_CMD_QUIT_RETROARCH: case EVENT_CMD_QUIT_RETROARCH:
rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT); rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT);
@ -1187,7 +1187,7 @@ bool rarch_main_command(unsigned cmd)
if (runloop->is_paused) if (runloop->is_paused)
{ {
RARCH_LOG("Paused.\n"); RARCH_LOG("Paused.\n");
rarch_main_command(EVENT_CMD_AUDIO_STOP); event_command(EVENT_CMD_AUDIO_STOP);
if (settings->video.black_frame_insertion) if (settings->video.black_frame_insertion)
rarch_render_cached_frame(); rarch_render_cached_frame();
@ -1195,33 +1195,33 @@ bool rarch_main_command(unsigned cmd)
else else
{ {
RARCH_LOG("Unpaused.\n"); RARCH_LOG("Unpaused.\n");
rarch_main_command(EVENT_CMD_AUDIO_START); event_command(EVENT_CMD_AUDIO_START);
} }
break; break;
case EVENT_CMD_PAUSE_TOGGLE: case EVENT_CMD_PAUSE_TOGGLE:
runloop->is_paused = !runloop->is_paused; runloop->is_paused = !runloop->is_paused;
rarch_main_command(EVENT_CMD_PAUSE_CHECKS); event_command(EVENT_CMD_PAUSE_CHECKS);
break; break;
case EVENT_CMD_UNPAUSE: case EVENT_CMD_UNPAUSE:
runloop->is_paused = false; runloop->is_paused = false;
rarch_main_command(EVENT_CMD_PAUSE_CHECKS); event_command(EVENT_CMD_PAUSE_CHECKS);
break; break;
case EVENT_CMD_PAUSE: case EVENT_CMD_PAUSE:
runloop->is_paused = true; runloop->is_paused = true;
rarch_main_command(EVENT_CMD_PAUSE_CHECKS); event_command(EVENT_CMD_PAUSE_CHECKS);
break; break;
case EVENT_CMD_MENU_PAUSE_LIBRETRO: case EVENT_CMD_MENU_PAUSE_LIBRETRO:
if (runloop->is_menu) if (runloop->is_menu)
{ {
if (settings->menu.pause_libretro) if (settings->menu.pause_libretro)
rarch_main_command(EVENT_CMD_AUDIO_STOP); event_command(EVENT_CMD_AUDIO_STOP);
else else
rarch_main_command(EVENT_CMD_AUDIO_START); event_command(EVENT_CMD_AUDIO_START);
} }
else else
{ {
if (settings->menu.pause_libretro) if (settings->menu.pause_libretro)
rarch_main_command(EVENT_CMD_AUDIO_START); event_command(EVENT_CMD_AUDIO_START);
} }
break; break;
case EVENT_CMD_SHADER_DIR_DEINIT: case EVENT_CMD_SHADER_DIR_DEINIT:
@ -1233,7 +1233,7 @@ bool rarch_main_command(unsigned cmd)
global->shader_dir.ptr = 0; global->shader_dir.ptr = 0;
break; break;
case EVENT_CMD_SHADER_DIR_INIT: case EVENT_CMD_SHADER_DIR_INIT:
rarch_main_command(EVENT_CMD_SHADER_DIR_DEINIT); event_command(EVENT_CMD_SHADER_DIR_DEINIT);
if (!*settings->video.shader_dir) if (!*settings->video.shader_dir)
return false; return false;
@ -1243,7 +1243,7 @@ bool rarch_main_command(unsigned cmd)
if (!global->shader_dir.list || global->shader_dir.list->size == 0) if (!global->shader_dir.list || global->shader_dir.list->size == 0)
{ {
rarch_main_command(EVENT_CMD_SHADER_DIR_DEINIT); event_command(EVENT_CMD_SHADER_DIR_DEINIT);
return false; return false;
} }
@ -1276,13 +1276,13 @@ bool rarch_main_command(unsigned cmd)
RARCH_LOG("SRAM will not be saved.\n"); RARCH_LOG("SRAM will not be saved.\n");
if (global->use_sram) if (global->use_sram)
rarch_main_command(EVENT_CMD_AUTOSAVE_INIT); event_command(EVENT_CMD_AUTOSAVE_INIT);
break; break;
case EVENT_CMD_MSG_QUEUE_DEINIT: case EVENT_CMD_MSG_QUEUE_DEINIT:
rarch_main_msg_queue_free(); rarch_main_msg_queue_free();
break; break;
case EVENT_CMD_MSG_QUEUE_INIT: case EVENT_CMD_MSG_QUEUE_INIT:
rarch_main_command(EVENT_CMD_MSG_QUEUE_DEINIT); event_command(EVENT_CMD_MSG_QUEUE_DEINIT);
rarch_main_msg_queue_init(); rarch_main_msg_queue_init();
rarch_main_data_init_queues(); rarch_main_data_init_queues();
break; break;
@ -1295,7 +1295,7 @@ bool rarch_main_command(unsigned cmd)
global->bsv.movie = NULL; global->bsv.movie = NULL;
break; break;
case EVENT_CMD_BSV_MOVIE_INIT: case EVENT_CMD_BSV_MOVIE_INIT:
rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
event_init_movie(); event_init_movie();
break; break;
case EVENT_CMD_NETPLAY_DEINIT: case EVENT_CMD_NETPLAY_DEINIT:
@ -1314,7 +1314,7 @@ bool rarch_main_command(unsigned cmd)
#endif #endif
break; break;
case EVENT_CMD_NETPLAY_INIT: case EVENT_CMD_NETPLAY_INIT:
rarch_main_command(EVENT_CMD_NETPLAY_DEINIT); event_command(EVENT_CMD_NETPLAY_DEINIT);
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
if (!init_netplay()) if (!init_netplay())
return false; return false;
@ -1337,7 +1337,7 @@ bool rarch_main_command(unsigned cmd)
/* If we go fullscreen we drop all drivers and /* If we go fullscreen we drop all drivers and
* reinitialize to be safe. */ * reinitialize to be safe. */
settings->video.fullscreen = !settings->video.fullscreen; settings->video.fullscreen = !settings->video.fullscreen;
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
break; break;
case EVENT_CMD_COMMAND_DEINIT: case EVENT_CMD_COMMAND_DEINIT:
#ifdef HAVE_COMMAND #ifdef HAVE_COMMAND
@ -1347,7 +1347,7 @@ bool rarch_main_command(unsigned cmd)
#endif #endif
break; break;
case EVENT_CMD_COMMAND_INIT: case EVENT_CMD_COMMAND_INIT:
rarch_main_command(EVENT_CMD_COMMAND_DEINIT); event_command(EVENT_CMD_COMMAND_DEINIT);
#ifdef HAVE_COMMAND #ifdef HAVE_COMMAND
event_init_command(); event_init_command();

View File

@ -196,14 +196,14 @@ enum event_command
}; };
/** /**
* rarch_main_command: * event_command:
* @cmd : Command index. * @cmd : Command index.
* *
* Performs RetroArch command with index @cmd. * Performs RetroArch command with index @cmd.
* *
* Returns: true (1) on success, otherwise false (0). * Returns: true (1) on success, otherwise false (0).
**/ **/
bool rarch_main_command(unsigned action); bool event_command(unsigned action);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -244,7 +244,7 @@ static void driver_adjust_system_rates(void)
return; return;
if (global->system.force_nonblock) if (global->system.force_nonblock)
rarch_main_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE); event_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE);
else else
driver_set_nonblock_state(driver->nonblock_state); driver_set_nonblock_state(driver->nonblock_state);
} }
@ -313,7 +313,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
global->system.av_info = *info; global->system.av_info = *info;
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
/* Cannot continue recording with different parameters. /* Cannot continue recording with different parameters.
* Take the easiest route out and just restart the recording. */ * Take the easiest route out and just restart the recording. */
@ -322,8 +322,8 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
static const char *msg = "Restarting recording due to driver reinit."; static const char *msg = "Restarting recording due to driver reinit.";
rarch_main_msg_queue_push(msg, 2, 180, false); rarch_main_msg_queue_push(msg, 2, 180, false);
RARCH_WARN("%s\n", msg); RARCH_WARN("%s\n", msg);
rarch_main_command(EVENT_CMD_RECORD_DEINIT); event_command(EVENT_CMD_RECORD_DEINIT);
rarch_main_command(EVENT_CMD_RECORD_INIT); event_command(EVENT_CMD_RECORD_INIT);
} }
return true; return true;

View File

@ -1122,7 +1122,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
/* Forces recomputation of aspect ratios if /* Forces recomputation of aspect ratios if
* using core-dependent aspect ratios. */ * using core-dependent aspect ratios. */
rarch_main_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
/* TODO: Figure out what to do, if anything, with recording. */ /* TODO: Figure out what to do, if anything, with recording. */
} }

View File

@ -73,7 +73,7 @@ void engine_handle_cmd(void *data)
slock_unlock(android_app->mutex); slock_unlock(android_app->mutex);
if (runloop->is_paused) if (runloop->is_paused)
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
break; break;
case APP_CMD_RESUME: case APP_CMD_RESUME:

View File

@ -70,7 +70,7 @@ void main_exit_save_config(void)
config_save_file(global->core_specific_config_path); config_save_file(global->core_specific_config_path);
} }
rarch_main_command(EVENT_CMD_AUTOSAVE_STATE); event_command(EVENT_CMD_AUTOSAVE_STATE);
} }
/** /**
@ -102,7 +102,7 @@ void main_exit(args_type() args)
rarch_main_deinit(); rarch_main_deinit();
} }
rarch_main_command(EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG); event_command(EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG);
#if defined(HAVE_LOGGER) && !defined(ANDROID) #if defined(HAVE_LOGGER) && !defined(ANDROID)
logger_shutdown(); logger_shutdown();
@ -264,7 +264,7 @@ bool main_load_content(int argc, char **argv, args_type() args,
goto error; goto error;
} }
rarch_main_command(EVENT_CMD_RESUME); event_command(EVENT_CMD_RESUME);
if (process_args) if (process_args)
process_args(rarch_argc_ptr, rarch_argv_ptr); process_args(rarch_argc_ptr, rarch_argv_ptr);
@ -321,7 +321,7 @@ returntype main_entry(signature())
} }
} }
rarch_main_command(EVENT_CMD_HISTORY_INIT); event_command(EVENT_CMD_HISTORY_INIT);
settings = config_get_ptr(); settings = config_get_ptr();

View File

@ -172,7 +172,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
} }
if (cmd != EVENT_CMD_NONE) if (cmd != EVENT_CMD_NONE)
rarch_main_command(cmd); event_command(cmd);
if (do_wm_close) if (do_wm_close)
PostMessage(owner, WM_CLOSE, 0, 0); PostMessage(owner, WM_CLOSE, 0, 0);

View File

@ -226,6 +226,8 @@ static bool ctr_frame(void* data, const void* frame,
static int total_frames = 0; static int total_frames = 0;
static int frames = 0; static int frames = 0;
extern bool select_pressed;
RARCH_PERFORMANCE_INIT(ctrframe_f); RARCH_PERFORMANCE_INIT(ctrframe_f);
RARCH_PERFORMANCE_START(ctrframe_f); RARCH_PERFORMANCE_START(ctrframe_f);
@ -237,14 +239,13 @@ static bool ctr_frame(void* data, const void* frame,
if(!aptMainLoop()) if(!aptMainLoop())
{ {
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
goto end; goto end;
} }
extern bool select_pressed;
if (select_pressed) if (select_pressed)
{ {
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
goto end; goto end;
} }

View File

@ -400,7 +400,7 @@ void uninit_video_input(void)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
if ( if (
!driver->input_data_own && !driver->input_data_own &&
@ -419,7 +419,7 @@ void uninit_video_input(void)
deinit_video_filter(); deinit_video_filter();
rarch_main_command(EVENT_CMD_SHADER_DIR_DEINIT); event_command(EVENT_CMD_SHADER_DIR_DEINIT);
video_monitor_compute_fps_statistics(); video_monitor_compute_fps_statistics();
} }
@ -439,7 +439,7 @@ void init_video(void)
runloop->frames.video.count = 0; runloop->frames.video.count = 0;
init_video_filter(global->system.pix_fmt); init_video_filter(global->system.pix_fmt);
rarch_main_command(EVENT_CMD_SHADER_DIR_INIT); event_command(EVENT_CMD_SHADER_DIR_INIT);
geom = (const struct retro_game_geometry*)&global->system.av_info.geometry; geom = (const struct retro_game_geometry*)&global->system.av_info.geometry;
max_dim = max(geom->max_width, geom->max_height); max_dim = max(geom->max_width, geom->max_height);
@ -567,8 +567,8 @@ void init_video(void)
if (!driver->input) if (!driver->input)
init_video_input(tmp); init_video_input(tmp);
rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
rarch_main_command(EVENT_CMD_OVERLAY_INIT); event_command(EVENT_CMD_OVERLAY_INIT);
runloop->measure_data.frame_time_samples_count = 0; runloop->measure_data.frame_time_samples_count = 0;

View File

@ -164,7 +164,7 @@ static void ctr_joypad_poll(void)
(state_tmp & KEY_SELECT) && (state_tmp & KEY_SELECT) &&
(state_tmp & KEY_L) && (state_tmp & KEY_L) &&
(state_tmp & KEY_R)) (state_tmp & KEY_R))
rarch_main_command(EVENT_CMD_QUIT); event_command(EVENT_CMD_QUIT);
} }

View File

@ -76,9 +76,9 @@ void menu_update_libretro_info(struct retro_system_info *info)
retro_get_system_info(info); retro_get_system_info(info);
#endif #endif
rarch_main_command(EVENT_CMD_CORE_INFO_INIT); event_command(EVENT_CMD_CORE_INFO_INIT);
menu_driver_context_reset(); menu_driver_context_reset();
rarch_main_command(EVENT_CMD_LOAD_CORE_PERSIST); event_command(EVENT_CMD_LOAD_CORE_PERSIST);
} }
static void menu_environment_get(int *argc, char *argv[], static void menu_environment_get(int *argc, char *argv[],
@ -168,13 +168,13 @@ bool menu_load_content(void)
menu_shader_manager_init(driver->menu); menu_shader_manager_init(driver->menu);
rarch_main_command(EVENT_CMD_HISTORY_INIT); event_command(EVENT_CMD_HISTORY_INIT);
if (*global->fullpath || (driver->menu && driver->menu->load_no_content)) if (*global->fullpath || (driver->menu && driver->menu->load_no_content))
push_to_history_playlist(); push_to_history_playlist();
rarch_main_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
rarch_main_command(EVENT_CMD_RESUME); event_command(EVENT_CMD_RESUME);
return true; return true;
} }
@ -310,7 +310,7 @@ void menu_free(void *data)
menu_list_free(menu->menu_list); menu_list_free(menu->menu_list);
menu->menu_list = NULL; menu->menu_list = NULL;
rarch_main_command(EVENT_CMD_HISTORY_DEINIT); event_command(EVENT_CMD_HISTORY_DEINIT);
if (global->core_info) if (global->core_info)
core_info_list_free(global->core_info); core_info_list_free(global->core_info);

View File

@ -33,7 +33,7 @@ void menu_entries_common_load_content(bool persist)
if (!menu) if (!menu)
return; return;
rarch_main_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT); event_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT);
menu_list_flush_stack(menu->menu_list, MENU_SETTINGS); menu_list_flush_stack(menu->menu_list, MENU_SETTINGS);
menu->msg_force = true; menu->msg_force = true;

View File

@ -92,7 +92,7 @@ static int archive_load(void)
switch (ret) switch (ret)
{ {
case -1: case -1:
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
menu_entries_common_load_content(false); menu_entries_common_load_content(false);
break; break;
case 0: case 0:
@ -461,7 +461,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
else if (custom->height >= (unsigned)stride_y) else if (custom->height >= (unsigned)stride_y)
custom->height -= stride_y; custom->height -= stride_y;
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
break; break;
case MENU_ACTION_DOWN: case MENU_ACTION_DOWN:
@ -474,7 +474,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
else else
custom->height += stride_y; custom->height += stride_y;
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
break; break;
case MENU_ACTION_LEFT: case MENU_ACTION_LEFT:
@ -486,7 +486,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
else if (custom->width >= (unsigned)stride_x) else if (custom->width >= (unsigned)stride_x)
custom->width -= stride_x; custom->width -= stride_x;
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
break; break;
case MENU_ACTION_RIGHT: case MENU_ACTION_RIGHT:
@ -499,7 +499,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
else else
custom->width += stride_x; custom->width += stride_x;
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
break; break;
case MENU_ACTION_CANCEL: case MENU_ACTION_CANCEL:
@ -543,7 +543,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
custom->height = vp.full_height - custom->y; custom->height = vp.full_height - custom->y;
} }
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
} }
break; break;
@ -596,7 +596,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action)
aspectratio_lut[ASPECT_RATIO_CUSTOM].value = aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
(float)custom->width / custom->height; (float)custom->width / custom->height;
rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES);
return 0; return 0;
} }

View File

@ -298,7 +298,7 @@ static int action_ok_core_updater_list(const char *path,
return -1; return -1;
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
rarch_main_command(EVENT_CMD_NETWORK_INIT); event_command(EVENT_CMD_NETWORK_INIT);
fill_pathname_join(url_path, settings->network.buildbot_url, fill_pathname_join(url_path, settings->network.buildbot_url,
".index", sizeof(url_path)); ".index", sizeof(url_path));
@ -387,7 +387,7 @@ static int action_ok_video_filter_file_load(const char *path,
strlcpy(settings->video.softfilter_plugin, filter_path, strlcpy(settings->video.softfilter_plugin, filter_path,
sizeof(settings->video.softfilter_plugin)); sizeof(settings->video.softfilter_plugin));
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
menu_list_flush_stack_by_needle(menu->menu_list, "video_options"); menu_list_flush_stack_by_needle(menu->menu_list, "video_options");
@ -667,7 +667,7 @@ static int action_ok_core_load(const char *path,
fill_pathname_join(settings->libretro, menu_path, path, fill_pathname_join(settings->libretro, menu_path, path,
sizeof(settings->libretro)); sizeof(settings->libretro));
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
menu_list_flush_stack(menu->menu_list, MENU_SETTINGS); menu_list_flush_stack(menu->menu_list, MENU_SETTINGS);
#if defined(HAVE_DYNAMIC) #if defined(HAVE_DYNAMIC)
/* No content needed for this core, load core immediately. */ /* No content needed for this core, load core immediately. */
@ -683,7 +683,7 @@ static int action_ok_core_load(const char *path,
/* Core selection on non-console just updates directory listing. /* Core selection on non-console just updates directory listing.
* Will take effect on new content load. */ * Will take effect on new content load. */
#elif defined(RARCH_CONSOLE) #elif defined(RARCH_CONSOLE)
rarch_main_command(EVENT_CMD_RESTART_RETROARCH); event_command(EVENT_CMD_RESTART_RETROARCH);
return -1; return -1;
#endif #endif
} }
@ -818,7 +818,7 @@ static int action_ok_disk_image_append(const char *path,
fill_pathname_join(image, menu_path, path, sizeof(image)); fill_pathname_join(image, menu_path, path, sizeof(image));
rarch_disk_control_append_image(image); rarch_disk_control_append_image(image);
rarch_main_command(EVENT_CMD_RESUME); event_command(EVENT_CMD_RESUME);
menu_list_flush_stack(menu->menu_list, MENU_SETTINGS); menu_list_flush_stack(menu->menu_list, MENU_SETTINGS);
return -1; return -1;
@ -845,7 +845,7 @@ static int action_ok_file_load_with_detect_core(const char *path,
if (ret == -1) if (ret == -1)
{ {
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
menu_entries_common_load_content(false); menu_entries_common_load_content(false);
return -1; return -1;
} }
@ -951,7 +951,7 @@ static int action_ok_custom_viewport(const char *path,
settings->video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM; settings->video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
rarch_main_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
return 0; return 0;
} }
@ -959,7 +959,7 @@ static int action_ok_custom_viewport(const char *path,
static int generic_action_ok_command(unsigned cmd) static int generic_action_ok_command(unsigned cmd)
{ {
if (!rarch_main_command(cmd)) if (!event_command(cmd))
return -1; return -1;
return 0; return 0;
} }
@ -1059,7 +1059,7 @@ static int action_ok_file_load_or_resume(const char *path,
{ {
strlcpy(global->fullpath, strlcpy(global->fullpath,
menu->deferred_path, sizeof(global->fullpath)); menu->deferred_path, sizeof(global->fullpath));
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT); rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT);
return -1; return -1;
} }
@ -1188,7 +1188,7 @@ static int action_ok_video_resolution(const char *path,
global->console.screen.pal60_enable = false; global->console.screen.pal60_enable = false;
} }
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
#else #else
if (video_driver_get_video_output_size(&width, &height)) if (video_driver_get_video_output_size(&width, &height))
video_driver_set_video_mode(width, height, true); video_driver_set_video_mode(width, height, true);

View File

@ -40,7 +40,7 @@ static int action_start_video_filter_file_load(unsigned type, const char *label,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
settings->video.softfilter_plugin[0] = '\0'; settings->video.softfilter_plugin[0] = '\0';
rarch_main_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
return 0; return 0;
} }

View File

@ -479,10 +479,10 @@ static int disk_options_disk_idx_toggle(unsigned type, const char *label,
switch (action) switch (action)
{ {
case MENU_ACTION_LEFT: case MENU_ACTION_LEFT:
rarch_main_command(EVENT_CMD_DISK_PREV); event_command(EVENT_CMD_DISK_PREV);
break; break;
case MENU_ACTION_RIGHT: case MENU_ACTION_RIGHT:
rarch_main_command(EVENT_CMD_DISK_NEXT); event_command(EVENT_CMD_DISK_NEXT);
break; break;
} }

View File

@ -113,7 +113,7 @@ void recording_dump_frame(const void *data, unsigned width,
if (!vp.width || !vp.height) if (!vp.width || !vp.height)
{ {
RARCH_WARN("Viewport size calculation failed! Will continue using raw data. This will probably not work right ...\n"); RARCH_WARN("Viewport size calculation failed! Will continue using raw data. This will probably not work right ...\n");
rarch_main_command(EVENT_CMD_GPU_RECORD_DEINIT); event_command(EVENT_CMD_GPU_RECORD_DEINIT);
recording_dump_frame(data, width, height, pitch); recording_dump_frame(data, width, height, pitch);
return; return;
@ -127,7 +127,7 @@ void recording_dump_frame(const void *data, unsigned width,
RARCH_WARN("%s\n", msg); RARCH_WARN("%s\n", msg);
rarch_main_msg_queue_push(msg, 1, 180, true); rarch_main_msg_queue_push(msg, 1, 180, true);
rarch_main_command(EVENT_CMD_RECORD_DEINIT); event_command(EVENT_CMD_RECORD_DEINIT);
return; return;
} }
@ -169,7 +169,7 @@ bool recording_deinit(void)
driver->recording_data = NULL; driver->recording_data = NULL;
driver->recording = NULL; driver->recording = NULL;
rarch_main_command(EVENT_CMD_GPU_RECORD_DEINIT); event_command(EVENT_CMD_GPU_RECORD_DEINIT);
return true; return true;
} }
@ -302,7 +302,7 @@ bool recording_init(void)
if (!ffemu_init_first(&driver->recording, &driver->recording_data, &params)) if (!ffemu_init_first(&driver->recording, &driver->recording_data, &params))
{ {
RARCH_ERR(RETRO_LOG_INIT_RECORDING_FAILED); RARCH_ERR(RETRO_LOG_INIT_RECORDING_FAILED);
rarch_main_command(EVENT_CMD_GPU_RECORD_DEINIT); event_command(EVENT_CMD_GPU_RECORD_DEINIT);
return false; return false;
} }

View File

@ -786,7 +786,7 @@ static void rarch_init_savefile_paths(void)
{ {
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
rarch_main_command(EVENT_CMD_SAVEFILES_DEINIT); event_command(EVENT_CMD_SAVEFILES_DEINIT);
global->savefiles = string_list_new(); global->savefiles = string_list_new();
rarch_assert(global->savefiles); rarch_assert(global->savefiles);
@ -919,7 +919,7 @@ void rarch_disk_control_append_image(const char *path)
RARCH_LOG("%s\n", msg); RARCH_LOG("%s\n", msg);
rarch_main_msg_queue_push(msg, 0, 180, true); rarch_main_msg_queue_push(msg, 0, 180, true);
rarch_main_command(EVENT_CMD_AUTOSAVE_DEINIT); event_command(EVENT_CMD_AUTOSAVE_DEINIT);
/* TODO: Need to figure out what to do with subsystems case. */ /* TODO: Need to figure out what to do with subsystems case. */
if (!*global->subsystem) if (!*global->subsystem)
@ -932,7 +932,7 @@ void rarch_disk_control_append_image(const char *path)
rarch_fill_pathnames(); rarch_fill_pathnames();
} }
rarch_main_command(EVENT_CMD_AUTOSAVE_INIT); event_command(EVENT_CMD_AUTOSAVE_INIT);
rarch_disk_control_set_eject(false, false); rarch_disk_control_set_eject(false, false);
} }
@ -1054,8 +1054,8 @@ static void main_clear_state_drivers(void)
if (!inited) if (!inited)
return; return;
rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); event_command(EVENT_CMD_DRIVERS_DEINIT);
rarch_main_command(EVENT_CMD_DRIVERS_INIT); event_command(EVENT_CMD_DRIVERS_INIT);
} }
static void main_init_state_config(void) static void main_init_state_config(void)
@ -1081,7 +1081,7 @@ void rarch_main_alloc(void)
if (!settings) if (!settings)
return; return;
rarch_main_command(EVENT_CMD_HISTORY_DEINIT); event_command(EVENT_CMD_HISTORY_DEINIT);
rarch_main_clear_state(); rarch_main_clear_state();
rarch_main_data_clear_state(); rarch_main_data_clear_state();
@ -1101,14 +1101,14 @@ void rarch_main_new(void)
init_state(); init_state();
main_init_state_config(); main_init_state_config();
rarch_main_command(EVENT_CMD_MSG_QUEUE_INIT); event_command(EVENT_CMD_MSG_QUEUE_INIT);
} }
void rarch_main_free(void) void rarch_main_free(void)
{ {
rarch_main_command(EVENT_CMD_MSG_QUEUE_DEINIT); event_command(EVENT_CMD_MSG_QUEUE_DEINIT);
rarch_main_command(EVENT_CMD_LOG_FILE_DEINIT); event_command(EVENT_CMD_LOG_FILE_DEINIT);
rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); event_command(EVENT_CMD_DRIVERS_DEINIT);
rarch_main_state_free(); rarch_main_state_free();
rarch_main_global_free(); rarch_main_global_free();
@ -1257,25 +1257,25 @@ int rarch_main_init(int argc, char *argv[])
init_drivers_pre(); init_drivers_pre();
if (!rarch_main_command(EVENT_CMD_CORE_INIT)) if (!event_command(EVENT_CMD_CORE_INIT))
goto error; goto error;
rarch_main_command(EVENT_CMD_DRIVERS_INIT); event_command(EVENT_CMD_DRIVERS_INIT);
rarch_main_command(EVENT_CMD_COMMAND_INIT); event_command(EVENT_CMD_COMMAND_INIT);
rarch_main_command(EVENT_CMD_REWIND_INIT); event_command(EVENT_CMD_REWIND_INIT);
rarch_main_command(EVENT_CMD_CONTROLLERS_INIT); event_command(EVENT_CMD_CONTROLLERS_INIT);
rarch_main_command(EVENT_CMD_RECORD_INIT); event_command(EVENT_CMD_RECORD_INIT);
rarch_main_command(EVENT_CMD_CHEATS_INIT); event_command(EVENT_CMD_CHEATS_INIT);
rarch_main_command(EVENT_CMD_REMAPPING_INIT); event_command(EVENT_CMD_REMAPPING_INIT);
rarch_main_command(EVENT_CMD_SAVEFILES_INIT); event_command(EVENT_CMD_SAVEFILES_INIT);
#if defined(GEKKO) && defined(HW_RVL) #if defined(GEKKO) && defined(HW_RVL)
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (settings) if (settings)
{ {
rarch_main_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
video_driver_set_aspect_ratio(settings->video.aspect_ratio_idx); video_driver_set_aspect_ratio(settings->video.aspect_ratio_idx);
} }
} }
@ -1286,7 +1286,7 @@ int rarch_main_init(int argc, char *argv[])
return 0; return 0;
error: error:
rarch_main_command(EVENT_CMD_CORE_DEINIT); event_command(EVENT_CMD_CORE_DEINIT);
global->main_is_init = false; global->main_is_init = false;
return 1; return 1;
@ -1375,12 +1375,12 @@ void rarch_main_set_state(unsigned cmd)
menu_driver_toggle(true); menu_driver_toggle(true);
/* Menu should always run with vsync on. */ /* Menu should always run with vsync on. */
rarch_main_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE); event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
/* Stop all rumbling before entering the menu. */ /* Stop all rumbling before entering the menu. */
rarch_main_command(EVENT_CMD_RUMBLE_STOP); event_command(EVENT_CMD_RUMBLE_STOP);
if (settings->menu.pause_libretro) if (settings->menu.pause_libretro)
rarch_main_command(EVENT_CMD_AUDIO_STOP); event_command(EVENT_CMD_AUDIO_STOP);
/* Override keyboard callback to redirect to menu instead. /* Override keyboard callback to redirect to menu instead.
* We'll use this later for something ... * We'll use this later for something ...
@ -1417,7 +1417,7 @@ void rarch_main_set_state(unsigned cmd)
driver_set_nonblock_state(driver->nonblock_state); driver_set_nonblock_state(driver->nonblock_state);
if (settings && settings->menu.pause_libretro) if (settings && settings->menu.pause_libretro)
rarch_main_command(EVENT_CMD_AUDIO_START); event_command(EVENT_CMD_AUDIO_START);
/* Prevent stray input from going to libretro core */ /* Prevent stray input from going to libretro core */
driver->flushing_input = true; driver->flushing_input = true;
@ -1453,26 +1453,26 @@ void rarch_main_deinit(void)
{ {
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
rarch_main_command(EVENT_CMD_NETPLAY_DEINIT); event_command(EVENT_CMD_NETPLAY_DEINIT);
rarch_main_command(EVENT_CMD_COMMAND_DEINIT); event_command(EVENT_CMD_COMMAND_DEINIT);
if (global->use_sram) if (global->use_sram)
rarch_main_command(EVENT_CMD_AUTOSAVE_DEINIT); event_command(EVENT_CMD_AUTOSAVE_DEINIT);
rarch_main_command(EVENT_CMD_RECORD_DEINIT); event_command(EVENT_CMD_RECORD_DEINIT);
rarch_main_command(EVENT_CMD_SAVEFILES); event_command(EVENT_CMD_SAVEFILES);
rarch_main_command(EVENT_CMD_REWIND_DEINIT); event_command(EVENT_CMD_REWIND_DEINIT);
rarch_main_command(EVENT_CMD_CHEATS_DEINIT); event_command(EVENT_CMD_CHEATS_DEINIT);
rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
rarch_main_command(EVENT_CMD_AUTOSAVE_STATE); event_command(EVENT_CMD_AUTOSAVE_STATE);
rarch_main_command(EVENT_CMD_CORE_DEINIT); event_command(EVENT_CMD_CORE_DEINIT);
rarch_main_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT); event_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT);
rarch_main_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); event_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT);
rarch_main_command(EVENT_CMD_SAVEFILES_DEINIT); event_command(EVENT_CMD_SAVEFILES_DEINIT);
global->main_is_init = false; global->main_is_init = false;
} }
@ -1502,7 +1502,7 @@ void rarch_playlist_load_content(content_playlist_t *playlist,
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path); rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path);
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
} }
/** /**
@ -1610,7 +1610,7 @@ bool rarch_replace_config(const char *path)
global->block_config_read = false; global->block_config_read = false;
*settings->libretro = '\0'; /* Load core in new config. */ *settings->libretro = '\0'; /* Load core in new config. */
rarch_main_command(EVENT_CMD_PREPARE_DUMMY); event_command(EVENT_CMD_PREPARE_DUMMY);
return true; return true;
} }

View File

@ -74,7 +74,7 @@ static bool check_pause(bool pause_pressed, bool frameadvance_pressed)
old_focus = focus; old_focus = focus;
if (cmd != EVENT_CMD_NONE) if (cmd != EVENT_CMD_NONE)
rarch_main_command(cmd); event_command(cmd);
if (runloop->is_paused == old_is_paused) if (runloop->is_paused == old_is_paused)
return false; return false;
@ -320,7 +320,7 @@ static bool check_movie_record(void)
RETRO_MSG_MOVIE_RECORD_STOPPING, 2, 180, true); RETRO_MSG_MOVIE_RECORD_STOPPING, 2, 180, true);
RARCH_LOG(RETRO_LOG_MOVIE_RECORD_STOPPING); RARCH_LOG(RETRO_LOG_MOVIE_RECORD_STOPPING);
rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
return true; return true;
} }
@ -342,7 +342,7 @@ static bool check_movie_playback(void)
RETRO_MSG_MOVIE_PLAYBACK_ENDED, 1, 180, false); RETRO_MSG_MOVIE_PLAYBACK_ENDED, 1, 180, false);
RARCH_LOG(RETRO_LOG_MOVIE_PLAYBACK_ENDED); RARCH_LOG(RETRO_LOG_MOVIE_PLAYBACK_ENDED);
rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
global->bsv.movie_end = false; global->bsv.movie_end = false;
global->bsv.movie_playback = false; global->bsv.movie_playback = false;
@ -449,16 +449,16 @@ static int do_pre_state_checks(rarch_cmd_state_t *cmd)
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (cmd->overlay_next_pressed) if (cmd->overlay_next_pressed)
rarch_main_command(EVENT_CMD_OVERLAY_NEXT); event_command(EVENT_CMD_OVERLAY_NEXT);
if (!runloop->is_paused || runloop->is_menu) if (!runloop->is_paused || runloop->is_menu)
{ {
if (cmd->fullscreen_toggle) if (cmd->fullscreen_toggle)
rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
} }
if (cmd->grab_mouse_pressed) if (cmd->grab_mouse_pressed)
rarch_main_command(EVENT_CMD_GRAB_MOUSE_TOGGLE); event_command(EVENT_CMD_GRAB_MOUSE_TOGGLE);
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (cmd->menu_pressed || (global->libretro_dummy)) if (cmd->menu_pressed || (global->libretro_dummy))
@ -474,10 +474,10 @@ static int do_netplay_state_checks(
bool fullscreen_toggle) bool fullscreen_toggle)
{ {
if (netplay_flip_pressed) if (netplay_flip_pressed)
rarch_main_command(EVENT_CMD_NETPLAY_FLIP_PLAYERS); event_command(EVENT_CMD_NETPLAY_FLIP_PLAYERS);
if (fullscreen_toggle) if (fullscreen_toggle)
rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
return 0; return 0;
} }
#endif #endif
@ -496,7 +496,7 @@ static int do_pause_state_checks(
if (fullscreen_toggle_pressed) if (fullscreen_toggle_pressed)
{ {
rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
rarch_render_cached_frame(); rarch_render_cached_frame();
} }
@ -525,10 +525,10 @@ static int do_state_checks(rarch_cmd_state_t *cmd)
return 1; return 1;
if (cmd->screenshot_pressed) if (cmd->screenshot_pressed)
rarch_main_command(EVENT_CMD_TAKE_SCREENSHOT); event_command(EVENT_CMD_TAKE_SCREENSHOT);
if (cmd->mute_pressed) if (cmd->mute_pressed)
rarch_main_command(EVENT_CMD_AUDIO_MUTE_TOGGLE); event_command(EVENT_CMD_AUDIO_MUTE_TOGGLE);
if (cmd->osk_pressed) if (cmd->osk_pressed)
{ {
@ -539,9 +539,9 @@ static int do_state_checks(rarch_cmd_state_t *cmd)
} }
if (cmd->volume_up_pressed) if (cmd->volume_up_pressed)
rarch_main_command(EVENT_CMD_VOLUME_UP); event_command(EVENT_CMD_VOLUME_UP);
else if (cmd->volume_down_pressed) else if (cmd->volume_down_pressed)
rarch_main_command(EVENT_CMD_VOLUME_DOWN); event_command(EVENT_CMD_VOLUME_DOWN);
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
if (driver->netplay_data) if (driver->netplay_data)
@ -561,9 +561,9 @@ static int do_state_checks(rarch_cmd_state_t *cmd)
check_stateslots(cmd->state_slot_increase, cmd->state_slot_decrease); check_stateslots(cmd->state_slot_increase, cmd->state_slot_decrease);
if (cmd->save_state_pressed) if (cmd->save_state_pressed)
rarch_main_command(EVENT_CMD_SAVE_STATE); event_command(EVENT_CMD_SAVE_STATE);
else if (cmd->load_state_pressed) else if (cmd->load_state_pressed)
rarch_main_command(EVENT_CMD_LOAD_STATE); event_command(EVENT_CMD_LOAD_STATE);
check_rewind(cmd->rewind_pressed); check_rewind(cmd->rewind_pressed);
check_slowmotion(cmd->slowmotion_pressed); check_slowmotion(cmd->slowmotion_pressed);
@ -574,14 +574,14 @@ static int do_state_checks(rarch_cmd_state_t *cmd)
check_shader_dir(cmd->shader_next_pressed, cmd->shader_prev_pressed); check_shader_dir(cmd->shader_next_pressed, cmd->shader_prev_pressed);
if (cmd->disk_eject_pressed) if (cmd->disk_eject_pressed)
rarch_main_command(EVENT_CMD_DISK_EJECT_TOGGLE); event_command(EVENT_CMD_DISK_EJECT_TOGGLE);
else if (cmd->disk_next_pressed) else if (cmd->disk_next_pressed)
rarch_main_command(EVENT_CMD_DISK_NEXT); event_command(EVENT_CMD_DISK_NEXT);
else if (cmd->disk_prev_pressed) else if (cmd->disk_prev_pressed)
rarch_main_command(EVENT_CMD_DISK_PREV); event_command(EVENT_CMD_DISK_PREV);
if (cmd->reset_pressed) if (cmd->reset_pressed)
rarch_main_command(EVENT_CMD_RESET); event_command(EVENT_CMD_RESET);
if (global->cheat) if (global->cheat)
{ {
@ -847,7 +847,7 @@ static int rarch_main_iterate_quit(void)
if (global->core_shutdown_initiated if (global->core_shutdown_initiated
&& settings->load_dummy_on_core_shutdown) && settings->load_dummy_on_core_shutdown)
{ {
if (!rarch_main_command(EVENT_CMD_PREPARE_DUMMY)) if (!event_command(EVENT_CMD_PREPARE_DUMMY))
return -1; return -1;
global->core_shutdown_initiated = false; global->core_shutdown_initiated = false;
@ -868,19 +868,19 @@ static void rarch_main_iterate_linefeed_overlay(void)
{ {
driver->osk_enable = false; driver->osk_enable = false;
prev_overlay_restore = true; prev_overlay_restore = true;
rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
return; return;
} }
else if (!driver->osk_enable && driver->keyboard_linefeed_enable) else if (!driver->osk_enable && driver->keyboard_linefeed_enable)
{ {
driver->osk_enable = true; driver->osk_enable = true;
prev_overlay_restore = false; prev_overlay_restore = false;
rarch_main_command(EVENT_CMD_OVERLAY_INIT); event_command(EVENT_CMD_OVERLAY_INIT);
return; return;
} }
else if (prev_overlay_restore) else if (prev_overlay_restore)
{ {
rarch_main_command(EVENT_CMD_OVERLAY_INIT); event_command(EVENT_CMD_OVERLAY_INIT);
prev_overlay_restore = false; prev_overlay_restore = false;
} }
} }
@ -952,10 +952,10 @@ void rarch_main_global_free(void)
{ {
global_t *global = NULL; global_t *global = NULL;
rarch_main_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT); event_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT);
rarch_main_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); event_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT);
rarch_main_command(EVENT_CMD_RECORD_DEINIT); event_command(EVENT_CMD_RECORD_DEINIT);
rarch_main_command(EVENT_CMD_LOG_FILE_DEINIT); event_command(EVENT_CMD_LOG_FILE_DEINIT);
global = global_get_ptr(); global = global_get_ptr();

View File

@ -812,7 +812,7 @@ static void core_list_change_handler(void *data)
rarch_setting_t *setting = (rarch_setting_t *)data; rarch_setting_t *setting = (rarch_setting_t *)data;
(void)setting; (void)setting;
rarch_main_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
} }
#endif #endif
@ -942,8 +942,8 @@ static int setting_bool_action_ok_exit(void *data, unsigned action)
if (setting->cmd_trigger.idx != EVENT_CMD_NONE) if (setting->cmd_trigger.idx != EVENT_CMD_NONE)
{ {
rarch_main_command(setting->cmd_trigger.idx); event_command(setting->cmd_trigger.idx);
rarch_main_command(EVENT_CMD_RESUME); event_command(EVENT_CMD_RESUME);
} }
return 0; return 0;
@ -995,7 +995,7 @@ static int setting_action_ok_video_refresh_rate_auto(
{ {
driver_set_refresh_rate(video_refresh_rate); driver_set_refresh_rate(video_refresh_rate);
/* Incase refresh rate update forced non-block video. */ /* Incase refresh rate update forced non-block video. */
rarch_main_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE); event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
} }
if (setting->cmd_trigger.idx != EVENT_CMD_NONE) if (setting->cmd_trigger.idx != EVENT_CMD_NONE)
@ -1054,7 +1054,7 @@ static int setting_action_action_ok(void *data, unsigned action)
return -1; return -1;
if (setting->cmd_trigger.idx != EVENT_CMD_NONE) if (setting->cmd_trigger.idx != EVENT_CMD_NONE)
rarch_main_command(setting->cmd_trigger.idx); event_command(setting->cmd_trigger.idx);
return 0; return 0;
} }
@ -3140,7 +3140,7 @@ static void general_write_handler(void *data)
} }
if (rarch_cmd || setting->cmd_trigger.triggered) if (rarch_cmd || setting->cmd_trigger.triggered)
rarch_main_command(rarch_cmd); event_command(rarch_cmd);
} }
#define START_GROUP(group_info, NAME) \ #define START_GROUP(group_info, NAME) \
@ -3291,7 +3291,7 @@ static void load_content_change_handler(void *data)
* crashes. I think it is because LOAD_CORE has not yet run. I'm not * crashes. I think it is because LOAD_CORE has not yet run. I'm not
* sure the best way to test for that. * sure the best way to test for that.
*/ */
rarch_main_command(EVENT_CMD_LOAD_CONTENT); event_command(EVENT_CMD_LOAD_CONTENT);
} }
static void overlay_enable_toggle_change_handler(void *data) static void overlay_enable_toggle_change_handler(void *data)
@ -3302,9 +3302,9 @@ static void overlay_enable_toggle_change_handler(void *data)
return; return;
if (setting->value.boolean) if (setting->value.boolean)
rarch_main_command(EVENT_CMD_OVERLAY_INIT); event_command(EVENT_CMD_OVERLAY_INIT);
else else
rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
} }
static bool setting_append_list_main_menu_options( static bool setting_append_list_main_menu_options(