diff options
| author | 2019-03-05 10:09:27 -0500 | |
|---|---|---|
| committer | 2019-03-05 10:09:36 -0500 | |
| commit | 52ac6419dafb84b10369226d3746b3b5b761d33b (patch) | |
| tree | 008c14ba2e019b86128e6168ad49a3a1eafa6ba8 /src/core/loader/nso.cpp | |
| parent | core: Add support for registering and controlling ownership of CheatEngine (diff) | |
| download | yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.gz yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.xz yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.zip | |
vm_manager: Remove cheat-specific ranges from VMManager
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 2721d85b1..5f6a6c0cf 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -97,7 +97,6 @@ static constexpr u32 PageAlignSize(u32 size) { | |||
| 97 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | 97 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, |
| 98 | const FileSys::VfsFile& file, VAddr load_base, | 98 | const FileSys::VfsFile& file, VAddr load_base, |
| 99 | bool should_pass_arguments, | 99 | bool should_pass_arguments, |
| 100 | bool should_register_data_region, | ||
| 101 | std::optional<FileSys::PatchManager> pm) { | 100 | std::optional<FileSys::PatchManager> pm) { |
| 102 | if (file.GetSize() < sizeof(NsoHeader)) | 101 | if (file.GetSize() < sizeof(NsoHeader)) |
| 103 | return {}; | 102 | return {}; |
| @@ -156,10 +155,6 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 156 | const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)}; | 155 | const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)}; |
| 157 | program_image.resize(image_size); | 156 | program_image.resize(image_size); |
| 158 | 157 | ||
| 159 | if (should_register_data_region) { | ||
| 160 | process.VMManager().SetMainCodeRegion(load_base, load_base + program_image.size()); | ||
| 161 | } | ||
| 162 | |||
| 163 | // Apply patches if necessary | 158 | // Apply patches if necessary |
| 164 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { | 159 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { |
| 165 | std::vector<u8> pi_header(program_image.size() + 0x100); | 160 | std::vector<u8> pi_header(program_image.size() + 0x100); |
| @@ -176,7 +171,8 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 176 | const auto cheats = pm->CreateCheatList(nso_header.build_id); | 171 | const auto cheats = pm->CreateCheatList(nso_header.build_id); |
| 177 | if (!cheats.empty()) { | 172 | if (!cheats.empty()) { |
| 178 | Core::System::GetInstance().RegisterCheatList( | 173 | Core::System::GetInstance().RegisterCheatList( |
| 179 | cheats, Common::HexArrayToString(nso_header.build_id)); | 174 | cheats, Common::HexArrayToString(nso_header.build_id), load_base, |
| 175 | load_base + program_image.size()); | ||
| 180 | } | 176 | } |
| 181 | } | 177 | } |
| 182 | 178 | ||
| @@ -197,7 +193,7 @@ ResultStatus AppLoader_NSO::Load(Kernel::Process& process) { | |||
| 197 | 193 | ||
| 198 | // Load module | 194 | // Load module |
| 199 | const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); | 195 | const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); |
| 200 | if (!LoadModule(process, *file, base_address, true, true)) { | 196 | if (!LoadModule(process, *file, base_address, true)) { |
| 201 | return ResultStatus::ErrorLoadingNSO; | 197 | return ResultStatus::ErrorLoadingNSO; |
| 202 | } | 198 | } |
| 203 | LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", file->GetName(), base_address); | 199 | LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", file->GetName(), base_address); |