From 4080f7fcd56d3098c5f65d088c57d8cba52139c8 Mon Sep 17 00:00:00 2001 From: DorfDork <60723914+DorfDork@users.noreply.github.com> Date: Sun, 7 Jun 2026 11:45:29 -0500 Subject: [PATCH] Fix for Press Start graphic from overflowing and restore file select accessibility A pr which allows file select to work as intended as well as the press start graphic from overflowing. From my conversation with Peachy these types of changes are fine and nonintrusive to the player experience. If a mod creator wants to access this then they can explicitly declare in their respective mods. --- levels/intro/script.c | 6 ++---- src/game/print.c | 10 +++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/levels/intro/script.c b/levels/intro/script.c index f5fcbfb1b..a130cc04e 100644 --- a/levels/intro/script.c +++ b/levels/intro/script.c @@ -63,8 +63,7 @@ const LevelScript level_intro_mario_head_regular[] = { TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), SLEEP(/*frames*/ 20), CALL_LOOP(/*arg*/ 1, /*func*/ lvl_intro_update), - // JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L4), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1), JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2), JUMP(script_intro_L4), }; @@ -89,8 +88,7 @@ const LevelScript level_intro_mario_head_dizzy[] = { TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), SLEEP(/*frames*/ 20), CALL_LOOP(/*arg*/ 2, /*func*/ lvl_intro_update), - // JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L4), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1), JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2), JUMP(script_intro_L4), }; diff --git a/src/game/print.c b/src/game/print.c index b7c34cc19..2b748f755 100644 --- a/src/game/print.c +++ b/src/game/print.c @@ -24,6 +24,7 @@ struct TextLabel { * Stores the text to be rendered on screen * and how they are to be rendered. */ +static struct TextLabel sTextLabelStorage[256]; struct TextLabel *sTextLabels[256]; s16 sTextLabelsCount = 0; @@ -178,9 +179,10 @@ void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) { + if (sTextLabelsCount >= 256) { return; } + sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount]; sTextLabels[sTextLabelsCount]->x = x; sTextLabels[sTextLabelsCount]->y = y; @@ -228,9 +230,10 @@ void print_text(s32 x, s32 y, const char *str) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) { + if (sTextLabelsCount >= 256) { return; } + sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount]; sTextLabels[sTextLabelsCount]->x = x; sTextLabels[sTextLabelsCount]->y = y; @@ -260,9 +263,10 @@ void print_text_centered(s32 x, s32 y, const char *str) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) { + if (sTextLabelsCount >= 256) { return; } + sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount]; c = str[srcIndex];