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:
TakaRikka
2022-11-11 10:09:48 -08:00
committed by GitHub
parent f03b959831
commit 1114b13da8
665 changed files with 14863 additions and 30502 deletions
-4
View File
@@ -94,8 +94,4 @@ struct VertexNormal {
Vec data;
};
struct VertexPosition {
Vec data;
};
#endif /* J3DVERTEX_H */
+1
View File
@@ -2,6 +2,7 @@
#define J3DUCLIPPER_H
#include "dolphin/mtx/vec.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
class J3DUClipper {
+5
View File
@@ -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 */
+18 -2
View File
@@ -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 */
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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
+8 -1
View File
@@ -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 */
+1
View File
@@ -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
+11 -4
View File
@@ -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 */
+6 -6
View File
@@ -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));
+12 -4
View File
@@ -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
+3 -3
View File
@@ -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); }
+3
View File
@@ -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
+12
View File
@@ -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 */
+18
View File
@@ -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 */
@@ -3,4 +3,8 @@
#include "dolphin/types.h"
void TRKNubWelcome(void);
s32 TRKTerminateNub(void);
s32 TRKInitializeNub(void);
#endif /* METROTRK_PORTABLE_NUBINIT_H */
@@ -3,4 +3,8 @@
#include "dolphin/types.h"
void UnreserveEXI2Port();
void ReserveEXI2Port();
s32 TRKWriteUARTN(const void*, u32);
#endif /* OS_DOLPHIN_DOLPHIN_TRK_GLUE_H */
@@ -3,4 +3,7 @@
#include "dolphin/types.h"
void TRKSwapAndGo();
void TRKTargetSetStopped(s32);
#endif /* PPC_GENERIC_TARGIMPL_H */
@@ -3,4 +3,6 @@
#include "dolphin/types.h"
void MWTRACE(u8, char*, ...);
#endif /* UTILS_COMMON_MWTRACE_H */
+689 -278
View File
File diff suppressed because it is too large Load Diff
+87 -41
View File
@@ -78,6 +78,7 @@ public:
void setBufferSize(u32 size) { mBufferSize = size; }
void setBuffer(u8* buf) { mBuffer = buf; }
u8* getBuffer() { return mBuffer; }
bool checkNoSetIdx() const { return mIdx == 0xFFFF; }
private:
/* 0x00 */ u16 mIdx;
@@ -198,29 +199,38 @@ public:
public:
enum daPy_FLG0 {
FLG0_UNK_40000000 = 0x40000000,
EQUIP_HEAVY_BOOTS = 0x2000000,
PLAYER_NO_DRAW = 0x8000000,
FLG0_EQUIP_HVY_BOOTS = 0x2000000,
FLG0_PLAYER_NO_DRAW = 0x8000000,
FLG0_UNK_10000000 = 0x10000000,
FLG0_UNK_1000000 = 0x1000000,
UNDER_WATER_MOVEMENT = 0x800000,
FLG0_UNDERWATER = 0x800000,
FLG0_UNK_100000 = 0x100000,
FLG0_UNK_80000 = 0x80000,
FLG0_UNK_20000 = 0x20000,
FLG0_UNK_8000 = 0x8000,
FLG0_UNK_4000 = 0x4000,
MAGNE_BOOTS_ON = 0x1000,
FLG0_UNK_2000 = 0x2000,
FLG0_MAGNE_BOOTS_ON = 0x1000,
FLG0_UNK_100 = 0x100,
FLG0_UNK_80 = 0x80,
FLG0_UNK_40 = 0x40,
FLG0_UNK_20 = 0x20,
UNK_F_ROLL_CRASH_2 = 0x10,
UNK_F_ROLL_CRASH_1 = 0x8,
MIDNA_RIDE = 4,
FLG0_UNK_10 = 0x10,
FLG0_UNK_8 = 0x8,
FLG0_MIDNA_RIDE = 4,
FLG0_UNK_2 = 2,
HEAVY_STATE_BOOTS = FLG0_UNK_40000000 | EQUIP_HEAVY_BOOTS | FLG0_UNK_20000,
FLG0_HVY_STATE = FLG0_UNK_40000000 | FLG0_EQUIP_HVY_BOOTS | FLG0_UNK_20000,
};
enum daPy_FLG1 {
IS_WOLF = 0x2000000,
FLG1_UNK_10000000 = 0x10000000,
FLG1_IS_WOLF = 0x2000000,
FLG1_UNK_400000 = 0x400000,
FLG1_UNK_10000 = 0x10000,
THROW_DAMAGE = 0x4000,
FLG1_THROW_DAMAGE = 0x4000,
FLG1_UNK_20 = 0x20,
FLG1_UNK_10 = 0x10,
FLG1_UNK_4 = 4,
FLG1_UNK_2 = 2,
};
@@ -229,51 +239,78 @@ public:
FLG2_UNK_20000000 = 0x20000000,
FLG2_UNK_4080000 = 0x4080000,
FLG2_UNK_2080000 = 0x2080000,
BOAR_SINGLE_BATTLE = 0x1800000,
STATUS_WINDOW_DRAW = 0x400000,
FLG2_BOAR_SINGLE_BATTLE = 0x1800000,
FLG2_UNK_1000000 = 0x1000000,
FLG2_UNK_800000 = 0x800000,
FLG2_STATUS_WINDOW_DRAW = 0x400000,
FLG2_UNK_280000 = 0x280000,
UNK_ARMOR = 0x80000,
SCENE_CHANGE_START = 0x8000,
FLG2_UNK_200000 = 0x200000,
FLG2_UNK_80000 = 0x80000,
FLG2_UNK_40000 = 0x40000,
FLG2_UNK_20000 = 0x20000,
FLG2_SCN_CHG_START = 0x8000,
FLG2_UNK_4000 = 0x4000,
UNK_FLG2_2 = 2,
UNK_DAPY_FLG2_1 = 1
FLG2_UNK_80 = 0x80,
FLG2_UNK_40 = 0x40,
FLG2_UNK_10 = 0x10,
FLG2_UNK_8 = 8,
FLG2_UNK_2 = 2,
FLG2_UNK_1 = 1,
FLG2_UNK_58 = FLG2_UNK_40 | FLG2_UNK_10 | FLG2_UNK_8,
};
enum daPy_FLG3 {
FLG3_UNK_40000000 = 0x40000000,
FLG3_UNK_2000000 = 0x2000000,
FLG3_UNK_1000000 = 0x1000000,
FLG3_UNK_100000 = 0x100000,
COPY_ROD_THROW_AFTER = 0x40000
FLG3_UNK_80000 = 0x80000,
FLG3_COPY_ROD_THROW_AFTER = 0x40000,
FLG3_UNK_4000 = 0x4000,
};
enum daPy_ERFLG0 {
ERFLG0_UNK_8000000 = 0x8000000,
ERFLG0_UNK_2000000 = 0x2000000,
ERFLG0_UNK_1000000 = 0x1000000,
ERFLG0_UNK_800000 = 0x800000,
ERFLG0_UNK_400000 = 0x400000,
ERFLG0_UNK_200000 = 0x200000,
ERFLG0_UNK_100000 = 0x100000,
ERFLG0_UNK_2000 = 0x2000,
ERFLG0_UNK_400 = 0x400,
ERFLG0_UNK_100 = 0x100,
ERFLG0_UNK_4 = 4,
ERFLG0_UNK_2 = 2,
ERFLG0_UNK_1 = 1,
};
enum daPy_ERFLG1 {
GANON_FINISH = 0x80000000,
UNK_FORCE_PUT_POS = 0x2000,
ERFLG1_GANON_FINISH = 0x80000000,
ERFLG1_UNK_10000000 = 0x10000000,
ERFLG1_UNK_4000000 = 0x4000000,
ERFLG1_UNK_40000 = 0x40000,
ERFLG1_UNK_2000 = 0x2000,
ERFLG1_UNK_200 = 0x200,
ERFLG1_UNK_4 = 4,
ERFLG1_UNK_2 = 2,
ERFLG1_UNK_1 = 1,
};
enum daPy_ERFLG2 {
ERFLG2_UNK_100 = 0x100,
ERFLG2_UNK_20 = 0x20,
};
enum daPy_RFLG0 {
RFLG0_UNK_8000000 = 0x8000000,
RFLG0_UNK_4000 = 0x4000,
ENEMY_ATTENTION_LOCK = 0x1000,
RFLG0_ENEMY_ATTN_LOCK = 0x1000,
RFLG0_UNK_400 = 0x400,
RFLG0_UNK_80 = 0x80,
RFLG0_UNK_40 = 0x40,
RFLG0_UNK_10 = 0x10,
RFLG0_UNK_2 = 0x2,
};
@@ -323,7 +360,7 @@ public:
static BOOL checkTradeItem(int);
static BOOL checkDungeonWarpItem(int);
static BOOL checkMasterSwordEquip();
void checkWoodShieldEquip();
bool checkWoodShieldEquip();
f32 getAttentionOffsetY();
s16 checkNowWolfEyeUp();
static void forceRestartRoom(int, u32, int);
@@ -345,10 +382,10 @@ public:
static void setPlayerDamage(int, int);
static void setMidnaMotionNum(int);
static void setMidnaFaceNum(int);
int checkNoResetFlg0(daPy_FLG0) const;
int checkEquipHeavyBoots() const;
int checkBoarSingleBattle() const;
int checkEndResetFlg0(daPy_ERFLG0) const;
u32 checkNoResetFlg0(daPy_FLG0) const;
u32 checkEquipHeavyBoots() const;
u32 checkBoarSingleBattle() const;
u32 checkEndResetFlg0(daPy_ERFLG0) const;
void onNoResetFlg2(daPy_py_c::daPy_FLG2);
void offNoResetFlg0(daPy_py_c::daPy_FLG0);
int checkEndResetFlg2(daPy_py_c::daPy_ERFLG2) const;
@@ -356,14 +393,14 @@ public:
int checkNoResetFlg3(daPy_py_c::daPy_FLG3) const;
BOOL checkShieldGet();
void onNoResetFlg0(daPy_py_c::daPy_FLG0);
int checkEndResetFlg1(daPy_py_c::daPy_ERFLG1) const;
u32 checkEndResetFlg1(daPy_py_c::daPy_ERFLG1) const;
void offNoResetFlg1(daPy_py_c::daPy_FLG1);
void offNoResetFlg2(daPy_py_c::daPy_FLG2);
int checkWolf() const;
u32 checkWolf() const;
BOOL checkSwordGet();
int checkResetFlg0(daPy_py_c::daPy_RFLG0) const;
int checkNoResetFlg2(daPy_py_c::daPy_FLG2) const;
int checkMagneBootsOn() const;
u32 checkResetFlg0(daPy_py_c::daPy_RFLG0) const;
u32 checkNoResetFlg2(daPy_py_c::daPy_FLG2) const;
u32 checkMagneBootsOn() const;
void changeDemoPos0(cXyz const*);
void changeDemoMode(u32, int, int, s16);
void changeDemoParam2(s16);
@@ -379,6 +416,7 @@ public:
/* 80182B9C */ void getRightHandPos() const;
/* 8015DFD8 */ const cXyz getItemPos() const;
/* 8015DFF4 */ const cXyz& getLeftHandPos() const;
/* 800977B4 */ bool checkMidnaRide() const;
/* const cXyz* getItemPos() const {
return &mItemPos;
@@ -567,15 +605,15 @@ public:
bool i_getSumouMode() const { return getSumouCameraMode(); }
bool checkStatusWindowDraw() { return i_checkNoResetFlg2(STATUS_WINDOW_DRAW); }
bool checkStatusWindowDraw() { return i_checkNoResetFlg2(FLG2_STATUS_WINDOW_DRAW); }
bool checkCargoCarry() const { return mSpecialMode == SMODE_CARGO_CARRY; }
bool getHeavyStateAndBoots() { return i_checkNoResetFlg0(HEAVY_STATE_BOOTS); }
bool checkEnemyAttentionLock() const { return i_checkResetFlg0(ENEMY_ATTENTION_LOCK); }
bool getHeavyStateAndBoots() { return i_checkNoResetFlg0(FLG0_HVY_STATE); }
bool checkEnemyAttentionLock() const { return i_checkResetFlg0(RFLG0_ENEMY_ATTN_LOCK); }
bool checkCanoeSlider() const { return mSpecialMode == 0x2D; }
u8 getCutType() const { return mCutType; }
u16 getSwordAtUpTime() const { return mSwordUpTimer; }
bool checkWaterInMove() const { return i_checkNoResetFlg0(UNDER_WATER_MOVEMENT); }
bool checkSceneChangeAreaStart() const { return i_checkNoResetFlg2(SCENE_CHANGE_START); }
bool checkWaterInMove() const { return i_checkNoResetFlg0(FLG0_UNDERWATER); }
bool checkSceneChangeAreaStart() const { return i_checkNoResetFlg2(FLG2_SCN_CHG_START); }
// some functions use these function as an inline
// is there a better way to handle this?
@@ -583,28 +621,36 @@ public:
int i_checkNoResetFlg1(daPy_FLG1 pFlag) const { return mNoResetFlg1 & pFlag; }
int i_checkNoResetFlg2(daPy_FLG2 pFlag) const { return mNoResetFlg2 & pFlag; }
int i_checkNoResetFlg3(daPy_FLG3 pFlag) const { return mNoResetFlg3 & pFlag; }
void i_onNoResetFlg0(int pFlg) { mNoResetFlg0 |= pFlg; }
void i_onNoResetFlg1(int pFlg) { mNoResetFlg1 |= pFlg; }
void i_onNoResetFlg2(int pFlg) { mNoResetFlg2 |= pFlg; }
void i_onNoResetFlg3(int pFlg) { mNoResetFlg3 |= pFlg; }
void i_offNoResetFlg0(int pFlg) { mNoResetFlg0 &= ~pFlg; }
void i_offNoResetFlg2(int pFlg) { mNoResetFlg2 &= ~pFlg; }
void i_offNoResetFlg3(int pFlg) { mNoResetFlg3 &= ~pFlg; }
void i_offResetFlg0(int flag) { mResetFlg0 &= ~flag; }
void i_onResetFlg0(int flag) { mResetFlg0 |= flag; }
void i_onResetFlg1(int flag) { mResetFlg1 |= flag; }
void i_onEndResetFlg0(int flag) { mEndResetFlg0 |= flag; }
void i_onEndResetFlg2(int flag) { mEndResetFlg2 |= flag; }
int i_checkResetFlg0(daPy_py_c::daPy_RFLG0 flag) const { return mResetFlg0 & flag; }
int i_checkEndResetFlg0(daPy_py_c::daPy_ERFLG0 flag) const { return mEndResetFlg0 & flag; }
int i_checkEndResetFlg1(daPy_py_c::daPy_ERFLG1 flag) const { return mEndResetFlg1 & flag; }
void i_onEndResetFlg1(daPy_ERFLG1 pFlg) { mEndResetFlg1 |= pFlg; }
u32 i_checkWolf() const { return i_checkNoResetFlg1(IS_WOLF); }
BOOL i_checkEquipHeavyBoots() const { return i_checkNoResetFlg0(EQUIP_HEAVY_BOOTS); }
BOOL i_checkMagneBootsOn() const { return i_checkNoResetFlg0(MAGNE_BOOTS_ON); }
bool i_checkMidnaRide() const { return i_checkNoResetFlg0(MIDNA_RIDE); }
void i_onPlayerNoDraw() { i_onNoResetFlg0(PLAYER_NO_DRAW); }
void i_offPlayerNoDraw() { i_offNoResetFlg0(PLAYER_NO_DRAW); }
u32 i_checkWolf() const { return i_checkNoResetFlg1(FLG1_IS_WOLF); }
BOOL i_checkEquipHeavyBoots() const { return i_checkNoResetFlg0(FLG0_EQUIP_HVY_BOOTS); }
BOOL i_checkMagneBootsOn() const { return i_checkNoResetFlg0(FLG0_MAGNE_BOOTS_ON); }
bool i_checkMidnaRide() const { return i_checkNoResetFlg0(FLG0_MIDNA_RIDE); }
void i_onPlayerNoDraw() { i_onNoResetFlg0(FLG0_PLAYER_NO_DRAW); }
void i_offPlayerNoDraw() { i_offNoResetFlg0(FLG0_PLAYER_NO_DRAW); }
inline static u32 i_getLastSceneMode();
inline static u32 getLastSceneMode();
+47
View File
@@ -11,10 +11,57 @@ struct sBgPc {
/* 0x10 */ u32 code4;
}; // Size: 0x14
enum dBgPc_ECode {
/* 0x00004000 */ CODE_OBJ_THRU = 0x4000,
/* 0x00008000 */ CODE_CAM_THRU = 0x8000,
/* 0x00010000 */ CODE_LINK_THRU = 0x10000,
/* 0x00020000 */ CODE_ARROW_THRU = 0x20000,
/* 0x00040000 */ CODE_HS_STICK = 0x40000,
/* 0x00080000 */ CODE_BOOMERANG_THRU = 0x80000,
/* 0x00100000 */ CODE_ROPE_THRU = 0x100000,
/* 0x00200000 */ CODE_HORSE_NO_ENTRY = 0x200000,
/* 0x00400000 */ CODE_SHDW_THRU = 0x400000,
/* 0x00800000 */ CODE_BOMB_THRU = 0x800000,
/* 0x01000000 */ CODE_IRON_BALL_THRU = 0x1000000,
/* 0x02000000 */ CODE_ATTACK_THRU = 0x2000000,
/* 0x40000000 */ CODE_UNDERWATER_ROOF = 0x40000000,
};
class dBgPc {
public:
void setCode(sBgPc&);
u32 getHorseNoEntry() const { return m_code.code0 >> 0x15 & 1; }
u32 getSpl() const { return m_code.code0 >> 0x18 & 0xF; }
u32 getMagnet() const { return m_code.code0 >> 0x1C & 0x3; }
u32 getMonkeyBars() const { return m_code.code0 >> 0x1F; }
u32 getWallCode() const { return m_code.code1 >> 0x8 & 0xF; }
u32 getAtt0Code() const { return m_code.code1 >> 0xC & 0xF; }
u32 getAtt1Code() const { return m_code.code1 >> 0x10 & 0x7; }
u32 getGroundCode() const { return m_code.code1 >> 0x13 & 0x1F; }
u32 getObjThrough() const { return m_code.code0 & CODE_OBJ_THRU; }
u32 getCamThrough() const { return m_code.code0 & CODE_CAM_THRU; }
u32 getLinkThrough() const { return m_code.code0 & CODE_LINK_THRU; }
u32 getArrowThrough() const { return m_code.code0 & CODE_ARROW_THRU; }
u32 getHSStick() const { return m_code.code0 & CODE_HS_STICK; }
u32 getBoomerangThrough() const { return m_code.code0 & CODE_BOOMERANG_THRU; }
u32 getRopeThrough() const { return m_code.code0 & CODE_ROPE_THRU; }
u32 getBombThrough() const { return m_code.code0 & CODE_BOMB_THRU; }
u32 getIronBallThrough() const { return m_code.code1 & CODE_IRON_BALL_THRU; }
u32 getShdwThrough() const { return m_code.code0 & CODE_SHDW_THRU; }
u32 getUnderwaterRoof() const { return m_code.code0 & CODE_UNDERWATER_ROOF; }
u32 getAttackThrough() const { return m_code.code1 & CODE_ATTACK_THRU; }
u8 getRoom() const { return m_code.code4 >> 0x14; }
u8 getExit() const { return m_code.code0 & 0x3F; }
u8 getPolyCol() const { return m_code.code0 >> 6; }
u8 getLinkNo() const { return m_code.code1; }
u8 getCamMoveBG() const { return m_code.code2; }
u8 getRoomCam() const { return m_code.code2 >> 8; }
u8 getRoomPath() const { return m_code.code2 >> 0x10; }
u8 getRoomPathPnt() const { return m_code.code2 >> 0x18; }
u8 getRoomInf() const { return m_code.code4; }
u8 getSnd() const { return m_code.code4 >> 0xB; }
private:
/* 0x0 */ sBgPc m_code;
};
+2 -2
View File
@@ -12,7 +12,7 @@ struct PLC {
/* 0x0 */ u32 magic;
/* 0x4 */ u16 m_code_size;
/* 0x6 */ u16 m_num;
// ...
/* 0x8 */ sBgPc* field_0x8;
};
class dBgPlc {
@@ -21,7 +21,7 @@ public:
/* 80074080 */ ~dBgPlc();
/* 800740BC */ void setBase(void*);
/* 800740C4 */ void getCode(int, sBgPc**) const;
/* 800740DC */ void getGrpCode(int) const;
/* 800740DC */ u32 getGrpCode(int) const;
private:
/* 0x00 */ void* m_base;
+2 -2
View File
@@ -78,7 +78,7 @@ public:
int GetSpecialCode(cBgS_PolyInfo const&);
int GetMagnetCode(cBgS_PolyInfo const&);
int GetMonkeyBarsCode(cBgS_PolyInfo const&);
int GetUnderwaterRoofCode(cBgS_PolyInfo const&);
u32 GetUnderwaterRoofCode(cBgS_PolyInfo const&);
s32 GetWallCode(cBgS_PolyInfo const&);
int GetPolyAtt0(cBgS_PolyInfo const&);
int GetPolyAtt1(cBgS_PolyInfo const&);
@@ -87,7 +87,7 @@ public:
s32 GetRoomCamId(cBgS_PolyInfo const&);
s32 GetRoomPathId(cBgS_PolyInfo const&);
s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
s32 GetGrpSoundId(cBgS_PolyInfo const&);
u8 GetGrpSoundId(cBgS_PolyInfo const&);
u32 ChkGrpInf(cBgS_PolyInfo const&, u32);
s32 GetRoomId(cBgS_PolyInfo const&);
bool GetPolyAttackThrough(cBgS_PolyInfo const&);
+1
View File
@@ -149,6 +149,7 @@ public:
void SetGrndNone() { m_flags |= GRND_NONE; }
void ClrGrndNone() { m_flags &= ~GRND_NONE; }
bool ChkMoveBGOnly() const { return m_flags & MOVE_BG_ONLY; }
void SetWallHit() { m_flags |= WALL_HIT; }
// inline dupe
void i_ClrGroundHit() { m_flags &= ~GROUND_HIT; }
+11 -11
View File
@@ -47,17 +47,17 @@ public:
void SetUnderwaterRoof();
private:
bool mObject;
bool mCamera;
bool mLink;
bool mArrow;
bool mBomb;
bool mBoomerang;
bool mRope;
bool mUnderwaterRoof;
bool mHorse;
bool mStatue;
bool mIronBall;
/* 0x4 */ bool mObject;
/* 0x5 */ bool mCamera;
/* 0x6 */ bool mLink;
/* 0x7 */ bool mArrow;
/* 0x8 */ bool mBomb;
/* 0x9 */ bool mBoomerang;
/* 0xA */ bool mRope;
/* 0xB */ bool mUnderwaterRoof;
/* 0xC */ bool mHorse;
/* 0xD */ bool mStatue;
/* 0xE */ bool mIronBall;
};
#endif /* D_BG_D_BG_S_POLY_PASS_CHK_H */
+127 -63
View File
@@ -15,22 +15,23 @@
struct dBgS_CaptPoly {};
class cBgW_TriElm : public cM3dGPla {
class cBgW_TriElm {
public:
/* 80079754 */ cBgW_TriElm();
/* 0x00 */ cM3dGPla m_plane;
/* 80079754 */ cBgW_TriElm();
/* 800796F8 */ virtual ~cBgW_TriElm();
};
/* 0x14 vtable */
}; // Size: 0x18
class cBgW_RwgElm {
private:
/* 0x0 */ u8 field_0x0[4];
public:
/* 800791C4 */ cBgW_RwgElm();
/* 0x0 */ u16 field_0x0;
/* 800791C4 */ cBgW_RwgElm();
/* 800791D4 */ virtual ~cBgW_RwgElm();
};
}; // Size: 0x8
class cBgW_NodeTree : public cM3dGAab {
public:
@@ -39,22 +40,81 @@ public:
/* 80079238 */ virtual ~cBgW_NodeTree();
};
class cBgW_GrpElm : public cM3dGAab {
class cBgW_GrpElm {
public:
/* 8007A1E4 */ cBgW_GrpElm();
/* 8007A184 */ virtual ~cBgW_GrpElm();
/* 0x4 */ cM3dGAab m_aab;
};
struct cBgD_t {};
struct cBgW_unk_b_data {
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 field_0x2;
/* 0x4 */ u16 field_0x4;
}; // Size: 0x6
struct dzb_tri_data {
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 field_0x2;
/* 0x4 */ u16 field_0x4;
/* 0x6 */ u16 m_id;
/* 0x8 */ u16 m_grp;
}; // Size: 0xA
struct dzb_ti_data {
/* 0x0 */ u32 m_info0;
/* 0x4 */ u32 m_info1;
/* 0x8 */ u32 m_info2;
/* 0xC */ u8 field_0xc[0x10 - 0xC];
};
struct dzb_b_data {
/* 0x0 */ u16 field_0x0;
};
struct dzb_tree_data {
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 field_0x2;
/* 0x4 */ u16 m_id[1];
/* 0x6 */ u8 field_0x6[0x14 - 0x6];
}; // Size: 0x14
struct dzb_g_data {
/* 0x00 */ u8 field_0x0[0x24 - 0x0];
/* 0x24 */ u16 field_0x24;
/* 0x26 */ u8 field_0x26[0x28 - 0x26];
/* 0x28 */ u16 field_0x28;
/* 0x2A */ u16 field_0x2a;
/* 0x2C */ u8 field_0x2c[0x2E - 0x2C];
/* 0x2E */ u16 field_0x2e;
/* 0x30 */ u32 m_info;
}; // Size: 0x34
struct cBgD_t {
/* 0x00 */ int m_v_num; // vertex num
/* 0x04 */ Vec* m_v_tbl; // vertex table
/* 0x08 */ int m_t_num; // triangle num
/* 0x0C */ dzb_tri_data* m_t_tbl; // triangle table
/* 0x10 */ int m_b_num; // spatial?
/* 0x14 */ dzb_b_data* m_b_tbl;
/* 0x18 */ int m_tree_num; // face group?
/* 0x1C */ dzb_tree_data* m_tree_tbl;
/* 0x20 */ int m_g_num; // string group?
/* 0x24 */ dzb_g_data* m_g_tbl;
/* 0x28 */ int m_ti_num; // surface property?
/* 0x2C */ dzb_ti_data* m_ti_tbl;
/* 0x30 */ int field_0x30;
};
class cBgW : public dBgW_Base {
public:
/* 80079294 */ cBgW();
/* 800793A4 */ void FreeArea();
/* 800793C4 */ void GlobalVtx();
/* 80079484 */ void SetVtx();
/* 80079668 */ void SetTri();
/* 80079484 */ bool SetVtx();
/* 80079668 */ bool SetTri();
/* 80079770 */ void BlckConnect(u16*, int*, int);
/* 8007998C */ void MakeBlckTransMinMax(cXyz*, cXyz*);
/* 800799E0 */ void MakeBlckMinMax(int, cXyz*, cXyz*);
@@ -63,37 +123,37 @@ public:
/* 80079CC4 */ void MakeNodeTreeGrpRp(int);
/* 80079DF0 */ void MakeNodeTree();
/* 80079F38 */ bool Set(cBgD_t*, u32, f32 (*)[3][4]);
/* 8007A200 */ void RwgLineCheck(u16, cBgS_LinChk*);
/* 8007A3A0 */ void LineCheckRp(cBgS_LinChk*, int);
/* 8007A52C */ void LineCheckGrpRp(cBgS_LinChk*, int, int);
/* 8007A200 */ bool RwgLineCheck(u16, cBgS_LinChk*);
/* 8007A3A0 */ bool LineCheckRp(cBgS_LinChk*, int);
/* 8007A52C */ bool LineCheckGrpRp(cBgS_LinChk*, int, int);
/* 8007A680 */ void RwgGroundCheckCommon(f32, u16, cBgS_GndChk*);
/* 8007A774 */ void RwgGroundCheckGnd(u16, cBgS_GndChk*);
/* 8007A824 */ void RwgGroundCheckWall(u16, cBgS_GndChk*);
/* 8007A8F4 */ void GroundCrossRp(cBgS_GndChk*, int);
/* 8007AA50 */ void GroundCrossGrpRp(cBgS_GndChk*, int, int);
/* 8007AA50 */ bool GroundCrossGrpRp(cBgS_GndChk*, int, int);
/* 8007ABC4 */ void CopyOldMtx();
/* 8007AC10 */ void Move();
/* 8007ADF0 */ void RwgShdwDraw(int, cBgS_ShdwDraw*);
/* 8007AEA4 */ void ShdwDrawRp(cBgS_ShdwDraw*, int);
/* 8007AFC0 */ void ShdwDrawGrpRp(cBgS_ShdwDraw*, int);
/* 8007B17C */ void GetTrans(cXyz*) const;
/* 8007B2F4 */ void GetPolyInfId(int) const;
/* 8007B30C */ void GetPolyInf0(int, u32, u32) const;
/* 8007B360 */ void GetMaskPolyInf0_NoShift(int, u32) const;
/* 8007B654 */ void GetPolyInf1(int, u32, u32) const;
/* 8007B78C */ void GetMaskPolyInf1_NoShift(int, u32) const;
/* 8007B824 */ void GetPolyInf2(int, u32, u32) const;
/* 8007B930 */ void GetTriGrp(int) const;
/* 8007B2F4 */ int GetPolyInfId(int) const;
/* 8007B30C */ u32 GetPolyInf0(int, u32, u32) const;
/* 8007B360 */ u32 GetMaskPolyInf0_NoShift(int, u32) const;
/* 8007B654 */ u32 GetPolyInf1(int, u32, u32) const;
/* 8007B78C */ u32 GetMaskPolyInf1_NoShift(int, u32) const;
/* 8007B824 */ u32 GetPolyInf2(int, u32, u32) const;
/* 8007B930 */ int GetTriGrp(int) const;
/* 8007933C */ virtual ~cBgW();
/* 80079EEC */ virtual void ChkMemoryError();
/* 80079EEC */ virtual bool ChkMemoryError();
/* 8007B948 */ virtual bool ChkNotReady() const;
/* 8007B958 */ virtual bool ChkLock() const;
/* 8007B964 */ virtual bool ChkMoveBg() const;
virtual u32 ChkMoveFlag() const = 0;
/* 8007B270 */ virtual cM3dGPla GetTriPla(cBgS_PolyInfo const&) const;
/* 8007B1B4 */ virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
/* 8007B164 */ virtual void GetBnd() const;
/* 8007B164 */ virtual cM3dGAab* GetBnd() const;
/* 8007B2B0 */ virtual u32 GetGrpInf(cBgS_PolyInfo const&) const;
virtual void OffMoveFlag() = 0;
/* 8007B240 */ virtual void GetTopUnder(f32*, f32*) const;
@@ -101,7 +161,7 @@ public:
/* 8007AB9C */ virtual bool GroundCross(cBgS_GndChk*);
/* 8007B084 */ virtual void ShdwDraw(cBgS_ShdwDraw*);
virtual void CaptPoly(dBgS_CaptPoly&) = 0;
virtual void WallCorrect(dBgS_Acch*) = 0;
virtual bool WallCorrect(dBgS_Acch*) = 0;
virtual void WallCorrectSort(dBgS_Acch*) = 0;
virtual bool RoofChk(dBgS_RoofChk*) = 0;
virtual bool SplGrpChk(dBgS_SplGrpChk*) = 0;
@@ -113,40 +173,43 @@ public:
virtual int GetSpecialCode(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(int) = 0;
virtual int GetMagnetCode(cBgS_PolyInfo const&) = 0;
virtual void GetPolyObjThrough(int) = 0;
virtual void GetPolyCamThrough(int) = 0;
virtual void GetPolyLinkThrough(int) = 0;
virtual void GetPolyArrowThrough(int) = 0;
virtual u32 GetPolyObjThrough(int) = 0;
virtual u32 GetPolyCamThrough(int) = 0;
virtual u32 GetPolyLinkThrough(int) = 0;
virtual u32 GetPolyArrowThrough(int) = 0;
virtual u32 GetPolyHSStick(int) = 0;
virtual void GetPolyBoomerangThrough(int) = 0;
virtual void GetPolyRopeThrough(int) = 0;
virtual void GetPolyBombThrough(int) = 0;
virtual void GetShdwThrough(int) = 0;
virtual int GetUnderwaterRoofCode(int) = 0;
virtual u32 GetPolyBoomerangThrough(int) = 0;
virtual u32 GetPolyRopeThrough(int) = 0;
virtual u32 GetPolyBombThrough(int) = 0;
virtual bool GetShdwThrough(int) = 0;
virtual u32 GetUnderwaterRoofCode(int) = 0;
virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
virtual int GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual s32 GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt0(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt1(cBgS_PolyInfo const&) = 0;
virtual int GetGroundCode(cBgS_PolyInfo const&) = 0;
virtual void GetIronBallThrough(int) = 0;
virtual u32 GetIronBallThrough(int) = 0;
virtual u32 GetAttackThrough(int) = 0;
virtual s32 GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual void GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual s32 GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual u8 GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
/* 80079564 */ virtual void CalcPlane();
/* 800797BC */ virtual void ClassifyPlane();
/* 8007B0A8 */ virtual bool ChkPolyThrough(int, cBgS_PolyPassChk*);
/* 8007B0B0 */ virtual void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007B0B0 */ virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007B0DC */ virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
u32 GetOldInvMtx(Mtx m) { return PSMTXInverse(m_inv_mtx, m); }
MtxP GetBaseMtxP() { return pm_base; }
bool ChkNoCalcVtx() { return field_0x88 & 2; }
bool ChkFlush() { return field_0x91 & 8; }
public:
/* 0x18 */ MtxP pm_base;
@@ -161,9 +224,9 @@ public:
/* 0x92 */ u16 field_0x92;
/* 0x94 */ cBgW_TriElm* pm_tri;
/* 0x98 */ cBgW_RwgElm* pm_rwg;
/* 0x9C */ VertexPosition* pm_vtx_tbl; // type not confirmed
/* 0xA0 */ void* pm_bgd;
/* 0xA4 */ void* field_0xa4;
/* 0x9C */ Vec* pm_vtx_tbl;
/* 0xA0 */ cBgD_t* pm_bgd;
/* 0xA4 */ cBgW_unk_b_data* field_0xa4;
/* 0xA8 */ cBgW_GrpElm* pm_grp;
/* 0xAC */ cBgW_NodeTree* pm_node_tree;
};
@@ -180,28 +243,28 @@ public:
/* 8007B9EC */ void positionWallCorrect(dBgS_Acch*, f32, cM3dGPla&, cXyz* pupper_pos, f32);
/* 8007BA40 */ void RwgWallCorrect(dBgS_Acch*, u16);
/* 8007C234 */ void WallCorrectRp(dBgS_Acch*, int);
/* 8007C360 */ void WallCorrectGrpRp(dBgS_Acch*, int, int);
/* 8007C360 */ bool WallCorrectGrpRp(dBgS_Acch*, int, int);
/* 8007C4AC */ void RwgWallCorrectSort(dBgS_Acch*, u16);
/* 8007C714 */ void WallCorrectRpSort(dBgS_Acch*, int);
/* 8007C808 */ void WallCorrectGrpRpSort(dBgS_Acch*, int, int);
/* 8007D0DC */ void RwgRoofChk(u16, dBgS_RoofChk*);
/* 8007D208 */ void RoofChkRp(dBgS_RoofChk*, int);
/* 8007D330 */ void RoofChkGrpRp(dBgS_RoofChk*, int, int);
/* 8007D330 */ bool RoofChkGrpRp(dBgS_RoofChk*, int, int);
/* 8007D498 */ void RwgSplGrpChk(u16, dBgS_SplGrpChk*);
/* 8007D5C4 */ void SplGrpChkRp(dBgS_SplGrpChk*, int);
/* 8007D6F0 */ void SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
/* 8007D6F0 */ bool SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
/* 8007D858 */ void RwgCaptPoly(int, dBgS_CaptPoly&);
/* 8007D8E8 */ void CaptPolyRp(dBgS_CaptPoly&, int);
/* 8007DA04 */ void CaptPolyGrpRp(dBgS_CaptPoly&, int, int);
/* 8007DB20 */ void RwgSphChk(u16, dBgS_SphChk*, void*);
/* 8007DC70 */ void SphChkRp(dBgS_SphChk*, void*, int);
/* 8007DDE0 */ void SphChkGrpRp(dBgS_SphChk*, void*, int, int);
/* 8007DDE0 */ bool SphChkGrpRp(dBgS_SphChk*, void*, int, int);
/* 8007E548 */ virtual ~dBgW();
/* 8007E4B4 */ virtual u32 ChkMoveFlag() const;
/* 8007E4A4 */ virtual void OffMoveFlag();
/* 8007DAF8 */ virtual void CaptPoly(dBgS_CaptPoly&);
/* 8007C484 */ virtual void WallCorrect(dBgS_Acch*);
/* 8007C484 */ virtual bool WallCorrect(dBgS_Acch*);
/* 8007C910 */ virtual void WallCorrectSort(dBgS_Acch*);
/* 8007D470 */ virtual bool RoofChk(dBgS_RoofChk*);
/* 8007D830 */ virtual bool SplGrpChk(dBgS_SplGrpChk*);
@@ -212,30 +275,30 @@ public:
/* 8007B430 */ virtual int GetSpecialCode(cBgS_PolyInfo const&);
/* 8007B460 */ virtual int GetSpecialCode(int);
/* 8007B488 */ virtual int GetMagnetCode(cBgS_PolyInfo const&);
/* 8007B4E0 */ virtual void GetPolyObjThrough(int);
/* 8007B504 */ virtual void GetPolyCamThrough(int);
/* 8007B52C */ virtual void GetPolyLinkThrough(int);
/* 8007B550 */ virtual void GetPolyArrowThrough(int);
/* 8007B4E0 */ virtual u32 GetPolyObjThrough(int);
/* 8007B504 */ virtual u32 GetPolyCamThrough(int);
/* 8007B52C */ virtual u32 GetPolyLinkThrough(int);
/* 8007B550 */ virtual u32 GetPolyArrowThrough(int);
/* 8007B574 */ virtual u32 GetPolyHSStick(int);
/* 8007B598 */ virtual void GetPolyBoomerangThrough(int);
/* 8007B5BC */ virtual void GetPolyRopeThrough(int);
/* 8007B5E0 */ virtual void GetPolyBombThrough(int);
/* 8007B604 */ virtual void GetShdwThrough(int);
/* 8007B630 */ virtual int GetUnderwaterRoofCode(int);
/* 8007B598 */ virtual u32 GetPolyBoomerangThrough(int);
/* 8007B5BC */ virtual u32 GetPolyRopeThrough(int);
/* 8007B5E0 */ virtual u32 GetPolyBombThrough(int);
/* 8007B604 */ virtual bool GetShdwThrough(int);
/* 8007B630 */ virtual u32 GetUnderwaterRoofCode(int);
/* 8007B4B4 */ virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&);
/* 8007B6AC */ virtual void GetLinkNo(cBgS_PolyInfo const&);
/* 8007B6AC */ virtual int GetLinkNo(cBgS_PolyInfo const&);
/* 8007B6D8 */ virtual s32 GetWallCode(cBgS_PolyInfo const&);
/* 8007B704 */ virtual int GetPolyAtt0(cBgS_PolyInfo const&);
/* 8007B734 */ virtual int GetPolyAtt1(cBgS_PolyInfo const&);
/* 8007B760 */ virtual int GetGroundCode(cBgS_PolyInfo const&);
/* 8007B7DC */ virtual void GetIronBallThrough(int);
/* 8007B7DC */ virtual u32 GetIronBallThrough(int);
/* 8007B800 */ virtual u32 GetAttackThrough(int);
/* 8007B87C */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const&);
/* 8007B8A8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const&);
/* 8007B8D8 */ virtual s32 GetRoomPathId(cBgS_PolyInfo const&);
/* 8007B904 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 8007DF28 */ virtual void GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 8007DF58 */ virtual s32 GetGrpSoundId(cBgS_PolyInfo const&);
/* 8007DF28 */ virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 8007DF58 */ virtual u8 GetGrpSoundId(cBgS_PolyInfo const&);
/* 8007DF88 */ virtual void CrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
csXyz*);
/* 8007DFC4 */ virtual void TransPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
@@ -244,11 +307,12 @@ public:
csXyz*, csXyz*);
/* 8007E444 */ virtual void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
/* 8007E474 */ virtual void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
/* 8007E02C */ virtual void ChkPolyThrough(int, cBgS_PolyPassChk*);
/* 8007E360 */ virtual void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007E3D8 */ virtual void ChkGrpThrough(int, cBgS_GrpPassChk*, int);
/* 8007E02C */ virtual bool ChkPolyThrough(int, cBgS_PolyPassChk*);
/* 8007E360 */ virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007E3D8 */ virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
void SetCrrFunc(dBgW_CrrFunc func) { m_crr_func = func; }
void OnMoveFlag() { m_flags |= 1; }
private:
/* 0xB0 */ dBgW_CrrFunc m_crr_func;
+15 -15
View File
@@ -32,7 +32,7 @@ public:
virtual u32 ChkMoveFlag() const = 0;
virtual cM3dGPla GetTriPla(cBgS_PolyInfo const&) const = 0;
virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const = 0;
virtual void GetBnd() const = 0;
virtual cM3dGAab* GetBnd() const = 0;
virtual u32 GetGrpInf(cBgS_PolyInfo const&) const = 0;
virtual void OffMoveFlag() = 0;
virtual void GetTopUnder(f32*, f32*) const = 0;
@@ -41,7 +41,7 @@ public:
virtual bool GroundCross(cBgS_GndChk*) = 0;
virtual void ShdwDraw(cBgS_ShdwDraw*) = 0;
virtual void CaptPoly(dBgS_CaptPoly&) = 0;
virtual void WallCorrect(dBgS_Acch*) = 0;
virtual bool WallCorrect(dBgS_Acch*) = 0;
virtual void WallCorrectSort(dBgS_Acch*) = 0;
virtual bool RoofChk(dBgS_RoofChk*) = 0;
virtual bool SplGrpChk(dBgS_SplGrpChk*) = 0;
@@ -53,30 +53,30 @@ public:
virtual int GetSpecialCode(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(int) = 0;
virtual int GetMagnetCode(cBgS_PolyInfo const&) = 0;
virtual void GetPolyObjThrough(int) = 0;
virtual void GetPolyCamThrough(int) = 0;
virtual void GetPolyLinkThrough(int) = 0;
virtual void GetPolyArrowThrough(int) = 0;
virtual u32 GetPolyObjThrough(int) = 0;
virtual u32 GetPolyCamThrough(int) = 0;
virtual u32 GetPolyLinkThrough(int) = 0;
virtual u32 GetPolyArrowThrough(int) = 0;
virtual u32 GetPolyHSStick(int) = 0;
virtual void GetPolyBoomerangThrough(int) = 0;
virtual void GetPolyRopeThrough(int) = 0;
virtual void GetPolyBombThrough(int) = 0;
virtual void GetShdwThrough(int) = 0;
virtual int GetUnderwaterRoofCode(int) = 0;
virtual u32 GetPolyBoomerangThrough(int) = 0;
virtual u32 GetPolyRopeThrough(int) = 0;
virtual u32 GetPolyBombThrough(int) = 0;
virtual bool GetShdwThrough(int) = 0;
virtual u32 GetUnderwaterRoofCode(int) = 0;
virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
virtual void GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual int GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual s32 GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt0(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt1(cBgS_PolyInfo const&) = 0;
virtual int GetGroundCode(cBgS_PolyInfo const&) = 0;
virtual void GetIronBallThrough(int) = 0;
virtual u32 GetIronBallThrough(int) = 0;
virtual u32 GetAttackThrough(int) = 0;
virtual s32 GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual void GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual s32 GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual u8 GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
+57 -35
View File
@@ -7,72 +7,91 @@
struct dBgS_CaptPoly;
struct KC_PrismData {};
struct KC_PrismData {
/* 0x0 */ f32 field_0x0;
/* 0x4 */ u16 field_0x4;
/* 0x6 */ u16 field_0x6;
/* 0x8 */ u16 field_0x8;
/* 0xA */ u16 field_0xa;
/* 0xC */ u16 field_0xc;
/* 0xE */ u16 field_0xe;
}; // Size: 0x10
struct pkcdata {
/* 0x00 */ Vec* field_0x0;
/* 0x04 */ Vec* field_0x4;
/* 0x08 */ KC_PrismData* m_prism_data;
/* 0x0C */ KC_PrismData* m_block_data;
/* 0x10 */ u8 field_0x10[4];
/* 0x14 */ Vec m_area_min_pos;
/* 0x20 */ u8 field_0x20[4];
/* 0x24 */ u32 field_0x24;
};
class dBgWKCol : public dBgW_Base {
public:
/* 8007E6F4 */ dBgWKCol();
/* 8007E7D0 */ void initKCollision(void*);
/* 8007E804 */ void create(void*, void*);
/* 8007E804 */ void create(void* pprism, void* plc);
/* 8007E850 */ void getTriNrm(KC_PrismData*, Vec**) const;
/* 8007E8C0 */ void GetTriPla(int) const;
/* 8007E9A4 */ void GetTriPnt(int, Vec*, Vec*, Vec*) const;
/* 8007E9D4 */ void GetTriPnt(KC_PrismData const*, Vec*, Vec*, Vec*) const;
/* 8007E8C0 */ cM3dGPla GetTriPla(int) const;
/* 8007E9A4 */ bool GetTriPnt(int, Vec*, Vec*, Vec*) const;
/* 8007E9D4 */ bool GetTriPnt(KC_PrismData const*, Vec*, Vec*, Vec*) const;
/* 8007EB70 */ void getPolyCode(int, dBgPc*) const;
/* 8007EBC4 */ void chkPolyThrough(dBgPc*, cBgS_PolyPassChk*, cBgS_GrpPassChk*, cXyz&) const;
/* 8007FF00 */ void ChkShdwDrawThrough(dBgPc*);
/* 8007EBC4 */ bool chkPolyThrough(dBgPc*, cBgS_PolyPassChk*, cBgS_GrpPassChk*, cXyz&) const;
/* 8007FF00 */ bool ChkShdwDrawThrough(dBgPc*);
/* 8007E74C */ virtual ~dBgWKCol();
/* 8007E86C */ virtual bool ChkNotReady() const;
/* 8007E87C */ virtual bool ChkLock() const;
/* 8007E884 */ virtual bool ChkMoveBg() const;
/* 8007E88C */ virtual bool ChkMoveFlag() const;
/* 8007E88C */ virtual u32 ChkMoveFlag() const;
/* 8007E894 */ virtual cM3dGPla GetTriPla(cBgS_PolyInfo const&) const;
/* 8007E980 */ virtual void GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
/* 8007EB28 */ virtual void GetBnd() const;
/* 8007EB30 */ virtual void GetGrpInf(cBgS_PolyInfo const&) const;
/* 8007E980 */ virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
/* 8007EB28 */ virtual cM3dGAab* GetBnd() const;
/* 8007EB30 */ virtual u32 GetGrpInf(cBgS_PolyInfo const&) const;
/* 8007EB6C */ virtual void OffMoveFlag();
/* 800829AC */ virtual void GetTopUnder(f32*, f32*) const;
/* 8007EE34 */ virtual bool LineCheck(cBgS_LinChk*);
/* 8007F628 */ virtual bool GroundCross(cBgS_GndChk*);
/* 8007F9A4 */ virtual void ShdwDraw(cBgS_ShdwDraw*);
/* 8007FF1C */ virtual void CaptPoly(dBgS_CaptPoly&);
/* 800811A0 */ virtual void WallCorrect(dBgS_Acch*);
/* 800811A0 */ virtual bool WallCorrect(dBgS_Acch*);
/* 80080330 */ virtual void WallCorrectSort(dBgS_Acch*);
/* 80081E18 */ virtual bool RoofChk(dBgS_RoofChk*);
/* 80082184 */ virtual bool SplGrpChk(dBgS_SplGrpChk*);
/* 800824EC */ virtual bool SphChk(dBgS_SphChk*, virtual void*);
/* 800829F0 */ virtual void GetGrpRoomIndex(cBgS_PolyInfo const&) const;
/* 80082A20 */ virtual void GetExitId(cBgS_PolyInfo const&);
/* 80082A50 */ virtual void GetPolyColor(cBgS_PolyInfo const&);
/* 80082A80 */ virtual void GetHorseNoEntry(cBgS_PolyInfo const&);
/* 800829F0 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const;
/* 80082A20 */ virtual s32 GetExitId(cBgS_PolyInfo const&);
/* 80082A50 */ virtual s32 GetPolyColor(cBgS_PolyInfo const&);
/* 80082A80 */ virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&);
/* 80082AB0 */ virtual int GetSpecialCode(cBgS_PolyInfo const&);
/* 80082AE0 */ virtual int GetSpecialCode(int);
/* 80082B0C */ virtual int GetMagnetCode(cBgS_PolyInfo const&);
/* 80082B6C */ virtual void GetPolyObjThrough(int);
/* 80082B98 */ virtual void GetPolyCamThrough(int);
/* 80082BC4 */ virtual void GetPolyLinkThrough(int);
/* 80082BF0 */ virtual void GetPolyArrowThrough(int);
/* 80082B6C */ virtual u32 GetPolyObjThrough(int);
/* 80082B98 */ virtual u32 GetPolyCamThrough(int);
/* 80082BC4 */ virtual u32 GetPolyLinkThrough(int);
/* 80082BF0 */ virtual u32 GetPolyArrowThrough(int);
/* 80082C1C */ virtual u32 GetPolyHSStick(int);
/* 80082C48 */ virtual void GetPolyBoomerangThrough(int);
/* 80082C74 */ virtual void GetPolyRopeThrough(int);
/* 80082CA0 */ virtual void GetPolyBombThrough(int);
/* 80082CF8 */ virtual void GetShdwThrough(int);
/* 80082CCC */ virtual int GetUnderwaterRoofCode(int);
/* 80082C48 */ virtual u32 GetPolyBoomerangThrough(int);
/* 80082C74 */ virtual u32 GetPolyRopeThrough(int);
/* 80082CA0 */ virtual u32 GetPolyBombThrough(int);
/* 80082CF8 */ virtual bool GetShdwThrough(int);
/* 80082CCC */ virtual u32 GetUnderwaterRoofCode(int);
/* 80082B3C */ virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&);
/* 80082D24 */ virtual void GetLinkNo(cBgS_PolyInfo const&);
/* 80082D24 */ virtual int GetLinkNo(cBgS_PolyInfo const&);
/* 80082D54 */ virtual s32 GetWallCode(cBgS_PolyInfo const&);
/* 80082D84 */ virtual int GetPolyAtt0(cBgS_PolyInfo const&);
/* 80082DB4 */ virtual int GetPolyAtt1(cBgS_PolyInfo const&);
/* 80082DE4 */ virtual int GetGroundCode(cBgS_PolyInfo const&);
/* 80082E14 */ virtual void GetIronBallThrough(int);
/* 80082E40 */ virtual void GetAttackThrough(int);
/* 80082E6C */ virtual void GetCamMoveBG(cBgS_PolyInfo const&);
/* 80082E9C */ virtual void GetRoomCamId(cBgS_PolyInfo const&);
/* 80082ECC */ virtual void GetRoomPathId(cBgS_PolyInfo const&);
/* 80082EFC */ virtual void GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 80082F2C */ virtual void GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 80082F5C */ virtual void GetGrpSoundId(cBgS_PolyInfo const&);
/* 80082E14 */ virtual u32 GetIronBallThrough(int);
/* 80082E40 */ virtual u32 GetAttackThrough(int);
/* 80082E6C */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const&);
/* 80082E9C */ virtual s32 GetRoomCamId(cBgS_PolyInfo const&);
/* 80082ECC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const&);
/* 80082EFC */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 80082F2C */ virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 80082F5C */ virtual u8 GetGrpSoundId(cBgS_PolyInfo const&);
/* 80082F8C */ virtual void CrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
csXyz*);
/* 80082F90 */ virtual void TransPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
@@ -80,8 +99,11 @@ public:
/* 80082F94 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*,
csXyz*, csXyz*);
KC_PrismData* getPrismData(int poly_index) const { return &m_pkc_head->m_prism_data[poly_index]; }
void getTri1Pos(KC_PrismData* pd, Vec** nrm) const { *nrm = &m_pkc_head->field_0x0[pd->field_0x4]; }
private:
/* 0x18 */ void* m_pkc_head;
/* 0x18 */ pkcdata* m_pkc_head;
/* 0x1C */ dBgPlc m_code;
/* 0x20 */ cM3dGAab m_bnd;
};
+17 -1
View File
@@ -1,6 +1,22 @@
#ifndef D_BG_D_BG_W_SV_H
#define D_BG_D_BG_W_SV_H
#include "dolphin/types.h"
#include "d/bg/d_bg_w.h"
class dBgWSv : public dBgW {
public:
/* 80082F98 */ u8 Set(cBgD_t*, u32);
/* 80083020 */ void CopyBackVtx();
/* 8008308C */ void CrrPosWork(cXyz*, int, int, int);
/* 80083300 */ void TransPosWork(cXyz*, int, int, int);
/* 800835DC */ virtual ~dBgWSv();
/* 80083244 */ virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
/* 8008351C */ virtual void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
/* 800835D8 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
/* 0xC0 */ Vec* field_0xc0;
/* 0xC4 */ u8 field_0xc4;
};
#endif /* D_BG_D_BG_W_SV_H */
+41
View File
@@ -276,12 +276,14 @@ public:
int getOxygen() { return mOxygen; }
void setMaxOxygen(int max) { mMaxOxygen = max; }
int getMaxOxygen() { return mMaxOxygen; }
int getNowOxygen() { return mNowOxygen; }
void setItemNowLife(u16 life) { mItemNowLife = life; }
void setItemNowMagic(s16 magic) { mItemNowMagicCount = magic; }
void setItemNowOil(s32 oil) { mItemNowOil = oil; }
void setItemOilCount(s32 oil) { mItemOilCount += oil; }
s16 getItemMaxLifeCount() { return mItemMaxLifeCount; }
f32 getItemLifeCount() { return mItemLifeCount; }
s16 getItemMaxArrowNumCount() { return mItemMaxArrowNumCount; }
void clearItemMaxLifeCount() { mItemMaxLifeCount = 0; }
void clearItemLifeCount() {
mItemLifeCount = 0.0f;
@@ -396,9 +398,11 @@ public:
bool& isPauseFlag() { return mPauseFlag; }
void offPauseFlag() { mPauseFlag = false; }
void onPauseFlag() { mPauseFlag = true; }
u8 getOxygenShowFlag() { return mOxygenShowFlag; }
void show2dOn() { mShow2D = 1; }
s8 getLayerOld() { return mLayerOld; }
void setMesgCancelButton(u8 button) { mMesgCancelButton = button; }
void setMesgBgm(u8 param_0) { mMesgBgm = param_0; }
int getMessageCountNumber() { return mMessageCountNum; }
void setWindowNum(u8 num) { mWindowNum = num; }
@@ -803,6 +807,10 @@ void dComIfGs_onStageSwitch(int i_stageNo, int i_no);
void dComIfGs_offStageSwitch(int i_stageNo, int i_no);
void dComIfGs_PolyDamageOff_Set(s8 param_0);
u8 dComIfGs_staffroll_next_go_check();
BOOL dComIfGs_isEventBit(u16 id);
int dComIfGs_isItemFirstBit(u8 i_no);
u16 dComIfGs_getRupee();
static u16 dComIfGs_getLife();
inline void dComIfGs_init() {
g_dComIfG_gameInfo.info.init();
@@ -1513,6 +1521,23 @@ JKRExpHeap* dComIfGp_getSubHeap2D(int flag);
void dComIfGp_world_dark_set(u8);
u8 dComIfGp_getNowLevel();
void dComIfGp_calcNowRegion();
daHorse_c* dComIfGp_getHorseActor();
static BOOL dComIfGp_event_runCheck();
static s32 dComIfGp_evmng_getMyStaffId(const char* pName, fopAc_ac_c* pActor, int param_2);
static u16 dComIfGp_event_chkEventFlag(u16 flag);
static s8 dComIfGp_getPlayerCameraID(int idx);
static dEvent_manager_c& dComIfGp_getEventManager();
static u32 dComIfGp_checkPlayerStatus0(int param_0, u32 param_1);
static u32 dComIfGp_checkPlayerStatus1(int param_0, u32 param_1);
static dEvt_control_c& dComIfGp_getEvent();
static bool dComIfGp_evmng_startCheck(char const* param_0);
static dStage_stageDt_c* dComIfGp_getStage();
void dComIfGp_setItemLifeCount(f32 amount, u8 type);
void dComIfGp_setItemRupeeCount(s32 param_0);
static u8 dComIfGp_getDoStatus();
static u8 dComIfGp_getRStatus();
static dAttCatch_c* dComIfGp_att_getCatghTarget();
static void dComIfGp_setBottleStatus(u8 param_0, u8 param_1);
inline void i_dComIfGp_setItemLifeCount(float amount, u8 type) {
g_dComIfG_gameInfo.play.setItemLifeCount(amount, type);
@@ -2082,6 +2107,14 @@ inline int dComIfGp_getOxygen() {
return g_dComIfG_gameInfo.play.getOxygen();
}
inline int dComIfGp_getNowOxygen() {
return g_dComIfG_gameInfo.play.getNowOxygen();
}
inline u8 dComIfGp_getOxygenShowFlag() {
return g_dComIfG_gameInfo.play.getOxygenShowFlag();
}
inline u8 dComIfGp_getNeedLightDropNum() {
return g_dComIfG_gameInfo.play.getNeedLightDropNum();
}
@@ -2130,6 +2163,10 @@ inline void dComIfGp_setMesgCancelButton(u8 button) {
g_dComIfG_gameInfo.play.setMesgCancelButton(button);
}
inline void dComIfGp_setMesgBgmOn() {
g_dComIfG_gameInfo.play.setMesgBgm(1);
}
inline s32 dComIfGp_checkStatus(u16 flags) {
return g_dComIfG_gameInfo.play.checkStatus(flags);
}
@@ -2154,6 +2191,10 @@ inline f32 dComIfGp_getItemLifeCount() {
return g_dComIfG_gameInfo.play.getItemLifeCount();
}
inline s16 dComIfGp_getItemMaxArrowNumCount() {
return g_dComIfG_gameInfo.play.getItemMaxArrowNumCount();
}
inline void dComIfGp_clearItemMaxLifeCount() {
g_dComIfG_gameInfo.play.clearItemMaxLifeCount();
}
+1 -1
View File
@@ -45,7 +45,7 @@ public:
/* 80031248 */ void newData(s8, cXyz const&, cXyz const&, u8, u8, u8);
/* 800313BC */ void reset();
/* 800314D4 */ static void check(fopAc_ac_c*);
/* 80031434 */ static bool check(s8, cXyz const&);
/* 80031434 */ static bool check(s8 i_roomNo, cXyz const& i_pos);
/* 800315A4 */ static void execute();
static u8 mData[1152];
+3 -2
View File
@@ -900,13 +900,14 @@ static int dStage_fieldMapFiliInfo2Init(dStage_dt_c*, void*, int, void*);
static int dStage_fieldMapMapPathInit(dStage_dt_c*, void*, int, void*);
s8 dStage_roomRead_dt_c_GetReverbStage(roomRead_class&, int);
int dStage_changeScene(int, f32, u32, s8, s16, int);
int dStage_changeScene(int i_exitId, f32 i_speed, u32 i_mode, s8 i_roomNo, s16 i_angle, int i_layerOverride);
void dStage_infoCreate();
u8 dStage_stagInfo_GetParticleNo(stage_stag_info_class* p_info, int layer);
int dStage_changeSceneExitId(cBgS_PolyInfo& param_0, f32 speed, u32 mode, s8 roomNo, s16 angle);
int dStage_changeScene4Event(int i_exitId, s8 room_no, int i_wipe, bool param_3, f32 speed,
u32 mode, s16 angle, int param_7);
u32 mode, s16 angle, int param_7);
void dStage_Create();
static s32 dStage_stagInfo_GetSaveTbl(stage_stag_info_class* param_0);
inline s32 dStage_roomRead_dt_c_GetVrboxswitch(roomRead_data_class& data) {
return data.field_0x2 & 8;
+1 -1
View File
@@ -103,7 +103,7 @@ public:
void setPtI_Id(unsigned int id);
void setPtD(void* ptr);
void setGtItm(u8 itemNo);
void isOrderOK();
BOOL isOrderOK();
/* 807DFAD8 */ void checkSkipEdge();
/* 807E2908 */ void startCheckSkipEdge(void*);
+10
View File
@@ -49,6 +49,10 @@ class dMeter2_c;
class J2DPicture;
class dMeterMap_c;
enum dMeter2Info_warpStatus {
/* 0x3 */ WARP_DECIDED = 3,
};
class dMeter2Info_c {
public:
class WarpInfo_c {
@@ -246,6 +250,8 @@ void dMeter2Info_setCloth(u8 i_clothId, bool param_1);
void dMeter2Info_setShield(u8 i_itemId, bool param_1);
void dMeter2Info_set2DVibration();
void dMeter2Info_set2DVibrationM();
static void dMeter2Info_setFloatingMessage(u16 pMessageID, s16 pMessageTimer, bool pWakuVisible);
static void dMeter2Info_offUseButton(int pButton);
inline void dMeter2Info_Initialize() {
g_meter2_info.init();
@@ -495,6 +501,10 @@ inline void dMeter2Info_onDirectUseItem(int param_0) {
g_meter2_info.onDirectUseItem(param_0);
}
inline void dMeter2Info_setFloatingFlow(u16 param_0, s16 param_1, bool param_2) {
g_meter2_info.setFloatingFlow(param_0, param_1, param_2);
}
char* dMeter2Info_getNumberTextureName(int pIndex);
void dMeter2Info_recieveLetter();
u8 dMeter2Info_getNewLetterNum();
+7 -1
View File
@@ -3,10 +3,16 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
u32 ARInit(u32*, u32);
u32 ARAlloc(u32);
u32 ARGetSize(void);
}
#ifdef __cplusplus
};
#endif
#endif /* AR_H */
+11 -5
View File
@@ -3,10 +3,14 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*ARQCallback)(u32 request_address);
struct ARQRequest {
ARQRequest* next;
typedef struct ARQRequest {
struct ARQRequest* next;
u32 owner;
u32 type;
u32 priority;
@@ -14,12 +18,14 @@ struct ARQRequest {
u32 destination;
u32 length;
ARQCallback callback;
};
} ARQRequest;
extern "C" {
void ARQInit(void);
void ARQPostRequest(ARQRequest* task, u32 owner, u32 type, u32 priority, u32 source,
u32 destination, u32 length, ARQCallback callback);
}
#ifdef __cplusplus
};
#endif
#endif /* ARQ_H */
+52 -36
View File
@@ -3,7 +3,9 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum DVDState {
DVD_STATE_END = 0x0,
@@ -19,38 +21,37 @@ typedef enum DVDState {
DVD_STATE_RETRY = 0xb,
DVD_STATE_FATAL_ERROR = -1,
} DVDState;
}
struct DVDDirectory {
typedef struct DVDDirectory {
u32 entry_number;
u32 location;
u32 next;
};
} DVDDirectory;
struct DVDDirectoryEntry {
typedef struct DVDDirectoryEntry {
u32 entry_number;
BOOL is_directory;
char* name;
};
} DVDDirectoryEntry;
struct DVDDiskID {
char game_name[4];
char company[2];
u8 disk_number;
u8 game_version;
u8 is_streaming;
u8 streaming_buffer_size;
u8 padding[22];
};
typedef struct DVDDiskID {
/* 0x00 */ char game_name[4];
/* 0x04 */ char company[2];
/* 0x06 */ u8 disk_number;
/* 0x07 */ u8 game_version;
/* 0x08 */ u8 is_streaming;
/* 0x09 */ u8 streaming_buffer_size;
/* 0x0A */ u8 padding[22];
} DVDDiskID;
struct DVDFileInfo;
struct DVDCommandBlock;
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);
typedef void (*DVDCallback)(s32 result, DVDFileInfo* info);
typedef void (*DVDCBCallback)(s32 result, struct DVDCommandBlock* block);
typedef void (*DVDCallback)(s32 result, struct DVDFileInfo* info);
struct DVDCommandBlock {
DVDCommandBlock* next;
DVDCommandBlock* prev;
typedef struct DVDCommandBlock {
struct DVDCommandBlock* next;
struct DVDCommandBlock* prev;
u32 command;
s32 state;
u32 offset;
@@ -61,31 +62,46 @@ struct DVDCommandBlock {
DVDDiskID* disk_id;
DVDCBCallback callback;
void* user_data;
};
} DVDCommandBlock;
struct DVDFileInfo {
typedef struct DVDFileInfo {
DVDCommandBlock block;
u32 start_address;
u32 length;
DVDCallback callback;
};
} DVDFileInfo;
extern "C" {
s32 DVDOpen(const char*, DVDFileInfo*);
s32 DVDClose(DVDFileInfo*);
s32 DVDReadPrio(DVDFileInfo*, void*, s32, s32, s32);
typedef struct DVDDriveInfo {
/* 0x00 */ u16 field_0x0;
/* 0x02 */ u16 device_code;
/* 0x04 */ u32 field_0x4;
/* 0x08 */ u32 field_0x8;
/* 0x0C */ u32 field_0xc;
/* 0x10 */ u32 field_0x10;
/* 0x14 */ u32 field_0x14;
/* 0x18 */ u32 field_0x18;
/* 0x1C */ u32 field_0x1c;
} DVDDriveInfo;
void DVDInit(void);
BOOL DVDOpen(const char* filename, DVDFileInfo* fileinfo);
BOOL DVDClose(DVDFileInfo* fileinfo);
BOOL DVDReadPrio(DVDFileInfo* fileinfo, void*, s32, s32, s32);
DVDDiskID* DVDGetCurrentDiskID(void);
s32 DVDFastOpen(long, DVDFileInfo*);
int DVDGetCommandBlockStatus(DVDCommandBlock*);
s32 DVDReadAsyncPrio(DVDFileInfo*, void*, long, long, DVDCallback, long);
s32 DVDConvertPathToEntrynum(const char*);
BOOL DVDFastOpen(long, DVDFileInfo* fileinfo);
BOOL DVDGetCommandBlockStatus(DVDCommandBlock*);
BOOL DVDReadAsyncPrio(DVDFileInfo* fileinfo, void*, long, long, DVDCallback, long);
BOOL DVDConvertPathToEntrynum(const char*);
DVDState DVDGetDriveStatus(void);
s32 DVDCheckDisk(void);
BOOL DVDCheckDisk(void);
BOOL DVDChangeDir(const char*);
BOOL DVDCloseDir(DVDDirectory*);
BOOL DVDOpenDir(const char*, DVDDirectory*);
BOOL DVDReadDir(DVDDirectory*, DVDDirectoryEntry*);
}
BOOL DVDChangeDir(const char* dirname);
BOOL DVDCloseDir(DVDDirectory* dir);
BOOL DVDOpenDir(const char*, DVDDirectory* dir);
BOOL DVDReadDir(DVDDirectory* dir, DVDDirectoryEntry* entry);
#ifdef __cplusplus
};
#endif
#endif /* DVD_H */
+12 -5
View File
@@ -3,12 +3,16 @@
#include "dolphin/types.h"
struct GDLObj {
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GDLObj {
/* 0x0 */ u8* start;
/* 0x4 */ u32 length;
/* 0x8 */ u8* ptr;
/* 0xC */ u8* end;
}; // Size: 0x10
} GDLObj; // Size: 0x10
extern GDLObj* __GDCurrentDL;
@@ -20,11 +24,14 @@ inline u32 GDGetGDLObjOffset(GDLObj* obj) {
return (u32)(obj->ptr - obj->start);
}
extern "C" {
void GDInitGDLObj(GDLObj*, u8*, u32);
void GDFlushCurrToMem();
void GDPadCurr32();
}
typedef void (*GDOverflowCallback)(void);
#ifdef __cplusplus
};
#endif
#endif /* GDBASE_H */
+6 -1
View File
@@ -4,11 +4,16 @@
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void GDSetVtxDescv(GXVtxDescList*);
void GDSetArray(GXAttr attr, const void* data, u8 stride);
void GDSetArrayRaw(GXAttr attr, u32 data, u8 stride);
}
#ifdef __cplusplus
};
#endif
#endif /* GDGEOMETRY_H */
+29 -218
View File
@@ -1,235 +1,46 @@
#ifndef GX_H_
#define GX_H_
#include "dolphin/gx/GXInit.h"
#include "dolphin/gx/GXAttr.h"
#include "dolphin/gx/GXBump.h"
#include "dolphin/gx/GXDisplayList.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/mtx/mtx44.h"
#include "dolphin/types.h"
#include "global.h"
#include "dolphin/gx/GXFifo.h"
#include "dolphin/gx/GXFrameBuf.h"
#include "dolphin/gx/GXGeometry.h"
#include "dolphin/gx/GXLight.h"
#include "dolphin/gx/GXMisc.h"
#include "dolphin/gx/GXPerf.h"
#include "dolphin/gx/GXPixel.h"
#include "dolphin/gx/GXTev.h"
#include "dolphin/gx/GXTexture.h"
#include "dolphin/gx/GXTransform.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _GXVtxDescList {
/* 0x0 */ GXAttr attr;
/* 0x4 */ GXAttrType type;
} GXVtxDescList; // Size: 0x08
typedef struct _GXVtxAttrFmtList {
/* 0x00 */ GXAttr mAttrib;
/* 0x04 */ GXCompCnt mCompCnt;
/* 0x08 */ GXCompType mCompType;
/* 0x0C */ u8 mCompShift;
} GXVtxAttrFmtList; // Size: 0x10
typedef GXTexRegion (*GXTexRegionCallback)(void);
typedef u32 (*GXTlutRegionCallback)(u32);
typedef struct _GXData {
/* 0x000 */ u16 field_0x0;
/* 0x002 */ u16 field_0x2;
/* 0x004 */ u16 field_0x4;
/* 0x006 */ u16 field_0x6;
/* 0x008 */ u32 field_0x8;
/* 0x00C */ u32 field_0xc;
/* 0x010 */ u32 field_0x10;
/* 0x014 */ GXAttrType field_0x14;
/* 0x018 */ GXAttrType field_0x18;
/* 0x01C */ GXCompCnt field_0x1c[8];
/* 0x03C */ GXCompCnt field_0x3c[8];
/* 0x05C */ u32 field_0x5c[8];
/* 0x07C */ u32 field_0x7c;
/* 0x080 */ u32 field_0x80;
/* 0x084 */ u32 field_0x84;
/* 0x088 */ u8 field_0x88[0xA8 - 0x88];
/* 0x0A8 */ u32 field_0xa8[2];
/* 0x0B0 */ u32 field_0xb0[2];
/* 0x0B8 */ u32 field_0xb8[8]; // GX_MAX_TEXCOORD
/* 0x0D8 */ u32 field_0xd8[8]; // GX_MAX_TEXCOORD
/* 0x0F8 */ u32 field_0xf8;
/* 0x0FC */ u32 field_0xfc;
/* 0x100 */ u32 field_0x100[GX_MAX_TEVSTAGE / 2];
/* 0x120 */ u32 field_0x120;
/* 0x124 */ u32 field_0x124;
/* 0x128 */ u8 field_0x128[0x130 - 0x128];
/* 0x130 */ u32 field_0x130[GX_MAX_TEVSTAGE];
/* 0x170 */ u32 field_0x170[GX_MAX_TEVSTAGE];
/* 0x1B0 */ u32 field_0x1b0[GX_MAX_TEVSTAGE / 2];
/* 0x1D0 */ u32 field_0x1d0;
/* 0x1D4 */ u32 field_0x1d4;
/* 0x1D8 */ u32 field_0x1d8;
/* 0x1DC */ u32 field_0x1dc;
/* 0x1E0 */ u32 field_0x1e0;
/* 0x1E4 */ u32 field_0x1e4;
/* 0x1E8 */ u32 field_0x1e8;
/* 0x1EC */ u32 field_0x1ec;
/* 0x1F0 */ u32 field_0x1f0;
/* 0x1F4 */ u32 field_0x1f4;
/* 0x1F8 */ u32 field_0x1f8;
/* 0x1FC */ u32 field_0x1fc;
/* 0x200 */ u8 field_0x200;
/* 0x204 */ u32 field_0x204;
/* 0x208 */ GXTexRegion field_0x208[8];
/* 0x288 */ GXTexRegion field_0x288[8];
/* 0x308 */ GXTexRegion field_0x308[8];
/* 0x388 */ GXTlutRegion field_0x388[16];
/* 0x488 */ GXTlutRegion field_0x488[4];
/* 0x4C8 */ GXTexRegionCallback field_0x4c8;
/* 0x4CC */ GXTlutRegionCallback field_0x4cc;
/* 0x4D0 */ GXAttrType field_0x4d0;
/* 0x4D4 */ u8 field_0x4d4;
/* 0x4D5 */ u8 field_0x4d5;
/* 0x4D8 */ GXProjectionType field_0x4d8;
/* 0x4DC */ Mtx field_0x4dc;
/* 0x50C */ f32 field_0x50c;
/* 0x510 */ f32 field_0x510;
/* 0x514 */ u32 field_0x514[8];
/* 0x534 */ u32 field_0x534[8];
/* 0x554 */ u32 field_0x554;
/* 0x558 */ u32 field_0x558[8];
/* 0x578 */ u8 field_0x578[0x594 - 0x578];
/* 0x594 */ u32 field_0x594;
/* 0x598 */ u32 field_0x598;
/* 0x59C */ u32 field_0x59c;
/* 0x5A0 */ u8 field_0x5a0[4];
/* 0x5A4 */ u32 field_0x5a4;
/* 0x5A8 */ u8 field_0x5a8;
/* 0x5A9 */ u8 field_0x5a9;
/* 0x5AA */ u8 field_0x5aa;
/* 0x5AB */ u8 field_0x5ab;
/* 0x5AC */ u32 field_0x5ac;
} GXData; // Size: 0x5B0
STATIC_ASSERT(sizeof(GXData) == 0x5B0);
extern GXData* __GXData;
extern u32* __piReg;
extern u16* __cpReg;
// Pack value into bitfield
// Pack value into bitfield
#define GX_BITFIELD_SET(field, pos, size, value) (field) = __rlwimi((field), (value), 31 - (pos) - (size) + 1, (pos), (pos) + (size)-1)
#define GX_LOAD_BP_REG 0x61
#define GX_NOP 0
f32 GXGetYScaleFactor(u16 efb_height, u16 xfb_height);
u16 GXGetNumXfbLines(u32 efb_height, f32 y_scale);
typedef union {
u8 u8;
u16 u16;
u32 u32;
u64 u64;
s8 s8;
s16 s16;
s32 s32;
s64 s64;
f32 f32;
f64 f64;
} PPCWGPipe;
void GXBegin(GXPrimitive, GXVtxFmt, u16);
void GXLoadTexObj(GXTexObj*, GXTexMapID);
void GXInitTexObjLOD(GXTexObj*, GXTexFilter, GXTexFilter, f32, f32, f32, GXBool, GXBool,
GXAnisotropy);
void GXInitTexObj(GXTexObj*, void*, u16, u16, GXTexFmt, GXTexWrapMode, GXTexWrapMode, GXBool);
void GXInitTlutObj(GXTlutObj*, void*, GXTlutFmt, u16);
void GXLoadTlut(GXTlutObj*, u32);
void GXInitTexObjCI(GXTexObj*, void*, u16, u16, GXCITexFmt, GXTexWrapMode, GXTexWrapMode, GXBool,
u32);
void GXSetNumChans(u8);
void GXSetNumTevStages(u8);
void GXSetNumTexGens(u8);
void GXSetTevOrder(GXTevStageID, GXTexCoordID, GXTexMapID, GXChannelID);
void GXSetChanCtrl(GXChannelID, GXBool, GXColorSrc, GXColorSrc, u32, GXDiffuseFn, GXAttnFn);
void GXSetTevOp(GXTevStageID, GXTevMode);
void GXSetTevColor(GXTevRegID, GXColor);
void GXSetTevColorIn(GXTevStageID, GXTevColorArg, GXTevColorArg, GXTevColorArg, GXTevColorArg);
void GXSetTevAlphaIn(GXTevStageID, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg);
void GXSetTevColorOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, GXBool, GXTevRegID);
void GXSetTevAlphaOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, GXBool, GXTevRegID);
void GXSetTevIndirect(GXTevStageID, _GXIndTexStageID, GXIndTexFormat, GXIndTexBiasSel,
GXIndTexMtxID, GXIndTexWrap, GXIndTexWrap, GXBool, GXBool, GXIndTexAlphaSel);
void GXSetBlendMode(GXBlendMode, GXBlendFactor, GXBlendFactor, GXLogicOp);
void GXSetVtxAttrFmt(GXVtxFmt, GXAttr, GXCompCnt, GXCompType, u32);
void GXClearVtxDesc(void);
void GXSetVtxDesc(GXAttr, GXAttrType);
void GXSetArray(GXAttr, void*, u8);
typedef void (*GXDrawDoneCallback)(void);
void GXSetDrawDoneCallback(GXDrawDoneCallback);
void GXDrawDone(void);
void GXAbortFrame(void);
void GXFlush(void);
void GXSetCopyClear(GXColor, u32);
void GXSetDispCopySrc(u16, u16, u16, u16);
void GXSetDispCopyDst(u16, u16);
u32 GXSetDispCopyYScale(f32);
void GXSetCopyClamp(GXFBClamp);
void GXSetDispCopyGamma(GXGamma);
void GXCopyDisp(void*, GXBool);
void GXSetPixelFmt(GXPixelFmt, GXZFmt16);
struct OSThread;
OSThread* GXSetCurrentGXThread(void);
OSThread* GXGetCurrentGXThread(void);
void GXCopyTex(void*, GXBool);
void GXGetProjectionv(f32*);
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool is_mip_map, u8 max_lod);
void GXGetViewportv(f32*);
void GXInitLightColor(GXLightObj*, GXColor);
void GXInitLightDir(GXLightObj*, f32, f32, f32);
void GXInitLightDistAttn(GXLightObj*, f32, f32, GXDistAttnFn);
void GXInitLightPos(GXLightObj*, f32, f32, f32);
void GXInitLightSpot(GXLightObj*, f32, GXSpotFn);
void GXInvalidateTexAll(void);
void GXInitLightAttn(GXLightObj*, f32, f32, f32, f32, f32, f32);
void GXLoadLightObjImm(GXLightObj*, GXLightID);
void GXLoadPosMtxImm(Mtx, u32);
void GXLoadNrmMtxImm(Mtx, u32);
void GXLoadTexMtxImm(Mtx, u32, GXTexMtxType);
void GXPixModeSync(void);
void GXProject(f32, f32, f32, Mtx, f32*, f32*, f32*, f32*, f32*);
void GXSetAlphaCompare(GXCompare, u8, GXAlphaOp, GXCompare, u8);
void GXSetAlphaUpdate(GXBool);
void GXSetChanAmbColor(GXChannelID, GXColor);
void GXSetChanMatColor(GXChannelID, GXColor);
void GXSetClipMode(GXClipMode);
void GXSetCoPlanar(GXBool);
void GXSetColorUpdate(GXBool);
void GXSetCopyFilter(GXBool, u8[12][2], GXBool, u8[7]);
void GXSetCullMode(GXCullMode);
void GXSetCurrentMtx(u32);
void GXSetDither(GXBool);
void GXSetFog(GXFogType, f32, f32, f32, f32, GXColor);
void GXSetFogRangeAdj(GXBool, u16, GXFogAdjTable*);
void GXSetNumIndStages(u8);
void GXSetProjection(Mtx44, GXProjectionType);
void GXSetScissor(u32, u32, u32, u32);
void GXSetTevColorS10(GXTevRegID, GXColorS10);
void GXSetTevKAlphaSel(GXTevStageID, GXTevKAlphaSel);
void GXSetTevSwapMode(GXTevStageID, GXTevSwapSel, GXTevSwapSel);
void GXSetTevSwapModeTable(GXTevSwapSel, GXTevColor, GXTevColor, GXTevColor, GXTevColor);
void GXSetTexCoordGen2(GXTexCoordID, GXTexGenType, GXTexGenSrc, u32, GXBool, u32);
void GXSetTexCopyDst(u16, u16, GXTexFmt, GXBool);
void GXSetTexCopySrc(u16, u16, u16, u16);
void GXSetViewport(f32, f32, f32, f32, f32, f32);
void GXSetZCompLoc(GXBool);
void GXSetZMode(GXBool, GXCompare, GXBool);
void GXSetZTexture(GXZTexOp, GXTexFmt, u32);
void GXSetPointSize(u8, GXTexOffset);
void GXSetLineWidth(u8, GXTexOffset);
void GXSetTevDirect(GXTevStageID);
void GXSetTevKColor(GXTevKColorID, GXColor);
void GXSetTevKColorSel(GXTevStageID, GXTevKColorSel);
void GXGetScissor(u32*, u32*, u32*, u32*);
void GXSetIndTexMtx(GXIndTexMtxID, Mtx23, s8);
void GXSetIndTexCoordScale(GXIndTexStageID, GXIndTexScale, GXIndTexScale);
void GXSetIndTexOrder(GXIndTexStageID, GXTexCoordID, GXTexMapID);
void GXEnableTexOffsets(GXTexCoordID, GXBool, GXBool);
void GXSetDstAlpha(GXBool, u8);
u32 GXGetFifoSize(GXFifoObj*);
void* GXGetFifoBase(GXFifoObj*);
GXFifoObj* GXInit(void*, u32);
GXFifoObj* GXGetCPUFifo(void);
void GXGetGPStatus(GXBool*, GXBool*, GXBool*, GXBool*, GXBool*);
void GXReadXfRasMetric(u32*, u32*, u32*, u32*);
void GXInitFifoBase(GXFifoObj*, void*, u32);
void GXInitFifoPtrs(GXFifoObj*, void*, void*);
void GXSaveCPUFifo(GXFifoObj*);
void GXSetMisc(u32 opt, u32 val);
void GXInitTexCacheRegion(GXTexRegion* region, GXBool, u32, GXTexCacheSize, u32, GXTexCacheSize);
void GXPeekZ(u16 x, u16 y, u32* dst);
void __GXSetDirtyState(void);
void __GXSendFlushPrim(void);
volatile PPCWGPipe GXFIFO : 0xCC008000;
#define GFX_FIFO(T) (*(volatile T*)0xCC008000)
+34 -1
View File
@@ -1,6 +1,39 @@
#ifndef GXATTR_H
#define GXATTR_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _GXVtxDescList {
/* 0x0 */ GXAttr attr;
/* 0x4 */ GXAttrType type;
} GXVtxDescList; // Size: 0x08
typedef struct _GXVtxAttrFmtList {
/* 0x00 */ GXAttr mAttrib;
/* 0x04 */ GXCompCnt mCompCnt;
/* 0x08 */ GXCompType mCompType;
/* 0x0C */ u8 mCompShift;
} GXVtxAttrFmtList; // Size: 0x10
void GXSetVtxDesc(GXAttr attr, GXAttrType type);
void GXSetVtxDescv(GXVtxDescList* list);
void __GXSetVCD(void);
void __GXCalculateVLim(void);
void GXClearVtxDesc(void);
void GXSetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt cnt, GXCompType type, u32);
void GXSetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList* list);
void __GXSetVAT(void);
void GXSetArray(GXAttr attr, void* base, u8);
void GXInvalidateVtxCache(void);
void GXSetTexCoordGen2(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx, GXBool renormalize, u32 pt_mtx);
void GXSetNumTexGens(u8 numTexGens);
#ifdef __cplusplus
};
#endif
#endif /* GXATTR_H */
+19 -1
View File
@@ -1,6 +1,24 @@
#ifndef GXBUMP_H
#define GXBUMP_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/mtx/mtx.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetTevIndirect(GXTevStageID tevStage, GXIndTexStageID texStage, GXIndTexFormat texFmt,
GXIndTexBiasSel biasSel, GXIndTexMtxID mtxID, GXIndTexWrap wrapS,
GXIndTexWrap wrapT, u8 addPrev, u8 utcLod, GXIndTexAlphaSel alphaSel);
void GXSetIndTexMtx(GXIndTexMtxID mtxID, f32 offset[6], s8 scale_exp);
void GXSetIndTexCoordScale(GXIndTexStageID texStage, GXIndTexScale scaleS, GXIndTexScale scaleT);
void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord, GXTexMapID map);
void GXSetNumIndStages(u8 num);
void GXSetTevDirect(GXTevStageID stage);
#ifdef __cplusplus
};
#endif
#endif /* GXBUMP_H */
+6
View File
@@ -3,10 +3,16 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXBeginDisplayList(void* list, u32 capacity);
void GXEndDisplayList(void);
void GXCallDisplayList(void* list, u32 nbytes);
#ifdef __cplusplus
};
#endif
#endif /* GXDISPLAYLIST_H */
+36 -6
View File
@@ -20,12 +20,14 @@ typedef enum _GXCullMode {
/* 0x3 */ GX_CULL_ALL
} GXCullMode;
typedef enum _GXBool {
typedef enum _GXBoolVal {
/* 0x0 */ GX_FALSE,
/* 0x1 */ GX_TRUE,
/* 0x0 */ GX_DISABLE = 0,
/* 0x1 */ GX_ENABLE
} GXBool;
} GXBoolVal;
typedef u8 GXBool;
typedef enum _GXTexMapID {
/* 0x000 */ GX_TEXMAP0,
@@ -429,11 +431,11 @@ typedef enum _GXAnisotropy {
/* 0x3 */ GX_MAX_ANISOTROPY,
} GXAnisotropy;
enum GXCITexFmt {
typedef enum _GXCITexFmt {
/* 0x8 */ GX_TF_C4 = 8,
/* 0x8 */ GX_TF_C8,
/* 0xA */ GX_TF_C14X2
};
} GXCITexFmt;
typedef enum _GXTexMtxType {
/* 0x0 */ GX_MTX3x4,
@@ -619,9 +621,11 @@ typedef enum _GXIndTexMtxID {
/* 0x1 */ GX_ITM_0,
/* 0x2 */ GX_ITM_1,
/* 0x3 */ GX_ITM_2,
/* 0x4 */ GX_ITM_3,
/* 0x5 */ GX_ITM_S0 = 5,
/* 0x6 */ GX_ITM_S1,
/* 0x7 */ GX_ITM_S2,
/* 0x8 */ GX_ITM_S3,
/* 0x9 */ GX_ITM_T0 = 9,
/* 0xA */ GX_ITM_T1,
/* 0xB */ GX_ITM_T2,
@@ -711,7 +715,7 @@ typedef enum _GXTexMtx {
GX_TEXMTX8 = 30 + 8 * 3,
GX_TEXMTX9 = 30 + 9 * 3,
GX_IDENTITY = 60,
};
} GXTexMtx;
typedef enum _GXPTTexMtx {
GX_PTTEXMTX0 = 64 + 0 * 3,
@@ -735,7 +739,7 @@ typedef enum _GXPTTexMtx {
GX_PTTEXMTX18 = 64 + 18 * 3,
GX_PTTEXMTX19 = 64 + 19 * 3,
GX_PTIDENTITY = 125,
};
} GXPTTexMtx;
typedef enum _GXFBClamp {
/* 0x0 */ GX_CLAMP_NONE,
@@ -776,4 +780,30 @@ typedef enum _GXClipMode {
/* 0x1 */ GX_CLIP_DISABLE,
} GXClipMode;
typedef enum _GXCopyMode {
/* 0x0 */ GX_COPY_PROGRESSIVE,
/* 0x1 */ GX_COPY_INTLC_EVEN,
/* 0x2 */ GX_COPY_INTLC_ODD,
} GXCopyMode;
typedef enum _GXAlphaReadMode {
/* 0x0 */ GX_READ_00,
/* 0x1 */ GX_READ_FF,
/* 0x2 */ GX_READ_NONE,
} GXAlphaReadMode;
typedef enum _GXTlutSize {
/* 0x001 */ GX_TLUT_16 = 1,
/* 0x002 */ GX_TLUT_32 = 2,
/* 0x004 */ GX_TLUT_64 = 4,
/* 0x008 */ GX_TLUT_128 = 8,
/* 0x010 */ GX_TLUT_256 = 16,
/* 0x020 */ GX_TLUT_512 = 32,
/* 0x040 */ GX_TLUT_1K = 64,
/* 0x080 */ GX_TLUT_2K = 128,
/* 0x100 */ GX_TLUT_4K = 256,
/* 0x200 */ GX_TLUT_8K = 512,
/* 0x400 */ GX_TLUT_16K = 1024,
} GXTlutSize;
#endif /* GXENUM_H */
+33 -1
View File
@@ -1,6 +1,38 @@
#ifndef GXFIFO_H
#define GXFIFO_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/os/OS.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXInitFifoBase(GXFifoObj* fifo, void* base, u32 size);
void GXInitFifoPtrs(GXFifoObj* fifo, void* read_ptr, void* write_ptr);
void GXSetCPUFifo(void);
void GXSetGPFifo(void);
void GXSaveCPUFifo(GXFifoObj* fifo);
void __GXSaveCPUFifoAux(GXFifoObj* fifo);
void GXGetGPStatus(GXBool* overhi, GXBool* underlo, GXBool* read_idle, GXBool* cmd_idle, GXBool* breakpoint);
void* GXGetFifoBase(GXFifoObj* fifo);
u32 GXGetFifoSize(GXFifoObj* fifo);
void GXSetBreakPtCallback(void);
void __GXFifoInit(void);
void __GXFifoReadEnable(void);
void __GXFifoReadDisable(void);
void __GXFifoLink(u8);
void __GXWriteFifoIntEnable(u8, u8);
void __GXWriteFifoIntReset(u8, u8);
void __GXCleanGPFifo(void);
OSThread* GXSetCurrentGXThread(void);
OSThread* GXGetCurrentGXThread(void);
GXFifoObj* GXGetCPUFifo(void);
u32 GXGetGPFifo(void);
#ifdef __cplusplus
};
#endif
#endif /* GXFIFO_H */
+26 -1
View File
@@ -1,6 +1,31 @@
#ifndef GXFRAMEBUF_H
#define GXFRAMEBUF_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetDispCopySrc(u16 left, u16 top, u16 width, u16 height);
void GXSetTexCopySrc(u16 left, u16 top, u16 width, u16 height);
void GXSetDispCopyDst(u16 width, u16 height);
void GXSetTexCopyDst(u16 width, u16 height, GXTexFmt fmt, GXBool mipmap);
void GXSetDispCopyFrame2Field(GXCopyMode mode);
void GXSetCopyClamp(GXFBClamp clamp);
u16 GXGetNumXfbLines(u32 efb_height, f32 y_scale);
f32 GXGetYScaleFactor(u16 efb_height, u16 xfb_height);
u32 GXSetDispCopyYScale(f32 y_scale);
void GXSetCopyClear(GXColor color, u32 clear_z);
void GXSetCopyFilter(GXBool antialias, u8 pattern[12][2], GXBool vf, u8 vfilter[7]);
void GXSetDispCopyGamma(GXGamma gamma);
void GXCopyDisp(void* dst, GXBool clear);
void GXCopyTex(void* dst, GXBool clear);
void GXClearBoundingBox(void);
#ifdef __cplusplus
};
#endif
#endif /* GXFRAMEBUF_H */
+20 -1
View File
@@ -1,6 +1,25 @@
#ifndef GXGEOMETRY_H
#define GXGEOMETRY_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
void __GXSetDirtyState(void);
void GXBegin(GXPrimitive type, GXVtxFmt fmt, u16 vert_num);
void __GXSendFlushPrim(void);
void GXSetLineWidth(u8 width, GXTexOffset offsets);
void GXSetPointSize(u8 size, GXTexOffset offsets);
void GXEnableTexOffsets(GXTexCoordID coord, GXBool line, GXBool point);
void GXSetCullMode(GXCullMode mode);
void GXSetCoPlanar(GXBool enable);
void __GXSetGenMode(void);
#ifdef __cplusplus
};
#endif
#endif /* GXGEOMETRY_H */
+113 -1
View File
@@ -1,6 +1,118 @@
#ifndef GXINIT_H
#define GXINIT_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/mtx/mtx.h"
#include "global.h"
typedef GXTexRegion (*GXTexRegionCallback)(GXTexObj* obj);
typedef GXTlutRegion* (*GXTlutRegionCallback)(u32 name);
typedef struct _GXData {
/* 0x000 */ u16 field_0x0;
/* 0x002 */ u16 field_0x2;
/* 0x004 */ u16 field_0x4;
/* 0x006 */ u16 field_0x6;
/* 0x008 */ u32 field_0x8;
/* 0x00C */ u32 field_0xc;
/* 0x010 */ u32 field_0x10;
/* 0x014 */ u32 field_0x14;
/* 0x018 */ GXAttrType field_0x18;
/* 0x01C */ GXCompCnt field_0x1c[8];
/* 0x03C */ GXCompCnt field_0x3c[8];
/* 0x05C */ u32 field_0x5c[8];
/* 0x07C */ u32 field_0x7c;
/* 0x080 */ u32 field_0x80;
/* 0x084 */ u32 field_0x84;
/* 0x088 */ u8 field_0x88[0xA8 - 0x88];
/* 0x0A8 */ GXColor ambColors[2];
/* 0x0B0 */ GXColor matColors[2];
/* 0x0B8 */ u32 field_0xb8[8]; // GX_MAX_TEXCOORD
/* 0x0D8 */ u32 field_0xd8[8]; // GX_MAX_TEXCOORD
/* 0x0F8 */ u32 field_0xf8;
/* 0x0FC */ u32 field_0xfc;
/* 0x100 */ u32 field_0x100[GX_MAX_TEVSTAGE / 2];
/* 0x120 */ u32 field_0x120;
/* 0x124 */ u32 field_0x124;
/* 0x128 */ u32 field_0x128;
/* 0x12C */ u32 field_0x12c;
/* 0x130 */ u32 field_0x130[GX_MAX_TEVSTAGE];
/* 0x170 */ u32 field_0x170[GX_MAX_TEVSTAGE];
/* 0x1B0 */ u32 field_0x1b0[GX_MAX_TEVSTAGE / 2];
/* 0x1D0 */ u32 field_0x1d0;
/* 0x1D4 */ u32 field_0x1d4;
/* 0x1D8 */ u32 field_0x1d8;
/* 0x1DC */ u32 field_0x1dc;
/* 0x1E0 */ u32 field_0x1e0;
/* 0x1E4 */ u32 field_0x1e4;
/* 0x1E8 */ u32 field_0x1e8;
/* 0x1EC */ u32 field_0x1ec;
/* 0x1F0 */ u32 field_0x1f0;
/* 0x1F4 */ u32 field_0x1f4;
/* 0x1F8 */ u32 field_0x1f8;
/* 0x1FC */ u32 field_0x1fc;
/* 0x200 */ u8 field_0x200;
/* 0x204 */ u32 field_0x204;
/* 0x208 */ GXTexRegion field_0x208[8];
/* 0x288 */ GXTexRegion field_0x288[8];
/* 0x308 */ GXTexRegion field_0x308[8];
/* 0x388 */ GXTlutRegion field_0x388[16];
/* 0x488 */ GXTlutRegion field_0x488[4];
/* 0x4C8 */ GXTexRegionCallback field_0x4c8;
/* 0x4CC */ GXTlutRegionCallback field_0x4cc;
/* 0x4D0 */ GXAttrType field_0x4d0;
/* 0x4D4 */ u8 field_0x4d4;
/* 0x4D5 */ u8 field_0x4d5;
/* 0x4D8 */ GXProjectionType field_0x4d8;
/* 0x4DC */ Mtx field_0x4dc;
/* 0x50C */ f32 field_0x50c;
/* 0x510 */ f32 field_0x510;
/* 0x514 */ u32 field_0x514[8];
/* 0x534 */ u32 field_0x534[8];
/* 0x554 */ u32 field_0x554;
/* 0x558 */ u32 field_0x558[8];
/* 0x578 */ u8 field_0x578[0x594 - 0x578];
/* 0x594 */ u32 field_0x594;
/* 0x598 */ u32 field_0x598;
/* 0x59C */ u32 field_0x59c;
/* 0x5A0 */ u8 field_0x5a0[4];
/* 0x5A4 */ u32 field_0x5a4;
/* 0x5A8 */ u8 field_0x5a8;
/* 0x5A9 */ u8 field_0x5a9;
/* 0x5AA */ u8 field_0x5aa;
/* 0x5AB */ u8 field_0x5ab;
/* 0x5AC */ u32 field_0x5ac;
} GXData; // Size: 0x5B0
STATIC_ASSERT(sizeof(GXData) == 0x5B0);
extern GXData* __GXData;
extern u32* __piReg;
extern u16* __cpReg;
extern u8 __peReg[4];
extern u8 __memReg[4];
inline void GXSetWasteFlags() {
GXData* data = __GXData;
data->field_0x5ac |= 0x3;
data->field_0x2 = 0;
}
#ifdef __cplusplus
extern "C" {
#endif
GXTexRegion* __GXDefaultTexRegionCallback(GXTexObj* obj, GXTexMapID mapID);
GXTlutRegion* __GXDefaultTlutRegionCallback(u32 tlut);
void __GXShutdown(s32);
void __GXInitRevisionBits(void);
GXFifoObj* GXInit(void* base, u32 size);
void __GXInitGX(void);
#ifdef __cplusplus
};
#endif
#endif /* GXINIT_H */
+22 -1
View File
@@ -1,6 +1,27 @@
#ifndef GXLIGHT_H
#define GXLIGHT_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXInitLightAttn(GXLightObj* obj, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2);
void GXInitLightSpot(GXLightObj* obj, f32 cutoff, GXSpotFn spot_fn);
void GXInitLightDistAttn(GXLightObj* obj, f32 dist, f32 brightness, GXDistAttnFn dist_fn);
void GXInitLightPos(GXLightObj* obj, f32 x, f32 y, f32 z);
void GXInitLightDir(GXLightObj* obj, f32 x, f32 y, f32 z);
void GXInitLightColor(GXLightObj* obj, GXColor color);
void GXLoadLightObjImm(GXLightObj* obj, GXLightID light);
void GXSetChanAmbColor(GXChannelID channel, GXColor color);
void GXSetChanMatColor(GXChannelID channel, GXColor color);
void GXSetNumChans(u8 chan_num);
void GXSetChanCtrl(GXChannelID channel, GXBool enable, GXColorSrc amb_src, GXColorSrc mat_src, u32 light_mask, GXDiffuseFn diff_fn, GXAttnFn attn_fn);
#ifdef __cplusplus
};
#endif
#endif /* GXLIGHT_H */
+33 -1
View File
@@ -1,6 +1,38 @@
#ifndef GXMISC_H
#define GXMISC_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetMisc(u32 id, u32 value);
void GXFlush(void);
void __GXAbort(void);
void GXAbortFrame(void);
void GXSetDrawDone(void);
void GXDrawDone(void);
void GXPixModeSync(void);
void GXPokeAlphaMode(GXCompare comp, u8 threshold);
void GXPokeAlphaRead(GXAlphaReadMode mode);
void GXPokeAlphaUpdate(GXBool enable_update);
void GXPokeBlendMode(GXBlendMode mode, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op);
void GXPokeColorUpdate(GXBool enable_update);
void GXPokeDstAlpha(GXBool enable, u8 alpha);
void GXPokeDither(GXBool enable);
void GXPokeZMode(GXBool enable_compare, GXCompare comp);
void GXPeekZ(u16 x, u16 y, u32* z);
typedef void (*GXDrawSyncCallback)(u16 token);
void GXSetDrawSyncCallback(GXDrawSyncCallback callback);
typedef void (*GXDrawDoneCallback)(void);
void GXSetDrawDoneCallback(GXDrawDoneCallback callback);
void __GXPEInit(void);
#ifdef __cplusplus
};
#endif
#endif /* GXMISC_H */
+12
View File
@@ -3,4 +3,16 @@
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetGPMetric(u32 perf0, u32 perf1);
void GXClearGPMetric(void);
void GXReadXfRasMetric(u32*, u32*, u32*, u32*);
#ifdef __cplusplus
};
#endif
#endif /* GXPERF_H */
+23 -1
View File
@@ -1,6 +1,28 @@
#ifndef GXPIXEL_H
#define GXPIXEL_H
#include "dolphin/types.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXEnum.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, GXColor color);
void GXSetFogRangeAdj(GXBool enable, u16 center, GXFogAdjTable* table);
void GXSetBlendMode(GXBlendMode mode, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op);
void GXSetColorUpdate(GXBool enable_update);
void GXSetAlphaUpdate(GXBool enable_update);
void GXSetZMode(GXBool enable_compare, GXCompare comp, GXBool enable_update);
void GXSetZCompLoc(GXBool z_buf_before_tex);
void GXSetPixelFmt(GXPixelFmt pixel_fmt, GXZFmt16 z_fmt);
void GXSetDither(GXBool enable_dither);
void GXSetDstAlpha(GXBool enable, u8 alpha);
void GXSetFieldMask(GXBool odd_mask, GXBool even_mask);
void GXSetFieldMode(GXBool field_mode, GXBool half_aspect_ratio);
#ifdef __cplusplus
};
#endif
#endif /* GXPIXEL_H */
+15 -2
View File
@@ -34,7 +34,7 @@ typedef struct _GXRenderModeObj {
/* 0x32 */ u8 vfilter[7];
} GXRenderModeObj;
STATIC_ASSERT(sizeof(_GXRenderModeObj) == 60);
STATIC_ASSERT(sizeof(GXRenderModeObj) == 60);
typedef struct _GXTexObj {
/* 0x00 */ u32 texture_filter;
@@ -56,7 +56,20 @@ typedef struct _GXTlutObj {
} GXTlutObj;
typedef struct _GXLightObj {
/* 0x0 */ u32 data[16];
/* 0x00 */ u8 field_0x0[0xc];
/* 0x0C */ GXColor color;
/* 0x10 */ f32 a0;
/* 0x14 */ f32 a1;
/* 0x18 */ f32 a2;
/* 0x1C */ f32 k0;
/* 0x20 */ f32 k1;
/* 0x24 */ f32 k2;
/* 0x28 */ f32 posX;
/* 0x2C */ f32 posY;
/* 0x30 */ f32 posZ;
/* 0x34 */ f32 dirX;
/* 0x38 */ f32 dirY;
/* 0x3C */ f32 dirZ;
} GXLightObj;
typedef struct _GXFogAdjTable {
+32 -1
View File
@@ -1,6 +1,37 @@
#ifndef GXTEV_H
#define GXTEV_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXSetTevOp(GXTevStageID id, GXTevMode mode);
void GXSetTevColorIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c,
GXTevColorArg d);
void GXSetTevAlphaIn(GXTevStageID stage, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c,
GXTevAlphaArg d);
void GXSetTevColorOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
GXTevRegID out_reg);
void GXSetTevAlphaOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
GXTevRegID out_reg);
void GXSetTevColor(GXTevRegID id, GXColor color);
void GXSetTevColorS10(GXTevRegID id, GXColorS10 color);
void GXSetTevKColor(GXTevKColorID id, GXColor color);
void GXSetTevKColorSel(GXTevStageID stage, GXTevKColorSel color_sel);
void GXSetTevKAlphaSel(GXTevStageID stage, GXTevKAlphaSel alpha_sel);
void GXSetTevSwapMode(GXTevStageID stage, GXTevSwapSel ras_sel, GXTevSwapSel tex_sel);
void GXSetTevSwapModeTable(GXTevSwapSel select, GXTevColor r, GXTevColor g, GXTevColor b,
GXTevColor a);
void GXSetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1);
void GXSetZTexture(GXZTexOp op, GXTexFmt fmt, u32 bias);
void GXSetTevOrder(GXTevStageID stage, GXTexCoordID coord, GXTexMapID map, GXChannelID color);
void GXSetNumTevStages(u8 num_stages);
#ifdef __cplusplus
};
#endif
#endif /* GXTEV_H */
+44 -1
View File
@@ -1,6 +1,49 @@
#ifndef GXTEXTURE_H
#define GXTEXTURE_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/gx/GXInit.h"
#ifdef __cplusplus
extern "C" {
#endif
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool mipmap, u8 max_lod);
void __GetImageTileCount();
void GXInitTexObj(GXTexObj* obj, void* image, u16 width, u16 height, GXTexFmt fmt,
GXTexWrapMode wrapS, GXTexWrapMode wrapT, GXBool mipmap);
void GXInitTexObjCI(GXTexObj* obj, void* image, u16 width, u16 height, GXCITexFmt format,
GXTexWrapMode wrapS, GXTexWrapMode wrapT, GXBool mipmap, u32 tlut_name);
void GXInitTexObjLOD(GXTexObj* obj, GXTexFilter min_filter, GXTexFilter max_filter, f32 min_lod,
f32 max_lod, f32 lod_bias, GXBool bias_clamp, GXBool edge_lod,
GXAnisotropy aniso);
u16 GXGetTexObjWidth(GXTexObj* obj);
u16 GXGetTexObjHeight(GXTexObj* obj);
GXTexFmt GXGetTexObjFmt(GXTexObj* obj);
GXTexWrapMode GXGetTexObjWrapS(GXTexObj* obj);
GXTexWrapMode GXGetTexObjWrapT(GXTexObj* obj);
GXBool GXGetTexObjMipMap(GXTexObj* obj);
u32 GXGetTexObjTlut(GXTexObj* obj);
void GXLoadTexObj(GXTexObj* obj, GXTexMapID id);
void GXInitTlutObj(GXTlutObj* obj, void* lut, GXTlutFmt fmt, u16 entry_num);
void GXLoadTlut(GXTlutObj* obj, u32 tlut_name);
void GXInitTexCacheRegion(GXTexRegion* region, GXBool is_32b_mipmap, u32 tmem_even,
GXTexCacheSize size_even, u32 tmem_odd, GXTexCacheSize size_odd);
void GXInitTlutRegion(GXTlutRegion* region, u32 tmem_addr, GXTlutSize tlut_size);
void GXInvalidateTexAll(void);
GXTexRegionCallback GXSetTexRegionCallback(GXTexRegionCallback callback);
GXTlutRegionCallback GXSetTlutRegionCallback(GXTlutRegionCallback callback);
void GXSetTexCoordScaleManually(GXTexCoordID coord, GXBool enable, u16 s_scale, u16 t_scale);
void __SetSURegs();
void __GXSetSUTexRegs();
void __GXSetTmemConfig();
#ifdef __cplusplus
};
#endif
#endif /* GXTEXTURE_H */
+27 -1
View File
@@ -1,6 +1,32 @@
#ifndef GXTRANSFORM_H
#define GXTRANSFORM_H
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/mtx/mtx.h"
#ifdef __cplusplus
extern "C" {
#endif
void GXProject(f32 model_x, f32 model_y, f32 model_z, Mtx model_mtx, f32* proj_mtx, f32* viewpoint,
f32* screen_x, f32* screen_y, f32* screen_z);
void GXSetProjection(Mtx44 mtx, GXProjectionType type);
void GXSetProjectionv(f32* p);
void GXGetProjectionv(f32* p);
void GXLoadPosMtxImm(Mtx mtx, u32 id);
void GXLoadNrmMtxImm(Mtx mtx, u32 id);
void GXSetCurrentMtx(u32 id);
void GXLoadTexMtxImm(Mtx mtx, u32 id, GXTexMtxType type);
void GXSetViewport(f32 x_orig, f32 y_orig, f32 width, f32 height, f32 near_z, f32 far_z);
void GXGetViewportv(f32* p);
void GXSetScissor(u32 left, u32 top, u32 width, u32 height);
void GXGetScissor(u32* left, u32* top, u32* width, u32* height);
void GXSetScissorBoxOffset(u32 x_offset, u32 y_offset);
void GXSetClipMode(GXClipMode mode);
#ifdef __cplusplus
};
#endif
#endif /* GXTRANSFORM_H */
+11 -11
View File
@@ -6,13 +6,16 @@
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef f32 Mtx[3][4];
typedef f32 Mtx33[3][3];
typedef f32 Mtx23[2][3];
typedef f32 (*MtxP)[4];
typedef const f32 (*CMtxP)[4]; // Change name later?
extern "C" {
void PSMTXIdentity(Mtx m);
void PSMTXCopy(const Mtx src, Mtx dst);
void PSMTXConcat(const Mtx a, const Mtx b, Mtx ab);
@@ -21,23 +24,20 @@ void PSMTXRotRad(Mtx m, u8 axis, f32 rad);
void PSMTXRotTrig(Mtx m, u8 axis, f32 sin, f32 cos);
f64 __PSMTXRotAxisRadInternal(f64 param_1, f64 param_2, int param_3, int param_4);
void PSMTXRotAxisRad(Mtx m, const Vec* axis, f32 rad);
void PSMTXTrans(Mtx m, f32 x_trans, f32 y_trans, f32 z_trans);
void PSMTXTrans(Mtx m, f32 x, f32 y, f32 z);
void PSMTXTransApply(const Mtx src, Mtx dst, f32 x, f32 y, f32 z);
void PSMTXScale(Mtx m, f32 x_scale, f32 y_scale, f32 z_scale);
void PSMTXScaleApply(const Mtx src, Mtx dst, f32 x_scale, f32 y_scale, f32 z_scale);
void PSMTXScale(Mtx m, f32 x, f32 y, f32 z);
void PSMTXScaleApply(const Mtx src, Mtx dst, f32 x, f32 y, f32 z);
void PSMTXQuat(Mtx m, const Quaternion* q);
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
void C_MTXLookAt(Mtx m, const Vec* camPos, const Vec* camUp, const Vec* target);
void C_MTXLightPerspective(Mtx m, f32 fovY, f32 aspect, f32 scale_s, f32 scale_t, f32 trans_s,
f32 trans_t);
void C_MTXLightOrtho(Mtx m, f32 top, f32 bottom, f32 left, f32 right, f32 scale_s, f32 scale_t,
f32 trans_s, f32 trans_t);
}
#ifdef __cplusplus
};
#endif
#endif /* MTX_H */
+8 -2
View File
@@ -3,11 +3,17 @@
#include "dolphin/types.h"
typedef float Mtx44[4][4];
typedef f32 Mtx44[4][4];
#ifdef __cplusplus
extern "C" {
#endif
void C_MTXPerspective(Mtx44 m, f32 fovy, f32 aspect, f32 near, f32 far);
void C_MTXOrtho(Mtx44 m, f32 top, f32 bottom, f32 left, f32 right, f32 near, f32 far);
}
#ifdef __cplusplus
};
#endif
#endif /* MTX44_H */
+11 -7
View File
@@ -2,14 +2,18 @@
#define MTXVEC_H
#include "dolphin/mtx/mtx.h"
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
void PSMTXMultVec(const Mtx matrix, const Vec* src, Vec* dst);
void PSMTXMultVecArray(const Mtx matrix, const Vec* src, Vec* dst, u32 count);
void PSMTXMultVecSR(const Mtx matrix, const Vec* src, Vec* dst);
void PSMTXMultVecArraySR(const Mtx matrix, const Vec* src, Vec* dst, u32 count);
}
#endif
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
#ifdef __cplusplus
};
#endif
#endif /* MTXVEC_H */
+12 -7
View File
@@ -2,16 +2,21 @@
#define QUAT_H
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
struct Quaternion {
f32 x, y, z, w;
};
#ifdef __cplusplus
extern "C" {
void PSQUATMultiply(const Quaternion* src_a, const Quaternion* src_b, Quaternion* dst);
#endif
typedef struct Quaternion {
f32 x, y, z, w;
} Quaternion;
void PSQUATMultiply(const Quaternion* a, const Quaternion* b, Quaternion* ab);
void C_QUATRotAxisRad(Quaternion* q, const Vec* axis, f32 rad);
void C_QUATSlerp(const Quaternion* p, const Quaternion* q, Quaternion* r, f32 t);
}
#ifdef __cplusplus
};
#endif
#endif /* QUAT_H */
+12 -34
View File
@@ -3,47 +3,22 @@
#include "dolphin/types.h"
struct Vec {
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Vec {
f32 x, y, z;
f32 GetX() const { return x; }
f32 GetY() const { return y; }
f32 GetZ() const { return 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 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;
}
};
} Vec;
typedef Vec* VecPtr;
typedef Vec Point3d;
typedef Vec* Point3dPtr;
struct SVec {
typedef struct SVec {
s16 x, y, z;
} SVec;
void set(s16 oX, s16 oY, s16 oZ) {
x = oX;
y = oY;
z = oZ;
}
void setall(s16 val) {
x = val;
y = val;
z = val;
}
};
extern "C" {
void PSVECAdd(const Vec* a, const Vec* b, Vec* ab);
void PSVECSubtract(const Vec* a, const Vec* b, Vec* a_b);
void PSVECScale(const Vec* src, Vec* dst, f32 scale);
@@ -57,6 +32,9 @@ f32 PSVECDistance(const Vec* a, const Vec* b);
void C_VECHalfAngle(const Vec* a, const Vec* b, Vec* half);
void C_VECReflect(const Vec* src, const Vec* normal, Vec* dst);
}
#ifdef __cplusplus
};
#endif
#endif /* VEC_H */
+31 -5
View File
@@ -2,6 +2,8 @@
#define OS_H_
#include "Runtime.PPCEABI.H/__va_arg.h"
#include "dolphin/dvd/dvd.h"
#include "dolphin/os/OSAlarm.h"
#include "dolphin/os/OSAlloc.h"
#include "dolphin/os/OSArena.h"
@@ -35,6 +37,20 @@ extern "C" {
#define OS_MESSAGE_NON_BLOCKING 0
#define OS_MESSAGE_BLOCKING 1
volatile u16 __OSDeviceCode : 0x800030E6;
volatile u32 OS_PI_INTR_CAUSE : 0xCC003000;
volatile u32 OS_PI_INTR_MASK : 0xCC003004;
volatile u16 OS_MI_INTR_MASK : 0xCC00401C;
volatile u16 OS_DSP_DMA_ADDR_HI : 0xCC005030;
volatile u16 OS_DSP_DMA_ADDR_LO : 0xCC005032;
volatile u16 OS_DSP_INTR_MASK : 0xCC00500A;
volatile u16 OS_ARAM_DMA_ADDR_HI : 0xCC005020;
volatile u16 OS_ARAM_DMA_ADDR_LO : 0xCC005022;
BOOL OSIsThreadSuspended(OSThread* thread);
u32 OSGetConsoleType(void);
@@ -58,20 +74,20 @@ void OSReportInit__Fv(void); // needed for inline asm
u8* OSGetStackPointer(void);
void __OSFPRInit(void);
static void InquiryCallback(u32 param_0, void* param_1);
static void InquiryCallback(u32 param_0, DVDCommandBlock* param_1);
void OSInit(void);
static void OSExceptionInit(void);
void __OSDBIntegrator(void);
void __OSDBJump(void);
typedef void (*OSExceptionHandler)(OSException, OSContext*);
OSExceptionHandler __OSSetExceptionHandler(OSException exception, OSExceptionHandler handler);
OSExceptionHandler __OSGetExceptionHandler(OSException exception);
OSExceptionHandler __OSSetExceptionHandler(__OSException exception, OSExceptionHandler handler);
OSExceptionHandler __OSGetExceptionHandler(__OSException exception);
static void OSExceptionVector(void);
void __DBVECTOR();
void __OSEVSetNumber();
void __OSEVEnd();
static void OSDefaultExceptionHandler(OSException exception, OSContext* context);
static void OSDefaultExceptionHandler(__OSException exception, OSContext* context);
void __OSPSInit(void);
void __OSGetDIConfig(void);
void OSRegisterVersion(char* version);
@@ -132,7 +148,17 @@ inline void i_OSInitFastCast(void) {
// clang-format on
}
#include "dolphin/dvd/dvd.h"
typedef struct OSBootInfo {
/* 0x00 */ DVDDiskID disk_info;
/* 0x20 */ u32 boot_code;
/* 0x24 */ u32 version;
/* 0x28 */ u32 memory_size;
/* 0x2C */ u32 console_type;
/* 0x30 */ void* arena_lo;
/* 0x34 */ void* arena_hi;
/* 0x38 */ void* fst_location;
/* 0x3C */ u32 fst_max_length;
} OSBootInfo;
struct GLOBAL_MEMORY {
DVDDiskID disk;
+4 -4
View File
@@ -1,7 +1,6 @@
#ifndef OSALARM_H
#define OSALARM_H
#include "dolphin/types.h"
#include "dolphin/os/OSTime.h"
#include "dolphin/os/OSError.h"
@@ -14,7 +13,8 @@ typedef struct OSAlarmLink {
/* 0x4 */ struct OSAlarm* next;
} OSAlarmLink;
typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, struct OSContext* context);
typedef struct OSAlarm;
typedef void (*OSAlarmHandler)(struct OSAlarm* alarm, OSContext* context);
typedef struct OSAlarm {
/* 0x00 */ OSAlarmHandler handler;
@@ -31,8 +31,8 @@ static void InsertAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
void OSSetAlarm(OSAlarm* alarm, s64 time, OSAlarmHandler* handler);
void OSSetPeriodicAlarm(OSAlarm* alarm, s64 start, s64 period, OSAlarmHandler* handler);
void OSCancelAlarm(OSAlarm* alarm);
static void DecrementerExceptionCallback(OSException* exception, struct OSContext* context);
static void DecrementerExceptionHandler(OSException* exception, struct OSContext* context);
static void DecrementerExceptionCallback(__OSException exception, OSContext* context);
static void DecrementerExceptionHandler(__OSException exception, OSContext* context);
static s32 OnReset(s32 param_0);
#ifdef __cplusplus
+26 -3
View File
@@ -7,11 +7,34 @@
extern "C" {
#endif
typedef struct OSHeapDescriptor {
/* 0x0 */ s32 size;
/* 0x4 */ struct OSHeapCell* freeList;
/* 0x8 */ struct OSHeapCell* usedList;
} OSHeapDescriptor;
typedef struct OSHeapCell {
/* 0x00 */ struct OSHeapCell* prev;
/* 0x04 */ struct OSHeapCell* next;
/* 0x08 */ s32 size;
/* 0x0C */ struct OSHeapDescriptor* hd;
/* 0x10 */ s32 usedSize;
/* 0x14 */ char field_0x14[0x20 - 0x14];
} OSHeapCell;
typedef u32 OSHeapHandle;
static void* DLInsert(void* param_0, void* param_1);
void OSFreeToHeap(OSHeapHandle heap, void* ptr);
void OSSetCurrentHeap(OSHeapHandle heap);
extern volatile s32 __OSCurrHeap;
#define OSRoundUp(x, align) (((x) + (align)-1) & (-(align)))
#define OSRoundUpPtr(x, align) ((void*)((((u32)(x)) + (align)-1) & (~((align)-1))))
#define OSRoundDown(x, align) ((x) & (-(align)))
#define OSRoundDownPtr(x, align) ((void*)(((u32)(x)) & (~((align)-1))))
static OSHeapCell* DLInsert(OSHeapCell* list, OSHeapCell* child);
void OSFreeToHeap(OSHeapHandle handle, void* ptr);
s32 OSSetCurrentHeap(OSHeapHandle handle);
void* OSInitAlloc(void* lo, void* hi, s32 maxHeaps);
OSHeapHandle OSCreateHeap(void* start, void* end);
+6 -5
View File
@@ -7,8 +7,6 @@
extern "C" {
#endif
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
typedef struct OSContext {
/* 0x000 */ u32 gpr[32];
/* 0x080 */ u32 cr;
@@ -16,7 +14,7 @@ typedef struct OSContext {
/* 0x088 */ u32 ctr;
/* 0x08C */ u32 xer;
/* 0x090 */ f64 fpr[32];
/* 0x190 */ u32 padding_1;
/* 0x190 */ u32 field_0x190;
/* 0x194 */ u32 fpscr;
/* 0x198 */ u32 srr0;
/* 0x19C */ u32 srr1;
@@ -26,8 +24,11 @@ typedef struct OSContext {
/* 0x1C4 */ f64 ps[32];
} OSContext;
OSContext* OS_CURRENT_CONTEXT : 0x800000D4;
OSContext* OS_CURRENT_FPU_CONTEXT : 0x800000D8;
void __OSLoadFPUContext(void);
void __OSSaveFPUContext(OSContext* context);
void __OSSaveFPUContext(s32 unused0, s32 unused1, OSContext* context);
void OSSaveFPUContext(OSContext* context);
void OSSetCurrentContext(OSContext* context);
OSContext* OSGetCurrentContext(void);
@@ -36,7 +37,7 @@ void OSLoadContext(OSContext* context);
void OSClearContext(OSContext* context);
void OSInitContext(OSContext* context, u32 pc, u32 lr);
void OSDumpContext(OSContext* context);
static void OSSwitchFPUContext(OSContext* context);
static void OSSwitchFPUContext(u8 err, OSContext* context);
void __OSContextInit(void);
void OSFillFPUContext(OSContext* context);
+6 -6
View File
@@ -1,18 +1,14 @@
#ifndef OSERROR_H
#define OSERROR_H
#include "dolphin/types.h"
#include "dolphin/os/OSContext.h"
#ifdef __cplusplus
extern "C" {
#endif
struct OSContext;
extern u32 __OSFpscrEnableBits;
typedef u16 OSError;
typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
#define OS_ERROR_SYSTEM_RESET 0
#define OS_ERROR_MACHINE_CHECK 1
@@ -32,7 +28,7 @@ typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
#define OS_ERROR_MEMORY_PROTECTION 15
#define OS_ERROR_FLOATING_POINT_EXCEPTION 16
typedef enum OSException {
typedef enum {
EXCEPTION_SYSTEM_RESET,
EXCEPTION_MACHINE_CHECK,
EXCEPTION_DSI,
@@ -52,6 +48,10 @@ typedef enum OSException {
EXCEPTION_FLOATING_POINT_EXCEPTION,
} OSException;
typedef u8 __OSException;
typedef void (*OSErrorHandler)(OSError error, OSContext* context, u32, u32);
OSErrorHandler OSSetErrorHandler(OSError error, OSErrorHandler handler);
void __OSUnhandledException(OSException exception, OSContext* context, u32 dsisr, u32 dar);
+44 -4
View File
@@ -1,15 +1,52 @@
#ifndef OSINTERRUPT_H
#define OSINTERRUPT_H
#include "dolphin/types.h"
#include "dolphin/os/OSContext.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
OS_INTR_MEM_0,
OS_INTR_MEM_1,
OS_INTR_MEM_2,
OS_INTR_MEM_3,
OS_INTR_MEM_ADDRESS,
OS_INTR_DSP_AI,
OS_INTR_DSP_ARAM,
OS_INTR_DSP_DSP,
OS_INTR_AI_AI,
OS_INTR_EXI_0_EXI,
OS_INTR_EXI_0_TC,
OS_INTR_EXI_0_EXT,
OS_INTR_EXI_1_EXI,
OS_INTR_EXI_1_TC,
OS_INTR_EXI_1_EXT,
OS_INTR_EXI_2_EXI,
OS_INTR_EXI_2_TC,
OS_INTR_PI_CP,
OS_INTR_PI_PE_TOKEN,
OS_INTR_PI_PE_FINISH,
OS_INTR_PI_SI,
OS_INTR_PI_DI,
OS_INTR_PI_RSW,
OS_INTR_PI_ERROR,
OS_INTR_PI_VI,
OS_INTR_PI_DEBUG,
OS_INTR_PI_HSP,
OS_INTR_PI_ACR,
OS_INTR_28,
OS_INTR_29,
OS_INTR_30,
OS_INTR_31,
OS_INTR_MAX
} OSInterruptType;
typedef s16 OSInterrupt;
typedef u32 OSInterruptMask;
typedef void (*OSInterruptHandler)(OSInterrupt interrupt, struct OSContext* context);
typedef void (*OSInterruptHandler)(OSInterrupt interrupt, OSContext* context);
BOOL OSDisableInterrupts(void);
void __RAS_OSDisableInterrupts_end(void);
@@ -21,8 +58,11 @@ void __OSInterruptInit(void);
static OSInterruptMask SetInterruptMask(OSInterruptMask param_0, OSInterruptMask param_1);
OSInterruptMask __OSMaskInterrupts(OSInterruptMask mask);
OSInterruptMask __OSUnmaskInterrupts(OSInterruptMask mask);
void __OSDispatchInterrupt(OSInterrupt interrupt, struct OSContext* context);
static void ExternalInterruptHandler(OSInterrupt interrupt, struct OSContext* context);
void __OSDispatchInterrupt(OSInterrupt interrupt, OSContext* context);
static void ExternalInterruptHandler(OSInterrupt interrupt, OSContext* context);
void __RAS_OSDisableInterrupts_begin(void);
void __RAS_OSDisableInterrupts_end(void);
#ifdef __cplusplus
};
+8
View File
@@ -7,6 +7,14 @@
extern "C" {
#endif
typedef struct OSModuleQueue {
int* first;
int* last;
} OSModuleQueue;
OSModuleQueue __OSModuleList : 0x800030C8;
void* __OSStringTable : 0x800030D0;
typedef struct OSSectionInfo {
u32 mOffset;
u32 mSize;
+1 -1
View File
@@ -13,7 +13,7 @@ static void MEMIntrruptHandler(OSInterrupt interrupt, struct OSContext* context)
void OSProtectRange(u32 channel, void* address, u32 nBytes, u32 control);
static void Config24MB(void);
static void Config48MB(void);
static void RealMode(void);
static void RealMode(void* config);
void __OSInitMemoryProtection(void);
#ifdef __cplusplus
-1
View File
@@ -1,7 +1,6 @@
#ifndef OSMESSAGE_H
#define OSMESSAGE_H
#include "dolphin/types.h"
#include "dolphin/os/OSThread.h"
#ifdef __cplusplus
+18 -12
View File
@@ -1,24 +1,30 @@
#ifndef OSMUTEX_H
#define OSMUTEX_H
#include "dolphin/types.h"
#include "dolphin/os/OSThread.h"
#ifdef __cplusplus
extern "C" {
#endif
void OSInitMutex(struct OSMutex* mutex);
void OSLockMutex(struct OSMutex* mutex);
void OSUnlockMutex(struct OSMutex* mutex);
void __OSUnlockAllMutex(struct OSThread* thread);
s32 OSTryLockMutex(struct OSMutex* mutex);
void OSInitCond(struct OSCond* cond);
void OSWaitCond(struct OSCond* cond, struct OSMutex* mutex);
void OSSignalCond(struct OSCond* cond);
s32 __OSCheckMutex(struct OSThread* thread);
BOOL __OSCheckDeadLock(struct OSThread* thread);
BOOL __OSCheckMutexes(struct OSThread* thread);
typedef struct OSMutex {
/* 0x00 */ OSThreadQueue queue;
/* 0x08 */ OSThread* thread;
/* 0x0C */ s32 count;
/* 0x10 */ OSMutexLink link;
} OSMutex; // Size: 0x18
void OSInitMutex(OSMutex* mutex);
void OSLockMutex(OSMutex* mutex);
void OSUnlockMutex(OSMutex* mutex);
void __OSUnlockAllMutex(OSThread* thread);
s32 OSTryLockMutex(OSMutex* mutex);
void OSInitCond(OSCond* cond);
void OSWaitCond(OSCond* cond, OSMutex* mutex);
void OSSignalCond(OSCond* cond);
s32 __OSCheckMutex(OSThread* thread);
BOOL __OSCheckDeadLock(OSThread* thread);
BOOL __OSCheckMutexes(OSThread* thread);
#ifdef __cplusplus
};
+1 -1
View File
@@ -9,7 +9,7 @@ extern "C" {
void __OSReboot(u32 param_0, u32 param_1);
void OSSetSaveRegion(void* start, void* end);
void OSGetSaveRegion(void* start, void* end);
void OSGetSaveRegion(void** start, void** end);
#ifdef __cplusplus
};
+2
View File
@@ -10,6 +10,8 @@ extern "C" {
static void SystemCallVector(void);
void __OSInitSystemCall(void);
void __OSSystemCallVectorEnd(void);
#ifdef __cplusplus
};
#endif
+22 -29
View File
@@ -1,8 +1,6 @@
#ifndef OSTHREAD_H
#define OSTHREAD_H
#include "dolphin/types.h"
#include "dolphin/os/OSMutex.h"
#include "dolphin/os/OSContext.h"
#ifdef __cplusplus
@@ -16,24 +14,6 @@ typedef u16 OSThreadState;
#define OS_THREAD_STATE_WAITING 4
#define OS_THREAD_STATE_DEAD 8
typedef struct OSMutexLink {
struct OSMutex* prev;
struct OSMutex* next;
} OSMutexLink;
typedef struct OSMutexQueue {
struct OSMutex* prev;
struct OSMutex* next;
} OSMutexQueue;
typedef struct OSMutex {
/* 0x00 */ //OSThreadQueue queue;
/* 0x08 */ //OSThread* thread;
/* 0x0C */ //s32 count;
/* 0x10 */ //OSMutexLink link;
u8 unk[24];
} OSMutex; // Size: 0x18
typedef struct OSThreadLink {
struct OSThread* prev;
struct OSThread* next;
@@ -44,32 +24,45 @@ typedef struct OSThreadQueue {
/* 0x4 */ struct OSThread* tail;
} OSThreadQueue;
typedef struct OSMutexLink {
struct OSMutex* prev;
struct OSMutex* next;
} OSMutexLink;
typedef struct OSMutexQueue {
struct OSMutex* prev;
struct OSMutex* next;
} OSMutexQueue;
typedef struct OSCond {
struct OSThreadQueue queue;
OSThreadQueue queue;
} OSCond;
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
typedef struct OSThread {
struct OSContext context;
OSContext context;
OSThreadState state;
u16 attributes;
s32 suspend_count;
u32 effective_priority;
s32 effective_priority;
u32 base_priority;
void* exit_value;
struct OSThreadQueue* queue;
struct OSThreadLink link;
struct OSThreadQueue join_queue;
OSThreadQueue* queue;
OSThreadLink link;
OSThreadQueue join_queue;
struct OSMutex* mutex;
OSMutexQueue owned_mutexes;
struct OSThreadLink active_threads_link;
OSThreadLink active_threads_link;
u8* stack_base;
u8* stack_end;
u8* error_code;
void* data[2];
} OSThread;
typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);
OSThreadQueue OS_THREAD_QUEUE : 0x800000DC;
OSThread* OS_CURRENT_THREAD : 0x800000E4;
static void DefaultSwitchThreadCallback(OSThread* from, OSThread* to);
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback func);
void __OSThreadInit(void);
+2
View File
@@ -10,6 +10,8 @@ extern "C" {
typedef s64 OSTime;
typedef u32 OSTick;
OSTime OS_SYSTEM_TIME : 0x800030D8;
typedef struct OSCalendarTime {
/* 0x00 */ s32 seconds;
/* 0x04 */ s32 minutes;
+11 -10
View File
@@ -3,12 +3,11 @@
#include "dolphin/types.h"
typedef enum PADMask {
// PAD_CHAN3_BIT = (1 << 0),
// PAD_CHAN2_BIT = (1 << 1),
// PAD_CHAN1_BIT = (1 << 2),
// PAD_CHAN0_BIT = (1 << 3),
#ifdef __cplusplus
extern "C" {
#endif
typedef enum PADMask {
PAD_CHAN3_BIT = (1 << 28),
PAD_CHAN2_BIT = (1 << 29),
PAD_CHAN1_BIT = (1 << 30),
@@ -28,16 +27,18 @@ typedef struct PADStatus {
/* 0xA */ s8 error;
} PADStatus;
extern "C" {
u32 PADInit(void);
void PADSetAnalogMode(u32 mode);
void PADSetSpec(int spec);
s32 PADReset(PADMask mask);
BOOL PADReset(u32 mask);
void PADClampCircle(PADStatus* status);
void PADClamp(PADStatus* status);
u32 PADRead(PADStatus* status);
void PADRead(PADStatus* status);
void PADControlMotor(s32 channel, u32 command);
s32 PADRecalibrate(PADMask mask);
}
BOOL PADRecalibrate(u32 mask);
#ifdef __cplusplus
};
#endif
#endif /* PAD_H */
+19 -11
View File
@@ -4,18 +4,26 @@
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*VIRetraceCallback)(u32);
extern "C" void VIWaitForRetrace(void);
extern "C" void VISetNextFrameBuffer(void*);
extern "C" VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback);
extern "C" VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback);
extern "C" void VIInit();
extern "C" void VIConfigure(GXRenderModeObj*);
extern "C" void VIFlush();
extern "C" void* VIGetNextFrameBuffer();
extern "C" void* VIGetCurrentFrameBuffer();
extern "C" void VISetBlack(BOOL);
extern "C" u32 VIGetRetraceCount();
void VIWaitForRetrace(void);
void VISetNextFrameBuffer(void*);
VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback);
VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback);
void VIInit();
void VIConfigure(GXRenderModeObj*);
void VIFlush();
void* VIGetNextFrameBuffer();
void* VIGetCurrentFrameBuffer();
void VISetBlack(BOOL);
u32 VIGetRetraceCount();
#ifdef __cplusplus
};
#endif
#endif /* VI_H */
+2 -1
View File
@@ -412,6 +412,7 @@ s32 fopAcM_orderTreasureEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
void* fopAcM_getTalkEventPartner(const fopAc_ac_c*);
void* fopAcM_getItemEventPartner(const fopAc_ac_c*);
void* fopAcM_getEventPartner(const fopAc_ac_c*);
static void fopAcM_onSwitch(fopAc_ac_c const* param_0, int param_1);
s32 fopAcM_createItemForPresentDemo(cXyz const* p_pos, int i_itemNo, u8 param_2, int i_itemBitNo,
int i_roomNo, csXyz const* p_angle, cXyz const* p_scale);
@@ -459,7 +460,7 @@ void* fopAcM_fastCreateItem(const cXyz* p_pos, int i_itemNo, int i_roomNo, const
s32 fopAcM_createBokkuri(u16, const cXyz*, int, int, int, const cXyz*, int, int);
s32 fopAcM_createWarpHole(const cXyz*, const csXyz*, int, u8, u8, u8);
void fopAcM_myRoomSearchEnemy(s8 roomNo);
fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo);
s32 fopAcM_createDisappear(const fopAc_ac_c*, const cXyz*, u8, u8, u8);
void fopAcM_setCarryNow(fopAc_ac_c*, int);
-5
View File
@@ -31,11 +31,6 @@
#define STATIC_ASSERT(...)
#endif
struct JUTWarn {
JUTWarn& operator<<(const char*) { return *this; }
JUTWarn& operator<<(long) { return *this; }
};
// hack to make functions that return comparisons as int match
extern int __cntlzw(unsigned int);
inline BOOL checkEqual(s32 a, s32 b) {
+7
View File
@@ -42,6 +42,9 @@ void mDoAud_resetProcess();
bool mDoAud_resetRecover();
void mDoAud_setSceneName(char const* spot, s32 room, s32 layer);
s32 mDoAud_load1stDynamicWave();
static void mDoAud_setLinkGroupInfo(u8 param_0);
static void mDoAud_setLinkHp(s32 param_0, s32 param_1);
static void mDoAud_seStartLevel(u32 param_0, Vec const* param_1, u32 param_2, s8 param_3);
inline void mDoAud_bgmSetSwordUsing(s32 id) {
Z2AudioMgr::getInterface()->mSeqMgr.bgmSetSwordUsing(id);
@@ -51,6 +54,10 @@ inline void mDoAud_bgmStart(u32 i_bgmID) {
Z2AudioMgr::getInterface()->mSeqMgr.bgmStart(i_bgmID, 0, 0);
}
inline void mDoAud_subBgmStart(u32 i_bgmID) {
Z2AudioMgr::getInterface()->mSeqMgr.subBgmStart(i_bgmID);
}
inline void mDoAud_bgmNowBattle(f32 param_0) {
Z2AudioMgr::getInterface()->mSeqMgr.bgmNowBattle(param_0);
}
+3 -1
View File
@@ -168,6 +168,8 @@ public:
/* 8000DA08 */ int init(J3DDeformData* i_deformData, J3DAnmCluster* i_blk, int i_anmPlay,
int i_attribute, f32 i_rate, s16 i_start, s16 param_6);
J3DAnmCluster* getBlkAnm() { return mpAnm; }
private:
/* 0x14 */ J3DAnmCluster* mpAnm;
};
@@ -381,7 +383,7 @@ struct mDoExt_MtxCalcAnmBlendTblOld
}; // Size: 0xC
struct mDoExt_MtxCalcAnmBlendTbl : public mDoExt_MtxCalcAnmBlendTblOld {
/* 800D00BC */ void getAnm(int);
/* 800D00BC */ J3DAnmTransform* getAnm(int);
/* 80014F3C */ virtual ~mDoExt_MtxCalcAnmBlendTbl();
/* 8000F26C */ virtual void calc();
+1
View File
@@ -4,6 +4,7 @@
#include "SSystem/SComponent/c_sxyz.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/mtx/quat.h"
#include "dolphin/types.h"
+31 -1
View File
@@ -1,6 +1,36 @@
#ifndef D_A_ALLDIE_H
#define D_A_ALLDIE_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
class daAlldie_c : public fopAc_ac_c {
public:
enum EAction {
/* 0x0 */ ACT_WAIT,
/* 0x1 */ ACT_CHECK,
/* 0x2 */ ACT_TIMER,
/* 0x3 */ ACT_ORDER,
/* 0x4 */ ACT_NEXT,
/* 0x5 */ ACT_EVENT,
};
/* 804D5818 */ u8 getEventNo();
/* 804D5824 */ u8 getSwbit();
/* 804D5830 */ int actionWait();
/* 804D5838 */ int actionCheck();
/* 804D5888 */ int actionTimer();
/* 804D5938 */ int actionOrder();
/* 804D59A0 */ int actionEvent();
/* 804D5A44 */ int actionNext();
/* 804D5B10 */ int execute();
inline int create();
/* 0x568 */ u8 mAction;
/* 0x56A */ s16 mTimer;
/* 0x56C */ s16 mEventIdx;
/* 0x56E */ s16 mNextEventIdx;
/* 0x570 */ s16 mMapToolID;
}; // Size: 0x574
#endif /* D_A_ALLDIE_H */
+14 -1
View File
@@ -149,7 +149,7 @@ public:
/* 80844CB0 */ daHorse_c();
bool checkNoBombProc() const { return field_0x16b4 == 0 || field_0x16b4 == 1; }
bool checkResetStateFlg0(daHorse_RFLG0 flag) { return mResetStateFlg0 & flag; }
bool checkResetStateFlg0(daHorse_RFLG0 flag) const { return mResetStateFlg0 & flag; }
bool checkEndResetStateFlg0(daHorse_ERFLG0 flag) { return mEndResetStateFlg0 & flag; }
bool checkStateFlg0(daHorse_FLG0 flag) { return mStateFlg0 & flag; }
f32 getNormalMaxSpeedF() { return mNormalMaxSpeedF; }
@@ -157,6 +157,10 @@ public:
void setDemoStickR(f32 stick) { mDemoStickR = stick; }
void i_changeDemoMode(u32 param_0, int param_1) { field_0x1740 = param_0; field_0x1728 = param_1; }
void i_changeOriginalDemo() { field_0x16b8 = 3; field_0x1728 = 0; }
void i_setHorsePosAndAngle(cXyz const* i_pos, s16 i_angle) { (this->*mpSetHorsePosAngleFn)(i_pos, i_angle); }
bool checkTurnStandCamera() const { return checkResetStateFlg0(TURN_STAND_CAMERA); }
bool checkTurnStand() const { return checkResetStateFlg0(TURN_STAND); }
static u8 const m_footJointTable[8];
static f32 const m_callLimitDistance2;
@@ -220,6 +224,15 @@ public:
/* 0x1790 */ f32 mLashMaxSpeedF;
/* 0x1794 */ u8 field_0x1794[0x30];
/* 0x17C4 */ cXyz mDemoPos0;
/* 0x17D0 */ u8 field_0x17d0[0x18A4 - 0x17D0];
/* 0x18A4 */ int (daHorse_c::*mpProcFn)();
/* 0x18A4 */ int (daHorse_c::*mpCheckSpecialWallHitFn)(const cXyz&);
/* 0x18A4 */ void (daHorse_c::*mpSetReinPosHandFn)(int);
/* 0x18A4 */ void (daHorse_c::*mpSetReinPosNormalFn)();
/* 0x18A4 */ int (daHorse_c::*mpCallHorseFn)(const cXyz*);
/* 0x18A4 */ int (daHorse_c::*mpSetHorsePosAngleFn)(const cXyz* i_pos, s16 i_angle);
/* 0x18A4 */ void (daHorse_c::*mpOnRideFlgFn)();
/* 0x18A4 */ void (daHorse_c::*mpOffRideFlgFn)();
};
#endif /* D_A_HORSE_H */
+15 -1
View File
@@ -1,6 +1,20 @@
#ifndef D_A_TBOXSW_H
#define D_A_TBOXSW_H
#include "dolphin/types.h"
#include "f_op/f_op_actor_mng.h"
class daTboxSw_c : public fopAc_ac_c {
public:
/* 80D66858 */ int Create();
/* 80D66860 */ int create();
/* 80D668C8 */ int execute();
/* 80D66938 */ int draw();
/* 80D66940 */ int _delete();
};
namespace daTboxSw_prm {
inline u8 getTboxNo(daTboxSw_c* p_tbox) { return fopAcM_GetParam(p_tbox) & 0x3F; }
inline u8 getSwNo(daTboxSw_c* p_tbox) { return fopAcM_GetParam(p_tbox) >> 8; }
};
#endif /* D_A_TBOXSW_H */
@@ -1,6 +1,17 @@
#ifndef D_A_KYTAG14_H
#define D_A_KYTAG14_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
class kytag14_class : public fopAc_ac_c {
public:
/* 0x568 */ s8 mSaveRoomNo;
/* 0x569 */ u8 mSavePoint;
/* 0x56A */ u16 mEventID1;
/* 0x56C */ u16 mEventID2;
/* 0x56E */ u8 mSwitchNo1;
/* 0x56F */ u8 mSwitchNo2;
};
#endif /* D_A_KYTAG14_H */
@@ -1,6 +1,18 @@
#ifndef D_A_TAG_GSTART_H
#define D_A_TAG_GSTART_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
class daTagGstart_c : public fopAc_ac_c {
public:
/* 805A3478 */ int create();
/* 805A3514 */ ~daTagGstart_c();
/* 805A3590 */ int execute();
/* 0x568 */ u8 mSwNo;
/* 0x569 */ u8 mSwNo2;
/* 0x56A */ u8 field_0x56a;
/* 0x56B */ u8 mType;
};
#endif /* D_A_TAG_GSTART_H */
@@ -1,6 +1,26 @@
#ifndef D_A_TAG_HSTOP_H
#define D_A_TAG_HSTOP_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
#include "d/msg/d_msg_flow.h"
class daTagHstop_c : public fopAc_ac_c {
public:
/* 805A43EC */ int create();
/* 805A45F8 */ ~daTagHstop_c();
/* 805A46B8 */ void setActive();
/* 805A475C */ int execute();
static daTagHstop_c* m_top;
static dMsgFlow_c m_msgFlow;
/* 0x568 */ daTagHstop_c* mNext;
/* 0x568 */ daTagHstop_c* mPrev;
/* 0x570 */ u8 mPrm0;
/* 0x571 */ bool mActive;
/* 0x572 */ u8 mPrm1;
/* 0x573 */ u8 field_0x573;
/* 0x574 */ int field_0x574;
};
#endif /* D_A_TAG_HSTOP_H */
@@ -1,6 +1,8 @@
#ifndef D_A_TAG_INSTRUCTION_H
#define D_A_TAG_INSTRUCTION_H
#include "dolphin/types.h"
#include "f_op/f_op_actor_mng.h"
class daTagInst_c : public fopAc_ac_c {};
#endif /* D_A_TAG_INSTRUCTION_H */