Skip to content

Commit

Permalink
Create CORE_CTL_RETRO_GET_SYSTEM_INFO
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jan 27, 2016
1 parent a9e71b1 commit fef5ecd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "configuration.h"
#include "performance.h"
#include "runloop.h"
#include "libretro_version_1.h"

#ifdef HAVE_MENU
#include "menu/menu_driver.h"
Expand Down Expand Up @@ -1858,7 +1859,7 @@ int cheevos_load(const void *data)

/* The the supported extensions as a hint to what method we should use. */

core.retro_get_system_info(&sysinfo);
core_ctl(CORE_CTL_RETRO_GET_SYSTEM_INFO, &sysinfo);

for (i = 0; i < sizeof(finders) / sizeof(finders[0]); i++)
{
Expand Down
9 changes: 9 additions & 0 deletions libretro_version_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "general.h"
#include "msg_hash.h"
#include "rewind.h"
#include "system.h"
#include "gfx/video_driver.h"
#include "audio/audio_driver.h"

Expand Down Expand Up @@ -173,6 +174,14 @@ bool core_ctl(enum core_ctl_state state, void *data)

switch (state)
{
case CORE_CTL_RETRO_GET_SYSTEM_INFO:
{
struct retro_system_info *system = (struct retro_system_info*)data;
if (!system)
return false;
core.retro_get_system_info(system);
}
break;
case CORE_CTL_RETRO_UNSERIALIZE:
{
retro_ctx_serialize_info_t *info = (retro_ctx_serialize_info_t*)data;
Expand Down
4 changes: 3 additions & 1 deletion libretro_version_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ enum core_ctl_state
/**
* Initialize system A/V information.
**/
CORE_CTL_INIT_SYSTEM_AV_INFO
CORE_CTL_INIT_SYSTEM_AV_INFO,

CORE_CTL_RETRO_GET_SYSTEM_INFO
};

typedef struct retro_ctx_serialize_info
Expand Down
2 changes: 1 addition & 1 deletion runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
case RUNLOOP_CTL_SHADER_DIR_INIT:
return shader_dir_init(&runloop_shader_dir);
case RUNLOOP_CTL_SYSTEM_INFO_INIT:
core.retro_get_system_info(&runloop_system.info);
core_ctl(CORE_CTL_RETRO_GET_SYSTEM_INFO, &runloop_system.info);

if (!runloop_system.info.library_name)
runloop_system.info.library_name = msg_hash_to_str(MSG_UNKNOWN);
Expand Down

0 comments on commit fef5ecd

Please sign in to comment.