Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues) #2311

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion include/SSystem/SComponent/c_bg_s_lin_chk.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
void ct();
void Set2(const cXyz*, const cXyz*, unsigned int);
void PreCalc();
void GetCross();
cXyz* GetCross() { return &mLin.GetEnd(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should return a reference, and you can remove the i_GetCross fake. be sure you've ensured no regressions by comparing a diff report before this change and after.


virtual ~cBgS_LinChk();

Expand Down
57 changes: 30 additions & 27 deletions include/d/actor/d_a_e_ym.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#include "d/d_cc_uty.h"
#include "d/d_path.h"

class daKago_c;

class daE_YM_HIO_c {
public:
/* 8080812C */ daE_YM_HIO_c();

/* 80815458 */ virtual ~daE_YM_HIO_c();
/* 80815458 */ virtual ~daE_YM_HIO_c() {}

/* 0x04 */ s8 field_0x4;
/* 0x08 */ f32 mModelSize;
Expand Down Expand Up @@ -63,7 +65,7 @@ class daE_YM_c : public fopEn_enemy_c {

void setTagPosP() { mTagPosP = &mTagPos; }

/* 80808184 */ BOOL checkBck(char const*, int);
/* 80808184 */ u8 checkBck(char const*, int);
/* 808081E0 */ void bckSet(int, u8, f32, f32);
/* 80808328 */ void bckSetFly(int, u8, f32, f32);
/* 808083CC */ int draw();
Expand All @@ -72,10 +74,10 @@ class daE_YM_c : public fopEn_enemy_c {
/* 808089DC */ void setElecEffect2();
/* 80808B3C */ void setFireEffect();
/* 80808E34 */ bool checkWallCrash();
/* 80809000 */ void checkWolfBark();
/* 80809228 */ void checkSurpriseLock();
/* 8080963C */ void checkRailSurprise();
/* 808096EC */ void checkSurpriseNear();
/* 80809000 */ u8 checkWolfBark();
/* 80809228 */ u8 checkSurpriseLock();
/* 8080963C */ u8 checkRailSurprise();
/* 808096EC */ u8 checkSurpriseNear();
/* 80809D6C */ void setNormalCc();
/* 80809D84 */ void setAppear();
/* 80809DA8 */ void setMoveSound(int);
Expand All @@ -87,24 +89,24 @@ class daE_YM_c : public fopEn_enemy_c {
/* 8080B444 */ void executeDown();
/* 8080BB7C */ void damage_check();
/* 8080BCFC */ void executeWind();
/* 8080C05C */ void getSurpriseType();
/* 8080C05C */ int getSurpriseType();
/* 8080C1FC */ void setSurpriseAway();
/* 8080C24C */ void setGoHomeType();
/* 8080C374 */ void executeSurprise();
/* 8080CEE0 */ void executeBack();
/* 8080CFC8 */ void executeFall();
/* 8080D2C8 */ void executeAttack();
/* 8080D990 */ void checkAttackEnd();
/* 8080DB58 */ void setAttackMotion();
/* 8080D990 */ u8 checkAttackEnd();
/* 8080DB58 */ u8 setAttackMotion();
/* 8080DC5C */ void executeAttackWall();
/* 8080E26C */ void executeDefense();
/* 8080E49C */ void checkFlyTerritory();
/* 8080E49C */ u8 checkFlyTerritory();
/* 8080E630 */ void initFly();
/* 8080E6A0 */ void executeFly();
/* 8080F8C8 */ void setInclination();
/* 8080F92C */ void executeFlyAttack();
/* 80810084 */ void setNextPathPoint();
/* 8081013C */ void checkRailDig();
/* 8081013C */ u8 checkRailDig();
/* 8081030C */ void executeRail();
/* 80810690 */ void executeBackRail();
/* 80810DF8 */ void checkElectricStart();
Expand All @@ -122,10 +124,10 @@ class daE_YM_c : public fopEn_enemy_c {
/* 808138AC */ int execute();
/* 80813A38 */ int _delete();
/* 80813AF0 */ int CreateHeap();
/* 80813EA4 */ void checkBeforeBg(s16);
/* 808143A0 */ void checkBeforeGround();
/* 80813EA4 */ u8 checkBeforeBg(s16);
/* 808143A0 */ u8 checkBeforeGround();
/* 808144D8 */ void checkInitialWall();
/* 80814758 */ void checkWall();
/* 80814758 */ u8 checkWall();
/* 80814AF0 */ void setHideType();
/* 80814BA4 */ int create();

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

private:
/* 0x5AC */ request_of_phase_process_class mPhase;
/* 0x5B4 */ mDoExt_McaMorfSO* field_0x5b4;
/* 0x5B8 */ mDoExt_brkAnm* field_0x5b8;
/* 0x5BC */ Z2CreatureEnemy field_0x5bc;
/* 0x660 */ u8 field_0x660[0x664 - 0x660];
/* 0x664 */ fopAc_ac_c* field_0x664;
/* 0x5B4 */ mDoExt_McaMorfSO* mpMorf;
/* 0x5B8 */ mDoExt_brkAnm* mpBrk;
/* 0x5BC */ Z2CreatureEnemy mSound;
/* 0x660 */ fopAc_ac_c* field_0x660;
/* 0x664 */ daKago_c* mpKago;
/* 0x668 */ csXyz field_0x668;
/* 0x66E */ u8 field_0x66E[0x670 - 0x66E];
/* 0x670 */ cXyz field_0x670;
/* 0x670 */ cXyz mPrevPos;
/* 0x67C */ cXyz field_0x67c;
/* 0x688 */ f32 field_0x688;
/* 0x68C */ f32 field_0x68c;
Expand All @@ -164,7 +166,7 @@ class daE_YM_c : public fopEn_enemy_c {
/* 0x6AB */ u8 field_0x6AB[0x6AC - 0x6AB];
/* 0x6AC */ dPath* mpPath;
/* 0x6B0 */ dPath* field_0x6b0;
/* 0x6B4 */ s8 field_0x6b4;
/* 0x6B4 */ s8 mCurrentPntNo;
/* 0x6B5 */ u8 field_0x6B5[0x6B8 - 0x6B5];
/* 0x6B8 */ cXyz mTagPos;
/* 0x6C4 */ cXyz* mTagPosP;
Expand All @@ -173,7 +175,8 @@ class daE_YM_c : public fopEn_enemy_c {
/* 0x6CA */ u8 mFlyType;
/* 0x6CB */ u8 field_0x6cb;
/* 0x6CC */ u8 field_0x6cc;
/* 0x6CD */ u8 field_0x6CD[0x6CF - 0x6CD];
/* 0x6CD */ u8 field_0x6cd;
/* 0x6CE */ u8 field_0x6ce;
/* 0x6CF */ u8 field_0x6cf;
/* 0x6D0 */ cXyz* field_0x6d0;
/* 0x6D4 */ f32 field_0x6d4;
Expand Down Expand Up @@ -203,13 +206,13 @@ class daE_YM_c : public fopEn_enemy_c {
/* 0x710 */ s16 field_0x710;
/* 0x712 */ u8 field_0x712[0x714 - 0x712];
/* 0x714 */ int field_0x714;
/* 0x718 */ int field_0x718;
/* 0x718 */ u32 field_0x718;
/* 0x71C */ u8 field_0x71c;
/* 0x71D */ u8 field_0x71d;
/* 0x71E */ u8 field_0x71E[0x720 - 0x71E];
/* 0x720 */ dBgS_AcchCir field_0x720;
/* 0x760 */ dBgS_ObjAcch field_0x760;
/* 0x938 */ dCcD_Stts field_0x938;
/* 0x720 */ dBgS_AcchCir mAcchCir;
/* 0x760 */ dBgS_ObjAcch mAcch;
/* 0x938 */ dCcD_Stts mStts;
/* 0x974 */ dCcD_Sph mSphCc;
/* 0xAAC */ dCcU_AtInfo mAtInfo;
/* 0xAD0 */ u32 field_0xad0;
Expand All @@ -218,7 +221,7 @@ class daE_YM_c : public fopEn_enemy_c {
/* 0xADC */ u32 field_0xadc;
/* 0xAE0 */ u32 field_0xae0;
/* 0xAE4 */ u32 field_0xae4;
/* 0xAE8 */ u32 field_0xae8[3];
/* 0xAE8 */ u32 mParticleKeys[3];
/* 0xAF4 */ u8 field_0xaf4;
};

Expand Down
24 changes: 18 additions & 6 deletions include/d/actor/d_a_kago.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class daKago_c : public fopAc_ac_c {
/* 8084AF40 */ void createBalloonScore();
/* 8084AFB0 */ void startBalloonScore();
/* 8084B024 */ void endBalloonScore();
/* 8084B088 */ void checkNextPath(cXyz);
/* 8084B088 */ f32 checkNextPath(cXyz);
/* 8084B108 */ void checkHeight();
/* 8084B134 */ void checkYaguraPos(cXyz);
/* 8084B1E0 */ void checkWallHitFall(int);
Expand Down Expand Up @@ -88,7 +88,7 @@ class daKago_c : public fopAc_ac_c {
/* 808544D8 */ void create();

void setEvent() {
field_0x6e1 = 0;
mIsFlying = 0;
field_0x740 = 2;
field_0x744 = 0;
}
Expand All @@ -101,20 +101,32 @@ class daKago_c : public fopAc_ac_c {

MtxP getLegR3Mtx() { return mLegR3Mtx; }
MtxP getMidnaLocaterMtx() { return mpMorf->getModel()->getAnmMtx(4); }
s8 getPathDir() { return mPathDir; }
u8 isFlying() { return mIsFlying; }
fopAc_ac_c* getLockActor() { return mpLockActor; }
void setLockActor(fopAc_ac_c* actor) { mpLockActor = actor; }
void setEatYm() { field_0x6d8 |= 4; }
MtxP getMouthMtx() { return mpMorf->getModel()->getAnmMtx(7); }

private:
/* 0x568 */ u8 field_0x568[8];
/* 0x570 */ mDoExt_McaMorfSO* mpMorf;
/* 0x574 */ u8 field_0x574[0x620 - 0x574];
/* 0x574 */ u8 field_0x574[0x618 - 0x574];
/* 0x618 */ fopAc_ac_c* mpLockActor;
/* 0x61c */ u8 field_0x61c[0x620 - 0x61c];
/* 0x620 */ Mtx mLegR3Mtx;
/* 0x650 */ u8 field_0x650[0x6E1 - 0x650];
/* 0x6E1 */ u8 field_0x6e1;
/* 0x650 */ u8 field_0x650[0x6d8 - 0x650];
/* 0x6d8 */ u8 field_0x6d8;
/* 0x6d9 */ u8 field_0x6d9[0x6E1 - 0x6d9];
/* 0x6E1 */ u8 mIsFlying;
/* 0x6E2 */ u8 field_0x6E2[0x740 - 0x6E2];
/* 0x740 */ int field_0x740;
/* 0x744 */ int field_0x744;
/* 0x748 */ u8 field_0x748[0x76C - 0x748];
/* 0x76C */ dPath* field_0x76c;
/* 0x770 */ u8 field_0x770[0xBA4 - 0x770];
/* 0x770 */ u8 field_0x770[0x773 - 0x770];
/* 0x773 */ s8 mPathDir;
/* 0x774 */ u8 field_0x774[0xBA4 - 0x774];
};

STATIC_ASSERT(sizeof(daKago_c) == 0xBA4);
Expand Down
4 changes: 4 additions & 0 deletions include/d/actor/d_a_tag_firewall.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class daTag_FWall_c : public fopAc_ac_c {
/* 80D59078 */ int _delete();
/* 80D590A8 */ int create();

u8 getTagNo(u8 idx) { return field_0x65c[idx]; }
cXyz getPos(u8 idx) { return mWallPos[idx]; }
void setFire(u8 idx) { mWallMode[idx] = 2; }

/* 0x568 */ u8 field_0x568;
/* 0x569 */ u8 mSetGameoverEff;
/* 0x56C */ int mWallTimer[20];
Expand Down
2 changes: 2 additions & 0 deletions include/d/d_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class dCcD_GObjTg : public dCcD_GAtTgCoCommonBase {
s16* GetShieldFrontRangeYAngle() { return mShieldFrontRangeYAngle; }
s16 GetShieldRange() { return mShieldRange; }
u8 GetSpl() { return mSpl; }
void SetSpl(u8 tg_spl) { mSpl = tg_spl; }
u8 GetHitMark() { return mHitMark; }
void SetRVec(cXyz& vec) { mRVec = vec; }
cXyz* GetVecP() { return &mVec; }
Expand Down Expand Up @@ -380,6 +381,7 @@ class dCcD_GObjInf : public cCcD_GObjInf {
bool ChkTgHookShotNoHitMark() { return mGObjTg.ChkSPrm(0x400); }
bool ChkTgArrowNoHitMark() { return mGObjTg.ChkSPrm(0x1000); }
dCcG_Tg_Spl GetTgSpl() { return (dCcG_Tg_Spl)mGObjTg.GetSpl(); }
void SetTgSpl(u8 tg_spl) { mGObjTg.SetSpl(tg_spl); }
int GetTgHitMark() { return mGObjTg.GetHitMark(); }
int GetAtHitMark() { return mGObjAt.GetHitMark(); }
bool ChkAtEffCounter() { return mGObjAt.ChkEffCounter(); }
Expand Down
Loading