From fa13b8fbd05df2a84aa6858b84db41fc35f4be8b Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 10 Oct 2016 02:19:15 +0200 Subject: [PATCH] Fix derp --- source/exceptions.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/exceptions.c b/source/exceptions.c index 48b1828..bd097d1 100644 --- a/source/exceptions.c +++ b/source/exceptions.c @@ -47,19 +47,17 @@ void installArm9Handlers(void) u32 installArm11Handlers(u32 *exceptionsPage, u32 stackAddress, u32 codeSetOffset) { - u32 ret = 0; - u32 *initFPU; for(initFPU = exceptionsPage; initFPU < exceptionsPage + 0x400 && (initFPU[0] != 0xE59F0008 || initFPU[1] != 0xE5900000); initFPU++); - if(initFPU == exceptionsPage + 0x400) ret = 1; u32 *freeSpace; for(freeSpace = initFPU; freeSpace < exceptionsPage + 0x400 && (freeSpace[0] != 0xFFFFFFFF || freeSpace[1] != 0xFFFFFFFF); freeSpace++); - if(initFPU == exceptionsPage + 0x400) ret = 1; u32 *mcuReboot; for(mcuReboot = exceptionsPage; mcuReboot < exceptionsPage + 0x400 && (mcuReboot[0] != 0xE59F4104 || mcuReboot[1] != 0xE3A0A0C2); mcuReboot++); - if(initFPU == exceptionsPage + 0x400) ret = 1; + + u32 ret = (initFPU == exceptionsPage + 0x400 || freeSpace == exceptionsPage + 0x400 || mcuReboot == exceptionsPage + 0x400) ? 1 : 0; + mcuReboot--; memcpy(freeSpace, arm11_exceptions_bin + 32, arm11_exceptions_bin_size - 32);