summaryrefslogtreecommitdiffstats
path: root/src/core/loader
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/nso.cpp12
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);