Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions config/SOUE01/rels/d_a_obj_windmillNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ lbl_374_data_178 = .data:0x00000178; // type:object size:0x18 scope:local
lbl_374_data_190 = .data:0x00000190; // type:object size:0x198 scope:local
__vt__29sFStateID_c<14dAcOwindmill_c> = .data:0x00000328; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_374_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local data:4byte
AcOwindmill__STATE_WAIT = .bss:0x00000018; // type:object size:0x40 data:4byte
AcOwindmill__STATE_CAMERA_MOVE = .bss:0x00000058; // type:object size:0x40 data:4byte
AcOwindmill__STATE_MOVE = .bss:0x00000098; // type:object size:0x80 data:4byte
AcOwindmill__STATE_COLLECT_STICK = .bss:0x00000118; // type:object size:0x30 data:4byte
@25601 = .bss:0x00000008; // type:object size:0xC scope:local data:4byte
StateID_Wait__14dAcOwindmill_c = .bss:0x00000018; // type:object size:0x30 data:4byte
@25609 = .bss:0x00000048; // type:object size:0xC scope:local data:4byte
StateID_CameraMove__14dAcOwindmill_c = .bss:0x00000058; // type:object size:0x30 data:4byte
@25613 = .bss:0x00000088; // type:object size:0xC scope:local data:4byte
StateID_Move__14dAcOwindmill_c = .bss:0x00000098; // type:object size:0x30 data:4byte
@25613 = .bss:0x000000C8; // type:object size:0xC scope:local data:4byte
StateID_Collect__14dAcOwindmill_c = .bss:0x000000D8; // type:object size:0x30 data:4byte
@25617 = .bss:0x00000108; // type:object size:0xC scope:local data:4byte
StateID_CollectStick__14dAcOwindmill_c = .bss:0x00000118; // type:object size:0x30 data:4byte
2 changes: 1 addition & 1 deletion config/SOUE01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ d/a/obj/d_a_obj_boomerang.cpp:
.sdata start:0x805739D8 end:0x80573A30
.sbss start:0x80575900 end:0x80575908
.sdata2 start:0x8057C0F8 end:0x8057C180
.bss start:0x805B4BF0 end:0x805B4DD8
.bss start:0x805B4BE0 end:0x805B4DD8

d/a/obj/d_a_obj_fairy.cpp:
.text start:0x80265620 end:0x80268598 align:16
Expand Down
118 changes: 63 additions & 55 deletions config/SOUE01/symbols.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ def MatchingFor(*versions):
Rel(NonMatching, "d_a_obj_D3_dummy", "REL/d/a/obj/d_a_obj_D3_dummy.cpp"),
Rel(NonMatching, "d_a_obj_daynight", "REL/d/a/obj/d_a_obj_daynight.cpp"),
Rel(NonMatching, "d_a_obj_decoA", "REL/d/a/obj/d_a_obj_decoA.cpp"),
Rel(NonMatching, "d_a_obj_decoB", "REL/d/a/obj/d_a_obj_decoB.cpp"),
Rel(Matching, "d_a_obj_decoB", "REL/d/a/obj/d_a_obj_decoB.cpp"),
Rel(NonMatching, "d_a_obj_desert", "REL/d/a/obj/d_a_obj_desert.cpp"),
Rel(NonMatching, "d_a_obj_desert_ago", "REL/d/a/obj/d_a_obj_desert_ago.cpp"),
Rel(Matching, "d_a_obj_desert_debris", "REL/d/a/obj/d_a_obj_desert_debris.cpp"),
Expand Down
8 changes: 6 additions & 2 deletions include/d/a/d_a_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class dAcBase_c : public dBase_c {
AC_PROP_0x100 = (1 << 8),
AC_PROP_0x400 = (1 << 10),
AC_PROP_0x800 = (1 << 11),
AC_PROP_0x2000000 = (1 << 25),
AC_PROP_0x2000000 = (1 << 25), //< Force Loaded
AC_PROP_0x4000000 = (1 << 26),
AC_PROP_0x8000000 = (1 << 27),
AC_PROP_0x10000000 = (1 << 28),
Expand Down Expand Up @@ -166,10 +166,14 @@ class dAcBase_c : public dBase_c {
return mPosition.distance(to);
}

bool checkBeyondRadius(const mVec3_c &point, f32 radius) {
bool checkBeyondRadius(const mVec3_c &point, f32 radius) const {
return getSquareDistanceTo(point) > radius;
}

bool checkWithinRadius(const mVec3_c &point, f32 radius) const {
return (mPosition - point).squareMagXZ() < radius * radius;
}

u32 getRoomId() {
return mRoomID;
}
Expand Down
61 changes: 44 additions & 17 deletions include/d/a/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/d_a_item.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/c/c_bg_s_poly_info.h"
#include "d/d_player_mdl.h"
#include "m/m_angle.h"
Expand All @@ -12,6 +13,14 @@
#include "toBeSorted/file_manager.h"
#include "toBeSorted/minigame_mgr.h"

class dReferenceArr {
public:
/** Returns true if pObj is already present or if it was added */
bool Regist(dAcObjBase_c *pObj);

dAcRef_c<dAcObjBase_c> mObjRefs[16];
};

// See Below for some info
// https://github.com/lepelog/skywardsword-tools/wiki/Player-Actor

Expand All @@ -33,36 +42,53 @@ class dAcPy_c : public daPlayerModelBase_c {
/* vt 0x318 */ virtual void vt_0x318();

protected:
/* 0x137C */ u8 _0x137C[0x16F0 - 0x137C];
/* 0x137C */ dReferenceArr mOwnedObjects; //< Made up name
/* 0x143C */ u8 _0x143C[0x16F0 - 0x143C];
/* 0x16F0 */ nw4r::g3d::ResFile mHeldResFile;
/* 0x16F4 */ u8 _0x16F4[0x4564 - 0x16F4];
/* 0x4564 */ f32 field_0x4564;

public:
// Beetle Functions [0x8021AA70 - 0x8021BE20]
s16 getBeetleFlightTime();
mAng getBeetleAngle0();
mAng getBeetleAngle1();
f32 getBeetleWingAngleActive();
f32 getBeetleWingAngleInactive();
f32 getBeetleNormalSpeed();
f32 getBeetleQuickSpeed();
f32 getBeetleMaxRange();
f32 getBeetleLargeRadius();
f32 getBeetleSmallRadius();
f32 getBeetleMaxHeightOffset();
mAng getBeetleSmallAngle0();
mAng getBeetleSmallAngle1();
mAng getBeetleBonkRecoilAngle();
mAng getBeetleSmallAngle2();
mAng fn_8023BA40(mAng p1, mAng p2) const;
bool unkBeetle_8021B040(dAcObjBase_c *);
s16 getBeetleFlightTime() const;
mAng getBeetleAngle0() const;
mAng getBeetleAngle1() const;
f32 getBeetleWingAngleActive() const;
f32 getBeetleWingAngleInactive() const;
f32 getBeetleNormalSpeed() const;
f32 getBeetleQuickSpeed() const;
f32 getBeetleMaxRange() const;
f32 getBeetleLargeRadius() const;
f32 getBeetleSmallRadius() const;
f32 getBeetleMaxHeightOffset() const;
mAng getBeetleSmallAngle0() const;
mAng getBeetleSmallAngle1() const;
mAng getBeetleBonkRecoilAngle() const;
mAng getBeetleSmallAngle2() const;
f32 getBeetle_8021B280() const;
f32 getBeetle_8021B290() const;
u8 getBeetle_8021B2A0() const;
void setBeetleFlashClr(const mColor &);
void setBeetleBackAnim();
s32 getBeetleWarningTimeLeft();
int getBeetleWarningTimeLeft() const;
s16 getBeetleUnkTimeLeft() const;
void setBeetleReleasedObject(dAcObjBase_c *pObj);
bool retrieveBeetle();

// Responsible for taking in some collision Poly Info and playing the related effect.
// Used on Impact
static void spawnItemHitEffect(const mVec3_c &position, const cBgS_PolyInfo &polyInfo, f32 scale);

// Item select/equip/use functions [0x801E3160 - 0x801E7AD0] ?
static s32 calcItemWheelSelection(bool reset, s32 numOptions);

public:
dReferenceArr &getOwnedObjects() {
return mOwnedObjects;
}

f32 getField_0x4564() const {
return field_0x4564;
}
Expand Down Expand Up @@ -128,6 +154,7 @@ class dAcPy_c : public daPlayerModelBase_c {

static u32 getCurrentHealthCapacity();

void setGuide(dAcObjBase_c *);
bool canDowseProbably() const;

mAng fn_8023B520() const;
Expand Down
4 changes: 2 additions & 2 deletions include/d/a/obj/d_a_obj_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class dAcObjBase_c : public dAcBase_c {
enum ObjProperties_e {
OBJ_PROP_0x1 = (1 << 0),
OBJ_PROP_0x2 = (1 << 1),
OBJ_PROP_0x4 = (1 << 2),
OBJ_PROP_0x4 = (1 << 2), //< Attached to Clawshot
OBJ_PROP_0x8 = (1 << 3),
OBJ_PROP_0x10 = (1 << 4),
OBJ_PROP_0x20 = (1 << 5),
Expand All @@ -39,7 +39,7 @@ class dAcObjBase_c : public dAcBase_c {
OBJ_PROP_0x200 = (1 << 9),
OBJ_PROP_0x400 = (1 << 10),
OBJ_PROP_0x800 = (1 << 11),
OBJ_PROP_0x1000 = (1 << 12),
OBJ_PROP_0x1000 = (1 << 12), //< Attached to Whip
OBJ_PROP_0x2000 = (1 << 13),
OBJ_PROP_0x4000 = (1 << 14),
OBJ_PROP_0x8000 = (1 << 15),
Expand Down
4 changes: 2 additions & 2 deletions include/d/a/obj/d_a_obj_bomb.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class dAcBomb_c : public dAcObjBase_c {

void setTransformFromFlower(const mMtx_c &);

void Off_0xA3C(u32 mask) {
void unsetField0xA3C(u32 mask) {
field_0xA3C &= ~mask;
}
void On_0xA3C(u32 mask) {
void setField0xA3C(u32 mask) {
field_0xA3C |= mask;
}

Expand Down
97 changes: 62 additions & 35 deletions include/d/a/obj/d_a_obj_boomerang.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
#include "d/col/bg/d_bg_s_lin_chk.h"
#include "d/col/c/c_bg_s_poly_info.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "d/lyt/d_lyt_fader.h"
#include "m/m3d/m_anmchr.h"
#include "m/m3d/m_anmchrblend.h"
#include "m/m3d/m_mdl.h"
#include "m/m_angle.h"
#include "m/m_color.h"
#include "m/m_fader.h"
#include "m/m_vec.h"
Expand Down Expand Up @@ -105,34 +107,33 @@ class dAcBoomerang_c : public dAcObjBase_c {
RB_FLY_FAST = 1,
RB_FLY_MAX = 2,
};
static const char *sFlyChrAnims[RB_FLY_MAX];

enum Flags_e {
/* 0x00000001 */ FLAG_CANCEL_1 = 1 << 0,
/* 0x00000002 */ FLAG_CANCEL_2 = 1 << 1,
/* 0x00000003 */ FLAG_CANCEL = FLAG_CANCEL_1 | FLAG_CANCEL_2,

/* 0x00000004 */ FLAG_RELEASE_ITEM = 1 << 2,
/* 0x00000008 */ FLAG_0x8 = (0x8),
/* 0x00000010 */ FLAG_0x10 = (0x10),
/* 0x00000020 */ FLAG_0x20 = (0x20),
/* 0x00000040 */ FLAG_0x40 = (0x40),
/* 0x00000080 */ FLAG_0x80 = (0x80),
/* 0x00000100 */ FLAG_STOP_TIMER_ACTIVE = (0x100),
/* 0x00000200 */ FLAG_DROP_ITEM = (0x200), // related to 0x400
/* 0x00000400 */ FLAG_REQUEST_0x400 = (0x400), // related to 0x200
/* 0x00000800 */ FLAG_REQUEST_MOVE = (0x800),
/* 0x00001000 */ FLAG_CONTROLLABLE = (0x1000),
/* 0x00002000 */ FLAG_0x2000 = (0x2000),
/* 0x00004000 */ FLAG_RUMBLE_ACTIVE = (0x4000),
/* 0x00008000 */ FLAG_WING_EFFECT_ACTIVE = (0x8000),
/* 0x00010000 */ FLAG_0x10000 = (0x10000),
/* 0x00020000 */ FLAG_0x20000 = (0x40000),
/* 0x00040000 */ FLAG_0x40000 = (0x40000),
/* 0x00080000 */ FLAG_0x80000 = (0x80000),

/* 0x0001A117 */ FLAG_COMMON_INIT = FLAG_0x10000 | FLAG_WING_EFFECT_ACTIVE | FLAG_0x2000 |
FLAG_STOP_TIMER_ACTIVE | FLAG_0x10 | FLAG_RELEASE_ITEM | FLAG_CANCEL,
/* 0x00000004 */ FLAG_RELEASE_OBJECT = 1 << 2,
/* 0x00000008 */ FLAG_0x8 = 1 << 3,
/* 0x00000010 */ FLAG_0x10 = 1 << 4,
/* 0x00000020 */ FLAG_0x20 = 1 << 5,
/* 0x00000040 */ FLAG_0x40 = 1 << 6,
/* 0x00000080 */ FLAG_0x80 = 1 << 7,
/* 0x00000100 */ FLAG_STOP_TIMER_ACTIVE = 1 << 8,
/* 0x00000200 */ FLAG_DROP_ITEM = 1 << 9, // related to 0x400
/* 0x00000400 */ FLAG_REQUEST_0x400 = 1 << 10, // related to 0x200
/* 0x00000800 */ FLAG_REQUEST_MOVE = 1 << 11,
/* 0x00001000 */ FLAG_CONTROLLABLE = 1 << 12,
/* 0x00002000 */ FLAG_0x2000 = 1 << 13,
/* 0x00004000 */ FLAG_RUMBLE_ACTIVE = 1 << 14,
/* 0x00008000 */ FLAG_SPEED_UP = 1 << 15,
/* 0x00010000 */ FLAG_0x10000 = 1 << 16,
/* 0x00020000 */ FLAG_0x20000 = 1 << 17,
/* 0x00040000 */ FLAG_0x40000 = 1 << 18,
/* 0x00080000 */ FLAG_0x80000 = 1 << 19,

/* 0x0001A117 */ FLAG_COMMON_INIT = FLAG_0x10000 | FLAG_SPEED_UP | FLAG_0x2000 | FLAG_STOP_TIMER_ACTIVE |
FLAG_0x10 | FLAG_RELEASE_OBJECT | FLAG_CANCEL,
};

public: // INLINES
Expand All @@ -149,6 +150,10 @@ class dAcBoomerang_c : public dAcObjBase_c {
return mStateMgr.isState(StateID_Move);
}

static const s32 getSrcFlags() {
return 0x209B;
}

public: // FUNCTIONS
void areaCallback(mVec3_c *param1, u32 param2);
void atHitCallback(cCcD_Obj *i_objInfA, dAcObjBase_c *i_actorB, cCcD_Obj *i_objInfB);
Expand All @@ -171,8 +176,35 @@ class dAcBoomerang_c : public dAcObjBase_c {
/** Updates the position based on where links wrist is */
void placeOnArm();

/** */
void fn_80261E10();

/** */
void fn_80262150();

/** */
void calcVelocity();

/** */
void playFlySound();

/** */
void startHitEffect(const mVec3_c &position, const cBgS_PolyInfo &polyInfo);

/** */
bool fn_80262400();

/** Gets the colliding position and the poly info of where collision happened. Returns a nullptr on no collision */
cBgS_PolyInfo *getCollidingPolyInfo(mVec3_c &position);

/** */
void fn_80262BE0();

/** */
void fn_80262DC0();

/** Sets the assuming bonk flag and plays the rumble feedback */
void bonk();
void startRumble();

/** Applies the selected animation to the beetle */
void setChrAnimation(ChrAnimation_e requestedAnimation);
Expand All @@ -190,8 +222,8 @@ class dAcBoomerang_c : public dAcObjBase_c {
/* 0x0330 */ nw4r::g3d::ResFile mResFile;
/* 0x0334 */ m3d::mdl_c mMdl;
/* 0x0358 */ m3d::anmChrBlend_c mAnmChrBlend;
#define BOOMERANG_ANIM_PINCERS (0)
#define BOOMERANG_ANIM_WINGS (1)
#define BOOMERANG_ANIM_PINCERS 0
#define BOOMERANG_ANIM_WINGS 1
/* 0x0380 */ m3d::anmChr_c mAnmChr[2]; /* 0 - Pincers, 1 - Wings*/
/* 0x03F0 */ dAcBoomerangProc_c mProc;
/* 0x0410 */ dShadowCircle_c mShadow;
Expand All @@ -208,19 +240,16 @@ class dAcBoomerang_c : public dAcObjBase_c {
/* 0x08B5 */ u8 mWindNodeID;
/* 0x08B6 */ u8 mLeftWingNodeID;
/* 0x08B7 */ u8 mRightWingNodeID;
/* 0x08B8 */ mAng field_0x8B8;
/* 0x08BA */ mAng field_0x8BA;
/* 0x08BC */ mAng field_0x8BC;
/* 0x08BE */ mAng field_0x8BE;
/* 0x08C0 */ u8 _0x8C0[0x8C8 - 0x8C0];
/* 0x08CA */ mAng field_0x8C8;
/* 0x08B8 */ mAng3_c field_0x8B8;
/* 0x08BE */ mAng3_c field_0x8BE;
/* 0x08C4 */ mAng3_c field_0x8C4;
/* 0x08CA */ u16 mRemainingFlightTime;
/* 0x08CC */ u32 field_0x8CC;
/* 0x08D0 */ f32 field_0x8D0;
/* 0x08D4 */ f32 field_0x8D4;
/* 0x08D8 */ mVec3_c field_0x8D8;
/* 0x08E4 */ mVec3_c field_0x8E4;
/* 0x08F0 */ mVec3_c field_0x8F0;
/* 0x08F0 */ mVec3_c mBounceVelocity;
/* 0x08FC */ dCcD_Sph mSph0;
/* 0x0A4C */ dCcD_Sph mSph1;
/* 0x0B9C */ dEmitter_c mEff0;
Expand All @@ -232,10 +261,8 @@ class dAcBoomerang_c : public dAcObjBase_c {
/* 0x1150 */ u8 _0x1150[0x115C - 0x1150];
/* 0x115C */ STATE_MGR_DECLARE(dAcBoomerang_c);

static const u32 BoomerangAtFlags;
static dCcD_SrcSph sSphSrc;
static const dCcD_SrcSph sSphSrc;
static dBgS_BeetleLinChk sLinChk;
static const u32 sSrcAtType;
};

#endif
5 changes: 4 additions & 1 deletion include/d/col/bg/d_bg_s_acch.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "d/col/c/c_m3d_g_cyl.h"
#include "d/col/c/c_m3d_g_lin.h"
#include "d/col/c/c_m3d_g_pla.h"
#include "m/m_angle.h"
#include "m/m_vec.h"

class dAcObjBase_c;

Expand Down Expand Up @@ -107,11 +109,13 @@ struct dBgS_Acch_0x1A8 {
u8 field_0x00;
mVec3_c field_0x04;
mVec3_c field_0x10;
mVec3_c field_0x1C;

dBgS_Acch_0x1A8();

void Init();
void CalcPos(mVec3_c *);
const mVec3_c &GetField_0x1C() const;
};

class dBgS;
Expand Down Expand Up @@ -568,7 +572,6 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
/* 0x0E8 */ f32 field_0x0E8;
/* 0x0EC */ dBgS_SphChk mSph;
/* 0x1A8 */ dBgS_Acch_0x1A8 field_0x1A8;
/* 0x1C4 */ u8 _0[0x1D0 - 0x1C4];
/* 0x1D0 */ f32 field_0x1D0;
/* 0x1D4 */ dBgS_GndChk mGnd;
/* 0x264 */ dBgS_RoofChk mRoof;
Expand Down
1 change: 1 addition & 0 deletions include/d/d_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class dCamera_c : public dBase_c {

bool isUnderwater() const;
f32 getUnderwaterDepth() const;
bool fn_8019E3C0() const;

void fn_8019E430();
void fn_8019E410();
Expand Down
Loading