Merge pull request #496 from Jcw87/J3DTevs

J3DTevs
This commit is contained in:
Jasper St. Pierre
2023-09-30 10:14:17 -07:00
committed by GitHub
10 changed files with 428 additions and 166 deletions
@@ -14,17 +14,6 @@ struct J3DGXColor : public GXColor {
J3DGXColor() {}
};
struct J3DNBTScale : public J3DNBTScaleInfo {
J3DNBTScale() {}
J3DNBTScale(J3DNBTScaleInfo const& info) {
mbHasScale = info.mbHasScale;
mScale = info.mScale;
}
Vec* getScale() { return &mScale; }
};
extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo;
class J3DTexGenBlock {
public:
virtual void reset(J3DTexGenBlock*);
@@ -536,8 +525,6 @@ private:
/* 0x18 */ J3DIndTevStage mIndTevStage[1];
}; // Size: 0x1C
extern const u16 j3dDefaultZModeID;
inline u16 calcZModeID(u8 param_0, u8 param_1, u8 param_2) {
return ((param_1 * 2) & 0x1FE) + (param_0 * 0x10) + param_2;
}
@@ -568,15 +555,6 @@ struct J3DZMode {
/* 0x0 */ u16 mZModeID;
};
struct J3DBlendInfo {
/* 0x0 */ u8 mType;
/* 0x1 */ u8 mSrcFactor;
/* 0x2 */ u8 mDstFactor;
/* 0x3 */ u8 mOp;
};
extern const J3DBlendInfo j3dDefaultBlendInfo;
struct J3DBlend : public J3DBlendInfo {
J3DBlend() { *(J3DBlendInfo*)this = j3dDefaultBlendInfo; }
@@ -613,8 +591,6 @@ struct J3DAlphaCompInfo {
/* 0x7 */ u8 field_0x7;
};
extern const u16 j3dDefaultAlphaCmpID;
inline u32 calcAlphaCmpID(u32 param_1, u32 param_2, u32 param_3) {
return ((param_1 & 0xff) << 5) + ((param_2 & 0xff) << 3) + (param_3 & 0xff);
}
@@ -892,15 +868,6 @@ public:
virtual ~J3DIndBlockNull();
};
struct J3DColorChanInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 field_0x5;
};
/*
inline u32 setChanCtrlMacro(u8 param_0, GXColorSrc param_1, GXColorSrc param_2, u32 param_3, GXDiffuseFn param_4, GXAttnFn param_5) {
GXDiffuseFn r31;
+96 -19
View File
@@ -17,23 +17,6 @@ public:
/* 0x28 */ Vec mDistAtten;
}; // Size = 0x34
extern "C" extern J3DLightInfo const j3dDefaultLightInfo;
class J3DLightObj {
public:
/* 80018C0C */ J3DLightObj() { mInfo = j3dDefaultLightInfo; }
/* 80323590 */ void load(u32) const;
J3DLightInfo& getLightInfo() { return mInfo; }
J3DLightObj& operator=(J3DLightObj const& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x00 */ J3DLightInfo mInfo;
/* 0x34 */ u8 field_0x34[64];
}; // Size = 0x74
struct J3DTextureSRTInfo {
/* 0x00 */ f32 mScaleX;
/* 0x04 */ f32 mScaleY;
@@ -47,10 +30,11 @@ struct J3DTexMtxInfo {
/* 80325794 */ void setEffectMtx(Mtx);
/* 0x00 */ u8 mProjection;
/* 0x01 */ s8 mInfo;
/* 0x01 */ u8 mInfo;
/* 0x02 */ u8 padding[2];
/* 0x04 */ Vec mCenter;
/* 0x10 */ J3DTextureSRTInfo mSRT;
/* 0x24 */ Mtx44 mEffectMtx;
/* 0x24 */ Mtx44 mEffectMtx;
}; // Size: 0x64
struct J3DIndTexMtxInfo {
@@ -77,4 +61,97 @@ struct J3DNBTScaleInfo {
inline void operator=(const J3DNBTScaleInfo & other) { mbHasScale = other.mbHasScale; mScale = other.mScale; }
}; // Size: 0x10
struct J3DIndTexOrderInfo {
/* 0x0 */ u8 mCoord;
/* 0x1 */ u8 mMap;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
struct J3DTevSwapModeInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
};
struct J3DTevSwapModeTableInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
struct J3DTevStageInfo {
/* 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 */ u8 field_0x8;
/* 0x9 */ u8 field_0x9;
/* 0xA */ u8 field_0xa;
/* 0xB */ u8 field_0xb;
/* 0xC */ u8 field_0xc;
/* 0xD */ u8 field_0xd;
/* 0xE */ u8 field_0xe;
/* 0xF */ u8 field_0xf;
/* 0x10 */ u8 field_0x10;
/* 0x11 */ u8 field_0x11;
/* 0x12 */ u8 field_0x12;
/* 0x13 */ u8 field_0x13;
};
struct J3DIndTevStageInfo {
/* 0x0 */ u8 mIndStage;
/* 0x1 */ u8 mIndFormat;
/* 0x2 */ u8 mBiasSel;
/* 0x3 */ u8 mMtxSel;
/* 0x4 */ u8 mWrapS;
/* 0x5 */ u8 mWrapT;
/* 0x6 */ u8 mPrev;
/* 0x7 */ u8 mLod;
/* 0x8 */ u8 mAlphaSel;
};
struct J3DTexCoordInfo {
/* 0x0 */ u8 mTexGenType __attribute__((aligned(4)));
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
};
struct J3DIndTexCoordScaleInfo {
/* 0x0 */ u8 mScaleS;
/* 0x1 */ u8 mScaleT;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
struct J3DBlendInfo {
/* 0x0 */ u8 mType;
/* 0x1 */ u8 mSrcFactor;
/* 0x2 */ u8 mDstFactor;
/* 0x3 */ u8 mOp;
};
struct J3DTevOrderInfo {
/* 0x0 */ u8 mTexCoord __attribute__((aligned(2)));
/* 0x1 */ u8 mTexMap;
/* 0x2 */ u8 mColorChan;
};
struct J3DColorChanInfo {
/* 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;
};
STATIC_ASSERT(sizeof(J3DTevStageInfo) == 0x14);
#endif /* J3DSTRUCT_H */
+47 -46
View File
@@ -2,33 +2,34 @@
#define J3DTEVS_H
#include "JSystem/J3DGraphBase/J3DGD.h"
#include "JSystem/J3DGraphBase/J3DStruct.h"
extern u8 j3dTevSwapTableTable[1024];
struct J3DTevStageInfo {
/* 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 */ u8 field_0x8;
/* 0x9 */ u8 field_0x9;
/* 0xA */ u8 field_0xa;
/* 0xB */ u8 field_0xb;
/* 0xC */ u8 field_0xc;
/* 0xD */ u8 field_0xd;
/* 0xE */ u8 field_0xe;
/* 0xF */ u8 field_0xf;
/* 0x10 */ u8 field_0x10;
/* 0x11 */ u8 field_0x11;
/* 0x12 */ u8 field_0x12;
/* 0x13 */ u8 field_0x13;
};
extern const J3DLightInfo j3dDefaultLightInfo;
extern const J3DTexCoordInfo j3dDefaultTexCoordInfo[8];
extern const J3DTexMtxInfo j3dDefaultTexMtxInfo;
extern const J3DIndTexMtxInfo j3dDefaultIndTexMtxInfo;
extern const J3DTevStageInfo j3dDefaultTevStageInfo;
extern const J3DIndTevStageInfo j3dDefaultIndTevStageInfo;
extern const J3DFogInfo j3dDefaultFogInfo;
extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo;
STATIC_ASSERT(sizeof(J3DTevStageInfo) == 0x14);
extern const GXColor j3dDefaultColInfo;
extern const GXColor j3dDefaultAmbInfo;
extern const u8 j3dDefaultColorChanNum;
extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull;
extern const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull;
extern const GXColorS10 j3dDefaultTevColor;
extern const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo;
extern const GXColor j3dDefaultTevKColor;
extern const J3DTevSwapModeInfo j3dDefaultTevSwapMode;
extern const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable;
extern const J3DBlendInfo j3dDefaultBlendInfo;
extern const J3DColorChanInfo j3dDefaultColorChanInfo;
extern const u16 j3dDefaultTevSwapTableID;
extern const u16 j3dDefaultAlphaCmpID;
extern const u16 j3dDefaultZModeID;
struct J3DTevStageTevSwapModeInfo {
u8 field_0x0_29 : 2;
@@ -37,8 +38,7 @@ struct J3DTevStageTevSwapModeInfo {
struct J3DTevStage {
J3DTevStage() {
// TODO
// setTevStageInfo(j3dDefaultTevStageInfo);
setTevStageInfo(j3dDefaultTevStageInfo);
mTevSwapModeInfo.field_0x0_29 = 0;
mTevSwapModeInfo.field_0x0_31 = 0;
}
@@ -74,18 +74,6 @@ struct J3DTevStage {
/* 0x7 */ J3DTevStageTevSwapModeInfo mTevSwapModeInfo;
};
struct J3DIndTevStageInfo {
/* 0x0 */ u8 mIndStage;
/* 0x1 */ u8 mIndFormat;
/* 0x2 */ u8 mBiasSel;
/* 0x3 */ u8 mMtxSel;
/* 0x4 */ u8 mWrapS;
/* 0x5 */ u8 mWrapT;
/* 0x6 */ u8 mPrev;
/* 0x7 */ u8 mLod;
/* 0x8 */ u8 mAlphaSel;
};
struct J3DIndTevStage {
J3DIndTevStage();
@@ -96,12 +84,6 @@ struct J3DIndTevStage {
/* 0x0 */ u32 mInfo;
};
struct J3DTevOrderInfo {
/* 0x0 */ u8 mTexCoord __attribute__((aligned(2)));
/* 0x1 */ u8 mTexMap;
/* 0x2 */ u8 mColorChan;
};
struct J3DTevOrder : public J3DTevOrderInfo {
J3DTevOrder();
@@ -120,11 +102,30 @@ struct J3DTevSwapModeTable {
/* 0x0 */ u8 field_0x0;
}; // Size: 0x1
struct J3DTevSwapModeInfo {
/* 0x0 */ u8 field_0x0;
class J3DLightObj {
public:
/* 80018C0C */ J3DLightObj() { mInfo = j3dDefaultLightInfo; }
/* 80323590 */ void load(u32) const;
J3DLightInfo& getLightInfo() { return mInfo; }
J3DLightObj& operator=(J3DLightObj const& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x00 */ J3DLightInfo mInfo;
/* 0x34 */ u8 field_0x34[64];
}; // Size = 0x74
struct J3DNBTScale : public J3DNBTScaleInfo {
J3DNBTScale() {}
J3DNBTScale(J3DNBTScaleInfo const& info) {
mbHasScale = info.mbHasScale;
mScale = info.mScale;
}
Vec* getScale() { return &mScale; }
};
struct J3DNBTScale;
class J3DTexCoord;
void loadTexCoordGens(u32, J3DTexCoord*);
void loadNBTScale(J3DNBTScale& param_0);
+5 -15
View File
@@ -58,7 +58,7 @@ public:
GDOverflowCheck(53);
J3DGDLoadTexMtxImm((Mtx&)mMtx, i * 3 + 30, (GXTexMtxType)mTexMtxInfo.mProjection);
};
void calc(f32 const (*)[4]);
void calc();
void calcTexMtx(f32 const (*)[4]);
void calcPostTexMtx(f32 const (*)[4]);
void loadTexMtx(u32) const;
@@ -71,26 +71,16 @@ public:
private:
/* 0x00 */ J3DTexMtxInfo mTexMtxInfo;
/* 0x64 */ Mtx mMtx;
}; // Size: 0x94
struct J3DTexCoordInfo {
/* 0x0 */ u8 mTexGenType __attribute__((aligned(4)));
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
};
/* 0x94 */ Mtx field_0x94;
}; // Size: 0xc4
struct J3DTexCoord : public J3DTexCoordInfo {
J3DTexCoord();
u8 getTexGenType() { return mTexGenType; }
u8 getTexGenSrc() { return mTexGenSrc; }
u8 getTexGenMtx() { return mTexGenMtx & 0xff; }
void setTexGenMtx(u8 v) { mTexGenMtx = v; }
}; // Size: 0x4
struct J3DDefaultTexCoordInfo {
/* 0x0 */ u8 mTexGenType;
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
/* 0x3 */ u8 pad;
};
#endif /* J3DTEXTURE_H */
+12 -9
View File
@@ -4,6 +4,8 @@
#include "JSystem/JGeometry.h"
#include "dolphin/mtx/mtxvec.h"
struct J3DTextureSRTInfo;
struct J3DTransformInfo {
/* 0x00 */ JGeometry::TVec3<f32> mScale;
/* 0x0C */ JGeometry::TVec3<s16> mRotation;
@@ -15,19 +17,22 @@ extern Vec const j3dDefaultScale;
extern Mtx const j3dDefaultMtx;
extern f32 PSMulUnit01[2];
void J3DGQRSetup7(u32 param_0, u32 param_1, u32 param_2, u32 param_3);
f32 J3DCalcZValue(MtxP m, Vec v);
void J3DCalcBBoardMtx(Mtx);
void J3DCalcYBBoardMtx(Mtx);
void J3DPSCalcInverseTranspose(f32 (*param_0)[4], f32 (*param_1)[3]);
void J3DGetTranslateRotateMtx(J3DTransformInfo const&, Mtx);
void J3DGetTranslateRotateMtx(s16, s16, s16, f32, f32, f32, Mtx);
void J3DPSCalcInverseTranspose(f32 (*param_0)[4], f32 (*param_1)[3]);
void J3DGQRSetup7(u32 param_0, u32 param_1, u32 param_2, u32 param_3);
void J3DGetTextureMtx(const J3DTextureSRTInfo&, Vec, f32(*)[4]);
void J3DGetTextureMtxOld(const J3DTextureSRTInfo&, Vec, f32(*)[4]);
void J3DGetTextureMtxMaya(const J3DTextureSRTInfo&, f32(*)[4]);
void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo&, f32(*)[4]);
void J3DScaleNrmMtx(Mtx, const Vec&);
void J3DScaleNrmMtx33(Mtx33, const Vec&);
void J3DPSMtx33Copy(register Mtx3P src, register Mtx3P dst);
void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst);
void J3DMtxProjConcat(f32(*)[4], f32(*)[4], f32(*)[4]);
void J3DPSMtx33Copy(Mtx3P src, Mtx3P dst);
void J3DPSMtx33CopyFrom34(MtxP src, Mtx3P dst);
// regalloc issues
inline void J3DPSMulMtxVec(register MtxP mtx, register Vec* vec, register Vec* dst) {
@@ -196,6 +201,4 @@ inline void J3DPSMulMtxVec(register Mtx3P mtx, register SVec* vec, register SVec
}
}
f32 J3DCalcZValue(register MtxP m, register Vec v);
#endif /* J3DTRANSFORM_H */
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef D_KANKYO_D_KANKYO_H
#define D_KANKYO_D_KANKYO_H
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/J3DGraphBase/J3DTevs.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/gx/GX.h"
#include "global.h"
-5
View File
@@ -12,11 +12,6 @@
#include "dolphin/os/OSCache.h"
#include "dolphin/types.h"
extern "C" extern const GXColor j3dDefaultColInfo;
extern "C" extern const GXColor j3dDefaultAmbInfo;
extern "C" extern const GXColorS10 j3dDefaultTevColor;
extern "C" extern const GXColor j3dDefaultTevKColor;
extern bool isTexNoReg(void*);
extern u16 getTexNoReg(void*);
extern void loadTexNo(u32, const u16 &);
+1 -6
View File
@@ -6,6 +6,7 @@
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/J3DGraphBase/J3DGD.h"
#include "JSystem/J3DGraphBase/J3DTexture.h"
#include "JSystem/J3DGraphBase/J3DTevs.h"
#include "JSystem/J3DGraphBase/J3DShape.h"
#include "dolphin/os/OS.h"
@@ -15,12 +16,6 @@ extern void makeAlphaCmpTable();
extern void makeZModeTable();
extern void makeTevSwapTable();
extern "C" extern J3DDefaultTexCoordInfo const j3dDefaultTexCoordInfo[8];
extern "C" extern const GXColor j3dDefaultColInfo;
extern "C" extern u8 j3dDefaultColorChanNum;
extern "C" extern const GXColorS10 j3dDefaultTevColor;
extern "C" extern const GXColor j3dDefaultTevKColor;
/* 802D8AA8-802D8B8C .text __ct__6J3DSysFv */
J3DSys::J3DSys() {
makeTexCoordTable();
+251 -17
View File
@@ -4,64 +4,298 @@
//
#include "JSystem/J3DGraphBase/J3DTevs.h"
#include "dolphin/types.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/J3DGraphBase/J3DTexture.h"
#include "JSystem/J3DGraphBase/J3DTransform.h"
/* 802EBC94-802EBD48 .text load__11J3DLightObjCFUl */
void J3DLightObj::load(unsigned long) const {
void J3DLightObj::load(u32 param_0) const {
/* Nonmatching */
GDOverflowCheck(0x48);
J3DGDSetLightPos(GXLightID(param_0 * 2), mInfo.mLightPosition.x, mInfo.mLightPosition.y, mInfo.mLightPosition.z);
J3DGDSetLightAttn(GXLightID(param_0 * 2), mInfo.mCosAtten.x, mInfo.mCosAtten.y, mInfo.mCosAtten.z, mInfo.mDistAtten.x, mInfo.mDistAtten.y, mInfo.mDistAtten.z);
J3DGDSetLightColor(GXLightID(param_0 * 2), mInfo.mColor);
J3DGDSetLightDir(GXLightID(param_0 * 2), mInfo.mLightDirection.x, mInfo.mLightDirection.y, mInfo.mLightDirection.z);
}
/* 802EBD48-802EBF40 .text loadTexCoordGens__FUlP11J3DTexCoord */
void loadTexCoordGens(unsigned long, J3DTexCoord*) {
/* Nonmatching */
void loadTexCoordGens(u32 param_0, J3DTexCoord* param_1) {
GDOverflowCheck(param_0 * 8 + 10);
J3DGDWriteXFCmdHdr(0x1040, param_0);
for (int i = 0; i < param_0; i++) {
J3DGDSetTexCoordGen(
GXTexGenType(param_1[i].getTexGenType()),
GXTexGenSrc(param_1[i].getTexGenSrc())
);
}
static u32 dualReg = 61;
J3DGDWriteXFCmdHdr(0x1050, param_0);
for (int i = 0; i < param_0; i++) {
J3DGDWrite_u32(dualReg);
}
}
/* 802EBF40-802EC358 .text calc__9J3DTexMtxFv */
void J3DTexMtx::calc() {
/* Nonmatching */
Mtx44 mtx1;
Mtx44 mtx2;
Mtx qMtx = {
0.5f, 0.0f, 0.5f, 0.0f,
0.0f, -0.5f, 0.5f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
};
Mtx qMtx2 = {
0.5f, 0.0f, 0.0f, 0.5f,
0.0f, -0.5f, 0.0f, 0.5f,
0.0f, 0.0f, 1.0f, 0.0f,
};
u32 r28 = mTexMtxInfo.mInfo & 0x7f;
u32 r30 = (mTexMtxInfo.mInfo >> 7) & 1;
if (r28 - 8 <= 1 || r28 == 0x0b) {
if (r30 == 0) {
J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2);
} else if (r30 == 1) {
J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2);
}
MTXConcat(mtx2, qMtx, mtx2);
J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1);
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 == 7) {
if (r30 == 0) {
J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1);
} else if (r30 == 1) {
J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx1);
}
MTXConcat(mtx1, qMtx, mtx1);
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 == 10) {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2);
}
MTXConcat(mtx2, qMtx2, mtx2);
J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1);
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 == 6) {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1);
}
MTXConcat(mtx1, qMtx2, mtx1);
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 == 1) {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1);
}
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 - 2 <= 1 || r28 == 5) {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2);
}
J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1);
MTXConcat(mtx1, field_0x94, mMtx);
} else if (r28 == 4) {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2);
}
J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx);
} else {
if (r30 == 0) {
J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx);
} else if (r30 == 1) {
J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx);
}
}
}
/* 802EC358-802EC37C .text isTexNoReg__FPv */
void isTexNoReg(void*) {
/* Nonmatching */
bool isTexNoReg(void* param_0) {
u8 r31 = ((u8*)param_0)[1];
if (r31 >= 0x80 && r31 <= 0xbb) {
return true;
}
return false;
}
/* 802EC37C-802EC388 .text getTexNoReg__FPv */
void getTexNoReg(void*) {
/* Nonmatching */
u16 getTexNoReg(void* param_0) {
return *(u32*)((u8*)param_0 + 1);
}
/* 802EC388-802EC530 .text loadTexNo__FUlRCUs */
void loadTexNo(unsigned long, const unsigned short&) {
/* Nonmatching */
void loadTexNo(u32 param_0, const u16& param_1) {
ResTIMG* resTIMG = j3dSys.getTexture()->getResTIMG(param_1);
J3DSys::sTexCoordScaleTable[param_0].field_0x00 = resTIMG->width;
J3DSys::sTexCoordScaleTable[param_0].field_0x02 = resTIMG->height;
GDOverflowCheck(0x14);
J3DGDSetTexImgPtr(GXTexMapID(param_0), (u8*)resTIMG + resTIMG->imageOffset);
J3DGDSetTexImgAttr(GXTexMapID(param_0), resTIMG->width, resTIMG->height, GXTexFmt(resTIMG->format & 0x0f));
J3DGDSetTexLookupMode(GXTexMapID(param_0), GXTexWrapMode(resTIMG->wrapS), GXTexWrapMode(resTIMG->wrapT), GXTexFilter(resTIMG->minFilter), GXTexFilter(resTIMG->magFilter), resTIMG->minLOD * 0.125f, resTIMG->maxLOD * 0.125f, resTIMG->LODBias * 0.01f, resTIMG->biasClamp, resTIMG->doEdgeLOD, GXAnisotropy(resTIMG->maxAnisotropy));
if (resTIMG->indexTexture == true) {
GXTlutSize tlutSize = resTIMG->numColors > 16 ? GX_TLUT_256 : GX_TLUT_16;
GDOverflowCheck(0x14);
J3DGDLoadTlut((u8*)resTIMG + resTIMG->paletteOffset, (param_0 << 13) + 0xf0000, tlutSize);
J3DGDSetTexTlut(GXTexMapID(param_0), (param_0 << 13) + 0xf0000, GXTlutFmt(resTIMG->colorFormat));
}
}
/* 802EC530-802EC554 .text patchTexNo_PtrToIdx__FUlRCUs */
void patchTexNo_PtrToIdx(unsigned long, const unsigned short&) {
/* Nonmatching */
void patchTexNo_PtrToIdx(u32 texID, const u16& idx) {
J3DGDSetTexImgPtrRaw(GXTexMapID(texID), idx);
}
/* 802EC554-802EC588 .text loadNBTScale__FR11J3DNBTScale */
void loadNBTScale(J3DNBTScale&) {
/* Nonmatching */
void loadNBTScale(J3DNBTScale& param_0) {
if (param_0.mbHasScale == true) {
j3dSys.setNBTScale(&param_0.mScale);
} else {
j3dSys.setNBTScale(NULL);
}
}
const J3DLightInfo j3dDefaultLightInfo = {
0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0xff, 0xff, 0xff, 0xff,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
};
const J3DTexCoordInfo j3dDefaultTexCoordInfo[8] = {
{GX_MTX2x4, GX_TG_TEX0, GX_IDENTITY}, {GX_MTX2x4, GX_TG_TEX1, GX_IDENTITY},
{GX_MTX2x4, GX_TG_TEX2, GX_IDENTITY}, {GX_MTX2x4, GX_TG_TEX3, GX_IDENTITY},
{GX_MTX2x4, GX_TG_TEX4, GX_IDENTITY}, {GX_MTX2x4, GX_TG_TEX5, GX_IDENTITY},
{GX_MTX2x4, GX_TG_TEX6, GX_IDENTITY}, {GX_MTX2x4, GX_TG_TEX7, GX_IDENTITY},
};
const J3DTexMtxInfo j3dDefaultTexMtxInfo = {
0x01, 0x00, 0xFF, 0xFF,
0.0f, 0.0f, 0.0f,
1.0f, 1.0f, 0, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
};
const J3DIndTexMtxInfo j3dDefaultIndTexMtxInfo = {
0.5f, 0.0f, 0.0f,
0.0f, 0.5f, 0.0f,
1,
};
const J3DTevStageInfo j3dDefaultTevStageInfo = {
0x04, 0x0A, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x05, 0x07, 0x07, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
};
const J3DIndTevStageInfo j3dDefaultIndTevStageInfo = {};
const J3DFogInfo j3dDefaultFogInfo = {
0, 0, 0x140,
0.0f, 0.0f, 0.1f, 10000.0f,
0xFF, 0xFF, 0xFF, 0x00,
};
const J3DNBTScaleInfo j3dDefaultNBTScaleInfo = {
0,
1.0f, 1.0f, 1.0f
};
static u8 j3dTexCoordTable[7623];
/* 802EC588-802EC630 .text makeTexCoordTable__Fv */
void makeTexCoordTable() {
/* Nonmatching */
u8 bytes[] = { 0x1e, 0x21, 0x24, 0x27, 0x2a, 0x2d, 0x30, 0x33, 0x36, 0x39, 0x3c };
u8* table = j3dTexCoordTable;
for (u32 i = 0; i < 11; i++) {
for (u32 j = 0; j < 21; j++) {
for (int k = 0; k < 11; k++) {
u32 idx = i * 0xe7 + j * 11 + k;
table[idx * 3] = i;
table[idx * 3 + 1] = j;
table[idx * 3 + 2] = bytes[k];
}
}
}
}
u8 j3dTevSwapTableTable[1024];
u8 j3dAlphaCmpTable[768];
/* 802EC630-802EC69C .text makeAlphaCmpTable__Fv */
void makeAlphaCmpTable() {
/* Nonmatching */
u8* table = j3dAlphaCmpTable;
for (u32 i = 0; i < 8; i++) {
for (int j = 0; j < 4; j++) {
for (u32 k = 0; k < 8; k++) {
u32 idx = i * 32 + j * 8 + k;
table[idx * 3] = i;
table[idx * 3 + 1] = j;
table[idx * 3 + 2] = k;
}
}
}
}
u8 j3dZModeTable[96];
/* 802EC69C-802EC708 .text makeZModeTable__Fv */
void makeZModeTable() {
/* Nonmatching */
u8* table = j3dZModeTable;
for (int i = 0; i < 2; i++) {
for (u32 j = 0; j < 8; j++) {
for (int k = 0; k < 2; k++) {
u32 idx = i * 16 + j * 2 + k;
table[idx * 3] = i;
table[idx * 3 + 1] = j;
table[idx * 3 + 2] = k;
}
}
}
}
/* 802EC708-802EC74C .text makeTevSwapTable__Fv */
void makeTevSwapTable() {
/* Nonmatching */
u8* table = j3dTevSwapTableTable;
int i = 0;
do {
table[0] = i >> 6;
table[1] = (i >> 4) & 3;
table[2] = (i >> 2) & 3;
table[3] = i & 3;
i++;
table += 4;
} while (i < 256);
}
const GXColor j3dDefaultColInfo = {0xFF, 0xFF, 0xFF, 0xFF};
const GXColor j3dDefaultAmbInfo = {0x32, 0x32, 0x32, 0x32};
const u8 j3dDefaultColorChanNum = 0x01;
const J3DTevOrderInfo j3dDefaultTevOrderInfoNull = {GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL};
const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull = {GX_TEXCOORD_NULL, GX_TEXMAP_NULL};
const GXColorS10 j3dDefaultTevColor = {0xFF, 0xFF, 0xFF, 0xFF};
const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo = {};
const GXColor j3dDefaultTevKColor = {0xFF, 0xFF, 0xFF, 0xFF};
const J3DTevSwapModeInfo j3dDefaultTevSwapMode = {};
const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable = {0, 1, 2, 3};
const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP};
const J3DColorChanInfo j3dDefaultColorChanInfo = {0, 0, 0, 2, 2, 0, 0xFF, 0xFF};
const u16 j3dDefaultTevSwapTableID = 0x1B00;
const u16 j3dDefaultAlphaCmpID = 0xE7;
const u16 j3dDefaultZModeID = 0x17;
+15 -15
View File
@@ -8,12 +8,12 @@
#include "dolphin/types.h"
/* 802DA0A8-802DA0B0 .text __MTGQR7__FUl */
void __MTGQR7(unsigned long) {
void __MTGQR7(u32) {
/* Nonmatching */
}
/* 802DA0B0-802DA0E8 .text J3DGQRSetup7__FUlUlUlUl */
void J3DGQRSetup7(unsigned long, unsigned long, unsigned long, unsigned long) {
void J3DGQRSetup7(u32, u32, u32, u32) {
/* Nonmatching */
}
@@ -44,62 +44,62 @@ f32 J3DCalcZValue(register MtxP m, register Vec v) {
}
/* 802DA120-802DA2E0 .text J3DCalcBBoardMtx__FPA4_f */
void J3DCalcBBoardMtx(float(*)[4]) {
void J3DCalcBBoardMtx(f32(*)[4]) {
/* Nonmatching */
}
/* 802DA2E0-802DA584 .text J3DCalcYBBoardMtx__FPA4_f */
void J3DCalcYBBoardMtx(float(*)[4]) {
void J3DCalcYBBoardMtx(f32(*)[4]) {
/* Nonmatching */
}
/* 802DA584-802DA64C .text J3DPSCalcInverseTranspose__FPA4_fPA3_f */
void J3DPSCalcInverseTranspose(float(*)[4], float(*)[3]) {
void J3DPSCalcInverseTranspose(f32(*)[4], f32(*)[3]) {
/* Nonmatching */
}
/* 802DA64C-802DA724 .text J3DGetTranslateRotateMtx__FRC16J3DTransformInfoPA4_f */
void J3DGetTranslateRotateMtx(const J3DTransformInfo&, float(*)[4]) {
void J3DGetTranslateRotateMtx(const J3DTransformInfo&, Mtx) {
/* Nonmatching */
}
/* 802DA724-802DA7E4 .text J3DGetTranslateRotateMtx__FsssfffPA4_f */
void J3DGetTranslateRotateMtx(short, short, short, float, float, float, float(*)[4]) {
void J3DGetTranslateRotateMtx(s16, s16, s16, f32, f32, f32, Mtx) {
/* Nonmatching */
}
/* 802DA7E4-802DA8A8 .text J3DGetTextureMtx__FRC17J3DTextureSRTInfo3VecPA4_f */
void J3DGetTextureMtx(const J3DTextureSRTInfo&, Vec, float(*)[4]) {
void J3DGetTextureMtx(const J3DTextureSRTInfo&, Vec, f32(*)[4]) {
/* Nonmatching */
}
/* 802DA8A8-802DA96C .text J3DGetTextureMtxOld__FRC17J3DTextureSRTInfo3VecPA4_f */
void J3DGetTextureMtxOld(const J3DTextureSRTInfo&, Vec, float(*)[4]) {
void J3DGetTextureMtxOld(const J3DTextureSRTInfo&, Vec, f32(*)[4]) {
/* Nonmatching */
}
/* 802DA96C-802DAA38 .text J3DGetTextureMtxMaya__FRC17J3DTextureSRTInfoPA4_f */
void J3DGetTextureMtxMaya(const J3DTextureSRTInfo&, float(*)[4]) {
void J3DGetTextureMtxMaya(const J3DTextureSRTInfo&, f32(*)[4]) {
/* Nonmatching */
}
/* 802DAA38-802DAB04 .text J3DGetTextureMtxMayaOld__FRC17J3DTextureSRTInfoPA4_f */
void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo&, float(*)[4]) {
void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo&, f32(*)[4]) {
/* Nonmatching */
}
/* 802DAB04-802DAB68 .text J3DScaleNrmMtx__FPA4_fRC3Vec */
void J3DScaleNrmMtx(float(*)[4], const Vec&) {
void J3DScaleNrmMtx(f32(*)[4], const Vec&) {
/* Nonmatching */
}
/* 802DAB68-802DABBC .text J3DScaleNrmMtx33__FPA3_fRC3Vec */
void J3DScaleNrmMtx33(float(*)[3], const Vec&) {
void J3DScaleNrmMtx33(f32(*)[3], const Vec&) {
/* Nonmatching */
}
/* 802DABBC-802DACE0 .text J3DMtxProjConcat__FPA4_fPA4_fPA4_f */
void J3DMtxProjConcat(float(*)[4], float(*)[4], float(*)[4]) {
void J3DMtxProjConcat(f32(*)[4], f32(*)[4], f32(*)[4]) {
/* Nonmatching */
}
@@ -151,6 +151,6 @@ void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst) {
}
/* 802DAD40-802DAE1C .text J3DPSMtxArrayConcat__FPA4_fPA4_fPA4_fUl */
void J3DPSMtxArrayConcat(float(*)[4], float(*)[4], float(*)[4], unsigned long) {
void J3DPSMtxArrayConcat(f32(*)[4], f32(*)[4], f32(*)[4], u32) {
/* Nonmatching */
}