mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
clean up dolphin files / work on some rels (#212)
* d_a_alldie / d_a_tboxSw / d_a_tag_gstart / d_a_tag_hstop * dolphin OS work / cleanup * dolphin GX work / cleanup * finish changing dolphin files to C * more files into C * match rest of MSL_C math functions * more dolphin files converted to C * remove asm * d_bg_w work * remove asm * d_a_alink work / kytag14
This commit is contained in:
@@ -94,8 +94,4 @@ struct VertexNormal {
|
||||
Vec data;
|
||||
};
|
||||
|
||||
struct VertexPosition {
|
||||
Vec data;
|
||||
};
|
||||
|
||||
#endif /* J3DVERTEX_H */
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define J3DUCLIPPER_H
|
||||
|
||||
#include "dolphin/mtx/vec.h"
|
||||
#include "dolphin/mtx/mtxvec.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class J3DUClipper {
|
||||
|
||||
@@ -127,4 +127,9 @@ private:
|
||||
|
||||
STATIC_ASSERT(sizeof(JUTException) == 0xA4);
|
||||
|
||||
struct JUTWarn {
|
||||
JUTWarn& operator<<(const char*) { return *this; }
|
||||
JUTWarn& operator<<(long) { return *this; }
|
||||
};
|
||||
|
||||
#endif /* JUTEXCEPTION_H */
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MSL_COMMON_SRC_FLOAT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "fdlibm.h"
|
||||
|
||||
#define FP_SNAN 0
|
||||
#define FP_QNAN 1
|
||||
@@ -42,8 +43,23 @@ inline int __fpclassifyf(float __value) {
|
||||
}
|
||||
|
||||
inline int __fpclassifyd(double __value) {
|
||||
// TODO:
|
||||
return FP_INFINITE;
|
||||
switch (__HI(__value) & 0x7ff00000) {
|
||||
case 0x7ff00000: {
|
||||
if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff))
|
||||
return FP_QNAN;
|
||||
else
|
||||
return FP_INFINITE;
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
if ((__HI(__value) & 0x000fffff) || (__LO(__value) & 0xffffffff))
|
||||
return FP_SUBNORMAL;
|
||||
else
|
||||
return FP_ZERO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FP_NORMAL;
|
||||
}
|
||||
|
||||
#endif /* MSL_COMMON_SRC_FLOAT_H */
|
||||
|
||||
@@ -26,7 +26,7 @@ double exp(double);
|
||||
|
||||
extern float __fabsf(float);
|
||||
inline double fabs(double f) {
|
||||
return __fabsf(f);
|
||||
return __fabs(f);
|
||||
}
|
||||
inline double fabsf2(float f) {
|
||||
return __fabsf(f);
|
||||
|
||||
@@ -14,9 +14,9 @@ typedef struct __va_list_struct {
|
||||
typedef _va_list_struct __va_list[1];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" void __va_arg(void*, int);
|
||||
extern "C" void* __va_arg(_va_list_struct*, int);
|
||||
#else
|
||||
void __va_arg(void*, int);
|
||||
void* __va_arg(_va_list_struct*, int);
|
||||
#endif
|
||||
|
||||
#if IN_VSCODE_EDITOR
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#ifndef PTMF_H
|
||||
#define PTMF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
typedef struct __ptmf {
|
||||
long this_delta; // self-explanatory
|
||||
long v_offset; // vtable offset
|
||||
union {
|
||||
void* f_addr; // function address
|
||||
long ve_offset; // virtual function entry offset (of vtable)
|
||||
} f_data;
|
||||
} __ptmf;
|
||||
|
||||
#endif /* PTMF_H */
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
u32 GetActorPid() const { return mActorPid; }
|
||||
void SetPolyPassChk(cBgS_PolyPassChk* p_chk) { mPolyPassChk = p_chk; }
|
||||
void SetGrpPassChk(cBgS_GrpPassChk* p_chk) { mGrpPassChk = p_chk; }
|
||||
cBgS_PolyPassChk* GetPolyPassChk() const { return mPolyPassChk; }
|
||||
|
||||
virtual ~cBgS_Chk(void);
|
||||
}; // Size: 0x14
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
|
||||
private:
|
||||
/* 0x024 */ cM3dGLin mLinP;
|
||||
public:
|
||||
/* 0x024 */ cM3dGLin mLin;
|
||||
/* 0x040 */ cXyz field_0x40;
|
||||
/* 0x04C */ u32 field_0x4c;
|
||||
/* 0x050 */ bool mPreWallChk;
|
||||
/* 0x051 */ bool mPreGroundChk;
|
||||
/* 0x052 */ bool mPreRoofChk;
|
||||
/* 0x053 */ u8 mFrontFlag;
|
||||
/* 0x054 */ u8 mBackFlag;
|
||||
/* 0x053 */ bool mFrontFlag;
|
||||
/* 0x054 */ bool mBackFlag;
|
||||
|
||||
public:
|
||||
cBgS_LinChk();
|
||||
@@ -30,6 +30,13 @@ public:
|
||||
void ClrHit() { field_0x4c &= ~16; }
|
||||
void SetHit() { field_0x4c |= 16; }
|
||||
u32 ChkHit() const { return field_0x4c & 16; }
|
||||
void SetCross(const cXyz& pos) { mLin.SetEnd(pos); }
|
||||
cM3dGLin* GetLinP() { return &mLin; }
|
||||
bool ChkBackFlag() const { return mBackFlag; }
|
||||
bool ChkFrontFlag() const { return mFrontFlag; }
|
||||
bool GetPreWallChk() const { return mPreWallChk; }
|
||||
bool GetPreGroundChk() const { return mPreGroundChk; }
|
||||
bool GetPreRoofChk() const { return mPreRoofChk; }
|
||||
};
|
||||
|
||||
#endif /* C_BG_S_LIN_CHK_H */
|
||||
|
||||
@@ -26,12 +26,12 @@ public:
|
||||
void PlusR(f32);
|
||||
const cXyz& getMaxP(void) const { return mMax; }
|
||||
const cXyz& getMinP(void) const { return mMin; }
|
||||
const f32 GetMaxX(void) const { return mMax.GetX(); }
|
||||
const f32 GetMaxY(void) const { return mMax.GetY(); }
|
||||
const f32 GetMaxZ(void) const { return mMax.GetZ(); }
|
||||
const f32 GetMinX(void) const { return mMin.GetX(); }
|
||||
const f32 GetMinY(void) const { return mMin.GetY(); }
|
||||
const f32 GetMinZ(void) const { return mMin.GetZ(); }
|
||||
const f32 GetMaxX(void) const { return mMax.x; }
|
||||
const f32 GetMaxY(void) const { return mMax.y; }
|
||||
const f32 GetMaxZ(void) const { return mMax.z; }
|
||||
const f32 GetMinX(void) const { return mMin.x; }
|
||||
const f32 GetMinY(void) const { return mMin.y; }
|
||||
const f32 GetMinZ(void) const { return mMin.z; }
|
||||
}; // Size = 0x1C
|
||||
|
||||
STATIC_ASSERT(0x1C == sizeof(cM3dGAab));
|
||||
|
||||
@@ -2,26 +2,34 @@
|
||||
#define C_M3C_G_PLA_H_
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "SSystem/SComponent/c_m3d.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
// Plane with a normal
|
||||
class cM3dGPla {
|
||||
public:
|
||||
cXyz mNormal;
|
||||
f32 mD;
|
||||
/* 0x00 */ cXyz mNormal;
|
||||
/* 0x0C */ f32 mD;
|
||||
/* 0x10 vtable */
|
||||
|
||||
cM3dGPla() {}
|
||||
cM3dGPla(const cXyz*, f32);
|
||||
virtual ~cM3dGPla() {}
|
||||
bool crossInfLin(const cXyz&, const cXyz&, cXyz&) const;
|
||||
void SetupNP0(const Vec&, const Vec&);
|
||||
void SetupNP(const Vec&, const Vec&);
|
||||
bool getCrossY(const cXyz&, f32*) const;
|
||||
bool getCrossYLessD(const Vec&, f32*) const;
|
||||
void Set(const cM3dGPla*);
|
||||
void GetNP();
|
||||
|
||||
virtual ~cM3dGPla() {}
|
||||
|
||||
f32 getPlaneFunc(const Vec* pPoint) const { return mD + PSVECDotProduct(&mNormal, pPoint); }
|
||||
const cXyz& GetNP() const { return mNormal; }
|
||||
void GetNP();
|
||||
f32 GetD() const { return mD; }
|
||||
void SetupFrom3Vtx(const Vec* v1, const Vec* v2, const Vec* v3) {
|
||||
cM3d_CalcPla(v1, v2, v3, &mNormal, &mD);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -29,9 +29,9 @@ public:
|
||||
void GetMinMaxCube(cXyz&, cXyz&) const;
|
||||
const cXyz& GetC(void) const { return mCenter; }
|
||||
const f32 GetR(void) const { return mRadius; }
|
||||
f32 GetCX(void) const { return mCenter.GetX(); }
|
||||
f32 GetCY(void) const { return mCenter.GetY(); }
|
||||
f32 GetCZ(void) const { return mCenter.GetZ(); }
|
||||
f32 GetCX(void) const { return mCenter.x; }
|
||||
f32 GetCY(void) const { return mCenter.y; }
|
||||
f32 GetCZ(void) const { return mCenter.z; }
|
||||
|
||||
bool Cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); }
|
||||
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsSph(*cps, *this, xyz); }
|
||||
|
||||
@@ -27,6 +27,9 @@ public:
|
||||
bool Cross(cM3dGTri const& other, cXyz* xyz) const {
|
||||
return cM3d_Cross_TriTri(*this, other, xyz);
|
||||
}
|
||||
bool cross(const cM3dGLin* lin, Vec* xyz, bool param_2, bool param_3) const {
|
||||
return cM3d_Cross_LinTri(lin, this, xyz, param_2, param_3);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,6 +18,18 @@ public:
|
||||
s16 GetX() const { return x; }
|
||||
s16 GetY() const { return y; }
|
||||
s16 GetZ() const { return z; }
|
||||
|
||||
void set(s16 oX, s16 oY, s16 oZ) {
|
||||
x = oX;
|
||||
y = oY;
|
||||
z = oZ;
|
||||
}
|
||||
|
||||
void setall(s16 val) {
|
||||
x = val;
|
||||
y = val;
|
||||
z = val;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* C_SXYZ_H */
|
||||
|
||||
@@ -41,6 +41,8 @@ struct cXyz : Vec {
|
||||
/* 80266B84 */ cXyz operator*(f32) const;
|
||||
/* 80266BD0 */ cXyz operator*(Vec const&) const;
|
||||
/* 80266C18 */ cXyz operator/(f32) const;
|
||||
/* 800977D8 */ // void operator=(cXyz const&);
|
||||
|
||||
void operator+=(f32 f) {
|
||||
x += f;
|
||||
y += f;
|
||||
@@ -72,6 +74,22 @@ struct cXyz : Vec {
|
||||
/* 80267128 */ s16 atan2sX_Z() const;
|
||||
/* 80267150 */ s16 atan2sY_XZ() const;
|
||||
|
||||
void set(f32 pX, f32 pY, f32 pZ) {
|
||||
x = pX;
|
||||
y = pY;
|
||||
z = pZ;
|
||||
}
|
||||
|
||||
void set(const Vec& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
f32 getXDiff(const Vec* other) const { return x - other->x; }
|
||||
f32 getYDiff(const Vec* other) const { return y - other->y; }
|
||||
f32 getZDiff(const Vec* other) const { return z - other->z; }
|
||||
|
||||
void setAll(f32 f) { set(f, f, f); }
|
||||
|
||||
void setMin(const cXyz& other) {
|
||||
|
||||
@@ -3,4 +3,19 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#define TRK_DISPATCH_CMD_CONNECT 1 /* Connect to the console */
|
||||
#define TRK_DISPATCH_CMD_DISCONNECT 2 /* Disconnect from the console */
|
||||
#define TRK_DISPATCH_CMD_RESET 3 /* Reset the debugger */
|
||||
#define TRK_DISPATCH_CMD_GETVERSION 4 /* Get debugger version */
|
||||
#define TRK_DISPATCH_CMD_GETSUPPORTMASK 5 /* Get Support Mask */
|
||||
#define TRK_DISPATCH_CMD_OVERRIDE 7 /* Override? */
|
||||
#define TRK_DISPATCH_CMD_READMEM 16 /* Reading from memory */
|
||||
#define TRK_DISPATCH_CMD_WRITEMEM 17 /* Writing to memory */
|
||||
#define TRK_DISPATCH_CMD_READREGS 18 /* Read a register value */
|
||||
#define TRK_DISPATCH_CMD_WRITEREGS 19 /* Set a register */
|
||||
#define TRK_DISPATCH_CMD_SETOPTION 23 /* Set an option? */
|
||||
#define TRK_DISPATCH_CMD_CONTINUE 24 /* Continue debugging */
|
||||
#define TRK_DISPATCH_CMD_STEP 25 /* Step through an instruction */
|
||||
#define TRK_DISPATCH_CMD_STOP 26 /* Stop the debugger */
|
||||
|
||||
#endif /* METROTRK_PORTABLE_DISPATCH_H */
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void TRKNubMainLoop(void);
|
||||
|
||||
#endif /* METROTRK_PORTABLE_MAINLOOP_H */
|
||||
|
||||
@@ -3,4 +3,11 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef struct _TRK_Msg {
|
||||
u8 _00[8];
|
||||
u32 m_msgLength;
|
||||
u32 _0C;
|
||||
u32 m_msg;
|
||||
} TRK_Msg;
|
||||
|
||||
#endif /* METROTRK_PORTABLE_MSG_H */
|
||||
|
||||
@@ -3,4 +3,15 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef struct TRKBuffer {
|
||||
u8 _00[4];
|
||||
u32 _04;
|
||||
s32 _08;
|
||||
u32 _0C;
|
||||
u32 _10;
|
||||
u8 m_buffer[0x87C];
|
||||
} TRKBuffer;
|
||||
|
||||
s32 TRKSetBufferPosition(TRKBuffer*, u32);
|
||||
|
||||
#endif /* METROTRK_PORTABLE_MSGBUF_H */
|
||||
|
||||
@@ -2,5 +2,23 @@
|
||||
#define METROTRK_PORTABLE_MSGHNDLR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h"
|
||||
|
||||
void SetTRKConnected(BOOL);
|
||||
BOOL GetTRKConnected(void);
|
||||
s32 TRKDoSetOption(TRKBuffer*);
|
||||
s32 TRKDoStop(TRKBuffer*);
|
||||
s32 TRKDoStep(TRKBuffer*);
|
||||
s32 TRKDoContinue(TRKBuffer*);
|
||||
s32 TRKDoWriteRegisters(TRKBuffer*);
|
||||
s32 TRKDoReadRegisters(TRKBuffer*);
|
||||
s32 TRKDoWriteMemory(TRKBuffer*);
|
||||
s32 TRKDoReadMemory(TRKBuffer*);
|
||||
s32 TRKDoSupportMask(TRKBuffer*);
|
||||
s32 TRKDoVersions(TRKBuffer*);
|
||||
s32 TRKDoOverride(TRKBuffer*);
|
||||
s32 TRKDoReset(TRKBuffer*);
|
||||
s32 TRKDoDisconnect(TRKBuffer*);
|
||||
s32 TRKDoConnect(TRKBuffer*);
|
||||
|
||||
#endif /* METROTRK_PORTABLE_MSGHNDLR_H */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user