Skip to content

Commit 763400c

Browse files
authored
daObjNAN_c equivalent (#2320)
* daObjNAN_c equivalent * Remove padding
1 parent 800049a commit 763400c

File tree

14 files changed

+725
-878
lines changed

14 files changed

+725
-878
lines changed

config/GZ2E01/rels/d_a_obj_nan/symbols.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ __register_global_object = .text:0x00000078; // type:function size:0x1C scope:gl
55
__destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:global
66
__ct__14daObj_NanHIO_cFv = .text:0x000000EC; // type:function size:0x28 scope:global
77
setAction__10daObjNAN_cFM10daObjNAN_cFPCvPv_v = .text:0x00000114; // type:function size:0xA4 scope:global
8-
useHeapInit__FP10fopAc_ac_c = .text:0x000001B8; // type:function size:0x274 scope:global
8+
useHeapInit__FP10fopAc_ac_c = .text:0x000001B8; // type:function size:0x274 scope:local
99
__dt__12J3DFrameCtrlFv = .text:0x0000042C; // type:function size:0x48 scope:global
10-
daObjNAN_Create__FP10fopAc_ac_c = .text:0x00000474; // type:function size:0x20 scope:global
11-
daObjNAN_Delete__FP10daObjNAN_c = .text:0x00000494; // type:function size:0x24 scope:global
10+
daObjNAN_Create__FP10fopAc_ac_c = .text:0x00000474; // type:function size:0x20 scope:local
11+
daObjNAN_Delete__FP10daObjNAN_c = .text:0x00000494; // type:function size:0x24 scope:local
1212
nan_posMove__10daObjNAN_cFv = .text:0x000004B8; // type:function size:0xB4 scope:global
1313
turn__10daObjNAN_cFv = .text:0x0000056C; // type:function size:0x328 scope:global
1414
__dt__8cM3dGPlaFv = .text:0x00000894; // type:function size:0x48 scope:global
@@ -26,13 +26,13 @@ action__10daObjNAN_cFv = .text:0x0000224C; // type:function size:0x60 scope:glob
2626
execute__10daObjNAN_cFv = .text:0x000022AC; // type:function size:0x198 scope:global
2727
_delete__10daObjNAN_cFv = .text:0x00002444; // type:function size:0x68 scope:global
2828
setBaseMtx__10daObjNAN_cFv = .text:0x000024AC; // type:function size:0x80 scope:global
29-
daObjNAN_Draw__FP10daObjNAN_c = .text:0x0000252C; // type:function size:0x15C scope:global
30-
daObjNAN_Execute__FP10daObjNAN_c = .text:0x00002688; // type:function size:0x20 scope:global
29+
daObjNAN_Draw__FP10daObjNAN_c = .text:0x0000252C; // type:function size:0x15C scope:local
30+
daObjNAN_Execute__FP10daObjNAN_c = .text:0x00002688; // type:function size:0x20 scope:local
3131
create__10daObjNAN_cFv = .text:0x000026A8; // type:function size:0x474 scope:global
3232
__dt__8cM3dGSphFv = .text:0x00002B1C; // type:function size:0x48 scope:global
3333
__dt__8cM3dGAabFv = .text:0x00002B64; // type:function size:0x48 scope:global
3434
__dt__10dCcD_GSttsFv = .text:0x00002BAC; // type:function size:0x5C scope:global
35-
daObjNAN_IsDelete__FP10daObjNAN_c = .text:0x00002C08; // type:function size:0x8 scope:global
35+
daObjNAN_IsDelete__FP10daObjNAN_c = .text:0x00002C08; // type:function size:0x8 scope:local
3636
__dt__14daObj_NanHIO_cFv = .text:0x00002C10; // type:function size:0x48 scope:global
3737
__sinit_d_a_obj_nan_cpp = .text:0x00002C58; // type:function size:0x3C scope:local
3838
Insect_Release__9dInsect_cFv = .text:0x00002C94; // type:function size:0xC scope:global
@@ -42,8 +42,8 @@ __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 sc
4242
_dtors = .dtors:0x00000000; // type:label scope:global
4343
...rodata.0 = .rodata:0x00000000; // type:label scope:local
4444
@3774 = .rodata:0x00000000; // type:object size:0x4 scope:local
45-
l_nan_brk_index = .rodata:0x00000004; // type:object size:0x8 scope:global
46-
l_nan_btk_index = .rodata:0x0000000C; // type:object size:0x8 scope:global
45+
l_nan_brk_index = .rodata:0x00000004; // type:object size:0x8 scope:local
46+
l_nan_btk_index = .rodata:0x0000000C; // type:object size:0x8 scope:local
4747
@3868 = .rodata:0x00000014; // type:object size:0x4 scope:local data:float
4848
@3869 = .rodata:0x00000018; // type:object size:0x4 scope:local
4949
@3870 = .rodata:0x0000001C; // type:object size:0x4 scope:local data:float
@@ -78,21 +78,21 @@ l_nan_btk_index = .rodata:0x0000000C; // type:object size:0x8 scope:global
7878
@4491 = .rodata:0x000000A8; // type:object size:0x4 scope:local
7979
@4601 = .rodata:0x000000AC; // type:object size:0x4 scope:local
8080
@4672 = .rodata:0x000000B0; // type:object size:0x4 scope:local
81-
l_nan_itemno = .rodata:0x000000B4; // type:object size:0x2 scope:global
81+
l_nan_itemno = .rodata:0x000000B4; // type:object size:0x2 scope:local
8282
@4742 = .rodata:0x000000B8; // type:object size:0x4 scope:local data:float
8383
@4744 = .rodata:0x000000C0; // type:object size:0x8 scope:local data:double
8484
@4823 = .rodata:0x000000C8; // type:object size:0x4 scope:local
8585
@4824 = .rodata:0x000000CC; // type:object size:0x4 scope:local data:string
8686
@4825 = .rodata:0x000000D0; // type:object size:0x4 scope:local
8787
@4826 = .rodata:0x000000D4; // type:object size:0x4 scope:local
88-
l_musiya_num = .rodata:0x000000D8; // type:object size:0x4 scope:global
89-
l_heapsize = .rodata:0x000000DC; // type:object size:0x4 scope:global
88+
l_musiya_num = .rodata:0x000000D8; // type:object size:0x4 scope:local
89+
l_heapsize = .rodata:0x000000DC; // type:object size:0x4 scope:local
9090
@5034 = .rodata:0x000000E0; // type:object size:0x4 scope:local
9191
@stringBase0 = .rodata:0x000000E4; // type:object size:0xE scope:local data:string_table
9292
...data.0 = .data:0x00000000; // type:label scope:local
93-
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
93+
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local
9494
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
95-
cc_sph_src__25@unnamed@d_a_obj_nan_cpp@ = .data:0x00000020; // type:object size:0x40 scope:global
95+
cc_sph_src__25@unnamed@d_a_obj_nan_cpp@ = .data:0x00000020; // type:object size:0x40 scope:local
9696
@3924 = .data:0x00000060; // type:object size:0xC scope:local data:4byte
9797
@4034 = .data:0x0000006C; // type:object size:0xC scope:local data:4byte
9898
@4126 = .data:0x00000078; // type:object size:0xC scope:local
@@ -109,7 +109,7 @@ cc_sph_src__25@unnamed@d_a_obj_nan_cpp@ = .data:0x00000020; // type:object size:
109109
@4683 = .data:0x000000FC; // type:object size:0xC scope:local data:4byte
110110
@4938 = .data:0x00000108; // type:object size:0xC scope:local
111111
@4941 = .data:0x00000114; // type:object size:0xC scope:local
112-
l_daObjNAN_Method = .data:0x00000120; // type:object size:0x20 scope:global
112+
l_daObjNAN_Method = .data:0x00000120; // type:object size:0x20 scope:local
113113
g_profile_Obj_Nan = .data:0x00000140; // type:object size:0x30 scope:global
114114
__vt__9dInsect_c = .data:0x00000170; // type:object size:0xC scope:global
115115
__vt__10cCcD_GStts = .data:0x0000017C; // type:object size:0xC scope:global
@@ -121,6 +121,6 @@ __vt__8cM3dGPla = .data:0x000001B8; // type:object size:0xC scope:global
121121
__vt__12J3DFrameCtrl = .data:0x000001C4; // type:object size:0xC scope:global
122122
__vt__14daObj_NanHIO_c = .data:0x000001D0; // type:object size:0xC scope:global
123123
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
124-
lbl_581_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte
124+
l_hio_init = .bss:0x00000008; // type:object size:0x1 scope:local data:byte
125125
@3769 = .bss:0x0000000C; // type:object size:0xC scope:local
126-
l_HIO = .bss:0x00000018; // type:object size:0x10 scope:global data:float
126+
l_HIO = .bss:0x00000018; // type:object size:0x10 scope:local data:float

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ def MatchingFor(*versions):
20132013
ActorRel(NonMatching, "d_a_obj_mvstair"),
20142014
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_myogan"),
20152015
ActorRel(NonMatching, "d_a_obj_nagaisu"),
2016-
ActorRel(NonMatching, "d_a_obj_nan"),
2016+
ActorRel(Equivalent, "d_a_obj_nan"),
20172017
ActorRel(NonMatching, "d_a_obj_ndoor"),
20182018
ActorRel(NonMatching, "d_a_obj_nougu"),
20192019
ActorRel(Equivalent, "d_a_obj_octhashi"),

include/d/actor/d_a_obj_nan.h

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#ifndef D_A_OBJ_NAN_H
22
#define D_A_OBJ_NAN_H
33

4+
#include "SSystem/SComponent/c_phase.h"
45
#include "d/d_insect.h"
6+
#include "d/actor/d_a_player.h"
7+
#include "d/d_cc_d.h"
8+
9+
class daPy_boomerangMove_c;
510

611
/**
712
* @ingroup actors-objects
@@ -13,10 +18,12 @@
1318
*/
1419
class daObjNAN_c : public dInsect_c {
1520
public:
16-
/* 80CA05D4 */ void setAction(void (daObjNAN_c::*)());
21+
typedef void (daObjNAN_c::*actionFunc)();
22+
23+
/* 80CA05D4 */ void setAction(actionFunc);
1724
/* 80CA0978 */ void nan_posMove();
1825
/* 80CA0A2C */ void turn();
19-
/* 80CA0D9C */ void nan_WalkAnm();
26+
/* 80CA0D9C */ u8 nan_WalkAnm();
2027
/* 80CA0E7C */ void wait();
2128
/* 80CA1184 */ void walk();
2229
/* 80CA1904 */ void bin_wait();
@@ -27,21 +34,51 @@ class daObjNAN_c : public dInsect_c {
2734
/* 80CA2368 */ void drop();
2835
/* 80CA2658 */ void hit_check();
2936
/* 80CA270C */ void action();
30-
/* 80CA276C */ void execute();
31-
/* 80CA2904 */ void _delete();
37+
/* 80CA276C */ int execute();
38+
/* 80CA2904 */ int _delete();
3239
/* 80CA296C */ void setBaseMtx();
33-
/* 80CA2B68 */ void create();
40+
/* 80CA2B68 */ int create();
41+
42+
inline int CreateHeap();
43+
inline int draw();
3444

3545
private:
36-
/* 0x590 */ u8 field_0x568[0x800 - 0x590];
46+
/* 0x590 */ request_of_phase_process_class mPhase;
47+
/* 0x598 */ Z2Creature mCreatureSound;
48+
/* 0x628 */ mDoExt_McaMorfSO* mMorf;
49+
/* 0x62C */ mDoExt_brkAnm* mBrk;
50+
/* 0x630 */ mDoExt_btkAnm* mBtk;
51+
/* 0x634 */ dCcD_Stts mStts;
52+
/* 0x670 */ dCcD_Sph mSph;
53+
/* 0x7A8 */ daPy_boomerangMove_c mBoomerangMove;
54+
/* 0x7B4 */ int field_0x7b4;
55+
/* 0x7B8 */ actionFunc mAction;
56+
/* 0x7C4 */ actionFunc mPrevAction;
57+
/* 0x7D0 */ int field_0x7d0;
58+
/* 0x7D4 */ csXyz field_0x7d4;
59+
/* 0x7DA */ csXyz field_0x7da;
60+
/* 0x7E0 */ s16 field_0x7e0;
61+
/* 0x7E2 */ s16 field_0x7e2;
62+
/* 0x7E4 */ s16 field_0x7e4;
63+
/* 0x7E8 */ f32 field_0x7e8;
64+
/* 0x7E6 */ u8 field_0x7e6[0x7f8 - 0x7ec];
65+
/* 0x7F8 */ u16 field_0x7f8;
66+
/* 0x7FA */ u8 field_0x7fa;
67+
/* 0x7FB */ u8 field_0x7fb;
68+
/* 0x7FC */ u8 field_0x7fc;
69+
/* 0x7FC */ u8 field_0x7fd;
3770
};
3871

3972
STATIC_ASSERT(sizeof(daObjNAN_c) == 0x800);
4073

4174
class daObj_NanHIO_c {
4275
public:
4376
/* 80CA05AC */ daObj_NanHIO_c();
44-
/* 80CA30D0 */ ~daObj_NanHIO_c();
77+
/* 80CA30D0 */ virtual ~daObj_NanHIO_c() {}
78+
79+
/* 0x04 */ s8 field_0x4;
80+
/* 0x08 */ f32 field_0x8;
81+
/* 0x0C */ f32 field_0xc;
4582
};
4683

4784

include/d/d_cc_uty.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef D_CC_D_CC_UTY_H
22
#define D_CC_D_CC_UTY_H
33

4+
#include "SSystem/SComponent/c_sxyz.h"
45
#include "dolphin/types.h"
56

67
class cCcD_Obj;
@@ -20,9 +21,7 @@ struct dCcU_AtInfo {
2021
/* 0x00 */ cCcD_Obj* mpCollider;
2122
/* 0x04 */ fopAc_ac_c* mpActor;
2223
/* 0x08 */ Z2Creature* mpSound;
23-
/* 0x0C */ u8 field_0xc[2];
24-
/* 0x0E */ s16 mHitDirection;
25-
/* 0x10 */ u8 field_0x10[4];
24+
/* 0x0C */ csXyz mHitDirection;
2625
/* 0x14 */ u32 mHitBit;
2726
/* 0x18 */ u32 field_0x18;
2827
/* 0x1C */ u16 mAttackPower;

include/d/d_insect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class dInsect_c : public fopAc_ac_c {
2525
bool ChkGetDemo() { return m_mode > 0; }
2626
void setItemNo(u8 i_itemNo) { m_itemNo = i_itemNo; }
2727
void setSaveBitNo(s16 i_saveBitNo) { m_saveBitNo = i_saveBitNo; }
28+
bool CheckZ() { return (u32)field_0x57C > field_0x578; }
2829

2930
public:
3031
/* 0x56C */ u8 field_0x56C;

src/d/actor/d_a_e_ba.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static void damage_check(e_ba_class* i_this) {
146146
i_this->mIFrames = 10;
147147
}
148148
i_this->mKnockbackSpeed = 80.0f;
149-
i_this->mKnockbackAngle = i_this->mAtInfo.mHitDirection;
149+
i_this->mKnockbackAngle = i_this->mAtInfo.mHitDirection.y;
150150
if (i_this->health <= 0) {
151151
i_this->mCreatureSound.startCreatureVoice(Z2SE_EN_BA_V_DEATH, -1);
152152
i_this->mpMorf->setPlaySpeed(0.2f);

src/d/actor/d_a_e_fs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static void damage_check(e_fs_class* i_this) {
438438
} else {
439439
i_this->mIFrameTimer = 10;
440440
}
441-
i_this->current.angle.y = i_this->mAtInfo.mHitDirection;
441+
i_this->current.angle.y = i_this->mAtInfo.mHitDirection.y;
442442

443443
if (i_this->health <= 0) {
444444
i_this->mAction = e_fs_class::ACT_END;

src/d/actor/d_a_e_fz.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void daE_FZ_c::damage_check() {
253253
dComIfGp_setHitMark(3,this,&pos3,&s_pos,0,AT_TYPE_0);
254254
}
255255

256-
mLastWallHitAngle = mAtInfo.mHitDirection;
256+
mLastWallHitAngle = mAtInfo.mHitDirection.y;
257257
setReflectAngle();
258258
current.angle.y += -32768;
259259
field_0x712 = 10;

src/d/actor/d_a_e_oct_bg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ void daE_OctBg_c::damage() {
740740
field_0x8c0.OffTgSetBit();
741741
field_0x9f8.OffAtSetBit();
742742
attention_info.flags = 0;
743-
current.angle.y = field_0xb30.mHitDirection + 0x8000;
743+
current.angle.y = field_0xb30.mHitDirection.y + 0x8000;
744744
speedF = 10.0f;
745745
field_0xb96 = 0x1000;
746746
speed.y = 0.0f;

src/d/actor/d_a_e_ot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void daE_OT_c::executeDamage() {
550550
mMode = 1;
551551
mAnmSpeed = 1.0f;
552552
gravity = -5.0f;
553-
current.angle.y = mAtInfo.mHitDirection + 0x8000 + cM_rndFX(0x2000);
553+
current.angle.y = mAtInfo.mHitDirection.y + 0x8000 + cM_rndFX(0x2000);
554554
break;
555555

556556
case 1:

0 commit comments

Comments
 (0)