Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DTevs.h
Go to the documentation of this file.
1#ifndef J3DTEVS_H
2#define J3DTEVS_H
3
4#include "dolphin/types.h"
7
13 /* 0x0 */ u8 field_0x0;
14 /* 0x1 */ u8 mTevColorOp;
15 /* 0x2 */ u8 mTevColorAB;
16 /* 0x3 */ u8 mTevColorCD;
17 /* 0x4 */ u8 field_0x4;
18 /* 0x5 */ u8 mTevAlphaOp;
19 /* 0x6 */ u8 mTevAlphaAB;
21 /* 0x8 */ u8 field_0x8;
22 /* 0x8 */ u8 field_0x9;
23 /* 0x8 */ u8 field_0xa;
24 /* 0x8 */ u8 field_0xb;
25 /* 0x8 */ u8 field_0xc;
26 /* 0x8 */ u8 field_0xd;
27 /* 0x8 */ u8 field_0xe;
28 /* 0x8 */ u8 field_0xf;
29 /* 0x8 */ u8 field_0x10;
30 /* 0x8 */ u8 field_0x11;
31 /* 0x8 */ u8 field_0x12;
32 /* 0x8 */ u8 field_0x13;
33};
34
36
42 /* 0x0 */ u8 field_0x0;
43 /* 0x1 */ u8 field_0x1;
44 /* 0x2 */ u8 field_0x2;
45 /* 0x3 */ u8 field_0x3;
46}; // Size: 0x4
47
49
55 /* 0x0 */ u8 mRasSel;
56 /* 0x1 */ u8 mTexSel;
57 /* 0x2 */ u8 field_0x2;
58 /* 0x3 */ u8 field_0x3;
59}; // Size: 0x4
60
62
72 void setTevColorOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5) {
73 mTevColorOp = mTevColorOp & ~(0x01 << 2) | param_1 << 2;
74 if (param_1 <= 1) {
75 mTevColorOp = mTevColorOp & ~(0x03 << 4) | param_3 << 4;
77 } else {
78 mTevColorOp = mTevColorOp & ~(0x03 << 4) | (param_1 >> 1 & 3) << 4;
79 mTevColorOp = mTevColorOp & ~0x03 | 3;
80 }
81 mTevColorOp = mTevColorOp & ~(0x01 << 3) | param_4 << 3;
82 mTevColorOp = mTevColorOp & ~(0x03 << 6) | param_5 << 6;
83 }
84
85 void setTevColorAB(u8 a, u8 b) { mTevColorAB = a << 4 | b; }
86 void setTevColorCD(u8 c, u8 d) { mTevColorCD = c << 4 | d; }
87 void setAlphaA(u8 a) { mTevAlphaAB = mTevAlphaAB & ~(0x07 << 5) | a << 5; }
88 void setAlphaB(u8 b) { mTevAlphaAB = mTevAlphaAB & ~(0x07 << 2) | b << 2; }
89 void setAlphaC(u8 c) {
90 mTevAlphaAB = mTevAlphaAB & ~0x03 | c >> 1;
91 mTevSwapModeInfo = mTevSwapModeInfo & ~(0x01 << 7) | c << 7;
92 }
93 void setAlphaD(u8 d) { mTevSwapModeInfo = mTevSwapModeInfo & ~(0x07 << 4) | d << 4; }
94 void setAlphaABCD(u8 a, u8 b, u8 c, u8 d) {
95 setAlphaA(a);
96 setAlphaB(b);
97 setAlphaC(c);
98 setAlphaD(d);
99 }
100
101 void setTevAlphaOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5) {
102 mTevAlphaOp = mTevAlphaOp & ~(0x01 << 2) | param_1 << 2;
103 if (param_1 <= 1) {
104 mTevAlphaOp = mTevAlphaOp & ~0x03 | param_2;
105 mTevAlphaOp = mTevAlphaOp & ~(0x03 << 4) | param_3 << 4;
106 } else {
107 mTevAlphaOp = mTevAlphaOp & ~(0x03 << 4) | (param_1 >> 1 & 3) << 4;
108 mTevAlphaOp = mTevAlphaOp & ~0x03 | 3;
109 }
110 mTevAlphaOp = mTevAlphaOp & ~(0x01 << 3) | param_4 << 3;
111 mTevAlphaOp = mTevAlphaOp & ~(0x03 << 6) | param_5 << 6;
112 }
113
121
126
128 setTexSel(param_0.mTexSel);
129 setRasSel(param_0.mRasSel);
130 }
133
138
141 mTevColorAB = other.mTevColorAB;
142 mTevColorCD = other.mTevColorCD;
143 mTevAlphaOp = other.mTevAlphaOp;
144 mTevAlphaAB = other.mTevAlphaAB;
145 mTevSwapModeInfo = other.mTevSwapModeInfo;
146 return *this;
147 }
148
149 /* 0x0 */ u8 field_0x0;
150 /* 0x1 */ u8 mTevColorOp;
151 /* 0x2 */ u8 mTevColorAB;
152 /* 0x3 */ u8 mTevColorCD;
153 /* 0x4 */ u8 field_0x4;
154 /* 0x5 */ u8 mTevAlphaOp;
155 /* 0x6 */ u8 mTevAlphaAB;
157};
158
164 /* 0x0 */ u8 mIndStage;
165 /* 0x1 */ u8 mIndFormat;
166 /* 0x2 */ u8 mBiasSel;
167 /* 0x3 */ u8 mMtxSel;
168 /* 0x4 */ u8 mWrapS;
169 /* 0x5 */ u8 mWrapT;
170 /* 0x6 */ u8 mPrev;
171 /* 0x7 */ u8 mLod;
172 /* 0x8 */ u8 mAlphaSel;
173 /* 0x9 */ u8 pad[3];
174};
175
177
188 setBiasSel(info.mBiasSel);
189 setMtxSel(info.mMtxSel);
190 setWrapS(info.mWrapS);
191 setWrapT(info.mWrapT);
192 setPrev(info.mPrev);
193 setLod(info.mLod);
195 }
197 void setIndFormat(u8 indFormat) { mInfo = (mInfo & ~0xc) | (indFormat << 2); }
198 void setBiasSel(u8 biasSel) { mInfo = (mInfo & ~0x70) | (biasSel << 4); }
199 void setMtxSel(u8 mtxSel) { mInfo = (mInfo & ~0x1e00) | (mtxSel << 9); }
200 void setWrapS(u8 wrapS) { mInfo = (mInfo & ~0xe000) | (wrapS << 13); }
201 void setWrapT(u8 wrapT) { mInfo = (mInfo & ~0x70000) | (wrapT << 16); }
202 void setPrev(u8 prev) { mInfo = (mInfo & ~0x100000) | (prev << 20); }
203 void setLod(u8 lod) { mInfo = (mInfo & ~0x80000) | (lod << 19); }
204 void setAlphaSel(u8 alphaSel) { mInfo = (mInfo & ~0x180) | (alphaSel << 7); }
205
207 J3DGDWriteBPCmd(mInfo | (param_1 + 0x10) * 0x1000000);
208 }
209
210 /* 0x0 */ u32 mInfo;
211};
212
219 *(u32*) this = *(u32*)&other;
220 }
221
222 /* 0x0 */ u8 mTexCoord;
223 /* 0x1 */ u8 mTexMap;
224 /* 0x2 */ u8 mColorChan;
225 /* 0x3 */ u8 field_0x3; // Maybe padding
226};
227
229
241
242extern u8 j3dTevSwapTableTable[1024];
243extern u8 const data_804563F8;
244
250 /* 8000E134 */ J3DTevSwapModeTable() { mIdx = data_804563F8; }
255 return 0x40 * param_0 + 0x10 * param_1 + 4 * param_2 + param_3;
256 }
257
258 u8 getR() { return j3dTevSwapTableTable[mIdx * 4]; }
259 u8 getG() { return j3dTevSwapTableTable[mIdx * 4 + 1]; }
260 u8 getB() { return j3dTevSwapTableTable[mIdx * 4 + 2]; }
261 u8 getA() { return j3dTevSwapTableTable[mIdx * 4 + 3]; }
262
263 /* 0x0 */ u8 mIdx;
264}; // Size: 0x1
265
266extern const GXColor j3dDefaultColInfo;
267extern const GXColor j3dDefaultAmbInfo;
268extern const GXColorS10 j3dDefaultTevColor;
269extern const GXColor j3dDefaultTevKColor;
270extern u8 j3dAlphaCmpTable[768];
271
272struct J3DNBTScale;
273struct J3DTexCoord;
276void loadTexNo(u32 param_0, u16 const& param_1);
277void patchTexNo_PtrToIdx(u32 texID, u16 const& idx);
278bool isTexNoReg(void* param_0);
279u16 getTexNoReg(void* param_0);
280
281#endif /* J3DTEVS_H */
void J3DGDWriteBPCmd(u32 cmd)
Definition J3DGD.h:27
const GXColor j3dDefaultAmbInfo
void loadTexNo(u32 param_0, u16 const &param_1)
Definition J3DTevs.cpp:280
const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable
const GXColor j3dDefaultColInfo
J3DTevSwapModeInfo const j3dDefaultTevSwapMode
u8 const data_804563F8
void patchTexNo_PtrToIdx(u32 texID, u16 const &idx)
Definition J3DTevs.cpp:297
u16 getTexNoReg(void *param_0)
Definition J3DTevs.cpp:275
void loadNBTScale(J3DNBTScale &param_0)
Definition J3DTevs.cpp:302
void loadTexCoordGens(u32 param_0, J3DTexCoord *param_1)
Definition J3DTevs.cpp:25
u8 j3dTevSwapTableTable[1024]
Definition J3DTevs.cpp:403
bool isTexNoReg(void *param_0)
Definition J3DTevs.cpp:266
const J3DTevOrderInfo j3dDefaultTevOrderInfoNull
const GXColorS10 j3dDefaultTevColor
u8 j3dAlphaCmpTable[768]
Definition J3DTevs.cpp:406
J3DTevStageInfo const j3dDefaultTevStageInfo
J3DIndTevStageInfo const j3dDefaultIndTevStageInfo
const GXColor j3dDefaultTevKColor
T cLib_calcTimer(T *value)
Definition c_lib.h:74
c
Definition e_acos.c:97
a
Definition k_cos.c:89
Definition J3DTevs.h:163
u8 pad[3]
Definition J3DTevs.h:173
u8 mAlphaSel
Definition J3DTevs.h:172
u8 mBiasSel
Definition J3DTevs.h:166
u8 mPrev
Definition J3DTevs.h:170
u8 mWrapS
Definition J3DTevs.h:168
u8 mWrapT
Definition J3DTevs.h:169
u8 mLod
Definition J3DTevs.h:171
u8 mMtxSel
Definition J3DTevs.h:167
u8 mIndFormat
Definition J3DTevs.h:165
u8 mIndStage
Definition J3DTevs.h:164
Definition J3DTevs.h:182
void setWrapT(u8 wrapT)
Definition J3DTevs.h:201
void setPrev(u8 prev)
Definition J3DTevs.h:202
void setIndTevStageInfo(J3DIndTevStageInfo const &info)
Definition J3DTevs.h:185
void setBiasSel(u8 biasSel)
Definition J3DTevs.h:198
void setLod(u8 lod)
Definition J3DTevs.h:203
J3DIndTevStage(J3DIndTevStageInfo const &info)
Definition J3DTevs.h:184
void setIndFormat(u8 indFormat)
Definition J3DTevs.h:197
void setWrapS(u8 wrapS)
Definition J3DTevs.h:200
u32 mInfo
Definition J3DTevs.h:210
void setMtxSel(u8 mtxSel)
Definition J3DTevs.h:199
void setIndStage(u8 indStage)
Definition J3DTevs.h:196
void load(u32 param_1)
Definition J3DTevs.h:206
void setAlphaSel(u8 alphaSel)
Definition J3DTevs.h:204
J3DIndTevStage()
Definition J3DTevs.h:183
Definition J3DMatBlock.h:51
Definition J3DTevs.h:217
u8 mColorChan
Definition J3DTevs.h:224
u8 mTexMap
Definition J3DTevs.h:223
void operator=(const J3DTevOrderInfo &other)
Definition J3DTevs.h:218
u8 field_0x3
Definition J3DTevs.h:225
u8 mTexCoord
Definition J3DTevs.h:222
Definition J3DTevs.h:234
J3DTevOrder(const J3DTevOrderInfo &info)
Definition J3DTevs.h:236
J3DTevOrderInfo & getTevOrderInfo()
Definition J3DTevs.h:237
u8 getTexMap()
Definition J3DTevs.h:239
J3DTevOrder()
Definition J3DTevs.h:235
Definition J3DTevs.h:12
u8 mTevColorAB
Definition J3DTevs.h:15
u8 field_0x0
Definition J3DTevs.h:13
u8 field_0xd
Definition J3DTevs.h:26
u8 field_0x13
Definition J3DTevs.h:32
u8 field_0x10
Definition J3DTevs.h:29
u8 field_0x8
Definition J3DTevs.h:21
u8 mTevColorCD
Definition J3DTevs.h:16
u8 field_0x9
Definition J3DTevs.h:22
u8 mTevSwapModeInfo
Definition J3DTevs.h:20
u8 mTevColorOp
Definition J3DTevs.h:14
u8 field_0xb
Definition J3DTevs.h:24
u8 field_0xe
Definition J3DTevs.h:27
u8 field_0x4
Definition J3DTevs.h:17
u8 mTevAlphaOp
Definition J3DTevs.h:18
u8 mTevAlphaAB
Definition J3DTevs.h:19
u8 field_0xa
Definition J3DTevs.h:23
u8 field_0x11
Definition J3DTevs.h:30
u8 field_0x12
Definition J3DTevs.h:31
u8 field_0xf
Definition J3DTevs.h:28
u8 field_0xc
Definition J3DTevs.h:25
Definition J3DTevs.h:67
J3DTevStage & operator=(const J3DTevStage &other)
Definition J3DTevs.h:139
void setTevColorCD(u8 c, u8 d)
Definition J3DTevs.h:86
void setRasSel(u8 ras_sel)
Definition J3DTevs.h:131
u8 mTevSwapModeInfo
Definition J3DTevs.h:156
u8 field_0x0
Definition J3DTevs.h:149
void setTevSwapModeInfo(J3DTevSwapModeInfo const &param_0)
Definition J3DTevs.h:127
J3DTevStage()
Definition J3DTevs.h:68
void load(u32 param_1)
Definition J3DTevs.h:134
u8 mTevColorCD
Definition J3DTevs.h:152
u8 mTevAlphaAB
Definition J3DTevs.h:155
u8 mTevAlphaOp
Definition J3DTevs.h:154
u8 mTevColorAB
Definition J3DTevs.h:151
u8 field_0x4
Definition J3DTevs.h:153
void setAlphaB(u8 b)
Definition J3DTevs.h:88
void setTevColorAB(u8 a, u8 b)
Definition J3DTevs.h:85
void setAlphaC(u8 c)
Definition J3DTevs.h:89
void setTevAlphaOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5)
Definition J3DTevs.h:101
u8 mTevColorOp
Definition J3DTevs.h:150
void setTevColorOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5)
Definition J3DTevs.h:72
void setTexSel(u8 tex_sel)
Definition J3DTevs.h:132
void setAlphaA(u8 a)
Definition J3DTevs.h:87
void setAlphaABCD(u8 a, u8 b, u8 c, u8 d)
Definition J3DTevs.h:94
void setAlphaD(u8 d)
Definition J3DTevs.h:93
void setTevStageInfo(const J3DTevStageInfo &info)
Definition J3DTevs.h:114
J3DTevStage(J3DTevStageInfo const &param_0)
Definition J3DTevs.h:122
Definition J3DTevs.h:54
u8 mTexSel
Definition J3DTevs.h:56
u8 field_0x2
Definition J3DTevs.h:57
u8 mRasSel
Definition J3DTevs.h:55
u8 field_0x3
Definition J3DTevs.h:58
Definition J3DTevs.h:41
u8 field_0x3
Definition J3DTevs.h:45
u8 field_0x1
Definition J3DTevs.h:43
u8 field_0x0
Definition J3DTevs.h:42
u8 field_0x2
Definition J3DTevs.h:44
Definition J3DTevs.h:249
u8 mIdx
Definition J3DTevs.h:263
J3DTevSwapModeTable(J3DTevSwapModeTableInfo const &info)
Definition J3DTevs.h:251
u8 getA()
Definition J3DTevs.h:261
J3DTevSwapModeTable()
Definition J3DTevs.h:250
u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3)
Definition J3DTevs.h:254
u8 getG()
Definition J3DTevs.h:259
u8 getB()
Definition J3DTevs.h:260
u8 getR()
Definition J3DTevs.h:258
Definition J3DTexture.h:81
Definition d_a_obj_sekizoa.cpp:191
Definition d_a_ep.cpp:68
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8