diff options
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 25 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 1 |
2 files changed, 22 insertions, 4 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index e32a7c48e..234a8687b 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -360,6 +360,15 @@ FileSys::VirtualDir GetModificationLoadRoot(u64 title_id) { | |||
| 360 | return bis_factory->GetModificationLoadRoot(title_id); | 360 | return bis_factory->GetModificationLoadRoot(title_id); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | FileSys::VirtualDir GetModificationDumpRoot(u64 title_id) { | ||
| 364 | LOG_TRACE(Service_FS, "Opening mod dump root for tid={:016X}", title_id); | ||
| 365 | |||
| 366 | if (bis_factory == nullptr) | ||
| 367 | return nullptr; | ||
| 368 | |||
| 369 | return bis_factory->GetModificationDumpRoot(title_id); | ||
| 370 | } | ||
| 371 | |||
| 363 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | 372 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { |
| 364 | if (overwrite) { | 373 | if (overwrite) { |
| 365 | bis_factory = nullptr; | 374 | bis_factory = nullptr; |
| @@ -373,13 +382,21 @@ void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | |||
| 373 | FileSys::Mode::ReadWrite); | 382 | FileSys::Mode::ReadWrite); |
| 374 | auto load_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), | 383 | auto load_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), |
| 375 | FileSys::Mode::ReadWrite); | 384 | FileSys::Mode::ReadWrite); |
| 385 | auto dump_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::DumpDir), | ||
| 386 | FileSys::Mode::ReadWrite); | ||
| 376 | 387 | ||
| 377 | if (bis_factory == nullptr) | 388 | if (bis_factory == nullptr) { |
| 378 | bis_factory = std::make_unique<FileSys::BISFactory>(nand_directory, load_directory); | 389 | bis_factory = |
| 379 | if (save_data_factory == nullptr) | 390 | std::make_unique<FileSys::BISFactory>(nand_directory, load_directory, dump_directory); |
| 391 | } | ||
| 392 | |||
| 393 | if (save_data_factory == nullptr) { | ||
| 380 | save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); | 394 | save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); |
| 381 | if (sdmc_factory == nullptr) | 395 | } |
| 396 | |||
| 397 | if (sdmc_factory == nullptr) { | ||
| 382 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); | 398 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); |
| 399 | } | ||
| 383 | } | 400 | } |
| 384 | 401 | ||
| 385 | void InstallInterfaces(SM::ServiceManager& service_manager, FileSys::VfsFilesystem& vfs) { | 402 | void InstallInterfaces(SM::ServiceManager& service_manager, FileSys::VfsFilesystem& vfs) { |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 6ca5c5636..b18652a68 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -54,6 +54,7 @@ FileSys::RegisteredCache* GetUserNANDContents(); | |||
| 54 | FileSys::RegisteredCache* GetSDMCContents(); | 54 | FileSys::RegisteredCache* GetSDMCContents(); |
| 55 | 55 | ||
| 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); | 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); |
| 57 | FileSys::VirtualDir GetModificationDumpRoot(u64 title_id); | ||
| 57 | 58 | ||
| 58 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function | 59 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function |
| 59 | // above is called. | 60 | // above is called. |