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];