Preprocess cheats to get rid of hacks that try to modify the cheat engine, add support for C2 cheat opcode

This commit is contained in:
Gericom
2026-03-14 12:27:35 +01:00
parent 8c8f36f5c6
commit d0f25a51d9
5 changed files with 142 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "common.h"
#include "../../include/picoLoader7.h"
#include "ndsHeader.h"
#include "DsiWareSaveArranger.h"
#include "BootMode.h"
@@ -44,7 +45,7 @@ public:
/// @brief Sets the cheats to apply to the rom.
/// @param cheats The cheats.
void SetCheats(const pload_cheats_t* cheats)
void SetCheats(pload_cheats_t* cheats)
{
_cheats = cheats;
}
@@ -60,12 +61,13 @@ private:
const TCHAR* _launcherPath = nullptr;
u32 _argumentsLength = 0;
const char* _arguments = nullptr;
const pload_cheats_t* _cheats = nullptr;
pload_cheats_t* _cheats = nullptr;
nds_header_twl_t _romHeader;
DsiWareSaveResult _dsiwareSaveResult;
bool IsCloneBootRom(u32 romOffset);
void ApplyArm7Patches();
void PreprocessCheats();
void SetupSharedMemory(u32 cardId, u32 agbMem, u32 resetParam, u32 romOffset, u32 bootType);
void LoadFirmwareUserSettings();
bool ShouldAttemptDldiPatch();