mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-01 02:11:44 -04:00
J3DTevs (#1950)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#ifndef J3DGD_H
|
||||
#define J3DGD_H
|
||||
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/gd/GDBase.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
|
||||
inline void J3DGDWrite_u8(u8 param) {
|
||||
__GDWrite(param);
|
||||
@@ -20,15 +20,63 @@ inline void J3DGDWrite_u32(u32 param) {
|
||||
__GDWrite(param & 0xff);
|
||||
}
|
||||
|
||||
inline void J3DGDWriteXFCmd(u16 param_1, u32 param_2) {
|
||||
J3DGDWrite_u8(0x10);
|
||||
J3DGDWrite_u16(0);
|
||||
J3DGDWrite_u16(param_1);
|
||||
J3DGDWrite_u32(param_2);
|
||||
inline void J3DGDWrite_f32(f32 param) {
|
||||
u32 tmp = *(u32*)¶m;
|
||||
J3DGDWrite_u32(tmp);
|
||||
}
|
||||
|
||||
void J3DGDSetGenMode(u8 texGenNum, u8 colorChanNum, u8 tevStageNum, u8 IndTexStageNum, _GXCullMode cullMode);
|
||||
inline void J3DGDWriteBPCmd(u32 param_1) {
|
||||
J3DGDWrite_u8(0x61);
|
||||
J3DGDWrite_u32(param_1);
|
||||
}
|
||||
|
||||
inline void J3DGDWriteXFCmd(u16 param_1, u32 param_2) {
|
||||
J3DGDWrite_u8(0x10);
|
||||
J3DGDWrite_u16(0);
|
||||
J3DGDWrite_u16(param_1);
|
||||
J3DGDWrite_u32(param_2);
|
||||
}
|
||||
|
||||
inline void J3DGDWriteXFCmdHdr(u16 cmd, u8 len) {
|
||||
J3DGDWrite_u8(0x10);
|
||||
J3DGDWrite_u16(len - 1);
|
||||
J3DGDWrite_u16(cmd);
|
||||
}
|
||||
|
||||
void J3DGDSetGenMode(u8 texGenNum, u8 colorChanNum, u8 tevStageNum, u8 IndTexStageNum,
|
||||
GXCullMode cullMode);
|
||||
void J3DGDSetGenMode_3Param(u8 texGenNum, u8 tevStageNum, u8 indTexStageNum);
|
||||
void J3DGDSetLightAttn(GXLightID, f32, f32, f32, f32, f32, f32);
|
||||
void J3DGDSetLightColor(GXLightID, GXColor);
|
||||
void J3DGDSetLightPos(GXLightID, f32, f32, f32);
|
||||
void J3DGDSetLightDir(GXLightID, f32, f32, f32);
|
||||
void J3DGDSetVtxAttrFmtv(GXVtxFmt, GXVtxAttrFmtList const*, bool);
|
||||
void J3DGDSetTexCoordGen(GXTexGenType, GXTexGenSrc);
|
||||
void J3DGDSetTexCoordScale2(GXTexCoordID, u16, u8, u8, u16, u8, u8);
|
||||
void J3DGDSetTexLookupMode(GXTexMapID, GXTexWrapMode, GXTexWrapMode, GXTexFilter, GXTexFilter, f32,
|
||||
f32, f32, u8, u8, GXAnisotropy);
|
||||
void J3DGDSetTexImgAttr(GXTexMapID, u16, u16, GXTexFmt);
|
||||
void J3DGDSetTexImgPtr(GXTexMapID, void*);
|
||||
void J3DGDSetTexImgPtrRaw(GXTexMapID, u32);
|
||||
void J3DGDSetTexTlut(GXTexMapID, u32, _GXTlutFmt);
|
||||
void J3DGDLoadTlut(void*, u32, _GXTlutSize);
|
||||
void J3DGDSetIndTexMtx(GXIndTexMtxID, f32 (*)[3], s8);
|
||||
void J3DGDSetIndTexCoordScale(GXIndTexStageID, GXIndTexScale, GXIndTexScale, GXIndTexScale,
|
||||
GXIndTexScale);
|
||||
void J3DGDSetIndTexOrder(u32, GXTexCoordID, GXTexMapID, GXTexCoordID, GXTexMapID, GXTexCoordID,
|
||||
GXTexMapID, GXTexCoordID, GXTexMapID);
|
||||
void J3DGDSetTevOrder(GXTevStageID, GXTexCoordID, GXTexMapID, GXChannelID, GXTexCoordID, GXTexMapID,
|
||||
GXChannelID);
|
||||
void J3DGDSetTevKColor(GXTevKColorID, GXColor);
|
||||
void J3DGDSetTevColorS10(GXTevRegID, GXColorS10);
|
||||
void J3DGDSetFog(GXFogType, f32, f32, f32, f32, GXColor);
|
||||
void J3DGDSetFogRangeAdj(u8, u16, _GXFogAdjTable*);
|
||||
void J3DFifoLoadPosMtxImm(f32 (*)[4], u32);
|
||||
void J3DFifoLoadNrmMtxImm(f32 (*)[4], u32);
|
||||
void J3DFifoLoadNrmMtxImm3x3(f32 (*)[3], u32);
|
||||
void J3DFifoLoadNrmMtxToTexMtx(f32 (*)[4], u32);
|
||||
void J3DFifoLoadNrmMtxToTexMtx3x3(f32 (*)[3], u32);
|
||||
void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize);
|
||||
|
||||
static inline void J3DFifoLoadIndx(u8 cmd, u16 indx, u16 addr) {
|
||||
GFX_FIFO(u8) = cmd;
|
||||
|
||||
@@ -65,7 +65,7 @@ struct J3DTexMtxInfo {
|
||||
/* 80325794 */ void setEffectMtx(Mtx);
|
||||
|
||||
/* 0x00 */ u8 mProjection;
|
||||
/* 0x01 */ s8 mInfo;
|
||||
/* 0x01 */ u8 mInfo;
|
||||
/* 0x04 */ Vec mCenter;
|
||||
/* 0x10 */ J3DTextureSRTInfo mSRT;
|
||||
/* 0x24 */ Mtx44 mEffectMtx;
|
||||
@@ -98,7 +98,7 @@ struct J3DFogInfo {
|
||||
struct J3DNBTScaleInfo {
|
||||
/* 8032587C */ void operator=(J3DNBTScaleInfo const&);
|
||||
|
||||
/* 0x0 */ u8 mbHasScale;
|
||||
/* 0x0 */ bool mbHasScale;
|
||||
/* 0x4 */ Vec mScale;
|
||||
}; // Size: 0x10
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@ class J3DShape;
|
||||
class J3DDrawBuffer;
|
||||
class J3DTexture;
|
||||
|
||||
struct J3DTexCoordScaleInfo {
|
||||
/* 0x0 */ u16 field_0x00;
|
||||
/* 0x2 */ u16 field_0x02;
|
||||
/* 0x4 */ u16 field_0x04;
|
||||
/* 0x6 */ u16 field_0x06;
|
||||
};
|
||||
|
||||
enum J3DSysFlag {
|
||||
J3DSysFlag_SkinPosCpu = 0x00000004,
|
||||
J3DSysFlag_SkinNrmCpu = 0x00000008,
|
||||
@@ -131,7 +138,7 @@ struct J3DSys {
|
||||
static Mtx mCurrentMtx;
|
||||
static Vec mCurrentS;
|
||||
static Vec mParentS;
|
||||
static u16 sTexCoordScaleTable[32];
|
||||
static J3DTexCoordScaleInfo sTexCoordScaleTable[8];
|
||||
};
|
||||
|
||||
extern u32 j3dDefaultViewNo;
|
||||
|
||||
@@ -32,9 +32,9 @@ public:
|
||||
mTexMtxInfo = info;
|
||||
}
|
||||
/* 803238C4 */ void load(u32) const;
|
||||
/* 80323900 */ void calc(f32 const (*)[4]);
|
||||
/* 80323920 */ void calcTexMtx(f32 const (*)[4]);
|
||||
/* 80323C0C */ void calcPostTexMtx(f32 const (*)[4]);
|
||||
/* 80323900 */ void calc(const Mtx);
|
||||
/* 80323920 */ void calcTexMtx(const Mtx);
|
||||
/* 80323C0C */ void calcPostTexMtx(const Mtx);
|
||||
/* 80324358 */ void loadTexMtx(u32) const;
|
||||
/* 803243BC */ void loadPostTexMtx(u32) const;
|
||||
|
||||
@@ -62,6 +62,8 @@ struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
*(J3DTexCoordInfo*)this = *param_1;
|
||||
}
|
||||
|
||||
u8 getTexGenType() { return mTexGenType; }
|
||||
u8 getTexGenSrc() { return mTexGenSrc; }
|
||||
u8 getTexGenMtx() { return mTexGenMtx & 0xff; }
|
||||
u16 getTexMtxReg() { return mTexMtxReg & 0xff; }
|
||||
|
||||
|
||||
@@ -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,10 +17,20 @@ extern Vec const j3dDefaultScale;
|
||||
extern Mtx const j3dDefaultMtx;
|
||||
extern f32 PSMulUnit01[2];
|
||||
|
||||
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 J3DCalcBBoardMtx(f32 (*)[4]);
|
||||
void J3DCalcYBBoardMtx(f32 (*)[4]);
|
||||
void J3DPSCalcInverseTranspose(f32 (*param_0)[4], f32 (*param_1)[3]);
|
||||
void J3DGetTranslateRotateMtx(const J3DTransformInfo&, Mtx);
|
||||
void J3DGetTranslateRotateMtx(s16, s16, s16, f32, f32, f32, Mtx);
|
||||
void J3DGetTextureMtx(const J3DTextureSRTInfo&, const Vec&, f32 (*)[4]);
|
||||
void J3DGetTextureMtxOld(const J3DTextureSRTInfo&, const Vec&, f32 (*)[4]);
|
||||
void J3DGetTextureMtxMaya(const J3DTextureSRTInfo&, f32 (*)[4]);
|
||||
void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo& param_0, f32 (*)[4]);
|
||||
void J3DScaleNrmMtx(f32 (*)[4], const Vec&);
|
||||
void J3DScaleNrmMtx33(f32 (*)[3], const Vec&);
|
||||
void J3DMtxProjConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4]);
|
||||
void J3DPSMtxArrayConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4], u32);
|
||||
|
||||
inline void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst) {
|
||||
register f32 x_y1;
|
||||
|
||||
Reference in New Issue
Block a user