diff options
| author | hatal175 <hatal175@users.noreply.github.com> | 2023-07-21 14:08:32 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-21 14:08:32 +0300 |
| commit | 912a14e57dc4fdeb192a23864fc2abc37166c0b1 (patch) | |
| tree | 14e7bac8c51bf2b72692ffb5afc3b7f2c3f68a01 /include/JSystem/J2DGraph | |
| parent | 2e177620128983214229a2b897c4952e28854526 (diff) | |
| parent | d331fd53e3713cc6d3c4a59b9771ec10454ffad7 (diff) | |
Merge pull request #379 from Jcw87/JAISeq
JAISeq, JAISe, and others
Diffstat (limited to 'include/JSystem/J2DGraph')
| -rw-r--r-- | include/JSystem/J2DGraph/J2DMatBlock.h | 10 | ||||
| -rw-r--r-- | include/JSystem/J2DGraph/J2DTevs.h | 67 |
2 files changed, 58 insertions, 19 deletions
diff --git a/include/JSystem/J2DGraph/J2DMatBlock.h b/include/JSystem/J2DGraph/J2DMatBlock.h index 1a036dc072..5473a3a0c1 100644 --- a/include/JSystem/J2DGraph/J2DMatBlock.h +++ b/include/JSystem/J2DGraph/J2DMatBlock.h @@ -16,6 +16,16 @@ struct ResTLUT; struct J2DGXColorS10 : public GXColorS10 { /* 802F1B90 */ J2DGXColorS10(); + + /* + J2DGXColorS10& operator=(const GXColorS10& other) { + r = other.r; + g = other.g; + b = other.b; + a = other.a; + return *this; + } + */ }; struct J2DTevSwapModeInfo; diff --git a/include/JSystem/J2DGraph/J2DTevs.h b/include/JSystem/J2DGraph/J2DTevs.h index 6a561e9557..1fdcc0c0f9 100644 --- a/include/JSystem/J2DGraph/J2DTevs.h +++ b/include/JSystem/J2DGraph/J2DTevs.h @@ -124,11 +124,31 @@ private: /* 0x0 */ J2DIndTexCoordScaleInfo mInfo; }; // Size: 0x2 +struct J2DIndTevStageInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; + /* 0x4 */ u8 field_0x4; + /* 0x5 */ u8 field_0x5; + /* 0x6 */ u8 field_0x6; + /* 0x7 */ u8 field_0x7; + /* 0x8 */ int field_0x8; +}; + +inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) { + return (info.field_0x8 << 22) | (info.field_0x7 << 21) | (info.field_0x6 << 20) | + (info.field_0x3 << 16) | (info.field_0x5 << 11) | (info.field_0x4 << 8) | + (info.field_0x2 << 4) | (info.field_0x1 << 2) | info.field_0x0; +} + class J2DIndTevStage { public: /* 802EA044 */ void load(u8); /* 802F18A0 */ J2DIndTevStage(); + void setIndTevStageInfo(const J2DIndTevStageInfo& info) { mFlags = J2DCalcIndTevStage(info); } + private: /* 0x0 */ u32 mFlags; @@ -143,24 +163,6 @@ private: GXIndTexAlphaSel getAlphaSel() const { return (GXIndTexAlphaSel)((mFlags >> 22) & 0x03); } }; -struct J2DIndTevStageInfo { - /* 0x0 */ u8 field_0x0; - /* 0x1 */ u8 field_0x1; - /* 0x2 */ u8 field_0x2; - /* 0x3 */ u8 field_0x3; - /* 0x4 */ u8 field_0x4; - /* 0x5 */ u8 field_0x5; - /* 0x6 */ u8 field_0x6; - /* 0x7 */ u8 field_0x7; - /* 0x8 */ int field_0x8; -}; - -inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) { - return (info.field_0x8 << 22) | (info.field_0x7 << 21) | (info.field_0x6 << 20) | - (info.field_0x3 << 16) | (info.field_0x5 << 11) | (info.field_0x4 << 8) | - (info.field_0x2 << 4) | (info.field_0x1 << 2) | info.field_0x0; -} - struct J2DTexCoordInfo { /* 0x0 */ u8 mTexGenType; /* 0x1 */ u8 mTexGenSrc; @@ -191,18 +193,26 @@ struct J2DTevOrderInfo { /* 0x0 */ u8 mTexCoord; /* 0x1 */ u8 mTexMap; /* 0x2 */ u8 mColor; + /* 0x3 */ u8 field_0x3; + + J2DTevOrderInfo& operator=(const J2DTevOrderInfo& other) { + mTexCoord = other.mTexCoord; + mTexMap = other.mTexMap; + mColor = other.mColor; + return *this; + } }; class J2DTevOrder { public: /* 802F1B70 */ J2DTevOrder(); + void setTevOrderInfo(const J2DTevOrderInfo& info) {mTevOrderInfo = info; } GXChannelID getColor() const { return (GXChannelID)mTevOrderInfo.mColor; } GXTexMapID getTexMap() const { return (GXTexMapID)mTevOrderInfo.mTexMap; } GXTexCoordID getTexCoord() const { return (GXTexCoordID)mTevOrderInfo.mTexCoord; } /* 0x0 */ J2DTevOrderInfo mTevOrderInfo; - /* 0x4 */ u8 field_0x4; }; struct J2DTevStageInfo { @@ -240,6 +250,11 @@ public: /* 802F1940 */ J2DTevStage(); /* 802F19A8 */ void setTevStageInfo(J2DTevStageInfo const&); + void setStageNo(u32 param_0) { + field_0x0 = (param_0 << 1) - 0x40; + field_0x4 = (param_0 << 1) - 0x3f; + } + void setTevSwapModeInfo(const J2DTevSwapModeInfo& swapInfo) { setTexSel(swapInfo.field_0x1); setRasSel(swapInfo.field_0x0); @@ -358,10 +373,24 @@ private: /* 0x7 */ u8 field_0x7; }; +struct J2DTevSwapModeTableInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; + +inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { + return (param_0 << 6) + (param_1 << 4) + (param_2 << 2) + param_3; +} + class J2DTevSwapModeTable { public: /* 802F1934 */ J2DTevSwapModeTable(); + void setTevSwapModeTableInfo(const J2DTevSwapModeTableInfo& info) { + field_0x0 = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3); + } u8 getR() { return field_0x0 >> 6 & 3; } u8 getG() { return field_0x0 >> 4 & 3; } u8 getB() { return field_0x0 >> 2 & 3; } |
