Merge branch 'master' of https://github.com/libretro/Genesis-Plus-GX into libretro-master

This commit is contained in:
EkeEke 2017-09-18 17:03:58 +02:00
commit 34eab9369f

View File

@ -2189,13 +2189,10 @@ unsigned retro_get_region(void) { return vdp_pal ? RETRO_REGION_PAL : RETRO_REGI
void *retro_get_memory_data(unsigned id) void *retro_get_memory_data(unsigned id)
{ {
if (!sram.on)
return NULL;
switch (id) switch (id)
{ {
case RETRO_MEMORY_SAVE_RAM: case RETRO_MEMORY_SAVE_RAM:
return sram.sram; return sram.on ? sram.sram : NULL;
case RETRO_MEMORY_SYSTEM_RAM: case RETRO_MEMORY_SYSTEM_RAM:
return work_ram; return work_ram;
default: default:
@ -2207,13 +2204,13 @@ size_t retro_get_memory_size(unsigned id)
{ {
int i; int i;
if (!sram.on)
return 0;
switch (id) switch (id)
{ {
case RETRO_MEMORY_SAVE_RAM: case RETRO_MEMORY_SAVE_RAM:
{ {
if (!sram.on)
return 0;
/* if emulation is not running, we assume the frontend is requesting SRAM size for loading */ /* if emulation is not running, we assume the frontend is requesting SRAM size for loading */
if (!is_running) if (!is_running)
{ {