sm64

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

script.c (3981B)


      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 "segment_symbols.h"
      7 #include "level_commands.h"
      8 
      9 #include "game/level_update.h"
     10 
     11 #include "levels/scripts.h"
     12 
     13 #include "actors/common1.h"
     14 
     15 #include "make_const_nonconst.h"
     16 #include "levels/wmotr/header.h"
     17 
     18 static const LevelScript script_func_local_1[] = {
     19     OBJECT(/*model*/ MODEL_NONE, /*pos*/  3996, -2739,  5477, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(82),  /*bhv*/ bhvPoleGrabbing),
     20     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -2911,  3564, -3967, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(84),  /*bhv*/ bhvPoleGrabbing),
     21     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -3258,  3359, -3946, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(105), /*bhv*/ bhvPoleGrabbing),
     22     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -2639,  3154, -4369, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(125), /*bhv*/ bhvPoleGrabbing),
     23     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -2980,  4048, -4248, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(36),  /*bhv*/ bhvPoleGrabbing),
     24     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -3290,  3636, -4477, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM2(77),  /*bhv*/ bhvPoleGrabbing),
     25     RETURN(),
     26 };
     27 
     28 static const LevelScript script_func_local_2[] = {
     29     OBJECT(/*model*/ MODEL_NONE, /*pos*/ -160, 1950, -470, /*angle*/ 0, 0, 0, /*bhvParam*/ BPARAM1(STAR_INDEX_ACT_1), /*bhv*/ bhvHiddenRedCoinStar),
     30     RETURN(),
     31 };
     32 
     33 const LevelScript level_wmotr_entry[] = {
     34     INIT_LEVEL(),
     35     LOAD_MIO0        (/*seg*/ 0x07, _wmotr_segment_7SegmentRomStart, _wmotr_segment_7SegmentRomEnd),
     36     LOAD_MIO0        (/*seg*/ 0x0A, _cloud_floor_skybox_mio0SegmentRomStart, _cloud_floor_skybox_mio0SegmentRomEnd),
     37     LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _sky_mio0SegmentRomStart, _sky_mio0SegmentRomEnd),
     38     LOAD_MIO0        (/*seg*/ 0x05, _group2_mio0SegmentRomStart, _group2_mio0SegmentRomEnd),
     39     LOAD_RAW         (/*seg*/ 0x0C, _group2_geoSegmentRomStart,  _group2_geoSegmentRomEnd),
     40     LOAD_MIO0        (/*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
     41     LOAD_RAW         (/*seg*/ 0x0D, _group17_geoSegmentRomStart,  _group17_geoSegmentRomEnd),
     42     LOAD_MIO0        (/*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
     43     LOAD_RAW         (/*seg*/ 0x0F, _common0_geoSegmentRomStart,  _common0_geoSegmentRomEnd),
     44     ALLOC_LEVEL_POOL(),
     45     MARIO(/*model*/ MODEL_MARIO, /*bhvParam*/ BPARAM4(0x01), /*bhv*/ bhvMario),
     46     JUMP_LINK(script_func_global_1),
     47     JUMP_LINK(script_func_global_3),
     48     JUMP_LINK(script_func_global_18),
     49 
     50     AREA(/*index*/ 1, wmotr_geo_0001F0),
     51         OBJECT(/*model*/ MODEL_NONE, /*pos*/ -67, 2669, -16, /*angle*/ 0, 270, 0, /*bhvParam*/ BPARAM2(WARP_NODE_0A), /*bhv*/ bhvAirborneWarp),
     52         WARP_NODE(/*id*/ WARP_NODE_0A,         /*destLevel*/ LEVEL_WMOTR,          /*destArea*/ 1, /*destNode*/ WARP_NODE_0A, /*flags*/ WARP_NO_CHECKPOINT),
     53         WARP_NODE(/*id*/ WARP_NODE_SUCCESS,    /*destLevel*/ LEVEL_CASTLE,         /*destArea*/ 2, /*destNode*/ WARP_NODE_38, /*flags*/ WARP_NO_CHECKPOINT),
     54         WARP_NODE(/*id*/ WARP_NODE_DEATH,      /*destLevel*/ LEVEL_CASTLE,         /*destArea*/ 2, /*destNode*/ WARP_NODE_6D, /*flags*/ WARP_NO_CHECKPOINT),
     55         WARP_NODE(/*id*/ WARP_NODE_WARP_FLOOR, /*destLevel*/ LEVEL_CASTLE_GROUNDS, /*destArea*/ 1, /*destNode*/ WARP_NODE_0A, /*flags*/ WARP_NO_CHECKPOINT),
     56         JUMP_LINK(script_func_local_1),
     57         JUMP_LINK(script_func_local_2),
     58         TERRAIN(/*terrainData*/ wmotr_seg7_collision),
     59         MACRO_OBJECTS(/*objList*/ wmotr_seg7_macro_objs),
     60         SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0000, /*seq*/ SEQ_LEVEL_SLIDE),
     61         TERRAIN_TYPE(/*terrainType*/ TERRAIN_SNOW),
     62     END_AREA(),
     63 
     64     FREE_LEVEL_POOL(),
     65     MARIO_POS(/*area*/ 1, /*yaw*/ 270, /*pos*/ -67, 1669, -16),
     66     CALL(/*arg*/ 0, /*func*/ lvl_init_or_update),
     67     CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update),
     68     CLEAR_LEVEL(),
     69     SLEEP_BEFORE_EXIT(/*frames*/ 1),
     70     EXIT(),
     71 };