diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-08-16 23:04:38 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-23 17:52:44 +0200 |
commit | ef3768f323fc06eb41c603fe797a26412424acd4 (patch) | |
tree | 9949bb6b334d3ab0f0991e981e3991225d1d9cb3 /src/core | |
parent | filesystem: Add logging to registration getters (diff) | |
download | yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar.gz yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar.bz2 yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar.lz yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar.xz yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.tar.zst yuzu-ef3768f323fc06eb41c603fe797a26412424acd4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 6 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 1a318b233..914315d20 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -345,16 +345,15 @@ void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite) { if (bis_factory == nullptr) bis_factory = std::make_unique<FileSys::BISFactory>(nand_directory); - - auto savedata = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); - save_data_factory = std::move(savedata); - - auto sdcard = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); - sdmc_factory = std::move(sdcard); + if (save_data_factory == nullptr) + save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); + if (sdmc_factory == nullptr) + sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); } void InstallInterfaces(SM::ServiceManager& service_manager, const FileSys::VirtualFilesystem& vfs) { - RegisterFileSystems(vfs); + romfs_factory = nullptr; + CreateFactories(vfs, false); std::make_shared<FSP_LDR>()->InstallAsService(service_manager); std::make_shared<FSP_PR>()->InstallAsService(service_manager); std::make_shared<FSP_SRV>()->InstallAsService(service_manager); diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index df78be44a..d88a66825 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -46,8 +46,12 @@ ResultVal<FileSys::VirtualDir> OpenSDMC(); std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents(); std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents(); +std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents(); + +// Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function +// above is called. +void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite = true); -/// Registers all Filesystem services with the specified service manager. void InstallInterfaces(SM::ServiceManager& service_manager, const FileSys::VirtualFilesystem& vfs); // A class that wraps a VfsDirectory with methods that return ResultVal and ResultCode instead of |