Added check to CardiTaskThreadPatch that the required slot is actually mapped to arm7. Fixes #60

This commit is contained in:
Gericom
2025-12-27 12:44:00 +01:00
parent 8036004e5a
commit 64e020182a
18 changed files with 95 additions and 42 deletions

View File

@@ -133,6 +133,16 @@ void CardiTaskThreadPatch::ApplyPatch(PatchContext& patchContext)
__patch_carditaskthread_readsave_asm_address = (u32)readSavePatchCode->GetReadSaveFunction();
__patch_carditaskthread_writesave_asm_address = (u32)writeSavePatchCode->GetWriteSaveFunction();
__patch_carditaskthread_verifysave_asm_address = (u32)verifySavePatchCode->GetVerifySaveFunction();
if (loaderPlatform->GetPlatformType() == LoaderPlatformType::Slot1)
{
// Test REG_EXMEMSTAT bit 11
__patch_carditaskthread_lsls_exmemstat_bit_to_r1 = THUMB_LSLS_IMM(THUMB_R1, THUMB_R1, 31 - 11);
}
else
{
// Test REG_EXMEMSTAT bit 7
__patch_carditaskthread_lsls_exmemstat_bit_to_r1 = THUMB_LSLS_IMM(THUMB_R1, THUMB_R1, 31 - 7);
}
if (_patchVariant >= PatchVariant::ThumbA)
{