diff options
| author | 2019-04-09 19:16:37 -0400 | |
|---|---|---|
| committer | 2019-04-09 19:16:37 -0400 | |
| commit | 61f63bb994e358b925771bd51898822573e5780e (patch) | |
| tree | a6a9f12b12b5946c04ccaf0856e0f3a94bbffe17 /src/core/hle | |
| parent | Merge pull request #2366 from FernandoS27/xmad-fix (diff) | |
| parent | patch_manager: Dump NSO name with build ID (diff) | |
| download | yuzu-61f63bb994e358b925771bd51898822573e5780e.tar.gz yuzu-61f63bb994e358b925771bd51898822573e5780e.tar.xz yuzu-61f63bb994e358b925771bd51898822573e5780e.zip | |
Merge pull request #1957 from DarkLordZach/title-provider
file_sys: Provide generic interface for accessing game data
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/am/applets/web_browser.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp index 9b0aa7f5f..7e17df98a 100644 --- a/src/core/hle/service/am/applets/web_browser.cpp +++ b/src/core/hle/service/am/applets/web_browser.cpp | |||
| @@ -86,7 +86,7 @@ static FileSys::VirtualFile GetManualRomFS() { | |||
| 86 | if (loader.ReadManualRomFS(out) == Loader::ResultStatus::Success) | 86 | if (loader.ReadManualRomFS(out) == Loader::ResultStatus::Success) |
| 87 | return out; | 87 | return out; |
| 88 | 88 | ||
| 89 | const auto& installed{FileSystem::GetUnionContents()}; | 89 | const auto& installed{Core::System::GetInstance().GetContentProvider()}; |
| 90 | const auto res = installed.GetEntry(Core::System::GetInstance().CurrentProcess()->GetTitleID(), | 90 | const auto res = installed.GetEntry(Core::System::GetInstance().CurrentProcess()->GetTitleID(), |
| 91 | FileSys::ContentRecordType::Manual); | 91 | FileSys::ContentRecordType::Manual); |
| 92 | 92 | ||
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index b506bc3dd..2d768d9fc 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -33,11 +33,11 @@ static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { | |||
| 33 | 33 | ||
| 34 | static std::vector<u64> AccumulateAOCTitleIDs() { | 34 | static std::vector<u64> AccumulateAOCTitleIDs() { |
| 35 | std::vector<u64> add_on_content; | 35 | std::vector<u64> add_on_content; |
| 36 | const auto rcu = FileSystem::GetUnionContents(); | 36 | const auto& rcu = Core::System::GetInstance().GetContentProvider(); |
| 37 | const auto list = | 37 | const auto list = |
| 38 | rcu.ListEntriesFilter(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); | 38 | rcu.ListEntriesFilter(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); |
| 39 | std::transform(list.begin(), list.end(), std::back_inserter(add_on_content), | 39 | std::transform(list.begin(), list.end(), std::back_inserter(add_on_content), |
| 40 | [](const FileSys::RegisteredCacheEntry& rce) { return rce.title_id; }); | 40 | [](const FileSys::ContentProviderEntry& rce) { return rce.title_id; }); |
| 41 | add_on_content.erase( | 41 | add_on_content.erase( |
| 42 | std::remove_if( | 42 | std::remove_if( |
| 43 | add_on_content.begin(), add_on_content.end(), | 43 | add_on_content.begin(), add_on_content.end(), |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 4c2b371c3..1ebfeb4bf 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -391,11 +391,6 @@ void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, | |||
| 391 | save_data_factory->WriteSaveDataSize(type, title_id, user_id, new_value); | 391 | save_data_factory->WriteSaveDataSize(type, title_id, user_id, new_value); |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | FileSys::RegisteredCacheUnion GetUnionContents() { | ||
| 395 | return FileSys::RegisteredCacheUnion{ | ||
| 396 | {GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}}; | ||
| 397 | } | ||
| 398 | |||
| 399 | FileSys::RegisteredCache* GetSystemNANDContents() { | 394 | FileSys::RegisteredCache* GetSystemNANDContents() { |
| 400 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); | 395 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); |
| 401 | 396 | ||
| @@ -460,6 +455,10 @@ void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | |||
| 460 | if (bis_factory == nullptr) { | 455 | if (bis_factory == nullptr) { |
| 461 | bis_factory = | 456 | bis_factory = |
| 462 | std::make_unique<FileSys::BISFactory>(nand_directory, load_directory, dump_directory); | 457 | std::make_unique<FileSys::BISFactory>(nand_directory, load_directory, dump_directory); |
| 458 | Core::System::GetInstance().RegisterContentProvider( | ||
| 459 | FileSys::ContentProviderUnionSlot::SysNAND, bis_factory->GetSystemNANDContents()); | ||
| 460 | Core::System::GetInstance().RegisterContentProvider( | ||
| 461 | FileSys::ContentProviderUnionSlot::UserNAND, bis_factory->GetUserNANDContents()); | ||
| 463 | } | 462 | } |
| 464 | 463 | ||
| 465 | if (save_data_factory == nullptr) { | 464 | if (save_data_factory == nullptr) { |
| @@ -468,6 +467,8 @@ void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | |||
| 468 | 467 | ||
| 469 | if (sdmc_factory == nullptr) { | 468 | if (sdmc_factory == nullptr) { |
| 470 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); | 469 | sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory)); |
| 470 | Core::System::GetInstance().RegisterContentProvider(FileSys::ContentProviderUnionSlot::SDMC, | ||
| 471 | sdmc_factory->GetSDMCContents()); | ||
| 471 | } | 472 | } |
| 472 | } | 473 | } |
| 473 | 474 | ||
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 7cfc0d902..6481f237c 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -54,8 +54,6 @@ FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, | |||
| 54 | void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, | 54 | void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, |
| 55 | FileSys::SaveDataSize new_value); | 55 | FileSys::SaveDataSize new_value); |
| 56 | 56 | ||
| 57 | FileSys::RegisteredCacheUnion GetUnionContents(); | ||
| 58 | |||
| 59 | FileSys::RegisteredCache* GetSystemNANDContents(); | 57 | FileSys::RegisteredCache* GetSystemNANDContents(); |
| 60 | FileSys::RegisteredCache* GetUserNANDContents(); | 58 | FileSys::RegisteredCache* GetUserNANDContents(); |
| 61 | FileSys::RegisteredCache* GetSDMCContents(); | 59 | FileSys::RegisteredCache* GetSDMCContents(); |