From cb4ea7217a4212e07f4cad550520d3a273c2029d Mon Sep 17 00:00:00 2001 From: Wolfvak Date: Sun, 28 Jul 2019 14:12:24 -0300 Subject: [PATCH] fix entrypoint detection algo (nandboot, #514) --- arm9/source/start.s | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arm9/source/start.s b/arm9/source/start.s index f645035..603c4da 100644 --- a/arm9/source/start.s +++ b/arm9/source/start.s @@ -137,12 +137,14 @@ _start: ldreq pc, =main @ nandboot - @ if ([0x1FFFE010] | [0x1FFFE014]) == 0 + @ if ([0x1FFFE010] | [0x1FFFE014]) != 0 @ && ([0x1FFFE00C] & 0xFF) == 0 ldrd r4, r5, [r3] orrs r4, r4, r5 - ldreqb r4, [r3, #-4] - cmpeq r4, #0 + ldreq pc, =main + + ldrb r4, [r3, #-4] + cmp r4, #0 ldreq r2, =ENTRY_NANDBOOT @ unconditionally branch into the main C function