Skip to content

Commit

Permalink
Halfway there
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Feb 27, 2025
1 parent 6269e82 commit b1f2d81
Show file tree
Hide file tree
Showing 10 changed files with 639 additions and 55 deletions.
3 changes: 3 additions & 0 deletions config/SOUE01/rels/d_a_obj_dungeon_shipNP/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ REL/global_destructor_chain.c:
REL/d/a/obj/d_a_obj_dungeon_ship.cpp:
.text start:0x000000F0 end:0x00002828
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x000000C4
.data start:0x00000000 end:0x00000388
.bss start:0x00000008 end:0x00000148
66 changes: 31 additions & 35 deletions config/SOUE01/rels/d_a_obj_dungeon_shipNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ __dt__30sFState_c<17dAcODungeonShip_c>Fv = .text:0x00000360; // type:function si
__dt__33sFStateFct_c<17dAcODungeonShip_c>Fv = .text:0x000003C0; // type:function size:0x6C
__dt__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000430; // type:function size:0xA0
__dt__56sFStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c>Fv = .text:0x000004D0; // type:function size:0xA4
AcODungeonShip__eventIn = .text:0x00000580; // type:function size:0xC
fn_485_58C = .text:0x0000058C; // type:function size:0x4
AcODungeonShip__eventEnd = .text:0x00000590; // type:function size:0xC
fn_485_59C = .text:0x0000059C; // type:function size:0x4
AcODungeonShip__initModels = .text:0x000005A0; // type:function size:0x208
AcODungeonShip__init = .text:0x000007B0; // type:function size:0x2B8
eventIn_Wrapper__17dAcODungeonShip_cFPv = .text:0x00000580; // type:function size:0x10
eventEnd_Wrapper__17dAcODungeonShip_cFPv = .text:0x00000590; // type:function size:0x10
createHeap__17dAcODungeonShip_cFv = .text:0x000005A0; // type:function size:0x208
create__17dAcODungeonShip_cFv = .text:0x000007B0; // type:function size:0x2B8
changeState__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000A70; // type:function size:0x10
AcODungeonShip__destroy = .text:0x00000A80; // type:function size:0x34
AcODungeonShip__update = .text:0x00000AC0; // type:function size:0x268
doDelete__17dAcODungeonShip_cFv = .text:0x00000A80; // type:function size:0x34
actorExecute__17dAcODungeonShip_cFv = .text:0x00000AC0; // type:function size:0x268
executeState__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000D30; // type:function size:0x10
AcODungeonShip__draw = .text:0x00000D40; // type:function size:0x38
draw__17dAcODungeonShip_cFv = .text:0x00000D40; // type:function size:0x38
initializeState_Wait__17dAcODungeonShip_cFv = .text:0x00000D80; // type:function size:0x4
executeState_Wait__17dAcODungeonShip_cFv = .text:0x00000D90; // type:function size:0xCC
finalizeState_Wait__17dAcODungeonShip_cFv = .text:0x00000E60; // type:function size:0x4
Expand All @@ -31,28 +29,26 @@ initializeState_AppearEvent__17dAcODungeonShip_cFv = .text:0x000011E0; // type:f
executeState_AppearEvent__17dAcODungeonShip_cFv = .text:0x00001260; // type:function size:0x31C
finalizeState_AppearEvent__17dAcODungeonShip_cFv = .text:0x00001580; // type:function size:0x4
initializeState_Appear__17dAcODungeonShip_cFv = .text:0x00001590; // type:function size:0xC
executeState_Appear__17dAcODungeonShip_cFv = .text:0x000015A0; // type:function size:0x10
fn_485_15B0 = .text:0x000015B0; // type:function size:0x4
executeState_Appear__17dAcODungeonShip_cFv = .text:0x000015A0; // type:function size:0x14
finalizeState_Appear__17dAcODungeonShip_cFv = .text:0x000015C0; // type:function size:0x4
initializeState_End__17dAcODungeonShip_cFv = .text:0x000015D0; // type:function size:0xC
executeState_End__17dAcODungeonShip_cFv = .text:0x000015E0; // type:function size:0x10
fn_485_15F0 = .text:0x000015F0; // type:function size:0x4
executeState_End__17dAcODungeonShip_cFv = .text:0x000015E0; // type:function size:0x14
finalizeState_End__17dAcODungeonShip_cFv = .text:0x00001600; // type:function size:0x4
fn_485_1610 = .text:0x00001610; // type:function size:0x4
fn_485_1620 = .text:0x00001620; // type:function size:0x3C
fn_485_1660 = .text:0x00001660; // type:function size:0xB4
fn_485_1720 = .text:0x00001720; // type:function size:0x110
eventIn__17dAcODungeonShip_cFv = .text:0x00001610; // type:function size:0x4
eventEnd__17dAcODungeonShip_cFv = .text:0x00001620; // type:function size:0x3C
fn_485_1660__17dAcODungeonShip_cFv = .text:0x00001660; // type:function size:0xB4
fn_485_1720__17dAcODungeonShip_cFv = .text:0x00001720; // type:function size:0x110
fn_485_1830 = .text:0x00001830; // type:function size:0xC8
fn_485_1900 = .text:0x00001900; // type:function size:0x58
fn_485_1900__17dAcODungeonShip_cFv = .text:0x00001900; // type:function size:0x58
fn_485_1960 = .text:0x00001960; // type:function size:0xE8
fn_485_1A50 = .text:0x00001A50; // type:function size:0xC
fn_485_1A60 = .text:0x00001A60; // type:function size:0xC
fn_485_1A70 = .text:0x00001A70; // type:function size:0x18
fn_485_1A90 = .text:0x00001A90; // type:function size:0x154
fn_485_1BF0 = .text:0x00001BF0; // type:function size:0x200
fn_485_1DF0 = .text:0x00001DF0; // type:function size:0xA0
AcODungeonShip__updateMatrixAndScale = .text:0x00001E90; // type:function size:0x44
fn_485_1EE0 = .text:0x00001EE0; // type:function size:0xE0
fn_485_1A90__17dAcODungeonShip_cFv = .text:0x00001A90; // type:function size:0x154
fn_485_1BF0__17dAcODungeonShip_cFv = .text:0x00001BF0; // type:function size:0x200
fn_485_1DF0__17dAcODungeonShip_cFv = .text:0x00001DF0; // type:function size:0xA0
updateMatrixAndScale__17dAcODungeonShip_cFv = .text:0x00001E90; // type:function size:0x44
fn_485_1EE0__17dAcODungeonShip_cFv = .text:0x00001EE0; // type:function size:0xE0
__dt__17dAcODungeonShip_cFv = .text:0x00001FC0; // type:function size:0x154
getStateID__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00002120; // type:function size:0x10
fn_485_2130 = .text:0x00002130; // type:function size:0x4
Expand Down Expand Up @@ -89,22 +85,22 @@ lbl_485_rodata_88 = .rodata:0x00000088; // type:object size:0x14 data:float
lbl_485_rodata_9C = .rodata:0x0000009C; // type:object size:0x14 data:float
lbl_485_rodata_B0 = .rodata:0x000000B0; // type:object size:0x8 data:float
lbl_485_rodata_B8 = .rodata:0x000000B8; // type:object size:0xC data:float
g_profile_OBJ_DUNGEON_SHIP = .data:0x00000000; // type:object size:0x3C data:4byte
g_profile_OBJ_DUNGEON_SHIP = .data:0x00000000; // type:object size:0x10 data:4byte
lbl_485_data_3C = .data:0x0000003C; // type:object size:0xC data:string
lbl_485_data_48 = .data:0x00000048; // type:object size:0x34
lbl_485_data_7C = .data:0x0000007C; // type:object size:0x4 data:4byte
lbl_485_data_80 = .data:0x00000080; // type:object size:0x4 data:4byte
lbl_485_data_84 = .data:0x00000084; // type:object size:0x4 data:4byte
AcODungeonShip__vtable = .data:0x00000088; // type:object size:0x80
lbl_485_data_108 = .data:0x00000108; // type:object size:0x30
lbl_485_data_138 = .data:0x00000138; // type:object size:0x30
lbl_485_data_168 = .data:0x00000168; // type:object size:0x18
lbl_485_data_180 = .data:0x00000180; // type:object size:0x1D4
lbl_485_data_354 = .data:0x00000354; // type:object size:0x34
__vt__17dAcODungeonShip_c = .data:0x00000088; // type:object size:0x80
__vt__56sFStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c> = .data:0x00000108; // type:object size:0x30
__vt__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000138; // type:object size:0x30
__vt__33sFStateFct_c<17dAcODungeonShip_c> = .data:0x00000168; // type:object size:0x14
__vt__30sFState_c<17dAcODungeonShip_c> = .data:0x00000180; // type:object size:0x18
__vt__32sFStateID_c<17dAcODungeonShip_c> = .data:0x00000354; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_485_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
AcODungeonShip__STATE_WAIT = .bss:0x00000018; // type:object size:0x40 data:4byte
AcODungeonShip__STATE_TRANSPARENCY = .bss:0x00000058; // type:object size:0x40 data:4byte
AcODungeonShip__STATE_APPEAR_EVENT = .bss:0x00000098; // type:object size:0x40 data:4byte
AcODungeonShip__STATE_APPEAR = .bss:0x000000D8; // type:object size:0x40 data:4byte
AcODungeonShip__STATE_END = .bss:0x00000118; // type:object size:0x30 data:4byte
StateID_Wait__17dAcODungeonShip_c = .bss:0x00000018; // type:object size:0x30 data:4byte
StateID_Transparency__17dAcODungeonShip_c = .bss:0x00000058; // type:object size:0x30 data:4byte
StateID_AppearEvent__17dAcODungeonShip_c = .bss:0x00000098; // type:object size:0x30 data:4byte
StateID_Appear__17dAcODungeonShip_c = .bss:0x000000D8; // type:object size:0x30 data:4byte
StateID_End__17dAcODungeonShip_c = .bss:0x00000118; // type:object size:0x30 data:4byte
18 changes: 11 additions & 7 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3527,8 +3527,8 @@ isAdvance__17ActorEventRelatedFv = .text:0x8009D020; // type:function size:0x34
advanceNext__17ActorEventRelatedFv = .text:0x8009D060; // type:function size:0x50
ActorEventRelated__getSingleIntData2 = .text:0x8009D0B0; // type:function size:0x8C
ActorEventRelated__getSingleIntData = .text:0x8009D140; // type:function size:0x8C
ActorEventRelated__getSingleFloatData = .text:0x8009D1D0; // type:function size:0x8C
ActorEventRelated__getSingleVec3f = .text:0x8009D260; // type:function size:0x9C
getSingleFloatData__17ActorEventRelatedFPfUlUl = .text:0x8009D1D0; // type:function size:0x8C
getSingleVecData__17ActorEventRelatedFP7mVec3_cUlUl = .text:0x8009D260; // type:function size:0x9C
ActorEventRelated__getIntDataWithDefault = .text:0x8009D300; // type:function size:0x98
ActorEventRelated__getSingleIntDataWithDefault = .text:0x8009D3A0; // type:function size:0x98
ActorEventRelated__getFloatDataWithDefault = .text:0x8009D440; // type:function size:0x98
Expand Down Expand Up @@ -3710,17 +3710,17 @@ SpecialActorOnRail__moveToTargetMaybe = .text:0x800A91E0; // type:function size:
fn_800A9370 = .text:0x800A9370; // type:function size:0x6C
fn_800A93E0 = .text:0x800A93E0; // type:function size:0x90
fn_800A9470 = .text:0x800A9470; // type:function size:0x74
ActorOnRail2__ctor = .text:0x800A94F0; // type:function size:0x60
ActorOnRail__dtor2 = .text:0x800A9550; // type:function size:0x58
ActorOnRail2__initWithSegment = .text:0x800A95B0; // type:function size:0x9C
__ct__15ActorOnRail_ExtFv = .text:0x800A94F0; // type:function size:0x60
__dt__15ActorOnRail_ExtFv = .text:0x800A9550; // type:function size:0x58
initExt__15ActorOnRail_ExtFiiiiifff = .text:0x800A95B0; // type:function size:0x9C
fn_800A9650 = .text:0x800A9650; // type:function size:0x208
fn_800A9860 = .text:0x800A9860; // type:function size:0x50
fn_800A98B0 = .text:0x800A98B0; // type:function size:0x58
fn_800A9910 = .text:0x800A9910; // type:function size:0x48
fn_800A9960 = .text:0x800A9960; // type:function size:0x8
fn_800A9970 = .text:0x800A9970; // type:function size:0x58
fn_800A99D0 = .text:0x800A99D0; // type:function size:0xE0
ActorOnRail2__setSegment = .text:0x800A9AB0; // type:function size:0x50
setSegment__15ActorOnRail_ExtFUsf = .text:0x800A9AB0; // type:function size:0x50
checkPosInAREA = .text:0x800A9B00; // type:function size:0xC4
getAreaForIndexInRoom__Fll = .text:0x800A9BD0; // type:function size:0x78
checkPosInArea__FllRC7mVec3_cPCP4AREA = .text:0x800A9C50; // type:function size:0xD4
Expand Down Expand Up @@ -29889,7 +29889,11 @@ lbl_80500B60 = .data:0x80500B60; // type:object size:0x40
lbl_80500BA0 = .data:0x80500BA0; // type:object size:0x30
lbl_80500BD0 = .data:0x80500BD0; // type:object size:0x48 data:4byte
lbl_80500C18 = .data:0x80500C18; // type:object size:0xC
lbl_80500C24 = .data:0x80500C24; // type:object size:0xB4
lbl_80500C24 = .data:0x80500C24; // type:object size:0xC
lbl_80500C30 = .data:0x80500C30; // type:object size:0x2C
__vt__15MdlWithTimeProc = .data:0x80500C5C; // type:object size:0x2C
__vt__8TimeProc = .data:0x80500C88; // type:object size:0x2C
__vt__14TimeCallback_c = .data:0x80500CB8; // type:object size:0x20
lbl_80500CD8 = .data:0x80500CD8; // type:object size:0x70
lbl_80500D48 = .data:0x80500D48; // type:object size:0x78
lbl_80500DC0 = .data:0x80500DC0; // type:object size:0x70
Expand Down
76 changes: 73 additions & 3 deletions include/d/a/obj/d_a_obj_dungeon_ship.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,93 @@
#ifndef D_A_OBJ_DUNGEON_SHIP_H
#define D_A_OBJ_DUNGEON_SHIP_H

#include "common.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_anmchr.h"
#include "m/m3d/m_anmmatclr.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/actor_event.h"
#include "toBeSorted/actor_on_rail.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/effects_struct.h"
#include "toBeSorted/time_proc.h"

class dAcODungeonShip_c : public dAcObjBase_c {
public:
dAcODungeonShip_c() : mStateMgr(*this, sStateID::null) {}
dAcODungeonShip_c()
: mStateMgr(*this, sStateID::null), mDowsingTarget(this, DowsingTarget::SLOT_NONE), mEvent(*this, nullptr) {}
virtual ~dAcODungeonShip_c() {}

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

STATE_FUNC_DECLARE(dAcODungeonShip_c, Wait);
STATE_FUNC_DECLARE(dAcODungeonShip_c, Transparency);
STATE_FUNC_DECLARE(dAcODungeonShip_c, AppearEvent);
STATE_FUNC_DECLARE(dAcODungeonShip_c, Appear);
STATE_FUNC_DECLARE(dAcODungeonShip_c, End);

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcODungeonShip_c);
static const f32 someFloats[18];

void updateMatrixAndScale();

void fn_485_1660();
void fn_485_1720();
u32 fn_485_1900();
u32 fn_485_1960();
void fn_485_1A90();
void fn_485_1BF0();
void fn_485_1DF0();
void fn_485_1EE0();

static void eventIn_Wrapper(void *arg);
void eventIn();
static void eventEnd_Wrapper(void *arg);
void eventEnd();

static dCcD_SrcCps sCcSrc;

/* 0x300 */ nw4r::g3d::ResFile mRes;
/* 0x334 */ MdlWithTimeProc mMdl;

/* 0x374 */ m3d::anmChr_c mAnmChr;
/* 0x3AC */ m3d::anmMatClr_c mAnmMatClr;
/* 0x3D8 */ dBgW mBg;
/* 0x5E8 */ dCcD_Cps mCc;
/* 0x758 */ STATE_MGR_DECLARE(dAcODungeonShip_c);
/* 0x794 */ DowsingTarget mDowsingTarget;
/* 0x7B4 */ mVec3_c mDowsingOffset;
/* 0x7C0 */ u8 mIsRoaming;
/* 0x7C4 */ ActorOnRail_Ext mPath;
/* 0x7F8 */ ActorEventRelated mEvent;
/* 0x848 */ u8 mAppearEventFromParam;
/* 0x849 */ u8 field_0x849;
/* 0x84A */ u8 mAppearEvent;
/* 0x84B */ u8 mPathIdx;
/* 0x84C */ u8 field_0x84C[0x850 - 0x84C];
/* 0x850 */ u32 field_0x850;
/* 0x854 */ u8 mNumTimesHit;
/* 0x855 */ u8 field_0x855;
/* 0x856 */ s8 field_0x856;
/* 0x858 */ f32 field_0x858;
/* 0x862 */ u8 field_0x862;
/* 0x863 */ u8 field_0x863;
/* 0x864 */ u8 field_0x864;
/* 0x865 */ u8 mIsDocked;
/* 0x868 */ s32 field_0x868;
/* 0x86C */ u32 field_0x86C;
/* 0x870 */ EffectsStruct mEffects[2];
/* 0x8D8 */ u8 field_0x8D8;
/* 0x8D9 */ u8 field_0x8D9;
/* 0x8DA */ u8 field_0x8DA;
};

#endif
1 change: 1 addition & 0 deletions include/d/col/cc/d_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class dCcD_Cps : public cCcD_Obj, public cCcD_CpsAttr {

virtual cCcD_ShapeAttr *GetShapeAttr() override;

using cM3dGCps::Set;
void Set(const dCcD_SrcCps &src);
void unknownCalc();
};
Expand Down
5 changes: 5 additions & 0 deletions include/m/m3d/m_anmmatclr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "m/m3d/m_bmdl.h"
#include "m/m3d/m_fanm.h"
#include "nw4r/g3d/g3d_anmclr.h"
#include "nw4r/g3d/g3d_scnobj.h"

namespace m3d {

Expand Down Expand Up @@ -48,6 +49,10 @@ class anmMatClr_c : public banm_c {
void setFrameStart(f32, s32);
f32 getFrameStart(s32) const;

nw4r::g3d::AnmObjMatClrRes *getChild(s32 idx) {
return nw4r::g3d::ScnObj::DynamicCast<nw4r::g3d::AnmObjMatClrRes>(mpChildren[idx].getAnimObj());
}

private:
child_c *mpChildren;
};
Expand Down
4 changes: 4 additions & 0 deletions include/toBeSorted/actor_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "common.h"
#include "d/a/d_a_base.h"
#include "m/m_vec.h"
#include "toBeSorted/event.h"

class ActorEventRelated {
Expand All @@ -16,6 +17,9 @@ class ActorEventRelated {
void advanceNext();
bool isAdvance();

int getSingleFloatData(f32 *result, u32 code, u32);
int getSingleVecData(mVec3_c *result, u32 code, u32);

private:
u8 field_0x00[0x50 - 0x00];
};
Expand Down
40 changes: 40 additions & 0 deletions include/toBeSorted/actor_on_rail.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define ACTOR_ON_RAIL_H

#include "common.h"
#include "m/m_vec.h"

class ActorOnRail {
private:
Expand All @@ -21,4 +22,43 @@ class ActorOnRail {
mVec3_c *getPntPosForIndex(int index);
};

class ActorOnRail_Ext : public ActorOnRail {
public:
ActorOnRail_Ext();
virtual ~ActorOnRail_Ext();

void setSegment(u16 segmentIndex, f32 segmentFraction);
bool initExt(int pathIndex, int roomId, int, int pathSegment, int pathSubtype, f32, f32, f32);

f32 getSegmentFraction() const {
return mSegmentFraction;
}

bool CheckFlag(u32 flag) const {
return (field_0x1C & flag) != 0;
}

void ClearFlag(u32 flag) {
field_0x1C &= ~flag;
}

void SetFlag(u32 flag) {
field_0x1C |= flag;
}

const mVec3_c &getPosition() const {
return mPosition;
}


private:
s32 mSegmentIndex;
f32 mSegmentFraction;
UNKWORD field_0x18;
u32 field_0x1C;
f32 field_0x20;
UNKWORD field_0x24;
mVec3_c mPosition;
};

#endif
45 changes: 45 additions & 0 deletions include/toBeSorted/time_proc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef TIME_PROC_H
#define TIME_PROC_H

/**
* A callback implementation that controls ???
*/

#include "m/m3d/m_proc.h"
#include "m/m3d/m_smdl.h"
#include "nw4r/g3d/g3d_scnobj.h"

class TimeCallback_c : public nw4r::g3d::IScnObjCallback {
public:
TimeCallback_c() : field_0x04(0), field_0x08(0), field_0x09(0) {}
virtual ~TimeCallback_c() {}
virtual void ExecCallback_CALC_VIEW(
nw4r::g3d::ScnObj::Timing /* timing */, nw4r::g3d::ScnObj * /* pObj */, u32 /* param */, void * /* pInfo */
) override;

/* 0x04 */ u32 field_0x04;
/* 0x08 */ u8 field_0x08;
/* 0x09 */ u8 field_0x09;
};

class TimeProcBase : public m3d::proc_c {
public:
virtual ~TimeProcBase() {}
};

class TimeProc : public TimeProcBase {
public:
TimeProc() {}
virtual ~TimeProc() {}

TimeCallback_c mCallback;
};

class MdlWithTimeProc : public m3d::smdl_c {
public:
int fn_8001F3B0(nw4r::g3d::ResMdl mdl, mAllocator_c *alloc, u32 bufferOption);

TimeProc mProc;
};

#endif // TIME_PROC_H
Loading

0 comments on commit b1f2d81

Please sign in to comment.