X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flibretro%2Flibretro.c;h=061f830d3f9ec01899f4451b26dcfa6c195216cf;hb=0d87bd6a48493afbaeefa67cb229a16cb6d60b25;hp=46363618d8ad7f15f66e4e71a38163021077d8f8;hpb=6c991e7ced6e893064dafbe7bd64b98c978f6195;p=picodrive.git diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 4636361..061f830 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -1,6 +1,8 @@ /* * libretro core glue for PicoDrive * (C) notaz, 2013 + * (C) aliaspider, 2016 + * (C) Daniel De Matteis, 2013 * * This work is licensed under the terms of MAME license. * See COPYING file in the top-level directory. @@ -877,6 +879,22 @@ 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; @@ -933,6 +951,8 @@ 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)