From febea9de73ff450294b310d7fecf85821bf8771d Mon Sep 17 00:00:00 2001 From: root <182859762@qq.com> Date: Sat, 14 Oct 2023 17:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BC=95=E5=85=A5libn3ds?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=85=B3=E6=9C=BA=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E2=80=A6=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libn3ds/source/arm11/debug.c | 13 ++++++++----- source/arm11/open_agb_firm.c | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/libn3ds/source/arm11/debug.c b/libn3ds/source/arm11/debug.c index 3ac8650..94ed325 100644 --- a/libn3ds/source/arm11/debug.c +++ b/libn3ds/source/arm11/debug.c @@ -36,6 +36,7 @@ NOINLINE noreturn void panic(void) { enterCriticalSection(); + GFX_setFramebufFmt(GFX_BGR8, GFX_RGB565); consoleInit(SCREEN_BOT, NULL); ee_printf("\x1b[41m\x1b[0J\x1b[15C****PANIC!!!****\n"); @@ -44,7 +45,7 @@ NOINLINE noreturn void panic(void) // Wait for A/B/X or Y while(!(REG_HID_PAD & (KEY_A | KEY_B | KEY_X | KEY_Y))); - MCU_powerOffSys(); + MCU_sysPowerOff(); while(1) __wfi(); } @@ -52,6 +53,7 @@ NOINLINE noreturn void panicMsg(const char *msg) { enterCriticalSection(); + GFX_setFramebufFmt(GFX_BGR8, GFX_RGB565); consoleInit(SCREEN_BOT, NULL); ee_printf("\x1b[41m\x1b[0J\x1b[15C****PANIC!!!****\n\n"); ee_printf("\nERROR MESSAGE:\n%s\n", msg); @@ -61,7 +63,7 @@ NOINLINE noreturn void panicMsg(const char *msg) // Wait for A/B/X or Y while(!(REG_HID_PAD & (KEY_A | KEY_B | KEY_X | KEY_Y))); - MCU_powerOffSys(); + MCU_sysPowerOff(); while(1) __wfi(); } @@ -72,6 +74,7 @@ NOINLINE noreturn void guruMeditation(u8 type, const u32 *excStack) const char *const typeStr[3] = {"Undefined instruction", "Prefetch abort", "Data abort"}; u32 realPc, instSize = 4; + GFX_setFramebufFmt(GFX_BGR8, GFX_RGB565); consoleInit(SCREEN_BOT, NULL); if(excStack[16] & 0x20) instSize = 2; // Processor was in Thumb mode? @@ -96,9 +99,9 @@ NOINLINE noreturn void guruMeditation(u8 type, const u32 *excStack) ee_puts("Stack dump:"); u32 sp = excStack[13]; - if(sp >= AXIWRAM_BASE && sp < AXIWRAM_BASE + AXIWRAM_SIZE && !(sp & 3u)) + if(sp >= AXI_RAM_BASE && sp < AXI_RAM_BASE + AXI_RAM_SIZE && !(sp & 3u)) { - u32 stackWords = ((AXIWRAM_BASE + AXIWRAM_SIZE - sp) / 4 > 48 ? 48 : (AXIWRAM_BASE + AXIWRAM_SIZE - sp) / 4); + u32 stackWords = ((AXI_RAM_BASE + AXI_RAM_SIZE - sp) / 4 > 48 ? 48 : (AXI_RAM_BASE + AXI_RAM_SIZE - sp) / 4); u32 newlineCounter = 0; for(u32 i = 0; i < stackWords; i++) @@ -114,7 +117,7 @@ NOINLINE noreturn void guruMeditation(u8 type, const u32 *excStack) // Wait for A/B/X or Y while(!(REG_HID_PAD & (KEY_A | KEY_B | KEY_X | KEY_Y))); - MCU_powerOffSys(); + MCU_sysPowerOff(); while(1) __wfi(); } diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index fd50447..ce9c9f5 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -1045,12 +1045,12 @@ void oafUpdate(void) void oafFinish(void) { LGYFB_deinit(); - if(g_frameReadyEvent != 0) - { - deleteEvent(g_frameReadyEvent); // gbaGfxHandler() will automatically terminate. - g_frameReadyEvent = 0; - } // @MERGE 231006 START + // if(g_frameReadyEvent != 0) + // { + // deleteEvent(g_frameReadyEvent); // gbaGfxHandler() will automatically terminate. + // } + g_frameReadyEvent = 0; LGY11_deinit(); // @MERGE 231006 END }