mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 05:04:40 -04:00
Merge branch 'main' of https://github.com/zeldaret/tp
This commit is contained in:
@@ -479,26 +479,26 @@ inline f32 J2DHermiteInterpolation<f32>(f32 f1, f32* f2, f32* f3, f32* f4, f32*
|
||||
}
|
||||
|
||||
template <>
|
||||
inline f32 J2DHermiteInterpolation<s16>(register f32 pp1, register s16* pp2, register s16* pp3,
|
||||
register s16* pp4, register s16* pp5, register s16* pp6,
|
||||
register s16* pp7) {
|
||||
inline f32 J2DHermiteInterpolation<s16>(__REGISTER f32 pp1, __REGISTER s16* pp2, __REGISTER s16* pp3,
|
||||
__REGISTER s16* pp4, __REGISTER s16* pp5, __REGISTER s16* pp6,
|
||||
__REGISTER s16* pp7) {
|
||||
#ifdef __MWERKS__
|
||||
register f32 p1 = pp1;
|
||||
register f32 ff8;
|
||||
register f32 ff7;
|
||||
register f32 ff6;
|
||||
register f32 ff5;
|
||||
register f32 ff4;
|
||||
register f32 ff3;
|
||||
register f32 ff2;
|
||||
register f32 ff0;
|
||||
register f32 fout;
|
||||
register s16* p2 = pp2;
|
||||
register s16* p3 = pp3;
|
||||
register s16* p4 = pp4;
|
||||
register s16* p5 = pp5;
|
||||
register s16* p6 = pp6;
|
||||
register s16* p7 = pp7;
|
||||
__REGISTER f32 p1 = pp1;
|
||||
__REGISTER f32 ff8;
|
||||
__REGISTER f32 ff7;
|
||||
__REGISTER f32 ff6;
|
||||
__REGISTER f32 ff5;
|
||||
__REGISTER f32 ff4;
|
||||
__REGISTER f32 ff3;
|
||||
__REGISTER f32 ff2;
|
||||
__REGISTER f32 ff0;
|
||||
__REGISTER f32 fout;
|
||||
__REGISTER s16* p2 = pp2;
|
||||
__REGISTER s16* p3 = pp3;
|
||||
__REGISTER s16* p4 = pp4;
|
||||
__REGISTER s16* p5 = pp5;
|
||||
__REGISTER s16* p6 = pp6;
|
||||
__REGISTER s16* p7 = pp7;
|
||||
// clang-format off
|
||||
asm {
|
||||
psq_l ff2, 0(p2), 0x1, 5
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include "dolphin/mtx.h"
|
||||
#include "global.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
@@ -213,6 +214,19 @@ struct J2DIndTevStageInfo {
|
||||
/* 0x9 */ u8 field_0x9;
|
||||
/* 0xa */ u8 field_0xa;
|
||||
/* 0xb */ u8 field_0xb;
|
||||
|
||||
J2DIndTevStageInfo& operator=(const J2DIndTevStageInfo& other) {
|
||||
mIndStage = other.mIndStage;
|
||||
mIndFormat = other.mIndFormat;
|
||||
mBiasSel = other.mBiasSel;
|
||||
mMtxSel = other.mMtxSel;
|
||||
mWrapS = other.mWrapS;
|
||||
mWrapT = other.mWrapT;
|
||||
mPrev = other.mPrev;
|
||||
mLod = other.mLod;
|
||||
mAlphaSel = other.mAlphaSel;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) {
|
||||
@@ -264,9 +278,9 @@ struct J2DTexCoordInfo {
|
||||
u8 padding; // ?
|
||||
|
||||
J2DTexCoordInfo& operator=(const J2DTexCoordInfo& other) {
|
||||
this->mTexGenType = other.mTexGenType;
|
||||
this->mTexGenSrc = other.mTexGenSrc;
|
||||
this->mTexGenMtx = other.mTexGenMtx;
|
||||
mTexGenType = other.mTexGenType;
|
||||
mTexGenSrc = other.mTexGenSrc;
|
||||
mTexGenMtx = other.mTexGenMtx;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
@@ -386,9 +400,20 @@ extern const J2DTevSwapModeInfo j2dDefaultTevSwapMode;
|
||||
*/
|
||||
class J2DTevStage {
|
||||
public:
|
||||
J2DTevStage(J2DTevStageInfo const&);
|
||||
J2DTevStage();
|
||||
void setTevStageInfo(J2DTevStageInfo const&);
|
||||
J2DTevStage(J2DTevStageInfo const& param_0) {
|
||||
setTevStageInfo(param_0);
|
||||
setTevSwapModeInfo(j2dDefaultTevSwapMode);
|
||||
}
|
||||
J2DTevStage() {
|
||||
setTevStageInfo(j2dDefaultTevStageInfo);
|
||||
setTevSwapModeInfo(j2dDefaultTevSwapMode);
|
||||
}
|
||||
void setTevStageInfo(J2DTevStageInfo const& info) {
|
||||
setColorABCD(info.mColorA, info.mColorB, info.mColorC, info.mColorD);
|
||||
setTevColorOp(info.mCOp, info.mCBias, info.mCScale, info.mCClamp, info.mCReg);
|
||||
setAlphaABCD(info.mAlphaA, info.mAlphaB, info.mAlphaC, info.mAlphaD);
|
||||
setTevAlphaOp(info.mAOp, info.mABias, info.mAScale, info.mAClamp, info.mAReg);
|
||||
}
|
||||
|
||||
void setStageNo(u32 param_0) {
|
||||
field_0x0 = (param_0 << 1) + 0xc0;
|
||||
@@ -522,6 +547,14 @@ struct J2DTevSwapModeTableInfo {
|
||||
/* 0x1 */ u8 field_0x1;
|
||||
/* 0x2 */ u8 field_0x2;
|
||||
/* 0x3 */ u8 field_0x3;
|
||||
|
||||
J2DTevSwapModeTableInfo& operator=(const J2DTevSwapModeTableInfo& other) {
|
||||
field_0x0 = other.field_0x0;
|
||||
field_0x1 = other.field_0x1;
|
||||
field_0x2 = other.field_0x2;
|
||||
field_0x3 = other.field_0x3;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
|
||||
@@ -564,6 +597,14 @@ struct J2DColorChanInfo {
|
||||
/* 0x0 */ u8 field_0x1;
|
||||
/* 0x0 */ u8 field_0x2;
|
||||
/* 0x0 */ u8 field_0x3;
|
||||
|
||||
J2DColorChanInfo& operator=(const J2DColorChanInfo& other) {
|
||||
field_0x0 = other.field_0x0;
|
||||
field_0x1 = other.field_0x1;
|
||||
field_0x2 = other.field_0x2;
|
||||
field_0x3 = other.field_0x3;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
inline u16 J2DCalcColorChanID(u8 param_0) { return param_0; }
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
|
||||
// matches debug
|
||||
inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
|
||||
inline f32 J3DCalcZValue(__REGISTER MtxP m, __REGISTER Vec v) {
|
||||
#ifdef __MWERKS__
|
||||
register f32 temp_f4;
|
||||
register f32 out;
|
||||
register f32 temp_f0;
|
||||
register f32 temp_f2;
|
||||
register f32 temp_f1 = 1.0f;
|
||||
__REGISTER f32 temp_f4;
|
||||
__REGISTER f32 out;
|
||||
__REGISTER f32 temp_f0;
|
||||
__REGISTER f32 temp_f2;
|
||||
__REGISTER f32 temp_f1 = 1.0f;
|
||||
|
||||
// clang-format off
|
||||
asm {
|
||||
|
||||
@@ -1543,6 +1543,15 @@ struct J3DAlphaCompInfo {
|
||||
/* 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;
|
||||
}
|
||||
};
|
||||
|
||||
extern const u16 j3dDefaultAlphaCmpID;
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
J3DLightObj() { mInfo = j3dDefaultLightInfo; }
|
||||
void load(u32) const;
|
||||
|
||||
J3DLightInfo& getLightInfo() { return mInfo; }
|
||||
J3DLightInfo* getLightInfo() { return &mInfo; }
|
||||
J3DLightObj& operator=(J3DLightObj const& other) {
|
||||
mInfo = other.mInfo;
|
||||
return *this;
|
||||
@@ -54,9 +54,9 @@ struct J3DTextureSRTInfo {
|
||||
|
||||
inline void operator=(J3DTextureSRTInfo const& other) {
|
||||
#ifdef __MWERKS__
|
||||
register const f32* src = &other.mScaleX;
|
||||
register f32* dst = &mScaleX;
|
||||
register f32 xy;
|
||||
__REGISTER const f32* src = &other.mScaleX;
|
||||
__REGISTER f32* dst = &mScaleX;
|
||||
__REGISTER f32 xy;
|
||||
asm {
|
||||
psq_l xy, 0(src), 0, 0
|
||||
psq_st xy, 0(dst), 0, 0
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "JSystem/J3DGraphBase/J3DStruct.h"
|
||||
#include "JSystem/J3DAssert.h"
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "global.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
@@ -79,6 +80,14 @@ struct J3DTexCoordInfo {
|
||||
/* 0x1 */ u8 mTexGenSrc;
|
||||
/* 0x2 */ u8 mTexGenMtx;
|
||||
/* 0x3 */ u8 pad;
|
||||
|
||||
J3DTexCoordInfo& operator=(const J3DTexCoordInfo& other) {
|
||||
mTexGenType = other.mTexGenType;
|
||||
mTexGenSrc = other.mTexGenSrc;
|
||||
mTexGenMtx = other.mTexGenMtx;
|
||||
pad = other.pad;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8];
|
||||
@@ -108,7 +117,7 @@ struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
void setTexMtxReg(u16 reg) { mTexMtxReg = reg; }
|
||||
J3DTexCoord& operator=(const J3DTexCoord& other) {
|
||||
// Fake match (__memcpy or = doesn't match)
|
||||
*(uintptr_t*)this = *(uintptr_t*)&other;
|
||||
*(u32*)this = *(u32*)&other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
|
||||
JAISoundID() {}
|
||||
|
||||
bool isAnonymous() const { return id_.composite_ == 0xFFFFFFFF; }
|
||||
void setAnonymous() { id_.composite_ = 0xFFFFFFFF; }
|
||||
bool isAnonymous() const { return id_.composite_ == -1; }
|
||||
void setAnonymous() { id_.composite_ = -1; }
|
||||
|
||||
union {
|
||||
u32 composite_;
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace JASDsp {
|
||||
extern FxBuf* FX_BUF;
|
||||
extern f32 sDSPVolume;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
extern s32 dspMutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
int mLine;
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
|
||||
#define JGADGET_ASSERTWARN(line, COND) \
|
||||
((COND)) || (JGadget_outMessage(JGadget_outMessage::warning, __FILE__, line) << #COND, false);
|
||||
|
||||
@@ -35,14 +35,14 @@ struct JORServer;
|
||||
|
||||
class JOREventListener {
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
virtual void listenPropertyEvent(const JORPropertyEvent*) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
class JORReflexible : public JOREventListener {
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
JORReflexible();
|
||||
static JORServer* getJORServer();
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ inline JKRHeap* JKRGetRootHeap2() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
inline void JKRSetDebugFillNotuse(u8 status) { data_804508B1 = status; }
|
||||
inline void JKRSetDebugFillNew(u8 status) { data_804508B2 = status; }
|
||||
inline void JKRSetDebugFillDelete(u8 status) { data_804508B3 = status; }
|
||||
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
>
|
||||
{
|
||||
TIterator_data_(const TFunctionValue_list_parameter& rParent, const f32* value) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
pOwn_ = &rParent;
|
||||
#endif
|
||||
pf_ = value;
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
void set(const f32* value) { pf_ = value; }
|
||||
|
||||
friend bool operator==(const TIterator_data_& r1, const TIterator_data_& r2) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
if (!(r1.pOwn_==r2.pOwn_)) {
|
||||
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
|
||||
msg << "r1.pOwn_==r2.pOwn_";
|
||||
@@ -333,9 +333,10 @@ public:
|
||||
}
|
||||
|
||||
f32 operator*() {
|
||||
#ifdef DEBUG
|
||||
// this guard is required - removing it breaks float regalloc in std::upper_bound
|
||||
#if DEBUG
|
||||
JUT_ASSERT(947, pf_!=NULL);
|
||||
#endif
|
||||
#endif
|
||||
return *pf_;
|
||||
}
|
||||
|
||||
@@ -357,7 +358,7 @@ public:
|
||||
}
|
||||
|
||||
friend s32 operator-(const TIterator_data_& r1, const TIterator_data_& r2) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
if (!(r1.pOwn_==r2.pOwn_)) {
|
||||
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
|
||||
msg << "r1.pOwn_==r2.pOwn_";
|
||||
@@ -366,7 +367,7 @@ public:
|
||||
return (r1.pf_ - r2.pf_) / suData_size;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
/* 0x00 */ const TFunctionValue_list_parameter* pOwn_;
|
||||
/* 0x04 */ const f32* pf_;
|
||||
#else
|
||||
@@ -421,7 +422,7 @@ public:
|
||||
>
|
||||
{
|
||||
TIterator_data_(const TFunctionValue_hermite& rParent, const f32* value) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
pOwn_ = &rParent;
|
||||
#endif
|
||||
pf_ = value;
|
||||
@@ -435,7 +436,7 @@ public:
|
||||
}
|
||||
|
||||
friend bool operator==(const TIterator_data_& r1, const TIterator_data_& r2) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
if (!(r1.pOwn_==r2.pOwn_)) {
|
||||
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
|
||||
msg << "r1.pOwn_==r2.pOwn_";
|
||||
@@ -445,7 +446,7 @@ public:
|
||||
}
|
||||
|
||||
f32 operator*() {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
JUT_ASSERT(1098, pf_!=NULL);
|
||||
#endif
|
||||
return *pf_;
|
||||
@@ -469,7 +470,7 @@ public:
|
||||
}
|
||||
|
||||
friend s32 operator-(const TIterator_data_& r1, const TIterator_data_& r2) {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
if (!(r1.pOwn_==r2.pOwn_)) {
|
||||
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
|
||||
msg << "r1.pOwn_==r2.pOwn_";
|
||||
@@ -483,7 +484,7 @@ public:
|
||||
return (r1.pf_ - r2.pf_) / r1.uSize_;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
/* 0x00 */ const TFunctionValue_hermite* pOwn_;
|
||||
/* 0x04 */ const f32* pf_;
|
||||
/* 0x08 */ u32 uSize_;
|
||||
|
||||
@@ -47,7 +47,7 @@ struct TVariableValue {
|
||||
}
|
||||
|
||||
void setValue_none() {
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
field_0xc.fv = NULL;
|
||||
#endif
|
||||
field_0x8 = NULL;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "dolphin/os.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG
|
||||
#define JUT_SHOW_ASSERT(LINE, COND) JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND)
|
||||
|
||||
#define JUT_ASSERT(LINE, COND) \
|
||||
|
||||
Reference in New Issue
Block a user