sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

script.c (3545B)


      1 #include <ultra64.h>
      2 #include "sm64.h"
      3 #include "behavior_data.h"
      4 #include "model_ids.h"
      5 #include "seq_ids.h"
      6 #include "dialog_ids.h"
      7 #include "segment_symbols.h"
      8 #include "level_commands.h"
      9 
     10 #include "game/level_update.h"
     11 
     12 #include "levels/scripts.h"
     13 
     14 #include "actors/common1.h"
     15 
     16 #include "make_const_nonconst.h"
     17 #include "levels/cotmc/header.h"
     18 
     19 static const LevelScript script_func_local_1[] = {
     20     OBJECT(/*model*/ MODEL_CAP_SWITCH, /*pos*/ 0,  363, -6144, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(0x01), /*bhv*/ bhvCapSwitch),
     21     OBJECT(/*model*/ MODEL_NONE,       /*pos*/ 0,  500, -7373, /*angle*/ 0, 0, 0, /*bhvParam*/ 0, /*bhv*/ bhvWaterfallSoundLoop),
     22     OBJECT(/*model*/ MODEL_NONE,       /*pos*/ 0,  500,  3584, /*angle*/ 0, 0, 0, /*bhvParam*/ 0, /*bhv*/ bhvWaterfallSoundLoop),
     23     RETURN(),
     24 };
     25 
     26 static const LevelScript script_func_local_2[] = {
     27     OBJECT(/*model*/ MODEL_NONE,       /*pos*/ 0, -200, -7000, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM1(STAR_INDEX_ACT_1), /*bhv*/ bhvHiddenRedCoinStar),
     28     RETURN(),
     29 };
     30 
     31 const LevelScript level_cotmc_entry[] = {
     32     INIT_LEVEL(),
     33     LOAD_MIO0        (/*seg*/ 0x07, _cotmc_segment_7SegmentRomStart, _cotmc_segment_7SegmentRomEnd),
     34     LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _cave_mio0SegmentRomStart, _cave_mio0SegmentRomEnd),
     35     LOAD_MIO0        (/*seg*/ 0x05, _group8_mio0SegmentRomStart, _group8_mio0SegmentRomEnd),
     36     LOAD_RAW         (/*seg*/ 0x0C, _group8_geoSegmentRomStart,  _group8_geoSegmentRomEnd),
     37     LOAD_MIO0        (/*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
     38     LOAD_RAW         (/*seg*/ 0x0D, _group17_geoSegmentRomStart,  _group17_geoSegmentRomEnd),
     39     LOAD_MIO0        (/*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
     40     LOAD_RAW         (/*seg*/ 0x0F, _common0_geoSegmentRomStart,  _common0_geoSegmentRomEnd),
     41     ALLOC_LEVEL_POOL(),
     42     MARIO(/*model*/ MODEL_MARIO, /*bhvParam*/ BPARAM4(0x01), /*bhv*/ bhvMario),
     43     JUMP_LINK(script_func_global_9),
     44     JUMP_LINK(script_func_global_18),
     45     JUMP_LINK(script_func_global_1),
     46 
     47     AREA(/*index*/ 1, cotmc_geo_0001A0),
     48         OBJECT(/*model*/ MODEL_NONE, /*pos*/ -4185, 1020, -47, /*angle*/ 0, 90, 0, /*bhvParam*/ BPARAM2(WARP_NODE_0A), /*bhv*/ bhvAirborneWarp),
     49         WARP_NODE(/*id*/ WARP_NODE_0A,         /*destLevel*/ LEVEL_COTMC,          /*destArea*/ 1, /*destNode*/ WARP_NODE_0A, /*flags*/ WARP_NO_CHECKPOINT),
     50         WARP_NODE(/*id*/ WARP_NODE_SUCCESS,    /*destLevel*/ LEVEL_CASTLE,         /*destArea*/ 3, /*destNode*/ WARP_NODE_34, /*flags*/ WARP_NO_CHECKPOINT),
     51         WARP_NODE(/*id*/ WARP_NODE_DEATH,      /*destLevel*/ LEVEL_CASTLE,         /*destArea*/ 3, /*destNode*/ WARP_NODE_66, /*flags*/ WARP_NO_CHECKPOINT),
     52         WARP_NODE(/*id*/ WARP_NODE_WARP_FLOOR, /*destLevel*/ LEVEL_CASTLE_GROUNDS, /*destArea*/ 1, /*destNode*/ WARP_NODE_14, /*flags*/ WARP_NO_CHECKPOINT),
     53         JUMP_LINK(script_func_local_2),
     54         JUMP_LINK(script_func_local_1),
     55         TERRAIN(/*terrainData*/ cotmc_seg7_collision_level),
     56         MACRO_OBJECTS(/*objList*/ cotmc_seg7_macro_objs),
     57         SHOW_DIALOG(/*index*/ 0x00, DIALOG_130),
     58         SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0004, /*seq*/ SEQ_LEVEL_UNDERGROUND),
     59         TERRAIN_TYPE(/*terrainType*/ TERRAIN_STONE),
     60     END_AREA(),
     61 
     62     FREE_LEVEL_POOL(),
     63     MARIO_POS(/*area*/ 1, /*yaw*/ 90, /*pos*/ -4185, 20, -47),
     64     CALL(/*arg*/ 0, /*func*/ lvl_init_or_update),
     65     CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update),
     66     CLEAR_LEVEL(),
     67     SLEEP_BEFORE_EXIT(/*frames*/ 1),
     68     EXIT(),
     69 };