summaryrefslogtreecommitdiff
path: root/src/code/z_viscvg.c
diff options
context:
space:
mode:
authormzxrules <mzxrules@gmail.com>2023-05-29 17:40:10 -0400
committerGitHub <noreply@github.com>2023-05-29 17:40:10 -0400
commit65d72a54cf712292f0bb97af8eeaa10c2eeb2e8c (patch)
tree25b5e09d8aea798a67649b388aef95e13c8e68e8 /src/code/z_viscvg.c
parentaa0a968791eb62ab02f2ce0b9e073362ebdd7243 (diff)
z_syscfb.c, z_vimode.c, code_80140CE0 split and OK (#1159)
* z_vimode * Fixups * WIP * matching * sys_cfb OK * some documentation * vimode docs, name all syscfb vars * quick fixes * suggested changes, more things I missed * merge suggestions * code_80140CE0 -> z_viscvg * format * update symbols * more suggestions * fix include order * sNotebookViMode comment, bss fix --------- Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk> Co-authored-by: louist103 <louist103@gmail.com>
Diffstat (limited to 'src/code/z_viscvg.c')
-rw-r--r--src/code/z_viscvg.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/code/z_viscvg.c b/src/code/z_viscvg.c
new file mode 100644
index 000000000..888fa19b3
--- /dev/null
+++ b/src/code/z_viscvg.c
@@ -0,0 +1,90 @@
+#include "global.h"
+
+Gfx D_801C5DD0[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
+ gsSPBranchList(D_0E000000.fillRect),
+};
+
+Gfx D_801C5DE0[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
+ gsSPBranchList(D_0E000000.fillRect),
+};
+
+Gfx D_801C5DF0[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
+ gsSPBranchList(D_0E000000.fillRect),
+};
+
+Gfx D_801C5E00[] = {
+ gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
+ gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
+ gsSPDisplayList(D_0E000000.fillRect),
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
+ gsSPBranchList(D_0E000000.fillRect),
+};
+
+void VisCvg_Init(struct_801F8010* this) {
+ this->type = 0;
+ this->setScissor = false;
+ this->color.r = 255;
+ this->color.g = 255;
+ this->color.b = 255;
+ this->color.a = 255;
+}
+
+void VisCvg_Destroy(struct_801F8010* this) {
+}
+
+void VisCvg_Draw(struct_801F8010* this, Gfx** gfxp) {
+ Gfx* gfx = *gfxp;
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimDepth(gfx++, -1, -1);
+
+ if (this->setScissor == true) {
+ gSPDisplayList(gfx++, D_0E000000.setScissor);
+ }
+
+ switch (this->type) {
+ case 1:
+ gSPDisplayList(gfx++, D_801C5DF0);
+ break;
+
+ case 2:
+ gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
+ gSPDisplayList(gfx++, D_801C5E00);
+ break;
+
+ case 3:
+ gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba);
+ gSPDisplayList(gfx++, D_801C5DD0);
+ break;
+
+ case 4:
+ gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba);
+ gSPDisplayList(gfx++, D_801C5DE0);
+ break;
+
+ default:
+ break;
+ }
+
+ gDPPipeSync(gfx++);
+ *gfxp = gfx;
+}