sm64

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

model.inc.c (5744B)


      1 // Quicksand Pit
      2 
      3 // 0x07004000 - 0x07004018
      4 static const Lights1 ssl_lights_quicksand_pit = gdSPDefLights1(
      5     0x3f, 0x3f, 0x3f,
      6     0xff, 0xff, 0xff, 0x28, 0x28, 0x28
      7 );
      8 
      9 // 0x07004018 - 0x07004818
     10 ALIGNED8 const Texture ssl_quicksand[] = {
     11 #include "levels/ssl/7.rgba16.inc.c"
     12 };
     13 
     14 // 0x07004818 - 0x07004860
     15 const Gfx ssl_dl_quicksand_pit_begin[] = {
     16     gsDPPipeSync(),
     17     gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB),
     18     gsSPLight(&ssl_lights_quicksand_pit.l, 1),
     19     gsSPLight(&ssl_lights_quicksand_pit.a, 2),
     20     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
     21     gsDPTileSync(),
     22     gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD),
     23     gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
     24     gsSPEndDisplayList(),
     25 };
     26 
     27 // 0x07004860 - 0x07004880
     28 const Gfx ssl_dl_quicksand_pit_end[] = {
     29     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
     30     gsDPPipeSync(),
     31     gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
     32     gsSPEndDisplayList(),
     33 };
     34 
     35 // 0x07004880 - 0x070048F8
     36 const Gfx ssl_dl_pyramid_quicksand_pit_begin[] = {
     37     gsDPPipeSync(),
     38     gsDPSetCycleType(G_CYC_2CYCLE),
     39     gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
     40     gsDPSetDepthSource(G_ZS_PIXEL),
     41     gsDPSetFogColor(0, 0, 0, 255),
     42     gsSPFogFactor(0x0E49, 0xF2B7), // This isn't gsSPFogPosition since there is no valid min/max pair that corresponds to 0x0E49F2B7
     43     gsSPSetGeometryMode(G_FOG),
     44     gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_PASS2),
     45     gsSPLight(&ssl_lights_quicksand_pit.l, 1),
     46     gsSPLight(&ssl_lights_quicksand_pit.a, 2),
     47     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
     48     gsDPTileSync(),
     49     gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD),
     50     gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
     51     gsSPEndDisplayList(),
     52 };
     53 
     54 // 0x070048F8 - 0x07004930
     55 const Gfx ssl_dl_pyramid_quicksand_pit_end[] = {
     56     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
     57     gsDPPipeSync(),
     58     gsDPSetCycleType(G_CYC_1CYCLE),
     59     gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_NOOP2),
     60     gsSPClearGeometryMode(G_FOG),
     61     gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
     62     gsSPEndDisplayList(),
     63 };
     64 
     65 // 0x07004930 - 0x07004AB4
     66 Movtex ssl_movtex_tris_quicksand_pit[] = {
     67     MOV_TEX_SPD(         10),
     68     MOV_TEX_LIGHT_TRIS(    0, -204,    0, 127, 0, 0),
     69     MOV_TEX_LIGHT_TRIS( 1024,    0,    0, 127, 2, 0),
     70     MOV_TEX_LIGHT_TRIS(  512,    0, -886, 127, 2, 1),
     71     MOV_TEX_LIGHT_TRIS( -511,    0, -886, 127, 2, 2),
     72     MOV_TEX_LIGHT_TRIS(-1023,    0,    0, 127, 2, 3),
     73     MOV_TEX_LIGHT_TRIS( -511,    0,  887, 127, 2, 2),
     74     MOV_TEX_LIGHT_TRIS(  512,    0,  887, 127, 2, 1),
     75     MOV_TEX_LIGHT_TRIS( 1024,    0,    0, 127, 2, 0),
     76     MOV_TEX_END(),
     77 };
     78 
     79 // 0x070049B4 - 0x07004A38
     80 Movtex ssl_movtex_tris_pyramid_quicksand_pit[] = {
     81     MOV_TEX_SPD(          5),
     82     MOV_TEX_LIGHT_TRIS(    0, -204,    0, 127, 0, 0),
     83     MOV_TEX_LIGHT_TRIS( 1024,    0,    0, 127, 2, 0),
     84     MOV_TEX_LIGHT_TRIS(  512,    0, -886, 127, 2, 1),
     85     MOV_TEX_LIGHT_TRIS( -511,    0, -886, 127, 2, 2),
     86     MOV_TEX_LIGHT_TRIS(-1023,    0,    0, 127, 2, 3),
     87     MOV_TEX_LIGHT_TRIS( -511,    0,  887, 127, 2, 2),
     88     MOV_TEX_LIGHT_TRIS(  512,    0,  887, 127, 2, 1),
     89     MOV_TEX_LIGHT_TRIS( 1024,    0,    0, 127, 2, 0),
     90     MOV_TEX_END(),
     91 };
     92 
     93 // 0x07004A38 - 0x07004A70
     94 const Gfx ssl_dl_quicksand_pit[] = {
     95     gsSP2Triangles( 0,  1,  2, 0x0,  0,  2,  3, 0x0),
     96     gsSP2Triangles( 0,  3,  4, 0x0,  0,  4,  5, 0x0),
     97     gsSP2Triangles( 0,  5,  6, 0x0,  0,  6,  7, 0x0),
     98     gsSPEndDisplayList(),
     99 };
    100 
    101 // 0x07004A70 - 0x07004AE0
    102 static const Vtx ssl_seg7_vertex_07004A70[] = {
    103     {{{     0,   -204,      0}, 0, {     0,      0}, {0x00, 0x7f, 0x00, 0xff}}},
    104     {{{  1024,      0,      0}, 0, {  2016,      0}, {0x00, 0x7f, 0x00, 0xff}}},
    105     {{{   512,      0,   -886}, 0, {  2016,    992}, {0x00, 0x7f, 0x00, 0xff}}},
    106     {{{  -511,      0,   -886}, 0, {  2016,   2016}, {0x00, 0x7f, 0x00, 0xff}}},
    107     {{{ -1023,      0,      0}, 0, {  2016,   3040}, {0x00, 0x7f, 0x00, 0xff}}},
    108     {{{  -511,      0,    887}, 0, {  2016,   2016}, {0x00, 0x7f, 0x00, 0xff}}},
    109     {{{   512,      0,    887}, 0, {  2016,    992}, {0x00, 0x7f, 0x00, 0xff}}},
    110 };
    111 
    112 // 0x07004AE0 - 0x07004BE0
    113 const Gfx ssl_dl_pyramid_quicksand_pit_static[] = {
    114     gsDPPipeSync(),
    115     gsDPSetCycleType(G_CYC_2CYCLE),
    116     gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
    117     gsDPSetDepthSource(G_ZS_PIXEL),
    118     gsDPSetFogColor(0, 0, 0, 255),
    119     gsSPFogFactor(0x0E49, 0xF2B7), // This isn't gsSPFogPosition since there is no valid min/max pair that corresponds to 0x0E49F2B7
    120     gsSPSetGeometryMode(G_FOG),
    121     gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_PASS2),
    122     gsSPLight(&ssl_lights_quicksand_pit.l, 1),
    123     gsSPLight(&ssl_lights_quicksand_pit.a, 2),
    124     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
    125     gsDPLoadTextureBlock(ssl_pyramid_sand, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
    126     gsSPVertex(ssl_seg7_vertex_07004A70, 7, 0),
    127     gsSP2Triangles( 0,  1,  2, 0x0,  0,  2,  3, 0x0),
    128     gsSP2Triangles( 0,  3,  4, 0x0,  0,  4,  5, 0x0),
    129     gsSP2Triangles( 0,  5,  6, 0x0,  0,  6,  1, 0x0),
    130     gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
    131     gsDPPipeSync(),
    132     gsDPSetCycleType(G_CYC_1CYCLE),
    133     gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_NOOP2),
    134     gsSPClearGeometryMode(G_FOG),
    135     gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
    136     gsSPEndDisplayList(),
    137 };