From 45e0a754915f3d52a253cdd77d3b89500c7d1fc9 Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 27 Jan 2018 15:24:27 -0500 Subject: [PATCH] savefile hack for slot 2, both load from the same SRM file but gb2 doesn't save --- libretro/libretro.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretro/libretro.c b/libretro/libretro.c index 2c53e5a3..e909f110 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -563,7 +563,11 @@ void *retro_get_memory_data(unsigned type) break; case RETRO_MEMORY_SAVE_RAM: if (gb1.cartridge_type->has_battery && gb1.mbc_ram_size != 0) + { data = gb1.mbc_ram; + /* let's copy the save to gb2 so it can save independently */ + memcpy(gb2.mbc_ram, gb1.mbc_ram, gb1.mbc_ram_size); + } else data = NULL; break;