X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flibretro%2Flibretro.c;h=9588bc8845c6e3850e71913a99437368062fae1b;hb=2d4f989df99867149b8fe9a7f2d9a11799f469af;hp=46363618d8ad7f15f66e4e71a38163021077d8f8;hpb=6c991e7ced6e893064dafbe7bd64b98c978f6195;p=picodrive.git diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 4636361..9588bc8 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. @@ -537,7 +539,10 @@ void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "PicoDrive"; - info->library_version = VERSION; +#ifndef GIT_VERSION +#define GIT_VERSION "" +#endif + info->library_version = VERSION GIT_VERSION; info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|sms"; info->need_fullpath = true; } @@ -877,6 +882,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 +954,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)