Skip to content

Commit

Permalink
Create CORE_INFO_CTL_LOAD
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Feb 7, 2016
1 parent e566665 commit d3b9356
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
14 changes: 3 additions & 11 deletions command_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)

if (menu_driver_ctl(RARCH_MENU_CTL_LOAD_NO_CONTENT_GET, &ptr))
{
core_info_list_t *core_info_list = NULL;
core_info_t *core_info = NULL;
core_info_ctx_find_t info_find;

#if defined(HAVE_DYNAMIC)
if (!(*settings->libretro))
Expand All @@ -999,16 +998,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
libretro_get_system_info(settings->libretro, system,
ptr);
#endif
core_info_ctl(CORE_INFO_CTL_LIST_GET, &core_info_list);
info_find.path = settings->libretro;

if (!core_info_list)
return false;

/* Load core info file */
core_info_ctl(CORE_INFO_CTL_CURRENT_CORE_GET, &core_info);

if (!core_info_list_get_info(core_info_list,
core_info, settings->libretro))
if (!core_info_ctl(CORE_INFO_CTL_LOAD, &info_find))
return false;
}
#endif
Expand Down
18 changes: 18 additions & 0 deletions core_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,24 @@ bool core_info_ctl(enum core_info_state state, void *data)
return false;
}
break;
case CORE_INFO_CTL_LOAD:
{
core_info_t *core_info = NULL;
core_info_ctx_find_t *info = (core_info_ctx_find_t*)data;

if (!info)
return false;

core_info_ctl(CORE_INFO_CTL_CURRENT_CORE_GET, &core_info);

if (!core_info_curr_list)
return false;

if (!core_info_list_get_info(core_info_curr_list,
core_info, info->path))
return false;
}
break;
case CORE_INFO_CTL_NONE:
default:
break;
Expand Down
1 change: 1 addition & 0 deletions core_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum core_info_state
CORE_INFO_CTL_CURRENT_CORE_FREE,
CORE_INFO_CTL_CURRENT_CORE_INIT,
CORE_INFO_CTL_CURRENT_CORE_GET,
CORE_INFO_CTL_LOAD,
CORE_INFO_CTL_FIND
};

Expand Down

0 comments on commit d3b9356

Please sign in to comment.