Skip to content

Commit

Permalink
d_a_b_zant matched + linked (#2253)
Browse files Browse the repository at this point in the history
* work on b_zant

* zant work

* more zant work

* all b_zant functions done

* some doc work

* some more doc work

* d_a_b_zant linked

* fix d_a_b_zant_magic issue
  • Loading branch information
TakaRikka authored Nov 22, 2024
1 parent 2159eac commit d0e243a
Show file tree
Hide file tree
Showing 12 changed files with 5,638 additions and 2,757 deletions.
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,8 @@ def MatchingFor(*versions):
ActorRel(NonMatching, "d_a_b_tn"),
ActorRel(Equivalent, "d_a_b_yo"),
ActorRel(Equivalent, "d_a_b_yo_ice"),
ActorRel(NonMatching, "d_a_b_zant"),
ActorRel(Equivalent, "d_a_b_zant_magic"), # matches in objdiff, unknown issue
ActorRel(Matching, "d_a_b_zant"),
ActorRel(Matching, "d_a_b_zant_magic"),
ActorRel(Matching, "d_a_b_zant_mobile"),
ActorRel(Matching, "d_a_b_zant_sima"),
ActorRel(NonMatching, "d_a_balloon_2D"),
Expand Down
5 changes: 4 additions & 1 deletion include/SSystem/SComponent/c_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ class cCcD_ObjCommonBase {

STATIC_ASSERT(0x10 == sizeof(cCcD_ObjCommonBase));

#pragma pack(1)
class cCcD_ObjAt : public cCcD_ObjCommonBase {
public:
cCcD_ObjAt() { mType = 0; }
Expand All @@ -408,7 +409,9 @@ class cCcD_ObjAt : public cCcD_ObjCommonBase {
protected:
/* 0x10 */ int mType;
/* 0x14 */ u8 mAtp;
/* 0x15 */ u8 field_0x15[3];
};
#pragma pack()

STATIC_ASSERT(0x18 == sizeof(cCcD_ObjAt));

Expand Down Expand Up @@ -486,7 +489,7 @@ class cCcD_ObjHitInf {
void SetAtHit(cCcD_Obj* obj) { mObjAt.SetHit(obj); }
void SetTgHit(cCcD_Obj* obj) { mObjTg.SetHit(obj); }
void SetCoHit(cCcD_Obj* obj) { mObjCo.SetHit(obj); }
BOOL ChkAtType(u32 type) const { return mObjAt.MskType(type); }
u32 ChkAtType(u32 type) const { return mObjAt.MskType(type); }
u32 ChkCoNoCrr() const { return mObjCo.ChkNoCrr(); }
void OnCoNoCrrBit() { mObjCo.OnNoCrrBit(); }
u32 ChkCoSph3DCrr() const { return mObjCo.ChkSph3DCrr(); }
Expand Down
208 changes: 132 additions & 76 deletions include/d/actor/d_a_b_zant.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,88 @@
*/
class daB_ZANT_c : public fopEn_enemy_c {
public:
/* 8063E19C */ void ctrlJoint(J3DJoint*, J3DModel*);
/* 8063E264 */ void JointCallBack(J3DJoint*, int);
/* 8063E2B0 */ void draw();
enum daB_ZANT_ACTION {
ACT_SMALL_ATTACK,
ACT_WARP,
ACT_DAMAGE,
ACT_CONFUSE,
ACT_OPENING,
ACT_FLY,
ACT_FLY_GROUND,
ACT_WATER,
ACT_HOOK,
ACT_SWIM,
ACT_SIMA_JUMP,
ACT_ICE_DEMO,
ACT_ICE_JUMP,
ACT_ICE_STEP,
ACT_ICE_DAMAGE,
ACT_MONKEY,
ACT_MONKEY_FALL,
ACT_MONKEY_DAMAGE,
ACT_LAST_START_DEMO,
ACT_LAST_ATTACK,
ACT_LAST_TIRED,
ACT_LAST_DAMAGE,
ACT_LAST_END_DEMO,
ACT_ROOM_CHANGE,
};

enum daB_ZANT_PHASE {
PHASE_OP, // Opening
PHASE_BB, // Diababa
PHASE_MG, // Dangoro
PHASE_OI, // Morpheel
PHASE_MK, // Ook
PHASE_YO, // Blizzeta
PHASE_LAST, // Castle

PHASE_MAX,
};

enum daB_ZANT_DMGTYPE {
DMGTYPE_SWORD,
DMGTYPE_MISC,
DMGTYPE_BOOMERANG,
DMGTYPE_OBJ,
DMGTYPE_HOOK_OI,
};

/* 8063E19C */ int ctrlJoint(J3DJoint*, J3DModel*);
/* 8063E264 */ static int JointCallBack(J3DJoint*, int);
/* 8063E2B0 */ int draw();
/* 8063E5C4 */ void setBck(int, u8, f32, f32);
/* 8063E668 */ void checkBck(int);
/* 8063E668 */ bool checkBck(int);
/* 8063E6C4 */ void setActionMode(int, int);
/* 8063E6F8 */ void checkBigDamage();
/* 8063E79C */ void checkDamageType();
/* 8063E6F8 */ bool checkBigDamage();
/* 8063E79C */ int checkDamageType();
/* 8063E810 */ void setDamageSe(dCcD_Sph*, int);
/* 8063E938 */ void damage_check();
/* 8063F524 */ void ice_damage_check();
/* 8063F84C */ void setNextDamageMode(int);
/* 8063FAB4 */ void checkAvoidWeapon(int);
/* 8063F84C */ bool setNextDamageMode(int);
/* 8063FAB4 */ bool checkAvoidWeapon(int);
/* 8063FF6C */ void setTgHitBit(int);
/* 8063FFAC */ void setCoHitBit(int);
/* 8063FFEC */ void setTgShield(int);
/* 806400BC */ void setTgType(u32);
/* 806400C8 */ void setZantMessage(int);
/* 80640104 */ void doZantMessage();
/* 80640104 */ int doZantMessage();
/* 80640180 */ void setIceLandingEffect(int);
/* 80640310 */ void setWaterBubble();
/* 806403D4 */ void setMonkeyFallEffect();
/* 80640478 */ void setLastRollEffect();
/* 80640654 */ f32 getMagicSpeed();
/* 80640664 */ f32 getMagicWaterSpeed();
/* 80640674 */ void executeSmallAttack();
/* 80640C20 */ void calcScale(int);
/* 80640C20 */ bool calcScale(int);
/* 80640D14 */ void executeWarp();
/* 806412A8 */ void executeDamage();
/* 806414E4 */ void executeConfuse();
/* 80641640 */ void executeOpening();
/* 806427EC */ void executeFly();
/* 80642EC8 */ void executeFlyGround();
/* 806430E0 */ void checkSwimLinkNearMouth();
/* 806432F8 */ void checkSwimLinkNear();
/* 806430E0 */ bool checkSwimLinkNearMouth();
/* 806432F8 */ bool checkSwimLinkNear();
/* 8064350C */ void executeHook();
/* 80643690 */ void executeWater();
/* 80644074 */ void executeSwim();
Expand Down Expand Up @@ -84,56 +131,55 @@ class daB_ZANT_c : public fopEn_enemy_c {
/* 8064CB1C */ void mtx_set();
/* 8064CD0C */ void cc_set();
/* 8064CFA8 */ void cc_ice_set();
/* 8064DA48 */ void execute();
/* 8064DB70 */ void _delete();
/* 8064DC04 */ void CreateHeap();
/* 8064E190 */ void create();
/* 8064DA48 */ int execute();
/* 8064DB70 */ int _delete();
/* 8064DC04 */ int CreateHeap();
/* 8064E190 */ int create();

private:
/* 0x05AC */ request_of_phase_process_class mPhase;
/* 0x05B4 */ mDoExt_McaMorfSO* mpMorfSO;
/* 0x05B8 */ J3DModel* field_0x5b8;
/* 0x05BC */ J3DModel* field_0x5bc;
/* 0x05C0 */ J3DModel* field_0x5c0;
/* 0x05C4 */ J3DModel* field_0x5c4;
/* 0x05C8 */ mDoExt_brkAnm* field_0x5c8;
/* 0x05CC */ mDoExt_btkAnm* field_0x5cc;
/* 0x05D0 */ mDoExt_btkAnm* field_0x5d0;
/* 0x05D4 */ mDoExt_brkAnm* field_0x5d4;
/* 0x05D8 */ mDoExt_btkAnm* field_0x5d8;
/* 0x05DC */ u8 field_0x5dc[0x5e8 - 0x5dc];
/* 0x05E8 */ u8 field_0x5e8;
/* 0x05E9 */ u8 field_0x5e9;
/* 0x05EC */ f32 field_0x5ec;
/* 0x05F0 */ Z2CreatureEnemy mZ2Enemy;
/* 0x0680 */ u8 field_0x680[0x6a0 - 0x680];
/* 0x05B4 */ mDoExt_McaMorfSO* mpModelMorf;
/* 0x05B8 */ J3DModel* mpSwordLModel;
/* 0x05BC */ J3DModel* mpSwordRModel;
/* 0x05C0 */ J3DModel* mpMahojinModel;
/* 0x05C4 */ J3DModel* mpMahojinModel2;
/* 0x05C8 */ mDoExt_brkAnm* mpMahojinBrk;
/* 0x05CC */ mDoExt_btkAnm* mpMahojinBtk;
/* 0x05D0 */ mDoExt_btkAnm* mpMahojinStartBtk;
/* 0x05D4 */ mDoExt_brkAnm* mpMahojinBrk2;
/* 0x05D8 */ mDoExt_btkAnm* mpMahojinStartBtk2;
/* 0x05DC */ cXyz field_0x5dc;
/* 0x05E8 */ u8 mMahojinAnmMode;
/* 0x05E9 */ u8 mMahojin2AnmMode;
/* 0x05EC */ f32 mMahojin2Size;
/* 0x05F0 */ Z2CreatureEnemy mSound;
/* 0x0694 */ u8 field_0x694[0x06A0 - 0x0694];
/* 0x06A0 */ cXyz mFlyWarpPos;
/* 0x06AC */ cXyz field_0x6ac;
/* 0x06B8 */ s16 field_0x6b8;
/* 0x06BA */ s16 field_0x6ba;
/* 0x06BC */ f32 field_0x6bc;
/* 0x06C0 */ f32 field_0x6c0;
/* 0x06C4 */ f32 field_0x6c4;
/* 0x06C8 */ f32 field_0x6c8;
/* 0x06C0 */ f32 mModelScaleXZ;
/* 0x06C4 */ f32 mModelScaleY;
/* 0x06C8 */ f32 mKankyoBlend;
/* 0x06CC */ f32 field_0x6cc;
/* 0x06D0 */ f32 field_0x6d0;
/* 0x06D4 */ int mActionID;
/* 0x06D8 */ int mLastActionID;
/* 0x06DC */ int mActionMode;
/* 0x06E0 */ u32 field_0x6e0;
/* 0x06D0 */ f32 mSwordSize;
/* 0x06D4 */ int mAction;
/* 0x06D8 */ int mLastAction;
/* 0x06DC */ int mMode;
/* 0x06E0 */ u32 mShadowKey;
/* 0x06E4 */ u16 field_0x6e4;
/* 0x06E8 */ int field_0x6e8;
/* 0x06E8 */ int mModeTimer;
/* 0x06EC */ int field_0x6ec;
/* 0x06F0 */ int field_0x6f0;
/* 0x06F4 */ int field_0x6f4;
/* 0x06F8 */ s16 field_0x6f8;
/* 0x06FA */ u8 field_0x6fa;
/* 0x06FA */ u8 mSwbit;
/* 0x06FB */ u8 mFightPhase;
/* 0x06FC */ u8 field_0x6fc;
/* 0x06FD */ u8 field_0x6fd;
/* 0x06FE */ u8 mFlyWarpPosID;
/* 0x06FF */ u8 field_0x6ff;
/* 0x0700 */ u8 field_0x700;
/* 0x0700 */ u8 field_0x700[0x0701 - 0x0700];
/* 0x0701 */ u8 field_0x701;
/* 0x0702 */ u8 field_0x702;
/* 0x0703 */ u8 field_0x703;
Expand All @@ -149,7 +195,7 @@ class daB_ZANT_c : public fopEn_enemy_c {
/* 0x070D */ u8 field_0x70d;
/* 0x070E */ u8 field_0x70e;
/* 0x070F */ u8 field_0x70f;
/* 0x0710 */ u8 field_0x710;
/* 0x0710 */ u8 mDrawSwords;
/* 0x0711 */ u8 field_0x711;
/* 0x0712 */ u8 field_0x712;
/* 0x0713 */ u8 field_0x713;
Expand All @@ -158,57 +204,67 @@ class daB_ZANT_c : public fopEn_enemy_c {
/* 0x0716 */ u8 field_0x716;
/* 0x0717 */ u8 field_0x717;
/* 0x0718 */ u8 field_0x718;
/* 0x0719 */ bool mTakenBigDmg;
/* 0x0719 */ u8 mTakenBigDmg;
/* 0x071A */ u8 mFightCycle;
/* 0x071B */ u8 field_0x71b;
/* 0x071C */ u8 field_0x71c;
/* 0x071D */ u8 field_0x71d;
/* 0x071E */ s16 field_0x71e;
/* 0x0720 */ s16 field_0x720;
/* 0x0722 */ s16 field_0x722;
/* 0x071E */ s16 mNeckRotZ;
/* 0x0720 */ s16 mNeckRotX;
/* 0x0722 */ s16 mBackboneRotZ;
/* 0x0724 */ u32 field_0x724;
/* 0x0728 */ u8 field_0x728;
/* 0x072C */ u32 field_0x72c[4];
/* 0x073C */ u32 field_0x73c[9];
/* 0x0760 */ cXyz field_0x760;
/* 0x076C */ cXyz field_0x76c;
/* 0x0778 */ f32 field_0x778;
/* 0x0728 */ u8 mCorrectMobileNo;
/* 0x072C */ fpc_ProcID mMobileIDs[4];
/* 0x073C */ fpc_ProcID mPillarIDs[9];
/* 0x0760 */ cXyz mDemoCamEye;
/* 0x076C */ cXyz mDemoCamCenter;
/* 0x0778 */ f32 mDemoCamBank;
/* 0x077C */ f32 field_0x77c;
/* 0x0780 */ int mMsgNo;
/* 0x0784 */ int mMsgID;
/* 0x0784 */ fpc_ProcID mMsgID;
/* 0x0788 */ msg_class* mpMsg;
/* 0x078C */ dBgS_AcchCir mAcchCir;
/* 0x07CC */ dBgS_Acch mAcch;
/* 0x09A4 */ dCcD_Stts mStts;
/* 0x09E0 */ dCcD_Sph field_0x9e0[2];
/* 0x07CC */ dBgS_ObjAcch mAcch;
/* 0x09A4 */ dCcD_Stts field_0x9a4;
/* 0x09E0 */ dCcD_Sph mBodySphCc[2];
/* 0x0C50 */ dCcU_AtInfo mAtInfo;
/* 0x0C74 */ dCcD_Stts field_0xc74;
/* 0x0CB0 */ dCcD_Sph field_0xcb0[11];
/* 0x1A18 */ dCcD_Sph field_0x1a18[11];
/* 0x2780 */ dCcD_Sph field_0x2780[11];
/* 0x34E8 */ dCcD_Cyl field_0x34e8;
/* 0x3624 */ dCcD_Sph field_0x3624[2];
/* 0x0CB0 */ dCcD_Sph mFootCc[11];
/* 0x1A18 */ dCcD_Sph mFoot2Cc[11];
/* 0x2780 */ dCcD_Sph mCameraCc[11];
/* 0x34E8 */ dCcD_Cyl mRollCc;
/* 0x3624 */ dCcD_Sph mSwordCc[2];
/* 0x3894 */ u32 field_0x3894;
/* 0x3898 */ u32 field_0x3898;
// /* 0x389C */ u32 field_0x389c;
/* 0x38A0 */ u8 field_0x38a0[0x38ac - 0x38a0];
// /* 0x38AC */ u32 field_0x38ac[2];
// /* 0x38B4 */ u32 field_0x38b4;
// /* 0x38B8 */ u8 field_0x38b8;
/* 0x389C */ u32 field_0x389c[4];
/* 0x38AC */ u32 field_0x38ac[2];
/* 0x38B4 */ u32 field_0x38b4;
/* 0x38B8 */ u8 mInitHIO;
};

/*
There is a misalignment here causing the class to be too big by 0x14.
Commenting out the class members at the end fixed it temporarily.
Needs to be fixed properly at some point.
*/

STATIC_ASSERT(sizeof(daB_ZANT_c) == 0x38BC);

class daB_ZANT_HIO_c {
public:
/* 8063E10C */ daB_ZANT_HIO_c();
/* 8064E994 */ ~daB_ZANT_HIO_c();
/* 8064E994 */ virtual ~daB_ZANT_HIO_c() {}

/* 0x04 */ s8 field_0x4;
/* 0x08 */ f32 mModelSize;
/* 0x0C */ f32 mMahojinWaitTime;
/* 0x10 */ f32 mDemoWarpTime;
/* 0x14 */ f32 mPlayWarpTime;
/* 0x18 */ f32 mSwordAttackSize;
/* 0x1C */ f32 mAttackAnmSpeed;
/* 0x20 */ f32 mBulletNum;
/* 0x24 */ f32 mBulletSpeed;
/* 0x28 */ f32 mBulletSpeedUnderwater;
/* 0x2C */ f32 mMahojinSize;
/* 0x30 */ f32 mMahojinOffsetX;
/* 0x34 */ f32 mMahojinOffsetY;
/* 0x38 */ f32 mMahojinOffsetZ;
/* 0x3C */ f32 mAppearAnmSpeed;
/* 0x40 */ f32 mDisappearAnmSpeed;
};

#endif /* D_A_B_ZANT_H */
5 changes: 5 additions & 0 deletions include/d/actor/d_a_b_zant_mobile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class daB_ZANTZ_c : public fopEn_enemy_c {
/* 80651DC4 */ int CreateHeap();
/* 80652038 */ int create();

int getMouthMode() { return mMouthMode; }
int getAppearMode() { return mAppearMode; }
bool isSearchContinue() { return mSearchContinue != false; }
void offSearchContinue() { mSearchContinue = false; }

private:
/* 0x5AC */ request_of_phase_process_class mPhase;
/* 0x5B4 */ mDoExt_McaMorfSO* mpMorf;
Expand Down
2 changes: 2 additions & 0 deletions include/d/actor/d_a_nbomb.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class daNbomb_c : public dBomb_c {
u32 checkWaterBomb() const { return checkStateFlg0(FLG0_WATER_BOMB); }
u32 checkPlayerMake() const { return checkStateFlg0(FLG0_PLAYER_MAKE); }

s16 getExTime() { return mExTime; }

static const char* m_arcNameList[6];

/* 0x56C */ request_of_phase_process_class mPhase;
Expand Down
12 changes: 11 additions & 1 deletion include/d/actor/d_a_obj_pillar.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ class daPillar_c : public fopAc_ac_c {
/* 80CB0658 */ void Draw();
/* 80CB0740 */ void Delete();

u8 getMdlType() { return field_0x73e & 0xF; }
bool checkRollAttack() { return field_0x732 == true; }
void setShake(int i_shake) { field_0x738 = i_shake; }

private:
/* 0x568 */ u8 field_0x568[0x750 - 0x568];
/* 0x568 */ u8 field_0x568[0x732 - 0x568];
/* 0x732 */ u8 field_0x732;
/* 0x733 */ u8 field_0x733[0x738 - 0x733];
/* 0x738 */ int field_0x738;
/* 0x73C */ u8 field_0x73c[0x73E - 0x73C];
/* 0x73E */ u16 field_0x73e;
/* 0x740 */ u8 field_0x740[0x750 - 0x740];
};

STATIC_ASSERT(sizeof(daPillar_c) == 0x750);
Expand Down
4 changes: 2 additions & 2 deletions include/d/d_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class dCcD_GAtTgCoCommonBase {
/* 0x0C */ u32 mApid;
/* 0x10 */ fopAc_ac_c* mAc;
/* 0x14 */ s8 mEffCounter;
/* 0x15 */ u8 field_0x15[3];
/* 0x18 vtable */

public:
Expand Down Expand Up @@ -262,7 +261,8 @@ class dCcD_GObjTg : public dCcD_GAtTgCoCommonBase {
/* 0x38 */ cXyz mHitPos;
/* 0x44 */ s16* mShieldFrontRangeYAngle;
/* 0x48 */ s16 mShieldRange;
}; // Size = 0x4A ?
/* 0x4A */ s16 field_0x4a;
}; // Size = 0x4C

// Correction (Co) Collider
class dCcD_GObjCo : public dCcD_GAtTgCoCommonBase {
Expand Down
Loading

0 comments on commit d0e243a

Please sign in to comment.