diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-07-30 21:29:39 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-07-30 21:29:39 +0200 |
commit | 45fd67c1093e0aa252228e250a66488029396764 (patch) | |
tree | 8cf3244deec6a10ee1eb70a6516c2fc274aab423 /src/core/file_sys/savedata_factory.h | |
parent | Merge pull request #4392 from lioncash/guard (diff) | |
download | yuzu-45fd67c1093e0aa252228e250a66488029396764.tar yuzu-45fd67c1093e0aa252228e250a66488029396764.tar.gz yuzu-45fd67c1093e0aa252228e250a66488029396764.tar.bz2 yuzu-45fd67c1093e0aa252228e250a66488029396764.tar.lz yuzu-45fd67c1093e0aa252228e250a66488029396764.tar.xz yuzu-45fd67c1093e0aa252228e250a66488029396764.tar.zst yuzu-45fd67c1093e0aa252228e250a66488029396764.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/savedata_factory.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 991e57aa1..6625bbbd8 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -21,6 +21,7 @@ enum class SaveDataSpaceId : u8 { TemporaryStorage = 3, SdCardUser = 4, ProperSystem = 100, + SafeMode = 101, }; enum class SaveDataType : u8 { @@ -30,28 +31,50 @@ enum class SaveDataType : u8 { DeviceSaveData = 3, TemporaryStorage = 4, CacheStorage = 5, + SystemBcat = 6, }; enum class SaveDataRank : u8 { - Primary, - Secondary, + Primary = 0, + Secondary = 1, }; -struct SaveDataDescriptor { - u64_le title_id; +enum class SaveDataFlags : u32 { + None = (0 << 0), + KeepAfterResettingSystemSaveData = (1 << 0), + KeepAfterRefurbishment = (1 << 1), + KeepAfterResettingSystemSaveDataWithoutUserSaveData = (1 << 2), + NeedsSecureDelete = (1 << 3), +}; + +struct SaveDataAttribute { + u64 title_id; u128 user_id; - u64_le save_id; + u64 save_id; SaveDataType type; SaveDataRank rank; - u16_le index; + u16 index; INSERT_PADDING_BYTES(4); - u64_le zero_1; - u64_le zero_2; - u64_le zero_3; + u64 zero_1; + u64 zero_2; + u64 zero_3; std::string DebugInfo() const; }; -static_assert(sizeof(SaveDataDescriptor) == 0x40, "SaveDataDescriptor has incorrect size."); +static_assert(sizeof(SaveDataAttribute) == 0x40, "SaveDataAttribute has incorrect size."); + +struct SaveDataExtraData { + SaveDataAttribute attr; + u64 owner_id; + s64 timestamp; + SaveDataFlags flags; + INSERT_PADDING_BYTES(4); + s64 available_size; + s64 journal_size; + s64 commit_id; + std::array<u8, 0x190> unused; +}; +static_assert(sizeof(SaveDataExtraData) == 0x200, "SaveDataExtraData has incorrect size."); struct SaveDataSize { u64 normal; @@ -64,8 +87,8 @@ public: explicit SaveDataFactory(VirtualDir dir); ~SaveDataFactory(); - ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; - ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; + ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataAttribute& meta) const; + ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataAttribute& meta) const; VirtualDir GetSaveDataSpaceDirectory(SaveDataSpaceId space) const; |