[Core/MD] fixed SRAM initialization for Sonic 1 Remastered hack

This commit is contained in:
EkeEke 2016-10-15 14:05:02 +02:00
parent 3332611572
commit e7e19c78dd
2 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* Genesis Plus
* Backup RAM support
*
* Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
*
* Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met:
@ -68,7 +68,17 @@ void sram_init()
sram.sram = cart.rom + 0x800000;
/* initialize Backup RAM */
if (strstr(rominfo.international,"Sonic 1 Remastered"))
{
/* Sonic 1 Remastered hack crashes if backup RAM is not initialized to zero */
memset(sram.sram, 0x00, 0x10000);
}
else
{
/* by default, assume backup RAM is initialized to 0xFF (Micro Machines 2, Dino Dini Soccer) */
memset(sram.sram, 0xFF, 0x10000);
}
sram.crc = crc32(0, sram.sram, 0x10000);
/* retrieve informations from header */

View File

@ -2,7 +2,7 @@
* Genesis Plus
* Backup RAM support
*
* Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
*
* Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: