From 0818b178f94a2bdef61fdb9f1a079d36c5e19fab Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 13 Apr 2015 11:26:02 +0200 Subject: [PATCH] Rename rarch_main_command to event_command --- apple/OSX/platform.m | 14 ++--- audio/audio_driver.c | 10 ++-- command_event.c | 88 ++++++++++++++--------------- command_event.h | 4 +- driver.c | 8 +-- dynamic.c | 2 +- frontend/drivers/platform_android.c | 2 +- frontend/frontend.c | 8 +-- gfx/common/win32_common.c | 2 +- gfx/drivers/ctr_gfx.c | 7 ++- gfx/video_driver.c | 10 ++-- input/drivers_joypad/ctr_joypad.c | 2 +- menu/menu.c | 12 ++-- menu/menu_entries_cbs.c | 2 +- menu/menu_entries_cbs_iterate.c | 14 ++--- menu/menu_entries_cbs_ok.c | 20 +++---- menu/menu_entries_cbs_start.c | 2 +- menu/menu_entries_cbs_toggle.c | 4 +- record/record_driver.c | 8 +-- retroarch.c | 80 +++++++++++++------------- runloop.c | 54 +++++++++--------- settings.c | 18 +++--- 22 files changed, 186 insertions(+), 185 deletions(-) diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index 3b9a58cc45..b79992e563 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -256,7 +256,7 @@ static void poll_iteration(void) if (global && global->main_is_init) reply = NSTerminateCancel; - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); return reply; } @@ -274,7 +274,7 @@ static void poll_iteration(void) strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath)); if (core_name) - rarch_main_command(EVENT_CMD_LOAD_CONTENT); + event_command(EVENT_CMD_LOAD_CONTENT); else [self chooseCore]; @@ -306,7 +306,7 @@ static void poll_iteration(void) strlcpy(global->fullpath, __core.UTF8String, sizeof(global->fullpath)); if (core_name) - rarch_main_command(EVENT_CMD_LOAD_CONTENT); + event_command(EVENT_CMD_LOAD_CONTENT); else [self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f]; } @@ -346,11 +346,11 @@ static void poll_iteration(void) if (global && !global->main_is_init) { /* TODO/FIXME: Set core/content here. */ - rarch_main_command(EVENT_CMD_LOAD_CORE); - rarch_main_command(EVENT_CMD_LOAD_CONTENT); + event_command(EVENT_CMD_LOAD_CORE); + event_command(EVENT_CMD_LOAD_CONTENT); } else - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); } #pragma mark RetroArch_Platform @@ -429,7 +429,7 @@ static void poll_iteration(void) cmd = EVENT_CMD_RESIZE_WINDOWED_SCALE; } - rarch_main_command(cmd); + event_command(cmd); } - (void)alertDidEnd:(NSAlert *)alert returnCode:(int32_t)returnCode contextInfo:(void *)contextInfo diff --git a/audio/audio_driver.c b/audio/audio_driver.c index 08e4201cd6..ae290140ad 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -279,7 +279,7 @@ void uninit_audio(void) free(global->audio_data.outsamples); global->audio_data.outsamples = NULL; - rarch_main_command(EVENT_CMD_DSP_FILTER_DEINIT); + event_command(EVENT_CMD_DSP_FILTER_DEINIT); compute_audio_buffer_statistics(); } @@ -363,7 +363,7 @@ void init_audio(void) 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.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_main_command(EVENT_CMD_DSP_FILTER_INIT); + event_command(EVENT_CMD_DSP_FILTER_INIT); 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; if (settings->audio.mute_enable) - rarch_main_command(EVENT_CMD_AUDIO_STOP); - else if (!rarch_main_command(EVENT_CMD_AUDIO_START)) + event_command(EVENT_CMD_AUDIO_STOP); + else if (!event_command(EVENT_CMD_AUDIO_START)) { driver->audio_active = false; return false; diff --git a/command_event.c b/command_event.c index f0a02799be..f612497649 100644 --- a/command_event.c +++ b/command_event.c @@ -346,7 +346,7 @@ static void event_deinit_core(bool reinit) pretro_deinit(); if (reinit) - rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); + event_command(EVENT_CMD_DRIVERS_DEINIT); if(global->overrides_active) { @@ -501,8 +501,8 @@ static bool event_init_content(void) RARCH_LOG("Skipping SRAM load.\n"); event_load_auto_state(); - rarch_main_command(EVENT_CMD_BSV_MOVIE_INIT); - rarch_main_command(EVENT_CMD_NETPLAY_INIT); + event_command(EVENT_CMD_BSV_MOVIE_INIT); + event_command(EVENT_CMD_NETPLAY_INIT); 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. * * Performs RetroArch event command with index @cmd. * * Returns: true (1) on success, otherwise false (0). **/ -bool rarch_main_command(unsigned cmd) +bool event_command(unsigned cmd) { unsigned i = 0; bool boolean = false; @@ -794,19 +794,19 @@ bool rarch_main_command(unsigned cmd) { case EVENT_CMD_LOAD_CONTENT_PERSIST: #ifdef HAVE_DYNAMIC - rarch_main_command(EVENT_CMD_LOAD_CORE); + event_command(EVENT_CMD_LOAD_CORE); #endif rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT); break; case EVENT_CMD_LOAD_CONTENT: #ifdef HAVE_DYNAMIC - rarch_main_command(EVENT_CMD_LOAD_CONTENT_PERSIST); + event_command(EVENT_CMD_LOAD_CONTENT_PERSIST); #else rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)settings->libretro); rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)global->fullpath); - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); #endif break; case EVENT_CMD_LOAD_CORE_DEINIT: @@ -815,7 +815,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case EVENT_CMD_LOAD_CORE_PERSIST: - rarch_main_command(EVENT_CMD_LOAD_CORE_DEINIT); + event_command(EVENT_CMD_LOAD_CORE_DEINIT); { #ifdef HAVE_MENU menu_handle_t *menu = menu_driver_get_ptr(); @@ -826,9 +826,9 @@ bool rarch_main_command(unsigned cmd) } break; case EVENT_CMD_LOAD_CORE: - rarch_main_command(EVENT_CMD_LOAD_CORE_PERSIST); + event_command(EVENT_CMD_LOAD_CORE_PERSIST); #ifndef HAVE_DYNAMIC - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); #endif break; case EVENT_CMD_LOAD_STATE: @@ -850,7 +850,7 @@ bool rarch_main_command(unsigned cmd) settings->video.scale = global->pending.windowed_scale; if (!settings->video.fullscreen) - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); global->pending.windowed_scale = 0; break; @@ -870,7 +870,7 @@ bool rarch_main_command(unsigned cmd) /* bSNES since v073r01 resets controllers to JOYPAD * after a reset, so just enforce it here. */ - rarch_main_command(EVENT_CMD_CONTROLLERS_INIT); + event_command(EVENT_CMD_CONTROLLERS_INIT); break; case EVENT_CMD_SAVE_STATE: if (settings->savestate_auto_index) @@ -898,7 +898,7 @@ bool rarch_main_command(unsigned cmd) } break; case EVENT_CMD_UNLOAD_CORE: - rarch_main_command(EVENT_CMD_PREPARE_DUMMY); + event_command(EVENT_CMD_PREPARE_DUMMY); #ifdef HAVE_DYNAMIC libretro_free_system_info(&global->menu.info); #endif @@ -910,7 +910,7 @@ bool rarch_main_command(unsigned cmd) driver->video_cache_context = global->system.hw_render_callback.cache_context; driver->video_cache_context_ack = false; - rarch_main_command(EVENT_CMD_RESET_CONTEXT); + event_command(EVENT_CMD_RESET_CONTEXT); driver->video_cache_context = false; /* Poll input to avoid possibly stale data to corrupt things. */ @@ -919,7 +919,7 @@ bool rarch_main_command(unsigned cmd) #ifdef HAVE_MENU runloop->frames.video.current.menu.framebuf.dirty = true; if (runloop->is_menu) - rarch_main_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE); + event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE); #endif break; case EVENT_CMD_CHEATS_DEINIT: @@ -931,13 +931,13 @@ bool rarch_main_command(unsigned cmd) global->cheat = NULL; break; case EVENT_CMD_CHEATS_INIT: - rarch_main_command(EVENT_CMD_CHEATS_DEINIT); + event_command(EVENT_CMD_CHEATS_DEINIT); event_init_cheats(); break; case EVENT_CMD_REMAPPING_DEINIT: break; case EVENT_CMD_REMAPPING_INIT: - rarch_main_command(EVENT_CMD_REMAPPING_DEINIT); + event_command(EVENT_CMD_REMAPPING_DEINIT); event_init_remapping(); break; case EVENT_CMD_REWIND_DEINIT: @@ -956,9 +956,9 @@ bool rarch_main_command(unsigned cmd) break; case EVENT_CMD_REWIND_TOGGLE: if (settings->rewind_enable) - rarch_main_command(EVENT_CMD_REWIND_INIT); + event_command(EVENT_CMD_REWIND_INIT); else - rarch_main_command(EVENT_CMD_REWIND_DEINIT); + event_command(EVENT_CMD_REWIND_DEINIT); break; case EVENT_CMD_AUTOSAVE_DEINIT: #ifdef HAVE_THREADS @@ -966,7 +966,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case EVENT_CMD_AUTOSAVE_INIT: - rarch_main_command(EVENT_CMD_AUTOSAVE_DEINIT); + event_command(EVENT_CMD_AUTOSAVE_DEINIT); #ifdef HAVE_THREADS event_init_autosave(); #endif @@ -1018,7 +1018,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case EVENT_CMD_OVERLAY_INIT: - rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); + event_command(EVENT_CMD_OVERLAY_DEINIT); #ifdef HAVE_OVERLAY if (driver->osk_enable) { @@ -1052,7 +1052,7 @@ bool rarch_main_command(unsigned cmd) global->audio_data.dsp = NULL; break; 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) break; @@ -1075,7 +1075,7 @@ bool rarch_main_command(unsigned cmd) return false; break; case EVENT_CMD_RECORD_INIT: - rarch_main_command(EVENT_CMD_HISTORY_DEINIT); + event_command(EVENT_CMD_HISTORY_DEINIT); if (!recording_init()) return false; break; @@ -1085,7 +1085,7 @@ bool rarch_main_command(unsigned cmd) g_defaults.history = NULL; break; case EVENT_CMD_HISTORY_INIT: - rarch_main_command(EVENT_CMD_HISTORY_DEINIT); + event_command(EVENT_CMD_HISTORY_DEINIT); if (!settings->history_list_enable) return false; 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(); break; 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) global->core_info = core_info_list_new(settings->libretro_directory); @@ -1156,8 +1156,8 @@ bool rarch_main_command(unsigned cmd) init_drivers(DRIVER_AUDIO); break; case EVENT_CMD_RESET_CONTEXT: - rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); - rarch_main_command(EVENT_CMD_DRIVERS_INIT); + event_command(EVENT_CMD_DRIVERS_DEINIT); + event_command(EVENT_CMD_DRIVERS_INIT); break; case EVENT_CMD_QUIT_RETROARCH: rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT); @@ -1187,7 +1187,7 @@ bool rarch_main_command(unsigned cmd) if (runloop->is_paused) { RARCH_LOG("Paused.\n"); - rarch_main_command(EVENT_CMD_AUDIO_STOP); + event_command(EVENT_CMD_AUDIO_STOP); if (settings->video.black_frame_insertion) rarch_render_cached_frame(); @@ -1195,33 +1195,33 @@ bool rarch_main_command(unsigned cmd) else { RARCH_LOG("Unpaused.\n"); - rarch_main_command(EVENT_CMD_AUDIO_START); + event_command(EVENT_CMD_AUDIO_START); } break; case EVENT_CMD_PAUSE_TOGGLE: runloop->is_paused = !runloop->is_paused; - rarch_main_command(EVENT_CMD_PAUSE_CHECKS); + event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_UNPAUSE: runloop->is_paused = false; - rarch_main_command(EVENT_CMD_PAUSE_CHECKS); + event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_PAUSE: runloop->is_paused = true; - rarch_main_command(EVENT_CMD_PAUSE_CHECKS); + event_command(EVENT_CMD_PAUSE_CHECKS); break; case EVENT_CMD_MENU_PAUSE_LIBRETRO: if (runloop->is_menu) { if (settings->menu.pause_libretro) - rarch_main_command(EVENT_CMD_AUDIO_STOP); + event_command(EVENT_CMD_AUDIO_STOP); else - rarch_main_command(EVENT_CMD_AUDIO_START); + event_command(EVENT_CMD_AUDIO_START); } else { if (settings->menu.pause_libretro) - rarch_main_command(EVENT_CMD_AUDIO_START); + event_command(EVENT_CMD_AUDIO_START); } break; case EVENT_CMD_SHADER_DIR_DEINIT: @@ -1233,7 +1233,7 @@ bool rarch_main_command(unsigned cmd) global->shader_dir.ptr = 0; break; 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) return false; @@ -1243,7 +1243,7 @@ bool rarch_main_command(unsigned cmd) 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; } @@ -1276,13 +1276,13 @@ bool rarch_main_command(unsigned cmd) RARCH_LOG("SRAM will not be saved.\n"); if (global->use_sram) - rarch_main_command(EVENT_CMD_AUTOSAVE_INIT); + event_command(EVENT_CMD_AUTOSAVE_INIT); break; case EVENT_CMD_MSG_QUEUE_DEINIT: rarch_main_msg_queue_free(); break; 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_data_init_queues(); break; @@ -1295,7 +1295,7 @@ bool rarch_main_command(unsigned cmd) global->bsv.movie = NULL; break; case EVENT_CMD_BSV_MOVIE_INIT: - rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); + event_command(EVENT_CMD_BSV_MOVIE_DEINIT); event_init_movie(); break; case EVENT_CMD_NETPLAY_DEINIT: @@ -1314,7 +1314,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case EVENT_CMD_NETPLAY_INIT: - rarch_main_command(EVENT_CMD_NETPLAY_DEINIT); + event_command(EVENT_CMD_NETPLAY_DEINIT); #ifdef HAVE_NETPLAY if (!init_netplay()) return false; @@ -1337,7 +1337,7 @@ bool rarch_main_command(unsigned cmd) /* If we go fullscreen we drop all drivers and * reinitialize to be safe. */ settings->video.fullscreen = !settings->video.fullscreen; - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); break; case EVENT_CMD_COMMAND_DEINIT: #ifdef HAVE_COMMAND @@ -1347,7 +1347,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case EVENT_CMD_COMMAND_INIT: - rarch_main_command(EVENT_CMD_COMMAND_DEINIT); + event_command(EVENT_CMD_COMMAND_DEINIT); #ifdef HAVE_COMMAND event_init_command(); diff --git a/command_event.h b/command_event.h index 95dbd7c060..97b665ea6d 100644 --- a/command_event.h +++ b/command_event.h @@ -196,14 +196,14 @@ enum event_command }; /** - * rarch_main_command: + * event_command: * @cmd : Command index. * * Performs RetroArch command with index @cmd. * * Returns: true (1) on success, otherwise false (0). **/ -bool rarch_main_command(unsigned action); +bool event_command(unsigned action); #ifdef __cplusplus } diff --git a/driver.c b/driver.c index 4ba5346ff7..f2724047fa 100644 --- a/driver.c +++ b/driver.c @@ -244,7 +244,7 @@ static void driver_adjust_system_rates(void) return; if (global->system.force_nonblock) - rarch_main_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE); + event_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE); else 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(); global->system.av_info = *info; - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); /* Cannot continue recording with different parameters. * 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."; rarch_main_msg_queue_push(msg, 2, 180, false); RARCH_WARN("%s\n", msg); - rarch_main_command(EVENT_CMD_RECORD_DEINIT); - rarch_main_command(EVENT_CMD_RECORD_INIT); + event_command(EVENT_CMD_RECORD_DEINIT); + event_command(EVENT_CMD_RECORD_INIT); } return true; diff --git a/dynamic.c b/dynamic.c index 5a5a3f7043..7ac2a79e99 100644 --- a/dynamic.c +++ b/dynamic.c @@ -1122,7 +1122,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) /* Forces recomputation of aspect ratios if * 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. */ } diff --git a/frontend/drivers/platform_android.c b/frontend/drivers/platform_android.c index 4b95317277..0936e6a639 100644 --- a/frontend/drivers/platform_android.c +++ b/frontend/drivers/platform_android.c @@ -73,7 +73,7 @@ void engine_handle_cmd(void *data) slock_unlock(android_app->mutex); if (runloop->is_paused) - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); break; case APP_CMD_RESUME: diff --git a/frontend/frontend.c b/frontend/frontend.c index 2e046c53da..eb4544fff5 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -70,7 +70,7 @@ void main_exit_save_config(void) 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_command(EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG); + event_command(EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG); #if defined(HAVE_LOGGER) && !defined(ANDROID) logger_shutdown(); @@ -264,7 +264,7 @@ bool main_load_content(int argc, char **argv, args_type() args, goto error; } - rarch_main_command(EVENT_CMD_RESUME); + event_command(EVENT_CMD_RESUME); if (process_args) 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(); diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 7b8a808527..589574ea57 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -172,7 +172,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) } if (cmd != EVENT_CMD_NONE) - rarch_main_command(cmd); + event_command(cmd); if (do_wm_close) PostMessage(owner, WM_CLOSE, 0, 0); diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 69cc6e3951..a92bc5a408 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -226,6 +226,8 @@ static bool ctr_frame(void* data, const void* frame, static int total_frames = 0; static int frames = 0; + extern bool select_pressed; + RARCH_PERFORMANCE_INIT(ctrframe_f); RARCH_PERFORMANCE_START(ctrframe_f); @@ -237,14 +239,13 @@ static bool ctr_frame(void* data, const void* frame, if(!aptMainLoop()) { - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); goto end; } - extern bool select_pressed; if (select_pressed) { - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); goto end; } diff --git a/gfx/video_driver.c b/gfx/video_driver.c index f6b1c6b0da..5407d320c5 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -400,7 +400,7 @@ void uninit_video_input(void) { driver_t *driver = driver_get_ptr(); - rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); + event_command(EVENT_CMD_OVERLAY_DEINIT); if ( !driver->input_data_own && @@ -419,7 +419,7 @@ void uninit_video_input(void) deinit_video_filter(); - rarch_main_command(EVENT_CMD_SHADER_DIR_DEINIT); + event_command(EVENT_CMD_SHADER_DIR_DEINIT); video_monitor_compute_fps_statistics(); } @@ -439,7 +439,7 @@ void init_video(void) runloop->frames.video.count = 0; 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; max_dim = max(geom->max_width, geom->max_height); @@ -567,8 +567,8 @@ void init_video(void) if (!driver->input) init_video_input(tmp); - rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); - rarch_main_command(EVENT_CMD_OVERLAY_INIT); + event_command(EVENT_CMD_OVERLAY_DEINIT); + event_command(EVENT_CMD_OVERLAY_INIT); runloop->measure_data.frame_time_samples_count = 0; diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index 34240f4a2e..f68b14fcdb 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -164,7 +164,7 @@ static void ctr_joypad_poll(void) (state_tmp & KEY_SELECT) && (state_tmp & KEY_L) && (state_tmp & KEY_R)) - rarch_main_command(EVENT_CMD_QUIT); + event_command(EVENT_CMD_QUIT); } diff --git a/menu/menu.c b/menu/menu.c index 5db1c94098..bae005c75d 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -76,9 +76,9 @@ void menu_update_libretro_info(struct retro_system_info *info) retro_get_system_info(info); #endif - rarch_main_command(EVENT_CMD_CORE_INFO_INIT); + event_command(EVENT_CMD_CORE_INFO_INIT); 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[], @@ -168,13 +168,13 @@ bool menu_load_content(void) 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)) push_to_history_playlist(); - rarch_main_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); - rarch_main_command(EVENT_CMD_RESUME); + event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); + event_command(EVENT_CMD_RESUME); return true; } @@ -310,7 +310,7 @@ void menu_free(void *data) menu_list_free(menu->menu_list); menu->menu_list = NULL; - rarch_main_command(EVENT_CMD_HISTORY_DEINIT); + event_command(EVENT_CMD_HISTORY_DEINIT); if (global->core_info) core_info_list_free(global->core_info); diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index 71bdb0638e..5280010756 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -33,7 +33,7 @@ void menu_entries_common_load_content(bool persist) if (!menu) 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->msg_force = true; diff --git a/menu/menu_entries_cbs_iterate.c b/menu/menu_entries_cbs_iterate.c index e095b99303..4773881f59 100644 --- a/menu/menu_entries_cbs_iterate.c +++ b/menu/menu_entries_cbs_iterate.c @@ -92,7 +92,7 @@ static int archive_load(void) switch (ret) { case -1: - rarch_main_command(EVENT_CMD_LOAD_CORE); + event_command(EVENT_CMD_LOAD_CORE); menu_entries_common_load_content(false); break; case 0: @@ -461,7 +461,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action) else if (custom->height >= (unsigned)stride_y) custom->height -= stride_y; - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); break; case MENU_ACTION_DOWN: @@ -474,7 +474,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action) else custom->height += stride_y; - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); break; 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) custom->width -= stride_x; - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); break; case MENU_ACTION_RIGHT: @@ -499,7 +499,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action) else custom->width += stride_x; - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); break; 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; } - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); } break; @@ -596,7 +596,7 @@ static int action_iterate_menu_viewport(const char *label, unsigned action) aspectratio_lut[ASPECT_RATIO_CUSTOM].value = (float)custom->width / custom->height; - rarch_main_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); + event_command(EVENT_CMD_VIDEO_APPLY_STATE_CHANGES); return 0; } diff --git a/menu/menu_entries_cbs_ok.c b/menu/menu_entries_cbs_ok.c index dcef1fd4f5..9d4cc6e612 100644 --- a/menu/menu_entries_cbs_ok.c +++ b/menu/menu_entries_cbs_ok.c @@ -298,7 +298,7 @@ static int action_ok_core_updater_list(const char *path, return -1; #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, ".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, 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"); @@ -667,7 +667,7 @@ static int action_ok_core_load(const char *path, fill_pathname_join(settings->libretro, menu_path, path, 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); #if defined(HAVE_DYNAMIC) /* 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. * Will take effect on new content load. */ #elif defined(RARCH_CONSOLE) - rarch_main_command(EVENT_CMD_RESTART_RETROARCH); + event_command(EVENT_CMD_RESTART_RETROARCH); return -1; #endif } @@ -818,7 +818,7 @@ static int action_ok_disk_image_append(const char *path, fill_pathname_join(image, menu_path, path, sizeof(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); return -1; @@ -845,7 +845,7 @@ static int action_ok_file_load_with_detect_core(const char *path, if (ret == -1) { - rarch_main_command(EVENT_CMD_LOAD_CORE); + event_command(EVENT_CMD_LOAD_CORE); menu_entries_common_load_content(false); return -1; } @@ -951,7 +951,7 @@ static int action_ok_custom_viewport(const char *path, 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; } @@ -959,7 +959,7 @@ static int action_ok_custom_viewport(const char *path, static int generic_action_ok_command(unsigned cmd) { - if (!rarch_main_command(cmd)) + if (!event_command(cmd)) return -1; return 0; } @@ -1059,7 +1059,7 @@ static int action_ok_file_load_or_resume(const char *path, { strlcpy(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); return -1; } @@ -1188,7 +1188,7 @@ static int action_ok_video_resolution(const char *path, global->console.screen.pal60_enable = false; } - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); #else if (video_driver_get_video_output_size(&width, &height)) video_driver_set_video_mode(width, height, true); diff --git a/menu/menu_entries_cbs_start.c b/menu/menu_entries_cbs_start.c index b7213592b8..3c4b193b71 100644 --- a/menu/menu_entries_cbs_start.c +++ b/menu/menu_entries_cbs_start.c @@ -40,7 +40,7 @@ static int action_start_video_filter_file_load(unsigned type, const char *label, settings_t *settings = config_get_ptr(); settings->video.softfilter_plugin[0] = '\0'; - rarch_main_command(EVENT_CMD_REINIT); + event_command(EVENT_CMD_REINIT); return 0; } diff --git a/menu/menu_entries_cbs_toggle.c b/menu/menu_entries_cbs_toggle.c index 28242c990d..e56ba7016a 100644 --- a/menu/menu_entries_cbs_toggle.c +++ b/menu/menu_entries_cbs_toggle.c @@ -479,10 +479,10 @@ static int disk_options_disk_idx_toggle(unsigned type, const char *label, switch (action) { case MENU_ACTION_LEFT: - rarch_main_command(EVENT_CMD_DISK_PREV); + event_command(EVENT_CMD_DISK_PREV); break; case MENU_ACTION_RIGHT: - rarch_main_command(EVENT_CMD_DISK_NEXT); + event_command(EVENT_CMD_DISK_NEXT); break; } diff --git a/record/record_driver.c b/record/record_driver.c index b1409bab67..61c71a5a78 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -113,7 +113,7 @@ void recording_dump_frame(const void *data, unsigned width, if (!vp.width || !vp.height) { 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); return; @@ -127,7 +127,7 @@ void recording_dump_frame(const void *data, unsigned width, RARCH_WARN("%s\n", msg); rarch_main_msg_queue_push(msg, 1, 180, true); - rarch_main_command(EVENT_CMD_RECORD_DEINIT); + event_command(EVENT_CMD_RECORD_DEINIT); return; } @@ -169,7 +169,7 @@ bool recording_deinit(void) driver->recording_data = NULL; driver->recording = NULL; - rarch_main_command(EVENT_CMD_GPU_RECORD_DEINIT); + event_command(EVENT_CMD_GPU_RECORD_DEINIT); return true; } @@ -302,7 +302,7 @@ bool recording_init(void) if (!ffemu_init_first(&driver->recording, &driver->recording_data, ¶ms)) { RARCH_ERR(RETRO_LOG_INIT_RECORDING_FAILED); - rarch_main_command(EVENT_CMD_GPU_RECORD_DEINIT); + event_command(EVENT_CMD_GPU_RECORD_DEINIT); return false; } diff --git a/retroarch.c b/retroarch.c index a14f232938..369559079c 100644 --- a/retroarch.c +++ b/retroarch.c @@ -786,7 +786,7 @@ static void rarch_init_savefile_paths(void) { global_t *global = global_get_ptr(); - rarch_main_command(EVENT_CMD_SAVEFILES_DEINIT); + event_command(EVENT_CMD_SAVEFILES_DEINIT); global->savefiles = string_list_new(); rarch_assert(global->savefiles); @@ -919,7 +919,7 @@ void rarch_disk_control_append_image(const char *path) RARCH_LOG("%s\n", msg); 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. */ if (!*global->subsystem) @@ -932,7 +932,7 @@ void rarch_disk_control_append_image(const char *path) rarch_fill_pathnames(); } - rarch_main_command(EVENT_CMD_AUTOSAVE_INIT); + event_command(EVENT_CMD_AUTOSAVE_INIT); rarch_disk_control_set_eject(false, false); } @@ -1054,8 +1054,8 @@ static void main_clear_state_drivers(void) if (!inited) return; - rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); - rarch_main_command(EVENT_CMD_DRIVERS_INIT); + event_command(EVENT_CMD_DRIVERS_DEINIT); + event_command(EVENT_CMD_DRIVERS_INIT); } static void main_init_state_config(void) @@ -1081,7 +1081,7 @@ void rarch_main_alloc(void) if (!settings) return; - rarch_main_command(EVENT_CMD_HISTORY_DEINIT); + event_command(EVENT_CMD_HISTORY_DEINIT); rarch_main_clear_state(); rarch_main_data_clear_state(); @@ -1101,14 +1101,14 @@ void rarch_main_new(void) init_state(); main_init_state_config(); - rarch_main_command(EVENT_CMD_MSG_QUEUE_INIT); + event_command(EVENT_CMD_MSG_QUEUE_INIT); } void rarch_main_free(void) { - rarch_main_command(EVENT_CMD_MSG_QUEUE_DEINIT); - rarch_main_command(EVENT_CMD_LOG_FILE_DEINIT); - rarch_main_command(EVENT_CMD_DRIVERS_DEINIT); + event_command(EVENT_CMD_MSG_QUEUE_DEINIT); + event_command(EVENT_CMD_LOG_FILE_DEINIT); + event_command(EVENT_CMD_DRIVERS_DEINIT); rarch_main_state_free(); rarch_main_global_free(); @@ -1257,25 +1257,25 @@ int rarch_main_init(int argc, char *argv[]) init_drivers_pre(); - if (!rarch_main_command(EVENT_CMD_CORE_INIT)) + if (!event_command(EVENT_CMD_CORE_INIT)) goto error; - rarch_main_command(EVENT_CMD_DRIVERS_INIT); - rarch_main_command(EVENT_CMD_COMMAND_INIT); - rarch_main_command(EVENT_CMD_REWIND_INIT); - rarch_main_command(EVENT_CMD_CONTROLLERS_INIT); - rarch_main_command(EVENT_CMD_RECORD_INIT); - rarch_main_command(EVENT_CMD_CHEATS_INIT); - rarch_main_command(EVENT_CMD_REMAPPING_INIT); + event_command(EVENT_CMD_DRIVERS_INIT); + event_command(EVENT_CMD_COMMAND_INIT); + event_command(EVENT_CMD_REWIND_INIT); + event_command(EVENT_CMD_CONTROLLERS_INIT); + event_command(EVENT_CMD_RECORD_INIT); + event_command(EVENT_CMD_CHEATS_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) { settings_t *settings = config_get_ptr(); 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); } } @@ -1286,7 +1286,7 @@ int rarch_main_init(int argc, char *argv[]) return 0; error: - rarch_main_command(EVENT_CMD_CORE_DEINIT); + event_command(EVENT_CMD_CORE_DEINIT); global->main_is_init = false; return 1; @@ -1375,12 +1375,12 @@ void rarch_main_set_state(unsigned cmd) menu_driver_toggle(true); /* 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. */ - rarch_main_command(EVENT_CMD_RUMBLE_STOP); + event_command(EVENT_CMD_RUMBLE_STOP); 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. * 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); 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 */ driver->flushing_input = true; @@ -1453,26 +1453,26 @@ void rarch_main_deinit(void) { global_t *global = global_get_ptr(); - rarch_main_command(EVENT_CMD_NETPLAY_DEINIT); - rarch_main_command(EVENT_CMD_COMMAND_DEINIT); + event_command(EVENT_CMD_NETPLAY_DEINIT); + event_command(EVENT_CMD_COMMAND_DEINIT); if (global->use_sram) - rarch_main_command(EVENT_CMD_AUTOSAVE_DEINIT); + event_command(EVENT_CMD_AUTOSAVE_DEINIT); - rarch_main_command(EVENT_CMD_RECORD_DEINIT); - rarch_main_command(EVENT_CMD_SAVEFILES); + event_command(EVENT_CMD_RECORD_DEINIT); + event_command(EVENT_CMD_SAVEFILES); - rarch_main_command(EVENT_CMD_REWIND_DEINIT); - rarch_main_command(EVENT_CMD_CHEATS_DEINIT); - rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); + event_command(EVENT_CMD_REWIND_DEINIT); + event_command(EVENT_CMD_CHEATS_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); - rarch_main_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); - rarch_main_command(EVENT_CMD_SAVEFILES_DEINIT); + event_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT); + event_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); + event_command(EVENT_CMD_SAVEFILES_DEINIT); 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_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; *settings->libretro = '\0'; /* Load core in new config. */ - rarch_main_command(EVENT_CMD_PREPARE_DUMMY); + event_command(EVENT_CMD_PREPARE_DUMMY); return true; } diff --git a/runloop.c b/runloop.c index 1616e8fd48..85a53a0790 100644 --- a/runloop.c +++ b/runloop.c @@ -74,7 +74,7 @@ static bool check_pause(bool pause_pressed, bool frameadvance_pressed) old_focus = focus; if (cmd != EVENT_CMD_NONE) - rarch_main_command(cmd); + event_command(cmd); if (runloop->is_paused == old_is_paused) return false; @@ -320,7 +320,7 @@ static bool check_movie_record(void) RETRO_MSG_MOVIE_RECORD_STOPPING, 2, 180, true); RARCH_LOG(RETRO_LOG_MOVIE_RECORD_STOPPING); - rarch_main_command(EVENT_CMD_BSV_MOVIE_DEINIT); + event_command(EVENT_CMD_BSV_MOVIE_DEINIT); return true; } @@ -342,7 +342,7 @@ static bool check_movie_playback(void) RETRO_MSG_MOVIE_PLAYBACK_ENDED, 1, 180, false); 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_playback = false; @@ -449,16 +449,16 @@ static int do_pre_state_checks(rarch_cmd_state_t *cmd) global_t *global = global_get_ptr(); 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 (cmd->fullscreen_toggle) - rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); + event_command(EVENT_CMD_FULLSCREEN_TOGGLE); } if (cmd->grab_mouse_pressed) - rarch_main_command(EVENT_CMD_GRAB_MOUSE_TOGGLE); + event_command(EVENT_CMD_GRAB_MOUSE_TOGGLE); #ifdef HAVE_MENU if (cmd->menu_pressed || (global->libretro_dummy)) @@ -474,10 +474,10 @@ static int do_netplay_state_checks( bool fullscreen_toggle) { if (netplay_flip_pressed) - rarch_main_command(EVENT_CMD_NETPLAY_FLIP_PLAYERS); + event_command(EVENT_CMD_NETPLAY_FLIP_PLAYERS); if (fullscreen_toggle) - rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); + event_command(EVENT_CMD_FULLSCREEN_TOGGLE); return 0; } #endif @@ -496,7 +496,7 @@ static int do_pause_state_checks( if (fullscreen_toggle_pressed) { - rarch_main_command(EVENT_CMD_FULLSCREEN_TOGGLE); + event_command(EVENT_CMD_FULLSCREEN_TOGGLE); rarch_render_cached_frame(); } @@ -525,10 +525,10 @@ static int do_state_checks(rarch_cmd_state_t *cmd) return 1; if (cmd->screenshot_pressed) - rarch_main_command(EVENT_CMD_TAKE_SCREENSHOT); + event_command(EVENT_CMD_TAKE_SCREENSHOT); if (cmd->mute_pressed) - rarch_main_command(EVENT_CMD_AUDIO_MUTE_TOGGLE); + event_command(EVENT_CMD_AUDIO_MUTE_TOGGLE); if (cmd->osk_pressed) { @@ -539,9 +539,9 @@ static int do_state_checks(rarch_cmd_state_t *cmd) } if (cmd->volume_up_pressed) - rarch_main_command(EVENT_CMD_VOLUME_UP); + event_command(EVENT_CMD_VOLUME_UP); else if (cmd->volume_down_pressed) - rarch_main_command(EVENT_CMD_VOLUME_DOWN); + event_command(EVENT_CMD_VOLUME_DOWN); #ifdef HAVE_NETPLAY 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); if (cmd->save_state_pressed) - rarch_main_command(EVENT_CMD_SAVE_STATE); + event_command(EVENT_CMD_SAVE_STATE); 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_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); 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) - rarch_main_command(EVENT_CMD_DISK_NEXT); + event_command(EVENT_CMD_DISK_NEXT); else if (cmd->disk_prev_pressed) - rarch_main_command(EVENT_CMD_DISK_PREV); + event_command(EVENT_CMD_DISK_PREV); if (cmd->reset_pressed) - rarch_main_command(EVENT_CMD_RESET); + event_command(EVENT_CMD_RESET); if (global->cheat) { @@ -847,7 +847,7 @@ static int rarch_main_iterate_quit(void) if (global->core_shutdown_initiated && settings->load_dummy_on_core_shutdown) { - if (!rarch_main_command(EVENT_CMD_PREPARE_DUMMY)) + if (!event_command(EVENT_CMD_PREPARE_DUMMY)) return -1; global->core_shutdown_initiated = false; @@ -868,19 +868,19 @@ static void rarch_main_iterate_linefeed_overlay(void) { driver->osk_enable = false; prev_overlay_restore = true; - rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); + event_command(EVENT_CMD_OVERLAY_DEINIT); return; } else if (!driver->osk_enable && driver->keyboard_linefeed_enable) { driver->osk_enable = true; prev_overlay_restore = false; - rarch_main_command(EVENT_CMD_OVERLAY_INIT); + event_command(EVENT_CMD_OVERLAY_INIT); return; } else if (prev_overlay_restore) { - rarch_main_command(EVENT_CMD_OVERLAY_INIT); + event_command(EVENT_CMD_OVERLAY_INIT); prev_overlay_restore = false; } } @@ -952,10 +952,10 @@ void rarch_main_global_free(void) { global_t *global = NULL; - rarch_main_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT); - rarch_main_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); - rarch_main_command(EVENT_CMD_RECORD_DEINIT); - rarch_main_command(EVENT_CMD_LOG_FILE_DEINIT); + event_command(EVENT_CMD_TEMPORARY_CONTENT_DEINIT); + event_command(EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT); + event_command(EVENT_CMD_RECORD_DEINIT); + event_command(EVENT_CMD_LOG_FILE_DEINIT); global = global_get_ptr(); diff --git a/settings.c b/settings.c index 5d8e82f2e3..691b909e62 100644 --- a/settings.c +++ b/settings.c @@ -812,7 +812,7 @@ static void core_list_change_handler(void *data) rarch_setting_t *setting = (rarch_setting_t *)data; (void)setting; - rarch_main_command(EVENT_CMD_LOAD_CORE); + event_command(EVENT_CMD_LOAD_CORE); } #endif @@ -942,8 +942,8 @@ static int setting_bool_action_ok_exit(void *data, unsigned action) if (setting->cmd_trigger.idx != EVENT_CMD_NONE) { - rarch_main_command(setting->cmd_trigger.idx); - rarch_main_command(EVENT_CMD_RESUME); + event_command(setting->cmd_trigger.idx); + event_command(EVENT_CMD_RESUME); } return 0; @@ -995,7 +995,7 @@ static int setting_action_ok_video_refresh_rate_auto( { driver_set_refresh_rate(video_refresh_rate); /* 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) @@ -1054,7 +1054,7 @@ static int setting_action_action_ok(void *data, unsigned action) return -1; if (setting->cmd_trigger.idx != EVENT_CMD_NONE) - rarch_main_command(setting->cmd_trigger.idx); + event_command(setting->cmd_trigger.idx); return 0; } @@ -3140,7 +3140,7 @@ static void general_write_handler(void *data) } if (rarch_cmd || setting->cmd_trigger.triggered) - rarch_main_command(rarch_cmd); + event_command(rarch_cmd); } #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 * 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) @@ -3302,9 +3302,9 @@ static void overlay_enable_toggle_change_handler(void *data) return; if (setting->value.boolean) - rarch_main_command(EVENT_CMD_OVERLAY_INIT); + event_command(EVENT_CMD_OVERLAY_INIT); else - rarch_main_command(EVENT_CMD_OVERLAY_DEINIT); + event_command(EVENT_CMD_OVERLAY_DEINIT); } static bool setting_append_list_main_menu_options(