This commit is contained in:
Mips96 2023-12-21 06:02:30 -07:00 committed by GitHub
commit 780c840d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View File

@ -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*/ 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_2),
};

View File

@ -1325,3 +1325,11 @@ 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;
}
return 0;
}

View File

@ -123,10 +123,12 @@ void load_level_init_text(u32 arg);
s16 level_trigger_warp(struct MarioState *m, s32 warpOp);
void level_set_transition(s16 length, void (*updateFunction)(s16 *));
s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused);
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum);
s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum);
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1);
s32 credits_end_wait_for_reset();
void basic_update(UNUSED s16 *arg);
#endif // LEVEL_UPDATE_H