Skip to content

Commit

Permalink
minor additions
Browse files Browse the repository at this point in the history
  • Loading branch information
HailSanta authored and HailSanta committed Nov 10, 2023
1 parent 70a11c5 commit 640442d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
2 changes: 2 additions & 0 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@

#define PACK_PAL_RGBA(r, g, b, a) (((r) << 11) | ((g) << 6) | ((b) << 1) | (a));

#define PM_RM_TILEMODE_B GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA)

#define PM_CC_01 0, 0, 0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_02 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_03 TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0
Expand Down
50 changes: 25 additions & 25 deletions src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Gfx* ModelRenderModes[] = {
[RENDER_MODE_IDX_3C] Gfx_RM3_CLOUD_NO_ZB,
};

Gfx ModelCombineModesA[21][5] = {
Gfx ModelCombineModesStandard[21][5] = {
{
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2),
Expand Down Expand Up @@ -297,7 +297,7 @@ Gfx ModelCombineModesA[21][5] = {
},
};

Gfx ModelCombineModesB[21][5] = {
Gfx ModelCombineModesAlphaTest[21][5] = {
{
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2),
Expand Down Expand Up @@ -1261,7 +1261,7 @@ enum {
TILE_MODE_1A = 1, // render modes are single-cycle
TILE_MODE_2A = 2, // render modes are two-cycle, starting with G_RM_PASS
TILE_MODE_3A = 3, // render modes are two-cycle, starting with G_RM_FOG_SHADE_A
TILE_MODE_1B = 4,
TILE_MODE_1B = 4, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite
TILE_MODE_2B = 5,
TILE_MODE_3B = 6,
TILE_MODE_1C = 10,
Expand Down Expand Up @@ -1445,9 +1445,9 @@ void appendGfx_model(void* data) {
}

if (renderMode != RENDER_MODE_ALPHATEST && renderMode != RENDER_MODE_ALPHATEST_ONESIDED) {
*(*gfxPos) = ModelCombineModesA[combineType][combineSubType];
*(*gfxPos) = ModelCombineModesStandard[combineType][combineSubType];
} else {
*(*gfxPos) = ModelCombineModesB[combineType][combineSubType];
*(*gfxPos) = ModelCombineModesAlphaTest[combineType][combineSubType];
}
(*gfxPos)++;
}
Expand Down Expand Up @@ -1661,61 +1661,61 @@ void appendGfx_model(void* data) {
gSPDisplayList((*gfxPos)++, ModelRenderModes[RENDER_MODE_IDX_10]);
switch (renderMode) {
case RENDER_MODE_SURFACE_OPA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_OPA_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_OPA_SURF2);
break;
case RENDER_MODE_SURFACE_OPA_NO_AA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_ZB_OPA_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_ZB_OPA_SURF2);
break;
case RENDER_MODE_DECAL_OPA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_OPA_DECAL2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_OPA_DECAL2);
break;
case RENDER_MODE_DECAL_OPA_NO_AA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_ZB_OPA_DECAL2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_ZB_OPA_DECAL2);
break;
case RENDER_MODE_INTERSECTING_OPA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_OPA_INTER2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_OPA_INTER2);
break;
case RENDER_MODE_ALPHATEST:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_TEX_EDGE2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_TEX_EDGE2);
break;
case RENDER_MODE_ALPHATEST_ONESIDED:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_TEX_EDGE2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_TEX_EDGE2);
break;
case RENDER_MODE_SURFACE_XLU_LAYER1:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_SURF2);
break;
case RENDER_MODE_SURFACE_XLU_LAYER2:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_SURF2);
break;
case RENDER_MODE_SURFACE_XLU_LAYER3:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_SURF2);
break;
case RENDER_MODE_SURFACE_XLU_NO_AA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_ZB_XLU_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_ZB_XLU_SURF2);
break;
case RENDER_MODE_DECAL_XLU:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_DECAL2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_DECAL2);
break;
case RENDER_MODE_DECAL_XLU_NO_AA:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_DECAL2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_DECAL2);
break;
case RENDER_MODE_INTERSECTING_XLU:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_ZB_XLU_INTER2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_ZB_XLU_INTER2);
break;
case RENDER_MODE_SURFACE_OPA_NO_ZB:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_OPA_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_OPA_SURF2);
break;
case RENDER_MODE_ALPHATEST_NO_ZB:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_TEX_EDGE2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_TEX_EDGE2);
break;
case RENDER_MODE_SURFACE_XLU_NO_ZB:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_AA_XLU_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_AA_XLU_SURF2);
break;
case RENDER_MODE_CLOUD:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_ZB_CLD_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_ZB_CLD_SURF2);
break;
case RENDER_MODE_CLOUD_NO_ZB:
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_CLD_SURF2);
gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_CLD_SURF2);
break;
}
gDPSetFogColor((*gfxPos)++, gCurrentFogSettings->color.r,
Expand Down Expand Up @@ -3055,7 +3055,7 @@ void make_texture_gfx(TextureHeader* header, Gfx** gfxPos, IMG_PTR raster, PAL_P
renderType = header->extraTiles * 3 + 1 + header->colorCombineSubType;
}

**gfxPos = ModelCombineModesA[renderType][0];
**gfxPos = ModelCombineModesStandard[renderType][0];
(*gfxPos)++;

switch (extraTileType) {
Expand Down
2 changes: 1 addition & 1 deletion src/world/partner/goombario.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ s32 N(EntityTattles)[] = {
ENTITY_TYPE_CHEST, MSG_EntityTattle_Chest,
ENTITY_TYPE_WOODEN_CRATE, MSG_EntityTattle_WoodenCrate_CantBreak,
ENTITY_TYPE_BOARDED_FLOOR, MSG_EntityTattle_BoardedFloor_CantBreak,
ENTITY_TYPE_STAR_BOX_LAUNCHER, MSG_EntityTattle_JackInTheBox_SpinJump,
ENTITY_TYPE_STAR_BOX_LAUNCHER, MSG_EntityTattle_JackInTheBox_SpinJump,
ENTITY_TYPE_BELLBELL_PLANT, MSG_EntityTattle_BellbellPlant,
ENTITY_TYPE_TRUMPET_PLANT, MSG_EntityTattle_TrumpetPlant,
ENTITY_TYPE_CYMBAL_PLANT, MSG_EntityTattle_CymbalBush,
Expand Down
4 changes: 2 additions & 2 deletions ver/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4451,9 +4451,9 @@ func_8014AFA0 = 0x8014AFA0; // type:func rom:0xE16A0
D_8014AFB0 = 0x8014AFB0; // rom:0xE16B0
D_8014AFB4 = 0x8014AFB4; // rom:0xE16B4
ModelRenderModes = 0x8014AFC0; // rom:0xE16C0
ModelCombineModesA = 0x8014B0B8; // rom:0xE17B8
ModelCombineModesStandard = 0x8014B0B8; // rom:0xE17B8
D_8014B0BC = 0x8014B0BC; // rom:0xE17BC
ModelCombineModesB = 0x8014B400; // rom:0xE1B00
ModelCombineModesAlphaTest = 0x8014B400; // rom:0xE1B00
D_8014B404 = 0x8014B404; // rom:0xE1B04
TextureHeapBase = 0x8014B748; // rom:0xE1E48
mdl_bgMultiplyColorA = 0x8014B74C; // rom:0xE1E4C
Expand Down

0 comments on commit 640442d

Please sign in to comment.