From a4fa71d4da571b206789805e3a3a5a37bc6ae1f1 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 13 Oct 2017 23:31:22 +0300 Subject: [PATCH] libretro: drop sram clear It's done by the core. If the core is missing something, core itself needs to be fixed. --- pico/pico.c | 5 +++-- platform/libretro/libretro.c | 18 ------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/pico/pico.c b/pico/pico.c index bcd8aa1..bf9df26 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -61,8 +61,9 @@ void PicoExit(void) PicoCartUnload(); z80_exit(); - if (Pico.sv.data) - free(Pico.sv.data); + free(Pico.sv.data); + Pico.sv.data = NULL; + Pico.sv.start = Pico.sv.end = 0; pevt_dump(); } diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 934b685..3502b5e 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -959,22 +959,6 @@ static const char *find_bios(int *region, const char *cd_fname) return NULL; } -static void sram_reset() -{ - SRam.data = NULL; - SRam.start = 0; - SRam.end = 0; - SRam.flags = '\0'; - SRam.unused2 = '\0'; - SRam.changed = '\0' ; - SRam.eeprom_type = '\0'; - SRam.unused3 = '\0'; - SRam.eeprom_bit_cl = '\0'; - SRam.eeprom_bit_in = '\0'; - SRam.eeprom_bit_out = '\0'; - SRam.size = 0; -} - bool retro_load_game(const struct retro_game_info *info) { enum media_type_e media_type; @@ -1031,8 +1015,6 @@ bool retro_load_game(const struct retro_game_info *info) { 0 }, }; - sram_reset(); - enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565; if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) { if (log_cb) -- 2.39.2