Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into d_a_player_particle
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTGL committed Aug 9, 2024
2 parents 4e2cac6 + f367078 commit b23bbfa
Show file tree
Hide file tree
Showing 119 changed files with 2,719 additions and 793 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Download objdiff CLI
if: github.ref == 'refs/heads/main'
run: |
python tools/download_tool.py --tag v2.0.0-alpha.5 objdiff-cli objdiff-cli
python tools/download_tool.py --tag v2.0.0-beta.1 objdiff-cli objdiff-cli
- name: Build
run: |
python configure.py --version ${{matrix.version}} --compilers /compilers --warn error
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
The Legend of Zelda: The Wind Waker
[![Build Status]][actions] ![Progress] ![DOL Progress] ![RELs Progress] [![Discord Badge]][discord]
[![Build Status]][actions] [![Progress]][progress site] [![DOL Progress]][progress site] [![RELs Progress]][progress site] [![Discord Badge]][discord]
=============

[Build Status]: https://github.com/zeldaret/tww/actions/workflows/build.yml/badge.svg
[actions]: https://github.com/zeldaret/tww/actions/workflows/build.yml
[Progress]: https://img.shields.io/endpoint?label=Code&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fall%2F%3Fmode%3Dshield%26measure%3Dcode
[DOL Progress]: https://img.shields.io/endpoint?label=DOL&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode
[RELs Progress]: https://img.shields.io/endpoint?label=RELs&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fmodules%2F%3Fmode%3Dshield%26measure%3Dcode
[progress site]: https://zeldaret.github.io/tww/
[Discord Badge]: https://img.shields.io/discord/688807550715560050?color=%237289DA&logo=discord&logoColor=%23FFFFFF
[discord]: https://discord.com/invite/DqwyCBYKqf/

Expand Down
6 changes: 3 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ def JSystemLib(lib_name, objects):
Object(NonMatching, "d/d_kankyo_rain.cpp"),
Object(Matching, "d/d_kankyo_demo.cpp"),
Object(NonMatching, "d/d_detect.cpp"),
Object(NonMatching, "d/d_vibration.cpp"),
Object(NonMatching, "d/d_vib_pattern.cpp"),
Object(Matching, "d/d_vibration.cpp"),
Object(Matching, "d/d_vib_pattern.cpp"),
Object(NonMatching, "d/d_attention.cpp"),
Object(Matching, "d/d_att_dist.cpp"),
Object(Matching, "d/d_bg_s.cpp"),
Expand Down Expand Up @@ -1574,7 +1574,7 @@ def JSystemLib(lib_name, objects):
ActorRel(NonMatching, "d_a_obj_flame"),
ActorRel(NonMatching, "d_a_obj_ftree"),
ActorRel(Matching, "d_a_obj_ganonbed", extra_cflags=['-pragma "nosyminline on"']),
ActorRel(NonMatching, "d_a_obj_gaship"),
ActorRel(Matching, "d_a_obj_gaship", extra_cflags=['-pragma "nosyminline on"']),
ActorRel(Matching, "d_a_obj_gaship2"),
ActorRel(NonMatching, "d_a_obj_gnnbtltaki"),
ActorRel(NonMatching, "d_a_obj_gnndemotakie"),
Expand Down
4 changes: 2 additions & 2 deletions include/JSystem/J3DGraphAnimator/J3DModelData.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ class J3DModelData {
mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, mShapeTable.mShapeNodePointer);
initShapeNodes();
}
const void* getBinary() { return mBinary; }

// TODO
void getBasicMtxCalc() {}
void getBinary() {}
void getRootNode() {}
void setMatColorAnimator(J3DAnmColor*, J3DMatColorAnm*) {}
void setTexNoAnimator(J3DAnmTexPattern*, J3DTexNoAnm*) {}

private:
friend class J3DModelLoader;

/* 0x04 */ const void* mpRawData;
/* 0x04 */ const void* mBinary;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u16 mbHasBumpArray;
/* 0x0E */ u16 mbHasBillboard;
Expand Down
6 changes: 3 additions & 3 deletions include/JSystem/JUtility/JUTGamePad.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ struct JUTGamePad : public JKRDisposer {
static PADMask mEnabled;

enum ERumble {
VAL_0 = 0,
VAL_1 = 1,
VAL_2 = 2,
LOOP_ONCE = 0,
LOOP_FOREVER = 1,
SET_DURATION = 2,
};

void clear();
Expand Down
19 changes: 2 additions & 17 deletions include/SSystem/SComponent/c_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "dolphin/mtx/mtx.h"

inline bool cLib_IsZero(f32 value) {
return fabsf(value) < 8e-11f;
return std::fabsf(value) < 8e-11f;
}

void cLib_memCpy(void* dst, const void* src, unsigned long size);
Expand Down Expand Up @@ -58,22 +58,7 @@ inline void cLib_setBit(T& value, T bit) {

template <typename T>
inline T cLib_minMaxLimit(T val, T min, T max) {
T ret;
T var_r30;

if (val < min) {
ret = min;
} else {
if (val > max) {
var_r30 = max;
} else {
var_r30 = val;
}

ret = var_r30;
}

return (T)ret;
return (T)((T)val < (T)min ? (T)min : ((T)val > (T)max ? (T)max : (T)val));
}

template <typename T>
Expand Down
6 changes: 1 addition & 5 deletions include/SSystem/SComponent/c_m3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ void cM3d_CrawVec(const Vec&, const Vec&, Vec*);
void cM3d_UpMtx_Base(const Vec&, const Vec&, MtxP);

inline bool cM3d_IsZero(f32 f) {
return fabsf(f) < G_CM3D_F_ABS_MIN;
}
// this is the inline cM3d_IsZero but inverted. Sometimes this will get a match where the regular cM3d_IsZero inline won't
inline bool cM3d_IsZero_inverted(f32 param_0) {
return !(fabsf(param_0) < G_CM3D_F_ABS_MIN);
return std::fabsf(f) < G_CM3D_F_ABS_MIN;
}

inline void cM3d_VectorProduct(const Vec* p01, const Vec* p02, Vec* pDst) {
Expand Down
8 changes: 4 additions & 4 deletions include/SSystem/SComponent/c_xyz.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ struct cXyz : Vec {
cXyz tmp2(other.x, 0, other.z);
return tmp.abs2(tmp2);
}
f32 abs() const { return sqrtf(this->abs2()); }
f32 abs(const Vec& other) const { return sqrtf(this->abs2(other)); }
f32 absXZ() const { return sqrtf(this->abs2XZ()); }
f32 absXZ(const Vec& other) const { return sqrtf(this->abs2XZ(other)); }
f32 abs() const { return std::sqrtf(this->abs2()); }
f32 abs(const Vec& other) const { return std::sqrtf(this->abs2(other)); }
f32 absXZ() const { return std::sqrtf(this->abs2XZ()); }
f32 absXZ(const Vec& other) const { return std::sqrtf(this->abs2XZ(other)); }
f32 getMagXZ() const { return cXyz(this->x, 0, this->z).getSquareMag(); }

f32 getDotProduct(const Vec& other) const { return VECDotProduct(this, &other); }
Expand Down
17 changes: 11 additions & 6 deletions include/c/c_damagereaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ struct damagereaction {
/* 0x100 */ cXyz m100[20];
/* 0x1F0 */ cXyz m1F0[20];
/* 0x2E0 */ cXyz m2E0[20];
/* 0x3D0 */ u8 m3D0[0x410 - 0x3D0];
/* 0x3D0 */ int m3D0[14];
/* 0x408 */ int m408;
/* 0x40C */ int m40C;
/* 0x410 */ int m410;
/* 0x414 */ u8 m414[0x418 - 0x414];
/* 0x414 */ int m414;
/* 0x418 */ int m418;
/* 0x41C */ u8 m41C[0x420 - 0x41C];
/* 0x420 */ int m420;
Expand All @@ -101,7 +103,7 @@ struct damagereaction {
/* 0x440 */ s16 m440;
/* 0x442 */ s16 m442;
/* 0x444 */ s16 m444;
/* 0x446 */ u8 m446[0x448 - 0x446];
/* 0x446 */ s16 m446;
/* 0x448 */ s16 m448;
/* 0x44A */ u8 m44A[0x44C - 0x44A];
/* 0x44C */ cXyz m44C;
Expand Down Expand Up @@ -161,7 +163,7 @@ struct damagereaction {
/* 0x70E */ u8 m70E;
/* 0x70F */ u8 m70F[0x710 - 0x70F];
/* 0x710 */ u8 m710;
/* 0x711 */ u8 m711[0x712 - 0x711];
/* 0x711 */ u8 m711;
/* 0x712 */ u8 m712;
/* 0x713 */ u8 m713;
/* 0x714 */ fopAc_ac_c* m714;
Expand All @@ -182,9 +184,12 @@ struct damagereaction {
/* 0x7AE */ s16 m7AE;
/* 0x7B0 */ u8 m7B0[0x7B2 - 0x7B0];
/* 0x7B2 */ s16 m7B2;
/* 0x7B4 */ u8 m7B4[0x7B8 - 0x7B4];
/* 0x7B4 */ u8 m7B4[0x7B6 - 0x7B4];
/* 0x7B6 */ u8 m7B6;
/* 0x7B7 */ u8 m7B7[0x7B8 - 0x7B7];
/* 0x7B8 */ int m7B8;
};
}; // Size: 0x7BC

// STATIC_ASSERT(sizeof(damagereaction) == 0x7BC);

BOOL ice_bg_check(enemyice*);
Expand Down
13 changes: 9 additions & 4 deletions include/d/actor/d_a_bk.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class bk_class : public fopEn_enemy_c {
/* 0x02C8 */ s16 m02C8;
/* 0x02CA */ s16 m02CA;
/* 0x02CC */ s16 m02CC;
/* 0x02CE */ u8 m02CE[0x02D0 - 0x02CE];
/* 0x02CE */ s8 m02CE;
/* 0x02CF */ u8 m02CF[0x02D0 - 0x02CF];
/* 0x02D0 */ J3DModel* m02D0;
/* 0x02D4 */ u8 m02D4;
/* 0x02D5 */ u8 m02D5;
Expand Down Expand Up @@ -126,14 +127,18 @@ class bk_class : public fopEn_enemy_c {
/* 0x1226 */ u8 m1226[0x1228 - 0x1226];
/* 0x1228 */ s16 m1228;
/* 0x122A */ s16 m122A;
/* 0x122C */ u8 m122C[0x1230 - 0x122C];
/* 0x122C */ s8 m122C;
/* 0x1230 */ J3DMaterialTable* m1230;
/* 0x1234 */ s8 m1234;
/* 0x1235 */ u8 m1235[0x1264 - 0x1235];
/* 0x1236 */ s16 m1236;
/* 0x1238 */ cXyz m1238;
/* 0x1244 */ cXyz m1244;
/* 0x1250 */ u8 m1250[0x1260 - 0x1250];
/* 0x1260 */ f32 m1260;
/* 0x1264 */ enemyice mEnemyIce;
/* 0x161C */ enemyfire mEnemyFire;
/* 0x1844 */ JntHit_c* mpJntHit;
};
}; // Size: 0x1848

class bkHIO_c : public JORReflexible {
public:
Expand Down
6 changes: 4 additions & 2 deletions include/d/actor/d_a_kytag03.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ class kytag03_class : public fopAc_ac_c {
public:
/* 0x290 */ request_of_phase_process_class mPhs;
/* 0x298 */ mDoExt_McaMorf* mpModel;
/* 0x29C */ u8 m29C[0x2A1 - 0x29C];
/* 0x29C */ u32 field_0x29c;
/* 0x2A0 */ u8 field_0x2a0;
/* 0x2A1 */ u8 mSwitchID;
/* 0x2A2 */ u8 mbRoomActive;
/* 0x2A3 */ u8 mbVisible;
/* 0x2A4 */ u8 mbIsActive;
/* 0x2A5 */ u8 m2A5[0x2AC - 0x2A5];
/* 0x2A5 */ u8 m2A5;
/* 0x2A8 */ f32 field_0x2a8;
};

#endif /* D_A_KYTAG03_H */
46 changes: 25 additions & 21 deletions include/d/actor/d_a_lod_bg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,40 @@ class JKRExpHeap;

class daLodbg_c : public fopAc_ac_c {
public:
inline void createHeap();
inline BOOL draw();
daLodbg_c();
~daLodbg_c();
BOOL createHeap();
BOOL draw();
inline BOOL execute();
void setExecute(int (daLodbg_c::*)()) {}
inline s32 getRoomNo(); // fake, debug maps are old but some inline here appears to be there
void setExecute(BOOL (daLodbg_c::*func)()) { mExecuteFunc = func; }

void deleteModelData();
void loadModelData(const char*, J3DModelData*&, JKRSolidHeap*&, unsigned long&);
void createModelData();
void execCreateWait();
void execReadWait();
void execDeleteWait();
BOOL loadModelData(const char*, J3DModelData*&, JKRSolidHeap*&, unsigned long&);
BOOL createModelData();
BOOL execCreateWait();
BOOL execReadWait();
BOOL execDeleteWait();

static s32 sObjectCount;
static JKRExpHeap* sLocalHeap;
static const char LodAllPath[];

public:
/* 0x290 */ int (daLodbg_c::*mExecFunc)();
/* 0x29C */ J3DModel* mpModel;
/* 0x2A0 */ J3DModel* mpModel2[2];
/* 0x290 */ BOOL (daLodbg_c::*mExecuteFunc)();
/* 0x29C */ J3DModel* mModel;
/* 0x2A0 */ J3DModel* mModel2[2];
/* 0x2A8 */ u8 mAlpha;
/* 0x2A9 */ u8 mDrawModel2;
/* 0x2A9 */ bool mDrawModel2;
/* 0x2AA */ u8 m2AA[0x2AC - 0x2AA];
/* 0x2AC */ J3DModelData* mpModelData;
/* 0x2B0 */ J3DModelData* mpModelData2;
/* 0x2B4 */ mDoDvdThd_mountXArchive_c* mpMountCommand;
/* 0x2B8 */ JKRArchive* mpArchive;
/* 0x2BC */ u32 m2BC;
/* 0x2C0 */ u32 m2C0;
/* 0x2C4 */ JKRSolidHeap* mpHeap;
/* 0x2C8 */ JKRSolidHeap* mpHeap2;
/* 0x2AC */ J3DModelData* mModelData;
/* 0x2B0 */ J3DModelData* mModelData2;
/* 0x2B4 */ mDoDvdThd_mountXArchive_c* mMountCommand;
/* 0x2B8 */ JKRArchive* mArchive;
/* 0x2BC */ u32 mDataSize;
/* 0x2C0 */ u32 mDataSize2;
/* 0x2C4 */ JKRSolidHeap* mDataHeap;
/* 0x2C8 */ JKRSolidHeap* mDataHeap2;
};

#endif /* D_A_LOD_BG_H */
20 changes: 15 additions & 5 deletions include/d/actor/d_a_lwood.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,33 @@
#define D_A_LWOOD_H

#include "f_op/f_op_actor.h"
#include "SSystem/SComponent/c_phase.h"

class dBgW;

class daLwood_c : public fopAc_ac_c {
public:
inline s32 _create();
inline BOOL _delete();
inline BOOL _draw();
inline BOOL _execute();
void getYureScale() const {}
void getYureTimer() const {}
f32 getYureScale() const { return mScale; }
s16 getYureTimer() const { return mTimer; }
void setMoveBGMtx(); // weak but not inlined?
void set_mtx(); // weak but not inlined?

void CreateHeap();
void CreateInit();
BOOL CreateHeap();
BOOL CreateInit();

static const char m_arcname[];

public:
/* Place member variables here */
/* 0x290 */ request_of_phase_process_class mPhs;
/* 0x298 */ J3DModel* mModel;
/* 0x29C */ dBgW* mpBgW;
/* 0x2A0 */ Mtx mtx;
/* 0x2D0 */ s16 mTimer;
/* 0x2D4 */ f32 mScale;
};

#endif /* D_A_LWOOD_H */
41 changes: 30 additions & 11 deletions include/d/actor/d_a_mozo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "SSystem/SComponent/c_phase.h"
#include "m_Do/m_Do_ext.h"
#include "d/d_cc_d.h"
#include "m_Do/m_Do_hostIO.h"

class daMozo_c : public fopAc_ac_c {
public:
Expand Down Expand Up @@ -50,25 +51,43 @@ class daMozo_c : public fopAc_ac_c {
/* 0x3BC */ dCcD_Cps mCps;
};

class daMozo_HIO_c {
class daMozo_childHIO_c {
public:
daMozo_HIO_c();
~daMozo_HIO_c() {}
};
virtual ~daMozo_childHIO_c() {}

class daMozo_childHIO_c {
/* 0x04 */ f32 m04;
/* 0x08 */ f32 m08;
/* 0x0C */ s16 m0C;
/* 0x0E */ s16 m0E;
/* 0x10 */ u8 m10;
/* 0x11 */ u8 m11[0x14 - 0x11];
}; // Size: 0x14

class daMozo_BeamChildHIO_c : public daMozo_childHIO_c {
public:
~daMozo_childHIO_c() {}
virtual ~daMozo_BeamChildHIO_c() {}
};

class daMozo_FireChildHIO_c {
class daMozo_FireChildHIO_c : public daMozo_childHIO_c {
public:
~daMozo_FireChildHIO_c() {}
virtual ~daMozo_FireChildHIO_c() {}
};

class daMozo_BeamChildHIO_c {
class daMozo_HIO_c : public JORReflexible {
public:
~daMozo_BeamChildHIO_c() {}
};
daMozo_HIO_c();
virtual ~daMozo_HIO_c() {}

/* 0x04 */ s8 mChildID;
/* 0x05 */ u8 m05[0x08 - 0x05];
/* 0x08 */ int m08;
/* 0x0C */ daMozo_BeamChildHIO_c* mpBeamChild;
/* 0x10 */ daMozo_FireChildHIO_c* mpFireChild;
/* 0x14 */ daMozo_BeamChildHIO_c mBeamChild;
/* 0x28 */ daMozo_FireChildHIO_c mFireChild;
/* 0x3C */ f32 m3C;
/* 0x40 */ f32 m40;
/* 0x44 */ f32 m44;
}; // Size: 0x48

#endif /* D_A_MOZO_H */
Loading

0 comments on commit b23bbfa

Please sign in to comment.