diff --git a/asm/JSystem/J3DGraphAnimator/J3DJointTree/findImportantMtxIndex__12J3DJointTreeFv.s b/asm/JSystem/J3DGraphAnimator/J3DJointTree/findImportantMtxIndex__12J3DJointTreeFv.s deleted file mode 100644 index df12b637195..00000000000 --- a/asm/JSystem/J3DGraphAnimator/J3DJointTree/findImportantMtxIndex__12J3DJointTreeFv.s +++ /dev/null @@ -1,51 +0,0 @@ -lbl_80325C00: -/* 80325C00 A0 E3 00 1E */ lhz r7, 0x1e(r3) -/* 80325C04 38 80 00 00 */ li r4, 0 -/* 80325C08 38 A0 00 00 */ li r5, 0 -/* 80325C0C A0 03 00 36 */ lhz r0, 0x36(r3) -/* 80325C10 81 03 00 24 */ lwz r8, 0x24(r3) -/* 80325C14 81 23 00 28 */ lwz r9, 0x28(r3) -/* 80325C18 81 43 00 30 */ lwz r10, 0x30(r3) -/* 80325C1C 39 80 00 00 */ li r12, 0 -/* 80325C20 48 00 00 18 */ b lbl_80325C38 -lbl_80325C24: -/* 80325C24 55 8B 0B FC */ rlwinm r11, r12, 1, 0xf, 0x1e -/* 80325C28 80 C3 00 3C */ lwz r6, 0x3c(r3) -/* 80325C2C 7C C6 5A 2E */ lhzx r6, r6, r11 -/* 80325C30 7C CA 5B 2E */ sthx r6, r10, r11 -/* 80325C34 39 8C 00 01 */ addi r12, r12, 1 -lbl_80325C38: -/* 80325C38 55 86 04 3E */ clrlwi r6, r12, 0x10 -/* 80325C3C 7C 06 00 40 */ cmplw r6, r0 -/* 80325C40 41 80 FF E4 */ blt lbl_80325C24 -/* 80325C44 39 60 00 00 */ li r11, 0 -/* 80325C48 48 00 00 58 */ b lbl_80325CA0 -lbl_80325C4C: -/* 80325C4C 80 C3 00 20 */ lwz r6, 0x20(r3) -/* 80325C50 55 60 04 3E */ clrlwi r0, r11, 0x10 -/* 80325C54 7C 06 00 AE */ lbzx r0, r6, r0 -/* 80325C58 38 C0 00 00 */ li r6, 0 -/* 80325C5C C0 22 CA 18 */ lfs f1, lit_903(r2) -/* 80325C60 7C 09 03 A6 */ mtctr r0 -/* 80325C64 2C 00 00 00 */ cmpwi r0, 0 -/* 80325C68 40 81 00 24 */ ble lbl_80325C8C -lbl_80325C6C: -/* 80325C6C 7C 09 2C 2E */ lfsx f0, r9, r5 -/* 80325C70 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80325C74 40 80 00 0C */ bge lbl_80325C80 -/* 80325C78 FC 20 00 90 */ fmr f1, f0 -/* 80325C7C 7C C8 22 2E */ lhzx r6, r8, r4 -lbl_80325C80: -/* 80325C80 38 84 00 02 */ addi r4, r4, 2 -/* 80325C84 38 A5 00 04 */ addi r5, r5, 4 -/* 80325C88 42 00 FF E4 */ bdnz lbl_80325C6C -lbl_80325C8C: -/* 80325C8C A0 03 00 36 */ lhz r0, 0x36(r3) -/* 80325C90 7C 0B 02 14 */ add r0, r11, r0 -/* 80325C94 54 00 08 3C */ slwi r0, r0, 1 -/* 80325C98 7C CA 03 2E */ sthx r6, r10, r0 -/* 80325C9C 39 6B 00 01 */ addi r11, r11, 1 -lbl_80325CA0: -/* 80325CA0 7C 0B 38 00 */ cmpw r11, r7 -/* 80325CA4 41 80 FF A8 */ blt lbl_80325C4C -/* 80325CA8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphAnimator/J3DJointTree/func_80325A9C.s b/asm/JSystem/J3DGraphAnimator/J3DJointTree/func_80325A9C.s deleted file mode 100644 index c26fb3c0645..00000000000 --- a/asm/JSystem/J3DGraphAnimator/J3DJointTree/func_80325A9C.s +++ /dev/null @@ -1,97 +0,0 @@ -lbl_80325A9C: -/* 80325A9C 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80325AA0 7C 08 02 A6 */ mflr r0 -/* 80325AA4 90 01 00 34 */ stw r0, 0x34(r1) -/* 80325AA8 39 61 00 30 */ addi r11, r1, 0x30 -/* 80325AAC 48 03 C7 19 */ bl _savegpr_23 -/* 80325AB0 7C 77 1B 78 */ mr r23, r3 -/* 80325AB4 7C 98 23 78 */ mr r24, r4 -/* 80325AB8 7C B9 2B 78 */ mr r25, r5 -/* 80325ABC 7C DA 33 78 */ mr r26, r6 -/* 80325AC0 7C FB 3B 78 */ mr r27, r7 -/* 80325AC4 7F 1F C3 78 */ mr r31, r24 -lbl_80325AC8: -/* 80325AC8 3B C0 00 00 */ li r30, 0 -/* 80325ACC 3B A0 00 00 */ li r29, 0 -/* 80325AD0 3B 80 00 00 */ li r28, 0 -/* 80325AD4 80 99 00 00 */ lwz r4, 0(r25) -/* 80325AD8 A0 04 00 00 */ lhz r0, 0(r4) -/* 80325ADC 28 00 00 12 */ cmplwi r0, 0x12 -/* 80325AE0 41 81 00 A0 */ bgt lbl_80325B80 -/* 80325AE4 3C 60 80 3D */ lis r3, lit_871@ha /* 0x803CECA8@ha */ -/* 80325AE8 38 63 EC A8 */ addi r3, r3, lit_871@l /* 0x803CECA8@l */ -/* 80325AEC 54 00 10 3A */ slwi r0, r0, 2 -/* 80325AF0 7C 03 00 2E */ lwzx r0, r3, r0 -/* 80325AF4 7C 09 03 A6 */ mtctr r0 -/* 80325AF8 4E 80 04 20 */ bctr -/* 80325AFC 38 04 00 04 */ addi r0, r4, 4 -/* 80325B00 90 19 00 00 */ stw r0, 0(r25) -/* 80325B04 7E E3 BB 78 */ mr r3, r23 -/* 80325B08 7F E4 FB 78 */ mr r4, r31 -/* 80325B0C 7F 25 CB 78 */ mr r5, r25 -/* 80325B10 7F 46 D3 78 */ mr r6, r26 -/* 80325B14 7F 67 DB 78 */ mr r7, r27 -/* 80325B18 4B FF FF 85 */ bl makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable -/* 80325B1C 48 00 00 64 */ b lbl_80325B80 -/* 80325B20 38 04 00 04 */ addi r0, r4, 4 -/* 80325B24 90 19 00 00 */ stw r0, 0(r25) -/* 80325B28 48 00 00 C0 */ b lbl_80325BE8 -/* 80325B2C 48 00 00 BC */ b lbl_80325BE8 -/* 80325B30 80 77 00 18 */ lwz r3, 0x18(r23) -/* 80325B34 38 04 00 04 */ addi r0, r4, 4 -/* 80325B38 90 19 00 00 */ stw r0, 0(r25) -/* 80325B3C A0 04 00 02 */ lhz r0, 2(r4) -/* 80325B40 54 00 10 3A */ slwi r0, r0, 2 -/* 80325B44 7F C3 00 2E */ lwzx r30, r3, r0 -/* 80325B48 48 00 00 38 */ b lbl_80325B80 -/* 80325B4C 38 04 00 04 */ addi r0, r4, 4 -/* 80325B50 90 19 00 00 */ stw r0, 0(r25) -/* 80325B54 A0 04 00 02 */ lhz r0, 2(r4) -/* 80325B58 80 7A 00 08 */ lwz r3, 8(r26) -/* 80325B5C 54 00 10 3A */ slwi r0, r0, 2 -/* 80325B60 7F A3 00 2E */ lwzx r29, r3, r0 -/* 80325B64 48 00 00 1C */ b lbl_80325B80 -/* 80325B68 38 04 00 04 */ addi r0, r4, 4 -/* 80325B6C 90 19 00 00 */ stw r0, 0(r25) -/* 80325B70 A0 04 00 02 */ lhz r0, 2(r4) -/* 80325B74 80 7B 00 08 */ lwz r3, 8(r27) -/* 80325B78 54 00 10 3A */ slwi r0, r0, 2 -/* 80325B7C 7F 83 00 2E */ lwzx r28, r3, r0 -lbl_80325B80: -/* 80325B80 28 1E 00 00 */ cmplwi r30, 0 -/* 80325B84 41 82 00 28 */ beq lbl_80325BAC -/* 80325B88 7F DF F3 78 */ mr r31, r30 -/* 80325B8C 28 18 00 00 */ cmplwi r24, 0 -/* 80325B90 40 82 00 0C */ bne lbl_80325B9C -/* 80325B94 93 D7 00 10 */ stw r30, 0x10(r23) -/* 80325B98 4B FF FF 30 */ b lbl_80325AC8 -lbl_80325B9C: -/* 80325B9C 7F 03 C3 78 */ mr r3, r24 -/* 80325BA0 7F C4 F3 78 */ mr r4, r30 -/* 80325BA4 48 00 95 99 */ bl appendChild__8J3DJointFP8J3DJoint -/* 80325BA8 4B FF FF 20 */ b lbl_80325AC8 -lbl_80325BAC: -/* 80325BAC 28 1D 00 00 */ cmplwi r29, 0 -/* 80325BB0 41 82 00 20 */ beq lbl_80325BD0 -/* 80325BB4 80 18 00 58 */ lwz r0, 0x58(r24) -/* 80325BB8 28 00 00 00 */ cmplwi r0, 0 -/* 80325BBC 41 82 00 08 */ beq lbl_80325BC4 -/* 80325BC0 90 1D 00 04 */ stw r0, 4(r29) -lbl_80325BC4: -/* 80325BC4 93 B8 00 58 */ stw r29, 0x58(r24) -/* 80325BC8 93 1D 00 0C */ stw r24, 0xc(r29) -/* 80325BCC 4B FF FE FC */ b lbl_80325AC8 -lbl_80325BD0: -/* 80325BD0 28 1C 00 00 */ cmplwi r28, 0 -/* 80325BD4 41 82 FE F4 */ beq lbl_80325AC8 -/* 80325BD8 80 78 00 58 */ lwz r3, 0x58(r24) -/* 80325BDC 93 83 00 08 */ stw r28, 8(r3) -/* 80325BE0 90 7C 00 04 */ stw r3, 4(r28) -/* 80325BE4 4B FF FE E4 */ b lbl_80325AC8 -lbl_80325BE8: -/* 80325BE8 39 61 00 30 */ addi r11, r1, 0x30 -/* 80325BEC 48 03 C6 25 */ bl _restgpr_23 -/* 80325BF0 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80325BF4 7C 08 03 A6 */ mtlr r0 -/* 80325BF8 38 21 00 30 */ addi r1, r1, 0x30 -/* 80325BFC 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_scene/fopScn_Create__FPv.s b/asm/f_op/f_op_scene/fopScn_Create__FPv.s deleted file mode 100644 index 2eb65e6ab8e..00000000000 --- a/asm/f_op/f_op_scene/fopScn_Create__FPv.s +++ /dev/null @@ -1,31 +0,0 @@ -lbl_8001EC00: -/* 8001EC00 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8001EC04 7C 08 02 A6 */ mflr r0 -/* 8001EC08 90 01 00 14 */ stw r0, 0x14(r1) -/* 8001EC0C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 8001EC10 7C 7F 1B 78 */ mr r31, r3 -/* 8001EC14 88 03 00 0C */ lbz r0, 0xc(r3) -/* 8001EC18 7C 00 07 75 */ extsb. r0, r0 -/* 8001EC1C 40 82 00 38 */ bne lbl_8001EC54 -/* 8001EC20 80 7F 00 10 */ lwz r3, 0x10(r31) -/* 8001EC24 80 03 00 20 */ lwz r0, 0x20(r3) -/* 8001EC28 90 1F 01 AC */ stw r0, 0x1ac(r31) -/* 8001EC2C 38 7F 01 B0 */ addi r3, r31, 0x1b0 -/* 8001EC30 7F E4 FB 78 */ mr r4, r31 -/* 8001EC34 48 00 05 55 */ bl fopScnTg_Init__FP15scene_tag_classPv -/* 8001EC38 38 7F 01 B0 */ addi r3, r31, 0x1b0 -/* 8001EC3C 48 00 05 21 */ bl fopScnTg_ToQueue__FP15scene_tag_class -/* 8001EC40 80 7F 00 AC */ lwz r3, 0xac(r31) -/* 8001EC44 28 03 00 00 */ cmplwi r3, 0 -/* 8001EC48 41 82 00 0C */ beq lbl_8001EC54 -/* 8001EC4C 80 03 00 00 */ lwz r0, 0(r3) -/* 8001EC50 90 1F 00 B0 */ stw r0, 0xb0(r31) -lbl_8001EC54: -/* 8001EC54 80 7F 01 AC */ lwz r3, 0x1ac(r31) -/* 8001EC58 7F E4 FB 78 */ mr r4, r31 -/* 8001EC5C 48 00 38 71 */ bl fpcMtd_Create__FP20process_method_classPv -/* 8001EC60 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 8001EC64 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8001EC68 7C 08 03 A6 */ mtlr r0 -/* 8001EC6C 38 21 00 10 */ addi r1, r1, 0x10 -/* 8001EC70 4E 80 00 20 */ blr diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 94ce45c74d7..dcb89894acf 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -69,6 +69,7 @@ public: private: friend struct J3DJointFactory; + friend class J3DJointTree; /* 0x00 */ void* mCallBackUserData; /* 0x04 */ J3DJointCallBack mCallBack; diff --git a/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/include/JSystem/J3DGraphAnimator/J3DJointTree.h index 4937fdae320..80513fb4de3 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJointTree.h +++ b/include/JSystem/J3DGraphAnimator/J3DJointTree.h @@ -6,7 +6,11 @@ #include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" -struct J3DModelHierarchy {}; +struct J3DModelHierarchy { + /* 0x0 */ u16 mType; + /* 0x2 */ u16 mValue; +}; + struct J3DMaterialTable; struct J3DDrawMtxData { @@ -32,6 +36,11 @@ public: /* 80325D24 */ virtual ~J3DJointTree(); u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; } + u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; } + u16 * getWEvlpMixIndex() const { return mWEvlpMixIndex; } + f32 * getWEvlpMixWeight() const { return mWEvlpMixWeight; } + u16 * getWEvlpImportantMtxIndex() const { return mWEvlpImportantMtxIdx; } + u16 getDrawFullWgtMtxNum() const { return mDrawMtxData.mDrawFullWgtMtxNum; } u16 getJointNum() const { return mJointNum; } u16 getDrawMtxNum() const { return mDrawMtxData.mEntryNum; } JUTNameTab* getJointName() const { return mJointName; } @@ -49,11 +58,11 @@ private: /* 0x18 */ J3DJoint** mJointNodePointer; /* 0x1C */ u16 mJointNum; /* 0x1E */ u16 mWEvlpMtxNum; - /* 0x20 */ u32 mWEvlpMixMtxNum; - /* 0x24 */ s32 mWEvlpMixIndex; - /* 0x28 */ s32 mWEvlpMixWeight; + /* 0x20 */ u8* mWEvlpMixMtxNum; + /* 0x24 */ u16* mWEvlpMixIndex; + /* 0x28 */ f32* mWEvlpMixWeight; /* 0x2C */ Mtx* mInvJointMtx; - /* 0x30 */ s32 mWEvlpImportantMtxIdx; + /* 0x30 */ u16* mWEvlpImportantMtxIdx; /* 0x34 */ J3DDrawMtxData mDrawMtxData; /* 0x40 */ u32 field_0x40; /* 0x44 */ JUTNameTab* mJointName; diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h index 85cf0da8e97..372dacc9766 100644 --- a/include/JSystem/J3DGraphBase/J3DShape.h +++ b/include/JSystem/J3DGraphBase/J3DShape.h @@ -113,6 +113,7 @@ public: private: friend struct J3DShapeFactory; + friend class J3DJointTree; /* 0x04 */ J3DMaterial* mMaterial; /* 0x08 */ u16 mIndex; diff --git a/include/d/msg/d_msg_class.h b/include/d/msg/d_msg_class.h index 60e36b87584..ffcac0294a6 100644 --- a/include/d/msg/d_msg_class.h +++ b/include/d/msg/d_msg_class.h @@ -7,16 +7,16 @@ class msg_class : public leafdraw_class { public: - /* 0xC0 */ int field_0xc0; - /* 0xC4 */ create_tag_class field_0xc4; - /* 0xD8 */ leafdraw_method_class* field_0xd8; - /* 0xDC */ fopAc_ac_c* field_0xdc; - /* 0xE0 */ cXyz field_0xe0; - /* 0xEC */ u32 field_0xec; + /* 0xC0 */ int mMsgType; + /* 0xC4 */ create_tag_class mDwTg; + /* 0xD8 */ leafdraw_method_class* mSubMtd; + /* 0xDC */ fopAc_ac_c* mpActor; + /* 0xE0 */ cXyz mPos; + /* 0xEC */ u32 mMsgID; /* 0xF0 */ u32 field_0xf0; /* 0xF4 */ u32 field_0xf4; - /* 0xF8 */ u16 field_0xf8; - /* 0xFA */ u8 field_0xfa; + /* 0xF8 */ u16 mMode; + /* 0xFA */ u8 mSelectedChoiceIdx; /* 0xFC */ int field_0xfc; }; // Size: 0x100 diff --git a/include/d/s/d_s_logo.h b/include/d/s/d_s_logo.h index 0627e86dd1d..8acfd8a38c0 100644 --- a/include/d/s/d_s_logo.h +++ b/include/d/s/d_s_logo.h @@ -63,6 +63,7 @@ public: /* 8025854C */ void setRenderMode(); public: + /* 0x1C4 */ request_of_phase_process_class field_0x1c4; /* 0x1CC */ mDoDvdThd_toMainRam_c* sceneCommand; /* 0x1D0 */ JKRExpHeap* field_0x1d0; /* 0x1D4 */ JKRExpHeap* field_0x1d4; diff --git a/include/d/s/d_s_play.h b/include/d/s/d_s_play.h index f1ceca75cd4..3e13f3304fa 100644 --- a/include/d/s/d_s_play.h +++ b/include/d/s/d_s_play.h @@ -72,6 +72,7 @@ public: static s8 pauseTimer; static s8 nextPauseTimer; + /* 0x1C4 */ request_of_phase_process_class field_0x1c4; /* 0x1CC */ mDoDvdThd_toMainRam_c* sceneCommand; /* 0x1D0 */ mDoDvdThd_mountXArchive_c* field_0x1d0; /* 0x1D4 */ u8 field_0x1d4; diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index 421cca1f994..ad64ba223be 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -7,6 +7,15 @@ #include "dolphin/mtx/mtx.h" #include "f_pc/f_pc_leaf.h" +struct actor_process_profile_definition { + /* 0x00 */ leaf_process_profile_definition mBase; + /* 0x24 */ leafdraw_method_class* mSubMtd; + /* 0x28 */ int field_0x28; // mStatus + /* 0x2C */ u8 field_0x2c; // mActorType + /* 0x2D */ u8 field_0x2d; // mCullType + /* 0x2E */ u8 field_0x2e[2]; // Likely padding +}; + struct JKRSolidHeap; class dEvt_info_c { diff --git a/include/f_op/f_op_camera.h b/include/f_op/f_op_camera.h index 99336008cec..5f37c4635ff 100644 --- a/include/f_op/f_op_camera.h +++ b/include/f_op/f_op_camera.h @@ -3,8 +3,13 @@ #include "f_op/f_op_camera_mng.h" +struct camera_process_profile_definition { + /* 0x00 */ view_process_profile_definition mBase; + /* 0x3C */ leafdraw_method_class* mSubMtd; // Subclass methods +}; + static s32 fopCam_Draw(camera_class* param_1); static int fopCam_Execute(camera_class* pCamera); int fopCam_IsDelete(camera_class* pCamera); -#endif \ No newline at end of file +#endif diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 7cafe414270..67db9e21e1c 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -5,10 +5,15 @@ #include "dolphin/types.h" #include "f_op/f_op_actor.h" +struct msg_process_profile_definition { + /* 0x00 */ leaf_process_profile_definition mBase; + /* 0x24 */ leafdraw_method_class* mSubMtd; // Subclass methods +}; + struct fopMsg_prm_class { - /* 0x00 */ fopAc_ac_c* field_0x0; - /* 0x04 */ cXyz field_0x4; - /* 0x10 */ u32 field_0x10; + /* 0x00 */ fopAc_ac_c* mpActor; + /* 0x04 */ cXyz mPos; + /* 0x10 */ u32 mMsgID; /* 0x14 */ u32 field_0x14; /* 0x18 */ int field_0x18; }; // Size: 0x1C @@ -33,6 +38,7 @@ typedef int (*fopMsgCreateFunc)(void*); JKRExpHeap* fopMsgM_createExpHeap(u32, JKRHeap*); u32 fopMsgM_Create(s16, fopMsgCreateFunc, void*); +fopMsg_prm_class* fopMsgM_GetAppend(void* msg); void fopMsgM_setMessageID(unsigned int); void fopMsgM_destroyExpHeap(JKRExpHeap*); s32 fopMsgM_setStageLayer(void*); diff --git a/include/f_op/f_op_scene.h b/include/f_op/f_op_scene.h index c8afbbb68dd..d884b7bf849 100644 --- a/include/f_op/f_op_scene.h +++ b/include/f_op/f_op_scene.h @@ -11,15 +11,16 @@ struct request_of_phase_process_class; class mDoDvdThd_command_c; +typedef struct scene_process_profile_definition { + /* 0x00 */ node_process_profile_definition mBase; + /* 0x20 */ process_method_class* mpMtd; // Subclass methods +} scene_process_profile_definition; + class scene_class { public: - /* 0x000 */ base_process_class field_0x0; - /* 0x0B8 */ u8 field_0xb8[0x10]; - /* 0x0C8 */ u32 field_0xc8; - /* 0x0CC */ u8 field_0xcc[0xE0]; - /* 0x1AC */ process_method_class* mpProcessMtd; - /* 0x1B0 */ scene_tag_class field_0x1b0; - /* 0x1C4 */ request_of_phase_process_class field_0x1c4; + /* 0x000 */ process_node_class mBase; + /* 0x1AC */ process_method_class * mpMtd; + /* 0x1B0 */ scene_tag_class mScnTg; }; #endif diff --git a/include/f_op/f_op_scene_mng.h b/include/f_op/f_op_scene_mng.h index 62111e5da17..b3ecb7503bc 100644 --- a/include/f_op/f_op_scene_mng.h +++ b/include/f_op/f_op_scene_mng.h @@ -14,7 +14,7 @@ void fopScnM_Init(void); inline u32 fpcM_LayerID(const void* pProc) { return fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)pProc)->mSubType) != FALSE ? - ((scene_class*)pProc)->field_0xc8 : + ((scene_class*)pProc)->mBase.mLayer.mLayerID : 0xFFFFFFFF; } diff --git a/include/f_op/f_op_view.h b/include/f_op/f_op_view.h index af5aea5963b..c87cc86cf1c 100644 --- a/include/f_op/f_op_view.h +++ b/include/f_op/f_op_view.h @@ -6,6 +6,16 @@ #include "dolphin/types.h" #include "f_pc/f_pc_leaf.h" +struct view_process_profile_definition { + /* 0x00 */ leaf_process_profile_definition mBase; + /* 0x24 */ leafdraw_method_class* mSubMtd; // Subclass methods + /* 0x28 */ u32 unk28; + /* 0x2C */ u32 unk2C; + /* 0x30 */ u32 unk30; + /* 0x34 */ u32 unk34; + /* 0x38 */ u32 unk38; +}; + class lookat_class { public: /* 0x00 */ cXyz mEye; diff --git a/include/f_pc/f_pc_draw_priority.h b/include/f_pc/f_pc_draw_priority.h index 6acd5cba2ab..9608bd25d5d 100644 --- a/include/f_pc/f_pc_draw_priority.h +++ b/include/f_pc/f_pc_draw_priority.h @@ -8,7 +8,7 @@ typedef struct draw_priority_class { s16 mPriority; } draw_priority_class; -s32 fpcDwPi_Get(const draw_priority_class* pDwPi); +s16 fpcDwPi_Get(const draw_priority_class* pDwPi); void fpcDwPi_Set(draw_priority_class* pDwPi, s16 p); void fpcDwPi_Init(draw_priority_class* pDwPi, s16 p); diff --git a/include/f_pc/f_pc_layer.h b/include/f_pc/f_pc_layer.h index 4e9e1f793b9..78229474dfd 100644 --- a/include/f_pc/f_pc_layer.h +++ b/include/f_pc/f_pc_layer.h @@ -11,14 +11,14 @@ struct process_method_tag_class; typedef struct process_node_class process_node_class; typedef struct layer_class { - node_class mNode; - u32 mLayerID; - node_lists_tree_class mNodeListTree; - process_node_class* mpPcNode; - node_list_class mCancelList; + /* 0x00 */ node_class mNode; + /* 0x0C */ u32 mLayerID; + /* 0x10 */ node_lists_tree_class mNodeListTree; + /* 0x18 */ process_node_class* mpPcNode; + /* 0x1C */ node_list_class mCancelList; struct { - s16 mCreatingCount; - s16 mDeletingCount; + /* 0x28 */ s16 mCreatingCount; + /* 0x2A */ s16 mDeletingCount; } counts; } layer_class; diff --git a/include/f_pc/f_pc_leaf.h b/include/f_pc/f_pc_leaf.h index 05b85796ab4..a646cd27585 100644 --- a/include/f_pc/f_pc_leaf.h +++ b/include/f_pc/f_pc_leaf.h @@ -22,15 +22,12 @@ typedef struct leafdraw_class { typedef struct leaf_process_profile_definition { /* 0x00 */ process_profile_definition mBase; - /* 0x28 */ int field_0x28; - /* 0x2C */ u8 field_0x2c; - /* 0x2D */ u8 field_0x2d; - /* 0x2E */ u8 field_0x2e[0x2]; // extended from here to end to make fopCam_Create match. might be wrong - /* 0x30 */ u8 field_0x30[0xc]; - /* 0x3C */ leafdraw_method_class* mMethods; + /* 0x1C */ leafdraw_method_class* mSubMtd; // Subclass methods + /* 0x20 */ s16 mPriority; // mDrawPriority + /* 0x22 */ u8 unk22[2]; // Likely padding... } leaf_process_profile_definition; -s32 fpcLf_GetPriority(const leafdraw_class* pLeaf); +s16 fpcLf_GetPriority(const leafdraw_class* pLeaf); s32 fpcLf_DrawMethod(leafdraw_method_class* pMthd, void* pUserData); s32 fpcLf_Draw(leafdraw_class* pMthd); s32 fpcLf_Execute(leafdraw_class* pLeaf); diff --git a/include/f_pc/f_pc_manager.h b/include/f_pc/f_pc_manager.h index cebe63b4548..7df7c5bc913 100644 --- a/include/f_pc/f_pc_manager.h +++ b/include/f_pc/f_pc_manager.h @@ -54,8 +54,8 @@ inline bool fpcM_IsFirstCreating(void* proc) { return ((base_process_class*)proc)->mInitState == 0; } -inline leaf_process_profile_definition* fpcM_GetProfile(void* proc) { - return (leaf_process_profile_definition*)((base_process_class*)proc)->mpProf; +inline process_profile_definition* fpcM_GetProfile(void* proc) { + return (process_profile_definition*)((base_process_class*)proc)->mpProf; } inline void* fpcM_GetAppend(const void* proc) { diff --git a/include/f_pc/f_pc_node.h b/include/f_pc/f_pc_node.h index 29b63797752..0043e7c4f71 100644 --- a/include/f_pc/f_pc_node.h +++ b/include/f_pc/f_pc_node.h @@ -8,19 +8,20 @@ typedef struct nodedraw_method_class { process_method_class mBase; - process_method_func mNodedrawFunc; + process_method_func mpDrawFunc; } nodedraw_method_class; typedef struct process_node_class { - base_process_class mBase; - nodedraw_method_class* mpNodeMtd; - layer_class mLayer; - node_list_class mLayerNodeLists[16]; - s8 mUnk0; + /* 0x00 */ base_process_class mBase; + /* 0xB8 */ nodedraw_method_class* mpNodeMtd; + /* 0xBC */ layer_class mLayer; + /* 0xE8 */ node_list_class mLayerNodeLists[16]; + /* 0x1A8 */ s8 mUnk0; } process_node_class; typedef struct node_process_profile_definition { - process_profile_definition mBase; + /* 0x00 */ process_profile_definition mBase; + /* 0x1C */ process_method_class* mSubMtd; // Subclass methods } node_process_profile_definition; s32 fpcNd_DrawMethod(nodedraw_method_class* pNodeMethod, void* pData); diff --git a/include/f_pc/f_pc_profile.h b/include/f_pc/f_pc_profile.h index a50104b126d..f6a51bf7f6c 100644 --- a/include/f_pc/f_pc_profile.h +++ b/include/f_pc/f_pc_profile.h @@ -14,14 +14,10 @@ typedef struct process_profile_definition { /* 0x06 */ u16 mListPrio; /* 0x08 */ s16 mProcName; /* 0x0A */ s16 unkA; // probably padding - /* 0x0C */ struct process_method_class* mpPcMtd; + /* 0x0C */ process_method_class* mSubMtd; // Subclass methods /* 0x10 */ s32 mSize; /* 0x14 */ s32 mSizeOther; /* 0x18 */ s32 mParameters; - /* 0x1C */ leafdraw_method_class* mLfDrwMth; - /* 0x20 */ s16 mPriority; - /* 0x22 */ u8 unk22[2]; - /* 0x24 */ leafdraw_method_class* mMethods; } process_profile_definition; #define LAYER_DEFAULT (-2) diff --git a/libs/JSystem/J3DGraphAnimator/J3DJointTree.cpp b/libs/JSystem/J3DGraphAnimator/J3DJointTree.cpp index 56ce30c90d3..e757921fe42 100644 --- a/libs/JSystem/J3DGraphAnimator/J3DJointTree.cpp +++ b/libs/JSystem/J3DGraphAnimator/J3DJointTree.cpp @@ -4,101 +4,11 @@ // #include "JSystem/J3DGraphAnimator/J3DJointTree.h" +#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h" +#include "JSystem/J3DGraphAnimator/J3DShapeTable.h" #include "dol2asm.h" #include "dolphin/types.h" -// -// Forward References: -// - -extern "C" void __ct__12J3DJointTreeFv(); -extern "C" void -makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable(); -extern "C" void findImportantMtxIndex__12J3DJointTreeFv(); -extern "C" void calc__12J3DJointTreeFP12J3DMtxBufferRC3VecRA3_A4_Cf(); -extern "C" void setMtxBuffer__10J3DMtxCalcFP12J3DMtxBuffer(); -extern "C" void __dt__12J3DJointTreeFv(); - -// -// External References: -// - -extern "C" void __dl__FPv(); -extern "C" void __ct__14J3DDrawMtxDataFv(); -extern "C" void __dt__14J3DDrawMtxDataFv(); -extern "C" void appendChild__8J3DJointFP8J3DJoint(); -extern "C" void recursiveCalc__8J3DJointFv(); -extern "C" void _savegpr_23(); -extern "C" void _restgpr_23(); -extern "C" u8 mMtxBuffer__10J3DMtxCalc[4]; -extern "C" u8 mCurrentMtxCalc__8J3DJoint[4 + 4 /* padding */]; - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 803CECA8-803CECF4 -00001 004C+00 1/1 0/0 0/0 .data @871 */ -SECTION_DATA static void* lit_871[19] = { - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0x90), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0x60), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0x84), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xE4), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0x94), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xB0), - (void*)(((char*) - makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable) + - 0xCC), -}; - /* 80325A18-80325A9C 320358 0084+00 0/0 1/1 0/0 .text __ct__12J3DJointTreeFv */ J3DJointTree::J3DJointTree() : mHierarchy(NULL), mFlags(0), mModelDataType(0), mRootNode(NULL), mBasicMtxCalc(NULL), @@ -109,33 +19,105 @@ J3DJointTree::J3DJointTree() /* 80325A9C-80325C00 3203DC 0164+00 1/0 2/2 0/0 .text * makeHierarchy__12J3DJointTreeFP8J3DJointPPC17J3DModelHierarchyP16J3DMaterialTableP13J3DShapeTable */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DJointTree::makeHierarchy(J3DJoint* param_0, J3DModelHierarchy const** param_1, - J3DMaterialTable* param_2, J3DShapeTable* param_3) { - nofralloc -#include "asm/JSystem/J3DGraphAnimator/J3DJointTree/func_80325A9C.s" -} -#pragma pop +void J3DJointTree::makeHierarchy(J3DJoint* pJoint, J3DModelHierarchy const** pHierarchy, + J3DMaterialTable* pMaterialTable, J3DShapeTable* pShapeTable) { + enum { + kTypeEnd = 0x00, + kTypeBeginChild = 0x01, + kTypeEndChild = 0x02, + kTypeJoint = 0x10, + kTypeMaterial = 0x11, + kTypeShape = 0x12, + }; -/* ############################################################################################## */ -/* 80456418-80456420 004A18 0004+04 1/1 0/0 0/0 .sdata2 @903 */ -SECTION_SDATA2 static f32 lit_903[1 + 1 /* padding */] = { - -1.0f / 10.0f, - /* padding */ - 0.0f, -}; + J3DJoint * curJoint = pJoint; + + while (true) { + J3DJoint * newJoint = NULL; + J3DMaterial * newMaterial = NULL; + J3DShape * newShape = NULL; + const J3DModelHierarchy * inf = *pHierarchy; + u16 val; + + switch (inf->mType) { + case kTypeBeginChild: + *pHierarchy = inf + 1; + makeHierarchy(curJoint, pHierarchy, pMaterialTable, pShapeTable); + break; + case kTypeEndChild: + *pHierarchy = inf + 1; + return; + case kTypeEnd: + return; + case kTypeJoint: + { + J3DJoint ** jointNodePointer = mJointNodePointer; + *pHierarchy = inf + 1; + newJoint = jointNodePointer[inf->mValue]; + } + break; + case kTypeMaterial: + *pHierarchy = inf + 1; + val = inf->mValue; + newMaterial = pMaterialTable->getMaterialNodePointer(val); + break; + case kTypeShape: + *pHierarchy = inf + 1; + val = inf->mValue; + newShape = pShapeTable->getShapeNodePointer(val); + break; + } + + if (newJoint != NULL) { + curJoint = newJoint; + if (pJoint == NULL) + mRootNode = newJoint; + else + pJoint->appendChild(newJoint); + } else if (newMaterial != NULL) { + if (pJoint->getMesh() != NULL) + newMaterial->mNext = pJoint->getMesh(); + pJoint->mMesh = newMaterial; + newMaterial->mJoint = pJoint; + } else if (newShape != NULL) { + newMaterial = pJoint->getMesh(); + newMaterial->mShape = newShape; + newShape->mMaterial = newMaterial; + } + } +} /* 80325C00-80325CAC 320540 00AC+00 0/0 2/2 0/0 .text findImportantMtxIndex__12J3DJointTreeFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DJointTree::findImportantMtxIndex() { - nofralloc -#include "asm/JSystem/J3DGraphAnimator/J3DJointTree/findImportantMtxIndex__12J3DJointTreeFv.s" +void J3DJointTree::findImportantMtxIndex() { + const s32 wEvlpMtxNum = getWEvlpMtxNum(); + u32 tableIdx = 0; + const u16 drawFullWgtMtxNum = getDrawFullWgtMtxNum(); + const u16 * wEvlpMixIndex = getWEvlpMixIndex(); + const f32 * wEvlpMixWeight = getWEvlpMixWeight(); + u16 * wEvlpImportantMtxIdx = getWEvlpImportantMtxIndex(); + + // Rigid matrices are easy. + for (u16 i = 0; i < drawFullWgtMtxNum; i++) + wEvlpImportantMtxIdx[i] = mDrawMtxData.mDrawMtxIndex[i]; + + // For envelope matrices, we need to find the matrix with the most contribution. + for (s32 i = 0; i < wEvlpMtxNum; i++) { + s32 mixNum = getWEvlpMixMtxNum(i); + u16 bestIdx = 0; + f32 bestWeight = -0.1f; + + for (s32 j = 0; j < mixNum; j++) { + if (bestWeight < wEvlpMixWeight[tableIdx]) { + bestWeight = wEvlpMixWeight[tableIdx]; + bestIdx = wEvlpMixIndex[tableIdx]; + } + + tableIdx++; + } + + wEvlpImportantMtxIdx[i + mDrawMtxData.mDrawFullWgtMtxNum] = bestIdx; + } } -#pragma pop /* 80325CAC-80325D1C 3205EC 0070+00 1/0 0/0 0/0 .text * calc__12J3DJointTreeFP12J3DMtxBufferRC3VecRA3_A4_Cf */ diff --git a/src/d/a/d_a_alink_demo.inc b/src/d/a/d_a_alink_demo.inc index 3358f549753..b5750737e68 100644 --- a/src/d/a/d_a_alink_demo.inc +++ b/src/d/a/d_a_alink_demo.inc @@ -230,10 +230,10 @@ BOOL daAlink_c::checkEndMessage(u32 param_0) { msg_class* msg = fopMsgM_SearchByID(mMsgClassID); if (msg != NULL) { - if (msg->field_0xf8 == 14) { - msg->field_0xf8 = 16; - } else if (msg->field_0xf8 == 0x12) { - msg->field_0xf8 = 0x13; + if (msg->mMode == 14) { + msg->mMode = 16; + } else if (msg->mMode == 0x12) { + msg->mMode = 0x13; return 1; } } diff --git a/src/d/event/d_event_data.cpp b/src/d/event/d_event_data.cpp index 982b3d06d90..e38c47e40bf 100644 --- a/src/d/event/d_event_data.cpp +++ b/src/d/event/d_event_data.cpp @@ -635,10 +635,10 @@ void dEvDtStaff_c::specialProcMessage() { break; case 'END\0': case 'FINI': - work->mLMsg->field_0xf8 = 0x10; + work->mLMsg->mMode = 0x10; break; case 'CONT': - work->mLMsg->field_0xf8 = 0xF; + work->mLMsg->mMode = 0xF; int* ptr = dComIfGp_evmng_getMyIntegerP(staffId, "msgNo"); if (ptr == NULL) { ptr = dComIfGp_evmng_getMyIntegerP(staffId, "No"); @@ -702,7 +702,7 @@ void dEvDtStaff_c::specialProcMessage() { } break; case 'PUSH': - if (work->mLMsg->field_0xf8 == 0xE) { + if (work->mLMsg->mMode == 0xE) { dComIfGp_evmng_cutEnd(staffId); } break; @@ -724,14 +724,14 @@ void dEvDtStaff_c::specialProcMessage() { break; } - switch (work->mLMsg->field_0xf8) { + switch (work->mLMsg->mMode) { case 0xE: - work->mLMsg->field_0xf8 = 0x10; + work->mLMsg->mMode = 0x10; break; case 0x11: break; case 0x12: - work->mLMsg->field_0xf8 = 0x13; + work->mLMsg->mMode = 0x13; work->_0 = UINT32_MAX; work->mLMsg = NULL; work->mMsgSubstanceNum--; @@ -757,8 +757,8 @@ void dEvDtStaff_c::specialProcMessage() { case 'FINI': if (work->mLMsg == NULL) { dComIfGp_evmng_cutEnd(staffId); - } else if (work->mLMsg->field_0xf8 == 0x12) { - work->mLMsg->field_0xf8 = 0x13; + } else if (work->mLMsg->mMode == 0x12) { + work->mLMsg->mMode = 0x13; work->_0 = UINT32_MAX; work->mLMsg = NULL; dComIfGp_evmng_cutEnd(staffId); @@ -768,7 +768,7 @@ void dEvDtStaff_c::specialProcMessage() { dComIfGp_evmng_cutEnd(staffId); break; case 'END\0': - switch (work->mLMsg->field_0xf8) { + switch (work->mLMsg->mMode) { case 0x11: case 0x12: dComIfGp_evmng_cutEnd(staffId); diff --git a/src/d/meter/d_meter2.cpp b/src/d/meter/d_meter2.cpp index aa60e21eb61..869e615b7ff 100644 --- a/src/d/meter/d_meter2.cpp +++ b/src/d/meter/d_meter2.cpp @@ -1426,13 +1426,14 @@ SECTION_DATA static leafdraw_method_class l_dMeter2_Method = { }; /* 803BFA68-803BFA90 -00001 0028+00 0/0 0/0 1/0 .data g_profile_METER2 */ -SECTION_DATA extern process_profile_definition g_profile_METER2 = { +SECTION_DATA extern msg_process_profile_definition g_profile_METER2 = { -3, 12, -3, 0x0316, 0, (process_method_class*)&g_fpcLf_Method, 0x4C0, 0, 0, &g_fopMsg_Method, 0x0301, 0, - 0, &l_dMeter2_Method}; + 0, &l_dMeter2_Method +}; /* 80399338-80399338 025998 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/msg/d_msg_flow.cpp b/src/d/msg/d_msg_flow.cpp index 7887fcfeda6..c635a2be159 100644 --- a/src/d/msg/d_msg_flow.cpp +++ b/src/d/msg/d_msg_flow.cpp @@ -486,11 +486,11 @@ int dMsgFlow_c::doFlow(fopAc_ac_c* param_0, fopAc_ac_c** param_1, int flow) { if (field_0x26 != 0 || field_0x27 != 0) { msg_class* msg = fopMsgM_SearchByID(mMsg); if (msg != NULL) { - if (msg->field_0xf8 != 0x12) { + if (msg->mMode != 0x12) { return 0; } - msg->field_0xf8 = 0x13; + msg->mMode = 0x13; mMsg = -1; } field_0x27 = 0; @@ -940,7 +940,7 @@ asm int dMsgFlow_c::query004(mesg_flow_node_branch* param_0, fopAc_ac_c* param_1 /* 8024B2C0-8024B2F8 245C00 0038+00 2/1 1/1 1/1 .text * query005__10dMsgFlow_cFP21mesg_flow_node_branchP10fopAc_ac_ci */ int dMsgFlow_c::query005(mesg_flow_node_branch*, fopAc_ac_c*, int) { - return mChoiceNo = fopMsgM_SearchByID(mMsg)->field_0xfa; + return mChoiceNo = fopMsgM_SearchByID(mMsg)->mSelectedChoiceIdx; } /* 8024B2F8-8024B32C 245C38 0034+00 1/0 0/0 0/0 .text @@ -1261,7 +1261,7 @@ int dMsgFlow_c::query035(mesg_flow_node_branch* flow_node, fopAc_ac_c*, int) { /* 8024BC3C-8024BC80 24657C 0044+00 1/0 0/0 0/0 .text * query036__10dMsgFlow_cFP21mesg_flow_node_branchP10fopAc_ac_ci */ int dMsgFlow_c::query036(mesg_flow_node_branch*, fopAc_ac_c*, int) { - int tmp = fopMsgM_SearchByID(mMsg)->field_0xfa; + int tmp = fopMsgM_SearchByID(mMsg)->mSelectedChoiceIdx; if (dMsgObject_getMsgObjectClass()->getSelectPushFlag() == 2) { tmp = 2; @@ -1273,7 +1273,7 @@ int dMsgFlow_c::query036(mesg_flow_node_branch*, fopAc_ac_c*, int) { /* 8024BC80-8024BCC4 2465C0 0044+00 1/0 0/0 0/0 .text * query037__10dMsgFlow_cFP21mesg_flow_node_branchP10fopAc_ac_ci */ int dMsgFlow_c::query037(mesg_flow_node_branch*, fopAc_ac_c*, int) { - int tmp = fopMsgM_SearchByID(mMsg)->field_0xfa; + int tmp = fopMsgM_SearchByID(mMsg)->mSelectedChoiceIdx; if (dMsgObject_getMsgObjectClass()->getSelectPushFlag() == 2) { tmp = 3; diff --git a/src/d/s/d_s_name.cpp b/src/d/s/d_s_name.cpp index 607115dfac4..375268dfd77 100644 --- a/src/d/s/d_s_name.cpp +++ b/src/d/s/d_s_name.cpp @@ -91,6 +91,7 @@ public: /* 802590F8 */ void changeGameScene(); private: + /* 0x1C4 */ request_of_phase_process_class field_0x1c4; /* 0x1CC */ JKRExpHeap* mHeap; /* 0x1D0 */ JKRExpHeap* field_0x1d0; /* 0x1D4 */ dScnName_camera_c mCamera; diff --git a/src/f_op/f_op_actor.cpp b/src/f_op/f_op_actor.cpp index b5af90e1c7c..a59b23cee3d 100644 --- a/src/f_op/f_op_actor.cpp +++ b/src/f_op/f_op_actor.cpp @@ -271,7 +271,7 @@ static int fopAc_Create(void* actor) { fopAc_ac_c* ac = (fopAc_ac_c*)actor; if (fpcM_IsFirstCreating(actor)) { - leaf_process_profile_definition* profile = fpcM_GetProfile(actor); + actor_process_profile_definition* profile = (actor_process_profile_definition*) fpcM_GetProfile(actor); ac->mAcType = fpcBs_MakeOfType(&g_fopAc_type); ac->mSubMtd = (profile_method_class*)profile->mBase.mMethods; @@ -340,7 +340,7 @@ static int fopAc_Create(void* actor) { int ret = fpcMtd_Create((process_method_class*)ac->mSubMtd, ac); if (ret == 4) { - s16 priority = fpcLf_GetPriority(ac); + s32 priority = fpcLf_GetPriority(ac); fopDwTg_ToDrawQ(&ac->mDwTg, priority); } else if (ret == 5) { fopAcM_OnCondition(ac, 0x10); diff --git a/src/f_op/f_op_camera.cpp b/src/f_op/f_op_camera.cpp index 773d521f4d7..64d09378254 100644 --- a/src/f_op/f_op_camera.cpp +++ b/src/f_op/f_op_camera.cpp @@ -9,6 +9,7 @@ #include "dol2asm.h" #include "dolphin/types.h" #include "f_op/f_op_draw_tag.h" +#include "f_op/f_op_msg_mng.h" #include "f_pc/f_pc_leaf.h" /* 8001E140-8001E180 018A80 0040+00 1/0 0/0 0/0 .text fopCam_Draw__FP12camera_class */ @@ -58,8 +59,8 @@ static int fopCam_Create(void* i_actorP) { camera_class* camera = (camera_class*)i_actorP; if (fpcM_IsFirstCreating(i_actorP)) { - leaf_process_profile_definition* profile = fpcM_GetProfile(i_actorP); - camera->mpMtd = profile->mMethods; + camera_process_profile_definition* profile = (camera_process_profile_definition*) fpcM_GetProfile(i_actorP); + camera->mpMtd = profile->mSubMtd; fopDwTg_Init(&camera->mCreateTag, camera); u32* append = (u32*)fpcM_GetAppend(camera); @@ -70,10 +71,9 @@ static int fopCam_Create(void* i_actorP) { } int ret = fpcMtd_Create(&camera->mpMtd->mBase, camera); - - if (ret == 4) { - s16 prior = fpcLf_GetPriority(camera); - fopDwTg_ToDrawQ(&camera->mCreateTag, prior); + if (ret == cPhs_COMPLEATE_e) { + s32 priority = fpcLf_GetPriority(camera); + fopDwTg_ToDrawQ(&camera->mCreateTag, priority); } return ret; @@ -81,10 +81,10 @@ static int fopCam_Create(void* i_actorP) { /* ############################################################################################## */ /* 803A3860-803A3878 -00001 0014+04 0/0 2/0 0/0 .data g_fopCam_Method */ -void* g_fopCam_Method[5] = { - fopCam_Create, - fopCam_Delete, - fopCam_Execute, - fopCam_IsDelete, - fopCam_Draw +leafdraw_method_class g_fopCam_Method = { + (process_method_func)fopCam_Create, + (process_method_func)fopCam_Delete, + (process_method_func)fopCam_Execute, + (process_method_func)fopCam_IsDelete, + (process_method_func)fopCam_Draw }; diff --git a/src/f_op/f_op_kankyo.cpp b/src/f_op/f_op_kankyo.cpp index cb76f4aece6..e8b4f2b48ad 100644 --- a/src/f_op/f_op_kankyo.cpp +++ b/src/f_op/f_op_kankyo.cpp @@ -88,7 +88,8 @@ static int fopKy_Create(void* param_0) { kankyo_class* env = (kankyo_class*)param_0; if (fpcM_IsFirstCreating(param_0)) { - leaf_process_profile_definition* profile = fpcM_GetProfile(param_0); + // TODO: This should be kankyo_process_profile_definition + leaf_process_profile_definition* profile = (leaf_process_profile_definition*) fpcM_GetProfile(param_0); env->field_0xc0 = fpcBs_MakeOfType(&fopKy_KANKYO_TYPE); env->field_0xd8 = profile->mBase.mMethods; diff --git a/src/f_op/f_op_msg.cpp b/src/f_op/f_op_msg.cpp index cc8d9c42f2d..ddef7fcd096 100644 --- a/src/f_op/f_op_msg.cpp +++ b/src/f_op/f_op_msg.cpp @@ -4,6 +4,7 @@ // #include "f_op/f_op_msg.h" +#include "f_op/f_op_msg_mng.h" #include "d/msg/d_msg_class.h" #include "d/s/d_s_play.h" #include "dol2asm.h" @@ -42,7 +43,7 @@ extern "C" void fpcMtd_Create__FP20process_method_classPv(); /* 8001F488-8001F4B0 019DC8 0028+00 1/0 0/0 0/0 .text fopMsg_Draw__FPv */ static int fopMsg_Draw(void* msg) { msg_class* m = static_cast(msg); - return fpcLf_DrawMethod(m->field_0xd8, msg); + return fpcLf_DrawMethod(m->mSubMtd, msg); } /* 8001F4B0-8001F4E8 019DF0 0038+00 1/0 0/0 0/0 .text fopMsg_Execute__FPv */ @@ -51,7 +52,7 @@ static int fopMsg_Execute(void* msg) { int stat = 1; if (dScnPly_c::isPause()) { - stat = fpcMtd_Execute(&m->field_0xd8->mBase, msg); + stat = fpcMtd_Execute(&m->mSubMtd->mBase, msg); } return stat; @@ -61,9 +62,9 @@ static int fopMsg_Execute(void* msg) { static int fopMsg_IsDelete(void* msg) { msg_class* m = static_cast(msg); - int stat = fpcMtd_IsDelete(&m->field_0xd8->mBase, msg); + int stat = fpcMtd_IsDelete(&m->mSubMtd->mBase, msg); if (stat == 1) { - fopDwTg_DrawQTo(&m->field_0xc4); + fopDwTg_DrawQTo(&m->mDwTg); } return stat; @@ -73,8 +74,8 @@ static int fopMsg_IsDelete(void* msg) { static int fopMsg_Delete(void* msg) { msg_class* m = static_cast(msg); - int stat = fpcMtd_Delete(&m->field_0xd8->mBase, msg); - fopDwTg_DrawQTo(&m->field_0xc4); + int stat = fpcMtd_Delete(&m->mSubMtd->mBase, msg); + fopDwTg_DrawQTo(&m->mDwTg); return stat; } @@ -84,6 +85,35 @@ static int fopMsg_Delete(void* msg) { static int fopMsg_MSG_TYPE; /* 8001F588-8001F660 019EC8 00D8+00 1/0 0/0 0/0 .text fopMsg_Create__FPv */ +#if defined NON_MATCHING +int fopMsg_Create(void* data) { + // r31 / r30 swap + msg_class *msg = (msg_class*)data; + + if (fpcM_IsFirstCreating(msg)) { + msg_process_profile_definition* profile = (msg_process_profile_definition*) fpcM_GetProfile(msg); + msg->mMsgType = fpcBs_MakeOfType(&fopMsg_MSG_TYPE); + msg->mSubMtd = profile->mMethods; + fopDwTg_Init(&msg->mDwTg, msg); + fopMsg_prm_class * prm = fopMsgM_GetAppend(msg); + if (prm != NULL) { + msg->mpActor = prm->mpActor; + msg->mPos = prm->mPos; + msg->mMsgID = prm->mMsgID; + msg->field_0xf0 = prm->field_0x14; + msg->field_0xf4 = prm->field_0x18; + } + } + + int status = fpcMtd_Create(&msg->mSubMtd->mBase, msg); + if (status == cPhs_COMPLEATE_e) { + s32 priority = fpcLf_GetPriority(msg); + fopDwTg_ToDrawQ(&msg->mDwTg, priority); + } + + return status; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -92,9 +122,14 @@ static asm int fopMsg_Create(void* param_0) { #include "asm/f_op/f_op_msg/fopMsg_Create__FPv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 803A3958-803A3970 -00001 0014+04 0/0 5/0 0/0 .data g_fopMsg_Method */ -SECTION_DATA extern leafdraw_method_class g_fopMsg_Method = { - &fopMsg_Create, &fopMsg_Delete, &fopMsg_Execute, &fopMsg_IsDelete, &fopMsg_Draw, +leafdraw_method_class g_fopMsg_Method = { + (process_method_func) fopMsg_Create, + (process_method_func) fopMsg_Delete, + (process_method_func) fopMsg_Execute, + (process_method_func) fopMsg_IsDelete, + (process_method_func) fopMsg_Draw, }; diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index a32943bbd8e..78d5c816b25 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -65,7 +65,7 @@ SECTION_SDATA2 static u8 lit_3902[4] = { /* 8001FA6C-8001FB50 01A3AC 00E4+00 1/1 0/0 0/0 .text createAppend__FP10fopAc_ac_cP4cXyzPUlPUlUi */ -static fopMsg_prm_class* createAppend(fopAc_ac_c* param_0, cXyz* param_1, u32* param_2, +static fopMsg_prm_class* createAppend(fopAc_ac_c* pActor, cXyz* pPos, u32* pMsgID, u32* param_3, unsigned int param_4) { fopMsg_prm_class* params = static_cast(cMl::memalignB(-4, sizeof(fopMsg_prm_class))); @@ -74,23 +74,23 @@ static fopMsg_prm_class* createAppend(fopAc_ac_c* param_0, cXyz* param_1, u32* p return NULL; } - params->field_0x0 = param_0; - dMsgObject_setTalkActor(param_0); + params->mpActor = pActor; + dMsgObject_setTalkActor(pActor); - if (param_2 != NULL) { - params->field_0x10 = *param_2; + if (pMsgID != NULL) { + params->mMsgID = *pMsgID; } if (param_3 != NULL) { params->field_0x14 = *param_3; } - if (param_1 != NULL) { - params->field_0x4 = *param_1; + if (pPos != NULL) { + params->mPos = *pPos; } else { f32 tmp_0 = FLOAT_LABEL(lit_3902); cXyz tmp(tmp_0, tmp_0, tmp_0); - params->field_0x4 = tmp; + params->mPos = tmp; } params->field_0x18 = param_4; @@ -188,11 +188,11 @@ int fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_actorP, u32 param_2) { dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID); - if (msg && msg->field_0xf8 == 1) { - msg->field_0xe0.set(pos); - msg->field_0xec = i_msgIdx; + if (msg && msg->mMode == 1) { + msg->mPos.set(pos); + msg->mMsgID = i_msgIdx; msg->field_0xf0 = param_2; - msg->field_0xdc = i_actorP; + msg->mpActor = i_actorP; msg->setMessageIndex(i_msgIdx,param_2,false); return i_msgID; } else { @@ -202,7 +202,7 @@ int fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_actorP, u32 param_2) { } /* 8001FE84-8001FFC4 01A7C4 0140+00 0/0 6/6 4/4 .text fopMsgM_messageSet__FUlUl */ -int fopMsgM_messageSet(u32 param_0, u32 param_1) { +int fopMsgM_messageSet(u32 msgIdx, u32 param_1) { if (dComIfGp_isHeapLockFlag() == 8) { dMeter2Info_getMeterClass()->emphasisButtonDelete(); } @@ -223,21 +223,21 @@ int fopMsgM_messageSet(u32 param_0, u32 param_1) { dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID); if (msg) { - if (msg->field_0xf8 == 1) { - msg->field_0xe0.set(pos); - msg->field_0xec = param_0; + if (msg->mMode == 1) { + msg->mPos.set(pos); + msg->mMsgID = msgIdx; msg->field_0xf0 = param_1; - msg->field_0xdc = 0; - msg->setTalkPartner(0); - msg->setMessageIndex(param_0,param_1,false); + msg->mpActor = NULL; + msg->setTalkPartner(NULL); + msg->setMessageIndex(msgIdx,param_1,false); return i_msgID; } - if (msg->field_0xf8 == 15) { - msg->field_0xe0.set(pos); - msg->field_0xec = param_0; + if (msg->mMode == 15) { + msg->mPos.set(pos); + msg->mMsgID = msgIdx; msg->field_0xf0 = param_1; - msg->field_0xdc = 0; + msg->mpActor = NULL; return i_msgID; } } @@ -267,11 +267,11 @@ int fopMsgM_messageSetDemo(u32 param_0) { dMsgObject_c* msg = (dMsgObject_c*)fopMsgM_SearchByID(i_msgID); - if (msg && msg->field_0xf8 == 1) { - msg->field_0xe0.set(pos); - msg->field_0xec = param_0; + if (msg && msg->mMode == 1) { + msg->mPos.set(pos); + msg->mMsgID = param_0; msg->field_0xf0 = 1000; - msg->field_0xdc = 0; + msg->mpActor = NULL; msg->setMessageIndexDemo(param_0,false); return i_msgID; } else { diff --git a/src/f_op/f_op_scene.cpp b/src/f_op/f_op_scene.cpp index 15dd2ed7623..8815ca8ff93 100644 --- a/src/f_op/f_op_scene.cpp +++ b/src/f_op/f_op_scene.cpp @@ -4,80 +4,59 @@ // #include "f_op/f_op_scene.h" +#include "f_op/f_op_scene_tag.h" +#include "f_pc/f_pc_manager.h" #include "dol2asm.h" #include "dolphin/types.h" -// -// Forward References: -// - -extern "C" static void fopScn_Draw__FP11scene_class(); -extern "C" static void fopScn_Execute__FP11scene_class(); -extern "C" static void fopScn_IsDelete__FPv(); -extern "C" static void fopScn_Delete__FPv(); -extern "C" static void fopScn_Create__FPv(); -extern "C" extern void* g_fopScn_Method[5 + 1 /* padding */]; - -// -// External References: -// - -extern "C" void fopScnTg_QueueTo__FP15scene_tag_class(); -extern "C" void fopScnTg_ToQueue__FP15scene_tag_class(); -extern "C" void fopScnTg_Init__FP15scene_tag_classPv(); -extern "C" void fpcMtd_Execute__FP20process_method_classPv(); -extern "C" void fpcMtd_IsDelete__FP20process_method_classPv(); -extern "C" void fpcMtd_Delete__FP20process_method_classPv(); -extern "C" void fpcMtd_Create__FP20process_method_classPv(); -extern "C" void fpcNd_DrawMethod__FP21nodedraw_method_classPv(); - -// -// Declarations: -// - /* 8001EB34-8001EB5C 019474 0028+00 1/0 0/0 0/0 .text fopScn_Draw__FP11scene_class */ static void fopScn_Draw(scene_class* pScene) { - fpcNd_DrawMethod((nodedraw_method_class*)pScene->mpProcessMtd, pScene); + fpcNd_DrawMethod((nodedraw_method_class*)pScene->mpMtd, pScene); } /* 8001EB5C-8001EB84 01949C 0028+00 1/0 0/0 0/0 .text fopScn_Execute__FP11scene_class */ static void fopScn_Execute(scene_class* pScene) { - fpcMtd_Execute(pScene->mpProcessMtd, pScene); + fpcMtd_Execute(pScene->mpMtd, pScene); } /* 8001EB84-8001EBAC 0194C4 0028+00 1/0 0/0 0/0 .text fopScn_IsDelete__FPv */ -static s32 fopScn_IsDelete(void* param_1) { - return fpcMtd_IsDelete(((scene_class*)param_1)->mpProcessMtd, param_1); +static s32 fopScn_IsDelete(scene_class* pScene) { + return fpcMtd_IsDelete(pScene->mpMtd, pScene); } /* 8001EBAC-8001EC00 0194EC 0054+00 1/0 0/0 0/0 .text fopScn_Delete__FPv */ static s32 fopScn_Delete(void* param_1) { scene_class* pScene = (scene_class*)param_1; - s32 ret = fpcMtd_Delete(pScene->mpProcessMtd, pScene); + s32 ret = fpcMtd_Delete(pScene->mpMtd, pScene); if (ret == 1) { - fopScnTg_QueueTo(&pScene->field_0x1b0); + fopScnTg_QueueTo(&pScene->mScnTg); } return ret; } /* 8001EC00-8001EC74 019540 0074+00 1/0 0/0 0/0 .text fopScn_Create__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void fopScn_Create(void* param_0) { - nofralloc -#include "asm/f_op/f_op_scene/fopScn_Create__FPv.s" +static s32 fopScn_Create(scene_class * pScene) { + if (fpcM_IsFirstCreating(pScene)) { + scene_process_profile_definition* profile = (scene_process_profile_definition*) fpcM_GetProfile(pScene); + pScene->mpMtd = profile->mpMtd; + fopScnTg_Init(&pScene->mScnTg, pScene); + fopScnTg_ToQueue(&pScene->mScnTg); + + u32 * append = (u32*)fpcM_GetAppend(pScene); + if (append != NULL) { + pScene->mBase.mBase.mParameters = *append; + } + } + + return fpcMtd_Create(pScene->mpMtd, pScene); } -#pragma pop /* ############################################################################################## */ /* 803A38B0-803A38C8 -00001 0014+04 0/0 9/0 0/0 .data g_fopScn_Method */ -SECTION_DATA extern void* g_fopScn_Method[5 + 1 /* padding */] = { - (void*)fopScn_Create, - (void*)fopScn_Delete, - (void*)fopScn_Execute, - (void*)fopScn_IsDelete, - (void*)fopScn_Draw, - /* padding */ - NULL, +nodedraw_method_class g_fopScn_Method = { + (process_method_func)fopScn_Create, + (process_method_func)fopScn_Delete, + (process_method_func)fopScn_Execute, + (process_method_func)fopScn_IsDelete, + (process_method_func)fopScn_Draw, }; diff --git a/src/f_op/f_op_scene_pause.cpp b/src/f_op/f_op_scene_pause.cpp index fac70803aaf..e04a4652787 100644 --- a/src/f_op/f_op_scene_pause.cpp +++ b/src/f_op/f_op_scene_pause.cpp @@ -27,7 +27,7 @@ int fopScnPause_Enable(scene_class* pScene) { /* 80020594-8002064C 01AED4 00B8+00 0/0 2/2 0/0 .text fopScnPause_Disable__FP11scene_class */ int fopScnPause_Disable(scene_class* pScene) { if (pScene) { - void* tmp = (void*)pScene->field_0x0.mLyTg.mpLayer->mpPcNode; + void* tmp = (void*)pScene->mBase.mBase.mLyTg.mpLayer->mpPcNode; if (!tmp) { fpcM_PauseDisable(pScene, 1); diff --git a/src/f_op/f_op_scene_req.cpp b/src/f_op/f_op_scene_req.cpp index 62ec8f8a3c6..ce1c9e546ee 100644 --- a/src/f_op/f_op_scene_req.cpp +++ b/src/f_op/f_op_scene_req.cpp @@ -78,7 +78,7 @@ static void fopScnRq_Execute(scene_request_class* pScnRq) { static int fopScnRq_PostMethod(void* param_1, scene_request_class* pScnRq) { if (pScnRq->mFadeRequest) { fopScnPause_Enable((scene_class*)param_1); - fopOvlpM_ToldAboutID(((scene_class*)param_1)->field_0x0.mBsPcId); + fopOvlpM_ToldAboutID(((scene_class*)param_1)->mBase.mBase.mBsPcId); } return 1; } diff --git a/src/f_pc/f_pc_base.cpp b/src/f_pc/f_pc_base.cpp index c259ab51f91..155d6b2be18 100644 --- a/src/f_pc/f_pc_base.cpp +++ b/src/f_pc/f_pc_base.cpp @@ -104,7 +104,7 @@ base_process_class* fpcBs_Create(s16 pProcTypeID, unsigned int pProcID, void* pD procClass->mBsType = fpcBs_MakeOfType(&g_fpcBs_type); procClass->mProcName = procProfDef->mProcName; fpcPause_Init(procClass); - procClass->mpPcMtd = procProfDef->mpPcMtd; + procClass->mpPcMtd = procProfDef->mSubMtd; procClass->mpProf = procProfDef; procClass->mpUserData = pData; procClass->mParameters = procProfDef->mParameters; diff --git a/src/f_pc/f_pc_draw.cpp b/src/f_pc/f_pc_draw.cpp index 4db4ff3bb2a..4ce1ebbebb8 100644 --- a/src/f_pc/f_pc_draw.cpp +++ b/src/f_pc/f_pc_draw.cpp @@ -22,9 +22,9 @@ s32 fpcDw_Execute(base_process_class* pProc) { process_method_func func; curLay = fpcLy_CurrentLayer(); if (fpcBs_Is_JustOfType(g_fpcLf_type, pProc->mSubType)) { - func = ((nodedraw_method_class*)pProc->mpPcMtd)->mNodedrawFunc; + func = ((leafdraw_method_class*)pProc->mpPcMtd)->mpDrawFunc; } else { - func = ((nodedraw_method_class*)pProc->mpPcMtd)->mNodedrawFunc; + func = ((nodedraw_method_class*)pProc->mpPcMtd)->mpDrawFunc; } fpcLy_SetCurrentLayer(pProc->mLyTg.mpLayer); ret = func(pProc); diff --git a/src/f_pc/f_pc_draw_priority.cpp b/src/f_pc/f_pc_draw_priority.cpp index bd5085dfb23..b87011f5a56 100644 --- a/src/f_pc/f_pc_draw_priority.cpp +++ b/src/f_pc/f_pc_draw_priority.cpp @@ -12,7 +12,7 @@ // /* 80021308-80021310 0008+00 s=0 e=1 z=0 None .text fpcDwPi_Get__FPC19draw_priority_class */ -s32 fpcDwPi_Get(const draw_priority_class* pDwPi) { +s16 fpcDwPi_Get(const draw_priority_class* pDwPi) { return pDwPi->mPriority; } diff --git a/src/f_pc/f_pc_leaf.cpp b/src/f_pc/f_pc_leaf.cpp index 795ad160448..6da1588191a 100644 --- a/src/f_pc/f_pc_leaf.cpp +++ b/src/f_pc/f_pc_leaf.cpp @@ -12,7 +12,7 @@ // /* 80021A00-80021A24 0024+00 s=0 e=4 z=2 None .text fpcLf_GetPriority__FPC14leafdraw_class */ -s32 fpcLf_GetPriority(const leafdraw_class* pLeaf) { +s16 fpcLf_GetPriority(const leafdraw_class* pLeaf) { return fpcDwPi_Get(&pLeaf->mDwPi); } @@ -55,10 +55,10 @@ int g_fpcLf_type; /* 80021B14-80021B88 0074+00 s=1 e=0 z=0 None .text fpcLf_Create__FP14leafdraw_class */ s32 fpcLf_Create(leafdraw_class* pLeaf) { - process_profile_definition* profDef; + leaf_process_profile_definition* profDef; if (pLeaf->mBase.mInitState == 0) { - profDef = (process_profile_definition*)pLeaf->mBase.mpProf; - pLeaf->mpDrawMtd = profDef->mLfDrwMth; + profDef = (leaf_process_profile_definition*)pLeaf->mBase.mpProf; + pLeaf->mpDrawMtd = profDef->mSubMtd; pLeaf->mBase.mSubType = fpcBs_MakeOfType(&g_fpcLf_type); fpcDwPi_Init(&pLeaf->mDwPi, profDef->mPriority); pLeaf->mbUnk0 = 0; diff --git a/src/f_pc/f_pc_node.cpp b/src/f_pc/f_pc_node.cpp index 2552c9fc19d..ffcfe0e4892 100644 --- a/src/f_pc/f_pc_node.cpp +++ b/src/f_pc/f_pc_node.cpp @@ -15,7 +15,7 @@ /* 800224F0-80022514 0024+00 s=1 e=1 z=0 None .text fpcNd_DrawMethod__FP21nodedraw_method_classPv */ s32 fpcNd_DrawMethod(nodedraw_method_class* pNodeMethod, void* pData) { - return fpcMtd_Method(pNodeMethod->mNodedrawFunc, pData); + return fpcMtd_Method(pNodeMethod->mpDrawFunc, pData); } /* 80022514-80022580 006C+00 s=1 e=0 z=0 None .text fpcNd_Draw__FP18process_node_class */ @@ -104,7 +104,7 @@ s32 fpcNd_Create(process_node_class* pProcNode1) { node_process_profile_definition* pProcProfileDef = (node_process_profile_definition*)pProcNode->mBase.mpProf; pProcNode->mBase.mSubType = fpcBs_MakeOfType(&g_fpcNd_type); - pProcNode->mpNodeMtd = (nodedraw_method_class*)pProcProfileDef->mBase.mLfDrwMth; + pProcNode->mpNodeMtd = (nodedraw_method_class*)pProcProfileDef->mSubMtd; fpcLy_Create(&pProcNode->mLayer, pProcNode, pProcNode->mLayerNodeLists, 0x10); pProcNode->mUnk0 = 0; }