Skip to content

Commit 9c3c075

Browse files
authored
d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues) (#2311)
* checkWallCrash and checkWolfBark done for d_a_e_ym * d_a_e_ym at 36 percent * 46% completion for d_a_e_ym * d_a_e_ym at 65% completion * d_a_e_ym 83% complete * d_a_e_ym 90% complete * d_a_e_ym 99% decompiled. All done except for 2 functions with regalloc issues. Cleanup of mSound funcs in d_a_e_ym. * Update d_a_e_ym based on Taka's feedback
1 parent 4453d06 commit 9c3c075

File tree

7 files changed

+2854
-1081
lines changed

7 files changed

+2854
-1081
lines changed

include/SSystem/SComponent/c_bg_s_lin_chk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
2828
void ct();
2929
void Set2(const cXyz*, const cXyz*, unsigned int);
3030
void PreCalc();
31-
void GetCross();
31+
cXyz& GetCross() { return mLin.GetEnd(); }
3232

3333
virtual ~cBgS_LinChk();
3434

include/d/actor/d_a_e_ym.h

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
#include "d/d_cc_uty.h"
1010
#include "d/d_path.h"
1111

12+
class daKago_c;
13+
1214
class daE_YM_HIO_c {
1315
public:
1416
/* 8080812C */ daE_YM_HIO_c();
1517

16-
/* 80815458 */ virtual ~daE_YM_HIO_c();
18+
/* 80815458 */ virtual ~daE_YM_HIO_c() {}
1719

1820
/* 0x04 */ s8 field_0x4;
1921
/* 0x08 */ f32 mModelSize;
@@ -63,7 +65,7 @@ class daE_YM_c : public fopEn_enemy_c {
6365

6466
void setTagPosP() { mTagPosP = &mTagPos; }
6567

66-
/* 80808184 */ BOOL checkBck(char const*, int);
68+
/* 80808184 */ u8 checkBck(char const*, int);
6769
/* 808081E0 */ void bckSet(int, u8, f32, f32);
6870
/* 80808328 */ void bckSetFly(int, u8, f32, f32);
6971
/* 808083CC */ int draw();
@@ -72,10 +74,10 @@ class daE_YM_c : public fopEn_enemy_c {
7274
/* 808089DC */ void setElecEffect2();
7375
/* 80808B3C */ void setFireEffect();
7476
/* 80808E34 */ bool checkWallCrash();
75-
/* 80809000 */ void checkWolfBark();
76-
/* 80809228 */ void checkSurpriseLock();
77-
/* 8080963C */ void checkRailSurprise();
78-
/* 808096EC */ void checkSurpriseNear();
77+
/* 80809000 */ u8 checkWolfBark();
78+
/* 80809228 */ u8 checkSurpriseLock();
79+
/* 8080963C */ u8 checkRailSurprise();
80+
/* 808096EC */ u8 checkSurpriseNear();
7981
/* 80809D6C */ void setNormalCc();
8082
/* 80809D84 */ void setAppear();
8183
/* 80809DA8 */ void setMoveSound(int);
@@ -87,24 +89,24 @@ class daE_YM_c : public fopEn_enemy_c {
8789
/* 8080B444 */ void executeDown();
8890
/* 8080BB7C */ void damage_check();
8991
/* 8080BCFC */ void executeWind();
90-
/* 8080C05C */ void getSurpriseType();
92+
/* 8080C05C */ int getSurpriseType();
9193
/* 8080C1FC */ void setSurpriseAway();
9294
/* 8080C24C */ void setGoHomeType();
9395
/* 8080C374 */ void executeSurprise();
9496
/* 8080CEE0 */ void executeBack();
9597
/* 8080CFC8 */ void executeFall();
9698
/* 8080D2C8 */ void executeAttack();
97-
/* 8080D990 */ void checkAttackEnd();
98-
/* 8080DB58 */ void setAttackMotion();
99+
/* 8080D990 */ u8 checkAttackEnd();
100+
/* 8080DB58 */ u8 setAttackMotion();
99101
/* 8080DC5C */ void executeAttackWall();
100102
/* 8080E26C */ void executeDefense();
101-
/* 8080E49C */ void checkFlyTerritory();
103+
/* 8080E49C */ u8 checkFlyTerritory();
102104
/* 8080E630 */ void initFly();
103105
/* 8080E6A0 */ void executeFly();
104106
/* 8080F8C8 */ void setInclination();
105107
/* 8080F92C */ void executeFlyAttack();
106108
/* 80810084 */ void setNextPathPoint();
107-
/* 8081013C */ void checkRailDig();
109+
/* 8081013C */ u8 checkRailDig();
108110
/* 8081030C */ void executeRail();
109111
/* 80810690 */ void executeBackRail();
110112
/* 80810DF8 */ void checkElectricStart();
@@ -122,10 +124,10 @@ class daE_YM_c : public fopEn_enemy_c {
122124
/* 808138AC */ int execute();
123125
/* 80813A38 */ int _delete();
124126
/* 80813AF0 */ int CreateHeap();
125-
/* 80813EA4 */ void checkBeforeBg(s16);
126-
/* 808143A0 */ void checkBeforeGround();
127+
/* 80813EA4 */ u8 checkBeforeBg(s16);
128+
/* 808143A0 */ u8 checkBeforeGround();
127129
/* 808144D8 */ void checkInitialWall();
128-
/* 80814758 */ void checkWall();
130+
/* 80814758 */ u8 checkWall();
129131
/* 80814AF0 */ void setHideType();
130132
/* 80814BA4 */ int create();
131133

@@ -135,14 +137,14 @@ class daE_YM_c : public fopEn_enemy_c {
135137

136138
private:
137139
/* 0x5AC */ request_of_phase_process_class mPhase;
138-
/* 0x5B4 */ mDoExt_McaMorfSO* field_0x5b4;
139-
/* 0x5B8 */ mDoExt_brkAnm* field_0x5b8;
140-
/* 0x5BC */ Z2CreatureEnemy field_0x5bc;
141-
/* 0x660 */ u8 field_0x660[0x664 - 0x660];
142-
/* 0x664 */ fopAc_ac_c* field_0x664;
140+
/* 0x5B4 */ mDoExt_McaMorfSO* mpMorf;
141+
/* 0x5B8 */ mDoExt_brkAnm* mpBrk;
142+
/* 0x5BC */ Z2CreatureEnemy mSound;
143+
/* 0x660 */ fopAc_ac_c* field_0x660;
144+
/* 0x664 */ daKago_c* mpKago;
143145
/* 0x668 */ csXyz field_0x668;
144146
/* 0x66E */ u8 field_0x66E[0x670 - 0x66E];
145-
/* 0x670 */ cXyz field_0x670;
147+
/* 0x670 */ cXyz mPrevPos;
146148
/* 0x67C */ cXyz field_0x67c;
147149
/* 0x688 */ f32 field_0x688;
148150
/* 0x68C */ f32 field_0x68c;
@@ -164,7 +166,7 @@ class daE_YM_c : public fopEn_enemy_c {
164166
/* 0x6AB */ u8 field_0x6AB[0x6AC - 0x6AB];
165167
/* 0x6AC */ dPath* mpPath;
166168
/* 0x6B0 */ dPath* field_0x6b0;
167-
/* 0x6B4 */ s8 field_0x6b4;
169+
/* 0x6B4 */ s8 mCurrentPntNo;
168170
/* 0x6B5 */ u8 field_0x6B5[0x6B8 - 0x6B5];
169171
/* 0x6B8 */ cXyz mTagPos;
170172
/* 0x6C4 */ cXyz* mTagPosP;
@@ -173,7 +175,8 @@ class daE_YM_c : public fopEn_enemy_c {
173175
/* 0x6CA */ u8 mFlyType;
174176
/* 0x6CB */ u8 field_0x6cb;
175177
/* 0x6CC */ u8 field_0x6cc;
176-
/* 0x6CD */ u8 field_0x6CD[0x6CF - 0x6CD];
178+
/* 0x6CD */ u8 field_0x6cd;
179+
/* 0x6CE */ u8 field_0x6ce;
177180
/* 0x6CF */ u8 field_0x6cf;
178181
/* 0x6D0 */ cXyz* field_0x6d0;
179182
/* 0x6D4 */ f32 field_0x6d4;
@@ -203,13 +206,13 @@ class daE_YM_c : public fopEn_enemy_c {
203206
/* 0x710 */ s16 field_0x710;
204207
/* 0x712 */ u8 field_0x712[0x714 - 0x712];
205208
/* 0x714 */ int field_0x714;
206-
/* 0x718 */ int field_0x718;
209+
/* 0x718 */ u32 field_0x718;
207210
/* 0x71C */ u8 field_0x71c;
208211
/* 0x71D */ u8 field_0x71d;
209212
/* 0x71E */ u8 field_0x71E[0x720 - 0x71E];
210-
/* 0x720 */ dBgS_AcchCir field_0x720;
211-
/* 0x760 */ dBgS_ObjAcch field_0x760;
212-
/* 0x938 */ dCcD_Stts field_0x938;
213+
/* 0x720 */ dBgS_AcchCir mAcchCir;
214+
/* 0x760 */ dBgS_ObjAcch mAcch;
215+
/* 0x938 */ dCcD_Stts mStts;
213216
/* 0x974 */ dCcD_Sph mSphCc;
214217
/* 0xAAC */ dCcU_AtInfo mAtInfo;
215218
/* 0xAD0 */ u32 field_0xad0;
@@ -218,7 +221,7 @@ class daE_YM_c : public fopEn_enemy_c {
218221
/* 0xADC */ u32 field_0xadc;
219222
/* 0xAE0 */ u32 field_0xae0;
220223
/* 0xAE4 */ u32 field_0xae4;
221-
/* 0xAE8 */ u32 field_0xae8[3];
224+
/* 0xAE8 */ u32 mParticleKeys[3];
222225
/* 0xAF4 */ u8 field_0xaf4;
223226
};
224227

include/d/actor/d_a_kago.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class daKago_c : public fopAc_ac_c {
3636
/* 8084AF40 */ void createBalloonScore();
3737
/* 8084AFB0 */ void startBalloonScore();
3838
/* 8084B024 */ void endBalloonScore();
39-
/* 8084B088 */ void checkNextPath(cXyz);
39+
/* 8084B088 */ f32 checkNextPath(cXyz);
4040
/* 8084B108 */ void checkHeight();
4141
/* 8084B134 */ void checkYaguraPos(cXyz);
4242
/* 8084B1E0 */ void checkWallHitFall(int);
@@ -88,7 +88,7 @@ class daKago_c : public fopAc_ac_c {
8888
/* 808544D8 */ void create();
8989

9090
void setEvent() {
91-
field_0x6e1 = 0;
91+
mIsFlying = 0;
9292
field_0x740 = 2;
9393
field_0x744 = 0;
9494
}
@@ -101,20 +101,32 @@ class daKago_c : public fopAc_ac_c {
101101

102102
MtxP getLegR3Mtx() { return mLegR3Mtx; }
103103
MtxP getMidnaLocaterMtx() { return mpMorf->getModel()->getAnmMtx(4); }
104+
s8 getPathDir() { return mPathDir; }
105+
u8 isFlying() { return mIsFlying; }
106+
fopAc_ac_c* getLockActor() { return mpLockActor; }
107+
void setLockActor(fopAc_ac_c* actor) { mpLockActor = actor; }
108+
void setEatYm() { field_0x6d8 |= 4; }
109+
MtxP getMouthMtx() { return mpMorf->getModel()->getAnmMtx(7); }
104110

105111
private:
106112
/* 0x568 */ u8 field_0x568[8];
107113
/* 0x570 */ mDoExt_McaMorfSO* mpMorf;
108-
/* 0x574 */ u8 field_0x574[0x620 - 0x574];
114+
/* 0x574 */ u8 field_0x574[0x618 - 0x574];
115+
/* 0x618 */ fopAc_ac_c* mpLockActor;
116+
/* 0x61c */ u8 field_0x61c[0x620 - 0x61c];
109117
/* 0x620 */ Mtx mLegR3Mtx;
110-
/* 0x650 */ u8 field_0x650[0x6E1 - 0x650];
111-
/* 0x6E1 */ u8 field_0x6e1;
118+
/* 0x650 */ u8 field_0x650[0x6d8 - 0x650];
119+
/* 0x6d8 */ u8 field_0x6d8;
120+
/* 0x6d9 */ u8 field_0x6d9[0x6E1 - 0x6d9];
121+
/* 0x6E1 */ u8 mIsFlying;
112122
/* 0x6E2 */ u8 field_0x6E2[0x740 - 0x6E2];
113123
/* 0x740 */ int field_0x740;
114124
/* 0x744 */ int field_0x744;
115125
/* 0x748 */ u8 field_0x748[0x76C - 0x748];
116126
/* 0x76C */ dPath* field_0x76c;
117-
/* 0x770 */ u8 field_0x770[0xBA4 - 0x770];
127+
/* 0x770 */ u8 field_0x770[0x773 - 0x770];
128+
/* 0x773 */ s8 mPathDir;
129+
/* 0x774 */ u8 field_0x774[0xBA4 - 0x774];
118130
};
119131

120132
STATIC_ASSERT(sizeof(daKago_c) == 0xBA4);

include/d/actor/d_a_tag_firewall.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ class daTag_FWall_c : public fopAc_ac_c {
1010
/* 80D59078 */ int _delete();
1111
/* 80D590A8 */ int create();
1212

13+
u8 getTagNo(u8 idx) { return field_0x65c[idx]; }
14+
cXyz getPos(u8 idx) { return mWallPos[idx]; }
15+
void setFire(u8 idx) { mWallMode[idx] = 2; }
16+
1317
/* 0x568 */ u8 field_0x568;
1418
/* 0x569 */ u8 mSetGameoverEff;
1519
/* 0x56C */ int mWallTimer[20];

include/d/d_cc_d.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ class dCcD_GObjTg : public dCcD_GAtTgCoCommonBase {
244244
s16* GetShieldFrontRangeYAngle() { return mShieldFrontRangeYAngle; }
245245
s16 GetShieldRange() { return mShieldRange; }
246246
u8 GetSpl() { return mSpl; }
247+
void SetSpl(u8 tg_spl) { mSpl = tg_spl; }
247248
u8 GetHitMark() { return mHitMark; }
248249
void SetRVec(cXyz& vec) { mRVec = vec; }
249250
cXyz* GetVecP() { return &mVec; }
@@ -380,6 +381,7 @@ class dCcD_GObjInf : public cCcD_GObjInf {
380381
bool ChkTgHookShotNoHitMark() { return mGObjTg.ChkSPrm(0x400); }
381382
bool ChkTgArrowNoHitMark() { return mGObjTg.ChkSPrm(0x1000); }
382383
dCcG_Tg_Spl GetTgSpl() { return (dCcG_Tg_Spl)mGObjTg.GetSpl(); }
384+
void SetTgSpl(u8 tg_spl) { mGObjTg.SetSpl(tg_spl); }
383385
int GetTgHitMark() { return mGObjTg.GetHitMark(); }
384386
int GetAtHitMark() { return mGObjAt.GetHitMark(); }
385387
bool ChkAtEffCounter() { return mGObjAt.ChkEffCounter(); }

0 commit comments

Comments
 (0)