summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-16 17:08:44 -0400
committerGravatar Zach Hilman2018-08-23 11:53:30 -0400
commit60b7a3b90448daf2eb0dabd6edadf42e50b3f5b6 (patch)
treebe9595212bd36ec5e5f6305b2ac3e74dcb1c3799 /src
parentfile_sys: Implement NAX containers (diff)
downloadyuzu-60b7a3b90448daf2eb0dabd6edadf42e50b3f5b6.tar.gz
yuzu-60b7a3b90448daf2eb0dabd6edadf42e50b3f5b6.tar.xz
yuzu-60b7a3b90448daf2eb0dabd6edadf42e50b3f5b6.zip
game_list: Add SD registration loading to game list
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/game_list.cpp22
-rw-r--r--src/yuzu/game_list_p.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index d5726b8b3..867a3c6f1 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -426,13 +426,12 @@ static void GetMetadataFromControlNCA(const std::shared_ptr<FileSys::NCA>& nca,
426 } 426 }
427} 427}
428 428
429void GameListWorker::AddInstalledTitlesToGameList() { 429void GameListWorker::AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache) {
430 const auto usernand = Service::FileSystem::GetUserNANDContents(); 430 const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application,
431 const auto installed_games = usernand->ListEntriesFilter(FileSys::TitleType::Application, 431 FileSys::ContentRecordType::Program);
432 FileSys::ContentRecordType::Program);
433 432
434 for (const auto& game : installed_games) { 433 for (const auto& game : installed_games) {
435 const auto& file = usernand->GetEntryRaw(game); 434 const auto& file = cache->GetEntryUnparsed(game);
436 std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file); 435 std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file);
437 if (!loader) 436 if (!loader)
438 continue; 437 continue;
@@ -442,8 +441,7 @@ void GameListWorker::AddInstalledTitlesToGameList() {
442 u64 program_id = 0; 441 u64 program_id = 0;
443 loader->ReadProgramId(program_id); 442 loader->ReadProgramId(program_id);
444 443
445 const auto& control = 444 const auto& control = cache->GetEntry(game.title_id, FileSys::ContentRecordType::Control);
446 usernand->GetEntry(game.title_id, FileSys::ContentRecordType::Control);
447 if (control != nullptr) 445 if (control != nullptr)
448 GetMetadataFromControlNCA(control, icon, name); 446 GetMetadataFromControlNCA(control, icon, name);
449 emit EntryReady({ 447 emit EntryReady({
@@ -457,11 +455,11 @@ void GameListWorker::AddInstalledTitlesToGameList() {
457 }); 455 });
458 } 456 }
459 457
460 const auto control_data = usernand->ListEntriesFilter(FileSys::TitleType::Application, 458 const auto control_data = cache->ListEntriesFilter(FileSys::TitleType::Application,
461 FileSys::ContentRecordType::Control); 459 FileSys::ContentRecordType::Control);
462 460
463 for (const auto& entry : control_data) { 461 for (const auto& entry : control_data) {
464 const auto nca = usernand->GetEntry(entry); 462 const auto nca = cache->GetEntry(entry);
465 if (nca != nullptr) 463 if (nca != nullptr)
466 nca_control_map.insert_or_assign(entry.title_id, nca); 464 nca_control_map.insert_or_assign(entry.title_id, nca);
467 } 465 }
@@ -549,7 +547,9 @@ void GameListWorker::run() {
549 stop_processing = false; 547 stop_processing = false;
550 watch_list.append(dir_path); 548 watch_list.append(dir_path);
551 FillControlMap(dir_path.toStdString()); 549 FillControlMap(dir_path.toStdString());
552 AddInstalledTitlesToGameList(); 550 AddInstalledTitlesToGameList(Service::FileSystem::GetUserNANDContents());
551 AddInstalledTitlesToGameList(Service::FileSystem::GetSystemNANDContents());
552 AddInstalledTitlesToGameList(Service::FileSystem::GetSDMCContents());
553 AddFstEntriesToGameList(dir_path.toStdString(), deep_scan ? 256 : 0); 553 AddFstEntriesToGameList(dir_path.toStdString(), deep_scan ? 256 : 0);
554 nca_control_map.clear(); 554 nca_control_map.clear();
555 emit Finished(watch_list); 555 emit Finished(watch_list);
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index c59613769..1d6c85400 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -172,7 +172,7 @@ private:
172 bool deep_scan; 172 bool deep_scan;
173 std::atomic_bool stop_processing; 173 std::atomic_bool stop_processing;
174 174
175 void AddInstalledTitlesToGameList(); 175 void AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache);
176 void FillControlMap(const std::string& dir_path); 176 void FillControlMap(const std::string& dir_path);
177 void AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion = 0); 177 void AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion = 0);
178}; 178};