1
0
mirror of https://github.com/libretro/RetroArch synced 2025-04-02 16:20:39 +00:00

Add some more private libretro environs

This commit is contained in:
twinaphex 2015-12-07 14:24:28 +01:00
parent cd8f34e0f8
commit f4fc179cae
2 changed files with 16 additions and 6 deletions

@ -67,7 +67,6 @@ static dylib_t lib_handle;
#endif #endif
struct retro_core_t core; struct retro_core_t core;
static bool ignore_environment_cb;
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
static bool *load_no_content_hook; static bool *load_no_content_hook;
@ -115,9 +114,9 @@ void libretro_get_environment_info(void (*func)(retro_environment_t),
/* It's possible that we just set get_system_info callback to the currently running core. /* It's possible that we just set get_system_info callback to the currently running core.
* Make sure we reset it to the actual environment callback. * Make sure we reset it to the actual environment callback.
* Ignore any environment callbacks here in case we're running on the non-current core. */ * Ignore any environment callbacks here in case we're running on the non-current core. */
ignore_environment_cb = true; rarch_environment_cb(RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB, NULL);
func(rarch_environment_cb); func(rarch_environment_cb);
ignore_environment_cb = false; rarch_environment_cb(RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB, NULL);
} }
static dylib_t libretro_get_system_info_lib(const char *path, static dylib_t libretro_get_system_info_lib(const char *path,
@ -604,9 +603,10 @@ static void rarch_log_libretro(enum retro_log_level level,
bool rarch_environment_cb(unsigned cmd, void *data) bool rarch_environment_cb(unsigned cmd, void *data)
{ {
unsigned p; unsigned p;
settings_t *settings = config_get_ptr(); static bool ignore_environment_cb = false;
global_t *global = global_get_ptr(); settings_t *settings = config_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr(); global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (ignore_environment_cb) if (ignore_environment_cb)
return false; return false;
@ -1232,6 +1232,12 @@ bool rarch_environment_cb(unsigned cmd, void *data)
RARCH_LOG("Environ (Private) EXEC.\n"); RARCH_LOG("Environ (Private) EXEC.\n");
} }
break; break;
case RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB:
ignore_environment_cb = true;
break;
case RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB:
ignore_environment_cb = false;
break;
default: default:
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);

@ -60,6 +60,10 @@
* _EXEC. NULL means no game. * _EXEC. NULL means no game.
*/ */
#define RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB (RETRO_ENVIRONMENT_PRIVATE | 3)
#define RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB (RETRO_ENVIRONMENT_PRIVATE | 4)
#endif #endif