diff options
| author | 2020-09-16 20:59:44 +0000 | |
|---|---|---|
| committer | 2020-09-16 20:59:44 +0000 | |
| commit | b0ae8265ea0aea16bfe37dce96cc3f758fd35feb (patch) | |
| tree | 735e838e0e271449cecaedc6977c1831c9e39a3a /src/core/loader/nso.cpp | |
| parent | Merge pull request #4658 from lioncash/copy3 (diff) | |
| parent | core/loader: Remove dependencies on the global system instance (diff) | |
| download | yuzu-b0ae8265ea0aea16bfe37dce96cc3f758fd35feb.tar.gz yuzu-b0ae8265ea0aea16bfe37dce96cc3f758fd35feb.tar.xz yuzu-b0ae8265ea0aea16bfe37dce96cc3f758fd35feb.zip | |
Merge pull request #4661 from lioncash/system-loader
core/loader: Remove dependencies on the global system instance
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 575330a86..2610cea34 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -71,7 +71,7 @@ FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) { | |||
| 71 | return FileType::NSO; | 71 | return FileType::NSO; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | 74 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, Core::System& system, |
| 75 | const FileSys::VfsFile& file, VAddr load_base, | 75 | const FileSys::VfsFile& file, VAddr load_base, |
| 76 | bool should_pass_arguments, bool load_into_process, | 76 | bool should_pass_arguments, bool load_into_process, |
| 77 | std::optional<FileSys::PatchManager> pm) { | 77 | std::optional<FileSys::PatchManager> pm) { |
| @@ -148,7 +148,6 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 148 | 148 | ||
| 149 | // Apply cheats if they exist and the program has a valid title ID | 149 | // Apply cheats if they exist and the program has a valid title ID |
| 150 | if (pm) { | 150 | if (pm) { |
| 151 | auto& system = Core::System::GetInstance(); | ||
| 152 | system.SetCurrentProcessBuildID(nso_header.build_id); | 151 | system.SetCurrentProcessBuildID(nso_header.build_id); |
| 153 | const auto cheats = pm->CreateCheatList(system, nso_header.build_id); | 152 | const auto cheats = pm->CreateCheatList(system, nso_header.build_id); |
| 154 | if (!cheats.empty()) { | 153 | if (!cheats.empty()) { |
| @@ -166,7 +165,8 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 166 | return load_base + image_size; | 165 | return load_base + image_size; |
| 167 | } | 166 | } |
| 168 | 167 | ||
| 169 | AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process) { | 168 | AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process, |
| 169 | [[maybe_unused]] Core::System& system) { | ||
| 170 | if (is_loaded) { | 170 | if (is_loaded) { |
| 171 | return {ResultStatus::ErrorAlreadyLoaded, {}}; | 171 | return {ResultStatus::ErrorAlreadyLoaded, {}}; |
| 172 | } | 172 | } |
| @@ -175,7 +175,7 @@ AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process) { | |||
| 175 | 175 | ||
| 176 | // Load module | 176 | // Load module |
| 177 | const VAddr base_address = process.PageTable().GetCodeRegionStart(); | 177 | const VAddr base_address = process.PageTable().GetCodeRegionStart(); |
| 178 | if (!LoadModule(process, *file, base_address, true, true)) { | 178 | if (!LoadModule(process, system, *file, base_address, true, true)) { |
| 179 | return {ResultStatus::ErrorLoadingNSO, {}}; | 179 | return {ResultStatus::ErrorLoadingNSO, {}}; |
| 180 | } | 180 | } |
| 181 | 181 | ||