mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 18:57:14 -04:00
Various alignments to debug + matching TUs (#2391)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define J3DANIMATION_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTNameTab.h"
|
||||
#include "global.h"
|
||||
|
||||
@@ -590,10 +591,11 @@ public:
|
||||
|
||||
u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; }
|
||||
u16 getUpdateMaterialNum() const { return mTrackNum / 3; }
|
||||
u16 getPostUpdateMaterialNum() const { return field_0x4a / 3; }
|
||||
|
||||
int getUpdateTexMtxID(u16 idx) { return mUpdateTexMtxID[idx]; }
|
||||
int getUpdateTexMtxID(u16 idx) const { return mUpdateTexMtxID[idx]; }
|
||||
bool isValidUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx] != 0xffff; }
|
||||
u32 getTexMtxCalcType() const { return mTexMtxCalcType; }
|
||||
u32 getTexMtxCalcType() { return mTexMtxCalcType; }
|
||||
Vec* getSRTCenter(u16 idx) { return &mSRTCenter[idx]; }
|
||||
|
||||
/* 0x0C */ int mDecShift;
|
||||
@@ -719,7 +721,10 @@ public:
|
||||
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
|
||||
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
|
||||
u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; }
|
||||
u16 getUpdateMaterialID(u16 idx) const {
|
||||
JUT_ASSERT_MSG(1578, 0 <= mUpdateMaterialNum - idx, "Error : range over.")
|
||||
return mUpdateMaterialID[idx];
|
||||
}
|
||||
|
||||
/* 0x0C */ u16 field_0xc;
|
||||
/* 0x0E */ u16 field_0xe;
|
||||
|
||||
@@ -118,6 +118,10 @@ namespace JASDsp {
|
||||
extern TChannel* CH_BUF;
|
||||
extern FxBuf* FX_BUF;
|
||||
extern f32 sDSPVolume;
|
||||
|
||||
#ifdef DEBUG
|
||||
extern s32 dspMutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
u16 DSP_CreateMap2(u32 msg);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
|
||||
@@ -112,7 +113,7 @@ class JASMemChunkPool : public OSMutex {
|
||||
mChunks = 0;
|
||||
}
|
||||
|
||||
bool checkArea(void* ptr) {
|
||||
bool checkArea(const void* ptr) const {
|
||||
return (u8*)this + 0xc <= (u8*)ptr && (u8*)ptr < (u8*)this + (ChunkSize + 0xc);
|
||||
}
|
||||
|
||||
@@ -127,11 +128,11 @@ class JASMemChunkPool : public OSMutex {
|
||||
return rv;
|
||||
}
|
||||
|
||||
void free() {
|
||||
void free(void* mem) {
|
||||
mChunks--;
|
||||
}
|
||||
|
||||
bool isEmpty() {
|
||||
bool isEmpty() const {
|
||||
return mChunks == 0;
|
||||
}
|
||||
|
||||
@@ -201,7 +202,8 @@ public:
|
||||
MemoryChunk* prevChunk = NULL;
|
||||
while (chunk != NULL) {
|
||||
if (chunk->checkArea(ptr)) {
|
||||
chunk->free();
|
||||
chunk->free(ptr);
|
||||
|
||||
if (chunk != field_0x18 && chunk->isEmpty()) {
|
||||
MemoryChunk* nextChunk = chunk->getNextChunk();
|
||||
delete chunk;
|
||||
@@ -212,6 +214,8 @@ public:
|
||||
prevChunk = chunk;
|
||||
chunk = chunk->getNextChunk();
|
||||
}
|
||||
|
||||
JUT_PANIC(362,"Cannnot free for JASMemChunkPool")
|
||||
}
|
||||
|
||||
/* 0x18 */ MemoryChunk* field_0x18;
|
||||
|
||||
@@ -37,10 +37,10 @@ public:
|
||||
const JASSeqReader* getSeqReader() const { return &mReader; }
|
||||
void* getBase() { return mReader.getBase(); }
|
||||
void* getAddr(u32 param_0) { return mReader.getAddr(param_0); }
|
||||
u8 getByte(u32 param_0) { return mReader.getByte(param_0); }
|
||||
u16 get16(u32 param_0) { return mReader.get16(param_0); }
|
||||
u32 get24(int param_0) { return mReader.get24(param_0); }
|
||||
u32 get32(u32 param_0) { return mReader.get32(param_0); }
|
||||
u8 getByte(u32 param_0) const { return mReader.getByte(param_0); }
|
||||
u16 get16(u32 param_0) const { return mReader.get16(param_0); }
|
||||
u32 get24(u32 param_0) const { return mReader.get24(param_0); }
|
||||
u32 get32(u32 param_0) const { return mReader.get32(param_0); }
|
||||
void* getCur() { return mReader.getCur(); }
|
||||
u32 readByte() { return mReader.readByte(); }
|
||||
u32 read16() { return mReader.read16(); }
|
||||
|
||||
@@ -25,29 +25,30 @@ public:
|
||||
field_0x04 = (u8*)param_1;
|
||||
}
|
||||
|
||||
u32 get24(int param_0) {
|
||||
u32 get24(int param_0) const {
|
||||
return (*(u32*)(field_0x00 + param_0 - 1)) & 0xffffff;
|
||||
}
|
||||
|
||||
u32* getBase() { return (u32*)field_0x00; }
|
||||
void* getAddr(u32 param_0) { return field_0x00 + param_0; }
|
||||
u8 getByte(u32 param_0) { return *(field_0x00 + param_0); }
|
||||
u16 get16(u32 param_0) { return *(u16*)(field_0x00 + param_0); }
|
||||
u32 get32(u32 param_0) { return *(u32*)(field_0x00 + param_0); }
|
||||
u8 getByte(u32 param_0) const { return *(field_0x00 + param_0); }
|
||||
u16 get16(u32 param_0) const { return *(u16*)(field_0x00 + param_0); }
|
||||
u32 get32(u32 param_0) const { return *(u32*)(field_0x00 + param_0); }
|
||||
u8* getCur() { return field_0x04; }
|
||||
u32 readByte() { return *field_0x04++; }
|
||||
u32 read16() {
|
||||
u16* tmp = (u16*)field_0x04;
|
||||
field_0x04 += 2;
|
||||
return *tmp;
|
||||
return *((u16*)field_0x04)++;
|
||||
}
|
||||
u32 read24() {
|
||||
field_0x04--;
|
||||
u32* tmp = (u32*)field_0x04;
|
||||
field_0x04 += 4;
|
||||
return *tmp & 0x00ffffff;
|
||||
return (*((u32*)field_0x04)++) & 0x00ffffff;
|
||||
}
|
||||
u16 getLoopCount() const {
|
||||
if (field_0x08 == 0) {
|
||||
return 0;
|
||||
}
|
||||
return field_0x2c[field_0x08 - 1];
|
||||
}
|
||||
u16 getLoopCount() const { return field_0x08 == 0 ? 0 : field_0x2c[field_0x08 - 1]; }
|
||||
|
||||
/* 0x00 */ u8* field_0x00;
|
||||
/* 0x04 */ u8* field_0x04;
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace JASDsp {
|
||||
extern const u32 FILTER_MODE_IIR;
|
||||
};
|
||||
|
||||
#define MAX_CHILDREN 16
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -125,14 +127,17 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
static TList sTrackList;
|
||||
|
||||
JASSeqCtrl* getSeqCtrl() { return &mSeqCtrl; }
|
||||
u16 getPort(u32 param_0) { return mTrackPort.get(param_0); }
|
||||
u16 getPort(u32 param_0) const { return mTrackPort.get(param_0); }
|
||||
void setPort(u32 param_0, u16 param_1) { mTrackPort.set(param_0, param_1); }
|
||||
u32 checkPortIn(u32 param_0) { return mTrackPort.checkImport(param_0); }
|
||||
u32 checkPort(u32 param_0) { return mTrackPort.checkExport(param_0); }
|
||||
u32 checkPortIn(u32 param_0) const { return mTrackPort.checkImport(param_0); }
|
||||
u32 checkPort(u32 param_0) const { return mTrackPort.checkExport(param_0); }
|
||||
u32 readReg(JASRegisterParam::RegID param_0) { return mRegisterParam.read(param_0); }
|
||||
void writeReg(JASRegisterParam::RegID param_0, u32 param_1) { mRegisterParam.write(param_0, param_1); }
|
||||
JASTrack* getParent() { return mParent; }
|
||||
JASTrack* getChild(u32 index) { return mChildren[index]; }
|
||||
JASTrack* getChild(u32 index) {
|
||||
JUT_ASSERT(115, index < MAX_CHILDREN)
|
||||
return mChildren[index];
|
||||
}
|
||||
int getChannelMgrCount() { return mChannelMgrCount; }
|
||||
f32 getVibDepth() const { return mVibDepth; }
|
||||
void setVibDepth(f32 param_0) { mVibDepth = param_0; }
|
||||
@@ -142,9 +147,9 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
void setTremDepth(f32 param_0) { mTremDepth = param_0; }
|
||||
f32 getTremPitch() const { return mTremPitch; }
|
||||
void setTremPitch(f32 param_0) { mTremPitch = param_0; }
|
||||
u16 getVibDelay() const { return mVibDelay; }
|
||||
u32 getVibDelay() const { return mVibDelay; }
|
||||
void setVibDelay(u32 param_0) { mVibDelay = param_0; }
|
||||
u16 getTremDelay() const { return mTremDelay; }
|
||||
u32 getTremDelay() const { return mTremDelay; }
|
||||
void setTremDelay(u32 param_0) { mTremDelay = param_0; }
|
||||
u8 getStatus() const { return mStatus; }
|
||||
void setAutoDelete(u8 param_0) { mFlags.autoDelete = param_0; }
|
||||
@@ -155,8 +160,8 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
u16 getDirectRelease() const { return mDirectRelease; }
|
||||
void setDirectRelease(u16 param_0) {mDirectRelease = param_0; }
|
||||
u16 getTimebase() const { return mTimebase; }
|
||||
s8 getTranspose() const { return mTranspose; }
|
||||
void setTranspose(u32 param_0) { mTranspose = param_0; }
|
||||
int getTranspose() const { return mTranspose; }
|
||||
void setTranspose(s32 param_0) { mTranspose = param_0; }
|
||||
u16 getBankNumber() const { return mBankNumber; }
|
||||
void setBankNumber(u16 param_0) { mBankNumber = param_0; }
|
||||
u16 getProgNumber() const { return mProgNumber; }
|
||||
@@ -187,7 +192,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
/* 0x0e4 */ JASOscillator::Data mOscParam[2];
|
||||
/* 0x114 */ JASOscillator::Point mOscPoint[4];
|
||||
/* 0x12C */ JASTrack* mParent;
|
||||
/* 0x130 */ JASTrack* mChildren[16];
|
||||
/* 0x130 */ JASTrack* mChildren[MAX_CHILDREN];
|
||||
/* 0x170 */ TChannelMgr* mChannelMgrs[4];
|
||||
/* 0x180 */ TChannelMgr mDefaultChannelMgr;
|
||||
/* 0x1D0 */ int mChannelMgrCount;
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
/* 8029360C */ u32 checkImport(u32) const;
|
||||
/* 80293628 */ u32 checkExport(u32) const;
|
||||
|
||||
u16 get(u32 param_0) { return field_0x4[param_0]; }
|
||||
u16 get(u32 param_0) const { return field_0x4[param_0]; }
|
||||
void set(u32 param_0, u16 param_1) { field_0x4[param_0] = param_1; }
|
||||
|
||||
u16 field_0x0;
|
||||
|
||||
+44
-68
@@ -38,7 +38,8 @@ struct TUtil<f32> {
|
||||
return x;
|
||||
}
|
||||
f32 root = __frsqrte(x);
|
||||
return 0.5f * root * (3.0f - x * (root * root));
|
||||
root = 0.5f * root * (3.0f - x * (root * root));
|
||||
return root;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -137,6 +138,24 @@ inline float fsqrt_step(float mag) {
|
||||
return 0.5f * root * (3.0f - mag * (root * root));
|
||||
}
|
||||
|
||||
inline void mulInternal(register const f32* a, register const f32* b, register float* dst) {
|
||||
register f32 a_x_y;
|
||||
register f32 b_x_y;
|
||||
register f32 x_y;
|
||||
register f32 za;
|
||||
register f32 zb;
|
||||
register f32 z;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l a_x_y, 0(a), 0, 0
|
||||
psq_l b_x_y, 0(b), 0, 0
|
||||
ps_mul x_y, a_x_y, b_x_y
|
||||
psq_st x_y, 0(dst), 0, 0
|
||||
};
|
||||
dst[2] = a[2] * b[2];
|
||||
#endif
|
||||
}
|
||||
|
||||
template <>
|
||||
struct TVec3<f32> : public Vec {
|
||||
inline TVec3(const Vec& i_vec) {
|
||||
@@ -147,7 +166,8 @@ struct TVec3<f32> : public Vec {
|
||||
setTVec3f(&i_vec.x, &x);
|
||||
}
|
||||
|
||||
TVec3(f32 x, f32 y, f32 z) {
|
||||
template<class U>
|
||||
TVec3(U x, U y, U z) {
|
||||
set(x, y, z);
|
||||
}
|
||||
|
||||
@@ -156,7 +176,8 @@ struct TVec3<f32> : public Vec {
|
||||
operator Vec*() { return (Vec*)&x; }
|
||||
operator const Vec*() const { return (Vec*)&x; }
|
||||
|
||||
void set(const TVec3<f32>& other) {
|
||||
template<class U>
|
||||
void set(const TVec3<U>& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
@@ -168,7 +189,8 @@ struct TVec3<f32> : public Vec {
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
void set(f32 x_, f32 y_, f32 z_) {
|
||||
template<class U>
|
||||
void set(U x_, U y_, U z_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
z = z_;
|
||||
@@ -181,27 +203,7 @@ struct TVec3<f32> : public Vec {
|
||||
void zero() { x = y = z = 0.0f; }
|
||||
|
||||
void mul(const TVec3<f32>& a, const TVec3<f32>& b) {
|
||||
register f32* dst = &x;
|
||||
const register f32* srca = &a.x;
|
||||
const register f32* srcb = &b.x;
|
||||
register f32 a_x_y;
|
||||
register f32 b_x_y;
|
||||
register f32 x_y;
|
||||
register f32 za;
|
||||
register f32 zb;
|
||||
register f32 z;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l a_x_y, 0(srca), 0, 0
|
||||
psq_l b_x_y, 0(srcb), 0, 0
|
||||
ps_mul x_y, a_x_y, b_x_y
|
||||
psq_st x_y, 0(dst), 0, 0
|
||||
lfs za, 8(srca)
|
||||
lfs zb, 8(srcb)
|
||||
fmuls z, za, zb
|
||||
stfs z, 8(dst)
|
||||
};
|
||||
#endif
|
||||
mulInternal(&a.x, &b.x, &this->x);
|
||||
}
|
||||
|
||||
inline void mul(const TVec3<f32>& a) {
|
||||
@@ -239,23 +241,19 @@ struct TVec3<f32> : public Vec {
|
||||
return JMathInlineVEC::C_VECSquareMag((Vec*)&x);
|
||||
}
|
||||
|
||||
void normalize() {
|
||||
f32 normalize() {
|
||||
f32 sq = squared();
|
||||
if (sq <= FLT_EPSILON * 32.0f) {
|
||||
return;
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
return 0.0f;
|
||||
}
|
||||
f32 norm;
|
||||
if (sq <= 0.0f) {
|
||||
norm = sq;
|
||||
} else {
|
||||
norm = fsqrt_step(sq);
|
||||
}
|
||||
scale(norm);
|
||||
f32 inv_norm = TUtil<f32>::inv_sqrt(sq);
|
||||
scale(inv_norm);
|
||||
return inv_norm * sq;
|
||||
}
|
||||
|
||||
void normalize(const TVec3<f32>& other) {
|
||||
f32 sq = other.squared();
|
||||
if (sq <= FLT_EPSILON * 32.0f) {
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
zero();
|
||||
return;
|
||||
}
|
||||
@@ -348,18 +346,14 @@ struct TVec3<f32> : public Vec {
|
||||
VECCrossProduct(a, b, *this);
|
||||
}
|
||||
|
||||
void setLength(f32 len) {
|
||||
f32 setLength(f32 len) {
|
||||
f32 sq = squared();
|
||||
if (sq <= FLT_EPSILON * 32.0f) {
|
||||
return;
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
return 0.0f;
|
||||
}
|
||||
f32 norm;
|
||||
if (sq <= 0.0f) {
|
||||
norm = sq;
|
||||
} else {
|
||||
norm = fsqrt_step(sq);
|
||||
}
|
||||
scale(norm * len);
|
||||
f32 inv_norm = TUtil<f32>::inv_sqrt(sq);
|
||||
scale(inv_norm * len);
|
||||
return inv_norm * sq;
|
||||
}
|
||||
|
||||
f32 setLength(const TVec3<f32>& other, f32 len) {
|
||||
@@ -374,25 +368,7 @@ struct TVec3<f32> : public Vec {
|
||||
}
|
||||
|
||||
f32 dot(const TVec3<f32>& other) const {
|
||||
register const f32* pThis = &x;
|
||||
register const f32* pOther = &other.x;
|
||||
register f32 res;
|
||||
register f32 thisyz;
|
||||
register f32 otheryz;
|
||||
register f32 otherxy;
|
||||
register f32 thisxy;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l thisyz, 4(pThis), 0, 0
|
||||
psq_l otheryz, 4(pOther), 0, 0
|
||||
ps_mul thisyz, thisyz, otheryz
|
||||
psq_l thisxy, 0(pThis), 0, 0
|
||||
psq_l otherxy, 0(pOther), 0, 0
|
||||
ps_madd otheryz, thisxy, otherxy, thisyz
|
||||
ps_sum0 res, otheryz, thisyz, thisyz
|
||||
};
|
||||
#endif
|
||||
return res;
|
||||
return JMathInlineVEC::C_VECDotProduct(this, &other);
|
||||
}
|
||||
|
||||
void cubic(const TVec3<f32>& param_1, const TVec3<f32>& param_2, const TVec3<f32>& param_3,
|
||||
@@ -450,15 +426,15 @@ struct TVec2 {
|
||||
return (x >= other.x) && (y >= other.y) ? true : false;
|
||||
}
|
||||
|
||||
f32 dot(const TVec2<T>& other) {
|
||||
f32 dot(const TVec2<T>& other) const {
|
||||
return x * other.x + y * other.y;
|
||||
}
|
||||
|
||||
f32 squared() {
|
||||
f32 squared() const {
|
||||
return dot(*this);
|
||||
}
|
||||
|
||||
f32 length() {
|
||||
f32 length() const {
|
||||
f32 sqr = squared();
|
||||
if (sqr <= 0.0f) {
|
||||
return sqr;
|
||||
|
||||
@@ -8,6 +8,9 @@ class JKRHeap;
|
||||
typedef void (*JKRErrorHandler)(void*, u32, int);
|
||||
|
||||
extern bool data_804508B0;
|
||||
extern u8 data_804508B1;
|
||||
extern u8 data_804508B2;
|
||||
extern u8 data_804508B3;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jkernel
|
||||
@@ -247,4 +250,10 @@ inline JKRHeap* JKRGetRootHeap() {
|
||||
return JKRHeap::getRootHeap();
|
||||
}
|
||||
|
||||
#ifdef 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; }
|
||||
#endif
|
||||
|
||||
#endif /* JKRHEAP_H */
|
||||
|
||||
@@ -227,6 +227,26 @@ namespace JMathInlineVEC {
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
inline f32 C_VECDotProduct(register const Vec *a, register const Vec *b) {
|
||||
register f32 res;
|
||||
register f32 thisyz;
|
||||
register f32 otheryz;
|
||||
register f32 otherxy;
|
||||
register f32 thisxy;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l thisyz, 4(a), 0, 0
|
||||
psq_l otheryz, 4(b), 0, 0
|
||||
ps_mul thisyz, thisyz, otheryz
|
||||
psq_l thisxy, 0(a), 0, 0
|
||||
psq_l otherxy, 0(b), 0, 0
|
||||
ps_madd otheryz, thisxy, otherxy, thisyz
|
||||
ps_sum0 res, otheryz, thisyz, thisyz
|
||||
};
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
u32 getClrLoopOfst(u32 param_1) const { return getClrLoopOfstMask() & param_1; }
|
||||
u8 getTexLoopOfstMask() const { return mpData->mTexAnmRndmMask; }
|
||||
u32 getTexLoopOfst(u8 param_1) const { return getTexLoopOfstMask() & param_1; }
|
||||
u8 getLoopOfstValue() { return mpData->mAnmRndm; }
|
||||
u8 getLoopOfstValue() const { return mpData->mAnmRndm; }
|
||||
|
||||
f32 getIncTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[5]; }
|
||||
f32 getInitTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[0]; }
|
||||
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
Mtx mCamMtx;
|
||||
Mtx mPrjMtx;
|
||||
|
||||
void getCamMtx(Mtx* dst) const { MTXCopy(mCamMtx, *dst); }
|
||||
void getPrjMtx(Mtx* dst) const { MTXCopy(mPrjMtx, *dst); }
|
||||
void getCamMtx(Mtx dst) const { MTXCopy(mCamMtx, dst); }
|
||||
void getPrjMtx(Mtx dst) const { MTXCopy(mPrjMtx, dst); }
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -96,10 +96,10 @@ public:
|
||||
f32 getInitVelDir() { return mpData->mInitialVelDir; }
|
||||
f32 getInitVelDirSp() { return mpData->mSpread; }
|
||||
f32 getInitVelRndm() { return mpData->mInitialVelRndm; }
|
||||
f32 getInitVelRatio() { return mpData->mInitialVelRatio; }
|
||||
f32 getInitVelRatio() const { return mpData->mInitialVelRatio; }
|
||||
f32 getAirRes() { return mpData->mAirResist; }
|
||||
f32 getLifeTimeRndm() { return mpData->mLifeTimeRndm; }
|
||||
f32 getMomentRndm() { return mpData->mMoment; }
|
||||
f32 getLifetimeRndm() const { return mpData->mLifeTimeRndm; }
|
||||
f32 getMomentRndm() const { return mpData->mMoment; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ const JPADynamicsBlockData* mpData;
|
||||
|
||||
@@ -19,13 +19,19 @@ class JPAParticleCallBack;
|
||||
*
|
||||
*/
|
||||
struct JPAEmitterWorkData {
|
||||
struct JPAVolumeCalcData {
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mVolumePos;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mVelOmni;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mVelAxis;
|
||||
};
|
||||
|
||||
JPAEmitterWorkData() : mRndm(0) {}
|
||||
|
||||
/* 0x00 */ JPABaseEmitter* mpEmtr;
|
||||
/* 0x04 */ JPAResource* mpRes;
|
||||
/* 0x08 */ JPAResourceManager* mpResMgr;
|
||||
/* 0x0C */ JPARandom mRndm;
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mVolumePos;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> mVelOmni;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> mVelAxis;
|
||||
/* 0x10 */ JPAVolumeCalcData mVolumeCalcData;
|
||||
/* 0x34 */ f32 mVolumeSize;
|
||||
/* 0x38 */ f32 mVolumeMinRad;
|
||||
/* 0x3C */ f32 mVolumeSweep;
|
||||
@@ -94,7 +100,7 @@ enum {
|
||||
class JPABaseEmitter {
|
||||
public:
|
||||
/* 8027E5EC */ ~JPABaseEmitter() {}
|
||||
/* 8027E64C */ JPABaseEmitter() : mLink(this) {}
|
||||
/* 8027E64C */ JPABaseEmitter() : mLink(this), mRndm(0) {}
|
||||
/* 8027E6EC */ void init(JPAEmitterManager*, JPAResource*);
|
||||
/* 8027EDD4 */ bool processTillStartFrame();
|
||||
/* 8027EE14 */ bool processTermination();
|
||||
@@ -109,8 +115,8 @@ public:
|
||||
void initStatus(u32 status) { mStatus = status; }
|
||||
void setStatus(u32 status) { mStatus |= status; }
|
||||
void clearStatus(u32 status) { mStatus &= ~status; }
|
||||
u32 checkStatus(u32 status) { return (mStatus & status); }
|
||||
bool checkFlag(u32 flag) { return !!(mpRes->getDyn()->getFlag() & flag); }
|
||||
u32 checkStatus(u32 status) const { return (mStatus & status); }
|
||||
bool checkFlag(u32 flag) const { return !!(mpRes->getDyn()->getFlag() & flag); }
|
||||
u8 getResourceManagerID() const { return mResMgrID; }
|
||||
u8 getGroupID() const { return mGroupID; }
|
||||
u8 getDrawTimes() const { return mDrawTimes; }
|
||||
|
||||
@@ -32,18 +32,18 @@ public:
|
||||
/* 8027E344 */ void entryResourceManager(JPAResourceManager*, u8);
|
||||
/* 8027E354 */ void clearResourceManager(u8);
|
||||
/* 8027E3F4 */ void calcYBBCam();
|
||||
JPAResourceManager* getResourceManager(u16 idx) { return mpResMgrAry[idx]; }
|
||||
JPAResourceManager* getResourceManager(u16 idx) { return pResMgrAry[idx]; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ JSUList<JPABaseEmitter>* mpGrpEmtr;
|
||||
/* 0x00 */ JSUList<JPABaseEmitter>* pEmtrUseList;
|
||||
/* 0x04 */ JSUList<JPABaseEmitter> mFreeEmtrList;
|
||||
/* 0x10 */ JPAList<JPABaseParticle> mPtclPool;
|
||||
/* 0x1C */ JPAResourceManager** mpResMgrAry;
|
||||
/* 0x20 */ JPAEmitterWorkData* mpWorkData;
|
||||
/* 0x24 */ u32 mEmtrMax;
|
||||
/* 0x28 */ u32 mPtclMax;
|
||||
/* 0x2C */ u8 mGrpMax;
|
||||
/* 0x2D */ u8 mResMax;
|
||||
/* 0x1C */ JPAResourceManager** pResMgrAry;
|
||||
/* 0x20 */ JPAEmitterWorkData* pWd;
|
||||
/* 0x24 */ u32 emtrNum;
|
||||
/* 0x28 */ u32 ptclNum;
|
||||
/* 0x2C */ u8 gidMax;
|
||||
/* 0x2D */ u8 ridMax;
|
||||
};
|
||||
|
||||
#endif /* JPAEMITTERMANAGER_H */
|
||||
|
||||
@@ -126,8 +126,8 @@ public:
|
||||
u32 getAddType() { return (mpData->mFlags >> 8) & 3; }
|
||||
u32 getSttFlag() { return mpData->mFlags >> 16; }
|
||||
bool checkStatus(u16 flag) { return flag & getSttFlag(); }
|
||||
f32 getMagRndm() { return mpData->mMagRndm; }
|
||||
f32 getVal1() { return mpData->mVal1; }
|
||||
f32 getMagRndm() const { return mpData->mMagRndm; }
|
||||
f32 getVal1() const { return mpData->mVal1; }
|
||||
f32 getFadeInTime() { return mpData->mFadeInTime; }
|
||||
f32 getFadeOutTime() { return mpData->mFadeOutTime; }
|
||||
f32 getEnTime() { return mpData->mEnTime; }
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
f32 getFadeOutRate() { return mFadeOutRate; }
|
||||
JGeometry::TVec3<f32>& getPos() { return mPos; }
|
||||
JGeometry::TVec3<f32>& getDir() { return mDir; }
|
||||
f32 getMag() { return mMag; }
|
||||
f32 getMag() const { return mMag; }
|
||||
void getPosOrig(JGeometry::TVec3<f32>* pos) { pos->set(mpData->mPos); }
|
||||
void getDirOrig(JGeometry::TVec3<f32>* dir) { dir->set(mpData->mDir); }
|
||||
f32 getMagOrig() { return mpData->mMag; }
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
*/
|
||||
template <class T>
|
||||
struct JPANode {
|
||||
JPANode() {
|
||||
mpPrev = NULL;
|
||||
mpNext = NULL;
|
||||
JPANode() : mpPrev(NULL), mpNext(NULL) {
|
||||
}
|
||||
~JPANode() {}
|
||||
JPANode<T>* getPrev() { return mpPrev; }
|
||||
@@ -34,6 +32,7 @@ struct JPAList {
|
||||
/* 0x08 */ u32 mNum;
|
||||
|
||||
JPAList() : mpFirst(NULL), mpLast(NULL), mNum() {}
|
||||
~JPAList() {}
|
||||
|
||||
JPANode<T>* getEnd() { return NULL; }
|
||||
JPANode<T>* getFirst() const { return mpFirst; }
|
||||
@@ -65,8 +64,7 @@ struct JPAList {
|
||||
} else {
|
||||
mpFirst = node;
|
||||
mpLast = node;
|
||||
node->mpPrev = NULL;
|
||||
node->mpNext = NULL;
|
||||
node->mpNext = node->mpPrev = NULL;
|
||||
}
|
||||
|
||||
mNum++;
|
||||
|
||||
@@ -19,6 +19,7 @@ struct JPAEmitterWorkData;
|
||||
*/
|
||||
class JPABaseParticle {
|
||||
public:
|
||||
~JPABaseParticle() {}
|
||||
/* 8027EFEC */ void init_p(JPAEmitterWorkData*);
|
||||
/* 8027F8C8 */ void init_c(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
/* 8027FFD0 */ bool calc_p(JPAEmitterWorkData*);
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
struct JPARandom {
|
||||
public:
|
||||
JPARandom() { mSeed = 0; }
|
||||
JPARandom(u32 seed) { mSeed = seed; }
|
||||
~JPARandom() {}
|
||||
void set_seed(u32 seed) { mSeed = seed; }
|
||||
|
||||
u32 get_rndm_u() { return mSeed = mSeed * 0x19660du + 0x3c6ef35fu; }
|
||||
|
||||
@@ -195,12 +195,12 @@ public:
|
||||
}
|
||||
|
||||
TTransform_position_direction*
|
||||
transformOnGet_transform_ifEnabled(TTransform_position_direction* param_1,
|
||||
transformOnGet_transform_ifEnabled(TTransform_position_direction& param_1,
|
||||
TTransform_position_direction* param_2) const {
|
||||
if (!transformOnGet_isEnabled()) {
|
||||
return param_1;
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnGet_transform(param_1, param_2);
|
||||
transformOnGet_transform(¶m_1, param_2);
|
||||
return param_2;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ struct TAdaptor {
|
||||
return &pValue_[param_0];
|
||||
}
|
||||
|
||||
const TObject* adaptor_getObject() { return pObject_; }
|
||||
const TObject* adaptor_getObject() const { return pObject_; }
|
||||
|
||||
/* 0x4 */ const TObject* pObject_;
|
||||
/* 0x8 */ TVariableValue* pValue_;
|
||||
|
||||
@@ -45,13 +45,13 @@ class JSULink : public JSUPtrLink {
|
||||
public:
|
||||
JSULink(T* object) : JSUPtrLink((void*)object) {}
|
||||
|
||||
T* getObject() const { return static_cast<T*>(getObjectPtr()); }
|
||||
T* getObject() const { return static_cast<T*>(mObject); }
|
||||
|
||||
JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(this->getList()); }
|
||||
|
||||
JSULink<T>* getNext() const { return static_cast<JSULink*>(this->JSUPtrLink::getNext()); }
|
||||
JSULink<T>* getNext() const { return static_cast<JSULink*>(mNext); }
|
||||
|
||||
JSULink<T>* getPrev() const { return static_cast<JSULink*>(this->JSUPtrLink::getPrev()); }
|
||||
JSULink<T>* getPrev() const { return static_cast<JSULink*>(mPrev); }
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
@@ -10,15 +10,18 @@
|
||||
#define JUT_ASSERT_MSG(LINE, COND, MSG) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, MSG), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define JUT_ASSERT_MSG_F(LINE, COND, MSG, ...) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, LINE, MSG, __VA_ARGS__), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define JUT_PANIC(LINE, TEXT) \
|
||||
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, TEXT); \
|
||||
OSPanic(__FILE__, LINE, "Halt");
|
||||
|
||||
#define JUT_WARN(LINE, ...) \
|
||||
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__); \
|
||||
#define JUT_WARN_DEVICE(LINE, DEVICE, ...) \
|
||||
JUTAssertion::setWarningMessage_f(DEVICE, __FILE__, LINE, __VA_ARGS__); \
|
||||
|
||||
#define JUT_WARN_1(LINE, ...) \
|
||||
JUTAssertion::setWarningMessage_f(1, __FILE__, LINE, __VA_ARGS__); \
|
||||
#define JUT_WARN(LINE, ...) \
|
||||
JUT_WARN_DEVICE(LINE, JUTAssertion::getSDevice(), __VA_ARGS__)
|
||||
|
||||
#define JUT_LOG(LINE, ...) \
|
||||
JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__)
|
||||
@@ -29,9 +32,10 @@
|
||||
#else
|
||||
#define JUT_ASSERT(...) (void)0;
|
||||
#define JUT_ASSERT_MSG(...) (void)0;
|
||||
#define JUT_ASSERT_MSG_F(...) (void)0;
|
||||
#define JUT_PANIC(...)
|
||||
#define JUT_WARN(...)
|
||||
#define JUT_WARN_1(...)
|
||||
#define JUT_WARN_DEVICE(...)
|
||||
#define JUT_LOG(...)
|
||||
#define JUT_CONFIRM(...)
|
||||
#endif
|
||||
@@ -46,6 +50,7 @@ namespace JUTAssertion {
|
||||
|
||||
u32 getSDevice();
|
||||
void showAssert(u32 device, const char * file, int line, const char * assertion);
|
||||
void showAssert_f(u32 device, const char* file, int line, const char* msg, ...);
|
||||
void setWarningMessage_f(u32 device, char * file, int line, const char * fmt, ...);
|
||||
void setLogMessage_f(u32 device, char* file, int line, const char* fmt, ...);
|
||||
void setConfirmMessage(u32 param_1, char* file, int line, bool param_4, const char* msg);
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
bool loadBgmWave(u32);
|
||||
|
||||
bool isSceneExist() { return sceneExist; }
|
||||
int getCurrentSceneNum() const { return sceneNum; }
|
||||
int getCurrentSceneNum() { return sceneNum; }
|
||||
s8 getCurrentRoomNum() { return roomNum; }
|
||||
bool isInGame() const { return inGame; }
|
||||
void setInGame(bool i_inGame) { inGame = i_inGame; }
|
||||
|
||||
@@ -183,6 +183,11 @@ public:
|
||||
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
|
||||
JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; }
|
||||
|
||||
#ifdef DEBUG
|
||||
f32 field_0x00_debug;
|
||||
u8 field_0x04_debug;
|
||||
#endif
|
||||
|
||||
/* 0x00 */ JAISoundHandle mMainBgmHandle;
|
||||
/* 0x04 */ JAISoundHandle mSubBgmHandle;
|
||||
/* 0x08 */ JAISoundHandle mFanfareHandle;
|
||||
|
||||
@@ -53,6 +53,10 @@ private:
|
||||
struct mDoMain {
|
||||
static char COPYDATE_STRING[18];
|
||||
static u32 memMargin;
|
||||
#ifdef DEBUG
|
||||
static u32 archiveHeapSize;
|
||||
static u32 gameHeapSize;
|
||||
#endif
|
||||
static u8 mHeapBriefType;
|
||||
static OSTime sPowerOnTime;
|
||||
static OSTime sHungUpTime;
|
||||
|
||||
Reference in New Issue
Block a user