Further work on support for cheats

Cheats can now be enabled/disabled and games can be launched with cheats
This commit is contained in:
Gericom
2026-02-28 17:00:02 +01:00
parent dddee0bb94
commit f54a379ff2
27 changed files with 660 additions and 171 deletions

View File

@@ -21,6 +21,7 @@ typedef void (*pico_loader_9_func_t)(void);
static pload_params_t sLoadParams;
static char sLauncherPath[256] alignas(32);
static PicoLoaderBootDrive sBootDrive;
static const pload_cheats_t* sCheatData = nullptr;
pload_params_t* pload_getLoadParams()
{
@@ -37,6 +38,11 @@ void pload_setLauncherPath(const char* launcherPath)
StringUtil::Copy(sLauncherPath, launcherPath, sizeof(sLauncherPath));
}
void pload_setCheatData(const pload_cheats_t* cheatData)
{
sCheatData = cheatData;
}
void pload_start()
{
mem_setVramAMapping(MEM_VRAM_AB_LCDC);
@@ -92,6 +98,10 @@ void pload_start()
{
dma_ntrCopy16(3, &sLauncherPath, &header->v2.launcherPath, sizeof(header->v2.launcherPath));
}
if (header->apiVersion >= 3)
{
header->v3.cheats = sCheatData;
}
mem_setVramCMapping(MEM_VRAM_C_ARM7_00000);
mem_setVramDMapping(MEM_VRAM_D_ARM7_20000);
ipc_sendFifoMessage(IPC_CHANNEL_LOADER, 1);