aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2020-10-06 00:48:35 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-10-06 00:49:16 +0200
commitef4215e172d2a83f39cb90a804e3f20d290ad52d (patch)
treea561ea5cc688797473ddf057f535e9cf6a9c203d /src/NDSCart.cpp
parent0d845c9e69e19046f351ce396da8eec150243387 (diff)
flush to file after importing SRAM
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 5710213..077bf48 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -1037,6 +1037,13 @@ void RelocateSave(const char* path, bool write)
int ImportSRAM(const u8* data, u32 length)
{
memcpy(NDSCart_SRAM::SRAM, data, std::min(length, NDSCart_SRAM::SRAMLength));
+ FILE* f = Platform::OpenFile(NDSCart_SRAM::SRAMPath, "wb");
+ if (f)
+ {
+ fwrite(NDSCart_SRAM::SRAM, NDSCart_SRAM::SRAMLength, 1, f);
+ fclose(f);
+ }
+
return length - NDSCart_SRAM::SRAMLength;
}