Add RARCH_ACTION_STATE_VERIFY_API_VERSION

This commit is contained in:
twinaphex 2015-09-27 02:06:58 +02:00
parent 2364ae6b17
commit 342635d562
3 changed files with 16 additions and 31 deletions

View File

@ -748,7 +748,7 @@ static bool event_init_core(void)
if((settings->sort_savestates_enable || settings->sort_savefiles_enable) && !global->inited.core.no_content)
set_paths_redirect(global->name.base);
rarch_verify_api_version();
rarch_ctl(RARCH_ACTION_STATE_VERIFY_API_VERSION, NULL);
pretro_init();
global->sram.use = (global->inited.core.type == CORE_TYPE_PLAIN) &&

View File

@ -1104,24 +1104,6 @@ void rarch_main_free(void)
config_free();
}
/*
* rarch_verify_api_version:
*
* Compare libretro core API version against API version
* used by the program.
*
* TODO - when libretro v2 gets added, allow for switching
* between libretro version backend dynamically.
**/
void rarch_verify_api_version(void)
{
RARCH_LOG("Version of libretro API: %u\n", pretro_api_version());
RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION);
if (pretro_api_version() != RETRO_API_VERSION)
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
}
#define FAIL_CPU(simd_type) do { \
RARCH_ERR(simd_type " code is compiled in, but CPU does not support this feature. Cannot continue.\n"); \
rarch_fail(1, "validate_cpu_features()"); \
@ -1451,6 +1433,13 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
case RARCH_ACTION_STATE_FORCE_QUIT:
rarch_ctl(RARCH_ACTION_STATE_QUIT, NULL);
break;
case RARCH_ACTION_STATE_VERIFY_API_VERSION:
RARCH_LOG("Version of libretro API: %u\n", pretro_api_version());
RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION);
if (pretro_api_version() != RETRO_API_VERSION)
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
break;
case RARCH_ACTION_STATE_NONE:
default:
return false;

View File

@ -68,7 +68,14 @@ enum rarch_ctl_state
* properly. */
RARCH_ACTION_STATE_REPLACE_CONFIG,
RARCH_ACTION_STATE_QUIT,
RARCH_ACTION_STATE_FORCE_QUIT
RARCH_ACTION_STATE_FORCE_QUIT,
/* Compare libretro core API version against API version
* used by RetroArch.
*
* TODO - when libretro v2 gets added, allow for switching
* between libretro version backend dynamically.
*/
RARCH_ACTION_STATE_VERIFY_API_VERSION
};
enum rarch_content_type
@ -189,17 +196,6 @@ int rarch_defer_core(core_info_list_t *data,
void rarch_fill_pathnames(void);
/*
* rarch_verify_api_version:
*
* Compare libretro core API version against API version
* used by RetroArch.
*
* TODO - when libretro v2 gets added, allow for switching
* between libretro version backend dynamically.
**/
void rarch_verify_api_version(void);
/**
* rarch_init_system_av_info:
*