From a279c7db285ec992e59548be37a9641f712cee67 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Fri, 9 Dec 2022 18:47:55 +0100 Subject: [PATCH 1/5] gold skull text options --- assets/text/fra_message_data_static.c | 2 ++ assets/text/ger_message_data_static.c | 2 ++ assets/text/nes_message_data_static.c | 2 ++ assets/text/staff_message_data_static.c | 2 ++ extract_assets.py | 1 + include/config/config_debug.h | 6 ++--- include/config/config_debug_toggles.h | 2 +- include/config/config_game.h | 12 +++++++++- include/message_data_static.h | 2 ++ src/boot/z_std_dma.c | 5 ---- src/code/z_message_PAL.c | 4 ++++ src/code/z_sram.c | 5 ++++ src/overlays/actors/ovl_En_Si/z_en_si.c | 10 ++++++++ tools/msgdis.py | 31 ++++++++++++++++++++++--- 14 files changed, 73 insertions(+), 13 deletions(-) diff --git a/assets/text/fra_message_data_static.c b/assets/text/fra_message_data_static.c index abad26c54..d59da9925 100644 --- a/assets/text/fra_message_data_static.c +++ b/assets/text/fra_message_data_static.c @@ -2,6 +2,8 @@ #include "message_data_fmt.h" +#include "config.h" + #define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) \ const char _message_##textId##_fra[sizeof(fraMessage)] = { fraMessage END }; diff --git a/assets/text/ger_message_data_static.c b/assets/text/ger_message_data_static.c index c4b8229a0..017e1d238 100644 --- a/assets/text/ger_message_data_static.c +++ b/assets/text/ger_message_data_static.c @@ -2,6 +2,8 @@ #include "message_data_fmt.h" +#include "config.h" + #define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) \ const char _message_##textId##_ger[sizeof(gerMessage)] = { gerMessage END }; diff --git a/assets/text/nes_message_data_static.c b/assets/text/nes_message_data_static.c index 2c37692d2..e3119d238 100644 --- a/assets/text/nes_message_data_static.c +++ b/assets/text/nes_message_data_static.c @@ -2,6 +2,8 @@ #include "message_data_fmt.h" +#include "config.h" + #define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) \ const char _message_##textId##_nes[sizeof(nesMessage)] = { nesMessage END }; diff --git a/assets/text/staff_message_data_static.c b/assets/text/staff_message_data_static.c index 5ad50b044..c9b925471 100644 --- a/assets/text/staff_message_data_static.c +++ b/assets/text/staff_message_data_static.c @@ -2,6 +2,8 @@ #include "message_data_fmt.h" +#include "config.h" + #define DEFINE_MESSAGE(textId, type, yPos, staffMessage) \ const char _message_##textId##_staff[sizeof(staffMessage)] = { staffMessage END }; diff --git a/extract_assets.py b/extract_assets.py index 5c9658d22..6b216909c 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -169,3 +169,4 @@ def main(): if __name__ == "__main__": main() + os.system("python3 tools/daf/daf.py -a -p ./") diff --git a/include/config/config_debug.h b/include/config/config_debug.h index 827b07271..dad8206ee 100644 --- a/include/config/config_debug.h +++ b/include/config/config_debug.h @@ -26,18 +26,18 @@ /** * Options for booting directly into a scene, the map select or the file select, instead of the title screen. */ -// #define BOOT_TO_SCENE +#define BOOT_TO_SCENE // #define BOOT_TO_SCENE_NEW_GAME_ONLY // #define BOOT_TO_FILE_SELECT // #define BOOT_TO_MAP_SELECT // Change these if using `BOOT_TO_SCENE`, `BOOT_TO_SCENE_NEW_GAME_ONLY` or `BOOT_TO_MAP_SELECT` -#define BOOT_ENTRANCE ENTR_DEKU_TREE_0 +#define BOOT_ENTRANCE ENTR_KOKIRI_FOREST_0 #define BOOT_AGE LINK_AGE_CHILD #define BOOT_CUTSCENE 0x0000 // Change these if using `BOOT_TO_SCENE` or `BOOT_TO_SCENE_NEW_GAME_ONLY` -#define BOOT_TIME NEXT_TIME_NONE +#define BOOT_TIME NEXT_TIME_NIGHT #define BOOT_PLAYER_NAME 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E // "LINK" /** diff --git a/include/config/config_debug_toggles.h b/include/config/config_debug_toggles.h index 287d0980f..0031f44c1 100644 --- a/include/config/config_debug_toggles.h +++ b/include/config/config_debug_toggles.h @@ -34,7 +34,7 @@ /**** [FRAMERATE OPTIONS] ****/ // TODO: check for frame advance for drawing, improve how it works -#define ENABLE_FRAMERATE_OPTIONS +// #define ENABLE_FRAMERATE_OPTIONS /**** [MAP SELECT] ****/ // #define ENABLE_MAP_SELECT diff --git a/include/config/config_game.h b/include/config/config_game.h index 1f0f49e42..af6e6f151 100644 --- a/include/config/config_game.h +++ b/include/config/config_game.h @@ -23,7 +23,7 @@ /** * Enable fast text */ -#define ENABLE_FAST_TEXT +// #define ENABLE_FAST_TEXT /** * Splits Farore's Wind warp point across ages. One point for child Link, one point for adult Link. @@ -33,5 +33,15 @@ /* Apply the anti-aliasing filter for the background of the pause menu. This adds a delay when pausing. */ //#define VANILLA_PAUSE_DELAY +/** + * Disable Player froze when getting a Gold Skulltula Token +*/ +#define DISABLE_GS_TOKEN_FREEZE + +/** + * Add Gold Skulltula count to the textbox +*/ +#define GS_COUNT_IN_TEXT + #endif diff --git a/include/message_data_static.h b/include/message_data_static.h index b80320382..ffe11cc10 100644 --- a/include/message_data_static.h +++ b/include/message_data_static.h @@ -4,6 +4,8 @@ #include "global.h" #include "message_data_fmt.h" +#include "config.h" + typedef enum { /* 0 */ TEXTBOX_TYPE_BLACK, /* 1 */ TEXTBOX_TYPE_WOODEN, diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 3b6320b85..faef6e1c2 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -534,11 +534,6 @@ void DmaMgr_Init(void) { sDmaMgrIsRomCompressed = true; } - osSyncPrintf( - "%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->vromStart, iter->vromEnd, iter->romStart, iter->romEnd, - (iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart, - (((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', name ? *name : ""); - idx++; iter++; diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 6a6436e4f..326af582a 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -3202,7 +3202,11 @@ void Message_Update(PlayState* play) { break; case MSGMODE_TEXT_NEXT_MSG: Message_Decode(play); +#ifdef DISABLE_GS_TOKEN_FREEZE + if (sTextFade && (msgCtx->textId != 0xB4) && (msgCtx->textId != 0xB5)) { +#else if (sTextFade) { +#endif Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } if (D_80153D74 != 0) { diff --git a/src/code/z_sram.c b/src/code/z_sram.c index d2ff086a7..cfd58f4dc 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -789,7 +789,12 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { u16 checksum; #if (defined BOOT_TO_SCENE || defined BOOT_TO_FILE_SELECT) + +#ifdef ENABLE_DEBUG_SAVE + Sram_InitDebugSave(); +#else Sram_InitNewSave(); +#endif gSaveContext.entranceIndex = BOOT_ENTRANCE; gSaveContext.linkAge = BOOT_AGE; diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 5638706f8..75993ad77 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -6,6 +6,8 @@ #include "z_en_si.h" +#include "config.h" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_9) void EnSi_Init(Actor* thisx, PlayState* play); @@ -93,7 +95,9 @@ void func_80AFB768(EnSi* this, PlayState* play) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; Item_Give(play, ITEM_SKULL_TOKEN); +#ifndef DISABLE_GS_TOKEN_FREEZE player->actor.freezeTimer = 10; +#endif Message_StartTextbox(play, 0xB4, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; @@ -115,7 +119,9 @@ void func_80AFB89C(EnSi* this, PlayState* play) { if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { Item_Give(play, ITEM_SKULL_TOKEN); +#ifndef DISABLE_GS_TOKEN_FREEZE player->actor.freezeTimer = 10; +#endif Message_StartTextbox(play, 0xB4, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; @@ -125,12 +131,16 @@ void func_80AFB89C(EnSi* this, PlayState* play) { void func_80AFB950(EnSi* this, PlayState* play) { Player* player = GET_PLAYER(play); +#ifndef DISABLE_GS_TOKEN_FREEZE if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { +#endif SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); Actor_Kill(&this->actor); +#ifndef DISABLE_GS_TOKEN_FREEZE } +#endif } void EnSi_Update(Actor* thisx, PlayState* play) { diff --git a/tools/msgdis.py b/tools/msgdis.py index 95b1a3470..78a8b5207 100644 --- a/tools/msgdis.py +++ b/tools/msgdis.py @@ -380,15 +380,40 @@ def extract_all_text(text_out, staff_text_out): if message[0] == 0xFFFC: out += "#ifdef DEFINE_MESSAGE_FFFC\n" + out += f"DEFINE_MESSAGE(0x{message[0]:04X}, {textbox_type[message[1]]}, {textbox_ypos[message[2]]}," out += "\n" - out += f"{message[3]}" + ("\n" if message[3] != "" else "") + "," + + if message[0] in [0x00B4, 0x00B5]: + out += "#ifndef GS_COUNT_IN_TEXT\n" + + tokenFreezeMode = ( + "#ifdef DISABLE_GS_TOKEN_FREEZE\n" + + "FADE(\"\\x50\")\n" + + "#endif\n" + ) if message[0] in [0x00B4, 0x00B5] else "" + + out += f"{message[3]}" + ("\n" if message[3] != "" else "") + f"{tokenFreezeMode}," out += "\n" if message[3] != "" else "" - out += f"{message[4]}" + ("\n" if message[4] != "" else "") + "," + out += f"{message[4]}" + ("\n" if message[4] != "" else "") + f"{tokenFreezeMode}," out += "\n" if message[4] != "" else "" - out += f"{message[5]}\n)" + out += f"{message[5]}\n" + tokenFreezeMode + + if message[0] in [0x00B4, 0x00B5]: + out += "#else\n" + out += "\"You got a \" COLOR(RED) \"Gold Skulltula Token\" COLOR(DEFAULT) \"!\\n\"\n" + out += f"\"You've collected \" COLOR(RED) TOKENS COLOR(DEFAULT) \" tokens in total.\"\n{tokenFreezeMode},\n" + out += "\"Du hast eine \" COLOR(RED) \"Goldene Skulltula\" COLOR(DEFAULT) \" zerstört!\\n\"\n" + out += f"\"Sie haben insgesamt \" COLOR(RED) TOKENS COLOR(DEFAULT) \" gesammelt.\"\n{tokenFreezeMode},\n" + out += "\"Vous venez de détruire une \" COLOR(RED) \"Skulltula d'or\" COLOR(DEFAULT) \"!\\n\"\n" + out += f"\"Vous en avez désormais \" COLOR(RED) TOKENS COLOR(DEFAULT) \".\"\n{tokenFreezeMode}" + out += "#endif\n" + + out += ")" + if message[0] == 0xFFFC: out += "\n#endif" + out += "\n\n" with open(text_out, "w") as outfile: From 29fe03ef7dd9ca0fc6b8139e2513df6978934b74 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Fri, 9 Dec 2022 18:53:46 +0100 Subject: [PATCH 2/5] revert testing changes --- include/config/config_debug.h | 6 +++--- src/code/z_sram.c | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/config/config_debug.h b/include/config/config_debug.h index dad8206ee..827b07271 100644 --- a/include/config/config_debug.h +++ b/include/config/config_debug.h @@ -26,18 +26,18 @@ /** * Options for booting directly into a scene, the map select or the file select, instead of the title screen. */ -#define BOOT_TO_SCENE +// #define BOOT_TO_SCENE // #define BOOT_TO_SCENE_NEW_GAME_ONLY // #define BOOT_TO_FILE_SELECT // #define BOOT_TO_MAP_SELECT // Change these if using `BOOT_TO_SCENE`, `BOOT_TO_SCENE_NEW_GAME_ONLY` or `BOOT_TO_MAP_SELECT` -#define BOOT_ENTRANCE ENTR_KOKIRI_FOREST_0 +#define BOOT_ENTRANCE ENTR_DEKU_TREE_0 #define BOOT_AGE LINK_AGE_CHILD #define BOOT_CUTSCENE 0x0000 // Change these if using `BOOT_TO_SCENE` or `BOOT_TO_SCENE_NEW_GAME_ONLY` -#define BOOT_TIME NEXT_TIME_NIGHT +#define BOOT_TIME NEXT_TIME_NONE #define BOOT_PLAYER_NAME 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E // "LINK" /** diff --git a/src/code/z_sram.c b/src/code/z_sram.c index cfd58f4dc..d2ff086a7 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -789,12 +789,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { u16 checksum; #if (defined BOOT_TO_SCENE || defined BOOT_TO_FILE_SELECT) - -#ifdef ENABLE_DEBUG_SAVE - Sram_InitDebugSave(); -#else Sram_InitNewSave(); -#endif gSaveContext.entranceIndex = BOOT_ENTRANCE; gSaveContext.linkAge = BOOT_AGE; From 79b83cfc7bb574285466d146c2dd654b16b00343 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:32:48 +0100 Subject: [PATCH 3/5] adjusted textbox delay for token --- tools/msgdis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msgdis.py b/tools/msgdis.py index 78a8b5207..f924d2ca4 100644 --- a/tools/msgdis.py +++ b/tools/msgdis.py @@ -389,7 +389,7 @@ def extract_all_text(text_out, staff_text_out): tokenFreezeMode = ( "#ifdef DISABLE_GS_TOKEN_FREEZE\n" - + "FADE(\"\\x50\")\n" + + "FADE(\"\\x20\")\n" + "#endif\n" ) if message[0] in [0x00B4, 0x00B5] else "" From ea77d7a1641ea865a1bcb47b89150f5eb996aea8 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Sat, 10 Dec 2022 14:17:06 +0100 Subject: [PATCH 4/5] add annoying glitch fixes --- include/config/config_game.h | 6 ++++++ src/code/z_actor.c | 6 ++++++ src/code/z_parameter.c | 3 +++ src/overlays/actors/ovl_Item_Shield/z_item_shield.c | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/include/config/config_game.h b/include/config/config_game.h index af6e6f151..abc6c6113 100644 --- a/include/config/config_game.h +++ b/include/config/config_game.h @@ -5,6 +5,12 @@ * GAME SETTINGS * *****************/ +// Fix annoying glitches (crashes and softlocks) +#define FIX_ANNOYING_GLITCH + +// Add a fix for the Stale Reference Manipulation glitch (OoT's Pandora's Box) +#define FIX_SRM + // Configure dialogue print speed (1 is vanilla) #define DIALOGUE_PRINT_SPEED 2 diff --git a/src/code/z_actor.c b/src/code/z_actor.c index b27eb0132..2f219cea4 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2927,6 +2927,12 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { Actor_FreeOverlay(overlayEntry); } +#ifdef FIX_SRM + // this is required to avoid having actor data still loaded in RAM after it's supposed to be deleted + // see func_80031B14 + Actor_Kill(actor); +#endif + return newHead; } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 886987e8c..90e8f7944 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1813,9 +1813,12 @@ u8 Item_Give(PlayState* play, u8 item) { } } } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { +#ifndef FIX_ANNOYING_GLITCH + // this conflicts with the flag used for the deku nut upgrade from the theater if (item == ITEM_POACHERS_SAW) { SET_ITEMGETINF(ITEMGETINF_1F); } +#endif temp = INV_CONTENT(item); INV_CONTENT(item) = item; diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index c6accb49a..7580c72f6 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -8,6 +8,8 @@ #include "z_item_shield.h" #include "assets/objects/object_link_child/object_link_child.h" +#include "config.h" + #define FLAGS ACTOR_FLAG_4 void ItemShield_Init(Actor* thisx, PlayState* play); @@ -219,6 +221,9 @@ void ItemShield_Draw(Actor* thisx, PlayState* play) { if (!(this->unk_19C & 2)) { OPEN_DISPS(play->state.gfxCtx, "../z_item_shield.c", 457); +#ifdef FIX_ANNOYING_GLITCH + gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); +#endif Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_item_shield.c", 460), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); From c85eb46538ef759e0d591872038d32a76cacc071 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:27:40 +0100 Subject: [PATCH 5/5] annoying autoscroll pepega --- include/config/config_debug.h | 5 +++++ include/fault.h | 4 ++++ src/code/fault.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/include/config/config_debug.h b/include/config/config_debug.h index 827b07271..d6fbed9fd 100644 --- a/include/config/config_debug.h +++ b/include/config/config_debug.h @@ -60,6 +60,11 @@ */ // #define DISABLE_DEBUG_FEATURES +/** + * Disable autoscroll on crash debugger +*/ +#define DISABLE_CRASH_DBG_AUTOSCROLL + // ------------------------------------------- // TODO: find a better way to do that diff --git a/include/fault.h b/include/fault.h index 511d3516f..cc3211102 100644 --- a/include/fault.h +++ b/include/fault.h @@ -4,6 +4,8 @@ #include "ultra64.h" #include "padmgr.h" +#include "config.h" + // These are the same as the 3-bit ansi color codes #define FAULT_COLOR_BLACK 0 #define FAULT_COLOR_RED 1 @@ -76,7 +78,9 @@ typedef struct FaultMgr { /* 0x7CC */ u8 exit; /* 0x7CD */ u8 msgId; /* 0x7CE */ u8 faultHandlerEnabled; +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL /* 0x7CF */ u8 autoScroll; +#endif /* 0x7D0 */ OSThread* faultedThread; /* 0x7D4 */ void (*padCallback)(Input* inputs); /* 0x7D8 */ FaultClient* clients; diff --git a/src/code/fault.c b/src/code/fault.c index 04c992393..93b1b2352 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -44,6 +44,8 @@ #include "terminal.h" #include "alloca.h" +#include "config.h" + void FaultDrawer_Init(void); void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled); void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color); @@ -382,15 +384,19 @@ u32 Fault_WaitForInputImpl(void) { pressedBtn = input->press.button; +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL if (pressedBtn == BTN_L) { sFaultInstance->autoScroll = !sFaultInstance->autoScroll; } +#endif +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL if (sFaultInstance->autoScroll) { if (count-- < 1) { return false; } } else { +#endif if (pressedBtn == BTN_A || pressedBtn == BTN_DRIGHT) { return false; } @@ -406,7 +412,9 @@ u32 Fault_WaitForInputImpl(void) { if (pressedBtn == BTN_DDOWN) { FaultDrawer_SetOsSyncPrintfEnabled(false); } +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL } +#endif } } @@ -638,7 +646,9 @@ void Fault_Wait5Seconds(void) { Fault_Sleep(1000 / 60); } while ((osGetTime() - start) < OS_SEC_TO_CYCLES(5) + 1); +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL sFaultInstance->autoScroll = true; +#endif } void Fault_DrawMemDumpContents(const char* title, uintptr_t addr, u32 arg2) { @@ -720,6 +730,7 @@ void Fault_DrawMemDump(uintptr_t pc, uintptr_t sp, uintptr_t cLeftJump, uintptr_ Fault_DrawMemDumpContents("Dump", addr, 0); scrollCountdown = 600; +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL while (sFaultInstance->autoScroll) { // Count down until it's time to move on to the next page if (scrollCountdown == 0) { @@ -734,6 +745,7 @@ void Fault_DrawMemDump(uintptr_t pc, uintptr_t sp, uintptr_t cLeftJump, uintptr_ sFaultInstance->autoScroll = false; } } +#endif // Wait for input do { @@ -777,8 +789,10 @@ void Fault_DrawMemDump(uintptr_t pc, uintptr_t sp, uintptr_t cLeftJump, uintptr_ } } while (!CHECK_BTN_ALL(input->press.button, BTN_L)); +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL // Resume auto-scroll and move to next page sFaultInstance->autoScroll = true; +#endif } /** @@ -1047,15 +1061,21 @@ void Fault_ThreadEntry(void* arg) { // Show fault framebuffer Fault_DisplayFrameBuffer(); +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL if (sFaultInstance->autoScroll) { Fault_Wait5Seconds(); } else { +#endif // Draw error bar signifying the crash screen is available Fault_DrawCornerRec(GPACK_RGBA5551(255, 0, 0, 1)); +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL } +#endif +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL // Set auto-scrolling and default colors sFaultInstance->autoScroll = true; +#endif FaultDrawer_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); FaultDrawer_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); @@ -1106,7 +1126,9 @@ void Fault_Init(void) { sFaultInstance->faultedThread = NULL; sFaultInstance->padCallback = Fault_PadCallback; sFaultInstance->clients = NULL; +#ifndef DISABLE_CRASH_DBG_AUTOSCROLL sFaultInstance->autoScroll = false; +#endif gFaultMgr.faultHandlerEnabled = true; osCreateMesgQueue(&sFaultInstance->queue, &sFaultInstance->msg, 1); StackCheck_Init(&sFaultThreadInfo, sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault");