summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHexagon12 <Hexagon12@users.noreply.github.com>2018-12-10 17:41:46 +0100
committerGitHub <noreply@github.com>2018-12-10 17:41:46 +0100
commitee9e433517b0dd91657ec0c659edad08bfb4b75f (patch)
tree058490dd8d45328ff8d4436a4f75c03cc6492fcf
parentMerge pull request #1876 from lioncash/vma (diff)
parentsavedata_factory: Add support for CacheStorage (diff)
downloadyuzu-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.cpp8
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));
}