diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 42f904bc19..680fb677ad 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -7,6 +7,7 @@ #include "../../gfx/video_monitor.h" #include "../../gfx/video_context_driver.h" #include "../../gfx/gl_common.h" +#include "../../runloop.h" //#define HAVE_NSOPENGL @@ -287,7 +288,7 @@ static void apple_gfx_ctx_update_window_title(void *data) [[g_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]]; #endif if (g_settings.fps_show) - msg_queue_push(g_runloop.msg_queue, buf_fps, 1, 1); + rarch_main_msg_queue_push(buf_fps, 1, 1, false); } static bool apple_gfx_ctx_has_focus(void *data) diff --git a/camera/camera_driver.c b/camera/camera_driver.c index 08abf8bc05..409a81f23f 100644 --- a/camera/camera_driver.c +++ b/camera/camera_driver.c @@ -152,8 +152,8 @@ bool driver_camera_start(void) if (g_settings.camera.allow) return driver.camera->start(driver.camera_data); - msg_queue_push(g_runloop.msg_queue, - "Camera is explicitly disabled.\n", 1, 180); + rarch_main_msg_queue_push( + "Camera is explicitly disabled.\n", 1, 180, false); } return false; } diff --git a/menu/menu.c b/menu/menu.c index 8245735090..4dafcf8835 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -150,7 +150,7 @@ bool menu_load_content(void) fill_pathname_base(name, g_extern.fullpath, sizeof(name)); snprintf(msg, sizeof(msg), "Failed to load %s.\n", name); - msg_queue_push(g_runloop.msg_queue, msg, 1, 90); + rarch_main_msg_queue_push(msg, 1, 90, false); if (driver.menu) driver.menu->msg_force = true; diff --git a/menu/menu_entries_cbs_ok.c b/menu/menu_entries_cbs_ok.c index 522e4fc607..c92067ab5c 100644 --- a/menu/menu_entries_cbs_ok.c +++ b/menu/menu_entries_cbs_ok.c @@ -898,8 +898,7 @@ static int action_ok_core_updater_download(const char *path, strlcpy(core_updater_path, path, sizeof(core_updater_path)); snprintf(msg, sizeof(msg), "Starting download: %s.", path); - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 1, 90); + rarch_main_msg_queue_push(msg, 1, 90, true); msg_queue_clear(g_data_runloop.http.msg_queue); msg_queue_push_string_list(g_data_runloop.http.msg_queue, core_path, "cb_core_updater_download", 0, 1); diff --git a/retroarch.c b/retroarch.c index 420ee98e48..d06e03a81f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -943,7 +943,7 @@ static void init_movie(void) } g_extern.bsv.movie_playback = true; - msg_queue_push(g_runloop.msg_queue, "Starting movie playback.", 2, 180); + rarch_main_msg_queue_push("Starting movie playback.", 2, 180, false); RARCH_LOG("Starting movie playback.\n"); g_settings.rewind_granularity = 1; } @@ -953,17 +953,15 @@ static void init_movie(void) snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".", g_extern.bsv.movie_start_path); - msg_queue_clear(g_runloop.msg_queue); - if (!(g_extern.bsv.movie = bsv_movie_init(g_extern.bsv.movie_start_path, RARCH_MOVIE_RECORD))) { - msg_queue_push(g_runloop.msg_queue, "Failed to start movie record.", 1, 180); + rarch_main_msg_queue_push("Failed to start movie record.", 1, 180, true); RARCH_ERR("Failed to start movie record.\n"); return; } - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); + rarch_main_msg_queue_push(msg, 1, 180, true); RARCH_LOG("Starting movie record to \"%s\".\n", g_extern.bsv.movie_start_path); g_settings.rewind_granularity = 1; @@ -1018,10 +1016,9 @@ static bool init_netplay(void) g_extern.netplay_is_client = false; RARCH_WARN(RETRO_LOG_INIT_NETPLAY_FAILED); - if (g_runloop.msg_queue) - msg_queue_push(g_runloop.msg_queue, - RETRO_MSG_INIT_NETPLAY_FAILED, - 0, 180); + rarch_main_msg_queue_push( + RETRO_MSG_INIT_NETPLAY_FAILED, + 0, 180, false); return false; } #endif @@ -1272,7 +1269,7 @@ static void load_auto_state(void) snprintf(msg, sizeof(msg), "Auto-loading savestate from \"%s\" %s.", savestate_name_auto, ret ? "succeeded" : "failed"); - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); + rarch_main_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); } @@ -1371,8 +1368,7 @@ static void main_state(unsigned cmd) else strlcpy(msg, "Core does not support save states.", sizeof(msg)); - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 2, 180); + rarch_main_msg_queue_push(msg, 2, 180, true); RARCH_LOG("%s\n", msg); } @@ -1402,8 +1398,7 @@ void rarch_disk_control_append_image(const char *path) snprintf(msg, sizeof(msg), "Appended disk: %s", path); RARCH_LOG("%s\n", msg); - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 0, 180); + rarch_main_msg_queue_push(msg, 0, 180, true); rarch_main_command(RARCH_CMD_AUTOSAVE_DEINIT); @@ -1463,10 +1458,7 @@ void rarch_disk_control_set_eject(bool new_state, bool print_log) /* Only noise in menu. */ if (print_log) - { - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); - } + rarch_main_msg_queue_push(msg, 1, 180, true); } } @@ -1515,8 +1507,7 @@ void rarch_disk_control_set_index(unsigned idx) RARCH_ERR("%s\n", msg); else RARCH_LOG("%s\n", msg); - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); + rarch_main_msg_queue_push(msg, 1, 180, true); } } @@ -2070,8 +2061,7 @@ static bool save_core_config(void) else { const char *message = "Config directory not set. Cannot save new config."; - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, message, 1, 180); + rarch_main_msg_queue_push(message, 1, 180, true); RARCH_ERR("%s\n", message); return false; } @@ -2133,8 +2123,7 @@ static bool save_core_config(void) RARCH_ERR("%s\n", msg); } - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); + rarch_main_msg_queue_push(msg, 1, 180, true); return ret; } @@ -2249,8 +2238,7 @@ bool rarch_main_command(unsigned cmd) break; case RARCH_CMD_RESET: RARCH_LOG(RETRO_LOG_RESETTING_CONTENT); - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, "Reset.", 1, 120); + rarch_main_msg_queue_push("Reset.", 1, 120, true); pretro_reset(); /* bSNES since v073r01 resets controllers to JOYPAD @@ -2379,8 +2367,7 @@ bool rarch_main_command(unsigned cmd) return false; } - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, msg, 1, 180); + rarch_main_msg_queue_push(msg, 1, 180, true); RARCH_LOG("%s\n", msg); } break; @@ -2753,10 +2740,7 @@ bool rarch_main_command(unsigned cmd) check_disk_eject(control); } else - { - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); - } + rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true); break; case RARCH_CMD_DISK_NEXT: if (g_extern.system.disk_control.get_num_images) @@ -2774,10 +2758,7 @@ bool rarch_main_command(unsigned cmd) check_disk_next(control); } else - { - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); - } + rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true); break; case RARCH_CMD_DISK_PREV: if (g_extern.system.disk_control.get_num_images) @@ -2795,10 +2776,7 @@ bool rarch_main_command(unsigned cmd) check_disk_prev(control); } else - { - msg_queue_clear(g_runloop.msg_queue); - msg_queue_push(g_runloop.msg_queue, "Core does not support Disk Options.", 1, 120); - } + rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true); break; case RARCH_CMD_RUMBLE_STOP: for (i = 0; i < MAX_USERS; i++) diff --git a/runloop.c b/runloop.c index 7e49cb7d79..3909fa12f5 100644 --- a/runloop.c +++ b/runloop.c @@ -233,14 +233,13 @@ static void check_rewind(bool pressed) { const void *buf = NULL; - msg_queue_clear(g_runloop.msg_queue); if (state_manager_pop(g_extern.rewind.state, &buf)) { g_extern.rewind.frame_is_reverse = true; setup_rewind_audio(); rarch_main_msg_queue_push(RETRO_MSG_REWINDING, 0, - g_runloop.is_paused ? 1 : 30, false); + g_runloop.is_paused ? 1 : 30, true); pretro_unserialize(buf, g_extern.rewind.size); if (g_extern.bsv.movie) @@ -248,7 +247,7 @@ static void check_rewind(bool pressed) } else rarch_main_msg_queue_push(RETRO_MSG_REWIND_REACHED_END, - 0, 30, false); + 0, 30, true); } else { diff --git a/xdk/screenshot_xdk1.c b/xdk/screenshot_xdk1.c index e9cf275009..440009a31a 100644 --- a/xdk/screenshot_xdk1.c +++ b/xdk/screenshot_xdk1.c @@ -17,6 +17,7 @@ #include #include #include "../screenshot.h" +#include "../runloop.h" bool screenshot_dump(const char *folder, const void *frame, unsigned width, unsigned height, int pitch, bool bgr24) @@ -44,7 +45,7 @@ bool screenshot_dump(const char *folder, const void *frame, if(ret == S_OK) { RARCH_LOG("Screenshot saved: %s.\n", filename); - msg_queue_push(g_runloop.msg_queue, "Screenshot saved.", 1, 30); + rarch_main_msg_queue_push("Screenshot saved.", 1, 30, false); return true; }