diff options
author | Hexagon12 <Hexagon12@users.noreply.github.com> | 2018-12-10 17:41:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 17:41:46 +0100 |
commit | ee9e433517b0dd91657ec0c659edad08bfb4b75f (patch) | |
tree | 058490dd8d45328ff8d4436a4f75c03cc6492fcf | |
parent | Merge pull request #1876 from lioncash/vma (diff) | |
parent | savedata_factory: Add support for CacheStorage (diff) | |
download | yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar.gz yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar.bz2 yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar.lz yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar.xz yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.tar.zst yuzu-ee9e433517b0dd91657ec0c659edad08bfb4b75f.zip |
-rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 5434f2149..bd50fedc7 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -18,7 +18,11 @@ std::string SaveDataDescriptor::DebugInfo() const { static_cast<u8>(type), title_id, user_id[1], user_id[0], save_id); } -SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save_directory)) {} +SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save_directory)) { + // Delete all temporary storages + // On hardware, it is expected that temporary storage be empty at first use. + dir->DeleteSubdirectoryRecursive("temp"); +} SaveDataFactory::~SaveDataFactory() = default; @@ -120,6 +124,8 @@ std::string SaveDataFactory::GetFullPath(SaveDataSpaceId space, SaveDataType typ case SaveDataType::TemporaryStorage: return fmt::format("{}{:016X}/{:016X}{:016X}/{:016X}", out, 0, user_id[1], user_id[0], title_id); + case SaveDataType::CacheStorage: + return fmt::format("{}save/cache/{:016X}", out, title_id); default: ASSERT_MSG(false, "Unrecognized SaveDataType: {:02X}", static_cast<u8>(type)); } |