2019-11-03 14:36:27 -05:00
|
|
|
#include <ultra64.h>
|
|
|
|
|
#include "sm64.h"
|
|
|
|
|
#include "behavior_data.h"
|
|
|
|
|
#include "model_ids.h"
|
|
|
|
|
#include "seq_ids.h"
|
|
|
|
|
#include "segment_symbols.h"
|
|
|
|
|
#include "level_commands.h"
|
|
|
|
|
|
2019-12-01 21:52:53 -05:00
|
|
|
#include "game/area.h"
|
2019-11-03 14:36:27 -05:00
|
|
|
#include "game/level_update.h"
|
2021-07-12 23:17:54 -04:00
|
|
|
#include "menu/title_screen.h"
|
2019-11-03 14:36:27 -05:00
|
|
|
|
|
|
|
|
#include "levels/scripts.h"
|
|
|
|
|
#include "levels/menu/header.h"
|
|
|
|
|
|
2021-12-30 10:57:51 -06:00
|
|
|
#include "actors/common0.h"
|
2019-11-03 14:36:27 -05:00
|
|
|
#include "actors/common1.h"
|
|
|
|
|
|
|
|
|
|
#include "make_const_nonconst.h"
|
|
|
|
|
#include "levels/intro/header.h"
|
2021-08-22 13:39:47 +01:00
|
|
|
#include "farcall.h"
|
2019-11-03 14:36:27 -05:00
|
|
|
|
2021-05-26 14:55:59 +01:00
|
|
|
#include "config.h"
|
2021-08-22 13:39:47 +01:00
|
|
|
#include "game/print.h"
|
2021-05-26 14:55:59 +01:00
|
|
|
|
2021-12-30 10:57:51 -06:00
|
|
|
#include "game/object_list_processor.h"
|
|
|
|
|
|
2020-12-03 14:26:38 -05:00
|
|
|
const LevelScript level_intro_splash_screen[] = {
|
2021-05-26 15:01:56 +01:00
|
|
|
#ifdef SKIP_TITLE_SCREEN
|
2021-12-30 10:57:51 -06:00
|
|
|
EXIT_AND_EXECUTE_WITH_CODE(/*seg*/ SEGMENT_MENU_INTRO, _introSegmentRomStart, _introSegmentRomEnd, level_intro_mario_head_regular, _introSegmentBssStart, _introSegmentBssEnd),
|
2021-05-26 15:01:56 +01:00
|
|
|
#endif
|
2023-01-24 09:22:49 -05:00
|
|
|
INIT_LEVEL(),
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_GODDARD(),
|
|
|
|
|
LOAD_BEHAVIOR_DATA(),
|
|
|
|
|
LOAD_LEVEL_DATA(intro),
|
|
|
|
|
#if defined(FLOOMBAS) && defined(INTRO_FLOOMBAS)
|
|
|
|
|
LOAD_COMMON0(),
|
|
|
|
|
|
|
|
|
|
// Load "Super Mario 64" logo
|
|
|
|
|
ALLOC_LEVEL_POOL(),
|
|
|
|
|
LOAD_MODEL_FROM_GEO(MODEL_GOOMBA, goomba_geo),
|
|
|
|
|
AREA(/*index*/ 1, intro_geo_splash_screen),
|
|
|
|
|
OBJECT(/*model*/ MODEL_GOOMBA, /*pos*/ -570, -480, 1500, /*angle*/ 0, 50, 0, /*behParam*/ BP(0x18, 0x00, 0x10, 0x0B), /*beh*/ bhvFloombaStartup),
|
|
|
|
|
OBJECT(/*model*/ MODEL_GOOMBA, /*pos*/ 570, -480, 1500, /*angle*/ 0, -50, 0, /*behParam*/ BP(0x18, 0x00, 0x90, 0x0B), /*beh*/ bhvFloombaStartup),
|
|
|
|
|
END_AREA(),
|
|
|
|
|
FREE_LEVEL_POOL(),
|
|
|
|
|
|
|
|
|
|
// Start animation
|
|
|
|
|
LOAD_AREA(/*area*/ 1),
|
2019-11-03 14:36:27 -05:00
|
|
|
|
2023-01-24 09:22:49 -05:00
|
|
|
SET_MENU_MUSIC(/*seq*/ SEQ_SOUND_PLAYER),
|
2021-12-30 10:57:51 -06:00
|
|
|
CALL(/*arg*/ LVL_INTRO_PLAY_ITS_A_ME_MARIO, /*func*/ lvl_intro_update),
|
|
|
|
|
CALL(/*arg*/ 0, /*func*/ load_mario_area),
|
|
|
|
|
|
|
|
|
|
JUMP_LINK_PUSH_ARG(75),
|
|
|
|
|
UPDATE_OBJECTS(),
|
|
|
|
|
SLEEP(/*frames*/ 1),
|
|
|
|
|
JUMP_N_TIMES(),
|
|
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
|
|
|
|
|
JUMP_LINK_PUSH_ARG(16),
|
|
|
|
|
UPDATE_OBJECTS(),
|
|
|
|
|
SLEEP(/*frames*/ 1),
|
|
|
|
|
JUMP_N_TIMES(),
|
|
|
|
|
#else
|
2020-12-03 14:26:38 -05:00
|
|
|
// Load "Super Mario 64" logo
|
|
|
|
|
ALLOC_LEVEL_POOL(),
|
2021-09-23 17:37:05 -07:00
|
|
|
AREA(/*index*/ 1, intro_geo_splash_screen),
|
2019-11-03 14:36:27 -05:00
|
|
|
END_AREA(),
|
|
|
|
|
FREE_LEVEL_POOL(),
|
2020-12-03 14:26:38 -05:00
|
|
|
|
|
|
|
|
// Start animation
|
2019-11-03 14:36:27 -05:00
|
|
|
LOAD_AREA(/*area*/ 1),
|
2020-12-03 14:26:38 -05:00
|
|
|
|
2023-01-24 09:22:49 -05:00
|
|
|
SET_MENU_MUSIC(/*seq*/ SEQ_SOUND_PLAYER),
|
2021-07-12 23:17:54 -04:00
|
|
|
CALL(/*arg*/ LVL_INTRO_PLAY_ITS_A_ME_MARIO, /*func*/ lvl_intro_update),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 75),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
2021-12-30 10:57:51 -06:00
|
|
|
#endif
|
|
|
|
|
UNLOAD_AREA(/*area*/ 1),
|
2019-11-03 14:36:27 -05:00
|
|
|
CLEAR_LEVEL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
2021-12-30 10:57:51 -06:00
|
|
|
EXIT_AND_EXECUTE_WITH_CODE(/*seg*/ SEGMENT_MENU_INTRO, _introSegmentRomStart, _introSegmentRomEnd, level_intro_mario_head_regular, _introSegmentBssStart, _introSegmentBssEnd),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2020-12-03 14:26:38 -05:00
|
|
|
const LevelScript level_intro_mario_head_regular[] = {
|
2021-09-23 17:37:05 -07:00
|
|
|
INIT_LEVEL(),
|
2019-11-03 14:36:27 -05:00
|
|
|
BLACKOUT(/*active*/ TRUE),
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_GODDARD(),
|
|
|
|
|
#ifdef KEEP_MARIO_HEAD
|
2021-03-28 20:54:54 -04:00
|
|
|
LOAD_MARIO_HEAD(/*loadHeadID*/ REGULAR_FACE),
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_BEHAVIOR_DATA(),
|
|
|
|
|
LOAD_TITLE_SCREEN_BG(),
|
2019-11-03 14:36:27 -05:00
|
|
|
|
2020-12-03 14:26:38 -05:00
|
|
|
ALLOC_LEVEL_POOL(),
|
|
|
|
|
AREA(/*index*/ 1, intro_geo_mario_head_regular),
|
2019-11-03 14:36:27 -05:00
|
|
|
END_AREA(),
|
|
|
|
|
FREE_LEVEL_POOL(),
|
2020-12-03 14:26:38 -05:00
|
|
|
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 2),
|
|
|
|
|
BLACKOUT(/*active*/ FALSE),
|
|
|
|
|
LOAD_AREA(/*area*/ 1),
|
2021-07-12 23:17:54 -04:00
|
|
|
SET_MENU_MUSIC(/*seq*/ SEQ_MENU_TITLE_SCREEN),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 20),
|
2021-12-30 10:57:51 -06:00
|
|
|
#else
|
2022-12-08 10:41:50 -05:00
|
|
|
PUSH_POOL(),
|
2021-09-24 17:28:02 +01:00
|
|
|
BLACKOUT(/*active*/ FALSE),
|
2021-09-15 10:40:21 -07:00
|
|
|
#endif
|
2021-07-12 23:17:54 -04:00
|
|
|
CALL_LOOP(/*arg*/ LVL_INTRO_REGULAR, /*func*/ lvl_intro_update),
|
2021-09-23 17:37:05 -07:00
|
|
|
JUMP_IF(/*op*/ OP_EQ, /*arg*/ LEVEL_FILE_SELECT, script_intro_file_select),
|
|
|
|
|
JUMP_IF(/*op*/ OP_EQ, /*arg*/ LEVEL_LEVEL_SELECT, script_intro_level_select),
|
|
|
|
|
JUMP(script_intro_main_level_entry),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2020-12-03 14:26:38 -05:00
|
|
|
const LevelScript level_intro_mario_head_dizzy[] = {
|
2019-11-03 14:36:27 -05:00
|
|
|
INIT_LEVEL(),
|
|
|
|
|
BLACKOUT(/*active*/ TRUE),
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_GODDARD(),
|
2021-05-26 14:55:59 +01:00
|
|
|
#ifdef KEEP_MARIO_HEAD
|
2021-03-28 20:54:54 -04:00
|
|
|
LOAD_MARIO_HEAD(/*loadHeadID*/ DIZZY_FACE),
|
|
|
|
|
#endif
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_BEHAVIOR_DATA(),
|
|
|
|
|
LOAD_TITLE_SCREEN_BG(),
|
2019-11-03 14:36:27 -05:00
|
|
|
ALLOC_LEVEL_POOL(),
|
|
|
|
|
|
2020-12-03 14:26:38 -05:00
|
|
|
AREA(/*index*/ 1, intro_geo_mario_head_dizzy),
|
2019-11-03 14:36:27 -05:00
|
|
|
END_AREA(),
|
|
|
|
|
|
|
|
|
|
FREE_LEVEL_POOL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
|
|
|
|
BLACKOUT(/*active*/ FALSE),
|
|
|
|
|
LOAD_AREA(/*area*/ 1),
|
2021-07-12 23:17:54 -04:00
|
|
|
SET_MENU_MUSIC(/*seq*/ SEQ_MENU_GAME_OVER),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 20),
|
2021-07-12 23:17:54 -04:00
|
|
|
CALL_LOOP(/*arg*/ LVL_INTRO_GAME_OVER, /*func*/ lvl_intro_update),
|
2021-09-23 17:37:05 -07:00
|
|
|
JUMP_IF(/*op*/ OP_EQ, /*arg*/ LEVEL_FILE_SELECT, script_intro_file_select),
|
|
|
|
|
JUMP_IF(/*op*/ OP_EQ, /*arg*/ LEVEL_LEVEL_SELECT, script_intro_level_select),
|
|
|
|
|
JUMP(script_intro_main_level_entry),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript level_intro_entry_level_select[] = {
|
2019-11-03 14:36:27 -05:00
|
|
|
INIT_LEVEL(),
|
2021-12-30 10:57:51 -06:00
|
|
|
LOAD_BEHAVIOR_DATA(),
|
|
|
|
|
LOAD_TITLE_SCREEN_BG(),
|
|
|
|
|
LOAD_YAY0(/*seg*/ SEGMENT_LEVEL_DATA, _debug_level_select_yay0SegmentRomStart, _debug_level_select_yay0SegmentRomEnd),
|
2019-11-03 14:36:27 -05:00
|
|
|
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
|
|
|
|
|
ALLOC_LEVEL_POOL(),
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
AREA(/*index*/ 1, intro_geo_debug_level_select),
|
2019-11-03 14:36:27 -05:00
|
|
|
END_AREA(),
|
|
|
|
|
|
|
|
|
|
FREE_LEVEL_POOL(),
|
|
|
|
|
LOAD_AREA(/*area*/ 1),
|
2021-07-12 23:17:54 -04:00
|
|
|
SET_MENU_MUSIC(/*seq*/ SEQ_MENU_TITLE_SCREEN),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
2021-07-12 23:17:54 -04:00
|
|
|
CALL_LOOP(/*arg*/ LVL_INTRO_LEVEL_SELECT, /*func*/ lvl_intro_update),
|
2021-09-23 17:37:05 -07:00
|
|
|
JUMP_IF(/*op*/ OP_EQ, /*arg*/ LEVEL_RESTART_GAME, script_intro_splash_screen),
|
|
|
|
|
JUMP(script_intro_main_level_entry_stop_music),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// These should be static, but C doesn't allow non-sized forward declarations of static arrays
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript script_intro_file_select[] = {
|
2019-11-03 14:36:27 -05:00
|
|
|
STOP_MUSIC(/*fadeOutTime*/ 0x00BE),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
|
|
|
|
CLEAR_LEVEL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
2021-12-30 10:57:51 -06:00
|
|
|
SET_REG(/*value*/ START_LEVEL),
|
|
|
|
|
EXIT_AND_EXECUTE(/*seg*/ SEGMENT_MENU_INTRO, _menuSegmentRomStart, _menuSegmentRomEnd, level_main_menu_entry_file_select),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript script_intro_level_select[] = {
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
|
|
|
|
CLEAR_LEVEL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
2021-12-30 10:57:51 -06:00
|
|
|
EXIT_AND_EXECUTE_WITH_CODE(/*seg*/ SEGMENT_MENU_INTRO, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_level_select, _introSegmentBssStart, _introSegmentBssEnd),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript script_intro_main_level_entry_stop_music[] = {
|
2019-11-03 14:36:27 -05:00
|
|
|
STOP_MUSIC(/*fadeOutTime*/ 0x00BE),
|
2021-09-23 17:37:05 -07:00
|
|
|
JUMP(script_intro_main_level_entry),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript script_intro_main_level_entry[] = {
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
|
|
|
|
CLEAR_LEVEL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
2021-12-30 10:57:51 -06:00
|
|
|
EXIT_AND_EXECUTE(/*seg*/ SEGMENT_GLOBAL_LEVEL_SCRIPT, _scriptsSegmentRomStart, _scriptsSegmentRomEnd, level_main_scripts_entry),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-09-23 17:37:05 -07:00
|
|
|
const LevelScript script_intro_splash_screen[] = {
|
2019-11-03 14:36:27 -05:00
|
|
|
STOP_MUSIC(/*fadeOutTime*/ 0x00BE),
|
2019-12-01 21:52:53 -05:00
|
|
|
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
|
2019-11-03 14:36:27 -05:00
|
|
|
SLEEP(/*frames*/ 16),
|
|
|
|
|
CLEAR_LEVEL(),
|
|
|
|
|
SLEEP(/*frames*/ 2),
|
2021-12-30 10:57:51 -06:00
|
|
|
EXIT_AND_EXECUTE_WITH_CODE(/*seg*/ SEGMENT_MENU_INTRO, _introSegmentRomStart, _introSegmentRomEnd, level_intro_splash_screen, _introSegmentBssStart, _introSegmentBssEnd),
|
2019-11-03 14:36:27 -05:00
|
|
|
};
|