From 5721b8b5ad87bcfc45b3da3e80add0e447d85891 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 6 Dec 2018 22:07:34 -0500 Subject: savedata_factory: Delete TemporaryStorage on startup Mimics hardware behavior. --- src/core/file_sys/savedata_factory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 5434f2149..37566e2e7 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(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; -- cgit v1.2.3 From fcfbae88e9b6707fadcf2e7b7049057329d43790 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Fri, 7 Dec 2018 08:47:26 -0500 Subject: savedata_factory: Add support for CacheStorage --- src/core/file_sys/savedata_factory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 37566e2e7..bd50fedc7 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -124,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(type)); } -- cgit v1.2.3