Add define for debug level selector, add defines for disabling menu music.

Disable the start intro when loading in a new game.
This commit is contained in:
kelson8 2025-01-23 00:26:05 -05:00
parent b5738c5a91
commit 550e055be5
4 changed files with 41 additions and 1 deletions

View File

@ -18,6 +18,10 @@
#include "make_const_nonconst.h" #include "make_const_nonconst.h"
#include "levels/intro/header.h" #include "levels/intro/header.h"
// Enable the debug level selector.
// TODO Figure out how to add to the games menu and switch to this, it should be possible.
// #define _LEVEL_SELECTOR
const LevelScript level_intro_entry_1[] = { const LevelScript level_intro_entry_1[] = {
INIT_LEVEL(), INIT_LEVEL(),
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
@ -37,7 +41,12 @@ const LevelScript level_intro_entry_1[] = {
CMD2A(/*unk2*/ 1), CMD2A(/*unk2*/ 1),
CLEAR_LEVEL(), CLEAR_LEVEL(),
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
#ifdef _LEVEL_SELECTOR //Level selector patch
EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_4),
#else
EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_2), EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_2),
#endif //_LEVEL_SELECTOR
}; };
const LevelScript level_intro_entry_2[] = { const LevelScript level_intro_entry_2[] = {
@ -56,6 +65,7 @@ const LevelScript level_intro_entry_2[] = {
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
BLACKOUT(/*active*/ FALSE), BLACKOUT(/*active*/ FALSE),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0002), SET_MENU_MUSIC(/*seq*/ 0x0002),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20), SLEEP(/*frames*/ 20),
@ -81,6 +91,7 @@ const LevelScript level_intro_entry_3[] = {
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
BLACKOUT(/*active*/ FALSE), BLACKOUT(/*active*/ FALSE),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0082), SET_MENU_MUSIC(/*seq*/ 0x0082),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20), SLEEP(/*frames*/ 20),
@ -103,6 +114,7 @@ const LevelScript level_intro_entry_4[] = {
FREE_LEVEL_POOL(), FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0002), SET_MENU_MUSIC(/*seq*/ 0x0002),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
SLEEP(/*frames*/ 16), SLEEP(/*frames*/ 16),

View File

@ -3,12 +3,22 @@
#include "types.h" #include "types.h"
// Enable my custom menus, I don't know how to use these yet.
// #define _CUSTOM_CODE
// Disables the menu music
// #define _DISABLE_MENU_MUSIC
// geo // geo
extern const GeoLayout geo_menu_mario_save_button[]; extern const GeoLayout geo_menu_mario_save_button[];
extern const GeoLayout geo_menu_mario_save_button_fade[]; extern const GeoLayout geo_menu_mario_save_button_fade[];
extern const GeoLayout geo_menu_mario_new_button[]; extern const GeoLayout geo_menu_mario_new_button[];
extern const GeoLayout geo_menu_mario_new_button_fade[]; extern const GeoLayout geo_menu_mario_new_button_fade[];
extern const GeoLayout geo_menu_erase_button[]; extern const GeoLayout geo_menu_erase_button[];
#ifdef _CUSTOM_CODE
extern const GeoLayout geo_menu_custom_button[];
#endif //_CUSTOM_CODE
extern const GeoLayout geo_menu_copy_button[]; extern const GeoLayout geo_menu_copy_button[];
extern const GeoLayout geo_menu_file_button[]; extern const GeoLayout geo_menu_file_button[];
extern const GeoLayout geo_menu_score_button[]; extern const GeoLayout geo_menu_score_button[];

View File

@ -35,6 +35,13 @@ const LevelScript level_main_menu_entry_1[] = {
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, geo_menu_sound_button), LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, geo_menu_sound_button),
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_generic_button), LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_generic_button),
// TODO Figure out how to add to the main menu, enable this in header.h
#ifdef _CUSTOM_CODE
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_custom_button),
#endif //_CUSTOM_CODE
AREA(/*index*/ 1, geo_menu_file_select_strings_and_menu_cursor), AREA(/*index*/ 1, geo_menu_file_select_strings_and_menu_cursor),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager), OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager),
OBJECT(/*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu), OBJECT(/*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu),
@ -43,7 +50,13 @@ const LevelScript level_main_menu_entry_1[] = {
FREE_LEVEL_POOL(), FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
#ifdef _DISABLE_MENU_MUSIC
// Make this do nothing if enabled
#else
SET_MENU_MUSIC(/*seq*/ 0x0021), SET_MENU_MUSIC(/*seq*/ 0x0021),
#endif //_DISABLE_MENU_MUSIC
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
CALL(/*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos), CALL(/*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos),
CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected), CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected),

View File

@ -1160,6 +1160,8 @@ s32 update_level(void) {
return changeLevel; return changeLevel;
} }
#define _DISABLE_START_INTRO
s32 init_level(void) { s32 init_level(void) {
s32 val4 = 0; s32 val4 = 0;
@ -1198,9 +1200,11 @@ s32 init_level(void) {
if (gMarioState->action != ACT_UNINITIALIZED) { if (gMarioState->action != ACT_UNINITIALIZED) {
if (save_file_exists(gCurrSaveFileNum - 1)) { if (save_file_exists(gCurrSaveFileNum - 1)) {
set_mario_action(gMarioState, ACT_IDLE, 0); set_mario_action(gMarioState, ACT_IDLE, 0);
#ifndef _DISABLE_START_INTRO //Disable the starting intro when launching a new save.
} else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) { } else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) {
set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0); set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0);
val4 = 1; val4 = 1;
#endif //_DISABLE_START_INTRO
} }
} }
} }
@ -1246,6 +1250,8 @@ s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused) {
return result; return result;
} }
#undef _LEVEL_SELECTOR
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
#ifdef VERSION_EU #ifdef VERSION_EU
s16 var = eu_get_language(); s16 var = eu_get_language();
@ -1267,7 +1273,6 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
sWarpDest.type = WARP_TYPE_NOT_WARPING; sWarpDest.type = WARP_TYPE_NOT_WARPING;
sDelayedWarpOp = WARP_OP_NONE; sDelayedWarpOp = WARP_OP_NONE;
gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1) && gCLIOpts.SkipIntro == 0 && configSkipIntro == 0; gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1) && gCLIOpts.SkipIntro == 0 && configSkipIntro == 0;
gCurrLevelNum = levelNum; gCurrLevelNum = levelNum;
gCurrCourseNum = COURSE_NONE; gCurrCourseNum = COURSE_NONE;
gSavedCourseNum = COURSE_NONE; gSavedCourseNum = COURSE_NONE;