Removed old better names to use the new ones

This commit is contained in:
KiritoDv
2026-01-11 19:42:31 -06:00
committed by Lywx
parent db4b5834d6
commit 9796e33b2a
7 changed files with 73 additions and 108 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
// For LEVEL_NAME defines, see level_defines.h.
// Please include this file if you want to use them.
#define STUB_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8, _9) levelenum,
#define DEFINE_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) levelenum,
#define STUB_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8) levelenum,
#define DEFINE_LEVEL(_0, levelenum, _2, _3, _4, _5, _6, _7, _8, _9, _10) levelenum,
enum LevelNum {
LEVEL_NONE,
+38 -41
View File
@@ -14,47 +14,44 @@
// Argument 7, 8, 9: Echo levels for individual areas.
// Argument 10: Specify dynamic music tables for levels, if specified. _ for none.
// Argument 11: Specify level camera table, if specified. _ for none.
// #region [PU] Added info for each level
// Argument 12: Human readable name of the level.
// #endregion
// NOTE: Be sure to edit sZoomOutAreaMasks in camera.c, as there isnt a good way to macro those right now.
// TODO: Figure something out for sZoomOutAreaMasks?
STUB_LEVEL( "", LEVEL_UNKNOWN_1, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _, "")
STUB_LEVEL( "", LEVEL_UNKNOWN_2, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _, "")
STUB_LEVEL( "", LEVEL_UNKNOWN_3, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _, "")
DEFINE_LEVEL("TERESA OBAKE", LEVEL_BBH, COURSE_BBH, bbh, spooky, 28000, 0x28, 0x28, 0x28, sDynBbh, sCamBBH, "Big Boos Haunt")
DEFINE_LEVEL("YYAMA1 % YSLD1", LEVEL_CCM, COURSE_CCM, ccm, snow, 17000, 0x10, 0x38, 0x38, _, sCamCCM, "Cool Cool Mountain")
DEFINE_LEVEL("SELECT ROOM", LEVEL_CASTLE, COURSE_NONE, castle_inside, inside, 20000, 0x20, 0x20, 0x30, _, sCamCastle, "Inside Peachs Castle")
DEFINE_LEVEL("HORROR DUNGEON", LEVEL_HMC, COURSE_HMC, hmc, cave, 16000, 0x28, 0x28, 0x28, sDynHmc, sCamHMC, "Hazy Maze Cave")
DEFINE_LEVEL("SABAKU % PYRMD", LEVEL_SSL, COURSE_SSL, ssl, generic, 15000, 0x08, 0x30, 0x30, _, sCamSSL, "Shifting Sand Land")
DEFINE_LEVEL("BATTLE FIELD", LEVEL_BOB, COURSE_BOB, bob, generic, 15000, 0x08, 0x08, 0x08, _, _, "Bobomb Battlefield")
DEFINE_LEVEL("YUKIYAMA2", LEVEL_SL, COURSE_SL, sl, snow, 14000, 0x10, 0x28, 0x28, _, sCamSL, "Snowmans Land")
DEFINE_LEVEL("POOL KAI", LEVEL_WDW, COURSE_WDW, wdw, grass, 17000, 0x10, 0x18, 0x18, sDynWdw, _, "Wet Dry World")
DEFINE_LEVEL("WTDG % TINBOTU", LEVEL_JRB, COURSE_JRB, jrb, water, 20000, 0x10, 0x18, 0x18, sDynJrb, _, "Jolly Roger Bay")
DEFINE_LEVEL("BIG WORLD", LEVEL_THI, COURSE_THI, thi, grass, 20000, 0x0c, 0x0c, 0x20, _, sCamTHI, "Tiny Huge Island")
DEFINE_LEVEL("CLOCK TOWER", LEVEL_TTC, COURSE_TTC, ttc, machine, 18000, 0x18, 0x18, 0x18, _, _, "Tick Tock Clock")
DEFINE_LEVEL("RAINBOW CRUISE", LEVEL_RR, COURSE_RR, rr, sky, 20000, 0x20, 0x20, 0x20, _, sCamRR, "Rainbow Ride")
DEFINE_LEVEL("MAIN MAP", LEVEL_CASTLE_GROUNDS, COURSE_NONE, castle_grounds, outside, 25000, 0x08, 0x08, 0x08, _, _, "Outside the Castle")
DEFINE_LEVEL("EXT1 YOKO SCRL", LEVEL_BITDW, COURSE_BITDW, bitdw, sky, 16000, 0x28, 0x28, 0x28, _, _, "Bowser in the Dark World")
DEFINE_LEVEL("EXT7 HORI MINI", LEVEL_VCUTM, COURSE_VCUTM, vcutm, outside, 30000, 0x28, 0x28, 0x28, _, _, "Vanish Cap Under the Moat")
DEFINE_LEVEL("EXT2 TIKA LAVA", LEVEL_BITFS, COURSE_BITFS, bitfs, sky, 16000, 0x28, 0x28, 0x28, _, _, "Bowser in the Fire Sea")
DEFINE_LEVEL("EXT9 SUISOU", LEVEL_SA, COURSE_SA, sa, inside, 20000, 0x10, 0x10, 0x10, _, _, "The Secret Aquarium")
DEFINE_LEVEL("EXT3 HEAVEN", LEVEL_BITS, COURSE_BITS, bits, sky, 16000, 0x28, 0x28, 0x28, _, _, "Bowser in the Sky")
DEFINE_LEVEL("FIREB1 % INVLC", LEVEL_LLL, COURSE_LLL, lll, fire, 22000, 0x08, 0x30, 0x30, _, _, "Lethal Lava Land")
DEFINE_LEVEL("WATER LAND", LEVEL_DDD, COURSE_DDD, ddd, water, 17000, 0x10, 0x20, 0x20, sDynDdd, _, "Dire Dire Docks")
DEFINE_LEVEL("MOUNTAIN", LEVEL_WF, COURSE_WF, wf, grass, 13000, 0x08, 0x08, 0x08, _, _, "Whomps Fortress")
DEFINE_LEVEL("ENDING", LEVEL_ENDING, COURSE_CAKE_END, ending, generic, 20000, 0x00, 0x00, 0x00, _, _, "The End")
DEFINE_LEVEL("URANIWA", LEVEL_CASTLE_COURTYARD, COURSE_NONE, castle_courtyard, outside, 20000, 0x08, 0x08, 0x08, _, _, "Castle Courtyard")
DEFINE_LEVEL("EXT4 MINI SLID", LEVEL_PSS, COURSE_PSS, pss, mountain, 20000, 0x28, 0x28, 0x28, _, _, "Secret Slide")
DEFINE_LEVEL("IN THE FALL", LEVEL_COTMC, COURSE_COTMC, cotmc, cave, 18000, 0x28, 0x28, 0x28, _, sCamCotMC, "Cavern of the Metal Cap")
DEFINE_LEVEL("EXT6 MARIO FLY", LEVEL_TOTWC, COURSE_TOTWC, totwc, sky, 20000, 0x20, 0x20, 0x20, _, _, "Tower of the Wing Cap")
DEFINE_LEVEL("KUPPA1", LEVEL_BOWSER_1, COURSE_BITDW, bowser_1, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _, "Bowser in the Dark World Boss")
DEFINE_LEVEL("EXT8 BLUE SKY", LEVEL_WMOTR, COURSE_WMOTR, wmotr, generic, 20000, 0x28, 0x28, 0x28, _, _, "Wing Mario Over the Rainbow")
STUB_LEVEL( "", LEVEL_UNKNOWN_32, COURSE_NONE, 20000, 0x70, 0x00, 0x00, _, _, "")
DEFINE_LEVEL("KUPPA2", LEVEL_BOWSER_2, COURSE_BITFS, bowser_2, fire, VAL_DIFF, 0x40, 0x40, 0x40, _, _, "Bowser in the Fire Sea Boss")
DEFINE_LEVEL("KUPPA3", LEVEL_BOWSER_3, COURSE_BITS, bowser_3, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _, "Bowser in the Sky Boss")
STUB_LEVEL( "", LEVEL_UNKNOWN_35, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _, "")
DEFINE_LEVEL("DONKEY % SLID2", LEVEL_TTM, COURSE_TTM, ttm, mountain, 15000, 0x08, 0x08, 0x08, _, _, "Tall Tall Mountain")
STUB_LEVEL( "", LEVEL_UNKNOWN_37, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _, "")
STUB_LEVEL( "", LEVEL_UNKNOWN_38, COURSE_NONE, 20000, 0x00, 0x00, 0x00, sDynUnk38, _, "")
STUB_LEVEL( "", LEVEL_UNKNOWN_1, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_2, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_3, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _)
DEFINE_LEVEL("TERESA OBAKE", LEVEL_BBH, COURSE_BBH, bbh, spooky, 28000, 0x28, 0x28, 0x28, sDynBbh, sCamBBH)
DEFINE_LEVEL("YYAMA1 % YSLD1", LEVEL_CCM, COURSE_CCM, ccm, snow, 17000, 0x10, 0x38, 0x38, _, sCamCCM)
DEFINE_LEVEL("SELECT ROOM", LEVEL_CASTLE, COURSE_NONE, castle_inside, inside, 20000, 0x20, 0x20, 0x30, _, sCamCastle)
DEFINE_LEVEL("HORROR DUNGEON", LEVEL_HMC, COURSE_HMC, hmc, cave, 16000, 0x28, 0x28, 0x28, sDynHmc, sCamHMC)
DEFINE_LEVEL("SABAKU % PYRMD", LEVEL_SSL, COURSE_SSL, ssl, generic, 15000, 0x08, 0x30, 0x30, _, sCamSSL)
DEFINE_LEVEL("BATTLE FIELD", LEVEL_BOB, COURSE_BOB, bob, generic, 15000, 0x08, 0x08, 0x08, _, _)
DEFINE_LEVEL("YUKIYAMA2", LEVEL_SL, COURSE_SL, sl, snow, 14000, 0x10, 0x28, 0x28, _, sCamSL)
DEFINE_LEVEL("POOL KAI", LEVEL_WDW, COURSE_WDW, wdw, grass, 17000, 0x10, 0x18, 0x18, sDynWdw, _)
DEFINE_LEVEL("WTDG % TINBOTU", LEVEL_JRB, COURSE_JRB, jrb, water, 20000, 0x10, 0x18, 0x18, sDynJrb, _)
DEFINE_LEVEL("BIG WORLD", LEVEL_THI, COURSE_THI, thi, grass, 20000, 0x0c, 0x0c, 0x20, _, sCamTHI)
DEFINE_LEVEL("CLOCK TOWER", LEVEL_TTC, COURSE_TTC, ttc, machine, 18000, 0x18, 0x18, 0x18, _, _)
DEFINE_LEVEL("RAINBOW CRUISE", LEVEL_RR, COURSE_RR, rr, sky, 20000, 0x20, 0x20, 0x20, _, sCamRR)
DEFINE_LEVEL("MAIN MAP", LEVEL_CASTLE_GROUNDS, COURSE_NONE, castle_grounds, outside, 25000, 0x08, 0x08, 0x08, _, _)
DEFINE_LEVEL("EXT1 YOKO SCRL", LEVEL_BITDW, COURSE_BITDW, bitdw, sky, 16000, 0x28, 0x28, 0x28, _, _)
DEFINE_LEVEL("EXT7 HORI MINI", LEVEL_VCUTM, COURSE_VCUTM, vcutm, outside, 30000, 0x28, 0x28, 0x28, _, _)
DEFINE_LEVEL("EXT2 TIKA LAVA", LEVEL_BITFS, COURSE_BITFS, bitfs, sky, 16000, 0x28, 0x28, 0x28, _, _)
DEFINE_LEVEL("EXT9 SUISOU", LEVEL_SA, COURSE_SA, sa, inside, 20000, 0x10, 0x10, 0x10, _, _)
DEFINE_LEVEL("EXT3 HEAVEN", LEVEL_BITS, COURSE_BITS, bits, sky, 16000, 0x28, 0x28, 0x28, _, _)
DEFINE_LEVEL("FIREB1 % INVLC", LEVEL_LLL, COURSE_LLL, lll, fire, 22000, 0x08, 0x30, 0x30, _, _)
DEFINE_LEVEL("WATER LAND", LEVEL_DDD, COURSE_DDD, ddd, water, 17000, 0x10, 0x20, 0x20, sDynDdd, _)
DEFINE_LEVEL("MOUNTAIN", LEVEL_WF, COURSE_WF, wf, grass, 13000, 0x08, 0x08, 0x08, _, _)
DEFINE_LEVEL("ENDING", LEVEL_ENDING, COURSE_CAKE_END, ending, generic, 20000, 0x00, 0x00, 0x00, _, _)
DEFINE_LEVEL("URANIWA", LEVEL_CASTLE_COURTYARD, COURSE_NONE, castle_courtyard, outside, 20000, 0x08, 0x08, 0x08, _, _)
DEFINE_LEVEL("EXT4 MINI SLID", LEVEL_PSS, COURSE_PSS, pss, mountain, 20000, 0x28, 0x28, 0x28, _, _)
DEFINE_LEVEL("IN THE FALL", LEVEL_COTMC, COURSE_COTMC, cotmc, cave, 18000, 0x28, 0x28, 0x28, _, sCamCotMC)
DEFINE_LEVEL("EXT6 MARIO FLY", LEVEL_TOTWC, COURSE_TOTWC, totwc, sky, 20000, 0x20, 0x20, 0x20, _, _)
DEFINE_LEVEL("KUPPA1", LEVEL_BOWSER_1, COURSE_BITDW, bowser_1, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _)
DEFINE_LEVEL("EXT8 BLUE SKY", LEVEL_WMOTR, COURSE_WMOTR, wmotr, generic, 20000, 0x28, 0x28, 0x28, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_32, COURSE_NONE, 20000, 0x70, 0x00, 0x00, _, _)
DEFINE_LEVEL("KUPPA2", LEVEL_BOWSER_2, COURSE_BITFS, bowser_2, fire, VAL_DIFF, 0x40, 0x40, 0x40, _, _)
DEFINE_LEVEL("KUPPA3", LEVEL_BOWSER_3, COURSE_BITS, bowser_3, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_35, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _)
DEFINE_LEVEL("DONKEY % SLID2", LEVEL_TTM, COURSE_TTM, ttm, mountain, 15000, 0x08, 0x08, 0x08, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_37, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _)
STUB_LEVEL( "", LEVEL_UNKNOWN_38, COURSE_NONE, 20000, 0x00, 0x00, 0x00, sDynUnk38, _)
+10 -10
View File
@@ -37,8 +37,8 @@
#include "level_table.h"
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9)
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) + 3
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8)
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + 3
static const LevelScript script_exec_level_table[2
#include "levels/level_defines.h"
];
@@ -51,8 +51,8 @@ static const LevelScript goto_mario_head_regular[4];
static const LevelScript goto_mario_head_dizzy[4];
static const LevelScript script_L5[4];
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9)
#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10, _11) static const LevelScript script_exec_ ## folder [4 + 1];
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8)
#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) static const LevelScript script_exec_ ## folder [4 + 1];
#include "level_defines.h"
@@ -149,18 +149,18 @@ static const LevelScript script_L5[] = {
// Include the level jumptable.
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9)
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8)
#define DEFINE_LEVEL(_0, levelenum, _2, folder, _4, _5, _6, _7, _8, _9, _10, _11) JUMP_IF(OP_EQ, levelenum, script_exec_ ## folder),
#define DEFINE_LEVEL(_0, levelenum, _2, folder, _4, _5, _6, _7, _8, _9, _10) JUMP_IF(OP_EQ, levelenum, script_exec_ ## folder),
static const LevelScript script_exec_level_table[] = {
GET_OR_SET(/*op*/ OP_GET, /*var*/ VAR_CURR_LEVEL_NUM),
#include "levels/level_defines.h"
EXIT(),
GET_OR_SET(/*op*/ OP_GET, /*var*/ VAR_CURR_LEVEL_NUM),
#include "levels/level_defines.h"
EXIT(),
};
#undef DEFINE_LEVEL
#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10, _11) \
#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) \
static const LevelScript script_exec_ ## folder [] = { \
EXECUTE(0x0E, _ ## folder ## SegmentRomStart, _ ## folder ## SegmentRomEnd, level_ ## folder ## _entry), \
RETURN(), \
+6 -6
View File
@@ -207,8 +207,8 @@ s16 sDynNone[] = { SEQ_SOUND_PLAYER, 0 };
u8 sCurrentMusicDynamic = 0xff;
u8 sBackgroundMusicForDynamics = SEQUENCE_NONE;
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, leveldyn, _8, _9) leveldyn,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, leveldyn, _10, _11) leveldyn,
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, leveldyn, _8) leveldyn,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, leveldyn, _10) leveldyn,
#define _ sDynNone
s16 *sLevelDynamics[LEVEL_COUNT] = {
@@ -239,8 +239,8 @@ struct MusicDynamic sMusicDynamics[8] = {
{ 0xffff, 127, 100, 0x0000, 0, 100 }, // any (unused)
};
#define STUB_LEVEL(_0, _1, _2, _3, echo1, echo2, echo3, _7, _8, _9) { echo1, echo2, echo3 },
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, echo1, echo2, echo3, _9, _10, _11) { echo1, echo2, echo3 },
#define STUB_LEVEL(_0, _1, _2, _3, echo1, echo2, echo3, _7, _8) { echo1, echo2, echo3 },
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, echo1, echo2, echo3, _9, _10) { echo1, echo2, echo3 },
u8 sLevelAreaReverbs[LEVEL_COUNT][3] = {
{ 0x00, 0x00, 0x00 }, // LEVEL_NONE
@@ -249,8 +249,8 @@ u8 sLevelAreaReverbs[LEVEL_COUNT][3] = {
#undef STUB_LEVEL
#undef DEFINE_LEVEL
#define STUB_LEVEL(_0, _1, _2, volume, _4, _5, _6, _7, _8, _9) volume,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, volume, _6, _7, _8, _9, _10, _11) volume,
#define STUB_LEVEL(_0, _1, _2, volume, _4, _5, _6, _7, _8) volume,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, volume, _6, _7, _8, _9, _10) volume,
u16 sLevelAcousticReaches[LEVEL_COUNT] = {
20000, // LEVEL_NONE
+2 -2
View File
@@ -6359,8 +6359,8 @@ struct CameraTrigger sCamBBH[] = {
};
#define _ NULL
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, cameratable, _9) cameratable,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, cameratable, _11) cameratable,
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, cameratable) cameratable,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, cameratable) cameratable,
/*
* This table has an extra 2 levels after the last unknown_38 stub level. What I think
+2 -2
View File
@@ -32,8 +32,8 @@ u8 gCurrCourseStarFlags = 0;
u8 gSpecialTripleJump = FALSE;
#define STUB_LEVEL(_0, _1, courseenum, _3, _4, _5, _6, _7, _8, _9) courseenum,
#define DEFINE_LEVEL(_0, _1, courseenum, _3, _4, _5, _6, _7, _8, _9, _10, _11) courseenum,
#define STUB_LEVEL(_0, _1, courseenum, _3, _4, _5, _6, _7, _8) courseenum,
#define DEFINE_LEVEL(_0, _1, courseenum, _3, _4, _5, _6, _7, _8, _9, _10) courseenum,
s8 gLevelToCourseNumTable[] = {
#include "levels/level_defines.h"
+13 -45
View File
@@ -24,8 +24,8 @@
* and a level select used for testing purposes.
*/
#define STUB_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8, _9) textname,
#define DEFINE_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) textname,
#define STUB_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8) textname,
#define DEFINE_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) textname,
static char sLevelSelectStageNames[64][16] = {
#include "levels/level_defines.h"
@@ -33,15 +33,6 @@ static char sLevelSelectStageNames[64][16] = {
#undef STUB_LEVEL
#undef DEFINE_LEVEL
#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, textname) textname,
#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, textname) textname,
static char sBetterLevelSelectStageNames[38][31] = {
#include "levels/level_defines.h"
};
#undef STUB_LEVEL
#undef DEFINE_LEVEL
static u16 sDemoCountdown = 0;
static s16 sPlayMarioGreeting = TRUE;
static s16 sPlayMarioGameOver = TRUE;
@@ -69,7 +60,7 @@ s32 run_level_id_or_demo(s32 level) {
if ((++sDemoCountdown) == PRESS_START_DEMO_TIMER) {
// start the Mario demo animation for the demo list.
void* data = ResourceGetDataByName(gDemoInputs[gDemoInputListID]);
void* data = segmented_to_virtual(gDemoInputs[gDemoInputListID]);
if(data == NULL) {
return 0;
@@ -77,8 +68,7 @@ s32 run_level_id_or_demo(s32 level) {
// if the next demo sequence ID is the count limit, reset it back to
// the first sequence.
// TODO: Remove this to check for gDemoInput size instead
if (++gDemoInputListID == sizeof(gDemoInputs) / sizeof(gDemoInputs[0]) - 1) {
if (++gDemoInputListID == ARRAY_COUNT(gDemoInputs)) {
gDemoInputListID = 0;
}
@@ -104,7 +94,6 @@ s32 run_level_id_or_demo(s32 level) {
*/
s16 intro_level_select(void) {
s32 stageChanged = FALSE;
s8 direction = 1;
// perform the ID updates per each button press.
// runs into a loop so after a button is pressed
@@ -114,20 +103,17 @@ s16 intro_level_select(void) {
}
if (gPlayer1Controller->buttonPressed & B_BUTTON) {
--gCurrLevelNum, stageChanged = TRUE;
direction = -1;
}
if (gPlayer1Controller->buttonPressed & U_JPAD || (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & U_CBUTTONS)) {
if (gPlayer1Controller->buttonPressed & U_JPAD) {
--gCurrLevelNum, stageChanged = TRUE;
direction = -1;
}
if (gPlayer1Controller->buttonPressed & D_JPAD || (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & D_CBUTTONS)) {
if (gPlayer1Controller->buttonPressed & D_JPAD) {
++gCurrLevelNum, stageChanged = TRUE;
}
if (gPlayer1Controller->buttonPressed & L_JPAD || (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & L_CBUTTONS)) {
if (gPlayer1Controller->buttonPressed & L_JPAD) {
gCurrLevelNum -= 10, stageChanged = TRUE;
direction = -1;
}
if (gPlayer1Controller->buttonPressed & R_JPAD || (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & R_CBUTTONS)) {
if (gPlayer1Controller->buttonPressed & R_JPAD) {
gCurrLevelNum += 10, stageChanged = TRUE;
}
@@ -144,32 +130,14 @@ s16 intro_level_select(void) {
gCurrLevelNum = LEVEL_MAX; // exceeded min. set to max.
}
// This block will ensure that the level select menu skips over the levels that are not in the game.
if (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0) && (stageChanged || gCurrLevelNum == 1)) {
while (sBetterLevelSelectStageNames[gCurrLevelNum - 1][0] == '\0') {
gCurrLevelNum += direction;
if (gCurrLevelNum > LEVEL_MAX) {
gCurrLevelNum = LEVEL_MIN; // exceeded max. set to min.
}
if (gCurrLevelNum < LEVEL_MIN) {
gCurrLevelNum = LEVEL_MAX; // exceeded min. set to max.
}
}
}
// Use file 4 and last act as a test
gCurrSaveFileNum = 4;
gCurrActNum = 6;
print_text_centered(160, 80, "SELECT STAGE");
print_text_centered(160, 30, "PRESS START BUTTON");
if (CVarGetInteger("gDeveloperTools.BetterLevelSelect", 0)) {
print_text_fmt_int(240, 80, "%2d", gCurrLevelNum);
print_text_centered(160, 60, sBetterLevelSelectStageNames[gCurrLevelNum - 1]);
} else {
print_text_fmt_int(40, 60, "%2d", gCurrLevelNum);
print_text(80, 60, sLevelSelectStageNames[gCurrLevelNum - 1]); // print stage name
}
print_text_fmt_int(40, 60, "%2d", gCurrLevelNum);
print_text(80, 60, sLevelSelectStageNames[gCurrLevelNum - 1]); // print stage name
#define QUIT_LEVEL_SELECT_COMBO (Z_TRIG | START_BUTTON | L_CBUTTONS | R_CBUTTONS)
@@ -178,7 +146,7 @@ s16 intro_level_select(void) {
// ... the level select quit combo is being pressed, which uses START. If this
// is the case, quit the menu instead.
if (gPlayer1Controller->buttonDown == QUIT_LEVEL_SELECT_COMBO) {
// CVarSetInteger("gDeveloperTools.DebugMode", 0);
CVarSetInteger("gDeveloperTools.DebugMode", 0);
return -1;
}
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
@@ -218,7 +186,7 @@ s32 intro_regular(void) {
// defined in level_intro_mario_head_regular JUMP_IF commands
// 100 is File Select - 101 is Level Select
level = 100 + gDebugLevelSelect;
sPlayMarioGreeting = TRUE;
sPlayMarioGreeting = !ROM_JP;
}
return run_level_id_or_demo(level);
}
@@ -244,7 +212,7 @@ s32 intro_game_over(void) {
#endif
// same criteria as intro_regular
level = 100 + gDebugLevelSelect;
sPlayMarioGameOver = TRUE;
sPlayMarioGameOver = !ROM_JP;
}
return run_level_id_or_demo(level);
}