aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorSuuperW <SuuperW@gmail.com>2021-02-22 19:46:02 -0600
committerGitHub <noreply@github.com>2021-02-23 02:46:02 +0100
commit94dcc9523eb1dfac0141d76eb148184b8c911781 (patch)
tree720a744993ced7b38c7decb7401f0b3dae5e8d43 /src/NDSCart.cpp
parent58dd1ec58063707c7944ae8c5b8c2019102de102 (diff)
SRAM things (#970)
* Allow SRAMManager to save to/load from a buffer. * Don't delete what doesn't exist. Don't create a thread that will do absolutely nothing. * Update SRAMManager's SecondaryBuffer when loading a savestate.
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index ae051bd..f08e5da 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -111,6 +111,10 @@ void DoSavestate(Savestate* file)
file->Var8(&StatusReg);
file->Var32(&Addr);
+
+ // SRAMManager might now have an old buffer (or one from the future or alternate timeline!)
+ if (!file->Saving)
+ NDSCart_SRAMManager::RequestFlush();
}
void LoadSave(const char* path, u32 type)
@@ -145,6 +149,7 @@ void LoadSave(const char* path, u32 type)
}
}
+ SRAMFileDirty = false;
NDSCart_SRAMManager::Setup(path, SRAM, SRAMLength);
switch (SRAMLength)