diff --git a/source/arm9/debug.c b/source/arm9/debug.c index ebafa10..8e533a9 100644 --- a/source/arm9/debug.c +++ b/source/arm9/debug.c @@ -24,6 +24,8 @@ #include "fatfs/ff.h" #include "fsutils.h" #include "arm9/hardware/interrupt.h" +#include "hardware/gfx.h" +#include "arm9/hardware/ndma.h" static u32 debugHash = 0; @@ -57,7 +59,12 @@ //PXI_sendWord(PXI_CMD_ALLOW_POWER_OFF); - while(1) __wfi(); + while(1) + { + const u32 color = RGB8_to_565(255, 0, 0)<<16 | RGB8_to_565(255, 0, 0); + NDMA_fill((u32*)FRAMEBUF_SUB_A_1, color, SCREEN_SIZE_SUB); + NDMA_fill((u32*)FRAMEBUF_SUB_A_2, color, SCREEN_SIZE_SUB); + } } noreturn void panicMsg(const char *msg) @@ -74,7 +81,12 @@ //PXI_sendWord(PXI_CMD_ALLOW_POWER_OFF); - while(1) __wfi(); + while(1) + { + const u32 color = RGB8_to_565(255, 0, 0)<<16 | RGB8_to_565(255, 0, 0); + NDMA_fill((u32*)FRAMEBUF_SUB_A_1, color, SCREEN_SIZE_SUB); + NDMA_fill((u32*)FRAMEBUF_SUB_A_2, color, SCREEN_SIZE_SUB); + } } // Expects the registers in the exception stack to be in the following order: diff --git a/source/fb_assert.c b/source/fb_assert.c index e80b38c..f81689e 100644 --- a/source/fb_assert.c +++ b/source/fb_assert.c @@ -19,15 +19,19 @@ #include "types.h" #ifdef ARM9 #include "arm9/hardware/interrupt.h" + #include "arm9/hardware/ndma.h" #elif ARM11 #include "arm11/fmt.h" #include "arm11/hardware/interrupt.h" #endif +#include "hardware/gfx.h" noreturn void __fb_assert(const char *const str, u32 line) { + enterCriticalSection(); + #ifdef ARM9 // Get rid of the warnings. (void)str; @@ -36,6 +40,14 @@ ee_printf("Assertion failed: %s:%" PRIu32, str, line); #endif - enterCriticalSection(); - while(1) __wfi(); + while(1) + { +#ifdef ARM9 + const u32 color = RGB8_to_565(0, 0, 255)<<16 | RGB8_to_565(0, 0, 255); + NDMA_fill((u32*)FRAMEBUF_SUB_A_1, color, SCREEN_SIZE_SUB); + NDMA_fill((u32*)FRAMEBUF_SUB_A_2, color, SCREEN_SIZE_SUB); +#elif ARM11 + __wfi(); +#endif + } }