Skip to content
Open
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
10 changes: 5 additions & 5 deletions config/SOUE01/rels/d_a_obj_bellNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ __dt__23sFState_c<10dAcObell_c>Fv = .text:0x000001E0; // type:function size:0x58
__dt__26sFStateFct_c<10dAcObell_c>Fv = .text:0x00000240; // type:function size:0x6C
__dt__79sStateMgr_c<10dAcObell_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000002B0; // type:function size:0xA0
__dt__49sFStateMgr_c<10dAcObell_c,20sStateMethodUsr_FI_c>Fv = .text:0x00000350; // type:function size:0xA4
AcObell__initModels = .text:0x00000400; // type:function size:0xFC
AcObell__init = .text:0x00000500; // type:function size:0x1A4
createHeap__10dAcObell_cFv = .text:0x00000400; // type:function size:0xFC
create__10dAcObell_cFv = .text:0x00000500; // type:function size:0x1A4
changeState__79sStateMgr_c<10dAcObell_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x000006B0; // type:function size:0x10
fn_417_6C0 = .text:0x000006C0; // type:function size:0x8
AcObell__update = .text:0x000006D0; // type:function size:0x10C
doDelete__10dAcObell_cFv = .text:0x000006C0; // type:function size:0x8
execute__10dAcObell_cFv = .text:0x000006D0; // type:function size:0x10C
executeState__79sStateMgr_c<10dAcObell_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000007E0; // type:function size:0x10
AcObell__draw = .text:0x000007F0; // type:function size:0x28
draw__10dAcObell_cFv = .text:0x000007F0; // type:function size:0x28
initializeState_Wait__10dAcObell_cFv = .text:0x00000820; // type:function size:0xC
executeState_Wait__10dAcObell_cFv = .text:0x00000830; // type:function size:0x17C
finalizeState_Wait__10dAcObell_cFv = .text:0x000009B0; // type:function size:0x4
Expand Down
4 changes: 2 additions & 2 deletions config/SOUE01/rels/d_a_obj_dormitory_gateNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ __dt__35sFStateFct_c<19dAcODormitoryGate_c>Fv = .text:0x00000290; // type:functi
__dt__88sStateMgr_c<19dAcODormitoryGate_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000300; // type:function size:0xA0
__dt__58sFStateMgr_c<19dAcODormitoryGate_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003A0; // type:function size:0xA4
fn_534_450 = .text:0x00000450; // type:function size:0x40
AcODormitoryGate__initModels = .text:0x00000490; // type:function size:0x238
fn_534_6D0 = .text:0x000006D0; // type:function size:0x2BC
createHeap__19dAcODormitoryGate_cFv = .text:0x00000490; // type:function size:0x238
create__19dAcODormitoryGate_cFv = .text:0x000006D0; // type:function size:0x2BC
changeState__88sStateMgr_c<19dAcODormitoryGate_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000990; // type:function size:0x10
fn_534_9A0 = .text:0x000009A0; // type:function size:0x8
fn_534_9B0 = .text:0x000009B0; // type:function size:0xEC
Expand Down
30 changes: 15 additions & 15 deletions config/SOUE01/rels/d_a_obj_flagNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ _epilog = .text:0x00000030; // type:function size:0x2C scope:global
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
fn_552_F0 = .text:0x000000F0; // type:function size:0x40
__dt__7mVec3_cFv = .text:0x000000F0; // type:function size:0x40
dAcOFlag_c_classInit__Fv = .text:0x00000130; // type:function size:0x110
__dt__23sFState_c<10dAcOFlag_c>Fv = .text:0x00000240; // type:function size:0x58
__dt__26sFStateFct_c<10dAcOFlag_c>Fv = .text:0x000002A0; // type:function size:0x6C
__dt__79sStateMgr_c<10dAcOFlag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000310; // type:function size:0xA0
__dt__49sFStateMgr_c<10dAcOFlag_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003B0; // type:function size:0xA4
fn_552_460 = .text:0x00000460; // type:function size:0x40
fn_552_4A0 = .text:0x000004A0; // type:function size:0x40
fn_552_4E0 = .text:0x000004E0; // type:function size:0x4
fn_552_4F0 = .text:0x000004F0; // type:function size:0x3AC
fn_552_8A0 = .text:0x000008A0; // type:function size:0x290
__ct__7mVec3_cFv = .text:0x000004E0; // type:function size:0x4
createHeap__10dAcOFlag_cFv = .text:0x000004F0; // type:function size:0x3AC
actorCreate__10dAcOFlag_cFv = .text:0x000008A0; // type:function size:0x290
changeState__79sStateMgr_c<10dAcOFlag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000B30; // type:function size:0x10
fn_552_B40 = .text:0x00000B40; // type:function size:0x1A4
fn_552_CF0 = .text:0x00000CF0; // type:function size:0x8
fn_552_D00 = .text:0x00000D00; // type:function size:0x178
actorPostCreate__10dAcOFlag_cFv = .text:0x00000B40; // type:function size:0x1A4
doDelete__10dAcOFlag_cFv = .text:0x00000CF0; // type:function size:0x8
actorExecute__10dAcOFlag_cFv = .text:0x00000D00; // type:function size:0x178
executeState__79sStateMgr_c<10dAcOFlag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000E80; // type:function size:0x10
fn_552_E90 = .text:0x00000E90; // type:function size:0x28
draw__10dAcOFlag_cFv = .text:0x00000E90; // type:function size:0x28
initializeState_Wait__10dAcOFlag_cFv = .text:0x00000EC0; // type:function size:0x4
executeState_Wait__10dAcOFlag_cFv = .text:0x00000ED0; // type:function size:0x2C
finalizeState_Wait__10dAcOFlag_cFv = .text:0x00000F00; // type:function size:0x4
Expand All @@ -34,13 +34,13 @@ fn_552_2EA0 = .text:0x00002EA0; // type:function size:0xB0
fn_552_2F50 = .text:0x00002F50; // type:function size:0x48
fn_552_2FA0 = .text:0x00002FA0; // type:function size:0x414
fn_552_33C0 = .text:0x000033C0; // type:function size:0x414
fn_552_37E0 = .text:0x000037E0; // type:function size:0x184
fn_552_3970 = .text:0x00003970; // type:function size:0x53C
fn_552_3EB0 = .text:0x00003EB0; // type:function size:0x4C
fn_552_3F00 = .text:0x00003F00; // type:function size:0x4C
fn_552_3F50 = .text:0x00003F50; // type:function size:0x44
fn_552_3FA0 = .text:0x00003FA0; // type:function size:0x24
fn_552_3FD0 = .text:0x00003FD0; // type:function size:0x24
setCollider__10dAcOFlag_cFv = .text:0x000037E0; // type:function size:0x184
createPlacement__10dAcOFlag_cFv = .text:0x00003970; // type:function size:0x53C
getArcName__10dAcOFlag_cFv = .text:0x00003EB0; // type:function size:0x4C
getMdlName__10dAcOFlag_cFv = .text:0x00003F00; // type:function size:0x4C
getAnmTexSrtName__10dAcOFlag_cFv = .text:0x00003F50; // type:function size:0x44
isSail__10dAcOFlag_cFv = .text:0x00003FA0; // type:function size:0x24
isPurpleFlag__10dAcOFlag_cFv = .text:0x00003FD0; // type:function size:0x24
fn_552_4000 = .text:0x00004000; // type:function size:0x90
__dt__10dAcOFlag_cFv = .text:0x00004090; // type:function size:0xF4
getStateID__79sStateMgr_c<10dAcOFlag_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00004190; // type:function size:0x10
Expand Down
1 change: 1 addition & 0 deletions include/d/a/d_a_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class dAcBase_c : public dBase_c {
public:
enum AcProperties_e {
AC_PROP_0x1 = (1 << 0),
AC_PROP_0x2 = (1 << 1),
AC_PROP_0x4 = (1 << 2),
AC_PROP_0x100 = (1 << 8),
AC_PROP_0x400 = (1 << 10),
Expand Down
9 changes: 6 additions & 3 deletions include/d/a/obj/d_a_obj_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,17 @@ class dAcObjBase_c : public dAcBase_c {
return result; \
} while (0)

// Use this in actors' create functions
#define CREATE_ALLOCATOR(className) \
#define CREATE_ALLOCATOR_SIZE(className, size) \
do { \
if (!initAllocatorWork1Heap(-1, #className "::m_allocator", 0x20)) { \
if (!initAllocatorWork1Heap(size, #className "::m_allocator", 0x20)) { \
return FAILED; \
} \
} while (0)

// Use this in actors' create functions
#define CREATE_ALLOCATOR(className) CREATE_ALLOCATOR_SIZE(className, -1)
#define CREATE_ALLOCATOR_UNCHECKED(className) initAllocatorWork1Heap(-1, #className "::m_allocator", 0x20)

class dAcObjRef_unk {
public:
dAcObjRef_unk(dAcObjBase_c *ref) : mObj(nullptr), refOwner(ref) {}
Expand Down
24 changes: 22 additions & 2 deletions include/d/a/obj/d_a_obj_bell.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,39 @@
#define D_A_OBJ_BELL_H

#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_w.h"
#include "d/col/cc/d_cc_d.h"
#include "m/m3d/m_smdl.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_State.hpp"
#include "toBeSorted/dowsing_target.h"

class dAcObell_c : public dAcObjBase_c {
public:
dAcObell_c() : mStateMgr(*this) {}
dAcObell_c() : mStateMgr(*this), mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dAcObell_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorExecute() override;

STATE_FUNC_DECLARE(dAcObell_c, Wait);
STATE_FUNC_DECLARE(dAcObell_c, WaitRupee);
STATE_FUNC_DECLARE(dAcObell_c, After);

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcObell_c);
/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mMdl;
/* 0x350 */ dBgW mBgW;
/* 0x560 */ dCcD_Sph mSph;
/* 0x6B0 */ STATE_MGR_DECLARE(dAcObell_c);
/* 0x6EC */ DowsingTarget mDowsingTarget;
/* 0x70C */ mVec3_c mRupeeDir;
/* 0x718 */ mVec3_c field_0x718;
/* 0x### */ // More
};

#endif
44 changes: 42 additions & 2 deletions include/d/a/obj/d_a_obj_dormitory_gate.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,58 @@
#define D_A_OBJ_DORMITORY_GATE_H

#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_w.h"
#include "m/m3d/m_anmmatclr.h"
#include "m/m3d/m_smdl.h"
#include "m/m_mtx.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_State.hpp"
#include "toBeSorted/stage_render_stuff.h"

class dAcODormitoryGate_c : public dAcObjBase_c {
public:
dAcODormitoryGate_c() : mStateMgr(*this) {}
enum Type_e {
TYPE_GATE = 0,
TYPE_GODDOOR = 1,
TYPE_SHUTTER = 2,
TYPE_GATE_F400 = 3,
};
dAcODormitoryGate_c() : mStateMgr(*this), mScnCallback(this) {}
virtual ~dAcODormitoryGate_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorExecute() override;

STATE_FUNC_DECLARE(dAcODormitoryGate_c, Wait);
STATE_FUNC_DECLARE(dAcODormitoryGate_c, End);

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcODormitoryGate_c);
/** Sets the parameter for Door to be open/closed physically */
void fn_534_C80();

/** Sets the Door open/closed physically */
void fn_534_D40();

bool checkOpenFlag();

/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mMdls[2];
/* 0x36C */ m3d::anmMatClr_c mAnmMatClr;
/* 0x398 */ dBgW mCollision[2];
/* 0x7B8 */ STATE_MGR_DECLARE(dAcODormitoryGate_c);
/* 0x7F4 */ mMtx_c mDoorMtx[2];
/* 0x854 */ Type_e mSubtype;
/* 0x858 */ u8 mNumDoors;
/* 0x85C */ f32 mShutterHeight;
/* 0x860 */ mAng mGateAngle;
/* 0x862 */ bool mIsOpen;
/* 0x863 */ u8 _0x863[0x865 - 0x863];
/* 0x865 */ u8 mGodDoorSomething;
/* 0x868 */ dScnCallback_c mScnCallback;
/* 0x874 */ u16 mStoryflag;
};

#endif
54 changes: 52 additions & 2 deletions include/d/a/obj/d_a_obj_flag.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,68 @@
#ifndef D_A_OBJ_FLAG_H
#define D_A_OBJ_FLAG_H

#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/cc/d_cc_d.h"
#include "m/m3d/m_anmtexsrt.h"
#include "m/m3d/m_smdl.h"
#include "m/m_vec.h"
#include "nw4r/g3d/g3d_scnobj.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_State.hpp"

class dAcODesertAgo_c;
class dAcOFlag_c : public dAcObjBase_c {
public:
dAcOFlag_c() : mStateMgr(*this) {}
class callback_c : public nw4r::g3d::IScnObjCallback {
public:
callback_c(dAcObjBase_c *arg) : mpActor(arg) {}
/* 0x04 */ dAcObjBase_c *mpActor;
};
dAcOFlag_c() : mResFile(nullptr), mStateMgr(*this), mCallback(this) {}
virtual ~dAcOFlag_c() {}

virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;

STATE_FUNC_DECLARE(dAcOFlag_c, Wait);

void setCollider();
void createPlacement();

bool isSail();
bool isPurpleFlag();
const char *getArcName();
const char *getMdlName();
const char *getAnmTexSrtName();

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcOFlag_c);
/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mMdl;
/* 0x350 */ m3d::anmTexSrt_c mAnmTexSrt;
/* 0x37C */ dCcD_Cps mCps;
/* 0x4EC */ STATE_MGR_DECLARE(dAcOFlag_c);
/* 0x528 */ callback_c mCallback;
/* 0x530 */ s32 field_0x530;
/* 0x534 */ s32 mNumJoints;
/* 0x538 */ mVec3_c *mpJoints;
/* 0x53C */ mVec3_c field_0x53C;
/* 0x548 */ s32 field_0x548;
/* 0x54C */ dAcRef_c<dAcODesertAgo_c> mDesertAgoRef;
/* 0x558 */ s32 field_0x558;
/* 0x55C */ s32 field_0x55C;
/* 0x560 */ u8 field_0x560;
/* 0x561 */ u8 field_0x561;
/* 0x564 */ s32 field_0x564;
/* 0x568 */ f32 field_0x568;
/* 0x56C */ mVec3_c *mpJoints1; // Size 15
/* 0x570 */ mVec3_c *mpJoints2; // Size 15
/* 0x574 */ mVec3_c *mpJoints3; // Size 15
};

#endif
2 changes: 1 addition & 1 deletion include/d/flag/storyflag_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,7 @@ enum StoryFlags_e {
/** [Goddess Statue Opened]
* Story Flag #672 (0x02A0) - JP 805ACDA0 0x02 / US 805A9B20 0x02
*/
STORYFLAG_672,
STORYFLAG_GODDESS_STATUE_ACCESS,

/** [Set when Scrapper picks up Oolo]
* Story Flag #673 (0x02A1) - JP 805ACDA0 0x04 / US 805A9B20 0x04
Expand Down
2 changes: 1 addition & 1 deletion include/nw4r/g3d/res/g3d_resnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ResNode : public ResCommon<ResNodeData>, public ResNodeDataTypedef {
}

const math::VEC3 &GetTranslate() const {
return ref().translate;
return *(const math::VEC3 *)&ref().translate;
}

// not in the dwarf
Expand Down
4 changes: 1 addition & 3 deletions src/REL/d/a/npc/d_a_npc_rival_lod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ bool dAcNpcRivalLOD_c::createHeap() {
return true;
}
int dAcNpcRivalLOD_c::create() {
if (!initAllocatorWork1Heap(-1, "dAcNpcRivalLOD_c::m_allocator", 0x20)) {
return FAILED;
}
CREATE_ALLOCATOR(dAcNpcRivalLOD_c);
0.0f; // float order, cool
mAcceleration = -1.0f;
mMaxSpeed = -40.0f;
Expand Down
1 change: 0 additions & 1 deletion src/REL/d/a/obj/d_a_obj_barrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "m/m_mtx.h"
#include "m/m_quat.h"
#include "m/m_vec.h"
#include "math.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "nw4r/math/math_arithmetic.h"
#include "rvl/MTX/mtxvec.h"
Expand Down
60 changes: 60 additions & 0 deletions src/REL/d/a/obj/d_a_obj_bell.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,71 @@
#include "d/a/obj/d_a_obj_bell.h"

#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_plc.h"
#include "d/col/bg/d_bg_s.h"
#include "d/col/bg/d_bg_w.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_stage.h"
#include "f/f_base.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "toBeSorted/arc_managers/current_stage_arc_manager.h"
#include "toBeSorted/dowsing_target.h"

SPECIAL_ACTOR_PROFILE(OBJ_BELL, dAcObell_c, fProfile::OBJ_BELL, 0x208, 0, 2);

STATE_DEFINE(dAcObell_c, Wait);
STATE_DEFINE(dAcObell_c, WaitRupee);
STATE_DEFINE(dAcObell_c, After);

static dCcD_SrcSph sSrcSph = {
// TODO
};

bool dAcObell_c::createHeap() {
mResFile = nw4r::g3d::ResFile(CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres"));
dStage_c::bindStageResToFile(&mResFile);
dStage_c::bindSkyCmnToResFile(&mResFile);

nw4r::g3d::ResMdl resMdl = mResFile.GetResMdl("StageF000Bell");
TRY_CREATE(mMdl.create(resMdl, &mAllocator, 0x120));

cBgD_t *dzb = (cBgD_t *)CurrentStageArcManager::GetInstance()->getData("dzb/StageF000Bell.dzb");
PLC *plc = (PLC *)CurrentStageArcManager::GetInstance()->getData("dat/StageF000Bell.plc");
updateMatrix();

TRY_CREATE(!(BOOL)mBgW.Set(dzb, plc, 1, &mWorldMtx, &mScale));

return true;
}

int dAcObell_c::create() {
CREATE_ALLOCATOR(dAcObell_c);

mBgW.SetCrrFunc(dBgS_MoveBGProc_Typical);
dBgS::GetInstance()->Regist(&mBgW, this);

mStts.SetRank(13);
mSph.Set(sSrcSph);
mSph.SetStts(mStts);

mRupeeDir = mVec3_c(0.f, -300.f, 0.f);
field_0x718 = mVec3_c(0.f, -210.f, 0.f);

mDowsingTarget.initialize(DowsingTarget::SLOT_RUPEE, 0, nullptr, 0.f);
mDowsingTarget.doRegister();
mDowsingTarget.setOffset(mVec3_c::Ey * -150.f);

mStateMgr.changeState(StateID_Wait);

mMdl.setPriorityDraw(0x1C, 9);
mBoundingBox.Set(mVec3_c(-160.f, -320.f, -160.f), mVec3_c(160.f, 10.f, 160.f));
mCullingDistance = 50000.f;
return SUCCEEDED;
}

void dAcObell_c::initializeState_Wait() {}
void dAcObell_c::executeState_Wait() {}
void dAcObell_c::finalizeState_Wait() {}
Expand Down
Loading
Loading