notaz.gp2x.de
/
picodrive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c991e7
)
Fixed crash on loading sram game after a game with no sram
author
lentillog
<lentillog@gmail.com>
Wed, 5 Oct 2016 01:02:52 +0000
(18:02 -0700)
committer
lentillog
<lentillog@gmail.com>
Wed, 5 Oct 2016 01:02:52 +0000
(18:02 -0700)
platform/libretro/libretro.c
patch
|
blob
|
blame
|
history
diff --git
a/platform/libretro/libretro.c
b/platform/libretro/libretro.c
index
4636361
..
5f326da
100644
(file)
--- a/
platform/libretro/libretro.c
+++ b/
platform/libretro/libretro.c
@@
-877,6
+877,22
@@
static const char *find_bios(int *region, const char *cd_fname)
return NULL;
}
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;
bool retro_load_game(const struct retro_game_info *info)
{
enum media_type_e media_type;
@@
-933,6
+949,8
@@
bool retro_load_game(const struct retro_game_info *info)
{ 0 },
};
{ 0 },
};
+ sram_reset();
+
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
if (log_cb)
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
if (log_cb)