mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
filesystem: Add CreateFactories methods to fs
Allows frontend to create registration caches for use before a game has booted.
This commit is contained in:
parent
410062031b
commit
ef3768f323
3 changed files with 12 additions and 10 deletions
|
@ -345,16 +345,15 @@ void CreateFactories(const FileSys::VirtualFilesystem& vfs, bool overwrite) {
|
||||||
|
|
||||||
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);
|
||||||
|
if (save_data_factory == nullptr)
|
||||||
auto savedata = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory));
|
save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory));
|
||||||
save_data_factory = std::move(savedata);
|
if (sdmc_factory == nullptr)
|
||||||
|
sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory));
|
||||||
auto sdcard = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory));
|
|
||||||
sdmc_factory = std::move(sdcard);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager, const FileSys::VirtualFilesystem& vfs) {
|
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_LDR>()->InstallAsService(service_manager);
|
||||||
std::make_shared<FSP_PR>()->InstallAsService(service_manager);
|
std::make_shared<FSP_PR>()->InstallAsService(service_manager);
|
||||||
std::make_shared<FSP_SRV>()->InstallAsService(service_manager);
|
std::make_shared<FSP_SRV>()->InstallAsService(service_manager);
|
||||||
|
|
|
@ -46,8 +46,12 @@ ResultVal<FileSys::VirtualDir> OpenSDMC();
|
||||||
|
|
||||||
std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents();
|
std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents();
|
||||||
std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents();
|
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);
|
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
|
// A class that wraps a VfsDirectory with methods that return ResultVal and ResultCode instead of
|
||||||
|
|
|
@ -122,8 +122,7 @@ GMainWindow::GMainWindow()
|
||||||
show();
|
show();
|
||||||
|
|
||||||
// Necessary to load titles from nand in gamelist.
|
// Necessary to load titles from nand in gamelist.
|
||||||
Service::FileSystem::RegisterBIS(std::make_unique<FileSys::BISFactory>(vfs->OpenDirectory(
|
Service::FileSystem::CreateFactories(vfs);
|
||||||
FileUtil::GetUserPath(FileUtil::UserPath::NANDDir), FileSys::Mode::ReadWrite)));
|
|
||||||
game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan);
|
game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan);
|
||||||
|
|
||||||
// Show one-time "callout" messages to the user
|
// Show one-time "callout" messages to the user
|
||||||
|
|
Loading…
Reference in a new issue