Work on weak order (#2979)

* JAUSectionHeap OK

* Slightly improve d_camera weak func order (12 -> 10)

* Minor d_a_alink fixes

* weak_order_diff.py: Change to take source file as cli argument instead of .o file

For cli autocompletion to work.

* Reorganize J3D structs (no change in weak order)
This commit is contained in:
LagoLunatic
2025-12-21 07:13:21 -05:00
committed by GitHub
parent 1f9b56cc65
commit 4e7c478259
15 changed files with 332 additions and 342 deletions
+193 -23
View File
@@ -4,13 +4,13 @@
#include <dolphin/gx.h>
#include "dolphin/mtx.h"
#include "dolphin/mtx.h"
#include "global.h"
/**
* @ingroup jsystem-j3d
*
*/
class J3DLightInfo {
public:
struct J3DLightInfo {
J3DLightInfo& operator=(J3DLightInfo const&);
/* 0x00 */ Vec mLightPosition;
@@ -20,27 +20,6 @@ public:
/* 0x28 */ Vec mDistAtten;
}; // Size = 0x34
extern "C" extern J3DLightInfo const j3dDefaultLightInfo;
/**
* @ingroup jsystem-j3d
*
*/
class J3DLightObj {
public:
J3DLightObj() { mInfo = j3dDefaultLightInfo; }
void load(u32) const;
J3DLightInfo* getLightInfo() { return &mInfo; }
J3DLightObj& operator=(J3DLightObj const& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x00 */ J3DLightInfo mInfo;
/* 0x34 */ GXLightObj mLightObj;
}; // Size = 0x74
/**
* @ingroup jsystem-j3d
*
@@ -146,4 +125,195 @@ struct J3DNBTScaleInfo {
/* 0x4 */ Vec mScale;
}; // Size: 0x10
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTexOrderInfo {
/* 0x0 */ u8 mCoord;
/* 0x1 */ u8 mMap;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
void operator=(J3DIndTexOrderInfo const& other) {
__memcpy(this, &other, sizeof(J3DIndTexOrderInfo));
}
}; // Size: 0x04
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevSwapModeInfo {
/* 0x0 */ u8 mRasSel;
/* 0x1 */ u8 mTexSel;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevSwapModeTableInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevStageInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 mTevColorOp;
/* 0x2 */ u8 mTevColorAB;
/* 0x3 */ u8 mTevColorCD;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 mTevAlphaOp;
/* 0x6 */ u8 mTevAlphaAB;
/* 0x7 */ u8 mTevSwapModeInfo;
/* 0x8 */ u8 field_0x8;
/* 0x8 */ u8 field_0x9;
/* 0x8 */ u8 field_0xa;
/* 0x8 */ u8 field_0xb;
/* 0x8 */ u8 field_0xc;
/* 0x8 */ u8 field_0xd;
/* 0x8 */ u8 field_0xe;
/* 0x8 */ u8 field_0xf;
/* 0x8 */ u8 field_0x10;
/* 0x8 */ u8 field_0x11;
/* 0x8 */ u8 field_0x12;
/* 0x8 */ u8 field_0x13;
};
/**
* @ingroup jsystem-j3d
*
*/
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;
/* 0x9 */ u8 pad[3];
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTexCoordInfo {
/* 0x0 */ u8 mTexGenType;
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
/* 0x3 */ u8 pad;
J3DTexCoordInfo& operator=(const J3DTexCoordInfo& other) {
__memcpy(this, &other, sizeof(J3DTexCoordInfo));
return *this;
}
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTexCoordScaleInfo {
/* 0x0 */ u8 mScaleS;
/* 0x1 */ u8 mScaleT;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
J3DIndTexCoordScaleInfo& operator=(const J3DIndTexCoordScaleInfo& other) {
__memcpy(this, &other, sizeof(J3DIndTexCoordScaleInfo));
return *this;
}
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DBlendInfo {
void operator=(J3DBlendInfo const& other) {
__memcpy(this, &other, sizeof(J3DBlendInfo));
}
/* 0x0 */ u8 mType;
/* 0x1 */ u8 mSrcFactor;
/* 0x2 */ u8 mDstFactor;
/* 0x3 */ u8 mOp;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevOrderInfo {
void operator=(const J3DTevOrderInfo& other) {
*(u32*) this = *(u32*)&other;
}
/* 0x0 */ u8 mTexCoord;
/* 0x1 */ u8 mTexMap;
/* 0x2 */ u8 mColorChan;
/* 0x3 */ u8 field_0x3; // Maybe padding
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DColorChanInfo {
/* 0x0 */ u8 mEnable;
/* 0x1 */ u8 mMatSrc;
/* 0x2 */ u8 mLightMask;
/* 0x3 */ u8 mDiffuseFn;
/* 0x4 */ u8 mAttnFn;
/* 0x5 */ u8 mAmbSrc;
/* 0x6 */ u8 pad[2];
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DZModeInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 pad;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAlphaCompInfo {
/* 0x0 */ u8 mComp0;
/* 0x1 */ u8 mRef0;
/* 0x2 */ u8 mOp;
/* 0x3 */ u8 mComp1;
/* 0x4 */ u8 mRef1;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
J3DAlphaCompInfo& operator=(const J3DAlphaCompInfo& other) {
mComp0 = other.mComp0;
mRef0 = other.mRef0;
mOp = other.mOp;
mComp1 = other.mComp1;
mRef1 = other.mRef1;
return *this;
}
};
#endif /* J3DSTRUCT_H */