Add 'core_is_inited' and 'core_is_symbols_inited'

This commit is contained in:
twinaphex 2016-09-06 03:52:29 +02:00
parent 3e9df72123
commit 6ccf67057b
2 changed files with 21 additions and 0 deletions

4
core.h
View File

@ -191,6 +191,10 @@ void core_uninit_symbols(void);
void core_set_input_state(retro_ctx_input_state_info_t *info);
bool core_is_symbols_inited(void);
bool core_is_inited(void);
bool core_is_game_loaded(void);
RETRO_END_DECLS

View File

@ -42,6 +42,8 @@
#endif
static struct retro_core_t core;
static bool core_inited;
static bool core_symbols_inited;
static bool core_game_loaded;
static unsigned core_poll_type;
static bool core_input_polled;
@ -159,6 +161,8 @@ bool core_deinit(void *data)
cbs->state_cb = NULL;
cbs->poll_cb = NULL;
core_inited = false;
return true;
}
@ -217,6 +221,7 @@ bool core_set_poll_type(unsigned *type)
void core_uninit_symbols(void)
{
uninit_libretro_sym(&core);
core_symbols_inited = false;
}
bool core_init_symbols(enum rarch_core_type *type)
@ -224,6 +229,7 @@ bool core_init_symbols(enum rarch_core_type *type)
if (!type)
return false;
init_libretro_sym(*type, &core);
core_symbols_inited = true;
return true;
}
@ -334,6 +340,7 @@ bool core_reset(void)
bool core_init(void)
{
core.retro_init();
core_inited = true;
return true;
}
@ -428,6 +435,16 @@ void core_unset_input_descriptors(void)
core_has_set_input_descriptors = false;
}
bool core_is_inited(void)
{
return core_inited;
}
bool core_is_symbols_inited(void)
{
return core_symbols_inited;
}
bool core_is_game_loaded(void)
{
return core_game_loaded;