Skip to content

Commit

Permalink
Create CORE_CTL_RETRO_SYMBOLS_INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jan 28, 2016
1 parent eb503e0 commit 7f81d7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions command_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ static void event_deinit_core(bool reinit)
config_unload_override();
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
}

uninit_libretro_sym(&core);
}

static void event_init_cheats(void)
Expand Down Expand Up @@ -573,12 +571,10 @@ static bool event_init_core(void *data)
{
retro_ctx_environ_info_t info;
settings_t *settings = config_get_ptr();
enum rarch_core_type *core_type = (enum rarch_core_type*)data;

if (!core_type)
if (!core_ctl(CORE_CTL_RETRO_SYMBOLS_INIT, data))
return false;

init_libretro_sym(*core_type, &core);
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_INIT, NULL);

/* auto overrides: apply overrides */
Expand Down
10 changes: 10 additions & 0 deletions libretro_version_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ bool core_ctl(enum core_ctl_state state, void *data)

switch (state)
{
case CORE_CTL_RETRO_SYMBOLS_INIT:
{
enum rarch_core_type *core_type = (enum rarch_core_type*)data;

if (!core_type)
return false;
init_libretro_sym(*core_type, &core);
}
break;
case CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE:
{
retro_ctx_controller_info_t *pad = (retro_ctx_controller_info_t*)data;
Expand Down Expand Up @@ -278,6 +287,7 @@ bool core_ctl(enum core_ctl_state state, void *data)
video_driver_callback_destroy_context();
video_driver_unset_callback();
core.retro_deinit();
uninit_libretro_sym(&core);
break;
case CORE_CTL_RETRO_UNLOAD_GAME:
core.retro_unload_game();
Expand Down
2 changes: 2 additions & 0 deletions libretro_version_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ enum core_ctl_state

CORE_CTL_RETRO_UNSERIALIZE,

CORE_CTL_RETRO_SYMBOLS_INIT,

/* Compare libretro core API version against API version
* used by RetroArch.
*
Expand Down

0 comments on commit 7f81d7a

Please sign in to comment.