From 782210614519c2368a240b5668b24b8f3874c12c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 6 Aug 2016 00:49:32 +0200 Subject: Reimplement save RAM - do it the libretro way by implementing retro_get_memory_data and friends --- source/memmap.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'source/memmap.c') diff --git a/source/memmap.c b/source/memmap.c index 01d0707..6c013ea 100644 --- a/source/memmap.c +++ b/source/memmap.c @@ -1535,41 +1535,6 @@ bool LoadSRAM(const char* filename) return (true); } -bool SaveSRAM(const char* filename) -{ - if (Settings.SuperFX && Memory.ROMType < 0x15) - return true; - if (Settings.SA1 && Memory.ROMType == 0x34) - return true; - - int size = Memory.SRAMSize ? - (1 << (Memory.SRAMSize + 3)) * 128 : 0; - if (Settings.SRTC) - { - size += SRTC_SRAM_PAD; - S9xSRTCPreSaveState(); - } - - if (size > 0x20000) - size = 0x20000; - - if (size && *Memory.ROMFilename) - { - - FILE* file = fopen(filename, "w"); - if (file) - { - fwrite((unsigned char*) Memory.SRAM, size, 1, file); - fclose(file); - if (Settings.SPC7110RTC) - S9xSaveSPC7110RTC(&rtc_f9); - - return (true); - } - } - return (false); -} - void FixROMSpeed() { int c; -- cgit v1.2.3