diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-22 02:41:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 02:41:59 +0100 |
commit | 639f0c524d3406b7c156dc75af4e934c6b5adcb6 (patch) | |
tree | e03093771bbffc832c48670331cf9af54aa4a9fc /src/core/loader | |
parent | Merge pull request #2260 from lioncash/sdl (diff) | |
parent | vm_manager: Remove cheat-specific ranges from VMManager (diff) | |
download | yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar.gz yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar.bz2 yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar.lz yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar.xz yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.tar.zst yuzu-639f0c524d3406b7c156dc75af4e934c6b5adcb6.zip |
Diffstat (limited to 'src/core/loader')
-rw-r--r-- | src/core/loader/nso.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index e1c8908a1..0eb9fd7f7 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -7,8 +7,10 @@ #include <lz4.h> #include "common/common_funcs.h" #include "common/file_util.h" +#include "common/hex_util.h" #include "common/logging/log.h" #include "common/swap.h" +#include "core/core.h" #include "core/file_sys/patch_manager.h" #include "core/gdbstub/gdbstub.h" #include "core/hle/kernel/code_set.h" @@ -165,6 +167,16 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, std::memcpy(program_image.data(), pi_header.data() + 0x100, program_image.size()); } + // Apply cheats if they exist and the program has a valid title ID + if (pm) { + const auto cheats = pm->CreateCheatList(nso_header.build_id); + if (!cheats.empty()) { + Core::System::GetInstance().RegisterCheatList( + cheats, Common::HexArrayToString(nso_header.build_id), load_base, + load_base + program_image.size()); + } + } + // Load codeset for current process codeset.memory = std::make_shared<std::vector<u8>>(std::move(program_image)); process.LoadModule(std::move(codeset), load_base); |