aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2020-09-11 03:08:06 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-09-11 03:08:06 +0200
commitf2fa52f26ceb1f385d58e57ab26ca7d5349978d2 (patch)
treecd5a01d7ee45b118bad3fcf8de9e9237c368686a /src/NDSCart.cpp
parent00e2ec3faf43b1fa6ad3def0e97828083244a47a (diff)
add functionality to import savefiles
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 6abfc7c..5710213 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -1034,6 +1034,12 @@ void RelocateSave(const char* path, bool write)
NDSCart_SRAM::RelocateSave(path, write);
}
+int ImportSRAM(const u8* data, u32 length)
+{
+ memcpy(NDSCart_SRAM::SRAM, data, std::min(length, NDSCart_SRAM::SRAMLength));
+ return length - NDSCart_SRAM::SRAMLength;
+}
+
void ResetCart()
{
// CHECKME: what if there is a transfer in progress?