From 391ad8c95e9b942ff39705f2c3cd5359aef633b3 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Mon, 12 Jun 2023 17:56:09 -0400 Subject: Implement in-memory savestates (#1693) * Refactor Savestate::Var{8,16,32,64} - They now delegate to VarArray - They're declared in the class header so they're likely to be inlined * First crack at refactoring Savestate to work in-memory - Well, third, but who's counting? * Implement Savestate::Finish * Remove the VersionMajor and VersionMinor fields - Instead, pull their values directly from the savestate buffer * Mark a new constructor as explicit * Rename Reset to Rewind * Fix a linebreak * Implement Savestate::Rewind * Add ROMManager::ClearBackupState * Refactor ROMManager to use the refactored Savestate * Capitalize "Least" - It was driving me nuts * Add a log call * Increase default Savestate buffer length to 32MB * Use C-style file I/O instead of C++-style - Dumping bytes to a file with C++'s standard library is a MONSTROUS PAIN IN THE ASS * Quote the savestate's file path for clarity * Write the savestate's length into the header * Add some extra logging calls * Fix section-loading * Remove the deprecated Savestate constructor * Convert a char* to a u32 with memcpy, not a cast * Fix section-handling in loads * Include in Savestate.h - This was causing a build error on Linux --- src/GPU3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/GPU3D.cpp') diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 5c48575..145b689 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -562,7 +562,7 @@ void DoSavestate(Savestate* file) file->Bool32(&poly->IsShadowMask); file->Bool32(&poly->IsShadow); - if (file->IsAtleastVersion(4, 1)) + if (file->IsAtLeastVersion(4, 1)) file->Var32((u32*)&poly->Type); else poly->Type = 0; -- cgit v1.2.3