mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-13 13:28:49 +00:00
Refactor CORE_CTL_RETRO_GET_MEMORY
This commit is contained in:
parent
6f0c4e03d5
commit
737fd4268c
@ -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);
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user