Skip to content

Commit

Permalink
obj_Iceleaf almost done / d_a_alink work (#2217)
Browse files Browse the repository at this point in the history
* obj_iceleaf almost done

* fix up d_a_alink procvars

* more d_a_alink work

* some d_a_alink error cleanup

* some more cleanup
  • Loading branch information
TakaRikka authored Oct 19, 2024
1 parent abc4c66 commit 0652b2c
Show file tree
Hide file tree
Showing 49 changed files with 1,746 additions and 5,191 deletions.
10 changes: 10 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
CompileFlags:
Add: [-Wno-c++11-compat-deprecated-writable-strings, -Wno-extern-initializer]
---
If:
PathMatch: .*/*.inc
Diagnostics:
Suppress:
- "undeclared_var_use"
- "undeclared_var_use_suggest"
- "bound_member_function"
- "typecheck_subscript_value"
- "unknown_typename"
19 changes: 16 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@
"editor.defaultFormatter": "ms-python.black-formatter"
},
"editor.tabSize": 4,
"files.autoSave": "onFocusChange",
// "files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.associations": {
"*.inc": "c",
".clangd": "yaml"
"*.inc": "cpp",
".clangd": "yaml",
},
// Disable C/C++ IntelliSense, use clangd instead
"C_Cpp.intelliSenseEngine": "disabled",
"search.useIgnoreFiles": false,
"search.exclude": {
"build/*/config.json": true,
"build/**/*.MAP": true,
"build.ninja": true,
".ninja_*": true,
"objdiff.json": true,
".cache/**": true,
},
"clangd.arguments": [
"--function-arg-placeholders=0",
"-header-insertion=never",
],
}
1 change: 1 addition & 0 deletions include/JSystem/J3DGraphAnimator/J3DJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class J3DJoint {
void setYounger(J3DJoint* pYounger) { mYounger = pYounger; }
void setCurrentMtxCalc(J3DMtxCalc* pMtxCalc) { mCurrentMtxCalc = pMtxCalc; }
J3DTransformInfo& getTransformInfo() { return mTransformInfo; }
void setTransformInfo(J3DTransformInfo& i_info) { mTransformInfo = i_info; }
Vec* getMax() { return &mMax; }
Vec* getMin() { return &mMin; }
void setCallBack(J3DJointCallBack callback) { mCallBack = callback; }
Expand Down
27 changes: 26 additions & 1 deletion include/JSystem/J3DGraphBase/J3DTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,36 @@ struct J3DTransformInfo {
/* 0x00 */ Vec mScale;
/* 0x0C */ SVec mRotation;
/* 0x14 */ Vec mTranslate;
inline J3DTransformInfo& operator=(const J3DTransformInfo& b) {

/* inline J3DTransformInfo& operator=(const J3DTransformInfo& b) {
mScale = b.mScale;
mRotation = b.mRotation;
mTranslate = b.mTranslate;
return *this;
} */

inline J3DTransformInfo& operator=(const register J3DTransformInfo& b) {
register const J3DTransformInfo& var_r31 = b;
register J3DTransformInfo& var_r30 = *this;

register f32 var_f31;
register f32 var_f0;
register int var_r0;
asm {
psq_l var_f31, 0x0(var_r31), 0, 0
psq_st var_f31, 0x0(var_r30), 0, 0
lfs var_f0, 0x8(var_r31)
stfs var_f0, 0x8(var_r30)
lwz var_r0, 0xc(var_r31)
stw var_r0, 0xc(var_r30)
lha var_r0, 0x10(var_r31)
sth var_r0, 0x10(var_r30)
psq_l var_f31, 0x14(var_r31), 0, 0
psq_st var_f31, 0x14(var_r30), 0, 0
lfs var_f0, 0x1c(var_r31)
stfs var_f0, 0x1c(var_r30)
}
return *this;
}
}; // Size: 0x20

Expand Down
51 changes: 42 additions & 9 deletions include/d/actor/d_a_alink.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
#define D_A_D_A_ALINK_H

#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "Z2AudioLib/Z2Creature.h"
#include "Z2AudioLib/Z2WolfHowlMgr.h"
#include "d/actor/d_a_player.h"
#include "d/d_eye_hl.h"
#include "d/d_jnt_col.h"
#include "d/d_meter2_info.h"
#include "d/d_msg_flow.h"
#include "d/d_particle_copoly.h"
#include "d/d_save.h"
#include "f_op/f_op_actor_mng.h"
#include "d/actor/d_a_kytag05.h"
#include "d/actor/d_a_tag_mmsg.h"

class J2DAnmColorKey;
Expand Down Expand Up @@ -157,6 +156,12 @@ class daAlink_matAnm_c : public J3DMaterialAnm {
/* 0x104 */ int mSetFlag;
};

// this class is mostly a complete guess
class daAlink_hsChainLight_c : public dKy_tevstr_c {
public:
GXLightObj* getLightObj() { return &mLightObj.mLightObj; }
};

struct daAlink_BckData {
/* 0x0 */ u16 m_underID;
/* 0x2 */ u16 m_upperID;
Expand Down Expand Up @@ -1704,7 +1709,7 @@ class daAlink_c : public daPy_py_c {
/* 800D1788 */ static BOOL notSwordHitVibActor(fopAc_ac_c*);
/* 800D17EC */ BOOL setSwordHitVibration(dCcD_GObjInf*);
/* 800D1920 */ BOOL checkAtShieldHit(dCcD_GObjInf&);
/* 800D1978 */ bool checkCutReverseAt(dCcD_GObjInf*);
/* 800D1978 */ BOOL checkCutReverseAt(dCcD_GObjInf*);
/* 800D19C8 */ BOOL changeCutReverseProc(daAlink_c::daAlink_ANM);
/* 800D1E1C */ void setCutDash(int, int);
/* 800D20B4 */ BOOL checkForceSwordSwing();
Expand Down Expand Up @@ -2492,7 +2497,7 @@ class daAlink_c : public daPy_py_c {
/* 8011078C */ BOOL checkWaterInKandelaarOffset(f32);
/* 801107BC */ void checkWaterInKandelaar(f32);
/* 80110840 */ void offKandelaarModel();
/* 801108EC */ void kandelaarModelCallBack();
/* 801108EC */ int kandelaarModelCallBack();
/* 80110C6C */ BOOL checkKandelaarEquipAnime() const;
/* 80110C94 */ void preKandelaarDraw();
/* 80110E84 */ void setKandelaarModel();
Expand Down Expand Up @@ -3173,7 +3178,7 @@ class daAlink_c : public daPy_py_c {
BOOL checkBarkAnime() const { return 0; }
bool checkWolfGrabAnimeObj() const { return checkUpperAnime(0x2DA); }
bool checkWolfGrabAnimeStick() const { return checkUpperAnime(0x2DB); }
bool checkWolfGrabAnime() const { return checkWolfGrabAnimeObj() || checkWolfGrabAnimeStick(); }
BOOL checkWolfGrabAnime() const { return checkWolfGrabAnimeObj() || checkWolfGrabAnimeStick(); }
bool checkWolfSwimDashAnime() const { return checkUnderMove0BckNoArcWolf(WANM_SWIM_DASH); }
bool checkKandelaarSwingAnime() const { return false; }
bool checkBowChargeWaitAnime() const { return checkUpperAnime(0xA); }
Expand Down Expand Up @@ -3386,6 +3391,11 @@ class daAlink_c : public daPy_py_c {
}

const cXyz& getHsChainTopPos() const { return mHookshotTopPos; }
const cXyz& getHsChainRootPos() const { return mHeldItemRootPos; }

const cXyz& getHsSubChainRootPos() const { return field_0x3810; }

s16 getHookshotStopTime() const { return field_0x3026; }

static int getBallModelIdx() { return 0x25; }
static int getBallBtkIdx() { return 0x49; }
Expand All @@ -3395,12 +3405,18 @@ class daAlink_c : public daPy_py_c {
bool checkRootTransZClearMode() { return field_0x2f99 & 4; }
bool checkRootTransXClearMode() { return field_0x2f99 & 1; }
bool checkRootTransYClearMode() { return field_0x2f99 & 2; }
s16 checkWindStoneHowl() {return mProcVar3.field_0x300e.y; }
s16 checkWindStoneHowl() {return mProcVar4.field_0x3010; }
u8 getCorrectCurveID() { return mZ2WolfHowlMgr.getCorrectCurveID(); }
u8 getCorrectLineNum() { return mZ2WolfHowlMgr.getCorrectLineNum(); }
u32 getWolfHowlTimer() { return mZ2WolfHowlMgr.getTimer(); }
s8 getOnLineNum() { return mZ2WolfHowlMgr.getOnLineNum(); }
SongNote getCorrectLine(u8 param_0) { return mZ2WolfHowlMgr.getCorrectLine(param_0); }
J3DModelData* getItemModelData() { return mpItemModelData; }

cXyz* getIronBallChainPos() const { return mIronBallChainPos; }
csXyz* getIronBallChainAngle() const { return mIronBallChainAngle; }
int getIronBallHandChainNum() const { return mItemMode; }
const cXyz& getIronBallChainHandRootPos() const { return mHookshotTopPos; }

void itemHitSE(u32 param_1, u32 param_2, Z2SoundObjBase* param_3) { mZ2Link.startHitItemSE(param_1, param_2, param_3, -1.0f); }

Expand Down Expand Up @@ -3494,7 +3510,7 @@ class daAlink_c : public daPy_py_c {
/* 0x0072C */ J3DAnmTexPattern* field_0x072c;
/* 0x00730 */ mDoExt_bckAnm mItemBck;
/* 0x0074C */ mDoExt_bckAnm mHookTipBck;
/* 0x00768 */ J3DModelData* mpHookKusariModelData;
/* 0x00768 */ J3DModelData* mpItemModelData;
/* 0x0076C */ Z2SoundObjSimple* mpHookSound;
/* 0x00770 */ hsChainShape_c* mpHookChain;
/* 0x00774 */ dBgS_AcchCir* field_0x0774;
Expand Down Expand Up @@ -3652,7 +3668,7 @@ class daAlink_c : public daPy_py_c {
/* 0x02FA5 */ u8 mPolySound;
/* 0x02FA6 */ u8 field_0x2fa6;
/* 0x02FA7 */ u8 field_0x2fa7;
/* 0x02FA8 */ u8 field_0x2fa8;
/* 0x02FA8 */ u8 mGndPolySpecialCode;
/* 0x02FA9 */ u8 mWolfEyeUpTimer;
/* 0x02FAA */ u8 mRideStatus;
/* 0x02FAB */ u8 field_0x2fab;
Expand Down Expand Up @@ -3733,14 +3749,21 @@ class daAlink_c : public daPy_py_c {
} /* 0x03008 */ mProcVar0;
union {
s16 field_0x300a;
s16 mBoardSwordChargeTime;
} /* 0x0300A */ mProcVar1;
union {
s16 field_0x300c;
s16 mPuzzleAimAngle;
} /* 0x0300C */ mProcVar2;
union {
SVec field_0x300e;
s16 field_0x300e;
} /* 0x0300E */ mProcVar3;
union {
s16 field_0x3010;
} /* 0x03010 */ mProcVar4;
union {
s16 field_0x3012;
} /* 0x03012 */ mProcVar5;
/* 0x03014 */ s16 mFallVoiceInit;
/* 0x03016 */ u8 field_0x3016[2];
union {
Expand Down Expand Up @@ -4049,6 +4072,16 @@ static bool daAlink_checkLightBallA(fopAc_ac_c* p_actor);
static bool daAlink_checkLightBallB(fopAc_ac_c* p_actor);
static fopAc_ac_c* daAlink_searchCoach(fopAc_ac_c* param_0, void* param_1);

struct daAlink_cutParamTbl {
/* 0x0 */ daAlink_c::daAlink_ANM m_anmID;
/* 0x4 */ int field_0x4;
/* 0x8 */ u8 m_cutType;
/* 0x9 */ u8 m_atSe;
/* 0xA */ u8 field_0xa;
/* 0xB */ u8 field_0xb;
/* 0xC */ f32 m_morf;
}; // Size: 0x10

struct daAlinkHIO_anm_c {
/* 0x00 */ s16 mEndFrame;
/* 0x04 */ f32 mSpeed;
Expand Down
2 changes: 2 additions & 0 deletions include/d/actor/d_a_obj_chandelier.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class daObjChandelier_c : public dBgS_MoveBgActor, public request_of_phase_proce
u8 getSW_0() { return fopAcM_GetParamBit(this, 4, 8); }
s32 getArg_0() { return fopAcM_GetParamBit(this, 0, 4); }

void moveHookOn() { field_0x60a = 1; }

private:
/* 0x5A8 */ cXyz field_0x5a8;
/* 0x5B4 */ Mtx mMtx;
Expand Down
50 changes: 35 additions & 15 deletions include/d/actor/d_a_obj_iceleaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@
*/
class daObjIceLeaf_c : public fopAc_ac_c {
public:
enum daObjIceLeaf_MODE {
MODE_DROP_WAIT_e,
MODE_DROP_e,
MODE_PLAYER_WAIT_e,
MODE_RIDE_e,
};

enum daObjIceLeaf_ACTION {
ACT_WAIT_e,
ACT_ORDER_EVENT_e,
ACT_EVENT_e,
ACT_DEAD_e,
};

/* 80C24738 */ void initBaseMtx();
/* 80C24774 */ void setBaseMtx();
/* 80C249E4 */ void Create();
/* 80C249E4 */ int Create();
/* 80C24BC4 */ void setAnmPos();
/* 80C24C9C */ void CreateHeap();
/* 80C24E14 */ void create();
/* 80C25158 */ void execute();
/* 80C24C9C */ int CreateHeap();
/* 80C24E14 */ int create();
/* 80C25158 */ int execute();
/* 80C25360 */ void action();
/* 80C2541C */ void modeDropWait();
/* 80C25614 */ void modeDrop();
Expand All @@ -33,13 +47,19 @@ class daObjIceLeaf_c : public fopAc_ac_c {
/* 80C25A68 */ void actionEvent();
/* 80C25AC4 */ void actionDead();
/* 80C25AC8 */ void setFallSE();
/* 80C25BB8 */ void draw();
/* 80C25C50 */ void _delete();
/* 80C25BB8 */ int draw();
/* 80C25C50 */ int _delete();

void offRide() { mRide = false; }
void onRide() { mRide = true; }
void setBreakEffect() { mBreakEffect = true; }
void deleteActor() { field_0x961 = 1; }
void deleteActor() { mDeleteActor = true; }
void setAction(u8 i_action) { mAction = i_action; }
void setMode(u8 i_mode) { mMode = i_mode; }

u8 getEvId() { return fopAcM_GetParamBit(this, 0, 8); }
u8 checkRideStatus() { return fopAcM_GetParamBit(this, 0x10, 8); }
u8 getSwbit() { return fopAcM_GetParamBit(this, 8, 8); }

private:
/* 0x568 */ request_of_phase_process_class mPhase;
Expand All @@ -49,18 +69,18 @@ class daObjIceLeaf_c : public fopAc_ac_c {
/* 0x78C */ dCcD_Stts mStts;
/* 0x7C8 */ dCcD_Cyl mCyl;
/* 0x904 */ mDoExt_bckAnm* mpBck;
/* 0x908 */ J3DTransformInfo field_0x908;
/* 0x928 */ u8 mAction;
/* 0x929 */ u8 field_0x929;
/* 0x92A */ u8 field_0x92a;
/* 0x908 */ J3DTransformInfo mTransformInfo;
/* 0x928 */ u8 mMode;
/* 0x929 */ u8 mAction;
/* 0x92A */ u8 mEvId;
/* 0x92B */ u8 field_0x92b;
/* 0x92C */ s16 mEventID;
/* 0x930 */ Mtx field_0x930;
/* 0x930 */ Mtx mMtx;
/* 0x960 */ u8 mRide;
/* 0x961 */ u8 field_0x961;
/* 0x961 */ u8 mDeleteActor;
/* 0x962 */ u8 mBreakEffect;
/* 0x964 */ cXyz field_0x964;
/* 0x970 */ cXyz field_0x970;
/* 0x964 */ cXyz mFallSEPos;
/* 0x970 */ cXyz mFallStartSEPos;
};

STATIC_ASSERT(sizeof(daObjIceLeaf_c) == 0x97c);
Expand Down
1 change: 1 addition & 0 deletions include/d/actor/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ class daPy_py_c : public fopAc_ac_c {
bool checkSwimUp() const { return checkNoResetFlg0(FLG0_SWIM_UP); }
BOOL checkHorseZelda() const { return checkNoResetFlg2(FLG2_HORSE_ZELDA); }
BOOL checkSpecialHorseRide() { return checkNoResetFlg2(daPy_FLG2(FLG2_HORSE_ZELDA | FLG2_UNK_1000000 | FLG2_UNK_800000)); }
BOOL checkBoardNoFootAngle() const { return checkResetFlg1(RFLG1_UNK_40); }

void onBossRoomWait() { onEndResetFlg0(ERFLG0_BOSS_ROOM_WAIT); }
void onBeeFollow() { onEndResetFlg0(ERFLG0_BEE_FOLLOW); }
Expand Down
7 changes: 7 additions & 0 deletions include/d/d_bg_w_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class dBgS_SphChk;
class dBgS_SplGrpChk;
class fopAc_ac_c;

enum dBgW_SpecialCode {
dBgW_SPCODE_NORMAL,
dBgW_SPCODE_LIGHT_SNOW = 5,
dBgW_SPCODE_HEAVY_SNOW = 6,
dBgW_SPCODE_ICE = 8,
};

class dBgW_Base : public cBgW_BgId {
public:
enum PushPullLabel {
Expand Down
4 changes: 2 additions & 2 deletions include/d/d_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class dDemo_system_c : public JStage::TSystem {
dDemo_system_c() { mpObject = NULL; }

/* 80039AAC */ virtual ~dDemo_system_c();
/* 80039528 */ virtual bool JSGFindObject(JStage::TObject**, char const*,
/* 80039528 */ virtual int JSGFindObject(JStage::TObject**, char const*,
JStage::TEObject) const;

void setObject(dDemo_object_c* i_object) { mpObject = i_object; }
Expand All @@ -131,7 +131,7 @@ class dDemo_particle_c : public JStudio_JParticle::TCreateObject {
: JStudio_JParticle::TCreateObject(p_emitMgr, p_system) {}

/* 80039F9C */ virtual ~dDemo_particle_c();
/* 80039F1C */ virtual void emitter_create(u32);
/* 80039F1C */ virtual JPABaseEmitter* emitter_create(u32);
};

class dDemo_light_c : public JStage::TLight {
Expand Down
4 changes: 1 addition & 3 deletions include/m_Do/m_Do_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef struct Vec Vec;
struct ResTIMG;

struct mDoLib_clipper {
/* 8001528C */ void setup(f32, f32, f32, f32);
/* 8001528C */ static void setup(f32, f32, f32, f32);

static void changeFar(f32 far) {
mClipper.setFar(far);
Expand All @@ -32,8 +32,6 @@ struct mDoLib_clipper {
mClipper.calcViewFrustum();
}

static void setup(f32, f32, f32, f32);

static J3DUClipper mClipper;
static f32 mSystemFar;
static f32 mFovyRate;
Expand Down
Loading

0 comments on commit 0652b2c

Please sign in to comment.