diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-11-15 03:42:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-15 03:42:26 +0100 |
| commit | 09c0321997fe4a5c418d24f248b58782de2b30bd (patch) | |
| tree | b2dfe02514702c454e77252f4ec0d41971b12aa9 /Source/Core/Common/ChunkFile.h | |
| parent | b6503d7585ef10ea0790335ad59a03f35ed2d001 (diff) | |
| parent | ed54e1905a92b4e84a1fed67d2ef4ac2a01eec03 (diff) | |
Merge pull request #11184 from Lobsterzelda/save-all-nand-files-to-save-state
HostFileSystem: Set all NAND folders to be saved in save states
Diffstat (limited to 'Source/Core/Common/ChunkFile.h')
| -rw-r--r-- | Source/Core/Common/ChunkFile.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index e6bc09322e..ef9be1b7ce 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -229,6 +229,22 @@ public: return current; } + // The reserved u32 is set to 0, and a pointer to it is returned. + // The caller needs to fill in the reserved u32 with the appropriate value later on, if they + // want a non-zero value there. + [[nodiscard]] u8* ReserveU32() + { + u32 temp = 0; + u8* previous_pointer = *m_ptr_current; + Do(temp); + return previous_pointer; + } + + u32 GetOffsetFromPreviousPosition(u8* previous_pointer) + { + return static_cast<u32>((*m_ptr_current) - previous_pointer); + } + void Do(Common::Flag& flag) { bool s = flag.IsSet(); |
