diff options
| author | 2018-11-15 14:46:10 -0800 | |
|---|---|---|
| committer | 2018-11-15 14:46:10 -0800 | |
| commit | 97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51 (patch) | |
| tree | c6f69e9269a8e6c4771b1fb338c2677d62f7c48e /src/core/hle | |
| parent | Merge pull request #1691 from lioncash/audren (diff) | |
| parent | patch_manager: Add support for dumping decompressed NSOs (diff) | |
| download | yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.gz yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.xz yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.zip | |
Merge pull request #1618 from DarkLordZach/dump-nso
patch_manager: Add support for dumping uncompressed NSOs
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 ea8fd965a..a92cf7815 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -370,6 +370,15 @@ FileSys::VirtualDir GetModificationLoadRoot(u64 title_id) { | |||
| 370 | return bis_factory->GetModificationLoadRoot(title_id); | 370 | return bis_factory->GetModificationLoadRoot(title_id); |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | FileSys::VirtualDir GetModificationDumpRoot(u64 title_id) { | ||
| 374 | LOG_TRACE(Service_FS, "Opening mod dump root for tid={:016X}", title_id); | ||
| 375 | |||
| 376 | if (bis_factory == nullptr) | ||
| 377 | return nullptr; | ||
| 378 | |||
| 379 | return bis_factory->GetModificationDumpRoot(title_id); | ||
| 380 | } | ||
| 381 | |||
| 373 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | 382 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { |
| 374 | if (overwrite) { | 383 | if (overwrite) { |
| 375 | bis_factory = nullptr; | 384 | bis_factory = nullptr; |
| @@ -383,13 +392,21 @@ void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | |||
| 383 | FileSys::Mode::ReadWrite); | 392 | FileSys::Mode::ReadWrite); |
| 384 | auto load_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), | 393 | auto load_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), |
| 385 | FileSys::Mode::ReadWrite); | 394 | FileSys::Mode::ReadWrite); |
| 395 | auto dump_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::DumpDir), | ||
| 396 | FileSys::Mode::ReadWrite); | ||
| 386 | 397 | ||
| 387 | if (bis_factory == nullptr) | 398 | if (bis_factory == nullptr) { |
| 388 | bis_factory = std::make_unique<FileSys::BISFactory>(nand_directory, load_directory); | 399 | bis_factory = |
| 389 | if (save_data_factory == nullptr) | 400 | std::make_unique<FileSys::BISFactory>(nand_directory, load_directory, dump_directory); |
| 401 | } | ||
| 402 | |||
| 403 | if (save_data_factory == nullptr) { | ||
| 390 | save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); | 404 | save_data_factory = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); |
| 391 | if (sdmc_factory == nullptr) | 405 | } |
| 406 | |||
| 407 | if (sdmc_factory == nullptr) { | ||
| 392 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); | 408 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); |
| 409 | } | ||
| 393 | } | 410 | } |
| 394 | 411 | ||
| 395 | void InstallInterfaces(SM::ServiceManager& service_manager, FileSys::VfsFilesystem& vfs) { | 412 | 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 2cbb70c87..e38f02869 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -55,6 +55,7 @@ FileSys::RegisteredCache* GetUserNANDContents(); | |||
| 55 | FileSys::RegisteredCache* GetSDMCContents(); | 55 | FileSys::RegisteredCache* GetSDMCContents(); |
| 56 | 56 | ||
| 57 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); | 57 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); |
| 58 | FileSys::VirtualDir GetModificationDumpRoot(u64 title_id); | ||
| 58 | 59 | ||
| 59 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function | 60 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function |
| 60 | // above is called. | 61 | // above is called. |