Files
KataMario/levels/ssl/areas/2/4/model.inc.c
T
5a9b5a9751 Mat Stack Fix
* Implemented new lightweight CPU/RDP profiler
* Added RSP profiling to the lightweight profiler
* Added CPU audio to lightweight profiler
* Changed lingering manual light struct definitions to gdSPDefLights1, made a dummy light for Koopa's pink shorts
* Ran script to convert all light commands to lightcolor commands
* Added define guards for the profiler
* Wrote function for setting up global light direction in the frame
* Moved camera matrix into projection stack
* Corrected cameraToObject for the new matrix stack (fixes culling and sound)
* Fixed billboarding with new matrix stack
* Fixed shadows with new matrix stack
* Fixed some areas where the game was previously extracting the camera matrix from various matrices
* Restored vanilla light and env map directions under new matrix stack
* Fix goddard crash
* Fix geo_process_level_of_detail
* Remove 'construct_float' from 'geo_process_level_of_detail'
* Removed some accidentally added files
* Removed unnecessary matrix multiplications in geo_process_object
* Added fixlights script to build system for fixing custom assets and added option to disable it if needed
* Fixed visual debug with new matstack and cleaned up visual debug code
* Fixed handling of WORLD_SCALE in view matrix so it doesn't get cancelled out
* Fixed clip planes not scaling based on WORLD_SCALE

Co-authored-by: Mr-Wiseguy <mrwiseguyromhacking@gmail.com>
Co-authored-by: Arceveti <arceveti@gmail.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>
2022-07-19 08:04:54 -05:00

134 lines
5.4 KiB
C

// Quicksand Pit
// 0x07004000 - 0x07004018
// 0x07004018 - 0x07004818
ALIGNED8 const Texture ssl_quicksand[] = {
#include "levels/ssl/7.rgba16.inc.c"
};
// 0x07004818 - 0x07004860
const Gfx ssl_dl_quicksand_pit_begin[] = {
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB),
gsSPLightColor(LIGHT_1, 0xffffffff),
gsSPLightColor(LIGHT_2, 0x3f3f3fff),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPTileSync(),
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),
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPEndDisplayList(),
};
// 0x07004860 - 0x07004880
const Gfx ssl_dl_quicksand_pit_end[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
// 0x07004880 - 0x070048F8
const Gfx ssl_dl_pyramid_quicksand_pit_begin[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_2CYCLE),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetDepthSource(G_ZS_PIXEL),
gsDPSetFogColor(0, 0, 0, 255),
gsSPFogFactor(0x0E49, 0xF2B7), // This isn't gsSPFogPosition since there is no valid min/max pair that corresponds to 0x0E49F2B7
gsSPSetGeometryMode(G_FOG),
gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_PASS2),
gsSPLightColor(LIGHT_1, 0xffffffff),
gsSPLightColor(LIGHT_2, 0x3f3f3fff),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPTileSync(),
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),
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPEndDisplayList(),
};
// 0x070048F8 - 0x07004930
const Gfx ssl_dl_pyramid_quicksand_pit_end[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_NOOP2),
gsSPClearGeometryMode(G_FOG),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
// 0x07004930 - 0x07004AB4
Movtex ssl_movtex_tris_quicksand_pit[] = {
MOV_TEX_SPD( 10),
MOV_TEX_LIGHT_TRIS( 0, -204, 0, 127, 0, 0),
MOV_TEX_LIGHT_TRIS( 1024, 0, 0, 127, 2, 0),
MOV_TEX_LIGHT_TRIS( 512, 0, -886, 127, 2, 1),
MOV_TEX_LIGHT_TRIS( -511, 0, -886, 127, 2, 2),
MOV_TEX_LIGHT_TRIS(-1023, 0, 0, 127, 2, 3),
MOV_TEX_LIGHT_TRIS( -511, 0, 887, 127, 2, 2),
MOV_TEX_LIGHT_TRIS( 512, 0, 887, 127, 2, 1),
MOV_TEX_LIGHT_TRIS( 1024, 0, 0, 127, 2, 0),
MOV_TEX_END(),
};
// 0x070049B4 - 0x07004A38
Movtex ssl_movtex_tris_pyramid_quicksand_pit[] = {
MOV_TEX_SPD( 5),
MOV_TEX_LIGHT_TRIS( 0, -204, 0, 127, 0, 0),
MOV_TEX_LIGHT_TRIS( 1024, 0, 0, 127, 2, 0),
MOV_TEX_LIGHT_TRIS( 512, 0, -886, 127, 2, 1),
MOV_TEX_LIGHT_TRIS( -511, 0, -886, 127, 2, 2),
MOV_TEX_LIGHT_TRIS(-1023, 0, 0, 127, 2, 3),
MOV_TEX_LIGHT_TRIS( -511, 0, 887, 127, 2, 2),
MOV_TEX_LIGHT_TRIS( 512, 0, 887, 127, 2, 1),
MOV_TEX_LIGHT_TRIS( 1024, 0, 0, 127, 2, 0),
MOV_TEX_END(),
};
// 0x07004A38 - 0x07004A70
const Gfx ssl_dl_quicksand_pit[] = {
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
gsSP2Triangles( 0, 3, 4, 0x0, 0, 4, 5, 0x0),
gsSP2Triangles( 0, 5, 6, 0x0, 0, 6, 7, 0x0),
gsSPEndDisplayList(),
};
// 0x07004A70 - 0x07004AE0
static const Vtx ssl_seg7_vertex_07004A70[] = {
{{{ 0, -204, 0}, 0, { 0, 0}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ 1024, 0, 0}, 0, { 2016, 0}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ 512, 0, -886}, 0, { 2016, 992}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ -511, 0, -886}, 0, { 2016, 2016}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ -1023, 0, 0}, 0, { 2016, 3040}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ -511, 0, 887}, 0, { 2016, 2016}, {0x00, 0x7f, 0x00, 0xff}}},
{{{ 512, 0, 887}, 0, { 2016, 992}, {0x00, 0x7f, 0x00, 0xff}}},
};
// 0x07004AE0 - 0x07004BE0
const Gfx ssl_dl_pyramid_quicksand_pit_static[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_2CYCLE),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetDepthSource(G_ZS_PIXEL),
gsDPSetFogColor(0, 0, 0, 255),
gsSPFogFactor(0x0E49, 0xF2B7), // This isn't gsSPFogPosition since there is no valid min/max pair that corresponds to 0x0E49F2B7
gsSPSetGeometryMode(G_FOG),
gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_PASS2),
gsSPLightColor(LIGHT_1, 0xffffffff),
gsSPLightColor(LIGHT_2, 0x3f3f3fff),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
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),
gsSPVertex(ssl_seg7_vertex_07004A70, 7, 0),
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
gsSP2Triangles( 0, 3, 4, 0x0, 0, 4, 5, 0x0),
gsSP2Triangles( 0, 5, 6, 0x0, 0, 6, 1, 0x0),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_NOOP2),
gsSPClearGeometryMode(G_FOG),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};