mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-09-12 14:08:46 +02:00
filesystem: Add LayeredFS VFS directory getter
This commit is contained in:
parent
50a470eab8
commit
940a711caf
@ -343,6 +343,15 @@ std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents() {
|
|||||||
return sdmc_factory->GetSDMCContents();
|
return sdmc_factory->GetSDMCContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileSys::VirtualDir GetModificationLoadRoot(u64 title_id) {
|
||||||
|
LOG_TRACE(Service_FS, "Opening mod load root for tid={:016X}", title_id);
|
||||||
|
|
||||||
|
if (bis_factory == nullptr)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return bis_factory->GetModificationLoadRoot(title_id);
|
||||||
|
}
|
||||||
|
|
||||||
void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite) {
|
void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite) {
|
||||||
if (overwrite) {
|
if (overwrite) {
|
||||||
bis_factory = nullptr;
|
bis_factory = nullptr;
|
||||||
@ -354,9 +363,11 @@ void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite) {
|
|||||||
FileSys::Mode::ReadWrite);
|
FileSys::Mode::ReadWrite);
|
||||||
auto sd_directory = vfs->OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir),
|
auto sd_directory = vfs->OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir),
|
||||||
FileSys::Mode::ReadWrite);
|
FileSys::Mode::ReadWrite);
|
||||||
|
auto load_directory = vfs->OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir),
|
||||||
|
FileSys::Mode::ReadWrite);
|
||||||
|
|
||||||
if (bis_factory == nullptr)
|
if (bis_factory == nullptr)
|
||||||
bis_factory = std::make_unique<FileSys::BISFactory>(nand_directory);
|
bis_factory = std::make_unique<FileSys::BISFactory>(nand_directory, load_directory);
|
||||||
if (save_data_factory == nullptr)
|
if (save_data_factory == nullptr)
|
||||||
save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory));
|
save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory));
|
||||||
if (sdmc_factory == nullptr)
|
if (sdmc_factory == nullptr)
|
||||||
|
@ -52,6 +52,8 @@ std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents();
|
|||||||
std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents();
|
std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents();
|
||||||
std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents();
|
std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents();
|
||||||
|
|
||||||
|
FileSys::VirtualDir GetModificationLoadRoot(u64 title_id);
|
||||||
|
|
||||||
// Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function
|
// Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function
|
||||||
// above is called.
|
// above is called.
|
||||||
void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite = true);
|
void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite = true);
|
||||||
|
Loading…
Reference in New Issue
Block a user