From 95f5e6aa9685a676ec4a26c3a24bf79ec228217f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 25 Aug 2013 19:42:24 +0200 Subject: [PATCH] Add RETRO_ENVIRONMENT_EXEC_ESCAPE -yes, I need this - when we are in retro_run - we need to escape first before we can get the next libretro core with input data running. This is not needed when we do exec without being in the main program loop. Anyway, one does not work for the other - so we need both. --- dynamic.c | 11 +++++++++-- libretro_private.h | 5 +++++ retroarch.c | 2 -- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dynamic.c b/dynamic.c index 5713e8ecec..2f789ee5d6 100644 --- a/dynamic.c +++ b/dynamic.c @@ -766,7 +766,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_EXEC: - RARCH_LOG("Environ (Private) EXEC.\n"); + case RETRO_ENVIRONMENT_EXEC_ESCAPE: if (data) strlcpy(g_extern.fullpath, (const char*)data, sizeof(g_extern.fullpath)); @@ -780,7 +780,14 @@ bool rarch_environment_cb(unsigned cmd, void *data) #elif defined(HAVE_DYNAMIC) g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME); #endif - g_extern.exec = true; + + if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE) + { + RARCH_LOG("Environ (Private) EXEC_ESCAPE.\n"); + g_extern.exec = true; + } + else + RARCH_LOG("Environ (Private) EXEC.\n"); break; diff --git a/libretro_private.h b/libretro_private.h index c602b39327..a393412911 100644 --- a/libretro_private.h +++ b/libretro_private.h @@ -35,6 +35,11 @@ // const char * -- // Requests that this core is deinitialized, and a new core is loaded. // The libretro core used is set with SET_LIBRETRO_PATH, and path to game is passed in _EXEC. NULL means no game. +#define RETRO_ENVIRONMENT_EXEC_ESCAPE (RETRO_ENVIRONMENT_PRIVATE | 2) + // const char * -- + // Requests that this core is deinitialized, and a new core is loaded. It also escapes the main loop the core is currently + // bound to. + // The libretro core used is set with SET_LIBRETRO_PATH, and path to game is passed in _EXEC. NULL means no game. #endif diff --git a/retroarch.c b/retroarch.c index ce73bb23f8..64544f6a30 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2719,7 +2719,6 @@ static void do_state_checks(void) if (!g_extern.netplay) { #endif -#if !defined(RARCH_PERFORMANCE_MODE) check_pause(); check_oneshot(); @@ -2728,7 +2727,6 @@ static void do_state_checks(void) if (g_extern.is_paused && !g_extern.is_oneshot) return; -#endif check_fast_forward_button();