aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authortwinaphex2016-08-06 00:51:48 +0200
committertwinaphex2016-08-06 00:51:48 +0200
commitfb2302917d24904e8a65adf9b6f7fb9b95ce8cd8 (patch)
tree5aea0dfefd8554946ca9b5c14a4a0ae9923cb9fc /source
parent782210614519c2368a240b5668b24b8f3874c12c (diff)
downloadsnesemu-fb2302917d24904e8a65adf9b6f7fb9b95ce8cd8.tar.gz
snesemu-fb2302917d24904e8a65adf9b6f7fb9b95ce8cd8.tar.bz2
snesemu-fb2302917d24904e8a65adf9b6f7fb9b95ce8cd8.zip
Remove unused LoadSRAM
Diffstat (limited to 'source')
-rw-r--r--source/memmap.c45
-rw-r--r--source/memmap.h1
2 files changed, 0 insertions, 46 deletions
diff --git a/source/memmap.c b/source/memmap.c
index 6c013ea..a8ba4e2 100644
--- a/source/memmap.c
+++ b/source/memmap.c
@@ -1490,51 +1490,6 @@ void InitROM(bool Interleaved)
Settings.ForceInterleaved2 = false;
}
-bool LoadSRAM(const char* filename)
-{
- int size = Memory.SRAMSize ?
- (1 << (Memory.SRAMSize + 3)) * 128 : 0;
-
- memset(Memory.SRAM, SNESGameFixes.SRAMInitialValue, 0x20000);
-
- if (size > 0x20000)
- size = 0x20000;
-
- if (size)
- {
- FILE* file;
- if ((file = fopen(filename, "rb")))
- {
- int len = fread((unsigned char*) Memory.SRAM, 1, 0x20000, file);
- fclose(file);
- if (len - size == 512)
- {
- // S-RAM file has a header - remove it
- // memmove required: Overlapping addresses [Neb]
- memmove(Memory.SRAM, Memory.SRAM + 512, size);
- }
- if (len == size + SRTC_SRAM_PAD)
- {
- S9xSRTCPostLoadState();
- S9xResetSRTC();
- rtc.index = -1;
- rtc.mode = MODE_READ;
- }
- else
- S9xHardResetSRTC();
-
- if (Settings.SPC7110RTC)
- S9xLoadSPC7110RTC(&rtc_f9);
-
- return (true);
- }
- S9xHardResetSRTC();
- return (false);
- }
-
- return (true);
-}
-
void FixROMSpeed()
{
int c;
diff --git a/source/memmap.h b/source/memmap.h
index 3be1cd3..9000641 100644
--- a/source/memmap.h
+++ b/source/memmap.h
@@ -144,7 +144,6 @@ bool LoadROM(const char*);
uint32_t FileLoader(uint8_t* buffer, const char* filename, int32_t maxsize);
#endif
void InitROM(bool);
-bool LoadSRAM(const char*);
bool S9xInitMemory();
void S9xDeinitMemory();
void FreeSDD1Data();