aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index fa235a4..0765288 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -27,7 +27,7 @@
#include "Config.h"
#include "ROMList.h"
#include "melonDLDI.h"
-
+#include "NDSCart_SRAMManager.h"
namespace NDSCart_SRAM
{
@@ -145,6 +145,8 @@ void LoadSave(const char* path, u32 type)
}
}
+ NDSCart_SRAMManager::Setup(path, SRAM, SRAMLength);
+
switch (SRAMLength)
{
case 512: WriteFunc = Write_EEPROMTiny; break;
@@ -450,17 +452,10 @@ void Write(u8 val, u32 hold)
void FlushSRAMFile()
{
- if (!SRAMFileDirty)
- return;
+ if (!SRAMFileDirty) return;
SRAMFileDirty = false;
-
- FILE* f = Platform::OpenFile(SRAMPath, "wb");
- if (f)
- {
- fwrite(SRAM, SRAMLength, 1, f);
- fclose(f);
- }
+ NDSCart_SRAMManager::RequestFlush();
}
}