Skip to content

Commit

Permalink
remove "duplicated" inlines (#2099)
Browse files Browse the repository at this point in the history
* fix f_op_actor_mng inlines

* fix f_pc inlines

* fix d_a_alink weak func signatures

* fix d_com_inf_game inlines

* fix some more inlines

* fix rest of player inlines

* m_Do / JSystem inlines fixed

* fix upstream changes
  • Loading branch information
TakaRikka authored Mar 19, 2024
1 parent 38e0f89 commit 25d5107
Show file tree
Hide file tree
Showing 347 changed files with 3,972 additions and 3,892 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lbl_80141190:
/* 80141190 80 03 05 90 */ lwz r0, 0x590(r3)
/* 80141194 7C 03 20 38 */ and r3, r0, r4
/* 80141198 4E 80 00 20 */ blr
4 changes: 4 additions & 0 deletions asm/d/a/d_a_alink/checkForceNormalColor__9daMidna_cCFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lbl_80141A04:
/* 80141A04 80 03 08 94 */ lwz r0, 0x894(r3)
/* 80141A08 54 03 07 38 */ rlwinm r3, r0, 0, 0x1c, 0x1c
/* 80141A0C 4E 80 00 20 */ blr
4 changes: 4 additions & 0 deletions asm/d/a/d_a_alink/checkForceTiredColor__9daMidna_cCFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lbl_80141A10:
/* 80141A10 80 03 08 94 */ lwz r0, 0x894(r3)
/* 80141A14 54 03 07 7A */ rlwinm r3, r0, 0, 0x1d, 0x1d
/* 80141A18 4E 80 00 20 */ blr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lbl_801411D4:
/* 801411D4 80 03 05 7C */ lwz r0, 0x57c(r3)
/* 801411D8 7C 03 20 38 */ and r3, r0, r4
/* 801411DC 4E 80 00 20 */ blr
8 changes: 8 additions & 0 deletions asm/d/a/d_a_alink/dMeter2Info_offUseButton__Fi.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lbl_8014196C:
/* 8014196C 3C 80 80 43 */ lis r4, g_meter2_info@ha /* 0x80430188@ha */
/* 80141970 38 A4 01 88 */ addi r5, r4, g_meter2_info@l /* 0x80430188@l */
/* 80141974 A0 85 00 AE */ lhz r4, 0xae(r5)
/* 80141978 54 60 04 3E */ clrlwi r0, r3, 0x10
/* 8014197C 7C 80 00 78 */ andc r0, r4, r0
/* 80141980 B0 05 00 AE */ sth r0, 0xae(r5)
/* 80141984 4E 80 00 20 */ blr
16 changes: 16 additions & 0 deletions asm/d/a/d_a_alink/dMeter2Info_setFloatingMessage__FUssb.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
lbl_801419B8:
/* 801419B8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 801419BC 7C 08 02 A6 */ mflr r0
/* 801419C0 90 01 00 14 */ stw r0, 0x14(r1)
/* 801419C4 7C 67 1B 78 */ mr r7, r3
/* 801419C8 7C 80 23 78 */ mr r0, r4
/* 801419CC 7C A6 2B 78 */ mr r6, r5
/* 801419D0 3C 60 80 43 */ lis r3, g_meter2_info@ha /* 0x80430188@ha */
/* 801419D4 38 63 01 88 */ addi r3, r3, g_meter2_info@l /* 0x80430188@l */
/* 801419D8 7C E4 3B 78 */ mr r4, r7
/* 801419DC 7C 05 03 78 */ mr r5, r0
/* 801419E0 48 0D A7 01 */ bl setFloatingMessage__13dMeter2Info_cFUssb
/* 801419E4 80 01 00 14 */ lwz r0, 0x14(r1)
/* 801419E8 7C 08 03 A6 */ mtlr r0
/* 801419EC 38 21 00 10 */ addi r1, r1, 0x10
/* 801419F0 4E 80 00 20 */ blr
9 changes: 9 additions & 0 deletions asm/d/a/d_a_alink/func_80141AE8.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
lbl_80141AE8:
/* 80141AE8 88 83 00 00 */ lbz r4, 0(r3)
/* 80141AEC 28 04 00 00 */ cmplwi r4, 0
/* 80141AF0 41 82 00 0C */ beq lbl_80141AFC
/* 80141AF4 38 04 FF FF */ addi r0, r4, -1
/* 80141AF8 98 03 00 00 */ stb r0, 0(r3)
lbl_80141AFC:
/* 80141AFC 88 63 00 00 */ lbz r3, 0(r3)
/* 80141B00 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getGiantPuzzleAimAngle__9daPy_py_cCFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141874:
/* 80141874 A8 63 04 E6 */ lha r3, 0x4e6(r3)
/* 80141878 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getInvMtx__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141514:
/* 80141514 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141518 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getLeftHandMatrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141534:
/* 80141534 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141538 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getLeftItemMatrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141524:
/* 80141524 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141528 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getLinkBackBone1Matrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141544:
/* 80141544 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141548 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getModelMtx__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_8014150C:
/* 8014150C 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141510 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getRightHandMatrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_8014153C:
/* 8014153C 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141540 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getRightItemMatrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_8014152C:
/* 8014152C 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141530 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getShadowTalkAtnPos__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_8014151C:
/* 8014151C 38 63 04 D0 */ addi r3, r3, 0x4d0
/* 80141520 4E 80 00 20 */ blr
11 changes: 11 additions & 0 deletions asm/d/a/d_a_alink/getSumouMode__9daPy_py_cCFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lbl_801411B0:
/* 801411B0 38 00 00 00 */ li r0, 0
/* 801411B4 88 63 05 6A */ lbz r3, 0x56a(r3)
/* 801411B8 28 03 00 00 */ cmplwi r3, 0
/* 801411BC 41 82 00 10 */ beq lbl_801411CC
/* 801411C0 28 03 00 26 */ cmplwi r3, 0x26
/* 801411C4 40 80 00 08 */ bge lbl_801411CC
/* 801411C8 38 00 00 01 */ li r0, 1
lbl_801411CC:
/* 801411CC 7C 03 03 78 */ mr r3, r0
/* 801411D0 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getWolfBackbone2Matrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141554:
/* 80141554 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141558 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getWolfMouthMatrix__9daPy_py_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_8014154C:
/* 8014154C 80 63 05 04 */ lwz r3, 0x504(r3)
/* 80141550 4E 80 00 20 */ blr
3 changes: 3 additions & 0 deletions asm/d/a/d_a_alink/getZeldaActor__9daHorse_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lbl_80141944:
/* 80141944 80 63 12 58 */ lwz r3, 0x1258(r3)
/* 80141948 4E 80 00 20 */ blr
5 changes: 5 additions & 0 deletions asm/d/a/d_a_alink/onForcePanic__9daMidna_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lbl_801419F4:
/* 801419F4 80 03 08 98 */ lwz r0, 0x898(r3)
/* 801419F8 60 00 00 08 */ ori r0, r0, 8
/* 801419FC 90 03 08 98 */ stw r0, 0x898(r3)
/* 80141A00 4E 80 00 20 */ blr
5 changes: 5 additions & 0 deletions asm/d/a/d_a_alink/onNoServiceWait__9daMidna_cFv.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lbl_80141A84:
/* 80141A84 80 03 08 98 */ lwz r0, 0x898(r3)
/* 80141A88 60 00 00 80 */ ori r0, r0, 0x80
/* 80141A8C 90 03 08 98 */ stw r0, 0x898(r3)
/* 80141A90 4E 80 00 20 */ blr
11 changes: 3 additions & 8 deletions include/JSystem/J3DGraphAnimator/J3DModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class J3DModel {
entryModelData(param_0, param_1, param_2);
}

/* 800CFFF4 */ void setBaseTRMtx(f32 (*)[4]);
/* 80327100 */ void initialize();
/* 80327184 */ s32 entryModelData(J3DModelData*, u32, u32);
/* 80327300 */ s32 createShapePacket(J3DModelData*);
Expand All @@ -56,7 +55,6 @@ class J3DModel {
/* 803281B4 */ void calcBumpMtx();
/* 803282B8 */ void calcBBoardMtx();
/* 803282EC */ void prepareShapePackets();
MtxP getAnmMtx(int);

/* 80327CA4 */ virtual void update();
/* 80327E4C */ virtual void entry();
Expand All @@ -75,7 +73,7 @@ class J3DModel {
bool isCpuSkinningOn() const { return (mFlags & J3DMdlFlag_SkinPosCpu) && (mFlags & J3DMdlFlag_SkinNrmCpu); }

Mtx& getBaseTRMtx() { return mBaseTransformMtx; }
void i_setBaseTRMtx(Mtx m) { MTXCopy(m, mBaseTransformMtx); }
void setBaseTRMtx(Mtx m) { MTXCopy(m, mBaseTransformMtx); }
u32 getMtxCalcMode() const { return mFlags & 0x03; }
J3DVertexBuffer* getVertexBuffer() const { return (J3DVertexBuffer*)&mVertexBuffer; }
J3DMatPacket* getMatPacket(u16 idx) const { return &mMatPacket[idx]; }
Expand All @@ -89,11 +87,8 @@ class J3DModel {
void setUserArea(u32 area) { mUserArea = area; }
u32 getUserArea() const { return mUserArea; }
Vec* getBaseScale() { return &mBaseScale; }
void setAnmMtx(int i, Mtx m) { mMtxBuffer->setAnmMtx(i, m); }

// is there a better way to handle inlines with same name as non-inlines?
MtxP i_getAnmMtx(int p1) { return mMtxBuffer->getAnmMtx(p1); }
void i_setAnmMtx(int p1, Mtx mtx) { mMtxBuffer->setAnmMtx(p1, mtx); }
void setAnmMtx(int jointNo, Mtx m) { mMtxBuffer->setAnmMtx(jointNo, m); }
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }

/* 0x04 */ J3DModelData* mModelData;
/* 0x08 */ u32 mFlags;
Expand Down
2 changes: 1 addition & 1 deletion include/JSystem/JKernel/JKRHeap.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ inline void JKRFreeToSysHeap(void* ptr) {
systemHeap->free(ptr);
}

inline void i_JKRFree(void* ptr) {
inline void JKRFree(void* ptr) {
JKRHeap::free(ptr, NULL);
}

Expand Down
36 changes: 13 additions & 23 deletions include/d/a/d_a_alink.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class daAlink_matAnm_c : public J3DMaterialAnm {

static u8 m_morf_frame;

private:
/* 0x0F4 */ f32 field_0xf4;
/* 0x0F8 */ f32 field_0xf8;
/* 0x0FC */ f32 mNowOffsetX;
Expand Down Expand Up @@ -1669,16 +1668,9 @@ class daAlink_c : public daPy_py_c {
/* 800CF100 */ int procCoPeepSubjectivityInit();
/* 800CF1B8 */ int procCoPeepSubjectivity();
/* 800CF380 */ daAlink_c();
/* 800CFEB0 */ BOOL checkRideOn() const;
/* 800CFF4C */ BOOL checkAttentionLock();
/* 800D0020 */ BOOL checkFmChainGrabAnime() const;
/* 800D0048 */ BOOL checkSmallUpperGuardAnime() const;
/* 800D00EC */ u32 checkReinRide() const;
/* 800D0110 */ BOOL checkWolfEnemyThrowAnime() const;
/* 800D0138 */ int checkSpecialDemoMode() const;
/* 800D014C */ void setMidnaTalkStatus(u8);
/* 800D0164 */ void set3DStatus(u8, u8);
/* 800D018C */ u32 checkModeFlg(u32) const;
/* 800D2684 */ void checkCutTurnCharge();
/* 800D0E08 */ void checkLightSwordMtrl();
/* 800D0E98 */ BOOL checkSwordEquipAnime() const;
Expand Down Expand Up @@ -3136,15 +3128,14 @@ class daAlink_c : public daPy_py_c {
virtual bool checkCopyRodEquip() const;
virtual BOOL checkCutJumpMode() const;

// inlined dupes
u32 i_checkModeFlg(u32 pFlag) const { return mModeFlg & pFlag; }
bool i_checkSmallUpperGuardAnime() const { return checkUpperAnime(0x16); }
bool i_checkFmChainGrabAnime() const { return checkUpperAnime(0x62) || checkUpperAnime(0x2A0); }
u32 checkModeFlg(u32 pFlag) const { return mModeFlg & pFlag; }
bool checkSmallUpperGuardAnime() const { return checkUpperAnime(0x16); }
bool checkFmChainGrabAnime() const { return checkUpperAnime(0x62) || checkUpperAnime(0x2A0); }
Z2WolfHowlMgr* i_getWolfHowlMgrP() { return &mZ2WolfHowlMgr; }

// this might be a fake match, but helps fix usage in many functions
#pragma optimization_level 2
BOOL i_checkAttentionLock() { return mAttention->Lockon(); }
BOOL checkAttentionLock() { return mAttention->Lockon(); }
#pragma optimization_level 3

bool checkUpperAnime(u16 i_idx) const { return mUpperAnmHeap[UPPER_2].getIdx() == i_idx; }
Expand Down Expand Up @@ -3241,15 +3232,15 @@ class daAlink_c : public daPy_py_c {
}

s32 checkPlayerDemoMode() const { return mDemo.getDemoType(); }
BOOL i_checkSpecialDemoMode() const { return mDemo.getDemoType() == 5; }
static bool checkMidnaChargeAttack() { return i_dComIfGs_isEventBit(0x501); }
BOOL checkSpecialDemoMode() const { return mDemo.getDemoType() == 5; }
static bool checkMidnaChargeAttack() { return dComIfGs_isEventBit(0x501); }
u16 getMidnaMsgNum() const { return mMidnaMsgNum; }
u32 getStartEvent() { return fopAcM_GetParam(this) >> 0x18; }

const daAlink_AnmData* getAnmData(daAlink_ANM anmID) const { return &m_anmDataTable[anmID]; }
const daAlink_FaceTexData* getFaceTexData(daAlink_FTANM i_anmID) const { return &m_faceTexDataTable[i_anmID]; }

BOOL i_checkReinRide() const { return mRideStatus == 1 || mRideStatus == 2; }
BOOL checkReinRide() const { return mRideStatus == 1 || mRideStatus == 2; }
int getGrassHowlEventActor() const { return field_0x3198; }
MtxP getShieldMtx() const { return mShieldModel->getBaseTRMtx(); }

Expand All @@ -3273,7 +3264,7 @@ class daAlink_c : public daPy_py_c {

if (!var_r3) {
bool var_r3_2 = 0;
if (mProcID != PROC_FISHING_CAST && i_checkNoResetFlg2(FLG2_UNK_20000000)) {
if (mProcID != PROC_FISHING_CAST && checkNoResetFlg2(FLG2_UNK_20000000)) {
var_r3_2 = 1;
}

Expand All @@ -3287,7 +3278,7 @@ class daAlink_c : public daPy_py_c {

MtxP getCopyRodMtx() {
if (mHeldItemModel != NULL) {
return mHeldItemModel->i_getAnmMtx(0);
return mHeldItemModel->getAnmMtx(0);
}
return NULL;
}
Expand All @@ -3298,7 +3289,7 @@ class daAlink_c : public daPy_py_c {

void clearIronBallActor() { field_0x173c.SetActor(this); }
BOOL checkCanoeRideOwn(const fopAc_ac_c* param_0) const { return checkCanoeRide() && mRideAcKeep.getActorConst() == param_0; }
bool checkWolfDashMode() const { return i_checkNoResetFlg1(FLG1_DASH_MODE); }
bool checkWolfDashMode() const { return checkNoResetFlg1(FLG1_DASH_MODE); }
bool checkWolfLieWaterIn() const { return mWaterY > current.pos.y + 20.5f; }

J3DModel* initModel(J3DModelData* p_modelData, u32 param_1) {
Expand All @@ -3317,9 +3308,9 @@ class daAlink_c : public daPy_py_c {
bool checkHorseGetOffMode() const { return mProcID == PROC_HORSE_GETOFF; }
bool checkHorseRideOn() const { return mProcID == PROC_HORSE_RIDE; }

BOOL i_checkRideOn() const { return mRideStatus != 0; }
BOOL checkRideOn() const { return mRideStatus != 0; }

bool checkSwimDashMode() const { return i_checkNoResetFlg1(FLG1_DASH_MODE); }
bool checkSwimDashMode() const { return checkNoResetFlg1(FLG1_DASH_MODE); }

bool talkTrigger() const { return mItemTrigger & BTN_A; }
J3DAnmTransform* getNowAnmPackUnder(daAlink_UNDER i_idx) {
Expand Down Expand Up @@ -3399,7 +3390,6 @@ class daAlink_c : public daPy_py_c {

static u8 m_fEffParamProc[72];

private:
/* 0x0062C */ request_of_phase_process_class mPhaseReq;
/* 0x00634 */ char* mArcName;
/* 0x00638 */ JKRExpHeap* field_0x0638;
Expand Down Expand Up @@ -6250,7 +6240,7 @@ class daAlinkHIO_hookshot_c0 {
};

inline BOOL dComIfGs_isTransformLV(int i_no);
inline BOOL i_dComIfGs_isEventBit(const u16);
inline BOOL dComIfGs_isEventBit(const u16);

static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* param_0, void* param_1);
static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* param_0, void* param_1);
Expand Down
Loading

0 comments on commit 25d5107

Please sign in to comment.