diff options
| author | SuuperW <SuuperW@gmail.com> | 2021-02-22 19:46:02 -0600 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-23 02:46:02 +0100 | 
| commit | 94dcc9523eb1dfac0141d76eb148184b8c911781 (patch) | |
| tree | 720a744993ced7b38c7decb7401f0b3dae5e8d43 /src/NDSCart.cpp | |
| parent | 58dd1ec58063707c7944ae8c5b8c2019102de102 (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.cpp | 5 | 
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) |