From 737fd4268ca023e7fdccdadcfb71fd6ded9ee8e8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 28 Jan 2016 02:53:43 +0100 Subject: [PATCH] Refactor CORE_CTL_RETRO_GET_MEMORY --- content.c | 4 ++-- libretro_version_1.c | 6 +++--- libretro_version_1.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content.c b/content.c index 5b8adc59d0..18f98fba61 100644 --- a/content.c +++ b/content.c @@ -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); diff --git a/libretro_version_1.c b/libretro_version_1.c index 56fd1a94a8..98a971d619 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -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: diff --git a/libretro_version_1.h b/libretro_version_1.h index 15825517cd..8482cad005 100644 --- a/libretro_version_1.h +++ b/libretro_version_1.h @@ -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