mirror of
https://github.com/libretro/snes9x.git
synced 2024-12-02 14:26:38 +00:00
Set SRAM initialization to set whole buffer, not just a few bytes.
Add a TODO comment at allocation. These never change, so they should ideally be static.
This commit is contained in:
parent
da23559f2f
commit
41fb9eb4c4
@ -893,6 +893,8 @@ static void S9xDeinterleaveGD24 (int size, uint8 *base)
|
||||
|
||||
bool8 CMemory::Init (void)
|
||||
{
|
||||
// TODO:If these change size, check other locations in the code that also
|
||||
// have the fixed size. In the future, make this a static allocation.
|
||||
RAM = (uint8 *) malloc(0x20000);
|
||||
SRAM = (uint8 *) malloc(0x80000);
|
||||
VRAM = (uint8 *) malloc(0x10000);
|
||||
@ -1915,8 +1917,8 @@ void CMemory::ClearSRAM (bool8 onlyNonSavedSRAM)
|
||||
if (onlyNonSavedSRAM)
|
||||
if (!(Settings.SuperFX && ROMType < 0x15) && !(Settings.SA1 && ROMType == 0x34)) // can have SRAM
|
||||
return;
|
||||
|
||||
memset(SRAM, SNESGameFixes.SRAMInitialValue, sizeof(SRAM));
|
||||
// TODO: If SRAM size changes change this value as well
|
||||
memset(SRAM, SNESGameFixes.SRAMInitialValue, 0x80000);
|
||||
}
|
||||
|
||||
bool8 CMemory::LoadSRAM (const char *filename)
|
||||
|
Loading…
Reference in New Issue
Block a user