diff --git a/source/arm9/debug.c b/source/arm9/debug.c index 45d5431..9cdf9ba 100644 --- a/source/arm9/debug.c +++ b/source/arm9/debug.c @@ -3,6 +3,7 @@ #include "types.h" #include "mem_map.h" #include "console.h" +#include "mpu.h" @@ -25,9 +26,12 @@ void NORETURN panic() { + volatile register lr; + + disableMpu(); consoleInit(0, NULL); - printf("\x1b[41m\x1b[0J\x1b[9CGPANIC!!!\n"); + printf("\x1b[41m\x1b[0J\x1b[9CGPANIC!!!\n\nlr = 0x%08"PRIX32"\n", lr); unmount_fs(); devs_close(); @@ -47,6 +51,8 @@ exceptionTriggered = true; + disableMpu(); + // verify text and rodata u32 prevHash = debugHash; hashCodeRoData();