aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-10-26 20:47:30 +0100
committerArisotura <thetotalworm@gmail.com>2020-10-26 20:47:30 +0100
commitfc922ffb14da3aa087a7eebeb55d09cf3b856e0d (patch)
tree68ad639693d7b97d286e71364ac796bfaaeefd7b /src/NDSCart.cpp
parent8d42b1c7d7466abf80a61ea51ee3006110c15b65 (diff)
parent49a96f41daa53ffa5dc4a46bdac4ee68f0b7eaee (diff)
Merge branch 'master' into dsi_camera
# Conflicts: # src/DSi_I2C.cpp
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 6abfc7c..077bf48 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -1034,6 +1034,19 @@ 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));
+ 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;
+}
+
void ResetCart()
{
// CHECKME: what if there is a transfer in progress?