Update documentation for Last Window AP patch (#179)

This commit is contained in:
Mow
2026-05-23 04:18:23 -04:00
committed by GitHub
parent f6c716cb6e
commit e5427291c1
2 changed files with 9 additions and 8 deletions

View File

@@ -11,14 +11,15 @@
/// So the CRC is sensitive not only to code modifications, but also to which encrypted functions
/// were run, and how many times they were run.
///
/// The current DS Protect patch modifies NotA1, causes one of its subfunction to run twice, and
/// The current DS Protect patch modifies NotA1, causes one of its subfunctions to run twice, and
/// the other subfunction to not be run, which obviously breaks the CRC.
///
/// Another region is also CRCed, from 0202DB34 to 02030334. What resides here is unknown, it does not
/// contain any commonly modified functions such as AP or card reading.
/// Another region is also CRCed, from 0202DB34 to 02030334. What resides here is the game functions
/// that are supplied to DS Protect as callbacks. These are left unmodified, but to be sure, the CRC
/// for them is patched anyway.
///
/// To make things more annoying, the memory location of the correct CRC is randomized, and the code
/// that checks the CRC resides in a compressed overlay which is loaded into ITCM. This same function
/// To make things more annoying, the memory locations of the correct CRCs are randomized, and the code
/// that checks the CRCs resides in a compressed overlay which is loaded into ITCM. This same function
/// also receives several dummy checks that are expected to fail, and so cannot be patched to always
/// report the CRC matches.
///

View File

@@ -11,9 +11,9 @@ patch_lastwindowcrc_entry:
cmp r1, r3
beq crc_dsprotect
ldr r3, =0x0202DB34 // CRC of other code region (unknown)
ldr r3, =0x0202DB34 // CRC of DS Protect callbacks
cmp r1, r3
beq crc_unk
beq crc_callback
swi #0xE // Normal CRC if address does not match (never hit?)
bx lr
@@ -22,7 +22,7 @@ crc_dsprotect:
ldr r0, =0x67D7
bx lr
crc_unk:
crc_callback:
ldr r0, =0x0D1E
bx lr