diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 53fd788aa6..933384db0f 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2386,3 +2386,9 @@ void video_driver_get_window_title(char *buf, unsigned len) video_driver_window_title_update = false; } } + +void video_driver_get_status(uint64_t *frame_count, bool * is_alive) +{ + *frame_count = video_driver_get_frame_count(); + *is_alive = video_driver_is_alive(); +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 505d733ffa..19ee8cf427 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -558,6 +558,8 @@ void video_driver_reinit(void); void video_driver_get_window_title(char *buf, unsigned len); +void video_driver_get_status(uint64_t *frame_count, bool * is_alive); + extern video_driver_t video_gl; extern video_driver_t video_vulkan; extern video_driver_t video_psp1; diff --git a/runloop.c b/runloop.c index cc41b16329..6a9567aa3f 100644 --- a/runloop.c +++ b/runloop.c @@ -678,7 +678,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) * d) Video driver no longer alive. * e) End of BSV movie and BSV EOF exit is true. (TODO/FIXME - explain better) */ -#define time_to_exit(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !video_driver_is_alive() || bsv_movie_ctl(BSV_MOVIE_CTL_END_EOF, NULL) || (runloop_max_frames && (video_driver_get_frame_count() >= runloop_max_frames)) || runloop_exec) +#define time_to_exit(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !is_alive || bsv_movie_ctl(BSV_MOVIE_CTL_END_EOF, NULL) || (runloop_max_frames && (frame_count >= runloop_max_frames)) || runloop_exec) #define runloop_check_cheevos() (settings->cheevos.enable && cheevos_loaded && (!cheats_are_enabled && !cheats_were_enabled)) @@ -697,9 +697,13 @@ static enum runloop_state runloop_check_state( #ifdef HAVE_NETWORKING bool tmp = false; #endif + bool is_alive = false; + uint64_t frame_count = 0; bool focused = true; bool pause_pressed = runloop_cmd_triggered(trigger_input, RARCH_PAUSE_TOGGLE); + video_driver_get_status(&frame_count, &is_alive); + if (runloop_cmd_triggered(trigger_input, RARCH_OVERLAY_NEXT)) command_event(CMD_EVENT_OVERLAY_NEXT, NULL);