diff options
| author | 2020-07-04 00:59:40 -0400 | |
|---|---|---|
| committer | 2020-07-04 00:59:40 -0400 | |
| commit | f829932ed191ad469df01342191bf2725e8a20bb (patch) | |
| tree | 0ae185ce3ef43ef9b085aae7b9ad5abb04e3d239 /src/core/file_sys | |
| parent | Fix for always firing triggers on some controllers, trigger threshold more un... (diff) | |
| parent | Merge pull request #4218 from ogniK5377/opus-external (diff) | |
| download | yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.gz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.xz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.zip | |
Fix merge conflicts?
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 2 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.h | 2 | ||||
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 5 | ||||
| -rw-r--r-- | src/core/file_sys/content_archive.h | 5 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.h | 2 | ||||
| -rw-r--r-- | src/core/file_sys/submission_package.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/submission_package.h | 2 | ||||
| -rw-r--r-- | src/core/file_sys/xts_archive.h | 2 |
10 files changed, 16 insertions, 18 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index 0af44f340..8935a62c3 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -79,7 +79,7 @@ VirtualDir BISFactory::OpenPartition(BisPartitionId id) const { | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | VirtualFile BISFactory::OpenPartitionStorage(BisPartitionId id) const { | 81 | VirtualFile BISFactory::OpenPartitionStorage(BisPartitionId id) const { |
| 82 | Core::Crypto::KeyManager keys; | 82 | auto& keys = Core::Crypto::KeyManager::Instance(); |
| 83 | Core::Crypto::PartitionDataManager pdm{ | 83 | Core::Crypto::PartitionDataManager pdm{ |
| 84 | Core::System::GetInstance().GetFilesystem()->OpenDirectory( | 84 | Core::System::GetInstance().GetFilesystem()->OpenDirectory( |
| 85 | FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir), Mode::Read)}; | 85 | FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir), Mode::Read)}; |
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 07d0c8d5d..664a47e7f 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -178,7 +178,7 @@ u32 XCI::GetSystemUpdateVersion() { | |||
| 178 | return 0; | 178 | return 0; |
| 179 | 179 | ||
| 180 | for (const auto& file : update->GetFiles()) { | 180 | for (const auto& file : update->GetFiles()) { |
| 181 | NCA nca{file, nullptr, 0, keys}; | 181 | NCA nca{file, nullptr, 0}; |
| 182 | 182 | ||
| 183 | if (nca.GetStatus() != Loader::ResultStatus::Success) | 183 | if (nca.GetStatus() != Loader::ResultStatus::Success) |
| 184 | continue; | 184 | continue; |
| @@ -286,7 +286,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | |||
| 286 | continue; | 286 | continue; |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | auto nca = std::make_shared<NCA>(file, nullptr, 0, keys); | 289 | auto nca = std::make_shared<NCA>(file, nullptr, 0); |
| 290 | if (nca->IsUpdate()) { | 290 | if (nca->IsUpdate()) { |
| 291 | continue; | 291 | continue; |
| 292 | } | 292 | } |
diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h index c2ee0ea99..e1b136426 100644 --- a/src/core/file_sys/card_image.h +++ b/src/core/file_sys/card_image.h | |||
| @@ -140,6 +140,6 @@ private: | |||
| 140 | 140 | ||
| 141 | u64 update_normal_partition_end; | 141 | u64 update_normal_partition_end; |
| 142 | 142 | ||
| 143 | Core::Crypto::KeyManager keys; | 143 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 144 | }; | 144 | }; |
| 145 | } // namespace FileSys | 145 | } // namespace FileSys |
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index b8bbdd1ef..473245d5a 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -118,9 +118,8 @@ static bool IsValidNCA(const NCAHeader& header) { | |||
| 118 | return header.magic == Common::MakeMagic('N', 'C', 'A', '3'); | 118 | return header.magic == Common::MakeMagic('N', 'C', 'A', '3'); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | NCA::NCA(VirtualFile file_, VirtualFile bktr_base_romfs_, u64 bktr_base_ivfc_offset, | 121 | NCA::NCA(VirtualFile file_, VirtualFile bktr_base_romfs_, u64 bktr_base_ivfc_offset) |
| 122 | Core::Crypto::KeyManager keys_) | 122 | : file(std::move(file_)), bktr_base_romfs(std::move(bktr_base_romfs_)) { |
| 123 | : file(std::move(file_)), bktr_base_romfs(std::move(bktr_base_romfs_)), keys(std::move(keys_)) { | ||
| 124 | if (file == nullptr) { | 123 | if (file == nullptr) { |
| 125 | status = Loader::ResultStatus::ErrorNullFile; | 124 | status = Loader::ResultStatus::ErrorNullFile; |
| 126 | return; | 125 | return; |
diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h index e249079b5..d25cbcf91 100644 --- a/src/core/file_sys/content_archive.h +++ b/src/core/file_sys/content_archive.h | |||
| @@ -99,8 +99,7 @@ inline bool IsDirectoryLogoPartition(const VirtualDir& pfs) { | |||
| 99 | class NCA : public ReadOnlyVfsDirectory { | 99 | class NCA : public ReadOnlyVfsDirectory { |
| 100 | public: | 100 | public: |
| 101 | explicit NCA(VirtualFile file, VirtualFile bktr_base_romfs = nullptr, | 101 | explicit NCA(VirtualFile file, VirtualFile bktr_base_romfs = nullptr, |
| 102 | u64 bktr_base_ivfc_offset = 0, | 102 | u64 bktr_base_ivfc_offset = 0); |
| 103 | Core::Crypto::KeyManager keys = Core::Crypto::KeyManager()); | ||
| 104 | ~NCA() override; | 103 | ~NCA() override; |
| 105 | 104 | ||
| 106 | Loader::ResultStatus GetStatus() const; | 105 | Loader::ResultStatus GetStatus() const; |
| @@ -159,7 +158,7 @@ private: | |||
| 159 | bool encrypted = false; | 158 | bool encrypted = false; |
| 160 | bool is_update = false; | 159 | bool is_update = false; |
| 161 | 160 | ||
| 162 | Core::Crypto::KeyManager keys; | 161 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 163 | }; | 162 | }; |
| 164 | 163 | ||
| 165 | } // namespace FileSys | 164 | } // namespace FileSys |
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index ba5f76288..27c1b0233 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -408,7 +408,7 @@ void RegisteredCache::ProcessFiles(const std::vector<NcaID>& ids) { | |||
| 408 | 408 | ||
| 409 | if (file == nullptr) | 409 | if (file == nullptr) |
| 410 | continue; | 410 | continue; |
| 411 | const auto nca = std::make_shared<NCA>(parser(file, id), nullptr, 0, keys); | 411 | const auto nca = std::make_shared<NCA>(parser(file, id), nullptr, 0); |
| 412 | if (nca->GetStatus() != Loader::ResultStatus::Success || | 412 | if (nca->GetStatus() != Loader::ResultStatus::Success || |
| 413 | nca->GetType() != NCAContentType::Meta) { | 413 | nca->GetType() != NCAContentType::Meta) { |
| 414 | continue; | 414 | continue; |
| @@ -486,7 +486,7 @@ std::unique_ptr<NCA> RegisteredCache::GetEntry(u64 title_id, ContentRecordType t | |||
| 486 | const auto raw = GetEntryRaw(title_id, type); | 486 | const auto raw = GetEntryRaw(title_id, type); |
| 487 | if (raw == nullptr) | 487 | if (raw == nullptr) |
| 488 | return nullptr; | 488 | return nullptr; |
| 489 | return std::make_unique<NCA>(raw, nullptr, 0, keys); | 489 | return std::make_unique<NCA>(raw, nullptr, 0); |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | template <typename T> | 492 | template <typename T> |
| @@ -865,7 +865,7 @@ std::unique_ptr<NCA> ManualContentProvider::GetEntry(u64 title_id, ContentRecord | |||
| 865 | const auto res = GetEntryRaw(title_id, type); | 865 | const auto res = GetEntryRaw(title_id, type); |
| 866 | if (res == nullptr) | 866 | if (res == nullptr) |
| 867 | return nullptr; | 867 | return nullptr; |
| 868 | return std::make_unique<NCA>(res, nullptr, 0, keys); | 868 | return std::make_unique<NCA>(res, nullptr, 0); |
| 869 | } | 869 | } |
| 870 | 870 | ||
| 871 | std::vector<ContentProviderEntry> ManualContentProvider::ListEntriesFilter( | 871 | std::vector<ContentProviderEntry> ManualContentProvider::ListEntriesFilter( |
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index d1eec240e..f339cd17b 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h | |||
| @@ -88,7 +88,7 @@ public: | |||
| 88 | 88 | ||
| 89 | protected: | 89 | protected: |
| 90 | // A single instance of KeyManager to be used by GetEntry() | 90 | // A single instance of KeyManager to be used by GetEntry() |
| 91 | Core::Crypto::KeyManager keys; | 91 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | class PlaceholderCache { | 94 | class PlaceholderCache { |
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index ef3084681..175a8266a 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | namespace FileSys { | 21 | namespace FileSys { |
| 22 | namespace { | 22 | namespace { |
| 23 | void SetTicketKeys(const std::vector<VirtualFile>& files) { | 23 | void SetTicketKeys(const std::vector<VirtualFile>& files) { |
| 24 | Core::Crypto::KeyManager keys; | 24 | auto& keys = Core::Crypto::KeyManager::Instance(); |
| 25 | 25 | ||
| 26 | for (const auto& ticket_file : files) { | 26 | for (const auto& ticket_file : files) { |
| 27 | if (ticket_file == nullptr) { | 27 | if (ticket_file == nullptr) { |
| @@ -285,7 +285,7 @@ void NSP::ReadNCAs(const std::vector<VirtualFile>& files) { | |||
| 285 | continue; | 285 | continue; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | auto next_nca = std::make_shared<NCA>(std::move(next_file), nullptr, 0, keys); | 288 | auto next_nca = std::make_shared<NCA>(std::move(next_file), nullptr, 0); |
| 289 | if (next_nca->GetType() == NCAContentType::Program) { | 289 | if (next_nca->GetType() == NCAContentType::Program) { |
| 290 | program_status[cnmt.GetTitleID()] = next_nca->GetStatus(); | 290 | program_status[cnmt.GetTitleID()] = next_nca->GetStatus(); |
| 291 | } | 291 | } |
diff --git a/src/core/file_sys/submission_package.h b/src/core/file_sys/submission_package.h index ee9b6ce17..cf89de6a9 100644 --- a/src/core/file_sys/submission_package.h +++ b/src/core/file_sys/submission_package.h | |||
| @@ -73,7 +73,7 @@ private: | |||
| 73 | std::map<u64, std::map<std::pair<TitleType, ContentRecordType>, std::shared_ptr<NCA>>> ncas; | 73 | std::map<u64, std::map<std::pair<TitleType, ContentRecordType>, std::shared_ptr<NCA>>> ncas; |
| 74 | std::vector<VirtualFile> ticket_files; | 74 | std::vector<VirtualFile> ticket_files; |
| 75 | 75 | ||
| 76 | Core::Crypto::KeyManager keys; | 76 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 77 | 77 | ||
| 78 | VirtualFile romfs; | 78 | VirtualFile romfs; |
| 79 | VirtualDir exefs; | 79 | VirtualDir exefs; |
diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h index 7704dee90..563531bb6 100644 --- a/src/core/file_sys/xts_archive.h +++ b/src/core/file_sys/xts_archive.h | |||
| @@ -62,6 +62,6 @@ private: | |||
| 62 | 62 | ||
| 63 | VirtualFile dec_file; | 63 | VirtualFile dec_file; |
| 64 | 64 | ||
| 65 | Core::Crypto::KeyManager keys; | 65 | Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance(); |
| 66 | }; | 66 | }; |
| 67 | } // namespace FileSys | 67 | } // namespace FileSys |