From ef6913260829173063a8771ac66c79ee9eec83e7 Mon Sep 17 00:00:00 2001 From: GateGuy <57763469+GateGuy@users.noreply.github.com> Date: Sat, 30 May 2020 23:25:18 -0400 Subject: [PATCH 1/4] Press start to leave the ending screen --- levels/ending/script.c | 10 +++++++--- src/game/level_update.c | 7 +++++++ src/game/level_update.h | 1 + src/game/mario_actions_stationary.c | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/levels/ending/script.c b/levels/ending/script.c index ad3d73865..957442484 100644 --- a/levels/ending/script.c +++ b/levels/ending/script.c @@ -16,6 +16,8 @@ #include "make_const_nonconst.h" #include "levels/ending/header.h" +#include "levels/intro/header.h" + const LevelScript level_ending_entry[] = { /*0*/ INIT_LEVEL(), /*1*/ LOAD_MIO0(/*seg*/ 0x07, _ending_segment_7SegmentRomStart, _ending_segment_7SegmentRomEnd), @@ -31,7 +33,9 @@ const LevelScript level_ending_entry[] = { /*12*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00), /*14*/ SLEEP(/*frames*/ 120), /*15*/ CALL(/*arg*/ 0, /*func*/ lvl_play_the_end_screen_sound), - // L1: - /*17*/ SLEEP(/*frames*/ 1), - /*18*/ JUMP(level_ending_entry + 17), + // The following lines were added/altered to allow the player to reset + /*17*/ CALL_LOOP(/*arg*/ 0, /*func*/ credits_end_wait_for_reset), + /*18*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00), + /*19*/ SLEEP(/*frames*/ 120), + /*20*/ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), }; diff --git a/src/game/level_update.c b/src/game/level_update.c index 052959c45..d4483f8dd 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1336,3 +1336,10 @@ s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1) { play_sound(SOUND_MENU_THANK_YOU_PLAYING_MY_GAME, gDefaultSoundArgs); return 1; } + +// Added so the player can reset the game at the end screen +s32 credits_end_wait_for_reset() { + if (gPlayer1Controller->buttonPressed & START_BUTTON) { + return 1; + } +} diff --git a/src/game/level_update.h b/src/game/level_update.h index a6100de2f..58ded2e1f 100644 --- a/src/game/level_update.h +++ b/src/game/level_update.h @@ -125,6 +125,7 @@ s32 lvl_init_or_update(s16 initOrUpdate, s32); s32 lvl_init_from_save_file(s16, s32 levelNum); s32 lvl_set_current_level(s16, s32 levelNum); s32 lvl_play_the_end_screen_sound(s16, s32); +s32 credits_end_wait_for_reset(); #endif diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index 33d2919d3..a0b04078e 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -102,6 +102,9 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) { } s32 act_idle(struct MarioState *m) { + if (m->controller->buttonPressed & L_TRIG) { + level_trigger_warp(m, WARP_OP_CREDITS_END); + } if (m->quicksandDepth > 30.0f) { return set_mario_action(m, ACT_IN_QUICKSAND, 0); } From 9ca143f19b2efd31f0020b16cf1e9dc0807cc937 Mon Sep 17 00:00:00 2001 From: GateGuy <57763469+GateGuy@users.noreply.github.com> Date: Sat, 30 May 2020 23:30:40 -0400 Subject: [PATCH 2/4] Removed my debug "warp to credits" function Forgot to take this out --- src/game/mario_actions_stationary.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index a0b04078e..33d2919d3 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -102,9 +102,6 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) { } s32 act_idle(struct MarioState *m) { - if (m->controller->buttonPressed & L_TRIG) { - level_trigger_warp(m, WARP_OP_CREDITS_END); - } if (m->quicksandDepth > 30.0f) { return set_mario_action(m, ACT_IN_QUICKSAND, 0); } From 5c7e0d3d05fe13c6eba1554681a13e744dc974d2 Mon Sep 17 00:00:00 2001 From: GateGuy <57763469+GateGuy@users.noreply.github.com> Date: Wed, 9 Sep 2020 19:21:49 -0400 Subject: [PATCH 3/4] Fixed premature exit bug It only took three months to change two numbers :^) --- levels/ending/script.c | 2 +- src/game/level_update.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/levels/ending/script.c b/levels/ending/script.c index 957442484..cfc36cd18 100644 --- a/levels/ending/script.c +++ b/levels/ending/script.c @@ -34,7 +34,7 @@ const LevelScript level_ending_entry[] = { /*14*/ SLEEP(/*frames*/ 120), /*15*/ CALL(/*arg*/ 0, /*func*/ lvl_play_the_end_screen_sound), // The following lines were added/altered to allow the player to reset - /*17*/ CALL_LOOP(/*arg*/ 0, /*func*/ credits_end_wait_for_reset), + /*17*/ CALL_LOOP(/*arg*/ 1, /*func*/ credits_end_wait_for_reset), /*18*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00), /*19*/ SLEEP(/*frames*/ 120), /*20*/ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), diff --git a/src/game/level_update.c b/src/game/level_update.c index dc30e2f5c..4c90e6d30 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1331,4 +1331,5 @@ s32 credits_end_wait_for_reset() { if (gPlayer1Controller->buttonPressed & START_BUTTON) { return 1; } + return 0; } From fbb508043fb5ee3e9247325e659567e62c61d7b2 Mon Sep 17 00:00:00 2001 From: GateGuy <57763469+GateGuy@users.noreply.github.com> Date: Wed, 9 Sep 2020 20:00:12 -0400 Subject: [PATCH 4/4] Changed transition from title to Mario face --- levels/ending/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/levels/ending/script.c b/levels/ending/script.c index cfc36cd18..cf75094bb 100644 --- a/levels/ending/script.c +++ b/levels/ending/script.c @@ -37,5 +37,5 @@ const LevelScript level_ending_entry[] = { /*17*/ CALL_LOOP(/*arg*/ 1, /*func*/ credits_end_wait_for_reset), /*18*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00), /*19*/ SLEEP(/*frames*/ 120), - /*20*/ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), + /*20*/ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_2), };