Refactor CORE_CTL_RETRO_GET_MEMORY

This commit is contained in:
twinaphex 2016-01-28 02:53:43 +01:00
parent 6f0c4e03d5
commit 737fd4268c
3 changed files with 6 additions and 6 deletions

View File

@ -313,7 +313,7 @@ static bool load_ram_file(ram_type_t *ram)
retro_ctx_memory_info_t mem_info;
void *buf = NULL;
mem_info.ram = ram;
mem_info.id = ram->type;
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);
@ -356,7 +356,7 @@ static bool save_ram_file(ram_type_t *ram)
{
retro_ctx_memory_info_t mem_info;
mem_info.ram = ram;
mem_info.id = ram->type;
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);

View File

@ -185,10 +185,10 @@ bool core_ctl(enum core_ctl_state state, void *data)
case CORE_CTL_RETRO_GET_MEMORY:
{
retro_ctx_memory_info_t *info = (retro_ctx_memory_info_t*)data;
if (!info || !info->ram)
if (!info)
return false;
info->size = core.retro_get_memory_size(info->ram->type);
info->data = core.retro_get_memory_data(info->ram->type);
info->size = core.retro_get_memory_size(info->id);
info->data = core.retro_get_memory_data(info->id);
}
break;
case CORE_CTL_RETRO_LOAD_GAME:

View File

@ -107,7 +107,7 @@ typedef struct retro_ctx_memory_info
{
void *data;
size_t size;
ram_type_t *ram;
unsigned id;
} retro_ctx_memory_info_t;
typedef struct retro_ctx_load_content_info