From d140c8ecf7514e925340cbd3340991c8df0d0c15 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 19 Feb 2018 00:32:00 -0500 Subject: Filesystem: Added a SaveData Factory and associated Disk_FileSystem. --- src/core/hle/service/filesystem/filesystem.cpp | 11 +++++++++-- src/core/hle/service/filesystem/filesystem.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 4b47548fd..32752aea5 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -3,7 +3,9 @@ // Refer to the license.txt file included. #include +#include "common/file_util.h" #include "core/file_sys/filesystem.h" +#include "core/file_sys/savedata_factory.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/fsp_srv.h" @@ -41,12 +43,17 @@ ResultVal> OpenFileSystem(Type type, return itr->second->Open(path); } -void UnregisterFileSystems() { +void RegisterFileSystems() { filesystem_map.clear(); + + std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX); + + auto savedata = std::make_unique(std::move(nand_directory)); + RegisterFileSystem(std::move(savedata), Type::SaveData); } void InstallInterfaces(SM::ServiceManager& service_manager) { - UnregisterFileSystems(); + RegisterFileSystems(); std::make_shared()->InstallAsService(service_manager); } diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index a674c9493..80f318676 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -25,6 +25,7 @@ namespace FileSystem { /// Supported FileSystem types enum class Type { RomFS = 1, + SaveData = 2, }; /** -- cgit v1.2.3