diff --git a/config/D44J01/config.yml b/config/D44J01/config.yml index 431939631c..16be222d45 100644 --- a/config/D44J01/config.yml +++ b/config/D44J01/config.yml @@ -3068,6 +3068,49 @@ extract: header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h rename: l_backMat +- symbol: l_Txq_bessou_hanaTEX + binary: assets/l_Txq_bessou_hanaTEX.bin + header: assets/l_Txq_bessou_hanaTEX.h +- symbol: l_QbsafDL + binary: assets/l_QbsafDL.bin + header: assets/l_QbsafDL.h +- symbol: l_QbsfwDL + binary: assets/l_QbsfwDL.bin + header: assets/l_QbsfwDL.h +- symbol: l_Txo_ob_flower_white_64x64TEX + binary: assets/l_Txo_ob_flower_white_64x64TEX.bin + header: assets/l_Txo_ob_flower_white_64x64TEX.h +- symbol: l_OhanaDL + binary: assets/l_OhanaDL.bin + header: assets/l_OhanaDL.h +- symbol: l_Ohana_gutDL + binary: assets/l_Ohana_gutDL.bin + header: assets/l_Ohana_gutDL.h +- symbol: l_Txo_ob_flower_pink_64x64TEX + binary: assets/l_Txo_ob_flower_pink_64x64TEX.bin + header: assets/l_Txo_ob_flower_pink_64x64TEX.h +- symbol: l_Ohana_highDL + binary: assets/l_Ohana_highDL.bin + header: assets/l_Ohana_highDL.h +- symbol: l_Ohana_high_gutDL + binary: assets/l_Ohana_high_gutDL.bin + header: assets/l_Ohana_high_gutDL.h +- symbol: l_matDL3 + binary: assets/l_matDL3.bin + header: assets/l_matDL3.h + header_type: none + custom_type: matDL +- symbol: l_matDL!.data:0x80377C60 + binary: assets/l_matDL__d_flower.bin + header: assets/l_matDL__d_flower.h + header_type: none + custom_type: matDL +- symbol: l_matDL2 + binary: assets/l_matDL2.bin + header: assets/l_matDL2.h + header_type: none + custom_type: matDL + - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@ binary: assets/l_Txa_swood_bTEX.bin header: assets/l_Txa_swood_bTEX.h diff --git a/config/GZLE01/config.yml b/config/GZLE01/config.yml index 9218a85702..27f539399c 100644 --- a/config/GZLE01/config.yml +++ b/config/GZLE01/config.yml @@ -2646,6 +2646,49 @@ extract: header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h rename: l_backMat +- symbol: l_Txq_bessou_hanaTEX + binary: assets/l_Txq_bessou_hanaTEX.bin + header: assets/l_Txq_bessou_hanaTEX.h +- symbol: l_QbsafDL + binary: assets/l_QbsafDL.bin + header: assets/l_QbsafDL.h +- symbol: l_QbsfwDL + binary: assets/l_QbsfwDL.bin + header: assets/l_QbsfwDL.h +- symbol: l_Txo_ob_flower_white_64x64TEX + binary: assets/l_Txo_ob_flower_white_64x64TEX.bin + header: assets/l_Txo_ob_flower_white_64x64TEX.h +- symbol: l_OhanaDL + binary: assets/l_OhanaDL.bin + header: assets/l_OhanaDL.h +- symbol: l_Ohana_gutDL + binary: assets/l_Ohana_gutDL.bin + header: assets/l_Ohana_gutDL.h +- symbol: l_Txo_ob_flower_pink_64x64TEX + binary: assets/l_Txo_ob_flower_pink_64x64TEX.bin + header: assets/l_Txo_ob_flower_pink_64x64TEX.h +- symbol: l_Ohana_highDL + binary: assets/l_Ohana_highDL.bin + header: assets/l_Ohana_highDL.h +- symbol: l_Ohana_high_gutDL + binary: assets/l_Ohana_high_gutDL.bin + header: assets/l_Ohana_high_gutDL.h +- symbol: l_matDL3 + binary: assets/l_matDL3.bin + header: assets/l_matDL3.h + header_type: none + custom_type: matDL +- symbol: l_matDL!.data:0x80383CE0 + binary: assets/l_matDL__d_flower.bin + header: assets/l_matDL__d_flower.h + header_type: none + custom_type: matDL +- symbol: l_matDL2 + binary: assets/l_matDL2.bin + header: assets/l_matDL2.h + header_type: none + custom_type: matDL + - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@ binary: assets/l_Txa_swood_bTEX.bin header: assets/l_Txa_swood_bTEX.h diff --git a/config/GZLJ01/config.yml b/config/GZLJ01/config.yml index 80fb811015..c443534b8a 100644 --- a/config/GZLJ01/config.yml +++ b/config/GZLJ01/config.yml @@ -2230,6 +2230,49 @@ extract: header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h rename: l_backMat +- symbol: l_Txq_bessou_hanaTEX + binary: assets/l_Txq_bessou_hanaTEX.bin + header: assets/l_Txq_bessou_hanaTEX.h +- symbol: l_QbsafDL + binary: assets/l_QbsafDL.bin + header: assets/l_QbsafDL.h +- symbol: l_QbsfwDL + binary: assets/l_QbsfwDL.bin + header: assets/l_QbsfwDL.h +- symbol: l_Txo_ob_flower_white_64x64TEX + binary: assets/l_Txo_ob_flower_white_64x64TEX.bin + header: assets/l_Txo_ob_flower_white_64x64TEX.h +- symbol: l_OhanaDL + binary: assets/l_OhanaDL.bin + header: assets/l_OhanaDL.h +- symbol: l_Ohana_gutDL + binary: assets/l_Ohana_gutDL.bin + header: assets/l_Ohana_gutDL.h +- symbol: l_Txo_ob_flower_pink_64x64TEX + binary: assets/l_Txo_ob_flower_pink_64x64TEX.bin + header: assets/l_Txo_ob_flower_pink_64x64TEX.h +- symbol: l_Ohana_highDL + binary: assets/l_Ohana_highDL.bin + header: assets/l_Ohana_highDL.h +- symbol: l_Ohana_high_gutDL + binary: assets/l_Ohana_high_gutDL.bin + header: assets/l_Ohana_high_gutDL.h +- symbol: l_matDL3 + binary: assets/l_matDL3.bin + header: assets/l_matDL3.h + header_type: none + custom_type: matDL +- symbol: l_matDL!.data:0x80377180 + binary: assets/l_matDL__d_flower.bin + header: assets/l_matDL__d_flower.h + header_type: none + custom_type: matDL +- symbol: l_matDL2 + binary: assets/l_matDL2.bin + header: assets/l_matDL2.h + header_type: none + custom_type: matDL + - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@ binary: assets/l_Txa_swood_bTEX.bin header: assets/l_Txa_swood_bTEX.h diff --git a/config/GZLP01/config.yml b/config/GZLP01/config.yml index 93e896dfa3..92dff7b5f7 100644 --- a/config/GZLP01/config.yml +++ b/config/GZLP01/config.yml @@ -2242,6 +2242,49 @@ extract: header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h rename: l_backMat +- symbol: l_Txq_bessou_hanaTEX + binary: assets/l_Txq_bessou_hanaTEX.bin + header: assets/l_Txq_bessou_hanaTEX.h +- symbol: l_QbsafDL + binary: assets/l_QbsafDL.bin + header: assets/l_QbsafDL.h +- symbol: l_QbsfwDL + binary: assets/l_QbsfwDL.bin + header: assets/l_QbsfwDL.h +- symbol: l_Txo_ob_flower_white_64x64TEX + binary: assets/l_Txo_ob_flower_white_64x64TEX.bin + header: assets/l_Txo_ob_flower_white_64x64TEX.h +- symbol: l_OhanaDL + binary: assets/l_OhanaDL.bin + header: assets/l_OhanaDL.h +- symbol: l_Ohana_gutDL + binary: assets/l_Ohana_gutDL.bin + header: assets/l_Ohana_gutDL.h +- symbol: l_Txo_ob_flower_pink_64x64TEX + binary: assets/l_Txo_ob_flower_pink_64x64TEX.bin + header: assets/l_Txo_ob_flower_pink_64x64TEX.h +- symbol: l_Ohana_highDL + binary: assets/l_Ohana_highDL.bin + header: assets/l_Ohana_highDL.h +- symbol: l_Ohana_high_gutDL + binary: assets/l_Ohana_high_gutDL.bin + header: assets/l_Ohana_high_gutDL.h +- symbol: l_matDL3 + binary: assets/l_matDL3.bin + header: assets/l_matDL3.h + header_type: none + custom_type: matDL +- symbol: l_matDL!.data:0x8038A9C0 + binary: assets/l_matDL__d_flower.bin + header: assets/l_matDL__d_flower.h + header_type: none + custom_type: matDL +- symbol: l_matDL2 + binary: assets/l_matDL2.bin + header: assets/l_matDL2.h + header_type: none + custom_type: matDL + - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@ binary: assets/l_Txa_swood_bTEX.bin header: assets/l_Txa_swood_bTEX.h diff --git a/configure.py b/configure.py index a446479af1..10085b52b1 100755 --- a/configure.py +++ b/configure.py @@ -634,7 +634,7 @@ def EquivalentFor(*versions): Object(NonMatching, "d/d_menu_fmap2.cpp"), Object(NonMatching, "d/d_menu_item.cpp"), Object(Matching, "d/d_menu_option.cpp"), - Object(NonMatching, "d/d_menu_save.cpp"), + Object(Matching, "d/d_menu_save.cpp"), Object(MatchingFor("GZLE01"), "d/d_menu_window.cpp"), Object(NonMatching, "d/d_mesg.cpp"), Object(NonMatching, "d/d_message.cpp"), @@ -1684,7 +1684,7 @@ def EquivalentFor(*versions): ActorRel(Matching, "d_a_npc_ls1"), ActorRel(NonMatching, "d_a_npc_mk"), ActorRel(NonMatching, "d_a_npc_mn"), - ActorRel(NonMatching, "d_a_npc_mt"), + ActorRel(Matching, "d_a_npc_mt"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_nz"), ActorRel(NonMatching, "d_a_npc_ob1"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_os"), @@ -1699,7 +1699,7 @@ def EquivalentFor(*versions): ActorRel(NonMatching, "d_a_npc_sarace"), ActorRel(NonMatching, "d_a_npc_sv"), ActorRel(Matching, "d_a_npc_tc"), - ActorRel(NonMatching, "d_a_npc_tt"), + ActorRel(Matching, "d_a_npc_tt"), ActorRel(NonMatching, "d_a_npc_uk"), ActorRel(NonMatching, "d_a_npc_ym1"), ActorRel(NonMatching, "d_a_npc_yw1"), diff --git a/include/JSystem/JAudio/JAISeMgr.h b/include/JSystem/JAudio/JAISeMgr.h index 2d83a9cdfa..51ab578c57 100644 --- a/include/JSystem/JAudio/JAISeMgr.h +++ b/include/JSystem/JAudio/JAISeMgr.h @@ -18,11 +18,9 @@ namespace JAInter { MoveParaSetInitZero field_0x2a4[8]; MoveParaSetInitZero field_0x324[8]; MoveParaSet field_0x3a4[8]; - f32* field_0x424; - f32 field_0x428; - u8 field_0x42c[0x43c - 0x42c]; - SeParameter* field_0x43c; - SeParameter* field_0x440; + f32* field_0x424[6]; + SeParameter* mPrev; + SeParameter* mNext; }; namespace SeMgr { diff --git a/include/JSystem/JAudio/JAISound.h b/include/JSystem/JAudio/JAISound.h index 9c7d772cfc..36ee08609b 100644 --- a/include/JSystem/JAudio/JAISound.h +++ b/include/JSystem/JAudio/JAISound.h @@ -165,7 +165,9 @@ class JAISound { void setRandom(u8) {} void setSeInterDolbyU7(u8, u8, u32, u8) {} void setSeInterFxmixU7(u8, u8, u32, u8) {} - void setSeqInterVolumeU7(u8, u8, u32) {} + void setSeqInterVolumeU7(u8 type, u8 value, u32 moveTime) { + setSeqInterVolume(type, value / 127.0f, moveTime); + } void setStatus(u8) {} void setTrack(u8) {} void setTrackVolumeU7(u8, u8, u32) {} @@ -183,7 +185,7 @@ class JAISound { /* 0x09 */ u8 field_0x9; /* 0x0a */ s16 field_0xa; /* 0x0c */ u32 mSoundID; - /* 0x10 */ int field_0x10; + /* 0x10 */ u32 field_0x10; /* 0x14 */ u32 mFadeCounter; /* 0x18 */ u32 field_0x18; /* 0x1c */ int field_0x1c; @@ -214,7 +216,7 @@ namespace JAInter { /* 0x00 */ f32 mTargetValue; /* 0x04 */ f32 mCurrentValue; /* 0x08 */ f32 mMoveAmount; - /* 0x0C */ int mMoveCounter; + /* 0x0C */ u32 mMoveCounter; }; class MoveParaSetInitHalf : public MoveParaSet { diff --git a/include/d/actor/d_a_npc_mt.h b/include/d/actor/d_a_npc_mt.h index b3d2679b13..69afdf4fc5 100644 --- a/include/d/actor/d_a_npc_mt.h +++ b/include/d/actor/d_a_npc_mt.h @@ -8,90 +8,152 @@ #include "d/d_npc.h" struct sMtAnmDat { - + /* 0x00 */ u8 field_0x00; + /* 0x01 */ u8 field_0x01; + /* 0x02 */ u8 field_0x02; }; +struct NpcDatStruct { + /* 0x00 */ s16 mMax_head_x; + /* 0x02 */ s16 mMax_head_y; + /* 0x04 */ s16 mMax_backbone_x; + /* 0x06 */ s16 mMax_backbone_y; + /* 0x08 */ s16 mMin_head_x; + /* 0x0A */ s16 mMin_head_y; + /* 0x0C */ s16 mMin_backbone_x; + /* 0x0E */ s16 mMin_backbone_y; + /* 0x10 */ s16 mMax_turn_step; + /* 0x12 */ s16 field_0x12; + /* 0x14 */ f32 field_0x14; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ f32 field_0x1C; + /* 0x20 */ f32 field_0x20; + /* 0x24 */ f32 field_0x24; + /* 0x28 */ s16 field_0x28; + /* 0x2A */ s16 field_0x2A; + /* 0x2C */ s16 field_0x2C; + /* 0x2E */ s16 field_0x2E; + /* 0x30 */ f32 field_0x30; + /* 0x34 */ f32 field_0x34; + /* 0x38 */ f32 field_0x38; + /* 0x3C */ s16 field_0x3C; + /* 0x3E */ s16 field_0x3E; + /* 0x40 */ s16 field_0x40; + /* 0x42 */ s16 field_0x42; + /* 0x44 */ s16 field_0x44; + /* 0x46 */ s16 field_0x46; + /* 0x48 */ s16 field_0x48; + /* 0x4A */ s8 field_0x4A; + /* 0x4B */ s8 field_0x4B; +}; // Size: 0x4c + class daNpcMt_c : public fopNpc_npc_c { public: + typedef s32(daNpcMt_c::*InitFunc_t)(); + typedef void(daNpcMt_c::*MoveFunc_t)(); + void attnOff() { m753 = false; } void attnOn() { m753 = true; } - void getNpcNo() {} - void getPhaseP() {} - void setResFlag(u8) {} + u8 getNpcNo() { return mNpcNo; } + request_of_phase_process_class* getPhaseP() { return &mPhsArcname; } + void setResFlag(u8 flag) { m747 = flag; } daNpcMt_c(); cPhs_State _create(); - void createHeap(); - void createInit(); + BOOL createHeap(); + cPhs_State createInit(); bool _delete(); bool _draw(); bool _execute(); - void executeCommon(); + BOOL executeCommon(); void executeSetMode(u8); - void executeWaitInit(); + s32 executeWaitInit(); void executeWait(); - void executeTalkInit(); + s32 executeTalkInit(); void executeTalk(); void checkOrder(); void eventOrder(); void eventMove(); void privateCut(); void eventMesSetInit(int); - void eventMesSet(); + bool eventMesSet(); void eventGetItemInit(); - void talk2(int); + u16 talk2(int); u16 next_msgStatus(u32*); u32 getMsg(); void chkMsg(); void setMessage(u32); void setAnmFromMsgTag(); - void getPrmNpcNo(); + u8 getPrmNpcNo(); void setMtx(); void chkAttention(); void lookBack(); - void initTexPatternAnm(bool); + BOOL initTexPatternAnm(bool); void playTexPatternAnm(); void playAnm(); void setAnm(u8, int, f32); - void setAnmTbl(sMtAnmDat*); - void XyCheckCB(int); + bool setAnmTbl(sMtAnmDat*); + s16 XyCheckCB(int); void setCollision(dCcD_Cyl*, cXyz, f32, f32); - void chkEndEvent(); - bool isFigureGet(u8); + BOOL chkEndEvent(); + u8 isFigureGet(u8); void setFigure(u8); int getFigureMakeNum(); - bool isComp(); - void changePhotoNo(u8); + BOOL isComp(); + u8 changePhotoNo(u8); -public: + static const char m_arcname[6]; + +private: /* 0x6C4 */ request_of_phase_process_class mPhsArcname; /* 0x6CC */ request_of_phase_process_class mPhs; - /* 0x6D4 */ u8 m6D4[0x6D8 - 0x6D4]; + /* 0x6D4 */ J3DAnmTexPattern* m_head_tex_pattern; /* 0x6D8 */ mDoExt_btpAnm mBtpAnm; - /* 0x6EC */ u8 m6EC[0x710 - 0x6EC]; + /* 0x6EC */ s32 mShadowId; + /* 0x6F0 */ u32 m6F0; + /* 0x6F4 */ u8 m6F4[0x704 - 0x6F4]; + /* 0x704 */ cXyz mLookAtPos; /* 0x710 */ sMtAnmDat* mpAnmDat; - /* 0x714 */ int* mpMsgTbl; - /* 0x718 */ u8 m718[0x71C - 0x718]; + /* 0x714 */ u32* mpMsgTbl; + /* 0x718 */ f32 m718; /* 0x71C */ f32 m71C; - /* 0x720 */ u8 m720[0x72A - 0x720]; + /* 0x720 */ f32 m720; + /* 0x724 */ s32 mItemNo; + /* 0x728 */ bool m728; + /* 0x729 */ u8 m729; /* 0x72A */ s16 mMtGetItemEventIdx; - /* 0x72C */ u8 m72C[0x732 - 0x72C]; + /* 0x72C */ s16 m72C; + /* 0x72E */ s16 m72E; + /* 0x730 */ s16 m730; /* 0x732 */ s16 m732; - /* 0x734 */ u8 m734[0x742 - 0x734]; + /* 0x734 */ u16 m734; + /* 0x736 */ s16 m736; + /* 0x738 */ u8 m738[0x73A - 0x738]; + /* 0x73A */ s16 mTimer; + /* 0x73C */ s16 m73C; + /* 0x73E */ s16 m73E; + /* 0x740 */ s16 m740; /* 0x742 */ u8 m742; - /* 0x743 */ u8 m743[0x747 - 0x743]; + /* 0x743 */ u8 m743; + /* 0x744 */ u8 m744; + /* 0x745 */ u8 mFrame; + /* 0x746 */ u8 m746; /* 0x747 */ u8 m747; - /* 0x748 */ u8 mPrmNpcNo; - /* 0x749 */ u8 m749[0x74A - 0x749]; + /* 0x748 */ u8 mNpcNo; + /* 0x749 */ u8 m749; /* 0x74A */ u8 m74A; - /* 0x74B */ u8 m74B[0x750 - 0x74B]; + /* 0x74B */ u8 mAnmFlag; + /* 0x74C */ s8 m74C; + /* 0x74D */ s8 m74D; + /* 0x74E */ u8 m74E; + /* 0x74F */ s8 m74F; /* 0x750 */ u8 m750; /* 0x751 */ u8 m751; - /* 0x752 */ u8 m752[0x753 - 0x752]; + /* 0x752 */ u8 m752; /* 0x753 */ bool m753; /* 0x754 */ u8 m754[0x758 - 0x754]; }; diff --git a/include/d/actor/d_a_npc_tt.h b/include/d/actor/d_a_npc_tt.h index 0177cf9d51..07b3c7908a 100644 --- a/include/d/actor/d_a_npc_tt.h +++ b/include/d/actor/d_a_npc_tt.h @@ -2,82 +2,177 @@ #define D_A_NPC_TT_H #include "f_op/f_op_actor.h" +#include "d/d_npc.h" struct tt_ke_s { - void ke_control(float); + /* 0x00 */ cXyz field_0x00[10]; + /* 0x78 */ cXyz field_0x78[10]; + void ke_control(f32); void ke_pos_set(cXyz*); }; +struct lineKe { + tt_ke_s field_0x6C8[8]; + mDoExt_3DlineMat0_c mLineMat; +}; + class daNpc_Tt_c : public fopAc_ac_c { public: - void ChkOrder(unsigned char) {} - void ClrOrder() {} - void SetOrder(unsigned char) {} - void chkEvFlag(unsigned short) {} - void chkFlag(unsigned short) {} - void clrEvFlag(unsigned short) {} - void clrFlag(unsigned short) {} - void getBackboneJntNum() {} - void getBackbone_x() {} - void getBackbone_y() {} - void getHeadJntNum() {} - void getHead_x() {} - void getHead_y() {} - void incAttnSetCount() {} - void setAction(int (daNpc_Tt_c::*)(void*), void*) {} - void setAttentionBasePos(cXyz) {} - void setEvFlag(unsigned short) {} - void setEyePos(cXyz) {} - void setFlag(unsigned short) {} - void XyCheckCB(int); + enum ActionStatus { + ACTION_ENDING = -1, + ACTION_STARTING = 0, + ACTION_ONGOING = 1 + }; + + enum TalkStates { + TALK_FINISHED = -1, + TALK_INIT = 0, + TALK_MSG_CREATE = 1, + TALK_ACTIVE = 2 + }; + + typedef BOOL (daNpc_Tt_c::*ActionFunc)(void*); + + bool ChkOrder(u8 flag) { return mOrderFlags & flag; } + void ClrOrder() { mOrderFlags = 0; } + void SetOrder(u8 flag) { mOrderFlags |= flag; } + bool chkEvFlag(u16 evFlag) { return (mEvFlags & evFlag) == evFlag; } + bool chkFlag(u16 flag) { return (mFlags & flag) == flag; } + void clrEvFlag(u16 evFlag) { mEvFlags &= ~evFlag; } + void clrFlag(u16 flag) { mFlags &= ~flag; } + + s8 getBackboneJntNum() { return m_jnt.getBackboneJntNum(); } + s16 getBackbone_y() { return m_jnt.getBackbone_y(); } + s8 getHeadJntNum() { return m_jnt.getHeadJntNum(); } + s16 getHead_x() { return m_jnt.getHead_x(); } + s16 getHead_y() { return m_jnt.getHead_y(); } + + void incAttnSetCount() { + if (mAttnSetCount != 0xff) { + mAttnSetCount++; + } + } + + BOOL setAction(ActionFunc actionFunc, void* arg) { + if (mCurrActionFunc != actionFunc) { + if (mCurrActionFunc != NULL) { + mActionStatus = ACTION_ENDING; + (this->*mCurrActionFunc)(arg); + } + mCurrActionFunc = actionFunc; + mActionStatus = ACTION_STARTING; + (this->*mCurrActionFunc)(arg); + } + return TRUE; + } + + void setAttentionBasePos(cXyz i_attnBasePos) { mAttnBasePos = i_attnBasePos; } + void setEvFlag(u16 evFlag) { mEvFlags |= evFlag;} + void setEyePos(cXyz i_eyePos) { mEyePos = i_eyePos; } + void setFlag(u16 flag) { mFlags |= flag; } + + s16 XyCheckCB(int); void setAnmStatus(); void eventOrder(); void checkOrder(); - void next_msgStatus(unsigned long*); - void getMsg(); + u16 next_msgStatus(u32*); + u32 getMsg(); void setCollision(); void talkInit(); void msgAnm(); void msgPushButton(); void msgContinue(); - void talk(); + u16 talk(); void demoInitChange(); - void demoProcTact1(); + bool demoProcTact1(); void demoInitPatten(); - void demoProcPatten(); + bool demoProcPatten(); void demoInitSpeak(); - void demoProcSpeak(); + bool demoProcSpeak(); void demoInitWait(); - void demoProcWait(); + bool demoProcWait(); void demoInitCom(); void demoProcCom(); - void getNowEventAction(); - void demoProc(); - void init(); + s32 getNowEventAction(); + bool demoProc(); + BOOL init(); void setAttention(bool); void lookBack(); - void wait01(); - void talk01(); - void tact00(); - void wait_action(void*); + bool wait01(); + bool talk01(); + bool tact00(); + BOOL wait_action(void*); void set_ke_root(int, int, int); void ke_execute(); BOOL _draw(); BOOL _execute(); BOOL _delete(); cPhs_State _create(); - void CreateHeap(); + BOOL CreateHeap(); - void initTexPatternAnm(bool); + BOOL initTexPatternAnm(bool); void playTexPatternAnm(); void setAnm(int); void danceInit(int); - void danceProc(); - void danceNext(); - + BOOL danceProc(); + BOOL danceNext(); public: - /* Place member variables here */ -}; + /* 0x290 */ dNpc_HeadAnm_c mHeadAnm; + /* 0x2B4 */ s16 mEventIdx; + /* 0x2B6 */ u8 field_0x2B6[0x2B8 - 0x2B6]; + /* 0x2B8 */ request_of_phase_process_class mPhs; + /* 0x2C0 */ mDoExt_McaMorf* mpMorf; + /* 0x2C4 */ u32 mShadowId; + /* 0x2C8 */ J3DAnmTexPattern* m_head_tex_pattern; + /* 0x2CC */ mDoExt_btpAnm mBtpAnm; + /* 0x2E0 */ u8 mBlinkFrame; + /* 0x2E1 */ u8 field_0x2E1[0x2E2 - 0x2E1]; + /* 0x2E2 */ s16 mBlinkTimer; + /* 0x2E4 */ dBgS_ObjAcch mObjAcch; + /* 0x4A8 */ dBgS_AcchCir mAcchCir; + /* 0x4E8 */ dCcD_Stts mStts; + /* 0x524 */ dCcD_Cyl mCyl; + /* 0x654 */ s8 m_head_jnt_num; + /* 0x655 */ s8 m_backbone_jnt_num; + /* 0x656 */ u8 field_0x656[0x658 - 0x656]; + /* 0x658 */ dNpc_JntCtrl_c m_jnt; + /* 0x68C */ cXyz mEyePos; + /* 0x698 */ cXyz mAttnBasePos; + /* 0x6A4 */ s16 mMaxHeadTurnVelocity; + /* 0x6A6 */ u8 field_0x6A6[0x6A8 - 0x6A6]; + /* 0x6A8 */ s8 mAnmEnded; + /* 0x6A9 */ u8 mAttnSetCount; + /* 0x6AA */ u8 field_0x6AA[0x6AC - 0x6AA]; + /* 0x6AC */ f32 mAnmTimer; + /* 0x6B0 */ u32 mCurrMsgNo; + /* 0x6B4 */ u16 mFlags; + /* 0x6B6 */ s16 mNoticeLinkTimer; + /* 0x6B8 */ ActionFunc mCurrActionFunc; + /* 0x6C4 */ u8 mDanceStep; + /* 0x6C5 */ u8 mDanceStepTimer; + /* 0x6C6 */ u8 field_0x6C6[0x6C8 - 0x6C6]; + /* 0x6C8 */ lineKe mLineKe; + /* 0xE64 */ s8 mTexPatternIdx; + /* 0xE65 */ s8 mCurrAnmIdx; + /* 0xE66 */ s8 mAnmLoopCount; + /* 0xE67 */ u8 mOrderFlags; + /* 0xE68 */ s8 mState; + /* 0xE69 */ s8 mReturnToState; + /* 0xE6A */ u8 mType; + /* 0xE6B */ s8 mActionStatus; + /* 0xE6C */ s8 mTalkState; + /* 0xE6D */ u8 mMsgAnmIdx; + /* 0xE6E */ u8 field_0xE6E[0xE70 - 0xE6E]; + /* 0xE70 */ u32 mMtrlSndId; + /* 0xE74 */ s8 mReverb; + /* 0xE75 */ u8 mEvFlags; + /* 0xE76 */ s16 mSoundTimer; + /* 0xE78 */ s16 mTimer; + /* 0xE7A */ u8 field_0xE7A; + /* 0xE7B */ u8 field_0xE7B[0xE7C - 0xE7B]; + /* 0xE7C */ u32 mMsgNo; + /* 0xE80 */ int mStaffIdx; +}; // Size: 0xE84 #endif /* D_A_NPC_TT_H */ diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 28f955d44e..ee23598c2d 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -619,6 +619,9 @@ class dComIfG_play_c { mPictureFlag &= ~mask; } u8 getPictureFormat() { return mPictureFormat; } + void setPictureFormat(u8 i) { mPictureFormat = i; } + u8 getSelectPicture() { return mSelectPicture; } + void setSelectPicture(u8 i) { mSelectPicture = i; } u8 getPictureResult() { return mPictureResult; } u8 getPictureResultDetail() { return mPictureResultDetail; } void setBossBattleData(JKRAramBlock* aramBlock, int i) { mBossBattleData[i] = aramBlock; } @@ -825,7 +828,7 @@ class dComIfG_play_c { /* 0x495E */ u8 mPictureStatus; /* 0x495F */ u8 field_0x495f; /* 0x4960 */ u8 mPictureFormat; - /* 0x4961 */ u8 field_0x4961; + /* 0x4961 */ u8 mSelectPicture; /* 0x4962 */ u8 mHeapLockFlag; #if VERSION > VERSION_DEMO /* 0x4963 */ u8 mNowVibration; @@ -904,6 +907,7 @@ void dComIfGs_setGameStartStage(); void dComIfGs_gameStart(); void dComIfGs_copyPlayerRecollectionData(); u8 dComIfGs_checkGetItem(u8); +void dComIfGs_exchangePlayerRecollectionData(); inline void dComIfGs_init() { g_dComIfG_gameInfo.save.init(); @@ -1471,8 +1475,8 @@ inline void dComIfGs_setTurnRestart(const cXyz& i_pos, s16 i_angle, s8 i_roomNo, } #endif -inline void dComIfGs_setMemoryToCard(u8* i_cardPtr, int i_dataNum) { - g_dComIfG_gameInfo.save.memory_to_card((char*)i_cardPtr, i_dataNum); +inline int dComIfGs_setMemoryToCard(u8* i_cardPtr, int i_dataNum) { + return g_dComIfG_gameInfo.save.memory_to_card((char*)i_cardPtr, i_dataNum); } inline void dComIfGs_setInitDataToCard(u8* i_cardPtr, int i_dataNum) { @@ -3191,6 +3195,18 @@ inline u8 dComIfGp_getPictureFormat() { return g_dComIfG_gameInfo.play.getPictureFormat(); } +inline void dComIfGp_setPictureFormat(u8 i) { + g_dComIfG_gameInfo.play.setPictureFormat(i); +} + +inline u8 dComIfGp_getSelectPicture() { + return g_dComIfG_gameInfo.play.getSelectPicture(); +} + +inline void dComIfGp_setSelectPicture(u8 i) { + g_dComIfG_gameInfo.play.setSelectPicture(i); +} + inline u8 dComIfGp_getPictureResult() { return g_dComIfG_gameInfo.play.getPictureResult(); } diff --git a/include/d/d_file_error.h b/include/d/d_file_error.h index 42aa44098e..6903ad2db4 100644 --- a/include/d/d_file_error.h +++ b/include/d/d_file_error.h @@ -69,10 +69,10 @@ class MyScreen : public J2DScreen { class dFile_error_c { public: - void getStatus() {} - void getYesNo() {} + u8 getStatus() { return mStatus; } + u8 getYesNo() { return mYesNo ^ 1; } void setDbgErrMessage(char*, int) {} - void setTimeCountDownMode() {} + void setTimeCountDownMode() { mTimeCountDownMode = 1; } virtual ~dFile_error_c() {} void _create(); @@ -117,14 +117,14 @@ class dFile_error_c { /* 0x2ec */ char* mMessage; /* 0x2f0 */ STControl* stick; /* 0x2f4 */ u8 mState; - /* 0x2f5 */ u8 m2f5; - /* 0x2f6 */ u8 mSelectedOption; + /* 0x2f5 */ u8 mStatus; + /* 0x2f6 */ u8 mYesNo; /* 0x2f7 */ u8 m2f7; /* 0x2f8 */ u8 m2f8; /* 0x2f9 */ u8 m2f9; /* 0x2fa */ u8 m2fa; /* 0x2fb */ u8 m2fb; - /* 0x2fc */ u8 m2fc; + /* 0x2fc */ u8 mTimeCountDownMode; /* 0x2fd */ u8 m2fd; /* 0x2fe */ s16 m2fe; /* 0x300 */ f32 m300; diff --git a/include/d/d_flower.h b/include/d/d_flower.h index 77462b5ad9..e811c7ab28 100644 --- a/include/d/d_flower.h +++ b/include/d/d_flower.h @@ -19,10 +19,14 @@ class dFlower_data_c { void WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*); void hitCheck(fopAc_ac_c*, int); - /* 0x00 */ u8 field_0x00[0x04 - 0x00]; + /* 0x00 */ u8 field_0x00; + /* 0x01 */ s8 field_0x01; + /* 0x02 */ s8 field_0x02; + /* 0x03 */ u8 field_0x03; /* 0x04 */ cXyz field_0x04; - /* 0x10 */ u8 field_0x10[0x44 - 0x10]; -}; + /* 0x10 */ Mtx field_0x10; + /* 0x40 */ dFlower_data_c* field_0x40; +}; // Size: 0x44 class dFlower_anm_c { public: @@ -31,8 +35,9 @@ class dFlower_anm_c { /* 0x00 */ u8 field_0x00; /* 0x02 */ s16 field_0x02; /* 0x04 */ s16 field_0x04; - /* 0x06 */ u8 field_0x6[0x38 - 0x6]; -}; + /* 0x06 */ u8 field_0x6[0x8 - 0x6]; + /* 0x08 */ Mtx mMtx; +}; // Size: 0x38 class dFlower_room_c { public: @@ -42,7 +47,7 @@ class dFlower_room_c { dFlower_room_c(); /* 0x0 */ dFlower_data_c* field_0x0; -}; +}; // Size: 0x4 class dFlower_packet_c : public J3DPacket { public: @@ -51,21 +56,35 @@ class dFlower_packet_c : public J3DPacket { void calc(); void update(); void setData(dFlower_data_c*, int, s8, cXyz&, int, s8); - void newData(s8, cXyz&, int, s8); - void newAnm(); + dFlower_data_c* newData(s8, cXyz&, int, s8); + int newAnm(); void setAnm(int, s16); void deleteRoom(s32 roomNo) { mRoom[roomNo].deleteData(); } virtual void draw(); virtual ~dFlower_packet_c(); - /* 0x0010 */ s16 field_0x0010; + dFlower_anm_c* getAnm() { return mAnm; } + dFlower_anm_c* getAnm(int idx) { return &mAnm[idx]; } + void deleteAnm(int i) { mAnm[i].field_0x00 = 0; } + + dFlower_data_c* getData() { return mData; } + + void setPlayerSwordTop(cXyz& pos) { field_0x45fc = pos; } + void setPlayerSwordMoveAngY(s16 angle) { field_0x45f8 = angle; } + cXyz& getPlayerSwordTop() { return field_0x45fc; } + void setPlayerSwordAngY(s16 angle) { field_0x45F6 = angle; } + void setPlayerCutFlg(BOOL flag) { field_0x45f4 = flag; } + + + /* 0x0010 */ u16 field_0x0010; /* 0x0012 */ u8 field_0x0012[0x0014 - 0x0012]; /* 0x0014 */ dFlower_data_c mData[200]; /* 0x3534 */ dFlower_anm_c mAnm[72]; /* 0x44F4 */ dFlower_room_c mRoom[64]; - /* 0x45F4 */ u8 field_0x45f4; - /* 0x45F5 */ u8 field_0x45F5[0x45F8 - 0x45F5]; + /* 0x45F4 */ bool field_0x45f4; + /* 0x45F5 */ u8 field_0x45F5; + /* 0x45F6 */ s16 field_0x45F6; /* 0x45F8 */ s16 field_0x45f8; /* 0x45FA */ u8 field_0x45FA[0x45FC - 0x45FA]; /* 0x45FC */ cXyz field_0x45fc; @@ -73,11 +92,11 @@ class dFlower_packet_c : public J3DPacket { /* 0x460C */ GXColor* field_0x460c; /* 0x4610 */ f32* field_0x4610; /* 0x4614 */ void* field_0x4614; - /* 0x4618 */ void* field_0x4618; + /* 0x4618 */ u32 field_0x4618; /* 0x461C */ void* field_0x461c; - /* 0x4620 */ void* field_0x4620; + /* 0x4620 */ u32 field_0x4620; /* 0x4624 */ void* field_0x4624; - /* 0x4628 */ void* field_0x4628; -}; + /* 0x4628 */ u32 field_0x4628; +}; // Size: 0x462C -#endif /* D_FLOWER_H */ \ No newline at end of file +#endif /* D_FLOWER_H */ diff --git a/include/d/d_menu_save.h b/include/d/d_menu_save.h index 9d4733cb65..b410885122 100644 --- a/include/d/d_menu_save.h +++ b/include/d/d_menu_save.h @@ -2,7 +2,8 @@ #define D_MENU_SAVE_H #include "d/d_drawlist.h" -#include "dolphin/types.h" +#include "f_op/f_op_msg_mng.h" +#include "m_Do/m_Do_hostIO.h" struct fopMsgM_pane_class; @@ -10,16 +11,66 @@ class dDlst_MenuSave_c : public dDlst_base_c { public: ~dDlst_MenuSave_c() {} void draw(); + + /* 0x4 */ J2DScreen* Scr; + /* 0x8 */ JUTFont* font; }; +class dFile_error_c; +class STControl; + class dMenu_save_c { public: - u8* getDataBufPtr() { return mDataBuf; } - u8 getEndStatus() { return mEndStatus; } - u8 getSaveStatus() { return mSaveStatus; } + enum { + PROC_SAVE_QUESTION, + PROC_MEMCARD_CHECK, + PROC_OPEN_SAVE_MENU, + PROC_CLOSE_SAVE_MENU, + PROC_MEMCARD_ERR_MSG_WAIT_KEY, + PROC_MEMCARD_ERR_MSG_WAIT_KEY2, + PROC_MEMCARD_ERR_MSG_WAIT_KEY3, + PROC_MEMCARD_ERR_GO_IPL_SEL, + PROC_MEMCARD_ERR_GO_IPL_SEL2, + PROC_MEMCARD_FORMAT, + PROC_MEMCARD_ERR_MSG_WAIT_FORMAT_SEL, + PROC_MEMCARD_ERR_MSG_WAIT_FORMAT_SEL2, + PROC_MEMCARD_FORMAT_CHECK, + PROC_MEMCARD_MAKE_GAME_FILE_SEL, + PROC_MEMCARD_MAKE_GAME_FILE, + PROC_MEMCARD_MAKE_GAME_FILE_CHECK, + PROC_MEMCARD_DATA_LOAD_WAIT, + PROC_MEMCARD_DATA_LOAT_WAIT2, + PROC_MEMCARD_DATA_SAVE, + PROC_MEMCARD_DATA_SAVE_UP_MENU, + PROC_MEMCARD_DATA_SAVE_SEL, + PROC_MEMCARD_DATA_SAVE_DOWN_MENU, + PROC_MEMCARD_DATA_SAVE_WAIT, + PROC_MSG_WAIT, + PROC_MSG_WAIT2, + PROC_SAVE_END_WAIT, + PROC_SAVE_WAIT, + PROC_CAN_NOT_SAVE, + PROC_CAN_NOT_SAVE2, + PROC_GAME_CONTINUE, + PROC_GAME_CONTINUE2, + PROC_GAME_CONTINUE3, +#if VERSION >= VERSION_JPN + PROC_GAME_CONTINUE4, +#endif + PROC_ENDING_NO_SAVE, + PROC_ENDING_NO_SAVE2, + PROC_ENDING_NO_SAVE3, + PROC_ENDING_DATA_CHECK, + PROC_NO_SAVE, + PROC_NO_SAVE2, + }; + + u8* getDataBufPtr() { return dataBuf; } + u8 getEndStatus() { return endStatus; } + u8 getSaveStatus() { return saveStatus; } void setErrorFlag(u8) {} void setErrorType(u8) {} - void setUseType(u8 useType) { mUseType = useType; } + void setUseType(u8 i_useType) { useType = i_useType; } virtual ~dMenu_save_c() {} void _create(); @@ -31,19 +82,19 @@ class dMenu_save_c { void _delete(); void initialize(); - void openNormal(); - void closeNormal(); - void openForCollect(); - void openForItem(); - void closeForCollect(); - void closeForItem(); - void openForGameover(); - void closeForGameover(); - void closeForGameover_1(); - void closeForGameover_2(); - void openForEnding(); - void openForEnding2(); - void closeForEnding(); + BOOL openNormal(); + BOOL closeNormal(); + BOOL openForCollect(); + BOOL openForItem(); + BOOL closeForCollect(); + BOOL closeForItem(); + BOOL openForGameover(); + BOOL closeForGameover(); + BOOL closeForGameover_1(); + BOOL closeForGameover_2(); + BOOL openForEnding(); + BOOL openForEnding2(); + BOOL closeForEnding(); void noSave(); void noSave2(); void saveQuestion(); @@ -84,54 +135,111 @@ class dMenu_save_c { void endingNoSave3(); void endingDataCheck(); void saveWait(); - void YesNoSelect(int); - void YesNoSelect2(int); + BOOL YesNoSelect(int); + BOOL YesNoSelect2(int); void CursorAlphaInit(); void CursorMove(); void CursorAnime(); - void openSave(); - void closeSave(); + BOOL openSave(); + BOOL closeSave(); void screenSet(); void paneTransInit(); void displayInit(); void initializeEx(); - void menuUp(); - void menuDown(); - void PaneAlphaMsgTxt(s16, u8); - void PaneTranceBase(s16, u8, f32, f32, u8, int); - void PaneScaleAlphaWipe(s16, u8, f32, u8, int); - void PaneAlphaMask(s16, u8, u8, int); - void PaneTranceTitle(s16, u8, f32, f32, u8, int); - void PaneRotate(s16, u8, fopMsgM_pane_class*, f32, f32, f32, u8); - void PaneTranceMenu(s16, u8, fopMsgM_pane_class*, f32, f32, u8, int); + BOOL menuUp(); + BOOL menuDown(); + BOOL PaneAlphaMsgTxt(s16, u8); + BOOL PaneTranceBase(s16, u8, f32, f32, u8, int); + BOOL PaneScaleAlphaWipe(s16, u8, f32, u8, int); + BOOL PaneAlphaMask(s16, u8, u8, int); + BOOL PaneTranceTitle(s16, u8, f32, f32, u8, int); + BOOL PaneRotate(s16, u8, fopMsgM_pane_class*, f32, f32, f32, u8); + BOOL PaneTranceMenu(s16, u8, fopMsgM_pane_class*, f32, f32, u8, int); public: - /* 0x0004 */ u8 field_0x0004; - /* 0x0008 */ dDlst_MenuSave_c mDlst; + /* 0x0004 */ JKRArchive* archive; + /* 0x0008 */ dDlst_MenuSave_c MenuSave; + /* 0x0014 */ fopMsgM_pane_class field_0x14[8]; + /* 0x01D4 */ fopMsgM_pane_class field_0x1d4; + /* 0x020C */ fopMsgM_pane_class field_0x20c[5]; + /* 0x0324 */ fopMsgM_pane_class field_0x324; + /* 0x035C */ fopMsgM_pane_class field_0x35c; + /* 0x0394 */ fopMsgM_pane_class field_0x394; + /* 0x03CC */ fopMsgM_pane_class field_0x3cc; + /* 0x0404 */ fopMsgM_pane_class field_0x404; + /* 0x043C */ fopMsgM_pane_class field_0x43c; + /* 0x0474 */ fopMsgM_pane_class field_0x474; + /* 0x04AC */ fopMsgM_pane_class field_0x4ac; + /* 0x04E4 */ fopMsgM_pane_class field_0x4e4; #if VERSION == VERSION_PAL - // Not 100% sure where these extra bytes go, but it has to be before field_0x0537. - /* 0x000C */ u8 field_0x000c_pal[0x0038]; + /* 0x051C */ fopMsgM_pane_class field_0x51c_pal; #endif - /* 0x000C */ u8 field_0x000c[0x0524]; - /* 0x0530 */ u8 field_0x0530; - /* 0x0531 */ u8 mSaveStatus; - /* 0x0532 */ u8 field_0x0532; - /* 0x0533 */ u8 field_0x0533; - /* 0x0534 */ u8 field_0x0534; - /* 0x0535 */ u8 field_0x0535; - /* 0x0536 */ u8 field_0x0536; - /* 0x0537 */ u8 mUseType; - /* 0x0538 */ u8 mEndStatus; - /* 0x0539 */ u8 field_0x0539[0x053C - 0x0539]; - /* 0x053C */ u8 field_0x053c; - /* 0x053D */ u8 field_0x053d; - /* 0x053E */ u8 field_0x053e[0x0554 - 0x053E]; - /* 0x0554 */ u8 mDataBuf[0x1650]; + /* 0x051C */ char* field_0x51c[2]; + /* 0x0524 */ dFile_error_c* dFe_c; + /* 0x0528 */ STControl* stick; + /* 0x052C */ u8 proc; + /* 0x052D */ u8 field_0x52d; + /* 0x052E */ u8 field_0x52e; + /* 0x052F */ u8 field_0x52f; + /* 0x0530 */ u8 field_0x530; + /* 0x0531 */ u8 saveStatus; + /* 0x0532 */ u8 field_0x532; + /* 0x0533 */ u8 field_0x533; + /* 0x0534 */ u8 field_0x534; + /* 0x0535 */ u8 field_0x535; + /* 0x0536 */ u8 field_0x536; + /* 0x0537 */ u8 useType; + /* 0x0538 */ u8 endStatus; + /* 0x0539 */ u8 field_0x539; + /* 0x053A */ u8 field_0x53a; + /* 0x053B */ u8 field_0x53b; + /* 0x053C */ u8 field_0x53c; + /* 0x053D */ u8 field_0x53d; + /* 0x0540 */ int field_0x540; + /* 0x0544 */ s16 field_0x544; + /* 0x0546 */ u8 field_0x546[0x0554 - 0x0546]; + /* 0x0554 */ u8 dataBuf[5712]; }; // Size: 0x1BA4 -class dMs_HIO_c { +class dMs_HIO_c : public JORReflexible { public: dMs_HIO_c(); + virtual ~dMs_HIO_c() {} + + /* 0x04 */ s8 id; + /* 0x05 */ u8 field_0x5; + /* 0x06 */ u8 field_0x6; + /* 0x07 */ u8 field_0x7; + /* 0x08 */ u8 field_0x8; + /* 0x09 */ u8 field_0x9; + /* 0x0A */ u8 field_0xa; + /* 0x0B */ u8 field_0xb; + /* 0x0C */ s16 field_0xc; + /* 0x0E */ s16 field_0xe; + /* 0x10 */ u8 field_0x10; + /* 0x11 */ u8 field_0x11; + /* 0x12 */ u8 field_0x12; + /* 0x13 */ u8 field_0x13; + /* 0x14 */ s16 field_0x14; + /* 0x16 */ s16 field_0x16; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u8 field_0x1a; + /* 0x1B */ u8 field_0x1b; + /* 0x1C */ u8 field_0x1c; + /* 0x1E */ s16 field_0x1e; + /* 0x20 */ u8 field_0x20; + /* 0x21 */ u8 field_0x21; + /* 0x22 */ u8 field_0x22; + /* 0x23 */ u8 field_0x23; + /* 0x24 */ u8 field_0x24; + /* 0x25 */ u8 field_0x25; + /* 0x26 */ s16 field_0x26; + /* 0x28 */ u8 field_0x28; + /* 0x29 */ u8 field_0x29; + /* 0x2A */ u8 field_0x2a; + /* 0x2C */ s16 field_0x2c; + /* 0x2E */ u8 field_0x2e; }; diff --git a/include/d/d_save.h b/include/d/d_save.h index 3bf1ac8de0..5b5d252a8b 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -977,8 +977,8 @@ class dSv_info_c { /* 0x1158 */ dSv_event_c mTmp; /* 0x1258 */ dSv_turnRestart_c mTurnRestart; /* 0x1290 */ u8 mDataNum; - /* 0x1291 */ u8 mNoFile; - /* 0x1292 */ u8 mNewFile; + /* 0x1291 */ u8 mNewFile; + /* 0x1292 */ u8 mNoFile; /* 0x1298 */ u64 mMemCardCheckID; }; // Size: 0x12A0 diff --git a/include/d/d_snap.h b/include/d/d_snap.h index e3a522b64e..0350b299ff 100644 --- a/include/d/d_snap.h +++ b/include/d/d_snap.h @@ -92,7 +92,7 @@ enum { /* 0x54 */ DSNAP_TYPE_KB, /* 0x55 */ DSNAP_TYPE_KAMOME, /* 0x56 */ DSNAP_TYPE_KN, - /* 0x57 */ DSNAP_TYPE_UNK57, + /* 0x57 */ DSNAP_TYPE_TT, /* 0x58 */ DSNAP_TYPE_KM1, /* 0x59 */ DSNAP_TYPE_UNK59, /* 0x5A */ DSNAP_TYPE_UNK5A, @@ -172,7 +172,7 @@ enum { /* 0xA4 */ DSNAP_TYPE_UNKA4, /* 0xA5 */ DSNAP_TYPE_UNKA5, /* 0xA6 */ DSNAP_TYPE_UNKA6, - /* 0xA7 */ DSNAP_TYPE_UNKA7, + /* 0xA7 */ DSNAP_TYPE_NPC_MT, /* 0xA8 */ DSNAP_TYPE_UNKA8, /* 0xA9 */ DSNAP_TYPE_UNKA9, /* 0xAA */ DSNAP_TYPE_BK, diff --git a/include/d/d_tree.h b/include/d/d_tree.h index 999a922766..7b98bf22ce 100644 --- a/include/d/d_tree.h +++ b/include/d/d_tree.h @@ -94,7 +94,7 @@ class dTree_packet_c : public J3DPacket { dTree_anm_c* getAnm(int idx) { return &mAnm[idx]; } dTree_data_c* getData() { return mData; } - void setPlayerCutFlg(int i_flg) { mPlayerCutFlg = i_flg; } + void setPlayerCutFlg(BOOL i_flg) { mPlayerCutFlg = i_flg; } void setPlayerSwordTop(cXyz& i_pos) { mPlayerSwordTop = i_pos; } void setPlayerSwordMoveAngY(s16 i_ang) { mPlayerSwordMoveAngY = i_ang; } cXyz& getPlayerSwordTop() { return mPlayerSwordTop; } diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 2965cea142..cddc59c0a8 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -41,7 +41,7 @@ struct JMSMesgEntry_c { struct msg_process_profile_definition { /* 0x00 */ leaf_process_profile_definition base; - /* 0x24 */ msg_method_class* sub_method; // Subclass methods + /* 0x24 */ msg_method_class* sub_method; // Subclass methods }; struct fopMsg_prm_class { @@ -50,7 +50,7 @@ struct fopMsg_prm_class { /* 0x10 */ u32 mMsgNo; /* 0x14 */ u32 field_0x14; /* 0x18 */ int field_0x18; -}; // Size: 0x1C +}; // Size: 0x1C struct fopMsg_prm_timer : public fopMsg_prm_class { /* 0x1C */ int mTimerMode; @@ -59,7 +59,7 @@ struct fopMsg_prm_timer : public fopMsg_prm_class { /* 0x23 */ u8 mIconType; /* 0x24 */ cXy mTimerPos; /* 0x2C */ cXy mRupeePos; -}; // Size: 0x34 +}; // Size: 0x34 class J2DScreen; @@ -70,7 +70,7 @@ class fopMsgM_f2d_class { }; struct fopMsgM_pane_class { - /* 0x00 */ J2DPane * pane; + /* 0x00 */ J2DPane* pane; /* 0x04 */ fopMsgM_f2d_class mPosTopLeftOrig; /* 0x0C */ fopMsgM_f2d_class mPosTopLeft; /* 0x14 */ fopMsgM_f2d_class mPosCenterOrig; @@ -80,10 +80,10 @@ struct fopMsgM_pane_class { /* 0x34 */ u8 mInitAlpha; /* 0x35 */ u8 mNowAlpha; /* 0x36 */ s16 mUserArea; -}; // Size: 0x38 +}; // Size: 0x38 struct fopMsgM_pane_alpha_class { - /* 0x00 */ J2DPane * pane; + /* 0x00 */ J2DPane* pane; /* 0x04 */ u8 mInitAlpha; /* 0x05 */ u8 mNowAlpha; }; @@ -91,15 +91,13 @@ struct fopMsgM_pane_alpha_class { class fopMsgM_msgGet_c { public: virtual ~fopMsgM_msgGet_c() {} - mesg_header* getMesgHeader(u32); - mesg_info* getMesgInfo(mesg_header*); - mesg_data* getMesgData(mesg_header*); - JMSMesgEntry_c getMesgEntry(mesg_header*); - const char* getMessage(mesg_header*); - - u32 getMesgNumber() { - return (mGroupID << 8) | mResMsgNo; - } + mesg_header* getMesgHeader(u32 i_msgNo); + mesg_info* getMesgInfo(mesg_header* i_head); + mesg_data* getMesgData(mesg_header* i_head); + JMSMesgEntry_c getMesgEntry(mesg_header* i_head); + const char* getMessage(mesg_header* i_head); + + u32 getMesgNumber() { return (mGroupID << 8) | mResMsgNo; } public: /* 0x04 */ u32 mMsgIdx; @@ -116,11 +114,11 @@ class fopMsgM_itemMsgGet_c { mResMsgNo = 0; } virtual ~fopMsgM_itemMsgGet_c() {} - mesg_header* getMesgHeader(u32); - mesg_info* getMesgInfo(mesg_header*); - mesg_data* getMesgData(mesg_header*); - JMSMesgEntry_c getMesgEntry(mesg_header*); - const char* getMessage(mesg_header*); + mesg_header* getMesgHeader(u32 i_msgNo); + mesg_info* getMesgInfo(mesg_header* i_head); + mesg_data* getMesgData(mesg_header* i_head); + JMSMesgEntry_c getMesgEntry(mesg_header* i_head); + const char* getMessage(mesg_header* i_head); public: /* 0x04 */ u32 mMsgIdx; @@ -130,7 +128,8 @@ class fopMsgM_itemMsgGet_c { class MyPicture : public J2DPicture { public: - MyPicture(J2DPane* pParent, JSURandomInputStream* pStream) : J2DPicture(pParent, pStream) { + MyPicture(J2DPane* pParent, JSURandomInputStream* pStream) + : J2DPicture(pParent, pStream) { m134 = 0; } @@ -271,8 +270,8 @@ class fopMsgM_msgDataProc_c { int getLineCount() { return lineCount; } u8 getMesgStatus() { return mesgStatus; } f32 getNowCursorPos() { return field_0x20; } - u8 getRCharAlpha() { return field_0x291; } // ? - u8 getRGradAlpha() { return field_0x290; } // ? + u8 getRCharAlpha() { return field_0x291; } // ? + u8 getRGradAlpha() { return field_0x290; } // ? void getSelectFlag() {} void getSelectLength() {} void getStringColor() {} @@ -309,14 +308,10 @@ class fopMsgM_msgDataProc_c { void setStringColor(u32) {} void set_waitTimer(int) {} void set_waitTimerZero() {} - void shortCut() { - field_0x299 = 1; - } + void shortCut() { field_0x299 = 1; } // fake, replace with real inline once it's figured out - u32 get_0x220(int i) { - return field_0x220[i]; - } + u32 get_0x220(int i) { return field_0x220[i]; } public: /* 0x004 */ JUTFont* font[2]; @@ -325,7 +320,7 @@ class fopMsgM_msgDataProc_c { /* 0x014 */ f32 field_0x14; /* 0x018 */ f32 field_0x18; /* 0x01C */ f32 field_0x1C; - /* 0x020 */ f32 field_0x20; // NowCursorPos? + /* 0x020 */ f32 field_0x20; // NowCursorPos? /* 0x024 */ f32 field_0x24; /* 0x028 */ f32 field_0x28; /* 0x02C */ u32 field_0x2C; @@ -367,9 +362,9 @@ class fopMsgM_msgDataProc_c { /* 0x158 */ u32 field_0x158; /* 0x15C */ int spaceTimer; /* 0x160 */ int sendSpeed; - /* 0x164 */ int field_0x164; // keyWaitTimer? - /* 0x168 */ int field_0x168[0xF]; // IconPosX - /* 0x1A4 */ int field_0x1A4[0xF]; // IconPosY + /* 0x164 */ int field_0x164; // keyWaitTimer? + /* 0x168 */ int field_0x168[0xF]; // IconPosX + /* 0x1A4 */ int field_0x1A4[0xF]; // IconPosY /* 0x1A4 */ u32 field_0x1E0[0xF]; /* 0x21C */ int field_0x21C; /* 0x21C */ u32 field_0x220[0xF]; @@ -407,64 +402,64 @@ class fopMsgM_msgDataProc_c { typedef int (*fopMsgCreateFunc)(void*); -JKRExpHeap* fopMsgM_createExpHeap(u32, JKRHeap*); -JKRExpHeap* fopMsgM_createExpHeap(u32); -fpc_ProcID fopMsgM_Create(s16, fopMsgCreateFunc, void*); -fpc_ProcID fopMsgM_create(s16 i_procName, fopAc_ac_c* param_1 = NULL, cXyz* param_2 = NULL, - u32* param_3 = NULL, u32* param_4 = NULL, fopMsgCreateFunc createFunc = NULL); -inline fpc_ProcID fopMsgM_MiniGameStarter_create(s16 i_procName, u8 param_1, u16 param_2, fopMsgCreateFunc createFunc) { +JKRExpHeap* fopMsgM_createExpHeap(u32 i_size, JKRHeap* i_heap); +JKRExpHeap* fopMsgM_createExpHeap(u32 i_size); +fpc_ProcID fopMsgM_Create(s16 i_procName, fopMsgCreateFunc, void*); +fpc_ProcID fopMsgM_create(s16 i_procName, fopAc_ac_c* i_actor = NULL, cXyz* i_pos = NULL, u32* i_msgNo = NULL, u32* param_4 = NULL, fopMsgCreateFunc i_createFunc = NULL); + +inline fpc_ProcID fopMsgM_MiniGameStarter_create(s16 i_procName, u8 param_1, u16 param_2, fopMsgCreateFunc i_createFunc) { u32 parameter = param_1; parameter |= param_2 << 16; - return fopMsgM_create(i_procName, NULL, NULL, ¶meter, ¶meter, createFunc); + return fopMsgM_create(i_procName, NULL, NULL, ¶meter, ¶meter, i_createFunc); } -fpc_ProcID fop_MGameTerm_create(s16, s16, s16, int, int, fopMsgCreateFunc); -inline fpc_ProcID fopMsgM_MiniGameTerminater_create(s16 param_0, s16 param_1, s16 param_2, int param_3, int param_4, fopMsgCreateFunc createFunc) { - return fop_MGameTerm_create(param_0, param_1, param_2, param_3, param_4, createFunc); + +fpc_ProcID fop_MGameTerm_create(s16 i_procName, s16, s16, int, int, fopMsgCreateFunc); + +inline fpc_ProcID fopMsgM_MiniGameTerminater_create(s16 i_procName, s16 param_1, s16 param_2, int param_3, int param_4, fopMsgCreateFunc i_createFunc) { + return fop_MGameTerm_create(i_procName, param_1, param_2, param_3, param_4, i_createFunc); } -void fopMsgM_Delete(void* process); -fopMsg_prm_class* fopMsgM_GetAppend(void* msg); -void fopMsgM_destroyExpHeap(JKRExpHeap*); -f32 fopMsgM_valueIncrease(int param_0, int param_1, u8 param_2); + +void fopMsgM_Delete(void* i_proc); +fopMsg_prm_class* fopMsgM_GetAppend(void* i_proc); +void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap); +f32 fopMsgM_valueIncrease(int i_max, int i_value, u8 i_mode); #if VERSION >= VERSION_USA -bool fopMsgM_hyrule_language_check(u32 msgNo); +bool fopMsgM_hyrule_language_check(u32 i_msgNo); #endif -s32 fopMsgM_setStageLayer(void*); -fpc_ProcID fopMsgM_messageSet(u32 i_msgNo, fopAc_ac_c* i_actorP); -fpc_ProcID fopMsgM_messageSet(u32 param_0, cXyz*); -fpc_ProcID fopMsgM_messageSet(u32 param_0); -fpc_ProcID fopMsgM_scopeMessageSet(u32 param_0); -int fopMsgM_messageSetDemo(u32 param_0); -msg_class* fopMsgM_SearchByID(fpc_ProcID param_0); -char* fopMsgM_messageGet(char* dst, u32 msgNo); -char* fopMsgM_passwordGet(char* dst, u32 msgNo); -fpc_ProcID fop_Timer_create(s16 param_0, u8 param_1, u16 param_2, u8 param_3, u8 param_4, f32 param_5, - f32 param_6, f32 param_7, f32 param_8, fopMsgCreateFunc createFunc); -inline fpc_ProcID fopMsgM_Timer_create(s16 param_0, u8 param_1, u16 param_2, u8 param_3, u8 param_4, - f32 param_5, f32 param_6, f32 param_7, f32 param_8, - fopMsgCreateFunc createFunc) { - return fop_Timer_create(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, - param_8, createFunc); +s32 fopMsgM_setStageLayer(void* i_proc); +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo, fopAc_ac_c* i_actor); +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo, cXyz*); +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo); +fpc_ProcID fopMsgM_scopeMessageSet(u32 i_msgNo); +int fopMsgM_messageSetDemo(u32 i_msgNo); +msg_class* fopMsgM_SearchByID(fpc_ProcID i_pid); +char* fopMsgM_messageGet(char* i_dest, u32 i_msgNo); +char* fopMsgM_passwordGet(char* i_dest, u32 i_msgNo); +fpc_ProcID fop_Timer_create(s16 i_procName, u8 i_mode, u16 i_limitTimeMs, u8 i_showType, u8 i_iconType, f32 i_posX, f32 i_posY, f32 i_rupeePosX, f32 i_rupeePosY, fopMsgCreateFunc i_createFunc); + +inline fpc_ProcID fopMsgM_Timer_create(s16 i_procName, u8 i_mode, u16 i_limitTimeMs, u8 i_showType, u8 i_iconType, f32 i_posX, f32 i_posY, f32 i_rupeePosX, f32 i_rupeePosY, fopMsgCreateFunc createFunc) { + return fop_Timer_create(i_procName, i_mode, i_limitTimeMs, i_showType, i_iconType, i_posX, i_posY, i_rupeePosX, i_rupeePosY, createFunc); } -void fopMsgM_setPaneData(fopMsgM_pane_class*, J2DPane*); -void fopMsgM_setPaneData(fopMsgM_pane_class*, J2DScreen*, u32); -void fopMsgM_setInitAlpha(fopMsgM_pane_class*); -void fopMsgM_setNowAlpha(fopMsgM_pane_class*, f32); -void fopMsgM_setNowAlphaZero(fopMsgM_pane_class*); -void fopMsgM_setAlpha(fopMsgM_pane_class*); -void fopMsgM_paneScaleX(fopMsgM_pane_class* i_this, f32 s); -void fopMsgM_paneScaleY(fopMsgM_pane_class* i_this, f32 s); -void fopMsgM_paneScale(fopMsgM_pane_class* i_this, f32 sx, f32 sy); -void fopMsgM_paneScaleXY(fopMsgM_pane_class*, f32); -void fopMsgM_cposMove(fopMsgM_pane_class*); -void fopMsgM_paneTrans(fopMsgM_pane_class*, f32, f32); - -void fopMsgM_setPaneData(fopMsgM_pane_alpha_class*, J2DPane*); -void fopMsgM_setPaneData(fopMsgM_pane_alpha_class*, J2DScreen*, u32); -void fopMsgM_setNowAlpha(fopMsgM_pane_alpha_class*, f32); -void fopMsgM_setAlpha(fopMsgM_pane_alpha_class*); - -u32 fopMsgM_searchMessageNumber(u32); +void fopMsgM_setPaneData(fopMsgM_pane_class* i_pane, J2DPane* i_paneData); +void fopMsgM_setPaneData(fopMsgM_pane_class* i_pane, J2DScreen* i_scrn, u32 i_tag); +void fopMsgM_setInitAlpha(fopMsgM_pane_class* i_pane); +void fopMsgM_setNowAlpha(fopMsgM_pane_class* i_pane, f32 i_alpha); +void fopMsgM_setNowAlphaZero(fopMsgM_pane_class* i_pane); +void fopMsgM_setAlpha(fopMsgM_pane_class* i_pane); +void fopMsgM_paneScaleX(fopMsgM_pane_class* i_pane, f32 i_scale); +void fopMsgM_paneScaleY(fopMsgM_pane_class* i_pane, f32 i_scale); +void fopMsgM_paneScale(fopMsgM_pane_class* i_pane, f32 i_scaleX, f32 i_scaleY); +void fopMsgM_paneScaleXY(fopMsgM_pane_class* i_pane, f32 i_scale); +void fopMsgM_cposMove(fopMsgM_pane_class* i_pane); +void fopMsgM_paneTrans(fopMsgM_pane_class* i_pane, f32 i_transX, f32 i_transY); + +void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_pane, J2DPane* i_paneData); +void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_pane, J2DScreen* i_scrn, u32 i_tag); +void fopMsgM_setNowAlpha(fopMsgM_pane_alpha_class* i_pane, f32 i_alpha); +void fopMsgM_setAlpha(fopMsgM_pane_alpha_class* i_pane); + +u32 fopMsgM_searchMessageNumber(u32 i_msgNo); bool fopMsgM_forceSendOn(); void fopMsgM_messageSendOn(); void fopMsgM_messageSendOff(); @@ -484,20 +479,20 @@ bool fopMsgM_tactMsgFlagCheck(); void fopMsgM_nextMsgFlagOff(); bool fopMsgM_nextMsgFlagCheck(); -void fopMsgM_blendInit(fopMsgM_pane_class* i_this, const char* data); +void fopMsgM_blendInit(fopMsgM_pane_class* i_pane, const char* data); void fopMsgM_blendInit(J2DPicture* pic, const char* data); -u8 fopMsgM_itemNumIdx(u8 i); -u8 fopMsgM_itemNum(u8 itemNo); -u32 fopMsgM_getColorTable(u16 param_1); -void fopMsgM_blendDraw(fopMsgM_pane_class* i_this, const char* data); +u8 fopMsgM_itemNumIdx(u8 i_no); +u8 fopMsgM_itemNum(u8 i_itemNo); +u32 fopMsgM_getColorTable(u16 i_colorNo); +void fopMsgM_blendDraw(fopMsgM_pane_class* i_pane, const char* data); void fopMsgM_blendDraw(J2DPicture* pic, const char* data); void fopMsgM_setFontsizeCenter(char* param_1, char* param_2, char* param_3, char* param_4, int param_5, int param_6); void fopMsgM_setFontsizeCenter2(char* a, char* b, char* c, char* d, int, int size, int, int); -void fopMsgM_outFontSet(J2DPicture*, J2DPicture*, s16*, u32, u8); -void fopMsgM_outFontSet(J2DPicture*, s16*, u32, u8); -void fopMsgM_outFontDraw(J2DPicture*, J2DPicture*, int, int, int, s16*, u8, u8); -void fopMsgM_outFontDraw2(J2DPicture*, J2DPicture*, int, int, int, int, s16*, u8, u8); +void fopMsgM_outFontSet(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, s16* i_timer, u32 i_color, u8 i_iconNo); +void fopMsgM_outFontSet(J2DPicture* i_iconPic, s16* i_timer, u32 i_color, u8 i_iconNo); +void fopMsgM_outFontDraw(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int param_3, int param_4, int param_5, s16* i_timer, u8 i_alpha, u8 i_iconNo); +void fopMsgM_outFontDraw2(J2DPicture* i_iconPic, J2DPicture* param_2, int param_3, int param_4, int i_width, int i_height, s16* i_timer, u8 i_alpha, u8 i_iconNo); extern u16 zfont[][2]; diff --git a/include/m_Do/m_Do_MemCard.h b/include/m_Do/m_Do_MemCard.h index 2651d43233..938e283960 100644 --- a/include/m_Do/m_Do_MemCard.h +++ b/include/m_Do/m_Do_MemCard.h @@ -19,6 +19,19 @@ class mDoMemCd_Ctrl_c { #endif }; + enum CardStatus { + CARD_STAT_WAIT, + CARD_STAT_RESTORE, + CARD_STAT_CREATE, + CARD_STAT_FORMAT, + CARD_STAT_READY, + CARD_STAT_DETACH, + CARD_STAT_ENCODING, + CARD_STAT_ERROR, + CARD_STAT_WRONG_DEVICE = 10, + CARD_STAT_IOERROR = 12, + }; + mDoMemCd_Ctrl_c(); void ThdInit(); void main(); @@ -57,17 +70,17 @@ class mDoMemCd_Ctrl_c { u8 getCopyToPos() { return mCopyToPos; } void setCopyToPos(u8 pos) { mCopyToPos = pos; } - void clearProbeStat() {} + void clearProbeStat() { mProbeStat = 2; } u64 getCardSerialNo() { return mCardSerialNo; } - void getDataVersion() {} - void getProbeStat() {} + u32 getDataVersion() { return mDataVersion; } + u8 getProbeStat() { return mProbeStat; } /* 0x0000 */ u8 mData[3 * sizeof(card_gamedata)]; /* 0x1650 */ u8* mPictDataPtr; /* 0x1654 */ u8* mPictDataWritePtr; /* 0x1658 */ u8 mCardSlot; /* 0x1659 */ u8 mCopyToPos; - /* 0x165A */ u8 field_0x165A; + /* 0x165A */ u8 mProbeStat; /* 0x165B */ u8 field_0x165B; /* 0x165C */ s32 mCommand; /* 0x1660 */ s32 field_0x1660; @@ -91,8 +104,8 @@ inline void mDoMemCd_ThdInit() { g_mDoMemCd_control.ThdInit(); } -inline void mDoMemCd_Save(void* i_data, u32 param_1, u32 param_2) { - g_mDoMemCd_control.save(i_data,param_1,param_2); +inline void mDoMemCd_Save(void* i_data, u32 i_size, u32 i_position) { + g_mDoMemCd_control.save(i_data, i_size, i_position); } inline u8 mDoMemCd_getNowSlot() { @@ -103,28 +116,28 @@ inline u64 mDoMemCd_getCardSerialNo() { return g_mDoMemCd_control.getCardSerialNo(); } -inline void mDoMemCd_setCardSerialNo(u64 v) { - g_mDoMemCd_control.setCardSerialNo(v); +inline void mDoMemCd_setCardSerialNo(u64 i_serialNo) { + g_mDoMemCd_control.setCardSerialNo(i_serialNo); } -inline void mDoMemCd_setDataVersion(u32 v) { - g_mDoMemCd_control.setDataVersion(v); +inline void mDoMemCd_setDataVersion(u32 i_version) { + g_mDoMemCd_control.setDataVersion(i_version); } inline u8* mDoMemCd_getPictDataPtr() { return g_mDoMemCd_control.getPictDataPtr(); } -inline void mDoMemCd_setPictDataPtr(u8* v) { - g_mDoMemCd_control.setPictDataPtr(v); +inline void mDoMemCd_setPictDataPtr(u8* i_dataPtr) { + g_mDoMemCd_control.setPictDataPtr(i_dataPtr); } inline u8* mDoMemCd_getPictWriteDataPtr() { return g_mDoMemCd_control.getPictWriteDataPtr(); } -inline void mDoMemCd_setPictWriteDataPtr(u8* v) { - g_mDoMemCd_control.setPictWriteDataPtr(v); +inline void mDoMemCd_setPictWriteDataPtr(u8* i_dataPtr) { + g_mDoMemCd_control.setPictWriteDataPtr(i_dataPtr); } inline u8 mDoMemCd_getCopyToPos() { @@ -151,11 +164,28 @@ inline u32 mDoMemCd_getStatus(u32 status) { return g_mDoMemCd_control.getStatus(status); } -inline void mDoMemCd_Format() {} -inline void mDoMemCd_Load() {} -inline void mDoMemCd_LoadSync(void*, u32, u32) {} -inline void mDoMemCd_clearProbeStat() {} -inline void mDoMemCd_getDataVersion() {} -inline void mDoMemCd_getProbeStat() {} +inline void mDoMemCd_Format() { + g_mDoMemCd_control.command_format(); +} + +inline void mDoMemCd_Load() { + g_mDoMemCd_control.load(); +} + +inline u32 mDoMemCd_LoadSync(void* i_buffer, u32 i_size, u32 i_position) { + return g_mDoMemCd_control.LoadSync(i_buffer, i_size, i_position); +} + +inline void mDoMemCd_clearProbeStat() { + g_mDoMemCd_control.clearProbeStat(); +} + +inline u32 mDoMemCd_getDataVersion() { + return g_mDoMemCd_control.getDataVersion(); +} + +inline u8 mDoMemCd_getProbeStat() { + return g_mDoMemCd_control.getProbeStat(); +} #endif /* M_DO_M_DO_MEMCARD_H */ diff --git a/src/JSystem/JAudio/JAISeMgr.cpp b/src/JSystem/JAudio/JAISeMgr.cpp index ec141f40ea..9630c790e0 100644 --- a/src/JSystem/JAudio/JAISeMgr.cpp +++ b/src/JSystem/JAudio/JAISeMgr.cpp @@ -4,13 +4,15 @@ // #include "JSystem/JSystem.h" // IWYU pragma: keep - +#include "JSystem/JAudio/JAISystemInterface.h" #include "JSystem/JAudio/JAISeMgr.h" #include "JSystem/JAudio/JAIBasic.h" #include "JSystem/JAudio/JAIConst.h" #include "JSystem/JAudio/JAIGlobalParameter.h" #include "JSystem/JAudio/JAISequenceMgr.h" #include "JSystem/JKernel/JKRSolidHeap.h" +#include "SSystem/SComponent/c_xyz.h" +#include "dolphin/mtx/mtxvec.h" namespace JAISeMgr = JAInter::SeMgr; @@ -35,7 +37,7 @@ void JAInter::SeMgr::init() { for (int i = 0; i < JAIGlobalParameter::getParamSoundSceneMax(); i++) { int r31 = 0; for (int j = 0; j < JAIGlobalParameter::getParamSeCategoryMax(); j++) { - r31 += JAIBasic::getInterface()->field_0x1c[i][j]; + r31 += JAIBasic::getInterface()->field_0x1c[i][j * 2]; } if (JAIGlobalParameter::getParamSeTrackMax() < r31) { JAIGlobalParameter::setParamSeTrackMax(r31); @@ -69,19 +71,20 @@ void JAInter::SeMgr::init() { tmp->field_0x0 = 0xff; tmp->field_0x14 = 0.0f; } - SeParameter* parameterObject = new (JAIBasic::getCurrentJAIHeap(), 0x20) SeParameter[JAIGlobalParameter::getParamSeCategoryMax() * JAIGlobalParameter::getParamSeRegistMax()]; + SeParameter* parameterObject = + new (JAIBasic::getCurrentJAIHeap(), 0x20) SeParameter[JAIGlobalParameter::getParamSeCategoryMax() * JAIGlobalParameter::getParamSeRegistMax()]; JUT_ASSERT_MSG(99, parameterObject, "JAIData::initHeap Cannot Alloc Heap!!\n"); seParameterFreeStartPointer = parameterObject; seParameterUsedEndPointer = NULL; - parameterObject[0].field_0x43c = NULL; - parameterObject[0].field_0x440 = parameterObject + 1; + parameterObject[0].mPrev = NULL; + parameterObject[0].mNext = parameterObject + 1; int r27; for (r27 = 1; r27 < JAIGlobalParameter::getParamSeCategoryMax() * JAIGlobalParameter::getParamSeRegistMax() - 1; r27++) { - parameterObject[r27].field_0x43c = parameterObject + (r27 - 1); - parameterObject[r27].field_0x440 = parameterObject + (r27 + 1); + parameterObject[r27].mPrev = parameterObject + (r27 - 1); + parameterObject[r27].mNext = parameterObject + (r27 + 1); } - parameterObject[r27].field_0x43c = parameterObject + (r27 - 1); - parameterObject[r27].field_0x440 = NULL; + parameterObject[r27].mPrev = parameterObject + (r27 - 1); + parameterObject[r27].mNext = NULL; if (JAIBasic::getInterface()->field_0x1c) { categoryInfoTable = JAIBasic::getInterface()->field_0x1c; } else { @@ -102,7 +105,8 @@ void JAInter::SeMgr::init() { } /* 80293370-80293460 .text __ct__Q27JAInter11SeParameterFv */ -JAInter::SeParameter::SeParameter() {} +JAInter::SeParameter::SeParameter() { +} /* 80293460-80293508 .text startSeSequence__Q27JAInter5SeMgrFv */ void JAInter::SeMgr::startSeSequence() { @@ -121,83 +125,738 @@ void JAInter::SeMgr::processGFrameSe() { /* 80293530-80293C94 .text checkNextFrameSe__Q27JAInter5SeMgrFv */ void JAInter::SeMgr::checkNextFrameSe() { /* Nonmatching */ + struct SortEntry { + /* 0x0 */ u8 state; + /* 0x4 */ u32 priority; + /* 0x8 */ u32 sound; + }; + + u8 bVar4; + JAInter::SeqParameter* puVar6; + u8 uVar9; + u32 uVar8; + uint uVar10; + uint uVar15; + u8 bVar14; + uint uVar12; + u8 count_; + u8 cam; + u8 max_; + u8 bVar17; + u8 bVar13; + JAISound* pJVar18; + cXyz* pDst; + s32 iVar19; + JAISound JStack_198; + SortEntry entries[16]; + + if (seHandle->mState >= 4) { + f32 fVar24 = JAIGlobalParameter::getParamDistanceMax(); + f32 fVar25 = JAIGlobalParameter::getParamDistanceMax(); + fVar25 = fVar25 * fVar24; + f32 fVar1 = JAIGlobalParameter::getParamDistanceMax() / 1000.0f; + f32 fVar2; + f32 fVar3; + if (fVar1 == 0.0f) { + fVar1 = 1.0f; + } + for (u32 i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) { + for (bVar17 = 0; bVar17 < categoryInfoTable[seScene][i * 2]; bVar17++) { + entries[bVar17].priority = 0x7fffffff; + entries[bVar17].state = 0xff; + entries[bVar17].sound = 0; + } + count_ = 0; + pJVar18 = seRegist[i].field_0x4; + while (pJVar18 != NULL) { + if ((pJVar18->mState == 1) && ((pJVar18->mSoundID & 0xc00) != 0)) { + pJVar18->field_0x6 = pJVar18->field_0x6 - 1; + } else if (((pJVar18->mSoundID & 0xc00) == 0) && (pJVar18->mState == 5)) { + JStack_198.field_0x34 = pJVar18->field_0x34; + releaseSeRegist(pJVar18); + pJVar18 = &JStack_198; + } + if (pJVar18->field_0x6 == 0) { + JStack_198.field_0x34 = pJVar18->field_0x34; + releaseSeRegist(pJVar18); + pJVar18 = &JStack_198; + } else if (pJVar18->mState != 0) { + fVar2 = 2.1474836e+09f; + u8 cam_start, cam_end; + if (pJVar18->field_0x8 == 4) { + cam_start = 0; + cam_end = JAIGlobalParameter::getParamAudioCameraMax(); + } else { + cam_start = pJVar18->field_0x8; + cam_end = cam_start + 1; + } + for (cam = cam_start; cam < cam_end; cam++) { + pDst = (cXyz*)&pJVar18->mPositionInfo[cam]; + pDst[1].x = pDst->x; + pDst[1].y = pDst->y; + pDst[1].z = pDst->z; + if ((cXyz*)pJVar18->field_0x28 == (cXyz*)0x0) { + pDst->set(Const::dummyZeroVec); + } else { + PSMTXMultVec(JAIBasic::msBasic->mAudioCamera[cam].field_0x8, (Vec*)pJVar18->field_0x28, pDst); + } + pDst[2].x = pDst->x * pDst->x + pDst->y * pDst->y + pDst->z * pDst->z; + s16 prio = pJVar18->getInfoPriority(); + if (pJVar18->field_0xa != 0) { + prio += pJVar18->field_0xa; + if (prio < 0) { + prio = 0; + } else if (prio > 0xff) { + prio = 0xff; + } + } + iVar19 = (0xff - prio) * (0xff - prio) * 0x1690; + iVar19 = (u32)((f32)iVar19 / fVar1); + u32 iVar5 = (pDst[2].x / fVar1); + pJVar18->field_0x10 = iVar5 + iVar19; + if (pDst->z > 0.0f) { + iVar19 = (u32)((pDst->z * 6.0f) / fVar1); + pJVar18->field_0x10 = iVar19 + pJVar18->field_0x10; + } + if ((cam == 0) || (pDst[2].x < fVar2)) { + fVar2 = pDst[2].x; + } + } + if (pJVar18->field_0x8 == 4) { + uVar15 = pJVar18->field_0x10; + uVar8 = JAIGlobalParameter::getParamAudioCameraMax(); + pJVar18->field_0x10 = uVar15 / uVar8; + } + uVar15 = pJVar18->getSwBit(); + if ((uVar15 & 0x20) != 0) { + fVar3 = fVar25; + } else { + fVar3 = 1e+10f; + } + if (fVar2 > fVar3) { + if ((pJVar18->mSoundID & 0xc00) == 0) { + if (pJVar18->mState != 1) { + bVar14 = pJVar18->field_0x4; + if (bVar14 != 0xff) { + puVar6 = seHandle->getSeqParameter(); + JASystem::TTrack* track = puVar6->getRootTrackPointer(); + track->writePortApp((bVar14 >> 4) + 0x20000000 + (bVar14 & 0xf) * 0x10, 0); + seHandle->setTrackInterruptSwitch(pJVar18->field_0x4, '\x01'); + } + } + pJVar18->mState = 5; + pJVar18->field_0x4 = 0xff; + } else { + JStack_198.field_0x34 = pJVar18->field_0x34; + releaseSeBuffer(pJVar18, 0); + pJVar18 = &JStack_198; + } + } else { + bVar14 = categoryInfoTable[seScene][pJVar18->getSeCategoryNumber() * 2]; + for (bVar13 = 0; bVar13 < bVar14; bVar13++) { + if ((pJVar18->field_0x10 < entries[bVar13].priority) || + ((uVar15 = entries[bVar13].priority, uVar15 == pJVar18->field_0x10) && (entries[bVar13].state >= pJVar18->mState))) + { + if (count_ < bVar14) { + count_++; + } + for (bVar17 = bVar14 - 1; bVar13 < bVar17; bVar17--) { + entries[bVar17].priority = entries[bVar17 - 1].priority; + entries[bVar17].sound = entries[bVar17 - 1].sound; + entries[bVar13].state = entries[bVar17 - 1].state; + } + entries[bVar13].priority = pJVar18->field_0x10; + entries[bVar13].sound = (uint)pJVar18; + entries[bVar13].state = pJVar18->mState; + bVar13 = bVar14; + } + } + } + } + if (pJVar18 != NULL) { + pJVar18 = pJVar18->field_0x34; + } + } + for (bVar14 = 0; bVar14 < count_; bVar14++) { + JAISound* pSound = (JAISound*)entries[bVar14].sound; + uVar15 = pSound->mState; + if (uVar15 == 1) { + pSound->mState = 2; + } else if (uVar15 == 4) { + pSound->mState = 3; + } + } + max_ = categoryInfoTable[seScene][i * 2]; + for (bVar14 = 0; bVar14 < max_; bVar14++) { + bVar4 = 0; + pJVar18 = (JAISound*)sePlaySound[i][bVar14]; + if (pJVar18 == NULL) { + bVar4 = 1; + } else { + uVar9 = pJVar18->mState; + if (uVar9 == 4) { + if ((pJVar18->mSoundID & 0xc00) != 0) { + releaseSeRegist(pJVar18); + } else { + pJVar18->mState = 1; + pJVar18->field_0x6 = 0; + } + bVar4 = 1; + } else if ((uVar9 == 0) || (uVar9 == 5)) { + sePlaySound[i][bVar14] = 0; + bVar4 = 1; + } else { + for (bVar13 = 0; bVar13 < max_; bVar13++) { + uVar10 = sePlaySound[i][bVar14]; + if (entries[bVar13].sound == uVar10) { + entries[bVar13].sound = 0; + bVar13 = max_; + } + } + } + } + if (bVar4 == 1) { + for (bVar13 = 0; bVar13 < max_; bVar13++) { + uVar12 = entries[bVar13].sound; + if ((uVar12 != 0) && (((JAISound*)uVar12)->mState != 3)) { + for (bVar17 = 0; bVar17 < max_; bVar17++) { + if ((sePlaySound[i][bVar17] != 0) && (entries[bVar13].sound == sePlaySound[i][bVar17])) { + bVar4 = 0; + bVar17 = max_; + } + } + if (bVar4 == 1) { + sePlaySound[i][bVar14] = uVar12; + entries[bVar13].sound = 0; + bVar13 = max_ + 1; + } + } + } + if (bVar13 == max_) { + sePlaySound[i][bVar14] = 0; + } + } + } + } + } } /* 80293C94-802941DC .text checkPlayingSe__Q27JAInter5SeMgrFv */ void JAInter::SeMgr::checkPlayingSe() { /* Nonmatching */ + u16 local_56; + u16 local_58; + u8 j; + JAISound* sound; + u8 track; + + track = 0; + for (u8 i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) { + for (j = 0; j < categoryInfoTable[seScene][(u8)i * 2]; j++) { + sound = (JAISound*)sePlaySound[i][j]; + if (sound != NULL) { + sound->field_0x18 = sound->field_0x18 + 1; + u32 port = ((track >> 4) & 0xf) + 0x20000000 + (track & 0xf) * 0x10; + JASystem::TTrack* rootTrack = seHandle->getSeqParameter()->getRootTrackPointer(); + rootTrack->readPortApp(port + 0x20000, &local_56); + rootTrack->readPortApp(port, &local_58); + JAISound::PositionInfo_t* posInfo; + // u8 cam = 0; + posInfo = sound->mPositionInfo; + for (u8 cam = 0; cam < JAIGlobalParameter::getParamAudioCameraMax(); cam++) { + posInfo[cam].field_0x18 = std::sqrtf(posInfo[cam].field_0x18); + } + if (sound->mState == 2) { + u32 swBit = sound->getSwBit(); + sound->field_0x4 = track; + if ((swBit & 8) != 0) { + setSeqMuteFromSeStart(sound); + } + u32 masked = swBit & 0xc0; + if (masked != 0) { + u8 rnd = (u8)(Const::random.get_ufloat_1() * 255.0f); + switch (masked) { + case 0x40: + sound->field_0x7 = rnd & 0xf; + break; + case 0x80: + sound->field_0x7 = rnd & 0x1f; + break; + case 0xC0: + sound->field_0x7 = rnd & 0x3f; + break; + default: + sound->field_0x7 = 0; + break; + } + } + SeParameter* para = sound->getSeParameter(); + for (u8 k = 0; para->field_0x0[16] != 0; k++) { + int bit = 1 << k; + if ((para->field_0x0[16] & bit) != 0) { + u8 portTrack = sound->field_0x4; + seHandle->setTrackPortData(portTrack, k, sound->getSeParameter()->field_0x0[k]); + para->field_0x0[16] ^= bit; + } + } + sound->setSeDistanceParameters(); + JAIBasic::msBasic->setSeExtParameter(sound); + if (sound->mFadeCounter > 1) { + sound->setSeInterVolume(SOUNDPARAM_Direct, 0.0f, 0, 0); + sound->setSeInterVolume(SOUNDPARAM_Direct, 127.0f, sound->mFadeCounter, 0); + sound->mFadeCounter = 0; + } + sendSeAllParameter(sound); + u16 offsetNo = JAIBasic::msBasic->getSoundOffsetNumberFromID(sound->mSoundID); + if (sound->checkSwBit(0x800) != (u32)0) { + offsetNo += JAIBasic::msBasic->getMapInfoGround(sound->field_0x1c); + } + u16 wait; + if (JAIGlobalParameter::getParamAudioCameraMax() == 1 && (sound->checkSwBit(0x1000) != (u32)0)) { + if (sound->mPositionInfo[0].field_0x18 < JAIGlobalParameter::getParamDistanceMax()) { + u32 den = (u32)JAIGlobalParameter::getParamDistanceMax(); + u32 num = (u32)sound->mPositionInfo[0].field_0x18; + wait = JAIGlobalParameter::getParamSeDistanceWaitMax() * num / den; + } else { + wait = JAIGlobalParameter::getParamSeDistanceWaitMax(); + } + } else { + wait = 0; + } + rootTrack->writePortApp(port + 0x30000, wait); + rootTrack->writePortApp(port + 0x60000, JAIBasic::msBasic->getMapInfoFxline(sound->field_0x1c)); + rootTrack->writePortApp(port + 0x40000, offsetNo); + rootTrack->writePortApp(port, 1); + if ((sound->mSoundID & 0xc00) != 0) { + sound->mState = 4; + } else { + sound->mState = 5; + } + } else if ((local_56 == 0) && (local_58 != 1)) { + releaseSeRegist(sound); + } else if (sound->mFadeCounter != 0) { + if (sound->getSeParameter()->field_0x124[6].mCurrentValue != 0.0f) { + sound->setSeDistanceParameters(); + sendSeAllParameter(sound); + if ((sound->mSoundID & 0xc00) != 0) { + sound->mState = 4; + } else { + sound->mState = 5; + } + } else { + releaseSeRegist(sound); + } + } else { + if (sound->mState == 3) { + sound->setSeDistanceParameters(); + sendSeAllParameter(sound); + if ((sound->mSoundID & 0xc00) != 0) { + sound->mState = 4; + } else { + sound->mState = 5; + } + } + } + } + track++; + } + } } /* 802941DC-802942B0 .text setSeqMuteFromSeStart__Q27JAInter5SeMgrFP8JAISound */ -void JAInter::SeMgr::setSeqMuteFromSeStart(JAISound*) { +void JAInter::SeMgr::setSeqMuteFromSeStart(JAISound* i_sound) { /* Nonmatching */ + for (u32 i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) { + SeqUpdateData* pSVar1 = SequenceMgr::getPlayTrackInfo(i); + JAISound* trackSound = pSVar1->field_0x48; + if ((i != seHandle->field_0x4) && (trackSound != NULL)) { + if ((trackSound->getSwBit() & 8) == 0) { + trackSound->setSeqInterVolume( + SOUNDPARAM_Unk9, + JAIGlobalParameter::getParamSeqMuteVolumeSePlay() / 127.0f, + JAIGlobalParameter::getParamSeqMuteMoveSpeedSePlay() + ); + seqMuteFlagFromSe |= (1 << i_sound->field_0x4); + } + } + } } /* 802942B0-80294380 .text clearSeqMuteFromSeStop__Q27JAInter5SeMgrFP8JAISound */ -void JAInter::SeMgr::clearSeqMuteFromSeStop(JAISound*) { +void JAInter::SeMgr::clearSeqMuteFromSeStop(JAISound* sound) { /* Nonmatching */ + if (seqMuteFlagFromSe != (u32)0 && (sound->getSwBit() & 8) != 0) { + for (u32 i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) { + SeqUpdateData* trackInfo = SequenceMgr::getPlayTrackInfo(i); + JAISound* trackSound = trackInfo->field_0x48; + if (i != seHandle->field_0x4 && trackSound != NULL) { + if ((trackSound->getSwBit() & 8) == 0) { + seqMuteFlagFromSe = seqMuteFlagFromSe & ((1 << sound->field_0x4) ^ 0xFFFFFFFF); + if (seqMuteFlagFromSe == 0) { + trackSound->setSeqInterVolume(SOUNDPARAM_Unk9, 1.0f, JAIGlobalParameter::getParamSeqMuteMoveSpeedSePlay()); + } + } + } + } + } } /* 80294380-802944A0 .text checkSeMovePara__Q27JAInter5SeMgrFv */ void JAInter::SeMgr::checkSeMovePara() { - /* Nonmatching */ - if (seHandle && seHandle->getSeqParameter()->field_0x1261 != 2) { - for (u8 i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) { - for (JAISound* sound = seRegist[i].field_0x4; sound; sound = sound->field_0x34) { - for (u8 j = 0; j < 8; j++) { - sound->getSeParameter()->field_0x124[j].move(); - sound->getSeParameter()->field_0x1a4[j].move(); - sound->getSeParameter()->field_0x2a4[j].move(); - sound->getSeParameter()->field_0x324[j].move(); - sound->getSeParameter()->field_0x3a4[j].move(); - sound->getSeParameter()->field_0x224[j].move(); - } + + if (seHandle == NULL || seHandle->getSeqParameter()->field_0x1261 == 2) { + return; + } + for (u8 i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) { + for (JAISound* sound = seRegist[i].field_0x4; sound; sound = sound->field_0x34) { + for (u8 j = 0; j < 8; j++) { + sound->getSeParameter()->field_0x124[j].move(); + sound->getSeParameter()->field_0x1a4[j].move(); + sound->getSeParameter()->field_0x2a4[j].move(); + sound->getSeParameter()->field_0x324[j].move(); + sound->getSeParameter()->field_0x3a4[j].move(); + sound->getSeParameter()->field_0x224[j].move(); } } } } /* 802944A0-802945FC .text sendSeAllParameter__Q27JAInter5SeMgrFP8JAISound */ -void JAInter::SeMgr::sendSeAllParameter(JAISound*) { +void JAInter::SeMgr::sendSeAllParameter(JAISound* i_sound) { /* Nonmatching */ + SeqUpdateData* trackInfo; + SeParameter* para; + seTrackUpdate_s* trackUpdate = &seTrackUpdate[i_sound->field_0x4]; + para = i_sound->getSeParameter(); + trackInfo = SequenceMgr::getPlayTrackInfo(seHandle->field_0x4); + checkPlayingSeUpdateMultiplication( + i_sound, + trackInfo, + para->field_0x424[0], + para->field_0x124, + seCategoryVolume[i_sound->getSeCategoryNumber()], + 2, + &trackUpdate->field_0x4 + ); + checkPlayingSeUpdateAddition(i_sound, trackInfo, para->field_0x424[1], para->field_0x1a4, 4, &trackUpdate->field_0x10, 0.5f); + checkPlayingSeUpdateMultiplication(i_sound, trackInfo, para->field_0x424[2], para->field_0x224, 1.0f, 3, &trackUpdate->field_0x8); + checkPlayingSeUpdateAddition(i_sound, trackInfo, para->field_0x424[3], para->field_0x2a4, 5, &trackUpdate->field_0xc, 0.0f); + checkPlayingSeUpdateAddition( + i_sound, + trackInfo, + para->field_0x424[5], + para->field_0x3a4, + 6, + &trackUpdate->field_0x14, + JAIGlobalParameter::getParamSeDolbyCenterValue() / 127.0f + ); + u32 value = trackInfo->trackupdate[i_sound->field_0x4]; + if (value != 0) { + SystemInterface::setSeqPortargsU32(SequenceMgr::getPlayTrackInfo(seHandle->field_0x4), i_sound->field_0x4, 1, value); + trackInfo->systemTrackParameter[i_sound->field_0x4].mCommand.addPortCmdOnce(); + } } /* 802945FC-802946F0 .text checkPlayingSeUpdateMultiplication__Q27JAInter5SeMgrFP8JAISoundPQ27JAInter13SeqUpdateDataPfPQ27JAInter11MoveParaSetfUcPf */ -void JAInter::SeMgr::checkPlayingSeUpdateMultiplication(JAISound*, JAInter::SeqUpdateData*, f32*, JAInter::MoveParaSet*, f32, u8, f32*) { +void JAInter::SeMgr::checkPlayingSeUpdateMultiplication( + JAISound* i_sound, JAInter::SeqUpdateData* param_2, f32* param_3, JAInter::MoveParaSet* param_4, f32 param_5, u8 param_6, f32* param_7 +) { /* Nonmatching */ + f32 curr; + f32 value; + if (-1.0f == (curr = param_4[7].mCurrentValue)) { + if (param_3 != NULL) { + param_4->mCurrentValue = *param_3; + } + value = 1.0f; + for (int i = 0; i < 7; i++) { + value *= param_4[i].mCurrentValue; + } + } else { + value = curr; + } + value *= param_5; + if (*param_7 != value) { + *param_7 = value; + if (i_sound->mState != 2) { + param_2->trackupdate[i_sound->field_0x4] |= 1 << (param_6 - 2); + SystemInterface::setSeqPortargsF32(SequenceMgr::getPlayTrackInfo(seHandle->field_0x4), i_sound->field_0x4, param_6, value); + } + } } /* 802946F0-8029480C .text checkPlayingSeUpdateAddition__Q27JAInter5SeMgrFP8JAISoundPQ27JAInter13SeqUpdateDataPfPQ27JAInter11MoveParaSetUcPff */ -void JAInter::SeMgr::checkPlayingSeUpdateAddition(JAISound*, JAInter::SeqUpdateData*, f32*, JAInter::MoveParaSet*, u8, f32*, f32) { +void JAInter::SeMgr::checkPlayingSeUpdateAddition( + JAISound* i_sound, JAInter::SeqUpdateData* param_2, f32* param_3, JAInter::MoveParaSet* param_4, u8 param_5, f32* param_6, f32 param_7 +) { /* Nonmatching */ + f32 curr; + f32 value; + if (-1.0f == (curr = param_4[7].mCurrentValue)) { + if (param_3 != NULL) { + param_4->mCurrentValue = *param_3; + } + value = 0.0f; + for (int i = 0; i < 7; i++) { + value += param_4[i].mCurrentValue - param_7; + } + value += param_7; + if (value < 0.0f) { + value = 0.0f; + } else if (value > 1.0f) { + value = 1.0f; + } + } else { + value = curr; + } + if (*param_6 != value) { + *param_6 = value; + if (i_sound->mState != 2) { + param_2->trackupdate[i_sound->field_0x4] |= 1 << (param_5 - 2); + SystemInterface::setSeqPortargsF32(SequenceMgr::getPlayTrackInfo(seHandle->field_0x4), i_sound->field_0x4, param_5, value); + } + } } /* 8029480C-80294814 .text changeIDToCategory__Q27JAInter5SeMgrFUl */ -u8 JAInter::SeMgr::changeIDToCategory(u32) { - /* Nonmatching */ +u8 JAInter::SeMgr::changeIDToCategory(u32 i_id) { + return i_id >> 0xc & 0xff; } /* 80294814-80294938 .text releaseSeRegist__Q27JAInter5SeMgrFP8JAISound */ -void JAInter::SeMgr::releaseSeRegist(JAISound*) { - /* Nonmatching */ +void JAInter::SeMgr::releaseSeRegist(JAISound* i_sound) { + u8 bVar4; + + if (i_sound->mState != 1) { + u8 track = i_sound->field_0x4; + seHandle->getSeqParameter()->getRootTrackPointer()->writePortApp((track >> 4) + 0x20000000 + (track & 0xf) * 0x10, 0); + seHandle->setTrackInterruptSwitch(i_sound->field_0x4, 1); + } + clearSeqMuteFromSeStop(i_sound); + u8 bound = categoryInfoTable[seScene][i_sound->getSeCategoryNumber() * 2]; + u8 category = i_sound->getSeCategoryNumber(); + for (bVar4 = 0; bVar4 < bound; bVar4++) { + if ((JAISound*)sePlaySound[category][bVar4] == i_sound) { + sePlaySound[category][bVar4] = 0; + bVar4 = bound; + } + } + i_sound->clearMainSoundPPointer(); + i_sound->mState = 0; + i_sound->field_0x4 = 0xff; + releaseSeParameterPointer(i_sound->getSeParameter()); + seRegist[category].releaseSound(i_sound); } /* 80294938-80294994 .text getSeParametermeterPointer__Q27JAInter5SeMgrFv */ JAInter::SeParameter* JAInter::SeMgr::getSeParametermeterPointer() { - /* Nonmatching */ + SeParameter** ppFree = &seParameterFreeStartPointer; + SeParameter** ppUsed = &seParameterUsedEndPointer; + if (seParameterFreeStartPointer != NULL) { + SeParameter* parameter = *ppFree; + *ppFree = parameter->mNext; + if (*ppUsed != NULL) { + parameter->mNext = *ppUsed; + (*ppUsed)->mPrev = parameter; + } else { + parameter->mNext = NULL; + } + parameter->mPrev = NULL; + *ppUsed = parameter; + return parameter; + } + return NULL; } /* 80294994-80294A10 .text releaseSeParameterPointer__Q27JAInter5SeMgrFPQ27JAInter11SeParameter */ -void JAInter::SeMgr::releaseSeParameterPointer(JAInter::SeParameter*) { - /* Nonmatching */ +void JAInter::SeMgr::releaseSeParameterPointer(JAInter::SeParameter* i_sound) { + if (i_sound == NULL) { + return; + } + SeParameter** ppFree = &seParameterFreeStartPointer; + SeParameter** ppUsed = &seParameterUsedEndPointer; + if (seParameterUsedEndPointer != i_sound) { + i_sound->mPrev->mNext = i_sound->mNext; + if (i_sound->mNext != 0) { + i_sound->mNext->mPrev = i_sound->mPrev; + } + } else { + *ppUsed = i_sound->mNext; + if (i_sound->mNext != 0) { + i_sound->mNext->mPrev = 0; + } + } + i_sound->mNext = *ppFree; + if (i_sound->mNext != 0) { + i_sound->mNext->mPrev = i_sound; + } + *ppFree = i_sound; } /* 80294A10-80294EBC .text storeSeBuffer__Q27JAInter5SeMgrFPP8JAISoundPQ27JAInter5ActorUlUlUcPv */ -void JAInter::SeMgr::storeSeBuffer(JAISound**, JAInter::Actor*, u32, u32, u8, void*) { +void JAInter::SeMgr::storeSeBuffer(JAISound** i_sound, JAInter::Actor* i_actor, u32 param_3, u32 param_4, u8 param_5, void* param_6) { /* Nonmatching */ + float fVar1; + float fVar2; + JAISound* pJVar3; + JAISound* test; + u32 iVar4; + u8 uVar5; + u32 uVar7; + u32 uVar8; + Vec* puVar12; + u8 uVar9; + JAISound* pJVar10; + u8 bVar11; + JAISound* local_98[16]; + + if ((i_sound == NULL) || (test = *i_sound, test == NULL) || (param_3 == test->mSoundID && !(param_3 == test->mSoundID && (param_3 & 0xc00) == 0x800)) || (iVar4 = test->checkSoundHandle(param_3, param_6), iVar4 == 0)) + { + uVar5 = changeIDToCategory(param_3); + pJVar3 = seRegist[uVar5].field_0x4; + Actor* actor = i_actor; + if (actor == NULL) { + actor = &Const::nullActor; + } + puVar12 = actor->field_0x0; + bVar11 = 0; + uVar9 = categoryInfoTable[seScene][(param_3 >> 0xb & 0x1fe) + 1]; + while (pJVar3 != NULL) { + if (pJVar3->field_0x24 == puVar12) { + if ((param_3 == pJVar3->mSoundID) && ((*(uint*)param_6 & 0x80000) == 0)) { + if ((param_3 & 0x800) == 0) { + if (pJVar3->field_0x4 != 0xff) { + pJVar3->mState = 4; + } else { + pJVar3->mState = 1; + } + if (i_sound == (JAISound**)0x0) { + return; + } + if (*i_sound != NULL) { + return; + } + pJVar3->field_0x38 = i_sound; + *i_sound = pJVar3; + return; + } + pJVar3->stop(0); + pJVar3 = NULL; + bVar11 = 0xff; + } else { + if (bVar11 == 0) { + local_98[bVar11] = pJVar3; + } else { + uVar7 = pJVar3->getInfoPriority(); + uVar8 = local_98[0]->getInfoPriority(); + if (uVar8 < uVar7) { + local_98[bVar11] = pJVar3; + } else { + // uVar8 = bVar11; + for (int i = 0; i < (u32)bVar11; i++) { + local_98[i + 1] = local_98[i]; + } + local_98[0] = pJVar3; + } + } + pJVar3 = pJVar3->field_0x34; + bVar11++; + } + } else { + pJVar3 = pJVar3->field_0x34; + } + } + if (bVar11 == uVar9) { + uVar9 = local_98[0]->getInfoPriority(); + if (uVar9 > *(u8*)((int)param_6 + 4)) { + return; + } + uVar9 = local_98[0]->getInfoPriority(); + if ((uVar9 == *(u8*)((int)param_6 + 4)) && (local_98[0]->mState == 5)) { + return; + } + releaseSeRegist(local_98[0]); + } + pJVar3 = seRegist[uVar5].getSound(); + if (pJVar3 == NULL) { + pJVar10 = seRegist[uVar5].field_0x4; + fVar1 = 0.0f; + pJVar3 = NULL; + for (; pJVar10 != NULL; pJVar10 = pJVar10->field_0x34) { + fVar2 = 0.0f; + u8 camStart, camEnd; + if (pJVar10->field_0x8 == 4) { + camStart = 0; + camEnd = JAIGlobalParameter::getParamAudioCameraMax(); + } else { + camStart = pJVar10->field_0x8; + camEnd = camStart + 1; + } + for (u8 cam = camStart; cam < camEnd; cam++) { + if (pJVar10->mPositionInfo[cam].field_0x18 >= fVar2) { + fVar2 = pJVar10->mPositionInfo[cam].field_0x18; + } + } + if ((pJVar10->mState != 1) && (fVar1 <= fVar2)) { + fVar1 = fVar2; + pJVar3 = pJVar10; + } + } + if (pJVar3 != NULL) { + pJVar3->stop(0); + pJVar3 = seRegist[uVar5].getSound(); + } else { + if (i_sound == NULL) { + return; + } + *i_sound = NULL; + return; + } + } + SeParameter* parameter = getSeParametermeterPointer(); + if (parameter == NULL) { + seRegist[uVar5].releaseSound(pJVar3); + *i_sound = NULL; + } else { + f32 dolby = JAIGlobalParameter::getParamSeDolbyCenterValue() / 127.0f; + for (int i = 0; i < 8; i++) { + parameter->field_0x124[i].init(1.0f); + parameter->field_0x1a4[i].init(0.5f); + parameter->field_0x224[i].init(1.0f); + parameter->field_0x2a4[i].init(0.0f); + parameter->field_0x324[i].init(0.0f); + parameter->field_0x3a4[i].init(dolby); + } + parameter->field_0x124[7].init(-1.0f); + parameter->field_0x1a4[7].init(-1.0f); + parameter->field_0x224[7].init(-1.0f); + parameter->field_0x2a4[7].init(-1.0f); + parameter->field_0x324[7].init(-1.0f); + parameter->field_0x3a4[7].init(-1.0f); + parameter->field_0x424[0] = NULL; + parameter->field_0x424[1] = NULL; + parameter->field_0x424[2] = NULL; + parameter->field_0x424[3] = NULL; + parameter->field_0x424[4] = NULL; + parameter->field_0x424[5] = NULL; + parameter->field_0x0[16] = 0; + pJVar3->field_0x3c = parameter; + pJVar3->mState = 1; + pJVar3->field_0x4 = 0xff; + pJVar3->initParameter(i_sound, actor, param_3, param_4, param_5, param_6); + } + } } /* 80294EBC-80294F14 .text releaseSeBuffer__Q27JAInter5SeMgrFP8JAISoundUl */ -void JAInter::SeMgr::releaseSeBuffer(JAISound*, u32) { +void JAInter::SeMgr::releaseSeBuffer(JAISound* param_1, u32 param_2) { /* Nonmatching */ + if (param_1->mState != NULL) { + if ((param_2 == 0) || (param_1->mState == 1)) { + releaseSeRegist(param_1); + } else { + param_1->mFadeCounter = param_2; + param_1->setSeInterVolume(SOUNDPARAM_Direct, 0.0, param_2, 0); + } + } } diff --git a/src/JSystem/JAudio/JAISequenceMgr.cpp b/src/JSystem/JAudio/JAISequenceMgr.cpp index 9210157bb0..ab6b6e21e6 100644 --- a/src/JSystem/JAudio/JAISequenceMgr.cpp +++ b/src/JSystem/JAudio/JAISequenceMgr.cpp @@ -4,6 +4,7 @@ // #include "JSystem/JSystem.h" // IWYU pragma: keep +#include "JSystem/JAudio/JAISystemInterface.h" #include "JSystem/JAudio/JAISequenceMgr.h" #include "JSystem/JAudio/JAIBasic.h" @@ -86,10 +87,12 @@ JAInter::SeqUpdateData::SeqUpdateData() { } /* 80296744-80296780 .text __dt__Q27JAInter15PlayerParameterFv */ -JAInter::PlayerParameter::~PlayerParameter() {} +JAInter::PlayerParameter::~PlayerParameter() { +} /* 80296780-802967B4 .text __ct__Q27JAInter15PlayerParameterFv */ -JAInter::PlayerParameter::PlayerParameter() {} +JAInter::PlayerParameter::PlayerParameter() { +} /* 802967B4-80296820 .text getArchiveName__Q27JAInter11SequenceMgrFPc */ void JAInter::SequenceMgr::getArchiveName(char* buffer) { @@ -125,16 +128,70 @@ void JAInter::SequenceMgr::checkEntriedSeq() { /* 80296C24-80296CCC .text checkFadeoutSeq__Q27JAInter11SequenceMgrFv */ void JAInter::SequenceMgr::checkFadeoutSeq() { /* Nonmatching */ + s32 i; + JAISound* sound; + SeqUpdateData* track_info; + + for (i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) { + track_info = &seqTrackInfo[i]; + sound = track_info->field_0x48; + if ((sound != NULL) && (sound->mState == 5) && (sound->getSeqInterVolume(7) == 0.0f)) { + track_info->field_0x48->getSeqParameter()->getRootTrackPointer()->stopSeq(); + track_info->field_0x48->clearMainSoundPPointer(); + stopSeq(track_info->field_0x48); + track_info->field_0x8 = 0; + } + } } /* 80296CCC-80296D6C .text checkStoppedSeq__Q27JAInter11SequenceMgrFv */ void JAInter::SequenceMgr::checkStoppedSeq() { /* Nonmatching */ + s32 i; + JAISound* sound; + SeqUpdateData* track_info; + + for (i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) { + track_info = &seqTrackInfo[i]; + sound = track_info->field_0x48; + if (sound != NULL) { + if ((sound->mState == 4) || (sound->mState == 5)) { + if ((u8)SystemInterface::checkSeqActiveFlag(sound->getSeqParameter()->getRootTrackPointer()) == 0) { + track_info->field_0x48->clearMainSoundPPointer(); + stopSeq(track_info->field_0x48); + track_info->field_0x8 = 0; + } + } + } + } } /* 80296D6C-80296E6C .text checkPlayingSeq__Q27JAInter11SequenceMgrFv */ void JAInter::SequenceMgr::checkPlayingSeq() { /* Nonmatching */ + SeqParameter* iVar2; + u32* track; + u8 uVar6; + u32 i; + SeqUpdateData* track_info; + for (i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) { + track_info = &seqTrackInfo[i]; + if ((track_info->field_0x48 != 0) && track_info->field_0x48->mState >= 4) { + checkPlayingSeqTrack(i); + for (uVar6 = 0; uVar6 < JAIGlobalParameter::getParamSeqTrackMax() + 1U; uVar6++) { + track = (u32*)track_info->trackupdate; + if (track[uVar6] != 0) { + if (uVar6 != 0x20) { + iVar2 = track_info->field_0x48->getSeqParameter(); + if ((iVar2->field_0x135c->field_0x4 & 1 << uVar6) == 0) + continue; + } + SystemInterface::setSeqPortargsU32(track_info, uVar6, 1, track_info->trackupdate[uVar6]); + track_info->systemTrackParameter[uVar6].mCommand.addPortCmdOnce(); + } + } + } + } } /* 80296E6C-80296F00 .text checkStartedSeq__Q27JAInter11SequenceMgrFv */ diff --git a/src/JSystem/JAudio/JAISound.cpp b/src/JSystem/JAudio/JAISound.cpp index 1e7d296bfc..3de357b6c9 100644 --- a/src/JSystem/JAudio/JAISound.cpp +++ b/src/JSystem/JAudio/JAISound.cpp @@ -63,18 +63,18 @@ void JAISound::stop(u32 fadeTime) { /* 802986B8-8029878C .text setVolume__8JAISoundFfUlUc */ void JAISound::setVolume(f32 param_1, u32 param_2, u8 param_3) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqInterVolume(param_3, param_1, param_2); - break; - case JAISoundID_Type_Se: - setSeInterVolume(param_3, param_1, param_2, 0); - break; - case JAISoundID_Type_Stream: - setStreamInterVolume(param_3, param_1, param_2); - break; - default: - JUT_ASSERT_MSG(177, 0, "JAISound::setVolume サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqInterVolume(param_3, param_1, param_2); + break; + case JAISoundID_Type_Se: + setSeInterVolume(param_3, param_1, param_2, 0); + break; + case JAISoundID_Type_Stream: + setStreamInterVolume(param_3, param_1, param_2); + break; + default: + JUT_ASSERT_MSG(177, 0, "JAISound::setVolume サウンドカテゴリービットが異常です。\n"); } } @@ -84,18 +84,18 @@ static void dummy1() { /* 8029878C-80298864 .text setPan__8JAISoundFfUlUc */ void JAISound::setPan(f32 param_1, u32 param_2, u8 param_3) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqInterPan(param_3, param_1, param_2); - break; - case JAISoundID_Type_Se: - setSeInterPan(param_3, param_1, param_2, 0); - break; - case JAISoundID_Type_Stream: - setStreamInterPan(param_3, param_1, param_2); - break; - default: - JUT_ASSERT_MSG(217, 0, "JAISound::setPan サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqInterPan(param_3, param_1, param_2); + break; + case JAISoundID_Type_Se: + setSeInterPan(param_3, param_1, param_2, 0); + break; + case JAISoundID_Type_Stream: + setStreamInterPan(param_3, param_1, param_2); + break; + default: + JUT_ASSERT_MSG(217, 0, "JAISound::setPan サウンドカテゴリービットが異常です。\n"); } } @@ -105,18 +105,18 @@ static void dummy2() { /* 80298864-8029893C .text setPitch__8JAISoundFfUlUc */ void JAISound::setPitch(f32 param_1, u32 param_2, u8 param_3) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqInterPitch(param_3, param_1, param_2); - break; - case JAISoundID_Type_Se: - setSeInterPitch(param_3, param_1, param_2, 0); - break; - case JAISoundID_Type_Stream: - setStreamInterPitch(param_3, param_1, param_2); - break; - default: - JUT_ASSERT_MSG(257, 0, "JAISound::setPitch サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqInterPitch(param_3, param_1, param_2); + break; + case JAISoundID_Type_Se: + setSeInterPitch(param_3, param_1, param_2, 0); + break; + case JAISoundID_Type_Stream: + setStreamInterPitch(param_3, param_1, param_2); + break; + default: + JUT_ASSERT_MSG(257, 0, "JAISound::setPitch サウンドカテゴリービットが異常です。\n"); } } @@ -126,17 +126,17 @@ static void dummy3() { /* 8029893C-80298A04 .text setFxmix__8JAISoundFfUlUc */ void JAISound::setFxmix(f32 param_1, u32 param_2, u8 param_3) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqInterFxmix(param_3, param_1, param_2); - break; - case JAISoundID_Type_Se: - setSeInterFxmix(param_3, param_1, param_2, 0); - break; - case JAISoundID_Type_Stream: - break; - default: - JUT_ASSERT_MSG(297, 0, "JAISound::setFxmix サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqInterFxmix(param_3, param_1, param_2); + break; + case JAISoundID_Type_Se: + setSeInterFxmix(param_3, param_1, param_2, 0); + break; + case JAISoundID_Type_Stream: + break; + default: + JUT_ASSERT_MSG(297, 0, "JAISound::setFxmix サウンドカテゴリービットが異常です。\n"); } } @@ -146,17 +146,17 @@ static void dummy4() { /* 80298A04-80298ACC .text setDolby__8JAISoundFfUlUc */ void JAISound::setDolby(f32 param_1, u32 param_2, u8 param_3) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqInterDolby(param_3, param_1, param_2); - break; - case JAISoundID_Type_Se: - setSeInterDolby(param_3, param_1, param_2, 0); - break; - case JAISoundID_Type_Stream: - break; - default: - JUT_ASSERT_MSG(337, 0, "JAISound::setDolby サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqInterDolby(param_3, param_1, param_2); + break; + case JAISoundID_Type_Se: + setSeInterDolby(param_3, param_1, param_2, 0); + break; + case JAISoundID_Type_Stream: + break; + default: + JUT_ASSERT_MSG(337, 0, "JAISound::setDolby サウンドカテゴリービットが異常です。\n"); } } @@ -166,48 +166,48 @@ static void dummy5() { /* 80298ACC-80298B74 .text setTempoProportion__8JAISoundFfUl */ void JAISound::setTempoProportion(f32 param_1, u32 param_2) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqTempoProportion(param_1, param_2); - break; - case JAISoundID_Type_Se: - break; - case JAISoundID_Type_Stream: - break; - default: - JUT_ASSERT_MSG(377, 0, "JAISound::setTempoProportion サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqTempoProportion(param_1, param_2); + break; + case JAISoundID_Type_Se: + break; + case JAISoundID_Type_Stream: + break; + default: + JUT_ASSERT_MSG(377, 0, "JAISound::setTempoProportion サウンドカテゴリービットが異常です。\n"); } } /* 80298B74-80298C28 .text setPortData__8JAISoundFUcUs */ void JAISound::setPortData(u8 param_1, u16 param_2) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqPortData(param_1, param_2, 0); - break; - case JAISoundID_Type_Se: - setSePortData(param_1, param_2); - break; - case JAISoundID_Type_Stream: - break; - default: - JUT_ASSERT_MSG(397, 0, "JAISound::setPortData サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqPortData(param_1, param_2, 0); + break; + case JAISoundID_Type_Se: + setSePortData(param_1, param_2); + break; + case JAISoundID_Type_Stream: + break; + default: + JUT_ASSERT_MSG(397, 0, "JAISound::setPortData サウンドカテゴリービットが異常です。\n"); } } /* 80298C28-80298CD8 .text setPrepareFlag__8JAISoundFUc */ void JAISound::setPrepareFlag(u8 param_1) { - switch(mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - setSeqPrepareFlag(param_1); - break; - case JAISoundID_Type_Se: - break; - case JAISoundID_Type_Stream: - setStreamPrepareFlag(param_1); - break; - default: - JUT_ASSERT_MSG(416, 0, "JAISound::setPrepareFlag サウンドカテゴリービットが異常です。\n"); + switch (mSoundID & JAISoundID_TypeMask) { + case JAISoundID_Type_Sequence: + setSeqPrepareFlag(param_1); + break; + case JAISoundID_Type_Se: + break; + case JAISoundID_Type_Stream: + setStreamPrepareFlag(param_1); + break; + default: + JUT_ASSERT_MSG(416, 0, "JAISound::setPrepareFlag サウンドカテゴリービットが異常です。\n"); } } @@ -288,7 +288,7 @@ void JAISound::setSeqInterPan(u8 line_, f32 param_2, u32 param_3) { if (!getSeqParameter()) { return; } - JUT_ASSERT_MSG(660, line_seqPan[line_].set(param_2, param_3); if (r31 == 1) { getSeqParameter()->field_0x1270 |= 1 << line_; @@ -306,7 +306,7 @@ void JAISound::setSeqInterPitch(u8 line_, f32 param_2, u32 param_3) { if (!getSeqParameter()) { return; } - JUT_ASSERT_MSG(678, line_seqPitch[line_].set(param_2, param_3); if (r31 == 1) { getSeqParameter()->field_0x1274 |= 1 << line_; @@ -324,7 +324,7 @@ void JAISound::setSeqInterFxmix(u8 line_, f32 param_2, u32 param_3) { if (!getSeqParameter()) { return; } - JUT_ASSERT_MSG(696, line_seqFxmix[line_].set(param_2, param_3); if (r31 == 1) { getSeqParameter()->field_0x1278 |= 1 << line_; @@ -342,7 +342,7 @@ void JAISound::setSeqInterDolby(u8 line_, f32 param_2, u32 param_3) { if (!getSeqParameter()) { return; } - JUT_ASSERT_MSG(714, line_field_0xd != 2) { if (getSeqParameter()->seqDolby[line_].mCurrentValue != 0.0f) { param_2 = 0.0f; @@ -505,7 +505,8 @@ void JAISound::setSeDistanceFxmix(u8) { } /* 8029A6B0-8029A6B4 .text setSeDistanceFir__8JAISoundFUc */ -void JAISound::setSeDistanceFir(u8) {} +void JAISound::setSeDistanceFir(u8) { +} /* 8029A6B4-8029A788 .text setSeDistanceDolby__8JAISoundFUc */ void JAISound::setSeDistanceDolby(u8) { @@ -536,65 +537,65 @@ void JAISound::setStreamPrepareFlag(u8) { void JAISound::setPauseMode(u8 param_1, u8 param_2) { /* Nonmatching */ switch (mSoundID & JAISoundID_TypeMask) { - case JAISoundID_Type_Sequence: - if (!getSeqParameter()) { - return; - } - if (param_1 == 3) { - param_1 = 4; - } - if (param_1 != 0) { - switch (param_1) { - case 1: - setSeqInterVolume(SOUNDPARAM_Pause, param_2 / 127.0f, 1); - break; - case 2: - JASystem::TTrack* track = getSeqParameter()->getRootTrackPointer(); - track->pauseTrackAll(); - break; + case JAISoundID_Type_Sequence: + if (!getSeqParameter()) { + return; } - } else { - getSeqParameter(); - switch (getSeqParameter()->field_0x1261) { - case 1: - setSeqInterVolume(SOUNDPARAM_Pause, 1.0f, 1); - break; - case 2: - JASystem::TTrack* track = getSeqParameter()->getRootTrackPointer(); - track->unPauseTrackAll(); - break; + if (param_1 == 3) { + param_1 = 4; } - } - getSeqParameter()->field_0x1261 = param_1; - break; - case JAISoundID_Type_Stream: - if (!getStreamParameter()) { - return; - } - if (param_1 != 0) { - switch (param_1) { - case 1: - setStreamInterVolume(SOUNDPARAM_Pause, param_2 / 127.0f, 1); - break; - case 2: - JAInter::StreamLib::setPauseFlag(2); - break; + if (param_1 != 0) { + switch (param_1) { + case 1: + setSeqInterVolume(SOUNDPARAM_Pause, param_2 / 127.0f, 1); + break; + case 2: + JASystem::TTrack* track = getSeqParameter()->getRootTrackPointer(); + track->pauseTrackAll(); + break; + } + } else { + getSeqParameter(); + switch (getSeqParameter()->field_0x1261) { + case 1: + setSeqInterVolume(SOUNDPARAM_Pause, 1.0f, 1); + break; + case 2: + JASystem::TTrack* track = getSeqParameter()->getRootTrackPointer(); + track->unPauseTrackAll(); + break; + } } - } else { - switch (getStreamParameter()->mPauseMode) { - case 1: - setStreamInterVolume(SOUNDPARAM_Pause, 1.0f, 1); - break; - case 2: - JAInter::StreamLib::clearPauseFlag(2); - break; + getSeqParameter()->field_0x1261 = param_1; + break; + case JAISoundID_Type_Stream: + if (!getStreamParameter()) { + return; } - } - getStreamParameter()->mPauseMode = param_1; - break; - default: - JUT_ASSERT_MSG(1443, 0, "JAISound::setPauseMode サウンドカテゴリービットが異常です。\n"); - break; + if (param_1 != 0) { + switch (param_1) { + case 1: + setStreamInterVolume(SOUNDPARAM_Pause, param_2 / 127.0f, 1); + break; + case 2: + JAInter::StreamLib::setPauseFlag(2); + break; + } + } else { + switch (getStreamParameter()->mPauseMode) { + case 1: + setStreamInterVolume(SOUNDPARAM_Pause, 1.0f, 1); + break; + case 2: + JAInter::StreamLib::clearPauseFlag(2); + break; + } + } + getStreamParameter()->mPauseMode = param_1; + break; + default: + JUT_ASSERT_MSG(1443, 0, "JAISound::setPauseMode サウンドカテゴリービットが異常です。\n"); + break; } } @@ -634,8 +635,21 @@ int JAISound::getTrackPortRoute(u8, u8) { } /* 8029AE88-8029AEF8 .text checkSoundHandle__8JAISoundFUlPv */ -u32 JAISound::checkSoundHandle(u32, void*) { +u32 JAISound::checkSoundHandle(u32 param_1, void* param_2) { /* Nonmatching */ + u32 uVar1; + + uVar1 = 0; + if ((this->mSoundID & 0xc0000000U) != (param_1 & 0xc0000000)) { + this->stop( 0); + } else { + if (((u8*)field_0x40)[4] <= *(u8*)((int)param_2 + 4) ) { + this->stop( 0); + } else { + uVar1 = 1; + } + } + return uVar1; } /* 8029AEF8-8029AFCC .text initParameter__8JAISoundFPP8JAISoundPQ27JAInter5ActorUlUlUcPv */ @@ -644,8 +658,30 @@ void JAISound::initParameter(JAISound**, JAInter::Actor*, u32, u32, u8, void*) { } /* 8029AFCC-8029B07C .text set__Q27JAInter11MoveParaSetFfUl */ -int JAInter::MoveParaSet::set(f32, u32) { +int JAInter::MoveParaSet::set(f32 param_1, u32 param_2) { /* Nonmatching */ + u32 ret; + + if ((this->mMoveCounter == 0) && (this->mCurrentValue == param_1)) { + ret = 2; + } else if ((this->mMoveCounter != 0) && (this->mTargetValue == param_1)) { + ret = 2; + } else { + this->mTargetValue = param_1; + if (param_2 == 0) { + this->mCurrentValue = param_1; + ret = 0; + } else { + if (param_2 == 1) { + this->mMoveAmount = this->mCurrentValue - this->mTargetValue; + } else { + this->mMoveAmount = (this->mCurrentValue - this->mTargetValue) / (float)param_2; + } + this->mMoveCounter = param_2; + ret = 1; + } + } + return ret; } /* 8029B07C-8029B0C4 .text move__Q27JAInter11MoveParaSetFv */ diff --git a/src/d/actor/d_a_npc_mt.cpp b/src/d/actor/d_a_npc_mt.cpp index 3d3aef5161..bd608380c4 100644 --- a/src/d/actor/d_a_npc_mt.cpp +++ b/src/d/actor/d_a_npc_mt.cpp @@ -1,14 +1,306 @@ -// -// Generated by dtk -// Translation Unit: d_a_npc_mt.cpp -// +/** + * d_a_npc_mt.cpp + * NPC - Carlov + */ #include "d/dolzel_rel.h" // IWYU pragma: keep #include "d/actor/d_a_npc_mt.h" +#include "d/d_com_lib_game.h" #include "d/d_com_inf_game.h" +#include "d/d_snap.h" +#include "d/d_picture_box.h" +#include "res/Object/Niten.h" #define TOTAL_FIGURE_COUNT 0x86 +const char daNpcMt_c::m_arcname[] = "Niten"; + +static char* l_npc_staff_id[] = { + "Mt" +}; + +static const char* l_arcname_tbl[] = { + "Niten" +}; + +static const int l_bmd_ix_tbl[] = { + dRes_ID_NITEN_BDL_MT_e, +}; + +static const int l_bck_ix_tbl[] = { + dRes_ID_NITEN_BCK_MT_WAIT01_e, + dRes_ID_NITEN_BCK_MT_TALK01_e, + dRes_ID_NITEN_BCK_MT_TALK02_e, + dRes_ID_NITEN_BCK_MT_TALK03_e, + dRes_ID_NITEN_BCK_MT_TALK04_e, + dRes_ID_NITEN_BCK_MT_TUKURU_e, +}; + +static const int l_btp_ix_tbl[] = { + dRes_ID_NITEN_BTP_MT_MABA_e, +}; + +static sMtAnmDat l_npc_anm_wait[] = { + { + 0x00, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_talk[] = { + { + 0x01, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_talk2[] = { + { + 0x02, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_talk3[] = { + { + 0x03, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_talk4[] = { + { + 0x04, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_talk5[] = { + { + 0x04, + 0x08, + 0x02, + }, + + { + 0x01, + 0x08, + 0xFF, + }, +}; + +static sMtAnmDat l_npc_anm_tukuru[] = { + { + 0x05, + 0x08, + 0x01, + }, + + { + 0x00, + 0x08, + 0xFF, + }, +}; + +static NpcDatStruct l_npc_dat[] = { + { + 0x0FA0, + 0x1B58, + 0, + 0, + 0xF448, + 0xE4A8, + 0, + 0, + 0x01F4, + 0, + 0, + 190.0f, + 150.0f, + 250.0f, + 400.0f, + 0x4000, + 0x0800, + 0x0190, + 0, + 60.0f, + 0.5f, + 3.0f, + 0x0006, + 0x0400, + 0x003C, + 0x005A, + 0x00C8, + 0x012C, + 0x001E, + false, + true, + }, +}; + +static u32 l_msg_mt_1st_talk[] = { + 0x365E, + 0x365F, + 0x3660, + 0x3661, + 0x3662, + 0x3663, + 0x3664, + 0x0000, +}; + +static u32 l_msg_mt_2nd_talk[] = { + 0x3665, + 0x3666, + 0x3667, + 0x0000, +}; + +static u32 l_msg_mt_3rd_talk[] = { + 0x3668, + 0x0000, +}; + +static u32 l_msg_mt_4th_talk[] = { + 0x3669, + 0x0000, +}; + +static u32 l_msg_mt_making[] = { + 0x3654, + 0x0000, +}; + +static u32 l_msg_mt_1st_kansei[] = { + 0x364D, + 0x364E, + 0x3650, + 0x0001, + 0x0000, +}; + +static u32 l_msg_mt_2nd_kansei[] = { + 0x364D, + 0x364F, + 0x3650, + 0x0001, + 0x0000, +}; + +static u32 l_msg_mt_room[] = { + 0x366B, + 0x366B, + 0x366C, + 0x366D, + 0x366E, + 0x366F, + 0x3670, + 0x3671, +}; + +static u32 l_msg_mt_gallery[] = { + 0x3651, + 0x0000, +}; + +static u32 l_msg_mt_room_in[] = { + 0x3652, + 0x0000, +}; + +static u32 l_msg_mt_kansei_end[] = { + 0x3653, + 0x0000, +}; + +static u32 l_msg_mt_no_color[] = { + 0x3655, + 0x0000, +}; + +static u32 l_msg_mt_no_figure[] = { + 0x3656, + 0x0000, +}; + +static u32 l_msg_mt_maked[] = { + 0x3658, + 0x0000, +}; + +static u32 l_msg_mt_face_ng[] = { + 0x3659, + 0x0000, +}; + +static u32 l_msg_mt_body_ng[] = { + 0x365A, + 0x0000, +}; + +static u32 l_msg_mt_make_1st[] = { + 0x365B, + 0x3674, + 0x365C, + 0x0002, +}; + +static u32 l_msg_mt_make_2nd[] = { + 0x365B, + 0x3674, + 0x365D, + 0x0002, +}; + +static u32 l_msg_mt_make_1st_mt[] = { + 0x3672, + 0x3674, + 0x365C, + 0x0002, +}; + +static u32 l_msg_mt_make_2nd_mt[] = { + 0x3672, + 0x3674, + 0x365D, + 0x0002, +}; + +static u32 l_msg_mt_make_1st_mn[] = { + 0x3673, + 0x3674, + 0x365C, + 0x0002, +}; + +static u32 l_msg_mt_make_2nd_mn[] = { + 0x3673, + 0x3674, + 0x365D, + 0x0002, +}; + +static u32* l_msg_mt_make[] = { + l_msg_mt_make_1st, + l_msg_mt_make_2nd, +}; + +static u32* l_msg_mt_make_mt[] = { + l_msg_mt_make_1st_mt, + l_msg_mt_make_2nd_mt, +}; + +static u32* l_msg_mt_make_mn[] = { + l_msg_mt_make_1st_mn, + l_msg_mt_make_2nd_mn, +}; + static u16 l_figure_comp[] = { dSv_event_flag_c::UNK_95FF, dSv_event_flag_c::UNK_94FF, @@ -29,231 +321,1053 @@ static u16 l_figure_comp[] = { dSv_event_flag_c::UNK_80FF, }; +static char* l_figure_room_name[] = { + "Pfigure", + "figureA", + "figureB", + "figureC", + "figureD", + "figureE", + "figureF", + "figureG", +}; + /* 00000078-00000228 .text __ct__9daNpcMt_cFv */ daNpcMt_c::daNpcMt_c() { - /* Nonmatching */ + mNpcNo = getPrmNpcNo(); + m747 = 0; + m746 = 0; + m718 = 0.0f; + m72C = 0; + m71C = -1.0f; + m74F = 0; + m728 = 1; + m732 = home.angle.y; + m74A = 0; + m736 = 0; } /* 000005D8-000006F4 .text daNpc_Mt_nodeCallBack__FP7J3DNodei */ -static BOOL daNpc_Mt_nodeCallBack(J3DNode*, int) { - /* Nonmatching */ +static BOOL daNpc_Mt_nodeCallBack(J3DNode* node, int calcTiming) { + if (calcTiming == 0) { + J3DModel* model = j3dSys.getModel(); + daNpcMt_c* i_this = (daNpcMt_c*)model->getUserArea(); + J3DJoint* joint = (J3DJoint*)node; + s32 jntNo = joint->getJntNo(); + + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); + + if(jntNo == i_this->m_jnt.getHeadJntNum()) { + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getHead_x()); + } + + else if(jntNo == i_this->m_jnt.getBackboneJntNum()) { + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getBackbone_x()); + } + + model->setAnmMtx(jntNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + return TRUE; } /* 000006F4-00000714 .text CheckCreateHeap__FP10fopAc_ac_c */ -static BOOL CheckCreateHeap(fopAc_ac_c*) { - /* Nonmatching */ +static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { + return static_cast(i_this)->createHeap(); } /* 00000714-00000858 .text phase_1__FP9daNpcMt_c */ -void phase_1(daNpcMt_c*) { - /* Nonmatching */ +static cPhs_State phase_1(daNpcMt_c* i_this) { + BOOL bVar1 = FALSE; + cPhs_State phase_state = cPhs_NEXT_e; + + fopAcM_ct(i_this, daNpcMt_c); + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_3D08)) { + bVar1 = TRUE; + } + else if (!dComIfGp_getStartStagePoint()) { + if (i_this->isComp()) { + bVar1 = TRUE; + dComIfGs_onEventBit(dSv_event_flag_c::UNK_3D08); + } + else { + dComIfGs_offTmpBit(dSv_event_tmp_flag_c::UNK_0202); + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4080)) { + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_2F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4040); + } + } + } + + if (bVar1) { + i_this->setFigure(0x40); + phase_state = cPhs_STOP_e; + } + else { + i_this->setResFlag(1); + phase_state = cPhs_NEXT_e; + } + return phase_state; } /* 00000858-000008D8 .text phase_2__FP9daNpcMt_c */ -void phase_2(daNpcMt_c*) { - /* Nonmatching */ +static cPhs_State phase_2(daNpcMt_c* i_this) { + cPhs_State phase_state = dComIfG_resLoad(i_this->getPhaseP(), l_arcname_tbl[i_this->getNpcNo()]); + if (phase_state == cPhs_COMPLEATE_e) { + if (fopAcM_entrySolidHeap(i_this, CheckCreateHeap, 0x2900)) { + return i_this->createInit(); + } else { +#if VERSION > VERSION_DEMO + i_this->mpMorf = NULL; +#endif + return cPhs_ERROR_e; + } + } + return phase_state; } /* 000008D8-00000908 .text _create__9daNpcMt_cFv */ cPhs_State daNpcMt_c::_create() { - /* Nonmatching */ + static cPhs__Handler l_method[] = { + (cPhs__Handler)phase_1, + (cPhs__Handler)phase_2, + NULL, + }; + return dComLbG_PhaseHandler(&mPhs, l_method, this); } /* 00000908-00000B98 .text createHeap__9daNpcMt_cFv */ -void daNpcMt_c::createHeap() { - /* Nonmatching */ +BOOL daNpcMt_c::createHeap() { + J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_bmd_ix_tbl[mNpcNo]); + mpMorf = new mDoExt_McaMorf( + modelData, + NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_bck_ix_tbl[m74A]), + J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, NULL, + 0x80000, 0x11020022 + ); + + m_jnt.setHeadJntNum(modelData->getJointName()->getIndex("head")); + JUT_ASSERT(DEMO_SELECT(904, 905), m_jnt.getHeadJntNum() >= 0); + m_jnt.setBackboneJntNum(modelData->getJointName()->getIndex("backbone")); + JUT_ASSERT(DEMO_SELECT(908, 909), m_jnt.getBackboneJntNum() >= 0); + + if (!initTexPatternAnm(false)) { + return FALSE; + } + + for(u16 i = 0; i < modelData->getJointNum(); i++) { + if(i == m_jnt.getHeadJntNum() || i == m_jnt.getBackboneJntNum()) { + modelData->getJointNodePointer(i)->setCallBack(daNpc_Mt_nodeCallBack); + } + } + + mpMorf->getModel()->setUserArea((u32)this); + mAcchCir.SetWall(30.0f, 30.0f); + mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); + return TRUE; } /* 00000B98-00000BB8 .text daNpcMt_XyCheckCB__FPvi */ -static s16 daNpcMt_XyCheckCB(void*, int) { - /* Nonmatching */ +static s16 daNpcMt_XyCheckCB(void* i_this, int i_itemBtn) { + return ((daNpcMt_c*)i_this)->XyCheckCB(i_itemBtn); } /* 00000BB8-00000DEC .text createInit__9daNpcMt_cFv */ -void daNpcMt_c::createInit() { - /* Nonmatching */ +cPhs_State daNpcMt_c::createInit() { +#if VERSION == VERSION_DEMO + mStts.Init(0xFF, 0xFF, this); + mCyl.Set(dNpc_cyl_src); + mCyl.SetStts(&mStts); + setCollision(&mCyl, current.pos, l_npc_dat[mNpcNo].field_0x30, 150.0f); +#endif + gravity = -9.0f; + setAnmTbl(l_npc_anm_wait); + mMtGetItemEventIdx = dComIfGp_evmng_getEventIdx("MT_GET_ITEM", 0xff); + eventInfo.mpCheckCB = daNpcMt_XyCheckCB; + mEventCut.setActorInfo2(l_npc_staff_id[mNpcNo], this); +#if VERSION == VERSION_DEMO + setMtx(); +#endif + m73E = 0; + m742 = 0; + m743 = 0; + m752 = 0; + attnOff(); + fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); + fopAcM_setCullSizeBox(this, -70.0f, 0.0f, -70.0f, 70.0f, 200.0f, 70.0f); + attention_info.distances[fopAc_Attn_TYPE_TALK_e] = 0x6E; + attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = 0x6E; + attention_info.flags = fopAc_Attn_LOCKON_TALK_e | fopAc_Attn_ACTION_SPEAK_e | fopAc_Attn_UNK1000000_e; + m_jnt.setParam( + l_npc_dat[mNpcNo].mMax_backbone_x, + l_npc_dat[mNpcNo].mMax_backbone_y, + l_npc_dat[mNpcNo].mMin_backbone_x, + l_npc_dat[mNpcNo].mMin_backbone_y, + l_npc_dat[mNpcNo].mMax_head_x, + l_npc_dat[mNpcNo].mMax_head_y, + l_npc_dat[mNpcNo].mMin_head_x, + l_npc_dat[mNpcNo].mMin_head_y, + l_npc_dat[mNpcNo].mMax_turn_step + ); + m750 = l_npc_dat[mNpcNo].field_0x4A; + m751 = l_npc_dat[mNpcNo].field_0x4B; + m720 = l_npc_dat[mNpcNo].field_0x20; + m730 = l_npc_dat[mNpcNo].field_0x28; + mObjAcch.CrrPos(*dComIfG_Bgsp()); +#if VERSION > VERSION_DEMO + setMtx(); + mpMorf->getModel()->calc(); + mStts.Init(0xFF, 0xFF, this); + mCyl.Set(dNpc_cyl_src); + mCyl.SetStts(&mStts); + setCollision(&mCyl, current.pos, l_npc_dat[mNpcNo].field_0x30, 150.0f); +#endif + return cPhs_COMPLEATE_e; } /* 00000DEC-00000F6C .text _delete__9daNpcMt_cFv */ bool daNpcMt_c::_delete() { - /* Nonmatching */ +#if VERSION == VERSION_DEMO + if (m747 != 0) { + dComIfG_resDeleteDemo(&mPhsArcname, l_arcname_tbl[mNpcNo]); + } + if(mpMorf != NULL){ + mpMorf->stopZelAnime(); + } +#else + dComIfG_resDeleteDemo(&mPhsArcname, l_arcname_tbl[mNpcNo]); + if(heap != NULL && mpMorf != NULL){ + mpMorf->stopZelAnime(); + } +#endif + + if(dComIfGp_isEnableNextStage()){ + int roomId; + for(roomId = 1; roomId <= 7; roomId++) { + if(!strcmp(dComIfGp_getNextStageName(), l_figure_room_name[roomId])) { + break; + } + } + if (roomId <= 7) { + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4080)) { + int temp = dSnap_GetFigRoomId(dComIfGs_getEventReg(dSv_event_flag_c::UNK_A9FF)); + if(temp == roomId) { + dComIfGs_onEventBit(dSv_event_flag_c::UNK_3F01); + } + } + } else { + dComIfGs_offTmpBit(dSv_event_tmp_flag_c::UNK_0202); + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4080)) { + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_2F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4040); + } + } + } + + + return true; } /* 00000F6C-0000107C .text _draw__9daNpcMt_cFv */ bool daNpcMt_c::_draw() { - /* Nonmatching */ + J3DModel* model = mpMorf->getModel(); + J3DModelData *model_data = model->getModelData(); + g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType(model, &tevStr); + mBtpAnm.entry(model_data, mFrame); + mpMorf->updateDL(); + mBtpAnm.remove(model_data); + + cXyz shadowPos( + current.pos.x, + current.pos.y + 150.0f, + current.pos.z + ); + + mShadowId = dComIfGd_setShadow( + mShadowId, 1, mpMorf->getModel(), &shadowPos, 800.0f, 20.0f, + current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr + ); + + dSnap_RegistFig(DSNAP_TYPE_NPC_MT, this, 1.0f, 1.0f, 1.0f); + return true; } +static daNpcMt_c::InitFunc_t l_execute_init[] = { + &daNpcMt_c::executeWaitInit, + &daNpcMt_c::executeTalkInit, +}; + +static daNpcMt_c::MoveFunc_t moveProc[] = { + &daNpcMt_c::executeWait, + &daNpcMt_c::executeTalk, +}; + /* 0000107C-000011D0 .text _execute__9daNpcMt_cFv */ bool daNpcMt_c::_execute() { - /* Nonmatching */ + chkAttention(); + checkOrder(); + + if (!dComIfGp_event_runCheck() || eventInfo.checkCommandTalk()) { + (this->*moveProc[m746])(); + } else { + eventMove(); + } + + eventOrder(); + playTexPatternAnm(); + playAnm(); + + setCollision(&mCyl, current.pos, l_npc_dat[mNpcNo].field_0x30, 150.0f); + + attention_info.position.set(current.pos.x, current.pos.y + l_npc_dat[mNpcNo].field_0x18, current.pos.z); + eyePos.set(current.pos.x, current.pos.y + l_npc_dat[mNpcNo].field_0x1C, current.pos.z); + + lookBack(); + setMtx(); + return false; } /* 000011D0-00001240 .text executeCommon__9daNpcMt_cFv */ -void daNpcMt_c::executeCommon() { - /* Nonmatching */ +BOOL daNpcMt_c::executeCommon() { + if (m743) { + m744 = 1; + } + else { + m744 = 0; + } + + if (m742 == 1 && m746 != 1) { + executeSetMode(1); + } + + return m742; } /* 00001240-00001294 .text executeSetMode__9daNpcMt_cFUc */ -void daNpcMt_c::executeSetMode(u8) { - /* Nonmatching */ +void daNpcMt_c::executeSetMode(u8 param_1) { + m718 = 0.0f; + m746 = (this->*l_execute_init[param_1])(); } /* 00001294-00001320 .text executeWaitInit__9daNpcMt_cFv */ -void daNpcMt_c::executeWaitInit() { - /* Nonmatching */ +s32 daNpcMt_c::executeWaitInit() { + speedF = 0.0f; + setAnmTbl(l_npc_anm_wait); + m_jnt.setParam( + l_npc_dat[mNpcNo].mMax_backbone_x, + l_npc_dat[mNpcNo].mMax_backbone_y, + l_npc_dat[mNpcNo].mMin_backbone_x, + l_npc_dat[mNpcNo].mMin_backbone_y, + l_npc_dat[mNpcNo].mMax_head_x, + l_npc_dat[mNpcNo].mMax_head_y, + l_npc_dat[mNpcNo].mMin_head_x, + l_npc_dat[mNpcNo].mMin_head_y, + l_npc_dat[mNpcNo].mMax_turn_step + ); + return FALSE; } /* 00001320-00001368 .text executeWait__9daNpcMt_cFv */ void daNpcMt_c::executeWait() { - /* Nonmatching */ + executeCommon(); + if(m74A) { + setAnmTbl(l_npc_anm_wait); + } } /* 00001368-00001370 .text executeTalkInit__9daNpcMt_cFv */ -void daNpcMt_c::executeTalkInit() { - /* Nonmatching */ +s32 daNpcMt_c::executeTalkInit() { + return TRUE; } /* 00001370-000013E8 .text executeTalk__9daNpcMt_cFv */ void daNpcMt_c::executeTalk() { - /* Nonmatching */ + executeCommon(); + if(talk2(1) == fopMsgStts_BOX_CLOSED_e) { + m742 = 0; + executeSetMode(0); + dComIfGp_event_reset(); + } + else { + setAnmFromMsgTag(); + } } /* 000013E8-00001480 .text checkOrder__9daNpcMt_cFv */ void daNpcMt_c::checkOrder() { - /* Nonmatching */ + if(eventInfo.checkCommandDemoAccrpt()) { + if(dComIfGp_evmng_startCheck(mMtGetItemEventIdx) && m744 == 3) { + m744 = 0; + } + } + else if (eventInfo.checkCommandTalk() && (m744 == 2 || m744 == 1)) { + m742 = 1; + executeSetMode(1); + } } /* 00001480-0000150C .text eventOrder__9daNpcMt_cFv */ void daNpcMt_c::eventOrder() { - /* Nonmatching */ + if(m744 == 2 || m744 == 1) { + eventInfo.onCondition(dEvtCnd_CANTALK_e); + eventInfo.onCondition(dEvtCnd_CANTALKITEM_e); + if(m744 == 2) { + fopAcM_orderSpeakEvent(this); + } + } + else if(m744 == 3) { + fopAcM_orderChangeEventId(dComIfGp_getPlayer(0), this, mMtGetItemEventIdx, 0, 0xffff); + } } /* 0000150C-00001580 .text eventMove__9daNpcMt_cFv */ void daNpcMt_c::eventMove() { - /* Nonmatching */ + if(!chkEndEvent()) { + bool oldFlag = mEventCut.getAttnFlag(); + if(mEventCut.cutProc()) { + if(!mEventCut.getAttnFlag()) { + mEventCut.setAttnFlag(oldFlag); + } + } + else { + privateCut(); + setAnmFromMsgTag(); + } + } } /* 00001580-000016B0 .text privateCut__9daNpcMt_cFv */ void daNpcMt_c::privateCut() { - /* Nonmatching */ + static char* cut_name_tbl[] = { + "MES_SET", + "GET_ITEM", + }; + + int staffIdx = dComIfGp_evmng_getMyStaffId(l_npc_staff_id[mNpcNo]); + if(staffIdx != -1) { + m74D = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0); + if(m74D == -1) { + dComIfGp_evmng_cutEnd(staffIdx); + return; + } + + if(dComIfGp_evmng_getIsAddvance(staffIdx)) { + switch(m74D) { + case 0: + eventMesSetInit(staffIdx); + break; + case 1: + eventGetItemInit(); + break; + } + } + + bool temp; + switch(m74D) { + case 0: + temp = eventMesSet(); + break; + default: + temp = true; + } + + if(temp) { + dComIfGp_evmng_cutEnd(staffIdx); + } + } } /* 000016B0-00001788 .text eventMesSetInit__9daNpcMt_cFi */ -void daNpcMt_c::eventMesSetInit(int) { - /* Nonmatching */ +void daNpcMt_c::eventMesSetInit(int staffIdx) { + int* pData = dComIfGp_evmng_getMyIntegerP(staffIdx, "MsgNo"); + if(pData) { + mpMsgTbl = NULL; + + int msg = *pData; + switch(msg){ + case 1: + break; + case 0: + setMessage(getMsg()); + break; + default: + setMessage(msg); + } + + if (mpMsgTbl != NULL) { + setMessage(*mpMsgTbl); + } + } + else { + mpMsgTbl++; + setMessage(*mpMsgTbl); + } } /* 00001788-0000181C .text eventMesSet__9daNpcMt_cFv */ -void daNpcMt_c::eventMesSet() { - /* Nonmatching */ +bool daNpcMt_c::eventMesSet() { + u16 temp = talk2(0); + if (temp == fopMsgStts_BOX_CLOSED_e) { + if(m749 & 1) { + m749 &= ~1; + mItemNo = 7; + m744 = 3; + } + else if (m749 & 2) { + m749 &= ~2; + mItemNo = 5; + m744 = 3; + } + } + return temp == fopMsgStts_BOX_CLOSED_e; } /* 0000181C-00001874 .text eventGetItemInit__9daNpcMt_cFv */ void daNpcMt_c::eventGetItemInit() { - /* Nonmatching */ + fpc_ProcID itemID = fopAcM_createItemForPresentDemo(¤t.pos, mItemNo, 0, -1, -1); + if (itemID != fpcM_ERROR_PROCESS_ID_e) { + dComIfGp_event_setItemPartnerId(itemID); + } } /* 00001874-000019BC .text talk2__9daNpcMt_cFi */ -void daNpcMt_c::talk2(int) { - /* Nonmatching */ +u16 daNpcMt_c::talk2(int i_param) { + u16 status = 0xFF; + if(mCurrMsgBsPcId == fpcM_ERROR_PROCESS_ID_e) { + + if(i_param == 1) { + mCurrMsgNo = getMsg(); + } + + mCurrMsgBsPcId = fopMsgM_messageSet(mCurrMsgNo, this); + mpCurrMsg = NULL; + m734 = -1; + } + else if(mpCurrMsg) { + status = mpCurrMsg->mStatus; + switch(status) { + case fopMsgStts_MSG_DISPLAYED_e: + mpCurrMsg->mStatus = next_msgStatus(&mCurrMsgNo); + + if(mpCurrMsg->mStatus == fopMsgStts_MSG_CONTINUES_e) { + fopMsgM_messageSet(mCurrMsgNo); + } + break; + + case fopMsgStts_MSG_TYPING_e: + if (m734 == fopMsgStts_MSG_CONTINUES_e) { + chkMsg(); + } + break; + + case fopMsgStts_BOX_CLOSED_e: + mpCurrMsg->mStatus = fopMsgStts_MSG_DESTROYED_e; + mCurrMsgBsPcId = -1; + break; + } + + m734 = status; + anmAtr(status); + } else { + mpCurrMsg = fopMsgM_SearchByID(mCurrMsgBsPcId); + } + return status; } /* 000019BC-00001A8C .text next_msgStatus__9daNpcMt_cFPUl */ -u16 daNpcMt_c::next_msgStatus(u32*) { - /* Nonmatching */ +u16 daNpcMt_c::next_msgStatus(u32* pMsgNo) { + u16 status = fopMsgStts_MSG_CONTINUES_e; + if (mpMsgTbl) { + mpMsgTbl++; + switch(*mpMsgTbl) { + case 2: + dPb_erasePicture(); + case 0: + mpMsgTbl = NULL; + status = fopMsgStts_MSG_ENDS_e; + break; + case 1: + *pMsgNo = l_msg_mt_room[dSnap_GetFigRoomId(dComIfGs_getEventReg(dSv_event_flag_c::UNK_A9FF))]; + break; + default: + *pMsgNo = *mpMsgTbl; + break; + } + } + else { + status = fopMsgStts_MSG_ENDS_e; + } + + return status; } /* 00001A8C-00001FC8 .text getMsg__9daNpcMt_cFv */ u32 daNpcMt_c::getMsg() { - /* Nonmatching */ + u8 uVar2; + + u32 msgNo = 0; + mpMsgTbl = NULL; + if (g_dComIfG_gameInfo.play.getEvent()->chkPhoto()){ + uVar2 = changePhotoNo(dComIfGp_getPictureResult()); + if ((uVar2 <= 0x48) || (uVar2 >= 0xcf)) { + uVar2 = 0xff; + } + else { + uVar2 = dSnap_PhotoIndex2TableIndex(uVar2) & 0xff; + } + if (dComIfGp_getPictureFormat() == 0 || dComIfGp_getPictureFormat() == 1) { + mpMsgTbl = l_msg_mt_no_color; + } + else if (uVar2 == 0xff) { + mpMsgTbl = l_msg_mt_no_figure; + } + else if (isFigureGet(uVar2)) { + mpMsgTbl = l_msg_mt_maked; + } + else if (dComIfGp_getPictureResultDetail() == 1) { + mpMsgTbl = l_msg_mt_face_ng; + } + else if (dComIfGp_getPictureResultDetail() == 2) { + mpMsgTbl = l_msg_mt_body_ng; + } + else { + dComIfGs_onEventBit(dSv_event_flag_c::UNK_2F01); + dComIfGs_onEventBit(dSv_event_flag_c::UNK_3401); + dComIfGs_setEventReg(dSv_event_flag_c::UNK_A9FF, uVar2); + s32 bVar1 = 0; + if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_3A01)) { + bVar1 = 1; + } + switch(uVar2) { + case 0x5e: + mpMsgTbl = l_msg_mt_make_mt[bVar1]; + break; + case 0x5f: + mpMsgTbl = l_msg_mt_make_mn[bVar1]; + break; + default: + mpMsgTbl = l_msg_mt_make[bVar1]; + } + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4080)) { + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4040); + } + } + } + else if (dComIfGp_event_chkTalkXY()) { + + } else if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_3080)) { + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4080) == 0) { + if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_3A01)) { + mpMsgTbl = l_msg_mt_1st_kansei; + } + else { + mpMsgTbl = l_msg_mt_2nd_kansei; + } + + u8 evReg = dComIfGs_getEventReg(dSv_event_flag_c::UNK_A9FF); + setFigure(evReg); + + if (evReg == (u8)dSnap_PhotoIndex2TableIndex(0x4a)) { + setFigure(dSnap_PhotoIndex2TableIndex(0x49)); + } + else if (evReg == (u8)dSnap_PhotoIndex2TableIndex(0x72)) { + setFigure(dSnap_PhotoIndex2TableIndex(0x73)); + setFigure(dSnap_PhotoIndex2TableIndex(0x74)); + setFigure(dSnap_PhotoIndex2TableIndex(0x75)); + setFigure(dSnap_PhotoIndex2TableIndex(0x76)); + setFigure(dSnap_PhotoIndex2TableIndex(0x77)); + setFigure(dSnap_PhotoIndex2TableIndex(0x78)); + } +#if VERSION > VERSION_DEMO + else if (evReg == (u8)dSnap_PhotoIndex2TableIndex(0x8c)) { + setFigure(dSnap_PhotoIndex2TableIndex(0x8d)); + } + else if (evReg == (u8)dSnap_PhotoIndex2TableIndex(0x88)) { + setFigure(dSnap_PhotoIndex2TableIndex(0x87)); + } +#endif + dComIfGs_onEventBit(dSv_event_flag_c::UNK_4080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_2F01); + } + else if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_3F01)) { + mpMsgTbl = l_msg_mt_gallery; + } + else if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_4040) == 0) { + dComIfGs_onEventBit(dSv_event_flag_c::UNK_4040); + mpMsgTbl = l_msg_mt_room_in; + } + else { + mpMsgTbl = l_msg_mt_kansei_end; + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4080); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_3F01); + dComIfGs_offEventBit(dSv_event_flag_c::UNK_4040); + dComIfGs_onTmpBit(dSv_event_tmp_flag_c::UNK_0202); + } + } + else if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_2F01)) { + mpMsgTbl = l_msg_mt_making; + } + else if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_2F02)) { + dComIfGs_onEventBit(dSv_event_flag_c::UNK_2F02); + mpMsgTbl = l_msg_mt_1st_talk; + } + else if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_3A01)) { + mpMsgTbl = l_msg_mt_2nd_talk; + } + else if(!dComIfGs_isTmpBit(dSv_event_tmp_flag_c::UNK_0202)) { + dComIfGs_onTmpBit(dSv_event_tmp_flag_c::UNK_0202); + mpMsgTbl = l_msg_mt_3rd_talk; + } + else { + mpMsgTbl = l_msg_mt_4th_talk; + } + + if (mpMsgTbl != NULL) { + msgNo = *mpMsgTbl; + } + + return msgNo; } /* 00001FC8-00001FCC .text chkMsg__9daNpcMt_cFv */ void daNpcMt_c::chkMsg() { - /* Nonmatching */ + return; } /* 00001FCC-00001FD4 .text setMessage__9daNpcMt_cFUl */ -void daNpcMt_c::setMessage(u32) { - /* Nonmatching */ +void daNpcMt_c::setMessage(u32 msgNo) { + mCurrMsgNo = msgNo; } /* 00001FD4-00002084 .text setAnmFromMsgTag__9daNpcMt_cFv */ void daNpcMt_c::setAnmFromMsgTag() { - /* Nonmatching */ + switch(dComIfGp_getMesgAnimeAttrInfo()) { + case 0: + setAnmTbl(l_npc_anm_wait); + break; + case 1: + setAnmTbl(l_npc_anm_talk); + break; + case 2: + setAnmTbl(l_npc_anm_talk2); + break; + case 3: + setAnmTbl(l_npc_anm_talk3); + break; + case 4: + setAnmTbl(l_npc_anm_talk4); + break; + case 5: + setAnmTbl(l_npc_anm_talk5); + break; + case 6: + setAnmTbl(l_npc_anm_tukuru); + } + dComIfGp_setMesgAnimeAttrInfo(0xff); } /* 00002084-000020A4 .text getPrmNpcNo__9daNpcMt_cFv */ -void daNpcMt_c::getPrmNpcNo() { - /* Nonmatching */ +u8 daNpcMt_c::getPrmNpcNo() { + if(0 <= argument && argument < 1) { + return argument; + } + return 0; } /* 000020A4-0000212C .text setMtx__9daNpcMt_cFv */ void daNpcMt_c::setMtx() { - /* Nonmatching */ + mpMorf->getModel()->setBaseScale(scale); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(current.angle.y); + mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); } /* 0000212C-00002474 .text chkAttention__9daNpcMt_cFv */ void daNpcMt_c::chkAttention() { - /* Nonmatching */ + m752 = 0; + + if(mEventCut.getAttnFlag()) { + mLookAtPos = mEventCut.getAttnPos(); + m74F = 1; + if(m750 != 0) { + m728 = false; + m_jnt.setTrn(); + } + else { + m728 = true; + } + + if(m743 == 0) { + m743 = 1; + } + } + else { + fopAc_ac_c* player = dComIfGp_getLinkPlayer(); + + f32 temp = m720; + int temp2 = m730; + f32 temp4; + s16 temp5; + + dNpc_calc_DisXZ_AngY(current.pos, player->current.pos, &temp4, &temp5); + + if(m743 != 0) { + temp += 40.0f; + temp2 += 0x71C; + } + + temp5 -= shape_angle.y; + if(temp > temp4 && temp2 > abs(temp5)) { + mLookAtPos = dNpc_playerEyePos(l_npc_dat[mNpcNo].field_0x14); + m74F = 1; + if(m750 != 0) { + m728 = false; + } + else { + m728 = true; + } + + if(m751 == 0) { + m740 = m732; + m728 = false; + m74F = 2; + m_jnt.setTrn(); + } + + if (m743 == 0) { + m743 = 1; + } + } + else { + if(m743 == 1) { + m743 = 0; + m72E = l_npc_dat[mNpcNo].field_0x48; + } + if(l_npc_dat[mNpcNo].field_0x24 > temp4 || m753 != 0){ + mLookAtPos = dNpc_playerEyePos(l_npc_dat[mNpcNo].field_0x14); + m74F = 1; + if (m750 != 0) { + m728 = 0; + } else { + m728 = 1; + } + if (m751 == 0) { + m740 = m732; + m728 = 0; + m74F = 2; + m_jnt.setTrn(); + } + m752 = 1; + } else { + m74F = 0; + if(m6F0 == 0) { + if(m72E) { + m72E--; + } + else { + m740 = m732; + m728 = false; + m74F = 2; + m_jnt.setTrn(); + } + } + } + } + } + + m73C = l_npc_dat[mNpcNo].field_0x2A; } /* 00002474-000025C0 .text lookBack__9daNpcMt_cFv */ void daNpcMt_c::lookBack() { - /* Nonmatching */ + short target = m73C; + short desiredYRot = current.angle.y; + cXyz* dstTemp = NULL; + cXyz temp2; + cXyz dstPos = eyePos; + bool headOnlyFollow = m728; + + switch(m74F) { + case 1: + temp2 = mLookAtPos; + dstTemp = &temp2; + break; + case 2: + desiredYRot = m740; + break; + case 0: + default: + break; + } + + if (m742 && m750) { + headOnlyFollow = false; + m_jnt.setTrn(); + } + + if (m_jnt.trnChk()) { + if(mEventCut.getTurnSpeed() != 0) { + target = mEventCut.getTurnSpeed(); + } + cLib_addCalcAngleS2(&m73E, target, 4, 0x800); + } else { + m73E = 0; + } + + m_jnt.lookAtTarget(¤t.angle.y, dstTemp, dstPos, desiredYRot, m73E, headOnlyFollow); + shape_angle = current.angle; } /* 000025C0-000026D8 .text initTexPatternAnm__9daNpcMt_cFb */ -void daNpcMt_c::initTexPatternAnm(bool) { - /* Nonmatching */ +BOOL daNpcMt_c::initTexPatternAnm(bool i_modify) { + J3DModelData *modelData = mpMorf->getModel()->getModelData(); + m_head_tex_pattern = (J3DAnmTexPattern*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_btp_ix_tbl[mNpcNo]); + JUT_ASSERT(DEMO_SELECT(2032, 2049), m_head_tex_pattern != NULL); + + if(!mBtpAnm.init(modelData, m_head_tex_pattern, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, i_modify, FALSE)) { + return FALSE; + } + + mFrame = 0; + mTimer = 0; + return TRUE; } /* 000026D8-00002744 .text playTexPatternAnm__9daNpcMt_cFv */ void daNpcMt_c::playTexPatternAnm() { - /* Nonmatching */ + if(cLib_calcTimer(&mTimer) == 0) { + if(mFrame >= m_head_tex_pattern->getFrameMax()) { + mFrame -= m_head_tex_pattern->getFrameMax(); + mTimer = 0x78; + } + else { + mFrame++; + } + } } /* 00002744-0000280C .text playAnm__9daNpcMt_cFv */ void daNpcMt_c::playAnm() { - /* Nonmatching */ + mAnmFlag &= ~1; + if(mpMorf->play(0, 0, 0)) { + if(mpAnmDat) { + if(m74C > 0) { + m74C--; + if(m74C == 0) { + mpAnmDat++; + if(setAnmTbl(mpAnmDat)) { + mAnmFlag |= 1; + } + } + else { + setAnm(mpAnmDat->field_0x00, 0, 0.0f); + } + } + } + } } /* 0000280C-000028E4 .text setAnm__9daNpcMt_cFUcif */ -void daNpcMt_c::setAnm(u8, int, f32) { - /* Nonmatching */ +void daNpcMt_c::setAnm(u8 param_1, int param_2, f32 morf) { + if (m71C >= 0.0f) { + morf = m71C; + m71C = -1.0f; + } + + mpMorf->setAnm( + (J3DAnmTransformKey*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_bck_ix_tbl[param_1]), + param_2, morf, 1.0f, 0.0f, -1.0f, NULL + ); + m74A = param_1; } /* 000028E4-00002984 .text setAnmTbl__9daNpcMt_cFP9sMtAnmDat */ -void daNpcMt_c::setAnmTbl(sMtAnmDat*) { - /* Nonmatching */ +bool daNpcMt_c::setAnmTbl(sMtAnmDat* anmDat) { + if (anmDat->field_0x00 == 0xFF) { + mpAnmDat = NULL; + return true; + } + else { + mpAnmDat = anmDat; + m74C = mpAnmDat->field_0x02; + + int temp = 2; + if (m74C > 0) { + temp = 0; + } + + if (m74A != mpAnmDat->field_0x00 || temp == 0) { + setAnm(mpAnmDat->field_0x00, temp, mpAnmDat->field_0x01); + } + return false; + } } /* 00002984-00002A28 .text XyCheckCB__9daNpcMt_cFi */ -void daNpcMt_c::XyCheckCB(int) { - /* Nonmatching */ +s16 daNpcMt_c::XyCheckCB(int i_itemBtn) { + if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_2F02) && !dComIfGs_isEventBit(dSv_event_flag_c::UNK_2F01)) { + u8 itemNo = dComIfGp_getSelectItem(i_itemBtn); + if(itemNo == dItemNo_PICTO_BOX_e || itemNo == dItemNo_DELUXE_PICTO_BOX_e){ + if(dComIfGs_getPictureNum()){ + return true; + } + } + } + return false; } /* 00002A28-00002AA0 .text setCollision__9daNpcMt_cFP8dCcD_Cyl4cXyzff */ -void daNpcMt_c::setCollision(dCcD_Cyl*, cXyz, f32, f32) { - /* Nonmatching */ +void daNpcMt_c::setCollision(dCcD_Cyl* cyl, cXyz center, f32 radius, f32 height) { + cyl->SetC(center); + cyl->SetR(radius); + cyl->SetH(height); + dComIfG_Ccsp()->Set(cyl); } /* 00002AA0-00002AFC .text chkEndEvent__9daNpcMt_cFv */ -void daNpcMt_c::chkEndEvent() { - /* Nonmatching */ +BOOL daNpcMt_c::chkEndEvent() { + if (dComIfGp_evmng_endCheck(mMtGetItemEventIdx)) { + g_dComIfG_gameInfo.play.getEvent()->onEventFlag(8); + return TRUE; + } + return FALSE; } /* 00002AFC-00002B98 .text isFigureGet__9daNpcMt_cFUc */ -bool daNpcMt_c::isFigureGet(u8) { - /* Nonmatching */ +u8 daNpcMt_c::isFigureGet(u8 figureNo) { + if(figureNo >= TOTAL_FIGURE_COUNT){ + return false; + } + + if(figureNo / 8 < 0x11) { + int r31 = (figureNo % 8); + u8 reg = dComIfGs_getEventReg(l_figure_comp[figureNo / 8]); + u32 ret = reg & (1 << r31); + return ret; + } + return false; } /* 00002B98-00002C38 .text setFigure__9daNpcMt_cFUc */ void daNpcMt_c::setFigure(u8 figure) { if(figure < TOTAL_FIGURE_COUNT) { + u32 r28 = figure % 8; u8 reg = dComIfGs_getEventReg(l_figure_comp[figure / 8]); - reg |= 1 << (figure % 8); + reg |= 1 << r28; dComIfGs_setEventReg(l_figure_comp[figure / 8], reg); dComIfGs_onEventBit(dSv_event_flag_c::UNK_3A01); } @@ -273,7 +1387,7 @@ int daNpcMt_c::getFigureMakeNum() { } /* 00002CA0-00002D08 .text isComp__9daNpcMt_cFv */ -bool daNpcMt_c::isComp() { +BOOL daNpcMt_c::isComp() { int ownedNum = getFigureMakeNum(); int totalNum = 0x84; if(isFigureGet(0x32)) { @@ -288,8 +1402,18 @@ bool daNpcMt_c::isComp() { } /* 00002D08-00002D4C .text changePhotoNo__9daNpcMt_cFUc */ -void daNpcMt_c::changePhotoNo(u8) { - /* Nonmatching */ +u8 daNpcMt_c::changePhotoNo(u8 photoNo) { + switch(photoNo) { + case 2: + photoNo = 0x69; + break; + case 4: + photoNo = 0x67; + break; + case 6: + photoNo = 0x6d; + } + return photoNo; } /* 00002D4C-00002D6C .text daNpc_MtCreate__FPv */ diff --git a/src/d/actor/d_a_npc_tt.cpp b/src/d/actor/d_a_npc_tt.cpp index 39016019f8..b5ef59e4f1 100644 --- a/src/d/actor/d_a_npc_tt.cpp +++ b/src/d/actor/d_a_npc_tt.cpp @@ -6,225 +6,947 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep #include "d/actor/d_a_npc_tt.h" #include "m_Do/m_Do_ext.h" +#include "res/Object/Tt.h" +#include "d/d_snap.h" +#include "d/actor/d_a_player_main.h" + +static fpc_ProcID l_msgId; +static msg_class* l_msg; /* 00000078-00000098 .text daNpc_tt_XyCheckCB__FPvi */ -static s16 daNpc_tt_XyCheckCB(void*, int) { - /* Nonmatching */ +static s16 daNpc_tt_XyCheckCB(void* i_this, int i_itemBtn) { + return ((daNpc_Tt_c*)i_this)->XyCheckCB(i_itemBtn); } /* 00000098-000000BC .text XyCheckCB__10daNpc_Tt_cFi */ -void daNpc_Tt_c::XyCheckCB(int) { - /* Nonmatching */ +s16 daNpc_Tt_c::XyCheckCB(int i_itemBtn) { + return dComIfGp_getSelectItem(i_itemBtn) == dItemNo_WIND_WAKER_e ? TRUE : FALSE; } /* 000000BC-00000108 .text daNpc_tt_XyEventCB__FPvi */ -static s16 daNpc_tt_XyEventCB(void*, int) { - /* Nonmatching */ +static s16 daNpc_tt_XyEventCB(void* i_this, int i_itemBtn) { + daNpc_Tt_c* a_this = (daNpc_Tt_c*)i_this; + a_this->mEventIdx = dComIfGp_evmng_getEventIdx("TACT_TT10"); + return a_this->mEventIdx; } /* 00000108-000002D8 .text nodeCallBack_Tt__FP7J3DNodei */ -static BOOL nodeCallBack_Tt(J3DNode*, int) { - /* Nonmatching */ +static BOOL nodeCallBack_Tt(J3DNode* node, int calcTiming) { + cXyz temp; + cXyz temp2; + if (calcTiming == J3DNodeCBCalcTiming_In) { + J3DModel* model = j3dSys.getModel(); + daNpc_Tt_c* i_this = (daNpc_Tt_c*)model->getUserArea(); + J3DJoint* joint = (J3DJoint*)node; + int jntNo = joint->getJntNo(); + + if(i_this != NULL) { + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); + if (jntNo == i_this->m_head_jnt_num) { + temp.setall(0.0f); + cMtx_YrotM(*calc_mtx, -i_this->getHead_y()); + cMtx_ZrotM(*calc_mtx, -i_this->getHead_x() - i_this->mHeadAnm.field_0x00); + MtxPosition(&temp, &temp2); + i_this->setAttentionBasePos(temp2); + temp.set(20.0f, -20.0f, 0.0f); + + MtxPosition(&temp, &temp2); + i_this->setEyePos(temp2); + i_this->incAttnSetCount(); + + } else if (jntNo == i_this->m_backbone_jnt_num) { + mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); + mDoMtx_ZrotM(*calc_mtx, i_this->m_jnt.getBackbone_x()); + } + cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); + model->setAnmMtx(jntNo, *calc_mtx); + } + } + return TRUE; } /* 000002D8-00000368 .text setAnmStatus__10daNpc_Tt_cFv */ void daNpc_Tt_c::setAnmStatus() { - /* Nonmatching */ + switch(mState) { + case 1: + case 2: + if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_0C40)) { + danceInit(0); + } else { + setAnm(4); + } + break; + case 3: + break; + default: + setAnm(0); + break; + } +} + +//probably unused JUT_ASSERT +static void dummy() { + OSReport("Tt"); + OSReport("d_a_npc_tt.cpp"); + OSReport("0"); + OSReport("Halt"); } +#include "d/actor/d_a_npc_tt_anm.inc" + /* 00000368-000003DC .text eventOrder__10daNpc_Tt_cFv */ void daNpc_Tt_c::eventOrder() { - /* Nonmatching */ + if (ChkOrder(1)) { + eventInfo.onCondition(dEvtCnd_CANTALK_e); + fopAcM_orderSpeakEvent(this); + } + if (ChkOrder(2)) { + eventInfo.onCondition(dEvtCnd_CANTALK_e); + } + if (ChkOrder(4)) { + eventInfo.onCondition(dEvtCnd_CANTALKITEM_e); + } } /* 000003DC-00000484 .text checkOrder__10daNpc_Tt_cFv */ void daNpc_Tt_c::checkOrder() { - /* Nonmatching */ + if (eventInfo.mCommand != dEvtCmd_INDEMO_e) { + if (eventInfo.mCommand == dEvtCmd_INTALK_e && ChkOrder(7)) { + if (dComIfGp_event_chkTalkXY()) { + setFlag(0x4); + } else { + setFlag(0x2); + } + talkInit(); + } + } + ClrOrder(); } /* 00000484-000004F4 .text next_msgStatus__10daNpc_Tt_cFPUl */ -void daNpc_Tt_c::next_msgStatus(unsigned long*) { - /* Nonmatching */ +u16 daNpc_Tt_c::next_msgStatus(u32* pMsgNo) { + u16 msgStatus = fopMsgStts_MSG_CONTINUES_e; + + switch (*pMsgNo) { + case 0x22C5: + case 0x22C7: + case 0x22C8: + case 0x22D5: + case 0x22D6: + (*pMsgNo)++; + break; + + case 0x22C6: + *pMsgNo = 0x22D5; + break; + case 0x22D7: + *pMsgNo = 0x22C7; + break; + + default: + msgStatus = fopMsgStts_MSG_ENDS_e; + break; + } + return msgStatus; } + /* 000004F4-000005D0 .text getMsg__10daNpc_Tt_cFv */ -void daNpc_Tt_c::getMsg() { - /* Nonmatching */ +u32 daNpc_Tt_c::getMsg() { + u32 msgNo; + clrFlag(0x20); + switch(mState) { + case 2: + if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_0C40)) { + msgNo = 0x22CB; + } else { + if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_0B08)) { + msgNo = 0x22CA; + setFlag(0x20); + } else { + dComIfGs_onEventBit(dSv_event_flag_c::UNK_0B08); + msgNo = 0x22C5; + setFlag(0x20); + } + } + break; + default: + msgNo = mMsgNo; + switch(msgNo) { + case 0x5B3: + dComIfGp_setMelodyNum(5); + break; + } + } + return msgNo; } /* 000005D0-00000650 .text setCollision__10daNpc_Tt_cFv */ void daNpc_Tt_c::setCollision() { - /* Nonmatching */ + + cXyz centerPos(current.pos); + f32 cylCollisionRadius = 48.0f; + f32 height = 140.0f; + mCyl.SetC(centerPos); + mCyl.SetR(cylCollisionRadius); + mCyl.SetH(height); + dComIfG_Ccsp()->Set(&mCyl); } /* 00000650-00000664 .text talkInit__10daNpc_Tt_cFv */ void daNpc_Tt_c::talkInit() { - /* Nonmatching */ + mTalkState = TALK_INIT;; + mMsgAnmIdx = 0xFF; } /* 00000664-00000718 .text msgAnm__10daNpc_Tt_cFv */ void daNpc_Tt_c::msgAnm() { - /* Nonmatching */ + if(mMsgAnmIdx != dComIfGp_getMesgAnimeAttrInfo()) { + mMsgAnmIdx = dComIfGp_getMesgAnimeAttrInfo(); + switch(mMsgAnmIdx) { + case 0: + setAnm(0); + break; + case 1: + setAnm(1); + break; + case 2: + setAnm(3); + break; + case 3: + setAnm(4); + break; + case 4: + danceInit(0); + break; + case 5: + setAnm(2); + break; + } + } } /* 00000718-00000730 .text msgPushButton__10daNpc_Tt_cFv */ void daNpc_Tt_c::msgPushButton() { - /* Nonmatching */ + if ((s32)mCurrMsgNo != 0x22C6) { + return; + } + mNoticeLinkTimer = 0xF; } /* 00000730-00000778 .text msgContinue__10daNpc_Tt_cFv */ void daNpc_Tt_c::msgContinue() { - /* Nonmatching */ + switch(mCurrMsgNo) { + case 0x22D5: + if (mNoticeLinkTimer > 0) { + mNoticeLinkTimer--; + } else { + fopMsgM_messageSendOn(); + } + break; + } } /* 00000778-00000900 .text talk__10daNpc_Tt_cFv */ -void daNpc_Tt_c::talk() { - /* Nonmatching */ +u16 daNpc_Tt_c::talk() { + u16 msgStatus = 0xFF; + if (mTalkState == TALK_INIT) { + l_msgId = fpcM_ERROR_PROCESS_ID_e; + mCurrMsgNo = getMsg(); + mTalkState = TALK_MSG_CREATE; + } else if (mTalkState != TALK_FINISHED) { + if(l_msgId == fpcM_ERROR_PROCESS_ID_e) { + l_msgId = fopMsgM_messageSet(mCurrMsgNo, this); + } else { + msgAnm(); + switch(mTalkState) { + case TALK_MSG_CREATE: + l_msg = fopMsgM_SearchByID(l_msgId); + if (l_msg != NULL) { + mTalkState = TALK_ACTIVE; + } + break; + + case TALK_ACTIVE: + if(l_msg != NULL) { + msgStatus = l_msg->mStatus; + if(msgStatus == fopMsgStts_MSG_CONTINUES_e) { + msgContinue(); + } else if(msgStatus == fopMsgStts_MSG_DISPLAYED_e) { + msgPushButton(); + l_msg->mStatus = next_msgStatus(&mCurrMsgNo); + if(l_msg->mStatus == fopMsgStts_MSG_CONTINUES_e) { + fopMsgM_messageSet(mCurrMsgNo); + } + } else if(msgStatus == fopMsgStts_BOX_CLOSED_e) { + l_msg->mStatus = fopMsgStts_MSG_DESTROYED_e; + l_msgId = fpcM_ERROR_PROCESS_ID_e; + l_msg = NULL; + } + } + break; + } + } + } + return msgStatus; } /* 00000900-000009EC .text demoInitChange__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoInitChange() { - /* Nonmatching */ + int* a_intP = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "prm0"); + JUT_ASSERT(DEMO_SELECT(758, 758), a_intP); + + if(a_intP != NULL) { + mEventIdx = dComIfGp_evmng_getEventIdx("TACT_TT11"); + setEvFlag(0x1); + fopAcM_orderChangeEventId(daPy_getPlayerLinkActorClass(), this, mEventIdx, 0, 0xFFFF); + } } /* 000009EC-00000B1C .text demoProcTact1__10daNpc_Tt_cFv */ -void daNpc_Tt_c::demoProcTact1() { - /* Nonmatching */ +bool daNpc_Tt_c::demoProcTact1() { + switch(daPy_getPlayerLinkActorClass()->getTactTimerCancel()) { + case 1: + mEventIdx = dComIfGp_evmng_getEventIdx("TACT_TT12"); + setEvFlag(0x1); + fopAcM_orderChangeEventId(daPy_getPlayerLinkActorClass(), this, mEventIdx, 0, 0xFFFF); + break; + case 2: + mEventIdx = dComIfGp_evmng_getEventIdx("TACT_TT13"); + setEvFlag(0x1); + fopAcM_orderChangeEventId(daPy_getPlayerLinkActorClass(), this, mEventIdx, 0, 0xFFFF); + break; + default: + dComIfGs_onEventBit(dSv_event_flag_c::UNK_0C40); + dComIfGp_evmng_cutEnd(mStaffIdx); + break; + } + + return TRUE; } /* 00000B1C-00000BA0 .text demoInitPatten__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoInitPatten() { - /* Nonmatching */ + setEvFlag(0x4); + mSoundTimer = 0; + danceInit(0); + int* cnt = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "Cnt"); + if(cnt != NULL) { + field_0xE7A = *cnt; + } else { + field_0xE7A = 2; + } } /* 00000BA0-00000D40 .text demoProcPatten__10daNpc_Tt_cFv */ -void daNpc_Tt_c::demoProcPatten() { - /* Nonmatching */ +bool daNpc_Tt_c::demoProcPatten() { + if (field_0xE7A == 0) { + dComIfGp_evmng_cutEnd(mStaffIdx); + clrEvFlag(0x4); + } else { + if(danceProc()) { + field_0xE7A--; + } + if(mSoundTimer > 0) { + mSoundTimer--; + if(mSoundTimer == 0) { + switch(mCurrAnmIdx) { + case 8: + fopAcM_seStart(this, JA_SE_CV_TT_DANCE_FIN, 0); + break; + case 9: + fopAcM_seStart(this, JA_SE_CV_TT_DANCE_2, 0); + break; + case 10: + fopAcM_seStart(this, JA_SE_CV_TT_DANCE_1, 0); + break; + } + + } + } + } + return FALSE; } /* 00000D40-00000E04 .text demoInitSpeak__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoInitSpeak() { - /* Nonmatching */ + talkInit(); + int* a_intP = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "MsgNo"); + JUT_ASSERT(882, a_intP); + mMsgNo = *a_intP; + switch(mMsgNo) { + case 0x22CE: + if(dKy_daynight_check() == dKy_TIME_NIGHT_e) { + mMsgNo = 0x22CF; + } + break; + } } /* 00000E04-00000E5C .text demoProcSpeak__10daNpc_Tt_cFv */ -void daNpc_Tt_c::demoProcSpeak() { - /* Nonmatching */ +bool daNpc_Tt_c::demoProcSpeak() { + u16 temp = talk(); + if (temp == fopMsgStts_BOX_CLOSED_e || temp == 0xFE) { + dComIfGp_evmng_cutEnd(mStaffIdx); + } + return false; } /* 00000E5C-00000EC4 .text demoInitWait__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoInitWait() { - /* Nonmatching */ + int* pTimer = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "Timer"); + if (pTimer != NULL) { + mTimer = *pTimer; + } else { + mTimer = 0; + } } /* 00000EC4-00000F14 .text demoProcWait__10daNpc_Tt_cFv */ -void daNpc_Tt_c::demoProcWait() { - /* Nonmatching */ +bool daNpc_Tt_c::demoProcWait() { + if (mTimer > 0) { + mTimer--; + } else { + dComIfGp_evmng_cutEnd(mStaffIdx); + } + return FALSE; } /* 00000F14-00001020 .text demoInitCom__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoInitCom() { - /* Nonmatching */ + daPy_lk_c* pLink = (daPy_lk_c*)daPy_getPlayerLinkActorClass(); + int* hidePl = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "HIDE_PL"); + if (hidePl != NULL) { + if (*hidePl != 0) { + pLink->onPlayerNoDraw(); + } else { + pLink->offPlayerNoDraw(); + } + } + + int* disp = dComIfGp_evmng_getMyIntegerP(mStaffIdx, "DISP"); + if (disp != NULL) { + if (*disp != 0) { + clrEvFlag(0x2); + } else { + setEvFlag(0x2); + } + } + + int* anm = dComIfGp_evmng_getMyIntegerP(mStaffIdx,"Anm"); + if (anm != NULL) { + setAnm(*anm & 0xff); + } } /* 00001020-00001040 .text demoProcCom__10daNpc_Tt_cFv */ void daNpc_Tt_c::demoProcCom() { - /* Nonmatching */ + if (chkEvFlag(0x2)) { + setFlag(0x8); + } } /* 00001040-00001088 .text getNowEventAction__10daNpc_Tt_cFv */ -void daNpc_Tt_c::getNowEventAction() { - /* Nonmatching */ +s32 daNpc_Tt_c::getNowEventAction() { + static char* action_table[] = { + "WAIT", + "SPEAK", + "PATTEN", + "CHANGE", + "TACT0", + "TACT1", + }; + + return dComIfGp_evmng_getMyActIdx(mStaffIdx, action_table, ARRAY_SIZE(action_table), FALSE, 1); } /* 00001088-00001238 .text demoProc__10daNpc_Tt_cFv */ -void daNpc_Tt_c::demoProc() { - /* Nonmatching */ +bool daNpc_Tt_c::demoProc() { + bool temp = false; + + if(chkEvFlag(0x1)) { + mStaffIdx = dComIfGp_evmng_getMyStaffId("Tt"); + clrEvFlag(0x1); + } + s32 eventAction = getNowEventAction(); + if(dComIfGp_evmng_getIsAddvance(mStaffIdx)) { + demoInitCom(); + setFlag(0x80); + switch(eventAction) { + case 1: + demoInitSpeak(); + break; + case 0: + demoInitWait(); + break; + case 2: + demoInitPatten(); + temp = true; + break; + case 3: + demoInitChange(); + break; + } + } + + switch(eventAction) { + case 1: + temp = demoProcSpeak(); + break; + case 0: + demoProcWait(); + break; + case 2: + demoProcPatten(); + break; + case 3: + break; + case 4: + dComIfGp_evmng_cutEnd(mStaffIdx); + break; + case 5: + demoProcTact1(); + break; + default: + dComIfGp_evmng_cutEnd(mStaffIdx); + break; + } + + demoProcCom(); + if(eventAction != 2) { + danceProc(); + } + return temp; } /* 00001238-00001420 .text init__10daNpc_Tt_cFv */ -void daNpc_Tt_c::init() { - /* Nonmatching */ +BOOL daNpc_Tt_c::init() { + attention_info.flags = fopAc_Attn_ACTION_SPEAK_e|fopAc_Attn_LOCKON_TALK_e; + attention_info.distances[fopAc_Attn_TYPE_TALK_e] = 0xAB; + attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = 0xAB; + gravity = -30.0f; + fopAcM_SetStatusMap(this, 0x27); + fopAcM_OnStatus(this, fopAcStts_SHOWMAP_e); + + switch(mType) { + case 0: + setAction(&daNpc_Tt_c::wait_action, NULL); + break; + } + + mAttnBasePos.set(current.pos); + mEyePos.set(current.pos); + + J3DModel* model = mpMorf->getModel(); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(current.angle.y); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + ke_execute(); + mStts.Init(0xFF, 0xFF, this); + mCyl.Set(dNpc_cyl_src); + mCyl.SetStts(&mStts); + eventInfo.setXyCheckCB(daNpc_tt_XyCheckCB); + eventInfo.setXyEventCB(daNpc_tt_XyEventCB); + mMtrlSndId = 0; + mReverb = dComIfGp_getReverb(fopAcM_GetRoomNo(this)); + return TRUE; } /* 00001420-00001474 .text setAttention__10daNpc_Tt_cFb */ -void daNpc_Tt_c::setAttention(bool) { - /* Nonmatching */ +void daNpc_Tt_c::setAttention(bool param_1) { + if (!param_1 && mAttnSetCount >= 2) { + return; + } + + eyePos.set(mEyePos.x, mEyePos.y, mEyePos.z); + attention_info.position.set(mAttnBasePos.x, mAttnBasePos.y + 65.0f, mAttnBasePos.z); } /* 00001474-000015D8 .text lookBack__10daNpc_Tt_cFv */ void daNpc_Tt_c::lookBack() { - /* Nonmatching */ + cXyz temp2; + cXyz temp(0.0f, 0.0f, 0.0f); + cXyz* dstPos = NULL; + s16 desiredYRot = current.angle.y; + bool headOnlyFollow = false; + + switch(mState) { + case 1: + desiredYRot = home.angle.y; + if(desiredYRot != current.angle.y) { + m_jnt.setTrn(); + } else { + m_jnt.clrTrn(); + } + break; + + default: + if (chkFlag(0x20)) { + desiredYRot = home.angle.y; + m_jnt.clrTrn(); + } else { + m_jnt.setTrn(); + temp2 = dNpc_playerEyePos(-20.0f); + dstPos = &temp2; + temp.set(current.pos); + temp.y = eyePos.y; + } + break; + } + + if (m_jnt.trnChk()) { + cLib_addCalcAngleS2(&mMaxHeadTurnVelocity, 0x800, 4, 0x800); + } else { + mMaxHeadTurnVelocity = 0; + } + + m_jnt.lookAtTarget(¤t.angle.y, dstPos, temp, desiredYRot, mMaxHeadTurnVelocity, headOnlyFollow); + shape_angle.y = current.angle.y; } /* 000015D8-00001734 .text wait01__10daNpc_Tt_cFv */ -void daNpc_Tt_c::wait01() { - /* Nonmatching */ +bool daNpc_Tt_c::wait01() { + if(chkFlag(0x4)) { + mReturnToState = mState; + mState = 3; + setAnmStatus(); + mTimer = 0x14; + setEvFlag(0x1); + fopAcM_seStart(this, JA_SE_PRE_TAKT, 0); + return demoProc(); + + } else if(chkFlag(0x2)) { + mReturnToState = mState; + mState = 2; + setAnmStatus(); + } else { + SetOrder(0x2); + if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_0C40) && dComIfGs_isEventBit(dSv_event_flag_c::UNK_0B08)) { + SetOrder(0x4); + } + } + danceProc(); + return mpMorf->isMorf(); } /* 00001734-00001804 .text talk01__10daNpc_Tt_cFv */ -void daNpc_Tt_c::talk01() { - /* Nonmatching */ +bool daNpc_Tt_c::talk01() { + u16 temp = talk(); + if(mCurrMsgNo == 0x22C6 && dComIfGp_checkMesgSendButton()) { + clrFlag(0x20); + } + + if(temp == fopMsgStts_BOX_CLOSED_e) { + mState = mReturnToState; + setAnmStatus(); + dComIfGp_event_reset(); + clrFlag(0x2); + clrFlag(0x4); + } + danceProc(); + return mpMorf->isMorf(); } /* 00001804-00001894 .text tact00__10daNpc_Tt_cFv */ -void daNpc_Tt_c::tact00() { - /* Nonmatching */ +bool daNpc_Tt_c::tact00() { + if(dComIfGp_evmng_endCheck(mEventIdx)) { + mState = mReturnToState; + setAnmStatus(); + dComIfGp_event_reset(); + clrFlag(0x2); + clrFlag(0x4); + return true; + } + return demoProc(); } /* 00001894-00001970 .text wait_action__10daNpc_Tt_cFPv */ -void daNpc_Tt_c::wait_action(void*) { - /* Nonmatching */ +BOOL daNpc_Tt_c::wait_action(void*) { + if(mActionStatus == ACTION_STARTING) { + mState = 1; + setAnmStatus(); + mActionStatus++; // set to ACTION_ONGOING + } else if(mActionStatus != ACTION_ENDING) { + bool temp; + clrFlag(0x8); + switch(mState) { + case 1: + temp = wait01(); + break; + case 2: + temp = talk01(); + break; + case 3: + temp = tact00(); + break; + default: + temp = false; + break; + } + lookBack(); + setAttention(temp); + } + return TRUE; } /* 00001970-00001BAC .text ke_control__7tt_ke_sFf */ -void tt_ke_s::ke_control(float) { - /* Nonmatching */ +void tt_ke_s::ke_control(f32 param_1) { + int i; + cXyz* temp2 = &field_0x00[1]; + cXyz* temp3 = &field_0x78[1]; + cXyz temp; + cXyz temp6; + cXyz temp4; + temp.set(0.0f, 0.0f, 7.875f); + + f32 _065 = 0.65f; + + for(i = 1; i < 10; i++, temp2++, temp3++) { + temp4.x = temp3->x + (temp2->x - (temp2 - 1)->x); + temp4.z = temp3->z + (temp2->z - (temp2 - 1)->z); + + f32 temp7 = temp2->y + temp3->y +-3.0f; + + if(temp7 < param_1) { + temp7 = param_1; + } + + temp4.y = temp7 - (temp2-1)->y; + mDoMtx_XrotS(*calc_mtx, -cM_atan2s(temp4.y, temp4.z)); + mDoMtx_YrotM(*calc_mtx, (s16)cM_atan2s(temp4.x, std::sqrtf(temp4.y * temp4.y + temp4.z * temp4.z))); + MtxPosition(&temp, &temp6); + *temp3 = *temp2; + *temp2 = *(temp2-1) + temp6; + temp3->x = (temp2->x - temp3->x) * _065; + temp3->y = (temp2->y - temp3->y) * _065; + temp3->z = (temp2->z - temp3->z) * _065; + } } /* 00001BAC-00001BE4 .text ke_pos_set__7tt_ke_sFP4cXyz */ -void tt_ke_s::ke_pos_set(cXyz*) { - /* Nonmatching */ +void tt_ke_s::ke_pos_set(cXyz* i_param) { + for(int i = 0; i < 10; i_param++) { + *i_param = field_0x00[i]; + i++; + } } /* 00001BE4-00001D48 .text set_ke_root__10daNpc_Tt_cFiii */ -void daNpc_Tt_c::set_ke_root(int, int, int) { - /* Nonmatching */ +void daNpc_Tt_c::set_ke_root(int param_1, int param_2, int param_3) { + cXyz temp(0.0f, 0.0f, 0.0f); + MTXCopy(mpMorf->getModel()->getAnmMtx(param_1), *calc_mtx); + MtxPosition(&temp, &mLineKe.field_0x6C8[param_3].field_0x00[0]); + + MTXCopy(mpMorf->getModel()->getAnmMtx(param_2), *calc_mtx); + MtxPosition(&temp, &mLineKe.field_0x6C8[param_3 + 3].field_0x00[0]); + + mLineKe.field_0x6C8[param_3+1].field_0x00[0] = (mLineKe.field_0x6C8[param_3 + 3].field_0x00[0] - mLineKe.field_0x6C8[param_3].field_0x00[0]) * 0.3333f + mLineKe.field_0x6C8[param_3].field_0x00[0]; + + mLineKe.field_0x6C8[param_3+2].field_0x00[0] = (mLineKe.field_0x6C8[param_3 + 3].field_0x00[0] - mLineKe.field_0x6C8[param_3].field_0x00[0]) * 0.6667f + mLineKe.field_0x6C8[param_3].field_0x00[0]; } /* 00001D48-00001E04 .text ke_execute__10daNpc_Tt_cFv */ void daNpc_Tt_c::ke_execute() { - /* Nonmatching */ + mpMorf->calc(); + + set_ke_root(6, 7, 0); + set_ke_root(10, 11, 4); + int i; + tt_ke_s* ke = mLineKe.field_0x6C8; + f32 y = current.pos.y + 3.0f; + + for (i = 0; i < 8; i++, ke++) { + ke->ke_control(y); + ke->ke_pos_set(mLineKe.mLineMat.getPos(i)); + } } /* 00001E04-00001F84 .text _draw__10daNpc_Tt_cFv */ BOOL daNpc_Tt_c::_draw() { - /* Nonmatching */ + J3DModel* pModel = mpMorf->getModel(); + J3DModelData* pModelData = pModel->getModelData(); + if (chkFlag(0x8)) { + return TRUE; + } + g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType(pModel, &tevStr); + mBtpAnm.entry(pModelData, mBlinkFrame); + mpMorf->entryDL(); + mBtpAnm.remove(pModelData); + f32 _100 = 100.0f; + f32 _450 = 450.0f; + cXyz shadowPos(current.pos.x, current.pos.y + _100, current.pos.z); + + mShadowId = dComIfGd_setShadow( + mShadowId, 1, pModel, &shadowPos, _450, 20.0f, + current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr + ); + +#ifdef __MWERKS__ + mLineKe.mLineMat.update(10, 0.8f, (GXColor){0xC9, 0xCA, 0xE4, 0xFF}, 0, &tevStr); +#else + GXColor color = (GXColor){0xC9, 0xCA, 0xE4, 0xFF}; + mLineKe.mLineMat.update(10, 0.8f, color, 0, &tevStr); +#endif + dComIfGd_set3DlineMat(&mLineKe.mLineMat); + + dSnap_RegistFig(DSNAP_TYPE_TT, this, 1.0f, 1.0f, 1.0f); + return TRUE; } /* 00001F84-00002158 .text _execute__10daNpc_Tt_cFv */ BOOL daNpc_Tt_c::_execute() { - /* Nonmatching */ + m_jnt.setParam( + /* mMaxBackboneX */ 0, + /* mMaxBackboneY */ 0x1C70, + /* mMinBackboneX */ 0, + /* mMinBackboneY */ -0x1C70, + /* mMaxHeadX */ 0x1FFE, + /* mMaxHeadY */ 9000, + /* mMinHeadX */ -0x1FFE, + /* mMinHeadY */ -9000, + /* mMaxTurnStep */ 0x1000 + ); + + playTexPatternAnm(); + + mAnmEnded = mpMorf->play(&eyePos, mMtrlSndId, mReverb); + if(mpMorf->getFrame() < mAnmTimer) { + mAnmEnded = 1; + } + + mAnmTimer = mpMorf->getFrame(); + if (mAnmEnded != 0) { + switch(mCurrAnmIdx) { + case 3: + if (mAnmLoopCount > 0) { + setAnm(0); + } else { + mAnmLoopCount++; + } + break; + } + } + mHeadAnm.move(); + checkOrder(); + (this->*mCurrActionFunc)(NULL); + eventOrder(); + fopAcM_posMoveF(this, mStts.GetCCMoveP()); + mObjAcch.CrrPos(*dComIfG_Bgsp()); + mMtrlSndId = 0; + + if (!mObjAcch.ChkGroundHit()) { + mMtrlSndId = dComIfG_Bgsp()->GetMtrlSndId(mObjAcch.m_gnd); + } + + tevStr.mRoomNo = dComIfG_Bgsp()->GetRoomId(mObjAcch.m_gnd); + tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mObjAcch.m_gnd); + + J3DModel* pModel = mpMorf->getModel(); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(current.angle.y); + pModel->setBaseTRMtx(mDoMtx_stack_c::get()); + setCollision(); + ke_execute(); + return TRUE; } /* 00002158-000021A8 .text _delete__10daNpc_Tt_cFv */ BOOL daNpc_Tt_c::_delete() { - /* Nonmatching */ + dComIfG_resDelete(&mPhs, "Tt"); + if (mpMorf != NULL) { + mpMorf->stopZelAnime(); + } + return TRUE; } /* 000021A8-000021C8 .text CheckCreateHeap__FP10fopAc_ac_c */ -static BOOL CheckCreateHeap(fopAc_ac_c*) { - /* Nonmatching */ +static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { + return ((daNpc_Tt_c*)i_this)->CreateHeap(); } /* 000021C8-0000241C .text _create__10daNpc_Tt_cFv */ cPhs_State daNpc_Tt_c::_create() { - /* Nonmatching */ + fopAcM_ct_Retail(this, daNpc_Tt_c); + cPhs_State state = dComIfG_resLoad(&mPhs, "Tt"); + if (state == cPhs_COMPLEATE_e) { + fopAcM_ct_Demo(this, daNpc_Tt_c); + switch(fopAcM_GetName(this)) { + case fpcNm_NPC_TT_e: + mType = 0; + break; + default: + return cPhs_ERROR_e; + } + + if (!fopAcM_entrySolidHeap(this, &CheckCreateHeap, 0xE880)) { +#if VERSION > VERSION_DEMO + mpMorf = NULL; +#endif + return cPhs_ERROR_e; + } + + fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); + if(!init()) { +#if VERSION > VERSION_DEMO + mpMorf = NULL; +#endif + return cPhs_ERROR_e; + } + } + return state; } /* 000027D0-00002AB0 .text CreateHeap__10daNpc_Tt_cFv */ -void daNpc_Tt_c::CreateHeap() { - /* Nonmatching */ +BOOL daNpc_Tt_c::CreateHeap() { + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Tt", dRes_INDEX_TT_BDL_TT_e); + + mpMorf = new mDoExt_McaMorf( + modelData, + NULL, NULL, + (J3DAnmTransformKey*)dComIfG_getObjectRes("Tt", dRes_INDEX_TT_BCK_WAIT01_e), + J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, + dComIfG_getObjectRes("Tt", dRes_INDEX_TT_BAS_WAIT01_e), + 0x80000, + 0x11020022 + ); + + if (mpMorf == NULL || mpMorf->getModel() == NULL) { + return FALSE; + } + + m_head_jnt_num = modelData->getJointName()->getIndex("head"); + JUT_ASSERT(DEMO_SELECT(1706, 1708), m_head_jnt_num >= 0); + + m_backbone_jnt_num = modelData->getJointName()->getIndex("backbone1"); + JUT_ASSERT(DEMO_SELECT(1708, 1710), m_backbone_jnt_num >= 0); + + switch(mType) { + case 0: + mTexPatternIdx = false; + break; + } + +#if VERSION == VERSION_DEMO + initTexPatternAnm(false); +#else + if (!initTexPatternAnm(false)) { + return FALSE; + } +#endif + + for(u16 i = 0; i < modelData->getJointNum(); i++) { + if(i == m_head_jnt_num || i == m_backbone_jnt_num) { + mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack_Tt); + } + } + + mpMorf->getModel()->setUserArea((u32)(this)); + + mAcchCir.SetWall(30.0f, 0.0f); + mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this)); + return mLineKe.mLineMat.init(8, 10, 0) == FALSE ? FALSE : TRUE; } /* 00002AB0-00002AD0 .text daNpc_Tt_Create__FP10fopAc_ac_c */ @@ -252,7 +974,6 @@ static BOOL daNpc_Tt_IsDelete(daNpc_Tt_c*) { return TRUE; } -#include "d/actor/d_a_npc_tt_anm.inc" static actor_method_class l_daNpc_Tt_Method = { (process_method_func)daNpc_Tt_Create, diff --git a/src/d/actor/d_a_npc_tt_anm.inc b/src/d/actor/d_a_npc_tt_anm.inc index 8f63442c6a..52e2fd0674 100644 --- a/src/d/actor/d_a_npc_tt_anm.inc +++ b/src/d/actor/d_a_npc_tt_anm.inc @@ -1,33 +1,213 @@ // The name of this .inc file is known because of an assert contained in it. - #include "d/actor/d_a_npc_tt.h" +static const s16 l_bck_ix_tbl[] = { + dRes_INDEX_TT_BCK_WAIT01_e, + dRes_INDEX_TT_BCK_TALK01_e, + dRes_INDEX_TT_BCK_TALK01_e, + dRes_INDEX_TT_BCK_TALK02_e, + dRes_INDEX_TT_BCK_STEP01_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_TURN_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_ND_e, + dRes_INDEX_TT_BCK_POSE_NL_e, + dRes_INDEX_TT_BCK_POSE_NR_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, + dRes_INDEX_TT_BCK_POSE_CC_e, +}; + +static const s16 l_bas_ix_tbl[] = { + dRes_INDEX_TT_BAS_WAIT01_e, + dRes_INDEX_TT_BAS_TALK01_e, + dRes_INDEX_TT_BAS_TALK01_e, + dRes_INDEX_TT_BAS_TALK01_e, + dRes_INDEX_TT_BAS_STEP01_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_TURN_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_ND_e, + dRes_INDEX_TT_BAS_POSE_NL_e, + dRes_INDEX_TT_BAS_POSE_NR_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, + dRes_INDEX_TT_BAS_POSE_CC_e, +}; + +static const int l_btp_ix_tbl[] = { + dRes_INDEX_TT_BTP_MABA01_e +}; + /* 00002CD4-00002DEC .text initTexPatternAnm__10daNpc_Tt_cFb */ -void daNpc_Tt_c::initTexPatternAnm(bool) { - /* Nonmatching */ +BOOL daNpc_Tt_c::initTexPatternAnm(bool i_modify) { + + J3DModelData* modelData = mpMorf->getModel()->getModelData(); + + m_head_tex_pattern = (J3DAnmTexPattern*)dComIfG_getObjectRes("Tt", l_btp_ix_tbl[mTexPatternIdx]); + JUT_ASSERT(130, m_head_tex_pattern != NULL); + + if (!mBtpAnm.init(modelData, m_head_tex_pattern, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, i_modify, FALSE)) { + return FALSE; + } + + mBlinkFrame = 0; + mBlinkTimer = 0; + return TRUE; } /* 00002DEC-00002E78 .text playTexPatternAnm__10daNpc_Tt_cFv */ void daNpc_Tt_c::playTexPatternAnm() { - /* Nonmatching */ + if (cLib_calcTimer(&mBlinkTimer) == 0) { + if (mBlinkFrame >= m_head_tex_pattern->getFrameMax()) { + mBlinkFrame -= m_head_tex_pattern->getFrameMax(); + mBlinkTimer = cM_rndF(100.0f) + 30.0f; + } else { + mBlinkFrame++; + } + } } /* 00002E78-00002F94 .text setAnm__10daNpc_Tt_cFi */ -void daNpc_Tt_c::setAnm(int) { - /* Nonmatching */ +void daNpc_Tt_c::setAnm(int newAnmIdx) { + if (mTexPatternIdx != 0) { + mTexPatternIdx = 0; + initTexPatternAnm(true); + } + s8 anmIdx = newAnmIdx; + f32 morf = 8.0f; + f32 speed = 1.0f; + s32 loopMode = J3DFrameCtrl::EMode_LOOP; + + if(newAnmIdx >= 7 && newAnmIdx <= 31) { + morf = 7.0f; + mSoundTimer = morf; + } + + if (newAnmIdx == 6) { + speed = 0.9f; + } + + if (newAnmIdx < 5) { + clrFlag(0x40); + } else { + loopMode = J3DFrameCtrl::EMode_NONE; + } + + if(newAnmIdx == 2) { + speed = 0.0f; + } + + if (anmIdx != mCurrAnmIdx && anmIdx != -1) { + mCurrAnmIdx = anmIdx; + mAnmLoopCount = 0; + mAnmTimer = 0.0f; + dNpc_setAnm(mpMorf, loopMode, morf, speed, l_bck_ix_tbl[mCurrAnmIdx], l_bas_ix_tbl[mCurrAnmIdx], "Tt"); + } } /* 00002F94-00002FFC .text danceInit__10daNpc_Tt_cFi */ -void daNpc_Tt_c::danceInit(int) { - /* Nonmatching */ +void daNpc_Tt_c::danceInit(int param_1) { + if (param_1 != 0 || !chkFlag(0x40)) { + mDanceStep = 0; + mDanceStepTimer = 8; + setAnm(5); + setFlag(0x40); + } } /* 00002FFC-000030B0 .text danceProc__10daNpc_Tt_cFv */ -void daNpc_Tt_c::danceProc() { - /* Nonmatching */ +BOOL daNpc_Tt_c::danceProc() { + if (!chkFlag(0x40)) { + return FALSE; + + } + if (mpMorf->isMorf()) { + return FALSE; + } + + if (mDanceStep == 5 && mDanceStepTimer == 0x19) { + mHeadAnm.swing_vertical_init(2, 0x1194, -1000, 1); + } + + if(mDanceStepTimer != 0) { + mDanceStepTimer--; + return FALSE; + } + return danceNext(); } /* 000030B0-00003210 .text danceNext__10daNpc_Tt_cFv */ -void daNpc_Tt_c::danceNext() { - /* Nonmatching */ +BOOL daNpc_Tt_c::danceNext() { + if (mDanceStep < 6) { + mDanceStep++; + } else { + mDanceStep = 0; + } + + switch(mDanceStep) { + case 0: + case 2: + setAnm(5); + mDanceStepTimer = 8; + break; + case 1: + setAnm(10); + mDanceStepTimer = 8; + break; + + case 3: + setAnm(9); + mDanceStepTimer = 8; + break; + case 4: + setAnm(6); + mDanceStepTimer = 58; + break; + case 5: + if(chkFlag(0x100)) { + clrFlag(0x100); + fopAcM_seStart(this, JA_SE_CV_TT_DANCE_FIN, 0); + } + setAnm(8); + mDanceStepTimer = 53; + break; + } + return mDanceStep == 0; } diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 28fcfa9a69..fdebd4f765 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -159,7 +159,7 @@ void dComIfG_play_c::itemInit() { mPictureStatus = 0; field_0x495f = 0; mPictureFormat = 0; - field_0x4961 = 0; + mSelectPicture = 0; mHeapLockFlag = 0; field_0x4965 = 0; diff --git a/src/d/d_file_error.cpp b/src/d/d_file_error.cpp index e006aaca36..684d43c9d5 100644 --- a/src/d/d_file_error.cpp +++ b/src/d/d_file_error.cpp @@ -106,7 +106,7 @@ void dFile_error_c::setErrMessage(u32 stringId, int param_2) { setMessage(message_buffer); m2fe = 0; - m2f5 = 1; + mStatus = 1; mState = 1; mDoAud_seStart(JA_SE_MSEL_ALERT_PANEL_IN); @@ -261,7 +261,7 @@ void dFile_error_c::ShowMsgBoard() { g_feHIO.m8, (f32) g_feHIO.m6, 40.0f, - curxp[mSelectedOption] - msgPanes[0].mPosTopLeftOrig.x, + curxp[mYesNo] - msgPanes[0].mPosTopLeftOrig.x, m300 + (f32) g_feHIO.m12, 1, 0 @@ -274,7 +274,7 @@ void dFile_error_c::ShowMsgBoard() { g_feHIO.m8, 40.0f, 0.0f, - curxp[mSelectedOption] - msgPanes[0].mPosTopLeftOrig.x, + curxp[mYesNo] - msgPanes[0].mPosTopLeftOrig.x, m300 + (f32) g_feHIO.m12, 4, 2 @@ -297,7 +297,7 @@ void dFile_error_c::ShowMsgBoard() { /* 8017E4FC-8017E638 .text ynCursorInit__13dFile_error_cFv */ void dFile_error_c::ynCursorInit() { for (int i = 0; i < 2; i ++) { - fopMsgM_paneScaleX(&msgPanes[i], g_feHIO.m14[mSelectedOption]); + fopMsgM_paneScaleX(&msgPanes[i], g_feHIO.m14[mYesNo]); } msgPanes[0].pane->rotate( @@ -322,7 +322,7 @@ void dFile_error_c::HideMsgBoard() { g_feHIO.m9, 0.0f, 40.0f, - curxp[mSelectedOption] - msgPanes[0].mPosTopLeftOrig.x, + curxp[mYesNo] - msgPanes[0].mPosTopLeftOrig.x, m300 + (f32) g_feHIO.m12, 4, 2 @@ -335,7 +335,7 @@ void dFile_error_c::HideMsgBoard() { g_feHIO.m9, 40.0f, (f32) g_feHIO.m6, - curxp[mSelectedOption] - msgPanes[0].mPosTopLeftOrig.x, + curxp[mYesNo] - msgPanes[0].mPosTopLeftOrig.x, m300 + (f32) g_feHIO.m12, 1, 1 @@ -345,16 +345,16 @@ void dFile_error_c::HideMsgBoard() { m2fe ++; if (cond1 == 1 && cond2 == 1) { - m2fc = 0; + mTimeCountDownMode = 0; m2fb = 0x5a; - m2f5 = 2; + mStatus = 2; mState = 0; } } /* 8017E798-8017E86C .text msgDispWait__13dFile_error_cFv */ void dFile_error_c::msgDispWait() { - if (m2fc == 1 && m2fb != 0) { + if (mTimeCountDownMode == 1 && m2fb != 0) { m2fb --; } @@ -373,7 +373,7 @@ void dFile_error_c::yesNoSelectWait() { stick->checkTrigger(); if (CPad_CHECK_TRIG_A(0)) { - if (mSelectedOption == 0) { + if (mYesNo == 0) { mDoAud_seStart(JA_SE_MSEL_OK_1); } else { mDoAud_seStart(JA_SE_MSEL_CANCEL_1); @@ -387,7 +387,7 @@ void dFile_error_c::yesNoSelectWait() { mDoAud_seStart(JA_SE_MSEL_ALERT_PANEL_OUT); } else if (CPad_CHECK_TRIG_B(0)) { - mSelectedOption = 1; + mYesNo = 1; ynCursorMove(); @@ -396,17 +396,17 @@ void dFile_error_c::yesNoSelectWait() { mDoAud_seStart(JA_SE_MSEL_ALERT_PANEL_OUT); } else if (stick->checkLeftTrigger()) { - if (mSelectedOption != 0) { + if (mYesNo != 0) { mDoAud_seStart(JA_SE_MSEL_CURSOR); - mSelectedOption = 0; + mYesNo = 0; ynCursorMove(); } } else if (stick->checkRightTrigger()) { - if (mSelectedOption != 1) { + if (mYesNo != 1) { mDoAud_seStart(JA_SE_MSEL_CURSOR); - mSelectedOption = 1; + mYesNo = 1; ynCursorMove(); } } @@ -428,10 +428,10 @@ void dFile_error_c::ynCursorMove() { fopMsgM_setAlpha(&msgPanes[1]); for (int i = 0; i < 2; i ++) { - fopMsgM_paneScaleX(&msgPanes[i], g_feHIO.m14[mSelectedOption]); + fopMsgM_paneScaleX(&msgPanes[i], g_feHIO.m14[mYesNo]); fopMsgM_paneTrans( &msgPanes[i], - curxp[mSelectedOption] - msgPanes[i].mPosTopLeftOrig.x, + curxp[mYesNo] - msgPanes[i].mPosTopLeftOrig.x, m300 + (f32) g_feHIO.m12 ); } @@ -462,13 +462,13 @@ void dFile_error_c::ynCursorAnime() { msgPanes[0].mUserArea = g_feHIO.mc; fopMsgM_paneTrans( &msgPanes[0], - curxp[mSelectedOption] - msgPanes[0].mPosTopLeftOrig.x + xp1[m2f9], + curxp[mYesNo] - msgPanes[0].mPosTopLeftOrig.x + xp1[m2f9], m300 + (f32) g_feHIO.m12 ); fopMsgM_paneTrans( &msgPanes[1], - curxp[mSelectedOption] - msgPanes[1].mPosTopLeftOrig.x + xp2[m2f9], + curxp[mYesNo] - msgPanes[1].mPosTopLeftOrig.x + xp2[m2f9], m300 + (f32) g_feHIO.m12 ); @@ -652,7 +652,7 @@ void dFile_error_c::paneTransInit() { fopMsgM_setAlpha(&msgPanes[0]); fopMsgM_setAlpha(&msgPanes[1]); - mSelectedOption = 1; + mYesNo = 1; PaneTranceBase(m2fe, g_feHIO.m8, (f32) g_feHIO.m6, 0.0, 0.0, 0.0, 1, 1); @@ -702,9 +702,9 @@ void dFile_error_c::displayInit() { } #endif - m2fc = 0; + mTimeCountDownMode = 0; m2fb = 0x5a; - m2f5 = 0; + mStatus = 0; mState = 0; } diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index 533cd5ad03..143ec0cf72 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -184,9 +184,9 @@ void dFile_select_c::_move() { (this->*DataSelProc[field_0x392b])(); #else #if VERSION <= VERSION_JPN - if(g_mDoMemCd_control.field_0x165A == 1 && field_0x3941 == 0) + if(g_mDoMemCd_control.mProbeStat == 1 && field_0x3941 == 0) #else - if((g_mDoMemCd_control.field_0x165A == 0 || g_mDoMemCd_control.field_0x165A == 1) && field_0x3941 == 0) + if((g_mDoMemCd_control.mProbeStat == 0 || g_mDoMemCd_control.mProbeStat == 1) && field_0x3941 == 0) #endif { field_0x392e = 1; @@ -200,7 +200,7 @@ void dFile_select_c::_move() { (this->*DataSelProc[field_0x392b])(); } - g_mDoMemCd_control.field_0x165A = 2; + g_mDoMemCd_control.mProbeStat = 2; #endif } @@ -3637,7 +3637,7 @@ int dFile_select_c::ExCardCheck() { return 1; } - if(dComIfGs_getNoFile() == 1) { + if(dComIfGs_getNewFile() == 1) { return 0; } @@ -3645,7 +3645,7 @@ int dFile_select_c::ExCardCheck() { return 2; } - if (dComIfGs_getNewFile()) { + if (dComIfGs_getNoFile()) { return 2; } diff --git a/src/d/d_flower.cpp b/src/d/d_flower.cpp index a8d21f14e5..81f1cad15b 100644 --- a/src/d/d_flower.cpp +++ b/src/d/d_flower.cpp @@ -5,94 +5,592 @@ #include "d/dolzel.h" // IWYU pragma: keep #include "d/d_flower.h" -#include "dolphin/types.h" +#include "f_op/f_op_overlap_mng.h" +#include "m_Do/m_Do_lib.h" +#include "SSystem/SComponent/c_counter.h" +#include "d/actor/d_a_player.h" + +#include "assets/l_Txq_bessou_hanaTEX.h" +const u16 l_Txq_bessou_hanaTEX__width = 0x40; +const u16 l_Txq_bessou_hanaTEX__height = 0x80; + +f32 l_pos3[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; +f32 l_texCoord3[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; + +#include "assets/l_QbsafDL.h" +#include "assets/l_QbsfwDL.h" + +#include "assets/l_Txo_ob_flower_white_64x64TEX.h" +const u16 l_Txo_ob_flower_white_64x64TEX__width = 0x40; +const u16 l_Txo_ob_flower_white_64x64TEX__height = 0x40; + +f32 l_pos[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; +f32 l_texCoord[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; + +#include "assets/l_OhanaDL.h" +#include "assets/l_Ohana_gutDL.h" + +#include "assets/l_Txo_ob_flower_pink_64x64TEX.h" +const u16 l_Txo_ob_flower_pink_64x64TEX__width = 0x40; +const u16 l_Txo_ob_flower_pink_64x64TEX__height = 0x40; +f32 l_pos2[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; +GXColor l_color2[] = { + {0xCC, 0xCC, 0xCC, 0xFF}, + {0x7F, 0x7F, 0x7F, 0xFF}, + {0xB2, 0xB2, 0xB2, 0xFF}, + {0xE5, 0xE5, 0xE5, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, +}; +f32 l_texCoord2[] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; + +#include "assets/l_Ohana_highDL.h" +#include "assets/l_Ohana_high_gutDL.h" + +#include "assets/l_matDL3.h" +l_matDL3(l_Txq_bessou_hanaTEX) + +#include "assets/l_matDL__d_flower.h" +l_matDL__d_flower(l_Txo_ob_flower_white_64x64TEX) + +#include "assets/l_matDL2.h" +l_matDL2(l_Txo_ob_flower_pink_64x64TEX) + +static bool l_CutSoundFlag = false; + +GXColor l_color3[] = { + {0xFF, 0xFF, 0xFF, 0xFF}, + {0x80, 0x80, 0x80, 0xFF}, +}; +static GXColor l_color[] = { + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xB2, 0xB2, 0xB2, 0xFF}, +}; /* 800BFA9C-800BFD28 .text WorkCo__14dFlower_data_cFP10fopAc_ac_cUli */ -void dFlower_data_c::WorkCo(fopAc_ac_c*, u32, int) { - /* Nonmatching */ +void dFlower_data_c::WorkCo(fopAc_ac_c* param_1, u32 param_2, int param_3) { + cXyz temp1; + temp1.x = field_0x04.x - param_1->current.pos.x; + temp1.z = field_0x04.z - param_1->current.pos.z; + f32 val = temp1.abs2XZ(); + + if(val > 900.0f) { + return; + } + + temp1.y = field_0x04.y - param_1->current.pos.y; + s16 angle = cM_atan2s(temp1.x, temp1.z); + f32 val2 = std::sqrtf(val); + + dFlower_anm_c* pAnm; + if(field_0x01 < 8) { + cXyz pos; + if(field_0x03 == 0 && !cLib_checkBit(field_0x00, 0x8) && param_1->speedF > 16.0f) { + pos.set(field_0x04.x, field_0x04.y + 20.0f, field_0x04.z); + + u16 particleID; + if(!cLib_checkBit(field_0x00, 0x20)) { + particleID = 0x3DE; + } + else if(!cLib_checkBit(field_0x00, 0x40)) { + particleID = 0x3DD; + } + else { + particleID = 0x82C6; + } + + dKy_tevstr_c* tevStr = dComIfGp_roomControl_getTevStr(param_3); + JPABaseEmitter* pEmtr = dComIfGp_particle_set(particleID, &pos, NULL, NULL, 0xFF, NULL, param_3, &tevStr->mColorK0, &tevStr->mColorK0); + if(pEmtr) { + f32 temp; + if(particleID == 0x82C6) { + temp = 3.0f; + } + else { + temp = 1.0f; + } + + pEmtr->setRate(temp); + field_0x03 = 0x10; + } + } + + int idx = dComIfGp_getFlower()->newAnm(); + if(idx < 0) { + return; + } + + field_0x01 = idx; + pAnm = dComIfGp_getFlower()->getAnm(field_0x01); + } + else { + pAnm = dComIfGp_getFlower()->getAnm(field_0x01); + } + + pAnm->field_0x02 = angle; + pAnm->field_0x04 = cM_atan2s(30.0f - val2, 40.0f); } /* 800BFD28-800C0018 .text WorkAt_NoCutAnim__14dFlower_data_cFP10fopAc_ac_cUliP15dCcMassS_HitInfP8cCcD_Obj */ -void dFlower_data_c::WorkAt_NoCutAnim(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*) { - /* Nonmatching */ +void dFlower_data_c::WorkAt_NoCutAnim(fopAc_ac_c* param_1, u32 param_2, int param_3, dCcMassS_HitInf* param_4, cCcD_Obj* param_5) { + dCcD_GObjInf* pObjInf = dCcD_GetGObjInf(param_5); + cXyz temp = *pObjInf->GetAtVecP(); + f32 val = temp.abs2XZ(); + f32 temp2; + if(std::abs(val) < G_CM3D_F_ABS_MIN && fopAcM_GetName(param_1) == fpcNm_PLAYER_e) { + temp.x = field_0x04.x - param_1->current.pos.x; + temp.y = field_0x04.y - param_1->current.pos.y; + temp.z = field_0x04.z - param_1->current.pos.z; + temp2 = temp.abs2XZ(); + } + + temp2 = temp.abs2XZ(); + s16 angle = cM_atan2s(temp.x, temp.z); + temp2 = std::sqrtf(temp2); + + dFlower_anm_c* pAnm; + if(field_0x01 < 8) { + cXyz pos; + if(field_0x03 == 0 && !cLib_checkBit(field_0x00, 0x8) && temp2 > 16.0f) { + pos.set(field_0x04.x, field_0x04.y + 20.0f, field_0x04.z); + + u16 particleID; + if(!cLib_checkBit(field_0x00, 0x20)) { + particleID = 0x3DE; + } + else if(!cLib_checkBit(field_0x00, 0x40)) { + particleID = 0x3DD; + } + else { + particleID = 0x82C6; + } + + dKy_tevstr_c* tevStr = dComIfGp_roomControl_getTevStr(param_3); + JPABaseEmitter* pEmtr = dComIfGp_particle_set(particleID, &pos, NULL, NULL, 0xFF, NULL, param_3, &tevStr->mColorK0, &tevStr->mColorK0); + if(pEmtr) { + f32 temp; + if(particleID == 0x82C6) { + temp = 3.0f; + } + else { + temp = 1.0f; + } + + pEmtr->setRate(temp); + field_0x03 = 0x10; + } + } + + int idx = dComIfGp_getFlower()->newAnm(); + if(idx < 0) { + return; + } + + field_0x01 = idx; + pAnm = dComIfGp_getFlower()->getAnm(field_0x01); + } + else { + pAnm = dComIfGp_getFlower()->getAnm(field_0x01); + } + + pAnm->field_0x02 = angle; + pAnm->field_0x04 = cM_atan2s(temp2, 40.0f); } /* 800C0018-800C0270 .text WorkAt__14dFlower_data_cFP10fopAc_ac_cUliP15dCcMassS_HitInf */ -void dFlower_data_c::WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*) { - /* Nonmatching */ +void dFlower_data_c::WorkAt(fopAc_ac_c* param_1, u32 param_2, int param_3, dCcMassS_HitInf* param_4) { + cCcD_Obj* pHitObj = param_4->GetAtHitObj(); + if(pHitObj && (pHitObj->ChkAtType(AT_TYPE_WIND) || pHitObj->ChkAtType(AT_TYPE_NORMAL_ARROW) || pHitObj->ChkAtType(AT_TYPE_FIRE_ARROW) || pHitObj->ChkAtType(AT_TYPE_ICE_ARROW) || pHitObj->ChkAtType(AT_TYPE_LIGHT_ARROW) || pHitObj->ChkAtType(AT_TYPE_HOOKSHOT))) { + WorkAt_NoCutAnim(param_1, param_2, param_3, param_4, pHitObj); + return; + } + + if(field_0x01 >= 8) { + dComIfGp_getFlower()->deleteAnm(field_0x01); + } + + cLib_onBit(field_0x00, 0x8); + + static csXyz ang(0, 0, 0); + + u16 particleID; + dKy_tevstr_c* tevStr = dComIfGp_roomControl_getTevStr(param_3); + cXyz temp2(field_0x04.x, field_0x04.y, field_0x04.z); + if(!cLib_checkBit(field_0x00, 0x20)) { + particleID = dPa_name::ID_IT_JN_FLOWER_W; + } + else if(!cLib_checkBit(field_0x00, 0x40)) { + particleID = dPa_name::ID_IT_JN_FLOWER_P; + } + else { + dComIfGp_particle_set(dPa_name::ID_IT_SN_FLOWER_OL00, &temp2, &ang, NULL, 0xFF, NULL, param_3, &tevStr->mColorK0, &tevStr->mColorK0); + particleID = dPa_name::ID_IT_SN_FLOWER_OF00; + } + + dComIfGp_particle_set(particleID, &temp2, &ang, NULL, 0xFF, NULL, param_3, &tevStr->mColorK0, &tevStr->mColorK0); + + if(field_0x02 >= 0) { + fopAcM_createItemFromTable(&field_0x04, field_0x02, -1, param_3, 0, NULL, 1); + } + + if(!l_CutSoundFlag) { + l_CutSoundFlag = true; + mDoAud_seStart(JA_SE_LK_CUT_GRASS, &field_0x04, 0, dComIfGp_getReverb(param_3)); + } } /* 800C0270-800C0430 .text hitCheck__14dFlower_data_cFP10fopAc_ac_ci */ -void dFlower_data_c::hitCheck(fopAc_ac_c*, int) { - /* Nonmatching */ +void dFlower_data_c::hitCheck(fopAc_ac_c* param_1, int param_2) { + dCcMassS_HitInf hitInf; + fopAc_ac_c* temp; + bool temp2 = false; + u32 ret = dComIfG_Ccsp()->ChkMass(&field_0x04, &temp, &hitInf); + temp2 = cLib_checkBit(ret, 1) && (temp && fopAcM_GetName(temp) != fpcNm_TSUBO_e && fopAcM_GetName(temp) != fpcNm_STONE_e); + + if(!cLib_checkBit(ret, 0x2) && !temp2) { + if(field_0x01 >= 8) { + dFlower_anm_c* pAnm = dComIfGp_getFlower()->getAnm(field_0x01); + s16 temp3 = pAnm->field_0x02 & 0xE000; + dFlower_anm_c* pAnm2 = dComIfGp_getFlower()->getAnm((pAnm->field_0x02 >> 0xD) & 0x7); + if(cLib_addCalcAngleS(&pAnm->field_0x04, pAnm2->field_0x04, 0x10, 0xFA0, 0x64) == 0) { + if(cLib_chaseAngleS(&pAnm->field_0x02, temp3, 0x320)) { + dComIfGp_getFlower()->deleteAnm(field_0x01); + field_0x01 = (pAnm->field_0x02 >> 0xD) & 0x7; + } + } + } + } + else { + if(cLib_checkBit(ret, 0x2)) { + WorkCo(temp, ret, param_2); + } + if(!cLib_checkBit(field_0x00, 0x8) && temp2) { + WorkAt(temp, ret, param_2, &hitInf); + } + } } /* 800C0430-800C0440 .text newData__14dFlower_room_cFP14dFlower_data_c */ -void dFlower_room_c::newData(dFlower_data_c*) { - /* Nonmatching */ +void dFlower_room_c::newData(dFlower_data_c* pData) { + pData->field_0x40 = field_0x0; + field_0x0 = pData; } /* 800C0440-800C04A4 .text deleteData__14dFlower_room_cFv */ void dFlower_room_c::deleteData() { - /* Nonmatching */ +#if VERSION == VERSION_DEMO + dFlower_data_c* r6 = field_0x0; + while(field_0x0) { + cLib_setBit(r6->field_0x00, 0); + field_0x0 = field_0x0->field_0x40; + } +#else + while(field_0x0) { + cLib_setBit(field_0x0->field_0x00, 0); + mDoAud_seDeleteObject(&field_0x0->field_0x04); + field_0x0 = field_0x0->field_0x40; + } +#endif } /* 800C04A4-800C05B8 .text __ct__16dFlower_packet_cFv */ dFlower_packet_c::dFlower_packet_c() { - /* Nonmatching */ + dFlower_data_c* pData = mData; + for(int i = 0; i < ARRAY_SIZE(mData); i++, pData++) { + cLib_setBit(pData->field_0x00, 0); + } + + dFlower_anm_c* pAnm = mAnm; + for(int i = 0; i < ARRAY_SIZE(mAnm); i++, pAnm++) { + pAnm->field_0x00 = 0; + } + + s16 angle = 0; + for(int i = 0; i < 8; i++, angle += 0x2000) { + setAnm(i, angle); + } } /* 800C05B8-800C05C4 .text __ct__14dFlower_room_cFv */ dFlower_room_c::dFlower_room_c() { - /* Nonmatching */ + field_0x0 = NULL; } /* 800C05C4-800C05D0 .text __ct__13dFlower_anm_cFv */ dFlower_anm_c::dFlower_anm_c() { - /* Nonmatching */ + field_0x00 = 0; } /* 800C05D0-800C05DC .text __ct__14dFlower_data_cFv */ dFlower_data_c::dFlower_data_c() { - /* Nonmatching */ + cLib_setBit(field_0x00, 0); } /* 800C05DC-800C0898 .text draw__16dFlower_packet_cFv */ void dFlower_packet_c::draw() { - /* Nonmatching */ +#if VERSION > VERSION_JPN + j3dSys.reinitGX(); + GXSetNumIndStages(0); +#endif + + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_INDEX8); + GXSetVtxDesc(GX_VA_CLR0, GX_INDEX8); + GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSetArray(GX_VA_POS, l_pos, 0xC); + GXSetArray(GX_VA_CLR0, l_color, 0x4); + GXSetArray(GX_VA_TEX0, l_texCoord, 0x8); + GXCallDisplayList(l_matDL, 0xA0); + + dFlower_room_c* pRoom = &mRoom[0]; + for(int i = 0; i < (s32)ARRAY_SIZE(mRoom); pRoom++, i++) { + dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(i); + GXSetTevColorS10(GX_TEVREG0, tevstr->mColorC0); + GXSetTevColor(GX_TEVREG1, tevstr->mColorK0); + dKy_GxFog_tevstr_set(tevstr); + + dFlower_data_c* pNext = pRoom->field_0x0; + while(pNext) { + if(!cLib_checkBit(pNext->field_0x00, 0x4) && !cLib_checkBit(pNext->field_0x00, 0x20)) { + GXLoadPosMtxImm(pNext->field_0x10, 0); + + if(!cLib_checkBit(pNext->field_0x00, 0x8)) { + GXCallDisplayList(l_OhanaDL, 0x100); + } + else { + GXCallDisplayList(l_Ohana_gutDL, 0xA0); + } + } + + pNext = pNext->field_0x40; + } + } + + GXSetArray(GX_VA_POS, field_0x4608, 0xC); + GXSetArray(GX_VA_CLR0, field_0x460c, 0x4); + GXSetArray(GX_VA_TEX0, field_0x4610, 0x8); + GXCallDisplayList(field_0x4614, field_0x4618); + + pRoom = &mRoom[0]; + for(int i = 0; i < (s32)ARRAY_SIZE(mRoom); pRoom++, i++) { + dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(i); + GXSetTevColorS10(GX_TEVREG0, tevstr->mColorC0); + GXSetTevColor(GX_TEVREG1, tevstr->mColorK0); + + dFlower_data_c* pNext = pRoom->field_0x0; + while(pNext) { + if(!cLib_checkBit(pNext->field_0x00, 0x4) && cLib_checkBit(pNext->field_0x00, 0x20)) { + GXLoadPosMtxImm(pNext->field_0x10, 0); + + if(!cLib_checkBit(pNext->field_0x00, 0x8)) { + GXCallDisplayList(field_0x461c, field_0x4620); + } + else { + GXCallDisplayList(field_0x4624, field_0x4628); + } + } + + pNext = pNext->field_0x40; + } + } + +#if VERSION > VERSION_JPN + J3DShape::resetVcdVatCache(); +#endif } /* 800C0898-800C0A88 .text calc__16dFlower_packet_cFv */ void dFlower_packet_c::calc() { - /* Nonmatching */ + dFlower_anm_c* pAnm = getAnm(); + for(int i = 0; i < 8; pAnm++, i++) { + pAnm->field_0x04 = cM_scos((g_Counter.mTimer + i * 0xFA) * 1000.0f) * 1000.0f + 1000.0f; + } + + int roomNo = dComIfGp_roomControl_getStayNo(); + dFlower_data_c* pData = mRoom[roomNo].field_0x0; + if(mRoom[roomNo].field_0x0) { + daPy_py_c* pPlayer = (daPy_py_c*)daPy_getPlayerActorClass(); + setPlayerCutFlg(pPlayer->getCutAtFlg()); + cXyz top = pPlayer->getSwordTopPos(); + cXyz temp = top - pPlayer->current.pos; + setPlayerSwordAngY(cM_atan2s(temp.x, temp.z)); + temp = getPlayerSwordTop() - top; + setPlayerSwordMoveAngY(cM_atan2s(temp.x, temp.z)); + setPlayerSwordTop(top); + + l_CutSoundFlag = false; + + dComIfG_Ccsp()->SetMassAttr(30.0f, 50.0f, 0xB, 0x2); + + do { + if(!cLib_checkBit(pData->field_0x00, 0x4)) { + pData->hitCheck(pPlayer, roomNo); + } + + pData = pData->field_0x40; + } while(pData); + } } /* 800C0A88-800C0D38 .text checkGroundY__FR4cXyz */ -static void checkGroundY(cXyz&) { - /* Nonmatching */ +static f32 checkGroundY(cXyz& pos) { + dBgS_GndChk gndChk; + + pos.y += 50.0f; + gndChk.SetPos(&pos); + f32 y = dComIfG_Bgsp()->GroundCross(&gndChk); + pos.y -= 50.0f; + + if(y <= -G_CM3D_F_INF) { + return pos.y; + } + + return y; } /* 800C0D38-800C0EF4 .text update__16dFlower_packet_cFv */ void dFlower_packet_c::update() { - /* Nonmatching */ + dFlower_anm_c* pAnm = getAnm(); + for(int i = 0; i < (s32)ARRAY_SIZE(mAnm); pAnm++, i++) { + mDoMtx_stack_c::YrotS(pAnm->field_0x02); + mDoMtx_stack_c::XrotM(pAnm->field_0x04); + mDoMtx_stack_c::YrotM(-pAnm->field_0x02); + mDoMtx_copy(mDoMtx_stack_c::get(), pAnm->mMtx); + } + + dFlower_data_c* pData = getData(); + pAnm = getAnm(); + int j = 0; + for(int i = 0; i < (s32)ARRAY_SIZE(mData); i++, pData++) { + if(cLib_checkBit(pData->field_0x00, 0x2)) { + cLib_calcTimer(&pData->field_0x03); + + if(cLib_checkBit(pData->field_0x00, 0x10) && j < 8) { + pData->field_0x04.y = checkGroundY(pData->field_0x04); + cLib_offBit(pData->field_0x00, 0x10); + j++; + } + + cXyz temp(pData->field_0x04.x, pData->field_0x04.y + 260.0f, pData->field_0x04.z); + if(mDoLib_clipper::clip(j3dSys.getViewMtx(), temp, 260.0f)) { + cLib_onBit(pData->field_0x00, 0x4); + } + else { + cLib_offBit(pData->field_0x00, 0x4); + MtxP pMtx = pAnm[pData->field_0x01].mMtx; + pMtx[0][3] = pData->field_0x04.x; + pMtx[1][3] = pData->field_0x04.y; + pMtx[2][3] = pData->field_0x04.z; + mDoMtx_concat(j3dSys.getViewMtx(), pMtx, pData->field_0x10); + } + } + } + + j3dSys.getDrawBuffer(0)->entryImm(this, 0); } /* 800C0EF4-800C10D4 .text setData__16dFlower_packet_cFP14dFlower_data_ciScR4cXyziSc */ -void dFlower_packet_c::setData(dFlower_data_c*, int, s8, cXyz&, int, s8) { - /* Nonmatching */ +void dFlower_packet_c::setData(dFlower_data_c* param_1, int param_2, s8 param_3, cXyz& param_4, int param_5, s8 param_6) { + f32 temp; + if(fopOvlpM_IsPeek()) { + temp = checkGroundY(param_4); + cLib_setBit(param_1->field_0x00, 0x6); + } + else { + temp = param_4.y; + cLib_setBit(param_1->field_0x00, 0x16); + } + + if(param_3 == 2) { + cLib_onBit(param_1->field_0x00, 0x20); + } + + param_1->field_0x01 = cM_rndF(7.0f); + + param_1->field_0x04.set(param_4.x, temp, param_4.z); + param_1->field_0x02 = param_6; + param_1->field_0x03 = 0; + + if(mRoom[param_5].field_0x0 == NULL) { + if(strcmp(dComIfGp_getStartStageName(), "sea") == 0 && param_5 == 0x21) { + field_0x4608 = l_pos3; + field_0x460c = l_color3; + field_0x4610 = l_texCoord3; + field_0x4614 = l_matDL3; + field_0x4618 = 0xA0; + field_0x461c = l_QbsfwDL; + field_0x4620 = 0x660; + field_0x4624 = l_QbsafDL; + field_0x4628 = 0x80; + } + else { + field_0x4608 = l_pos2; + field_0x460c = l_color2; + field_0x4610 = l_texCoord2; + field_0x4614 = l_matDL2; + field_0x4618 = 0xA0; + field_0x461c = l_Ohana_highDL; + field_0x4620 = 0x120; + field_0x4624 = l_Ohana_high_gutDL; + field_0x4628 = 0x80; + } + } + + if(field_0x461c == l_QbsfwDL) { + cLib_onBit(param_1->field_0x00, 0x40); + } + + mRoom[param_5].newData(param_1); + + field_0x0010 = param_2; } /* 800C10D4-800C121C .text newData__16dFlower_packet_cFScR4cXyziSc */ -void dFlower_packet_c::newData(s8, cXyz&, int, s8) { - /* Nonmatching */ +dFlower_data_c* dFlower_packet_c::newData(s8 param_1, cXyz& param_2, int i_roomNo, s8 param_4) { + JUT_ASSERT(VERSION_SELECT(2927, 2928, 2934, 2934), 0 <= i_roomNo && i_roomNo < 64); + + dFlower_data_c* pData = &mData[field_0x0010]; + for(int i = field_0x0010; i < (s32)ARRAY_SIZE(mData); pData++, i++) { + if(!cLib_checkBit(pData->field_0x00, 0x2)) { + setData(pData, i, param_1, param_2, i_roomNo, param_4); + return pData; + } + } + + pData = getData(); + for(int i = 0; i < field_0x0010; pData++, i++) { + if(!cLib_checkBit(pData->field_0x00, 0x2)) { + setData(pData, i, param_1, param_2, i_roomNo, param_4); + return pData; + } + } + + return NULL; } /* 800C121C-800C1264 .text newAnm__16dFlower_packet_cFv */ -void dFlower_packet_c::newAnm() { - /* Nonmatching */ +int dFlower_packet_c::newAnm() { + dFlower_anm_c* pAnm = &mAnm[8]; + for(int i = 8; i < ARRAY_SIZE(mAnm); pAnm++, i++) { + if(pAnm->field_0x00 == 0) { + pAnm->field_0x00 = 1; + pAnm->field_0x02 = 0; + pAnm->field_0x04 = 0; + + return i; + } + } + + return -1; } /* 800C1264-800C1288 .text setAnm__16dFlower_packet_cFis */ -void dFlower_packet_c::setAnm(int, s16) { - /* Nonmatching */ +void dFlower_packet_c::setAnm(int param_1, s16 angle) { + dFlower_anm_c* anm = getAnm(param_1); + + anm->field_0x00 = 1; + anm->field_0x02 = angle; + anm->field_0x04 = 0; } diff --git a/src/d/d_menu_save.cpp b/src/d/d_menu_save.cpp index 28428222ac..9885120c32 100644 --- a/src/d/d_menu_save.cpp +++ b/src/d/d_menu_save.cpp @@ -1,423 +1,1900 @@ -// -// Generated by dtk -// Translation Unit: d_menu_save.cpp -// - #include "d/dolzel.h" // IWYU pragma: keep #include "d/d_menu_save.h" -#include "dolphin/types.h" +#include "d/d_file_error.h" +#include "d/d_meter.h" +#include "m_Do/m_Do_Reset.h" +#include "m_Do/m_Do_MemCard.h" +#include "m_Do/m_Do_controller_pad.h" /* 801D5DB8-801D5E8C .text __ct__9dMs_HIO_cFv */ dMs_HIO_c::dMs_HIO_c() { - /* Nonmatching */ -} + field_0x5 = 5; + field_0x6 = 0; + field_0x7 = 0; + field_0x8 = 5; + field_0xc = -500; + field_0xe = 200; + field_0x9 = 0; + field_0xa = 0; + field_0xb = 3; + field_0x10 = 5; + field_0x11 = 8; + field_0x12 = 5; + field_0x13 = 0; + field_0x14 = -100; + field_0x16 = 150; + field_0x18 = 5; + field_0x19 = 8; + field_0x1a = 5; + field_0x1b = 6; + field_0x1c = 2; + field_0x1e = 200; + field_0x20 = 12; + field_0x21 = 140; + field_0x22 = 70; + field_0x23 = 6; + field_0x24 = 8; + field_0x25 = 0; + field_0x26 = 3; + field_0x28 = 90; + field_0x29 = 10; + field_0x2a = 0; + field_0x2c = -60; + field_0x2e = 0; +} + +dMs_HIO_c g_msHIO; /* 801D5E8C-801D6140 .text _create__12dMenu_save_cFv */ void dMenu_save_c::_create() { - /* Nonmatching */ -} + MenuSave.Scr = new J2DScreen(); + JUT_ASSERT(VERSION_SELECT(165, 165, 165, 165), MenuSave.Scr != NULL); + + stick = new STControl(5, 2, 3, 2); + JUT_ASSERT(VERSION_SELECT(170, 170, 170, 170), stick != NULL); + + archive = dComIfGp_getSaveResArchive(); + JUT_ASSERT(VERSION_SELECT(174, 174, 174, 174), archive != NULL); + + MenuSave.Scr->set("menu_save.blo", archive); + + MenuSave.font = mDoExt_getMesgFont(); + JUT_ASSERT(VERSION_SELECT(180, 180, 180, 180), MenuSave.font != NULL); + + dFe_c = new dFile_error_c(); + JUT_ASSERT(VERSION_SELECT(184, 184, 184, 184), dFe_c != NULL); + dFe_c->_create(); + + g_msHIO.id = mDoHIO_createChild("セーブ画面", &g_msHIO); + + screenSet(); + displayInit(); + paneTransInit(); +} + +typedef void (dMenu_save_c::*menuProcFunc)(); +menuProcFunc MenuSaveProc[] = { + &dMenu_save_c::saveQuestion, + &dMenu_save_c::memCardCheck, + &dMenu_save_c::openSaveMenu, + &dMenu_save_c::closeSaveMenu, + &dMenu_save_c::memCardErrMsgWaitKey, + &dMenu_save_c::memCardErrMsgWaitKey2, + &dMenu_save_c::memCardErrMsgWaitKey3, + &dMenu_save_c::memCardErrGoIPLSel, + &dMenu_save_c::memCardErrGoIPLSel2, + &dMenu_save_c::memCardErrMsgWaitFormatSel, + &dMenu_save_c::memCardErrMsgWaitFormatSel2, + &dMenu_save_c::memCardFormat, + &dMenu_save_c::memCardFormatCheck, + &dMenu_save_c::memCardMakeGameFileSel, + &dMenu_save_c::memCardMakeGameFile, + &dMenu_save_c::memCardMakeGameFileCheck, + &dMenu_save_c::memCardDataLoadWait, + &dMenu_save_c::memCardDataLoadWait2, + &dMenu_save_c::memCardDataSave, + &dMenu_save_c::memCardDataSaveUpMenu, + &dMenu_save_c::memCardDataSaveSel, + &dMenu_save_c::memCardDataSaveDownMenu, + &dMenu_save_c::memCardDataSaveWait, + &dMenu_save_c::msgWait, + &dMenu_save_c::msgWait2, + &dMenu_save_c::saveEndWait, + &dMenu_save_c::saveWait, + &dMenu_save_c::canNotSave, + &dMenu_save_c::canNotSave2, + &dMenu_save_c::gameContinue, + &dMenu_save_c::gameContinue2, + &dMenu_save_c::gameContinue3, +#if VERSION >= VERSION_JPN + &dMenu_save_c::gameContinue4, +#endif + &dMenu_save_c::endingNoSave, + &dMenu_save_c::endingNoSave2, + &dMenu_save_c::endingNoSave3, + &dMenu_save_c::endingDataCheck, + &dMenu_save_c::noSave, + &dMenu_save_c::noSave2, +}; /* 801D6140-801D6174 .text initialize__12dMenu_save_cFv */ void dMenu_save_c::initialize() { - /* Nonmatching */ + displayInit(); + paneTransInit(); } /* 801D6174-801D61A0 .text _open__12dMenu_save_cFv */ bool dMenu_save_c::_open() { - /* Nonmatching */ + return openNormal(); } /* 801D61A0-801D62CC .text openNormal__12dMenu_save_cFv */ -void dMenu_save_c::openNormal() { - /* Nonmatching */ +BOOL dMenu_save_c::openNormal() { + BOOL rt; + switch (useType) { + case 1: + rt = openForCollect(); + break; + case 0: + rt = openForItem(); + break; + case 2: + rt = openForGameover(); + break; + case 3: + if (field_0x53c != 0) { + if (field_0x53d == 2) { + rt = openForEnding2(); + } else { + rt = TRUE; + } + } else { + rt = openForEnding(); + } + break; + } + + field_0x544++; + if (rt == TRUE) { + field_0x544 = 0; + field_0x394.pane->show(); + + if (useType == 3) { + if (field_0x53c != 0) { + if (field_0x53d == 2) { + field_0x53a = 0; + field_0x535 = 1; + proc = PROC_CAN_NOT_SAVE; + } else { + field_0x53a = 1; + proc = PROC_MEMCARD_CHECK; + } + } else { + field_0x53a = 0; + proc = PROC_SAVE_QUESTION; + } + } else { + field_0x53a = 0; + proc = PROC_SAVE_QUESTION; + } + + saveStatus = 2; + return TRUE; + } + + return FALSE; } /* 801D62CC-801D62F8 .text _close__12dMenu_save_cFv */ bool dMenu_save_c::_close() { - /* Nonmatching */ + return closeNormal(); } /* 801D62F8-801D63A4 .text closeNormal__12dMenu_save_cFv */ -void dMenu_save_c::closeNormal() { - /* Nonmatching */ +BOOL dMenu_save_c::closeNormal() { + BOOL rt; + switch (useType) { + case 1: + rt = closeForCollect(); + break; + case 0: + rt = closeForItem(); + break; + case 2: + rt = closeForGameover(); + break; + case 3: + rt = closeForEnding(); + break; + } + + field_0x544++; + if (rt == TRUE) { + proc = PROC_SAVE_WAIT; + saveStatus = 0; + field_0x544 = 0; + field_0x53a = 1; + return TRUE; + } + + return FALSE; } /* 801D63A4-801D65C0 .text openForCollect__12dMenu_save_cFv */ -void dMenu_save_c::openForCollect() { - /* Nonmatching */ +BOOL dMenu_save_c::openForCollect() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_IN, NULL); + } + + dMenu_setPushMenuButton(0); + + BOOL var_r29 = FALSE; + BOOL alphaMask_rt = PaneAlphaMask(field_0x544 - g_msHIO.field_0x6, g_msHIO.field_0x5, 1, 0); + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 40.0f, 1, 0); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8), g_msHIO.field_0x8, 40.0f, 0.0f, 4, 2); + } + BOOL alphaWipe_rt = PaneScaleAlphaWipe(field_0x544 - g_msHIO.field_0x24, g_msHIO.field_0x23, g_msHIO.field_0x26, 1, 0); + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + BOOL menu_rt = menuUp(); + + if (alphaMask_rt == TRUE + && base_rt == TRUE + && var_r29 == TRUE + && alphaWipe_rt == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D65C0-801D67DC .text openForItem__12dMenu_save_cFv */ -void dMenu_save_c::openForItem() { - /* Nonmatching */ +BOOL dMenu_save_c::openForItem() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_IN, NULL); + } + + dMenu_setPushMenuButton(0); + + BOOL var_r29 = FALSE; + BOOL alphaMask_rt = PaneAlphaMask(field_0x544 - g_msHIO.field_0x6, g_msHIO.field_0x5, 1, 0); + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 40.0f, 1, 0); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8), g_msHIO.field_0x8, 40.0f, 0.0f, 4, 2); + } + BOOL alphaWipe_rt = PaneScaleAlphaWipe(field_0x544 - g_msHIO.field_0x24, g_msHIO.field_0x23, g_msHIO.field_0x26, 1, 0); + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + BOOL menu_rt = menuUp(); + + if (alphaMask_rt == TRUE + && base_rt == TRUE + && var_r29 == TRUE + && alphaWipe_rt == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D67DC-801D69F8 .text closeForCollect__12dMenu_save_cFv */ -void dMenu_save_c::closeForCollect() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForCollect() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_OUT, NULL); + } + + BOOL var_r29 = FALSE; + dMenu_setPushMenuButton(2); + + BOOL alphaMask_rt = PaneAlphaMask(field_0x544 - g_msHIO.field_0x7, g_msHIO.field_0x5, 0, 1); + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0xa, g_msHIO.field_0x8, 0.0f, 40.0f, 4, 2); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0xa + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, g_msHIO.field_0xc, 0, 1); + } + BOOL alphaWipe_rt = PaneScaleAlphaWipe(field_0x544 - g_msHIO.field_0x25, g_msHIO.field_0x23, 1.0f, 0, 1); + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x12, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x14, 0, 1); + BOOL menu_rt; + if (field_0x535 != 0) { + menu_rt = TRUE; + } else { + menu_rt = menuDown(); + } + + if (alphaMask_rt == TRUE + && base_rt == TRUE + && var_r29 == TRUE + && alphaWipe_rt == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D69F8-801D6C14 .text closeForItem__12dMenu_save_cFv */ -void dMenu_save_c::closeForItem() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForItem() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_OUT, NULL); + } + + BOOL var_r29 = FALSE; + dMenu_setPushMenuButton(1); + + BOOL alphaMask_rt = PaneAlphaMask(field_0x544 - g_msHIO.field_0x7, g_msHIO.field_0x5, 0, 1); + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0xa, g_msHIO.field_0x8, 0.0f, 40.0f, 4, 2); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0xa + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, g_msHIO.field_0xc, 0, 1); + } + BOOL alphaWipe_rt = PaneScaleAlphaWipe(field_0x544 - g_msHIO.field_0x25, g_msHIO.field_0x23, 1.0f, 0, 1); + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x12, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x14, 0, 1); + BOOL menu_rt; + if (field_0x535 != 0) { + menu_rt = TRUE; + } else { + menu_rt = menuDown(); + } + + if (alphaMask_rt == TRUE + && base_rt == TRUE + && var_r29 == TRUE + && alphaWipe_rt == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D6C14-801D6E68 .text openForGameover__12dMenu_save_cFv */ -void dMenu_save_c::openForGameover() { - /* Nonmatching */ +BOOL dMenu_save_c::openForGameover() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_IN, NULL); + } + + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 0.0f, 1, 0); + + s16 temp_r0 = field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8 - 2); + if (temp_r0 == 0 && field_0x539) { + for (int i = 0; i < 4; i++) { + static const f32 x[] = {-180.0f, -70.0f, 70.0f, 180.0f}; + + cXyz pos(x[i], 170.0f, 0.0f); + dComIfGp_particle_set2DmenuFore(0x2E, &pos); + } + + field_0x539 = 0; + } + + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, -20.0f, 5, 2); + } + + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + BOOL menu_rt = menuUp(); + + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D6E68-801D6EAC .text closeForGameover__12dMenu_save_cFv */ -void dMenu_save_c::closeForGameover() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForGameover() { + switch (endStatus) { + case 1: return closeForGameover_1(); + case 0: return closeForGameover_2(); + } } /* 801D6EAC-801D704C .text closeForGameover_1__12dMenu_save_cFv */ -void dMenu_save_c::closeForGameover_1() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForGameover_1() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_OUT, NULL); + } + + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0xa, g_msHIO.field_0x8, 0.0f, 40.0f, 4, 2); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0xa + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, g_msHIO.field_0xc, 0, 1); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x12, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x14, 0, 1); + BOOL menu_rt; + if (field_0x535 != 0) { + menu_rt = TRUE; + } else { + menu_rt = menuDown(); + } + + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D704C-801D755C .text closeForGameover_2__12dMenu_save_cFv */ -void dMenu_save_c::closeForGameover_2() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForGameover_2() { + BOOL var_r28 = FALSE; + BOOL var_r27 = FALSE; + BOOL var_r26 = FALSE; + BOOL var_r25 = FALSE; + + BOOL var_r23 = PaneTranceTitle(field_0x544 - g_msHIO.field_0x13, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x2c, 1, 2); + PaneRotate(field_0x544 - g_msHIO.field_0x13, g_msHIO.field_0x10, &field_0x324, 73.5f, field_0x324.mSizeOrig.y / 2, 7.0f, 0); + if (var_r23 == TRUE) { + var_r28 = PaneTranceTitle(field_0x544 - (g_msHIO.field_0x13 + g_msHIO.field_0x10), g_msHIO.field_0x10, g_msHIO.field_0x2c, g_msHIO.field_0x16, 0, 1); + } + + var_r23 = PaneTranceBase(field_0x544 - g_msHIO.field_0xb, g_msHIO.field_0x8, 0.0f, g_msHIO.field_0x2c, 1, 2); + PaneRotate(field_0x544 - g_msHIO.field_0xb, g_msHIO.field_0x10, &field_0x20c[0], 257.0f, 0.0f, -7.0f, 0); + if (var_r23 == TRUE) { + var_r27 = PaneTranceBase(field_0x544 - (g_msHIO.field_0xb + g_msHIO.field_0x8), g_msHIO.field_0x8, g_msHIO.field_0x2c, g_msHIO.field_0xe, 0, 1); + } + + var_r23 = PaneTranceMenu(field_0x544 - g_msHIO.field_0x1b, g_msHIO.field_0x18, &field_0x3cc, 0.0f, g_msHIO.field_0x2c, 1, 2); + PaneRotate(field_0x544 - g_msHIO.field_0x1b, g_msHIO.field_0x10, &field_0x3cc, 30.0f, 32.0f, -7.0f, 0); + if (var_r23 == TRUE) { + var_r26 = PaneTranceMenu(field_0x544 - (g_msHIO.field_0x1b + g_msHIO.field_0x18), g_msHIO.field_0x18, &field_0x3cc, g_msHIO.field_0x2c, g_msHIO.field_0x1e, 0, 1); + } + + var_r23 = PaneTranceMenu(field_0x544 - (g_msHIO.field_0x1b + g_msHIO.field_0x1c), g_msHIO.field_0x18, &field_0x474, 0.0f, g_msHIO.field_0x2c, 1, 2); + PaneRotate(field_0x544 - (g_msHIO.field_0x1b + g_msHIO.field_0x1c), g_msHIO.field_0x10, &field_0x474, 30.0f, 32.0f, 7.0f, 0); + if (var_r23 == TRUE) { + var_r25 = PaneTranceMenu(field_0x544 - (g_msHIO.field_0x1b + g_msHIO.field_0x1c + g_msHIO.field_0x18), g_msHIO.field_0x18, &field_0x474, g_msHIO.field_0x2c, g_msHIO.field_0x1e, 0, 1); + } + + if (var_r28 == TRUE + && var_r27 == TRUE + && var_r26 == TRUE + && var_r25 == TRUE) + { + PaneRotate(0, g_msHIO.field_0x10, &field_0x324, 73.5f, field_0x324.mSizeOrig.y / 2, 0.0f, 0); + PaneRotate(0, g_msHIO.field_0x10, &field_0x20c[0], 250.5f, 0.0f, 0.0f, 0); + PaneRotate(0, g_msHIO.field_0x10, &field_0x3cc, 30.0f, 32.0f, 0.0f, 0); + PaneRotate(0, g_msHIO.field_0x10, &field_0x474, 30.0f, 32.0f, 0.0f, 0); + return TRUE; + } + + return FALSE; } /* 801D755C-801D76E0 .text openForEnding__12dMenu_save_cFv */ -void dMenu_save_c::openForEnding() { - /* Nonmatching */ +BOOL dMenu_save_c::openForEnding() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_IN, NULL); + } + + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 0.0f, 1, 0); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, -20.0f, 5, 2); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + BOOL menu_rt = menuUp(); + + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D76E0-801D7850 .text openForEnding2__12dMenu_save_cFv */ -void dMenu_save_c::openForEnding2() { - /* Nonmatching */ +BOOL dMenu_save_c::openForEnding2() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_IN, NULL); + } + + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 0.0f, 1, 0); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0x9 + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, -20.0f, 5, 2); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D7850-801D79F0 .text closeForEnding__12dMenu_save_cFv */ -void dMenu_save_c::closeForEnding() { - /* Nonmatching */ +BOOL dMenu_save_c::closeForEnding() { + if (field_0x544 == 0) { + mDoAud_seStart(JA_SE_SAVE_PANEL_OUT, NULL); + } + + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0xa, g_msHIO.field_0x8, 0.0f, 40.0f, 4, 2); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase(field_0x544 - (g_msHIO.field_0xa + g_msHIO.field_0x8), g_msHIO.field_0x8, 0.0f, g_msHIO.field_0xc, 0, 1); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x12, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x14, 0, 1); + BOOL menu_rt; + if (field_0x535 != 0) { + menu_rt = TRUE; + } else { + menu_rt = menuDown(); + } + + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + return TRUE; + } + + return FALSE; } /* 801D79F0-801D7A9C .text _delete__12dMenu_save_cFv */ void dMenu_save_c::_delete() { - /* Nonmatching */ + delete MenuSave.Scr; + mDoExt_removeMesgFont(); + delete stick; + dFe_c->_delete(); + delete dFe_c; + archive->removeResourceAll(); + mDoHIO_deleteChild(g_msHIO.id); } /* 801D7A9C-801D7B68 .text _move__12dMenu_save_cFv */ void dMenu_save_c::_move() { - /* Nonmatching */ +#if VERSION > VERSION_DEMO + if (!mDoRst::isReset()) +#endif + { + if ((mDoMemCd_getProbeStat() == 0 || mDoMemCd_getProbeStat() == 1) +#if VERSION > VERSION_DEMO + && !mDoRst::isReset() +#endif + ) + { + if (field_0x53b == 0 && dFe_c->getStatus() == 1) { + dFe_c->closeMessage(); + field_0x533 = 0xFF; + field_0x52d = PROC_MEMCARD_CHECK; + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY3; + } + mDoMemCd_clearProbeStat(); + } + + dFe_c->_move(); + (this->*MenuSaveProc[proc])(); + } } /* 801D7B68-801D7BB8 .text noSave__12dMenu_save_cFv */ void dMenu_save_c::noSave() { - /* Nonmatching */ + field_0x533 = 0xFF; + dFe_c->setErrMessage(0x65, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY3; + field_0x52d = PROC_NO_SAVE2; } /* 801D7BB8-801D7BCC .text noSave2__12dMenu_save_cFv */ void dMenu_save_c::noSave2() { - /* Nonmatching */ + proc = PROC_SAVE_WAIT; + saveStatus = 3; } /* 801D7BCC-801D7CE8 .text saveQuestion__12dMenu_save_cFv */ void dMenu_save_c::saveQuestion() { - /* Nonmatching */ + BOOL temp_r3; + if (useType == 2 || useType == 3) { + temp_r3 = YesNoSelect2(0); + } else { + temp_r3 = YesNoSelect(0); + } + + if (temp_r3) { + if (field_0x52f == 0) { + *field_0x51c[field_0x536 ^ 1] = 0; + proc = PROC_MEMCARD_CHECK; + } else if (field_0x52f == 2) { + proc = PROC_SAVE_WAIT; + saveStatus = 3; + } else { + field_0x544 = 0; + switch (useType) { + case 0: + case 1: + case 2: + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x40); + proc = PROC_GAME_CONTINUE; + break; + case 3: + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x4D); + proc = PROC_ENDING_NO_SAVE; + break; + } + } + } } /* 801D7CE8-801D7E30 .text memCardCheck__12dMenu_save_cFv */ void dMenu_save_c::memCardCheck() { - /* Nonmatching */ + switch (mDoMemCd_getStatus(0)) { + case mDoMemCd_Ctrl_c::CARD_STAT_WAIT: + field_0x532 = 0x29; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + break; + case 8: + field_0x532 = 0x2A; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + break; + case 9: + field_0x532 = 0x2B; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + break; + case mDoMemCd_Ctrl_c::CARD_STAT_WRONG_DEVICE: + field_0x532 = 0x2C; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + break; + case mDoMemCd_Ctrl_c::CARD_STAT_ENCODING: + case mDoMemCd_Ctrl_c::CARD_STAT_ERROR: + field_0x532 = 0x2d; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_FORMAT; + break; + case 11: + case mDoMemCd_Ctrl_c::CARD_STAT_IOERROR: + field_0x532 = 0x2E; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_ERR_MSG_WAIT_KEY2; + field_0x533 = 0x62; + field_0x52e = 7; + break; + case mDoMemCd_Ctrl_c::CARD_STAT_CREATE: + mDoMemCd_setPictDataPtr(NULL); + mDoMemCd_Load(); + proc = PROC_MEMCARD_DATA_LOAD_WAIT; + break; + case mDoMemCd_Ctrl_c::CARD_STAT_RESTORE: + field_0x532 = 0x34; + proc = PROC_CLOSE_SAVE_MENU; + field_0x52d = PROC_MEMCARD_MAKE_GAME_FILE_SEL; + break; + } } /* 801D7E30-801D7E88 .text openSaveMenu__12dMenu_save_cFv */ void dMenu_save_c::openSaveMenu() { - /* Nonmatching */ + if (openSave() == TRUE) { + field_0x53a = 0; + field_0x394.pane->show(); + CursorAlphaInit(); + proc = PROC_SAVE_QUESTION; + } } /* 801D7E88-801D7F30 .text closeSaveMenu__12dMenu_save_cFv */ void dMenu_save_c::closeSaveMenu() { - /* Nonmatching */ + BOOL rt; + if (field_0x53a == 1) { + rt = TRUE; + } else { + rt = closeSave(); + } + + if (rt == TRUE) { + field_0x53a = 1; + if (useType == 3) { + fopMsgM_messageGet(field_0x51c[field_0x536], 0x4C); + } else { + fopMsgM_messageGet(field_0x51c[field_0x536], 0x39); + } + + dFe_c->setErrMessage(field_0x532, 0); + proc = field_0x52d; + } } /* 801D7F30-801D7F4C .text memCardErrMsgWaitKey__12dMenu_save_cFv */ void dMenu_save_c::memCardErrMsgWaitKey() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + proc = PROC_OPEN_SAVE_MENU; + } } /* 801D7F4C-801D7FC0 .text memCardErrMsgWaitKey2__12dMenu_save_cFv */ void dMenu_save_c::memCardErrMsgWaitKey2() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (field_0x533 != 0xFF) { + dFe_c->setErrMessage(field_0x533, 0); + field_0x533 = 0xFF; + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY2; + } else { + dFe_c->setErrMessage(99, 0); + proc = field_0x52e; + } + } } /* 801D7FC0-801D801C .text memCardErrMsgWaitKey3__12dMenu_save_cFv */ void dMenu_save_c::memCardErrMsgWaitKey3() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (field_0x533 != 0xFF) { + dFe_c->setErrMessage(field_0x533, 0); + field_0x533 = 0xFF; + } + + proc = field_0x52d; + } } /* 801D801C-801D8084 .text memCardErrGoIPLSel__12dMenu_save_cFv */ void dMenu_save_c::memCardErrGoIPLSel() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (dFe_c->getYesNo() != 0) { + dFe_c->setErrMessage(100, 0); + proc = PROC_MEMCARD_ERR_GO_IPL_SEL2; + } else { + proc = PROC_OPEN_SAVE_MENU; + } + } } /* 801D8084-801D80DC .text memCardErrGoIPLSel2__12dMenu_save_cFv */ void dMenu_save_c::memCardErrGoIPLSel2() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (dFe_c->getYesNo() != 0) { + OSResetSystem(1, 1, TRUE); + } else { + proc = PROC_OPEN_SAVE_MENU; + } + } } /* 801D80DC-801D8150 .text memCardErrMsgWaitFormatSel__12dMenu_save_cFv */ void dMenu_save_c::memCardErrMsgWaitFormatSel() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (dFe_c->getYesNo() != 0) { + dFe_c->setErrMessage(0x30, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_FORMAT_SEL; + } else { + dFe_c->setErrMessage(0x2F, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + } + } } /* 801D8150-801D81DC .text memCardErrMsgWaitFormatSel2__12dMenu_save_cFv */ void dMenu_save_c::memCardErrMsgWaitFormatSel2() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (dFe_c->getYesNo() != 0) { + mDoMemCd_Format(); + dFe_c->setErrMessage(0x31, 1); + proc = PROC_MEMCARD_ERR_MSG_WAIT_FORMAT_SEL2; + field_0x53b = 1; + } else { + dFe_c->setErrMessage(0x2F, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + } + } } /* 801D81DC-801D8230 .text memCardFormat__12dMenu_save_cFv */ void dMenu_save_c::memCardFormat() { - /* Nonmatching */ + field_0x540 = mDoMemCd_FormatSync(); + if (field_0x540 != 0) { + dFe_c->closeMessage(); + proc = PROC_MEMCARD_FORMAT_CHECK; + } } /* 801D8230-801D82C8 .text memCardFormatCheck__12dMenu_save_cFv */ void dMenu_save_c::memCardFormatCheck() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (field_0x540 == 2) { + dFe_c->setErrMessage(0x33, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY3; + field_0x52d = PROC_MEMCARD_CHECK; + } else if (field_0x540 == 1) { + dFe_c->setErrMessage(0x32, 0); + dFe_c->setTimeCountDownMode(); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY3; + field_0x52d = PROC_MEMCARD_CHECK; + } + + field_0x53b = 0; + } } /* 801D82C8-801D83C0 .text memCardMakeGameFileSel__12dMenu_save_cFv */ void dMenu_save_c::memCardMakeGameFileSel() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (dFe_c->getYesNo() != 0) { + dComIfGs_setInitDataToCard(dataBuf, 0); + mDoMemCdRWm_SetCheckSumGameData(dataBuf, 0); + + dComIfGs_setInitDataToCard(dataBuf, 1); + mDoMemCdRWm_SetCheckSumGameData(dataBuf, 1); + + dComIfGs_setInitDataToCard(dataBuf, 2); + mDoMemCdRWm_SetCheckSumGameData(dataBuf, 2); + + mDoMemCd_Save(dataBuf, sizeof(dataBuf), 0); + + dFe_c->setErrMessage(0x36, 1); + proc = PROC_MEMCARD_MAKE_GAME_FILE; + field_0x53b = 1; + } else { + dFe_c->setErrMessage(0x35, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + } + } } /* 801D83C0-801D8414 .text memCardMakeGameFile__12dMenu_save_cFv */ void dMenu_save_c::memCardMakeGameFile() { - /* Nonmatching */ + field_0x540 = mDoMemCd_SaveSync(); + if (field_0x540 != 0) { + dFe_c->closeMessage(); + proc = PROC_MEMCARD_MAKE_GAME_FILE_CHECK; + } } /* 801D8414-801D84AC .text memCardMakeGameFileCheck__12dMenu_save_cFv */ void dMenu_save_c::memCardMakeGameFileCheck() { - /* Nonmatching */ + if (dFe_c->getStatus() == 2) { + if (field_0x540 == 2) { + dFe_c->setErrMessage(0x37, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY3; + field_0x52d = PROC_MEMCARD_CHECK; + } else if (field_0x540 == 1) { + dComIfGs_setNewFile(1); + dFe_c->setErrMessage(0x38, 0); + proc = PROC_MEMCARD_ERR_MSG_WAIT_KEY; + } + + field_0x53b = 0; + } } /* 801D84AC-801D8548 .text memCardDataLoadWait__12dMenu_save_cFv */ void dMenu_save_c::memCardDataLoadWait() { - /* Nonmatching */ + int rt = mDoMemCd_LoadSync(dataBuf, sizeof(dataBuf), 0); + if (rt == 0) + return; + + if (rt == 2) { + proc = PROC_MEMCARD_CHECK; + } else if (rt == 1) { + if (field_0x53a == 1) { + proc = PROC_OPEN_SAVE_MENU; + } else if (useType == 3) { + proc = PROC_ENDING_DATA_CHECK; + } else { + proc = PROC_MEMCARD_DATA_LOAT_WAIT2; + } + } } /* 801D8548-801D85D8 .text memCardDataLoadWait2__12dMenu_save_cFv */ void dMenu_save_c::memCardDataLoadWait2() { - /* Nonmatching */ + BOOL menu_rt = menuDown(); + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (menu_rt == TRUE && alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 1; + proc = PROC_MEMCARD_DATA_SAVE; + } } /* 801D85D8-801D8798 .text memCardDataSave__12dMenu_save_cFv */ void dMenu_save_c::memCardDataSave() { - /* Nonmatching */ + bool temp_r0; + if (dComIfGs_getNewFile() == 1) { + temp_r0 = true; + } else if (dComIfGs_getNoFile() != 0) { + temp_r0 = false; + } else if (dComIfGs_getMemCardCheckID() != mDoMemCd_getCardSerialNo()) { + temp_r0 = false; + } else { + temp_r0 = true; + } + + if (temp_r0) { + dComIfGs_exchangePlayerRecollectionData(); + dComIfGs_putSave(dStage_stagInfo_GetSaveTbl(dComIfGp_getStage().getStagInfo())); + dComIfGs_setGameStartStage(); + + BOOL test = mDoMemCdRWm_TestCheckSumGameData(&dataBuf[dComIfGs_getDataNum() * (sizeof(dSv_save_c) - 8)]); + if (test) { + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3C); + dataWrite(); + proc = PROC_MEMCARD_DATA_SAVE_WAIT; + } else { + mDoAud_seStart(JA_SE_ALERT_DATA, NULL); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3B); + proc = PROC_MEMCARD_DATA_SAVE_UP_MENU; + } + } else { + mDoAud_seStart(JA_SE_ALERT_DATA, NULL); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3A); + proc = PROC_CAN_NOT_SAVE; + } } /* 801D8798-801D8848 .text memCardDataSaveUpMenu__12dMenu_save_cFv */ void dMenu_save_c::memCardDataSaveUpMenu() { - /* Nonmatching */ + BOOL menu_rt = menuUp(); + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (menu_rt == TRUE && alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 1; + CursorMove(); + field_0x394.pane->show(); + proc = PROC_MEMCARD_DATA_SAVE_SEL; + } } /* 801D8848-801D88E8 .text memCardDataSaveSel__12dMenu_save_cFv */ void dMenu_save_c::memCardDataSaveSel() { - /* Nonmatching */ + if (YesNoSelect(0) != 0) { + if (field_0x52f == 0) { + #if VERSION == VERSION_PAL + if (mDoMemCd_getStatus(0) != 2) { + proc = PROC_MEMCARD_CHECK; + return; + } + #endif + proc = PROC_MEMCARD_DATA_SAVE_DOWN_MENU; + } else { + CursorAlphaInit(); + field_0x52f = 0; + CursorMove(); + field_0x394.pane->show(); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x39); + proc = PROC_MSG_WAIT; + field_0x52d = PROC_SAVE_QUESTION; + } + } } /* 801D88E8-801D8964 .text memCardDataSaveDownMenu__12dMenu_save_cFv */ void dMenu_save_c::memCardDataSaveDownMenu() { - /* Nonmatching */ + BOOL menu_rt = menuDown(); + BOOL temp_r5 = TRUE; + + field_0x544++; + if (menu_rt == TRUE && temp_r5 == TRUE) { + field_0x544 = 0; + field_0x535 = 1; + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3C); + dataWrite(); + proc = PROC_MEMCARD_DATA_SAVE_WAIT; + } } /* 801D8964-801D8A18 .text dataWrite__12dMenu_save_cFv */ void dMenu_save_c::dataWrite() { - /* Nonmatching */ + int res = dComIfGs_setMemoryToCard(dataBuf, dComIfGs_getDataNum()); + JUT_ASSERT(VERSION_SELECT(1789, 1792, 1792, 1803), res != -1); + + mDoMemCdRWm_SetCheckSumGameData(dataBuf, dComIfGs_getDataNum()); + mDoMemCd_Save(dataBuf, sizeof(dataBuf), 0); + +#if VERSION >= VERSION_USA + field_0x540 = mDoMemCd_SaveSync(); +#endif } /* 801D8A18-801D8BB8 .text memCardDataSaveWait__12dMenu_save_cFv */ void dMenu_save_c::memCardDataSaveWait() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + field_0x544++; + +#if VERSION <= VERSION_JPN + int res = mDoMemCd_SaveSync(); +#else + if (field_0x540 == 0) { + field_0x540 = mDoMemCd_SaveSync(); + } +#endif + +#if VERSION <= VERSION_JPN + if (res != 0 && alphaMsg_rt == TRUE) +#else + if (field_0x540 != 0 && alphaMsg_rt == TRUE) +#endif + { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x534 = g_msHIO.field_0x28; + +#if VERSION <= VERSION_JPN + if (res == 1) +#else + if (field_0x540 == 1) +#endif + { + mDoAud_seStart(JA_SE_SAVE_FINISH, NULL); + dComIfGs_exchangePlayerRecollectionData(); + dComIfGs_setMemCardCheckID(mDoMemCd_getCardSerialNo()); + dComIfGs_setNewFile(0); + dComIfGs_setNoFile(0); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3E); + proc = PROC_MSG_WAIT; + field_0x52d = PROC_SAVE_END_WAIT; + } +#if VERSION <= VERSION_JPN + else if (res == 2) +#else + else if (field_0x540 == 2) +#endif + { + mDoAud_seStart(JA_SE_ALERT_DATA, NULL); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3D); + proc = PROC_MSG_WAIT2; + field_0x52d = PROC_MEMCARD_CHECK; + } + } } /* 801D8BB8-801D8C24 .text msgWait__12dMenu_save_cFv */ void dMenu_save_c::msgWait() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + proc = field_0x52d; + } } /* 801D8C24-801D8D08 .text msgWait2__12dMenu_save_cFv */ void dMenu_save_c::msgWait2() { - /* Nonmatching */ + if (field_0x534 != 0) { + field_0x534--; + } + + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + if (alphaMsg_rt == TRUE) { + if (CPad_CHECK_TRIG_A(0) + || CPad_CHECK_TRIG_B(0) + || CPad_CHECK_TRIG_X(0) + || CPad_CHECK_TRIG_Y(0) + || CPad_CHECK_TRIG_L(0) + || CPad_CHECK_TRIG_R(0) + || CPad_CHECK_TRIG_Z(0) + || CPad_CHECK_TRIG_START(0) + || field_0x534 == 0) + { + field_0x536 ^= 1; + field_0x544 = 0; + proc = field_0x52d; + } + } else { + field_0x544++; + } } /* 801D8D08-801D8DCC .text saveEndWait__12dMenu_save_cFv */ void dMenu_save_c::saveEndWait() { - /* Nonmatching */ + if (field_0x534 != 0) { + field_0x534--; + } + + if (CPad_CHECK_TRIG_A(0) + || CPad_CHECK_TRIG_B(0) + || CPad_CHECK_TRIG_X(0) + || CPad_CHECK_TRIG_Y(0) + || CPad_CHECK_TRIG_L(0) + || CPad_CHECK_TRIG_R(0) + || CPad_CHECK_TRIG_Z(0) + || CPad_CHECK_TRIG_START(0) + || field_0x534 == 0) + { + field_0x544 = 0; + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x40); + proc = PROC_GAME_CONTINUE; + } } /* 801D8DCC-801D8ED8 .text canNotSave__12dMenu_save_cFv */ void dMenu_save_c::canNotSave() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + if (alphaMsg_rt == FALSE) { + field_0x544++; + } + + if (alphaMsg_rt == TRUE) { + if (CPad_CHECK_TRIG_A(0) + || CPad_CHECK_TRIG_B(0) + || CPad_CHECK_TRIG_X(0) + || CPad_CHECK_TRIG_Y(0) + || CPad_CHECK_TRIG_L(0) + || CPad_CHECK_TRIG_R(0) + || CPad_CHECK_TRIG_Z(0) + || CPad_CHECK_TRIG_START(0)) + { + field_0x536 ^= 1; + field_0x544 = 0; + + if (useType == 3) { + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x4C); + } else { + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x39); + } + + proc = PROC_CAN_NOT_SAVE2; + } + } } /* 801D8ED8-801D8F9C .text canNotSave2__12dMenu_save_cFv */ void dMenu_save_c::canNotSave2() { - /* Nonmatching */ + BOOL menu_rt; + if (field_0x535) { + menu_rt = menuUp(); + } else { + menu_rt = TRUE; + } + + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (menu_rt == TRUE && alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 0; + CursorMove(); + field_0x394.pane->show(); + proc = PROC_SAVE_QUESTION; + } } /* 801D8F9C-801D9060 .text gameContinue__12dMenu_save_cFv */ void dMenu_save_c::gameContinue() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + BOOL menu_rt; + if (field_0x535) { + menu_rt = menuUp(); + } else { + menu_rt = TRUE; + } + + field_0x544++; + if (alphaMsg_rt == TRUE && menu_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 0; + CursorMove(); + field_0x394.pane->show(); + proc = PROC_GAME_CONTINUE2; + } } /* 801D9060-801D914C .text gameContinue2__12dMenu_save_cFv */ void dMenu_save_c::gameContinue2() { - /* Nonmatching */ + BOOL rt; + if (useType == 2 || useType == 3) { + rt = YesNoSelect2(1); + } else { + rt = YesNoSelect(2); + } + + if (rt) { + if (field_0x52f == 0) { + switch (useType) { + case 0: + case 1: + break; + case 2: + endStatus = 1; + break; + } + + proc = PROC_SAVE_WAIT; + saveStatus = 3; + } else if (useType == 2) { +#if VERSION == VERSION_DEMO + proc = PROC_SAVE_WAIT; + saveStatus = 3; + endStatus = 0; +#else + field_0x534 = 15; + proc = PROC_GAME_CONTINUE4; +#endif + } else if (field_0x52f == 2) { + proc = PROC_SAVE_WAIT; + saveStatus = 3; + } else { + field_0x544 = 0; + field_0x534 = 30; + proc = PROC_GAME_CONTINUE3; + } + } } /* 801D914C-801D91E8 .text gameContinue3__12dMenu_save_cFv */ void dMenu_save_c::gameContinue3() { - /* Nonmatching */ + BOOL alphaWipe_rt = PaneScaleAlphaWipe(field_0x544, g_msHIO.field_0x23, 1.0f, 0, 1); + BOOL close_rt = closeForGameover_2(); + + field_0x544++; + if (alphaWipe_rt == TRUE && close_rt == TRUE) { + if (field_0x534 != 0) { + field_0x534--; + } else { + mDoRst::onReset(); + } + } } /* 801D91E8-801D921C .text gameContinue4__12dMenu_save_cFv */ void dMenu_save_c::gameContinue4() { - /* Nonmatching */ + if (field_0x534 != 0) { + field_0x534--; + } else { + proc = PROC_SAVE_WAIT; + saveStatus = 3; + endStatus = 0; + } } /* 801D921C-801D92B0 .text endingNoSave__12dMenu_save_cFv */ void dMenu_save_c::endingNoSave() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 1; + CursorMove(); + field_0x394.pane->show(); + proc = PROC_ENDING_NO_SAVE2; + } } /* 801D92B0-801D9334 .text endingNoSave2__12dMenu_save_cFv */ void dMenu_save_c::endingNoSave2() { - /* Nonmatching */ + if (YesNoSelect2(1)) { + if (field_0x52f == 0) { + endStatus = 0; + proc = PROC_SAVE_WAIT; + saveStatus = 3; + } else { + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x4C); + proc = PROC_ENDING_NO_SAVE3; + } + } } /* 801D9334-801D93C8 .text endingNoSave3__12dMenu_save_cFv */ void dMenu_save_c::endingNoSave3() { - /* Nonmatching */ + BOOL alphaMsg_rt = PaneAlphaMsgTxt(field_0x544, g_msHIO.field_0x29); + + field_0x544++; + if (alphaMsg_rt == TRUE) { + field_0x536 ^= 1; + field_0x544 = 0; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 0; + CursorMove(); + field_0x394.pane->show(); + proc = PROC_SAVE_QUESTION; + } } /* 801D93C8-801D94C0 .text endingDataCheck__12dMenu_save_cFv */ void dMenu_save_c::endingDataCheck() { - /* Nonmatching */ + bool temp_r0; + if (dComIfGs_getNewFile() == 1) { + temp_r0 = true; + } else if (dComIfGs_getNoFile() != 0) { + temp_r0 = false; + } else if (dComIfGs_getMemCardCheckID() != mDoMemCd_getCardSerialNo()) { + temp_r0 = false; + } else { + temp_r0 = true; + } + + if (temp_r0) { + proc = PROC_SAVE_WAIT; + saveStatus = 3; + } else { + mDoAud_seStart(JA_SE_ALERT_DATA, NULL); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3A); + proc = PROC_CAN_NOT_SAVE; + } } /* 801D94C0-801D94C4 .text saveWait__12dMenu_save_cFv */ -void dMenu_save_c::saveWait() { - /* Nonmatching */ -} +void dMenu_save_c::saveWait() {} /* 801D94C4-801D9764 .text YesNoSelect__12dMenu_save_cFi */ -void dMenu_save_c::YesNoSelect(int) { - /* Nonmatching */ +BOOL dMenu_save_c::YesNoSelect(int param_0) { + if (!field_0x394.pane->isVisible()) { + return TRUE; + } + + stick->checkTrigger(); + + if (CPad_CHECK_TRIG_A(0)) { + field_0x394.pane->hide(); + if (field_0x52f == 0) { + if (param_0) { + mDoAud_seStart(JA_SE_CONTINUE_GAME, NULL); + } else { + mDoAud_seStart(JA_SE_SAVE_START, NULL); + } + } else { + if (param_0) { + mDoAud_seStart(JA_SE_QUIT_GAME, NULL); + } else { + mDoAud_seStart(JA_SE_SAVE_CANCEL, NULL); + } + } + return 1; + } else if (CPad_CHECK_TRIG_B(0)) { + if (param_0 == TRUE) { + mDoAud_seStart(JA_SE_QUIT_GAME, NULL); + } else { +#if VERSION <= VERSION_JPN + mDoAud_seStart(JA_SE_SAVE_CANCEL, NULL); +#else + mDoAud_seStart(JA_SE_CONTINUE_GAME, NULL); +#endif + } + + field_0x394.pane->hide(); + field_0x52f = 2; + return 1; + } else if (stick->checkRightTrigger()) { + if (field_0x52f != 1) { + mDoAud_seStart(JA_SE_TALK_CURSOR, NULL); + field_0x52f = 1; + CursorMove(); + } + } else if (stick->checkLeftTrigger()) { + if (field_0x52f != 0) { + mDoAud_seStart(JA_SE_TALK_CURSOR, NULL); + field_0x52f = 0; + CursorMove(); + } + } + + CursorAnime(); + return 0; } /* 801D9764-801D9978 .text YesNoSelect2__12dMenu_save_cFi */ -void dMenu_save_c::YesNoSelect2(int) { - /* Nonmatching */ +BOOL dMenu_save_c::YesNoSelect2(int param_0) { + if (!field_0x394.pane->isVisible()) { + return TRUE; + } + + stick->checkTrigger(); + + if (CPad_CHECK_TRIG_A(0)) { + field_0x394.pane->hide(); + if (field_0x52f == 0) { + if (param_0) { + mDoAud_seStart(JA_SE_CONTINUE_GAME, NULL); + } else { + mDoAud_seStart(JA_SE_SAVE_START, NULL); + } + } else { + if (param_0) { + mDoAud_seStart(JA_SE_QUIT_GAME, NULL); + } else { + mDoAud_seStart(JA_SE_SAVE_CANCEL, NULL); + } + } + return 1; + } else if (stick->checkRightTrigger()) { + if (field_0x52f != 1) { + mDoAud_seStart(JA_SE_TALK_CURSOR, NULL); + field_0x52f = 1; + CursorMove(); + } + } else if (stick->checkLeftTrigger()) { + if (field_0x52f != 0) { + mDoAud_seStart(JA_SE_TALK_CURSOR, NULL); + field_0x52f = 0; + CursorMove(); + } + } + + CursorAnime(); + return 0; } /* 801D9978-801D99AC .text CursorAlphaInit__12dMenu_save_cFv */ void dMenu_save_c::CursorAlphaInit() { - /* Nonmatching */ + field_0x394.mNowAlpha = 0; + field_0x394.mUserArea = 0; + field_0x530 = 0; + fopMsgM_setAlpha(&field_0x394); } /* 801D99AC-801D99FC .text CursorMove__12dMenu_save_cFv */ void dMenu_save_c::CursorMove() { - /* Nonmatching */ + fopMsgM_paneTrans(&field_0x394, field_0x52f * 139.0f, 0.0f); } /* 801D99FC-801D9ACC .text CursorAnime__12dMenu_save_cFv */ void dMenu_save_c::CursorAnime() { - /* Nonmatching */ + f32 temp_f1 = fopMsgM_valueIncrease(g_msHIO.field_0x20, field_0x394.mUserArea, 0); + if (field_0x530 != 0) { + temp_f1 = 1.0f - temp_f1; + } + + f32 temp = g_msHIO.field_0x21 - g_msHIO.field_0x22; + field_0x394.mNowAlpha = g_msHIO.field_0x22 + (u32)(temp * temp_f1); + fopMsgM_setAlpha(&field_0x394); + + if (field_0x394.mUserArea == 0) { + field_0x394.mUserArea = g_msHIO.field_0x20; + field_0x530 ^= 1; + } else { + field_0x394.mUserArea--; + } } /* 801D9ACC-801D9C28 .text openSave__12dMenu_save_cFv */ -void dMenu_save_c::openSave() { - /* Nonmatching */ +BOOL dMenu_save_c::openSave() { + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0x9, g_msHIO.field_0x8, g_msHIO.field_0xc, 40.0f, 1, 0); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase((field_0x544 - g_msHIO.field_0x9) - g_msHIO.field_0x8, g_msHIO.field_0x8, 40.0f, 0.0f, 4, 2); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x11, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + BOOL menu_rt = menuUp(); + + field_0x544++; + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + field_0x544 = 0; + return TRUE; + } + + return FALSE; } /* 801D9C28-801D9DA4 .text closeSave__12dMenu_save_cFv */ -void dMenu_save_c::closeSave() { - /* Nonmatching */ +BOOL dMenu_save_c::closeSave() { + BOOL var_r29 = FALSE; + BOOL base_rt = PaneTranceBase(field_0x544 - g_msHIO.field_0xa, g_msHIO.field_0x8, 0.0f, 40.0f, 4, 2); + if (base_rt == TRUE) { + var_r29 = PaneTranceBase((field_0x544 - g_msHIO.field_0xa) - g_msHIO.field_0x8, g_msHIO.field_0x8, 0.0f, g_msHIO.field_0xc, 0, 1); + } + BOOL title_rt = PaneTranceTitle(field_0x544 - g_msHIO.field_0x12, g_msHIO.field_0x10, 0.0f, g_msHIO.field_0x14, 0, 1); + BOOL menu_rt; + if (field_0x535 != 0) { + menu_rt = TRUE; + } else { + menu_rt = menuDown(); + } + + field_0x544++; + if (base_rt == TRUE + && var_r29 == TRUE + && title_rt == TRUE + && menu_rt == TRUE) + { + field_0x535 = 0; + field_0x544 = 0; + return TRUE; + } + + return FALSE; } /* 801D9DA4-801DA118 .text screenSet__12dMenu_save_cFv */ void dMenu_save_c::screenSet() { - /* Nonmatching */ + int i; + u32 var_r28 = 'wp00'; + for (i = 0; i < 8; i++) { + fopMsgM_setPaneData(&field_0x14[i], MenuSave.Scr->search(var_r28)); + var_r28++; + } + + fopMsgM_setPaneData(&field_0x1d4, MenuSave.Scr->search('msk0')); + fopMsgM_setPaneData(&field_0x20c[0], MenuSave.Scr->search('cc01')); + fopMsgM_setPaneData(&field_0x20c[1], MenuSave.Scr->search('cc12')); + fopMsgM_setPaneData(&field_0x20c[2], MenuSave.Scr->search('cc23')); + fopMsgM_setPaneData(&field_0x20c[3], MenuSave.Scr->search('st00')); + fopMsgM_setPaneData(&field_0x20c[4], MenuSave.Scr->search('st01')); + + ((J2DTextBox*)field_0x20c[3].pane)->setFont(MenuSave.font); + ((J2DTextBox*)field_0x20c[4].pane)->setFont(MenuSave.font); + +#if VERSION == VERSION_PAL + ((J2DTextBox*)field_0x20c[3].pane)->setLineSpace(28.0f); + ((J2DTextBox*)field_0x20c[4].pane)->setLineSpace(28.0f); +#endif + + char sp8[256]; + for (int i = 0; i < 256; i++) { + sp8[i] = 'A'; + } + sp8[255] = 0; + + ((J2DTextBox*)field_0x20c[3].pane)->setString(sp8); + ((J2DTextBox*)field_0x20c[4].pane)->setString(sp8); + + field_0x51c[0] = ((J2DTextBox*)field_0x20c[3].pane)->getStringPtr(); + *field_0x51c[0] = 0; + + field_0x51c[1] = ((J2DTextBox*)field_0x20c[4].pane)->getStringPtr(); + *field_0x51c[1] = 0; + + fopMsgM_setPaneData(&field_0x324, MenuSave.Scr->search('tk00')); + fopMsgM_setPaneData(&field_0x35c, MenuSave.Scr->search('tl00')); +#if VERSION == VERSION_PAL + fopMsgM_setPaneData(&field_0x51c_pal, MenuSave.Scr->search('tlsv')); +#endif + fopMsgM_setPaneData(&field_0x394, MenuSave.Scr->search('cur1')); + fopMsgM_setPaneData(&field_0x3cc, MenuSave.Scr->search('ysk0')); + fopMsgM_setPaneData(&field_0x404, MenuSave.Scr->search('ys00')); + fopMsgM_setPaneData(&field_0x43c, MenuSave.Scr->search('yes')); + ((J2DTextBox*)field_0x43c.pane)->setFont(MenuSave.font); + + fopMsgM_setPaneData(&field_0x474, MenuSave.Scr->search('nok0')); + fopMsgM_setPaneData(&field_0x4ac, MenuSave.Scr->search('no00')); + fopMsgM_setPaneData(&field_0x4e4, MenuSave.Scr->search('no')); + ((J2DTextBox*)field_0x4e4.pane)->setFont(MenuSave.font); + +#if VERSION == VERSION_PAL + char yestxt[4]; + switch (dComIfGs_getPalLanguage()) { + case 0: + ((J2DPicture*)field_0x51c_pal.pane)->changeTexture("title_save.bti", 0); + ((J2DTextBox*)field_0x43c.pane)->setString("Yes"); + ((J2DTextBox*)field_0x4e4.pane)->setString("No"); + break; + case 1: + ((J2DPicture*)field_0x51c_pal.pane)->changeTexture("title_save_gm.bti", 0); + ((J2DTextBox*)field_0x43c.pane)->setString("Ja"); + ((J2DTextBox*)field_0x4e4.pane)->setString("Nein"); + break; + case 2: + ((J2DPicture*)field_0x51c_pal.pane)->changeTexture("title_save_fr.bti", 0); + ((J2DTextBox*)field_0x43c.pane)->setString("Oui"); + ((J2DTextBox*)field_0x4e4.pane)->setString("Non"); + break; + case 3: { + strcpy(yestxt, "Si"); + yestxt[1] = 0xED; + + ((J2DPicture*)field_0x51c_pal.pane)->changeTexture("title_save_sp.bti", 0); + ((J2DTextBox*)field_0x43c.pane)->setString(yestxt); + ((J2DTextBox*)field_0x4e4.pane)->setString("No"); + break; + } + case 4: { + strcpy(yestxt, "Si"); + yestxt[1] = 0xEC; + + ((J2DPicture*)field_0x51c_pal.pane)->changeTexture("title_save_it.bti", 0); + ((J2DTextBox*)field_0x43c.pane)->setString(yestxt); + ((J2DTextBox*)field_0x4e4.pane)->setString("No"); + break; + } + } +#endif } /* 801DA118-801DA2C8 .text paneTransInit__12dMenu_save_cFv */ void dMenu_save_c::paneTransInit() { - /* Nonmatching */ + field_0x544 = 0; + PaneScaleAlphaWipe(field_0x544, g_msHIO.field_0x23, g_msHIO.field_0x26, 1, 0); + PaneAlphaMask(field_0x544, g_msHIO.field_0x5, 1, 0); + PaneTranceBase(field_0x544, g_msHIO.field_0x8, g_msHIO.field_0xc, 0.0f, 1, 0); + PaneTranceTitle(field_0x544, g_msHIO.field_0x10, g_msHIO.field_0x14, 0.0f, 1, 0); + PaneTranceMenu(field_0x544, g_msHIO.field_0x18, &field_0x3cc, g_msHIO.field_0x1e, 0.0f, 1, 0); + PaneTranceMenu(field_0x544, g_msHIO.field_0x18, &field_0x474, g_msHIO.field_0x1e, 0.0f, 1, 0); + field_0x394.pane->hide(); } /* 801DA2C8-801DA3C4 .text displayInit__12dMenu_save_cFv */ void dMenu_save_c::displayInit() { - /* Nonmatching */ + field_0x536 = 0; + field_0x53c = 0; + field_0x53d = 0; + field_0x53b = 0; + proc = PROC_SAVE_WAIT; + saveStatus = 1; + field_0x53a = 1; + endStatus = 2; + field_0x535 = 0; + CursorAlphaInit(); + field_0x52f = 0; + CursorMove(); + + fopMsgM_setNowAlpha(&field_0x20c[3], 1.0f); + fopMsgM_setNowAlpha(&field_0x20c[4], 0.0f); + fopMsgM_setAlpha(&field_0x20c[3]); + fopMsgM_setAlpha(&field_0x20c[4]); + + field_0x539 = 1; + + if (useType == 3) { + fopMsgM_messageGet(field_0x51c[field_0x536], 0x4C); + } else { + fopMsgM_messageGet(field_0x51c[field_0x536], 0x39); + } + + *field_0x51c[field_0x536 ^ 1] = 0; } /* 801DA3C4-801DA420 .text initializeEx__12dMenu_save_cFv */ void dMenu_save_c::initializeEx() { - /* Nonmatching */ + fopMsgM_messageGet(field_0x51c[field_0x536], 0x3A); + fopMsgM_messageGet(field_0x51c[field_0x536 ^ 1], 0x3A); } /* 801DA420-801DA508 .text menuUp__12dMenu_save_cFv */ -void dMenu_save_c::menuUp() { - /* Nonmatching */ +BOOL dMenu_save_c::menuUp() { + BOOL var_r31 = PaneTranceMenu(field_0x544, g_msHIO.field_0x18, &field_0x3cc, g_msHIO.field_0x1e, 0.0f, 1, 0); + BOOL temp_r3 = PaneTranceMenu(field_0x544 - g_msHIO.field_0x1c, g_msHIO.field_0x18, &field_0x474, g_msHIO.field_0x1e, 0.0f, 1, 0); + + if (var_r31 == true && temp_r3 == TRUE) { + return TRUE; + } + + return FALSE; } /* 801DA508-801DA5F0 .text menuDown__12dMenu_save_cFv */ -void dMenu_save_c::menuDown() { - /* Nonmatching */ +BOOL dMenu_save_c::menuDown() { + BOOL var_r31 = PaneTranceMenu(field_0x544, g_msHIO.field_0x18, &field_0x3cc, 0.0f, g_msHIO.field_0x1e, 0, 1); + BOOL temp_r3 = PaneTranceMenu(field_0x544 - g_msHIO.field_0x1c, g_msHIO.field_0x18, &field_0x474, 0.0f, g_msHIO.field_0x1e, 0, 1); + + if (var_r31 == true && temp_r3 == TRUE) { + return TRUE; + } + + return FALSE; } /* 801DA5F0-801DA6B0 .text PaneAlphaMsgTxt__12dMenu_save_cFsUc */ -void dMenu_save_c::PaneAlphaMsgTxt(short, unsigned char) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneAlphaMsgTxt(s16 param_0, u8 param_1) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, 0); + f32 temp = 1.0f - var_f31; + fopMsgM_setNowAlpha(&field_0x20c[field_0x536 + 3], temp); + fopMsgM_setNowAlpha(&field_0x20c[(field_0x536 ^ 1) + 3], var_f31); + fopMsgM_setAlpha(&field_0x20c[0 + 3]); + fopMsgM_setAlpha(&field_0x20c[1 + 3]); + return FALSE; } /* 801DA6B0-801DA7B8 .text PaneTranceBase__12dMenu_save_cFsUcffUci */ -void dMenu_save_c::PaneTranceBase(short, unsigned char, float, float, unsigned char, int) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneTranceBase(s16 param_0, u8 param_1, f32 param_2, f32 param_3, u8 param_4, int param_5) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_4); + f32 temp = var_f31 * (param_3 - param_2); + fopMsgM_paneTrans(&field_0x20c[0], 0.0f, param_2 + temp); + + if (param_5 != 2) { + if (param_5 == 1) { + var_f31 = 1.0f - var_f31; + } + + for (int i = 0; i < 3; i++) { + fopMsgM_setNowAlpha(&field_0x20c[i], var_f31); + fopMsgM_setAlpha(&field_0x20c[i]); + } + } + + return FALSE; } /* 801DA7B8-801DAA80 .text PaneScaleAlphaWipe__12dMenu_save_cFsUcfUci */ -void dMenu_save_c::PaneScaleAlphaWipe(short, unsigned char, float, unsigned char, int) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneScaleAlphaWipe(s16 param_0, u8 param_1, f32 param_2, u8 param_3, int param_4) { + int i; + + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_3); + + f32 temp_f2 = param_2 - 1.0f; + if (temp_f2 >= 0.0f) { + f32 temp_f0 = (1.0f - var_f31) * temp_f2; + for (i = 0; i < 8; i++) { + field_0x14[i].mSize.x = field_0x14[i].mSizeOrig.x * (temp_f0 + 1.0f); + field_0x14[i].mSize.y = field_0x14[i].mSizeOrig.y * (temp_f0 + 1.0f); + field_0x14[i].pane->resize(field_0x14[i].mSize.x, field_0x14[i].mSize.y); + } + + field_0x14[0].mPosTopLeft.x = field_0x14[0].mPosTopLeftOrig.x - (field_0x14[0].mSize.x - field_0x14[0].mSizeOrig.x); + field_0x14[0].pane->move(field_0x14[0].mPosTopLeft.x, field_0x14[0].mPosTopLeftOrig.y); + field_0x14[2].mPosTopLeft.y = field_0x14[2].mPosTopLeftOrig.y - (field_0x14[2].mSize.y - field_0x14[2].mSizeOrig.y); + field_0x14[2].pane->move(field_0x14[2].mPosTopLeftOrig.x, field_0x14[2].mPosTopLeft.y); + field_0x14[1].mPosTopLeft.y = field_0x14[1].mPosTopLeftOrig.y - (field_0x14[1].mSize.y - field_0x14[1].mSizeOrig.y); + field_0x14[1].mPosTopLeft.x = field_0x14[2].mSize.x; + field_0x14[1].pane->move(field_0x14[1].mPosTopLeft.x, field_0x14[1].mPosTopLeft.y); + field_0x14[3].mPosTopLeft.x = field_0x14[0].mSize.x; + field_0x14[3].pane->move(field_0x14[3].mPosTopLeft.x, field_0x14[3].mPosTopLeftOrig.y); + field_0x14[4].pane->move(field_0x14[2].mSize.x + field_0x14[1].mSize.x, -field_0x14[1].mSize.y); + field_0x14[5].pane->move(-field_0x14[5].mSize.x, -field_0x14[2].mSize.y); + field_0x14[6].pane->move(-(field_0x14[0].mSize.x + field_0x14[5].mSize.x), -(field_0x14[2].mSize.y + field_0x14[6].mSize.y)); + field_0x14[7].pane->move(-(field_0x14[0].mSize.x + field_0x14[5].mSize.x), field_0x14[0].mSize.y + field_0x14[7].mSize.y); + } + + if (param_4 != 2) { + if (param_4 == 1) { + var_f31 = 1.0f - var_f31; + } + + for (i = 0; i < 8; i++) { + fopMsgM_setNowAlpha(&field_0x14[i], var_f31); + fopMsgM_setAlpha(&field_0x14[i]); + } + } + + return FALSE; } /* 801DAA80-801DAB10 .text PaneAlphaMask__12dMenu_save_cFsUcUci */ -void dMenu_save_c::PaneAlphaMask(short, unsigned char, unsigned char, int) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneAlphaMask(s16 param_0, u8 param_1, u8 param_2, int param_3) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_2); + + if (param_3 != 2) { + if (param_3 == 1) { + var_f31 = 1.0f - var_f31; + } + + fopMsgM_setNowAlpha(&field_0x1d4, var_f31); + fopMsgM_setAlpha(&field_0x1d4); + } + + return FALSE; } /* 801DAB10-801DAC0C .text PaneTranceTitle__12dMenu_save_cFsUcffUci */ -void dMenu_save_c::PaneTranceTitle(short, unsigned char, float, float, unsigned char, int) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneTranceTitle(s16 param_0, u8 param_1, f32 param_2, f32 param_3, u8 param_4, int param_5) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_4); + f32 temp = var_f31 * (param_3 - param_2); + fopMsgM_paneTrans(&field_0x324, 0.0f, param_2 + temp); + + if (param_5 != 2) { + if (param_5 == 1) { + var_f31 = 1.0f - var_f31; + } + + fopMsgM_setNowAlpha(&field_0x324, var_f31); + fopMsgM_setNowAlpha(&field_0x35c, var_f31); + fopMsgM_setAlpha(&field_0x324); + fopMsgM_setAlpha(&field_0x35c); + } + + return FALSE; } /* 801DAC0C-801DACD0 .text PaneRotate__12dMenu_save_cFsUcP18fopMsgM_pane_classfffUc */ -void dMenu_save_c::PaneRotate(short, unsigned char, fopMsgM_pane_class*, float, float, float, unsigned char) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneRotate(s16 param_0, u8 param_1, fopMsgM_pane_class* param_2, f32 param_3, f32 param_4, f32 param_5, u8 param_6) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_6); + param_2->pane->rotate(param_3, param_4, ROTATE_Z, param_5 * var_f31); + + return FALSE; } /* 801DACD0-801DADD4 .text PaneTranceMenu__12dMenu_save_cFsUcP18fopMsgM_pane_classffUci */ -void dMenu_save_c::PaneTranceMenu(short, unsigned char, fopMsgM_pane_class*, float, float, unsigned char, int) { - /* Nonmatching */ +BOOL dMenu_save_c::PaneTranceMenu(s16 param_0, u8 param_1, fopMsgM_pane_class* param_2, f32 param_3, f32 param_4, u8 param_5, int param_6) { + if (param_0 < 0) + return FALSE; + if (param_0 > param_1) + return TRUE; + + f32 var_f31 = fopMsgM_valueIncrease(param_1, param_0, param_5); + f32 temp = var_f31 * (param_4 - param_3); + fopMsgM_paneTrans(param_2, 0.0f, param_3 + temp); + + if (param_6 != 2) { + if (param_6 == 1) { + var_f31 = 1.0f - var_f31; + } + + for (int i = 0; i < 3; i++) { + fopMsgM_setNowAlpha(¶m_2[i], var_f31); + fopMsgM_setAlpha(¶m_2[i]); + } + } + + return FALSE; } /* 801DADD4-801DAE20 .text _draw__12dMenu_save_cFv */ void dMenu_save_c::_draw() { - /* Nonmatching */ + MenuSave.Scr->draw(0.0f, 0.0f, dComIfGp_getCurrentGrafPort()); + dFe_c->draw2(); } /* 801DAE20-801DAE6C .text _draw2__12dMenu_save_cFv */ void dMenu_save_c::_draw2() { - /* Nonmatching */ + dComIfGd_set2DOpa(&MenuSave); + dFe_c->_draw(); } /* 801DAE6C-801DAED0 .text draw__16dDlst_MenuSave_cFv */ void dDlst_MenuSave_c::draw() { - /* Nonmatching */ + J2DOrthoGraph* graf = dComIfGp_getCurrentGrafPort(); + graf->setPort(); + Scr->draw(0.0f, 0.0f, graf); } diff --git a/src/d/d_picture_box.cpp b/src/d/d_picture_box.cpp index c3584d391a..d1df8febd3 100644 --- a/src/d/d_picture_box.cpp +++ b/src/d/d_picture_box.cpp @@ -6,10 +6,17 @@ #include "d/dolzel.h" // IWYU pragma: keep #include "d/d_picture_box.h" #include "f_op/f_op_msg.h" +#include "d/d_com_inf_game.h" /* 802258C8-80225954 .text dPb_erasePicture__Fv */ void dPb_erasePicture() { - /* Nonmatching */ + u8 selectPicture = dComIfGp_getSelectPicture(); + u8 evReg = dComIfGs_getEventReg(dSv_event_flag_c::UNK_89FF); + if (selectPicture < 3) { + dComIfGs_setEventReg(dSv_event_flag_c::UNK_89FF, evReg | (1 << (selectPicture))); + dComIfGp_setItemPictureNumCount(-1); + } + } /* 80225954-80225E88 .text screenSet__9dJle_Pb_cFv */ diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index f4d55826d4..2bdc40d06d 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -128,8 +128,8 @@ cPhs_State dScnName_c::create() { JUT_ASSERT(489, dFe_c != NULL); dFe_c->_create(); dMs_c = NULL; - dComIfGs_setNoFile(0); dComIfGs_setNewFile(0); + dComIfGs_setNoFile(0); } if (fpcM_GetName(this) == fpcNm_NAMEEX_SCENE_e) { dComIfGs_setClearCount(1); @@ -749,8 +749,8 @@ void dScnName_c::FileSelectClose() { case 2: if (fpcM_GetName(this) == fpcNm_NAMEEX_SCENE_e) { dMs_c->initialize(); - dMs_c->field_0x053c = 1; - dMs_c->field_0x053d = dFs_c->field_0x392f; // getErrType? + dMs_c->field_0x53c = 1; + dMs_c->field_0x53d = dFs_c->field_0x392f; // getErrType? if (dFs_c->field_0x392f == 2) { dMs_c->initializeEx(); } diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index 0a7d752c69..5ff752a35d 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -1,8 +1,3 @@ -// -// Generated by dtk -// Translation Unit: f_op_msg_mng.cpp -// - #include "d/dolzel.h" // IWYU pragma: keep #include "f_op/f_op_msg_mng.h" #include "JSystem/JKernel/JKRArchive.h" @@ -77,11 +72,11 @@ static struct { /* 0x12 */ {dItemNo_DELIVERY_BAG_e, "delivery.bti"}, /* 0x13 */ {dItemNo_HOOKSHOT_e, "hookshot.bti"}, /* 0x14 */ {dItemNo_SKULL_HAMMER_e, "hammer_01.bti"}, - + /* 0x15 */ {dItemNo_MAGIC_ARMOR_e, "shield_02.bti"}, /* 0x16 */ {dItemNo_MAGIC_ARMOR_e, "shield_02.bti"}, /* 0x17 */ {dItemNo_MAGIC_ARMOR_e, "shield_02.bti"}, - + /* 0x18 */ {dItemNo_SKULL_NECKLACE_e, "beast_01.bti"}, /* 0x19 */ {dItemNo_BOKOBABA_SEED_e, "beast_02.bti"}, /* 0x1A */ {dItemNo_GOLDEN_FEATHER_e, "beast_03.bti"}, @@ -90,12 +85,12 @@ static struct { /* 0x1D */ {dItemNo_GREEN_JELLY_e, "beast_06.bti"}, /* 0x1E */ {dItemNo_BLUE_JELLY_e, "beast_07.bti"}, /* 0x1F */ {dItemNo_JOY_PENDANT_e, "beast_08.bti"}, - + /* 0x20 */ {dItemNo_NONE_e, "beast_09.bti"}, /* 0x21 */ {dItemNo_NONE_e, "beast_10.bti"}, /* 0x22 */ {dItemNo_NONE_e, "beast_11.bti"}, /* 0x23 */ {dItemNo_NONE_e, "beast_12.bti"}, - + /* 0x24 */ {dItemNo_HYOI_PEAR_e, "beast_02.bti"}, /* 0x25 */ {dItemNo_BIRD_BAIT_5_e, "beast_02.bti"}, /* 0x26 */ {dItemNo_NONE_e, "beast_03.bti"}, @@ -104,12 +99,12 @@ static struct { /* 0x29 */ {dItemNo_NONE_e, "beast_06.bti"}, /* 0x2A */ {dItemNo_NONE_e, "beast_07.bti"}, /* 0x2B */ {dItemNo_NONE_e, "beast_08.bti"}, - + /* 0x2C */ {dItemNo_NONE_e, "beast_09.bti"}, /* 0x2D */ {dItemNo_NONE_e, "beast_10.bti"}, /* 0x2E */ {dItemNo_NONE_e, "beast_11.bti"}, /* 0x2F */ {dItemNo_NONE_e, "beast_12.bti"}, - + /* 0x30 */ {dItemNo_TOWN_FLOWER_e, "beast_02.bti"}, /* 0x31 */ {dItemNo_SEA_FLOWER_e, "beast_02.bti"}, /* 0x32 */ {dItemNo_EXOTIC_FLOWER_e, "beast_03.bti"}, @@ -118,7 +113,7 @@ static struct { /* 0x35 */ {dItemNo_BIG_SALE_FLAG_e, "beast_06.bti"}, /* 0x36 */ {dItemNo_PINWHEEL_e, "beast_07.bti"}, /* 0x37 */ {dItemNo_SICKLE_MOON_FLAG_e, "beast_08.bti"}, - + /* 0x38 */ {dItemNo_SKULL_TOWER_IDOL_e, "beast_09.bti"}, /* 0x39 */ {dItemNo_FOUNTAIN_IDOL_e, "beast_10.bti"}, /* 0x3A */ {dItemNo_POSTMAN_STATUE_e, "beast_11.bti"}, @@ -126,80 +121,73 @@ static struct { }; u16 zfont[][2] = { - 0x8340, 0x84a4, 0x8341, 0x84a5, 0x8342, 0x84a6, 0x8343, 0x84a7, 0x8344, 0x84a8, 0x8345, 0x84a9, 0x8346, - 0x84aa, 0x8347, 0x84ab, 0x8348, 0x84ac, 0x8349, 0x84ad, 0x834a, 0x84ae, 0x834b, 0x84af, 0x834c, 0x84b0, - 0x834d, 0x84b1, 0x834e, 0x84b2, 0x834f, 0x84b3, 0x8350, 0x84b4, 0x8351, 0x84b5, 0x8352, 0x84b6, 0x8353, - 0x84b7, 0x8354, 0x84b8, 0x8355, 0x84b9, 0x8356, 0x84ba, 0x8357, 0x84bb, 0x8358, 0x84bc, 0x8359, 0x84bd, - 0x835a, 0x84be, 0x835b, 0x8740, 0x835c, 0x8741, 0x835d, 0x8742, 0x835e, 0x8743, 0x835f, 0x8744, 0x8360, - 0x8745, 0x8361, 0x8746, 0x8362, 0x8747, 0x8363, 0x8748, 0x8364, 0x8749, 0x8365, 0x874a, 0x8366, 0x874b, - 0x8367, 0x874c, 0x8368, 0x874d, 0x8369, 0x874e, 0x836a, 0x874f, 0x836b, 0x8750, 0x836c, 0x8751, 0x836d, - 0x8752, 0x836e, 0x8753, 0x836f, 0x8754, 0x8370, 0x8755, 0x8371, 0x8756, 0x8372, 0x8757, 0x8373, 0x8758, - 0x8374, 0x8759, 0x8375, 0x875a, 0x8376, 0x875b, 0x8377, 0x875c, 0x8378, 0x875d, 0x8379, 0x875f, 0x837a, - 0x8760, 0x837b, 0x8761, 0x837c, 0x8762, 0x837d, 0x8763, 0x837e, 0x8764, 0x8380, 0x8765, 0x8381, 0x8766, - 0x8382, 0x8767, 0x8383, 0x8768, 0x8384, 0x8769, 0x8385, 0x876a, 0x8386, 0x876b, 0x8387, 0x876c, 0x8388, - 0x876d, 0x8389, 0x876e, 0x838a, 0x876f, 0x838b, 0x8770, 0x838c, 0x8771, 0x838d, 0x8772, 0x838e, 0x8773, - 0x838f, 0x8774, 0x8390, 0x8775, 0x8391, 0x877e, 0x8392, 0x8780, 0x8393, 0x8781, 0x824f, 0x8782, 0x8250, - 0x8783, 0x8251, 0x8784, 0x8252, 0x8785, 0x8253, 0x8786, 0x8254, 0x8787, 0x8255, 0x8788, 0x8256, 0x8789, - 0x8257, 0x878a, 0x8258, 0x878b, 0x8141, 0x878c, 0x815b, 0x878d, 0x8175, 0x878e, 0x8176, 0x878f, + 0x8340, 0x84a4, 0x8341, 0x84a5, 0x8342, 0x84a6, 0x8343, 0x84a7, 0x8344, 0x84a8, 0x8345, 0x84a9, 0x8346, 0x84aa, 0x8347, 0x84ab, 0x8348, 0x84ac, + 0x8349, 0x84ad, 0x834a, 0x84ae, 0x834b, 0x84af, 0x834c, 0x84b0, 0x834d, 0x84b1, 0x834e, 0x84b2, 0x834f, 0x84b3, 0x8350, 0x84b4, 0x8351, 0x84b5, + 0x8352, 0x84b6, 0x8353, 0x84b7, 0x8354, 0x84b8, 0x8355, 0x84b9, 0x8356, 0x84ba, 0x8357, 0x84bb, 0x8358, 0x84bc, 0x8359, 0x84bd, 0x835a, 0x84be, + 0x835b, 0x8740, 0x835c, 0x8741, 0x835d, 0x8742, 0x835e, 0x8743, 0x835f, 0x8744, 0x8360, 0x8745, 0x8361, 0x8746, 0x8362, 0x8747, 0x8363, 0x8748, + 0x8364, 0x8749, 0x8365, 0x874a, 0x8366, 0x874b, 0x8367, 0x874c, 0x8368, 0x874d, 0x8369, 0x874e, 0x836a, 0x874f, 0x836b, 0x8750, 0x836c, 0x8751, + 0x836d, 0x8752, 0x836e, 0x8753, 0x836f, 0x8754, 0x8370, 0x8755, 0x8371, 0x8756, 0x8372, 0x8757, 0x8373, 0x8758, 0x8374, 0x8759, 0x8375, 0x875a, + 0x8376, 0x875b, 0x8377, 0x875c, 0x8378, 0x875d, 0x8379, 0x875f, 0x837a, 0x8760, 0x837b, 0x8761, 0x837c, 0x8762, 0x837d, 0x8763, 0x837e, 0x8764, + 0x8380, 0x8765, 0x8381, 0x8766, 0x8382, 0x8767, 0x8383, 0x8768, 0x8384, 0x8769, 0x8385, 0x876a, 0x8386, 0x876b, 0x8387, 0x876c, 0x8388, 0x876d, + 0x8389, 0x876e, 0x838a, 0x876f, 0x838b, 0x8770, 0x838c, 0x8771, 0x838d, 0x8772, 0x838e, 0x8773, 0x838f, 0x8774, 0x8390, 0x8775, 0x8391, 0x877e, + 0x8392, 0x8780, 0x8393, 0x8781, 0x824f, 0x8782, 0x8250, 0x8783, 0x8251, 0x8784, 0x8252, 0x8785, 0x8253, 0x8786, 0x8254, 0x8787, 0x8255, 0x8788, + 0x8256, 0x8789, 0x8257, 0x878a, 0x8258, 0x878b, 0x8141, 0x878c, 0x815b, 0x878d, 0x8175, 0x878e, 0x8176, 0x878f, }; struct fopMsgM_pane_alpha_class; - /* 8002ABB4-8002AC1C .text drawSelf__9MyPictureFff */ -void MyPicture::drawSelf(f32 x, f32 y) { +void MyPicture::drawSelf(f32 i_posx, f32 i_posy) { Mtx mtx; MTXIdentity(mtx); - drawSelf(x, y, &mtx); + drawSelf(i_posx, i_posy, &mtx); } /* 8002AC1C-8002AC90 .text drawSelf__9MyPictureFffPA3_A4_f */ -void MyPicture::drawSelf(f32 x, f32 y, Mtx* mtx) { - if(mpTexture[0]) { - drawFullSet2(mGlobalBounds.i.x + x, mGlobalBounds.i.y + y, mBounds.getWidth(), mBounds.getHeight(), J2DBinding(mBinding), getMirror(), isTumble(), mtx); +void MyPicture::drawSelf(f32 i_posx, f32 i_posy, Mtx* i_mtx) { + if (mpTexture[0]) { + drawFullSet2(mGlobalBounds.i.x + i_posx, mGlobalBounds.i.y + i_posy, mBounds.getWidth(), mBounds.getHeight(), J2DBinding(mBinding), getMirror(), isTumble(), i_mtx); } } /* 8002AC90-8002AD4C .text drawFullSet2__9MyPictureFffff10J2DBinding9J2DMirrorbPA3_A4_f */ -void MyPicture::drawFullSet2(f32 x, f32 y, f32 width, f32 height, J2DBinding binding, J2DMirror mirror, bool tumble, Mtx* mtx) { +void MyPicture::drawFullSet2(f32 i_posx, f32 i_posy, f32 i_width, f32 i_height, J2DBinding i_binding, J2DMirror i_mirror, bool i_tumble, Mtx* i_mtx) { f32 s0, t0, s1, t1; s0 = m124; s1 = m12C; t0 = m128; t1 = m130; - if (mirror & J2DMirror_X) { + if (i_mirror & J2DMirror_X) { f32 tmp = s0; s0 = s1; s1 = tmp; } - if (mirror & J2DMirror_Y) { + if (i_mirror & J2DMirror_Y) { f32 tmp = t0; t0 = t1; t1 = tmp; } - if(m134) { - if(!tumble) { - drawTexCoord(0.0f, 0.0f, width, height, s0, t0, s1, t0, s0, t1, s1, t1, mtx); - } - else { - drawTexCoord(0.0f, 0.0f, width, height, s0, t1, s0, t0, s1, t1, s1, t0, mtx); + if (m134) { + if (!i_tumble) { + drawTexCoord(0.0f, 0.0f, i_width, i_height, s0, t0, s1, t0, s0, t1, s1, t1, i_mtx); + } else { + drawTexCoord(0.0f, 0.0f, i_width, i_height, s0, t1, s0, t0, s1, t1, s1, t0, i_mtx); } - } - else { - drawFullSet(x, y, width, height, binding, mirror, tumble, mtx); + } else { + drawFullSet(i_posx, i_posy, i_width, i_height, i_binding, i_mirror, i_tumble, i_mtx); } } #if VERSION >= VERSION_USA /* 8002AD4C-8002AE28 .text fopMsgM_hyrule_language_check__FUl */ -bool fopMsgM_hyrule_language_check(u32 msgNo) { - if(dComIfGs_getClearCount() != 0) { +bool fopMsgM_hyrule_language_check(u32 i_msgNo) { + if (dComIfGs_getClearCount() != 0) { return false; } - switch(msgNo) { + switch (i_msgNo) { case 0xD49: case 0xD4B: case 0xD4D: @@ -225,52 +213,52 @@ bool fopMsgM_hyrule_language_check(u32 msgNo) { #endif /* 8002AE28-8002AED4 .text fopMsgM_setStageLayer__FPv */ -s32 fopMsgM_setStageLayer(void* proc) { +s32 fopMsgM_setStageLayer(void* i_proc) { scene_class* stageProc = fopScnM_SearchByID(dStage_roomControl_c::getProcID()); JUT_ASSERT(VERSION_SELECT(0x15C, 0x15C, 0x189, 0x189), stageProc != NULL); u32 layer = fpcM_LayerID(stageProc); - return fpcM_ChangeLayerID(proc, layer); + return fpcM_ChangeLayerID(i_proc, layer); } /* 8002AED4-8002AEF4 .text fopMsgM_SearchByID__FUi */ -msg_class* fopMsgM_SearchByID(fpc_ProcID pid) { - return (msg_class*)fpcEx_SearchByID(pid); +msg_class* fopMsgM_SearchByID(fpc_ProcID i_pid) { + return (msg_class*)fpcEx_SearchByID(i_pid); } /* 8002AEF4-8002AF24 .text fopMsgM_SearchByName__Fs */ -msg_class* fopMsgM_SearchByName(s16 proc_name) { - return (msg_class*)fpcLyIt_AllJudge(fpcSch_JudgeForPName, &proc_name); +msg_class* fopMsgM_SearchByName(s16 i_name) { + return (msg_class*)fpcLyIt_AllJudge(fpcSch_JudgeForPName, &i_name); } /* 8002AF24-8002AF44 .text fopMsgM_IsExecuting__FUi */ -BOOL fopMsgM_IsExecuting(fpc_ProcID pid) { - return fpcEx_IsExist(pid); +BOOL fopMsgM_IsExecuting(fpc_ProcID i_pid) { + return fpcEx_IsExist(i_pid); } /* 8002AF44-8002AF4C .text fopMsgM_GetAppend__FPv */ -fopMsg_prm_class* fopMsgM_GetAppend(void* i_this) { - return (fopMsg_prm_class*) fpcM_GetAppend(i_this); +fopMsg_prm_class* fopMsgM_GetAppend(void* i_proc) { + return (fopMsg_prm_class*)fpcM_GetAppend(i_proc); } /* 8002AF4C-8002AF6C .text fopMsgM_Delete__FPv */ -void fopMsgM_Delete(void* i_this) { - fpcM_Delete(i_this); +void fopMsgM_Delete(void* i_proc) { + fpcM_Delete(i_proc); } /* 8002AF6C-8002B030 .text createAppend__FP10fopAc_ac_cP4cXyzPUlPUlUi */ -fopMsg_prm_class* createAppend(fopAc_ac_c* actor, cXyz* pos, u32* msg_no, u32* p4, uint p5) { - fopMsg_prm_class* params = (fopMsg_prm_class*) cMl::memalignB(-4, sizeof(fopMsg_prm_class)); +fopMsg_prm_class* createAppend(fopAc_ac_c* i_actor, cXyz* i_pos, u32* i_msgNo, u32* p4, uint p5) { + fopMsg_prm_class* params = (fopMsg_prm_class*)cMl::memalignB(-4, sizeof(fopMsg_prm_class)); if (params == NULL) return NULL; - params->mpActor = actor; - if (msg_no != NULL) - params->mMsgNo = *msg_no; + params->mpActor = i_actor; + if (i_msgNo != NULL) + params->mMsgNo = *i_msgNo; if (p4 != NULL) params->field_0x14 = *p4; - if (pos != NULL) { - params->mPos = *pos; + if (i_pos != NULL) { + params->mPos = *i_pos; } else { cXyz zero; zero.setall(0.0f); @@ -291,7 +279,7 @@ struct fopMsg_prm_MGameTerm : public fopMsg_prm_class { /* 8002B030-8002B0CC .text createMGameTermAppend__FssiiUi */ fopMsg_prm_MGameTerm* createMGameTermAppend(s16 param_1, s16 param_2, int param_3, int param_4, uint param_5) { fopMsg_prm_MGameTerm* req = (fopMsg_prm_MGameTerm*)cMl::memalignB(-4, sizeof(fopMsg_prm_MGameTerm)); - if(req == NULL) { + if (req == NULL) { return NULL; } @@ -310,10 +298,9 @@ fopMsg_prm_MGameTerm* createMGameTermAppend(s16 param_1, s16 param_2, int param_ } /* 8002B0CC-8002B1C8 .text createTimerAppend__FiUsUcUcffffUi */ -fopMsg_prm_timer* createTimerAppend(int param_1, u16 param_2, u8 param_3, u8 param_4, f32 param_5, f32 param_6, f32 param_7, f32 param_8, uint param_9) { +fopMsg_prm_timer* createTimerAppend(int i_mode, u16 i_limitTimeMs, u8 i_showType, u8 i_iconType, f32 i_posX, f32 i_posY, f32 i_rupeePosX, f32 i_rupeePosY, uint param_9) { fopMsg_prm_timer* req = (fopMsg_prm_timer*)cMl::memalignB(-4, sizeof(fopMsg_prm_timer)); - if (req == NULL) - { + if (req == NULL) { return NULL; } @@ -323,67 +310,65 @@ fopMsg_prm_timer* createTimerAppend(int param_1, u16 param_2, u8 param_3, u8 par cXyz temp(0.0f, 0.0f, 0.0f); req->mPos = temp; req->field_0x18 = param_9; - req->mTimerMode = param_1; - req->mLimitTimeMs = param_2; - req->mShowType = param_3; - req->mIconType = param_4; - req->mTimerPos.x = param_5; - req->mTimerPos.y = param_6; - req->mRupeePos.x = param_7; - req->mRupeePos.y = param_8; + req->mTimerMode = i_mode; + req->mLimitTimeMs = i_limitTimeMs; + req->mShowType = i_showType; + req->mIconType = i_iconType; + req->mTimerPos.x = i_posX; + req->mTimerPos.y = i_posY; + req->mRupeePos.x = i_rupeePosX; + req->mRupeePos.y = i_rupeePosY; return req; } /* 8002B1C8-8002B23C .text fopMsgM_create__FsP10fopAc_ac_cP4cXyzPUlPUlPFPv_i */ -fpc_ProcID fopMsgM_create(s16 param_1, fopAc_ac_c* param_2, cXyz* param_3, u32* param_4, u32* param_5, fopMsgCreateFunc param_6) { - fopMsg_prm_class* appen = createAppend(param_2, param_3, param_4, param_5, -1); - if(appen == NULL) { +fpc_ProcID fopMsgM_create(s16 i_procName, fopAc_ac_c* i_actor, cXyz* i_pos, u32* i_msgNo, u32* param_5, fopMsgCreateFunc i_createFunc) { + fopMsg_prm_class* appen = createAppend(i_actor, i_pos, i_msgNo, param_5, -1); + if (appen == NULL) { return fpcM_ERROR_PROCESS_ID_e; } - return fpcSCtRq_Request(fpcLy_CurrentLayer(), param_1, (stdCreateFunc)param_6, NULL, appen); + return fpcSCtRq_Request(fpcLy_CurrentLayer(), i_procName, (stdCreateFunc)i_createFunc, NULL, appen); } /* 8002B23C-8002B2B0 .text fop_MGameTerm_create__FsssiiPFPv_i */ -fpc_ProcID fop_MGameTerm_create(s16 param_1, s16 param_2, s16 param_3, int param_4, int param_5, fopMsgCreateFunc param_6) { +fpc_ProcID fop_MGameTerm_create(s16 i_procName, s16 param_2, s16 param_3, int param_4, int param_5, fopMsgCreateFunc i_createFunc) { fopMsg_prm_MGameTerm* appen = createMGameTermAppend(param_2, param_3, param_4, param_5, -1); - if(appen == NULL) { + if (appen == NULL) { return fpcM_ERROR_PROCESS_ID_e; } - return fpcSCtRq_Request(fpcLy_CurrentLayer(), param_1, (stdCreateFunc)param_6, NULL, appen); + return fpcSCtRq_Request(fpcLy_CurrentLayer(), i_procName, (stdCreateFunc)i_createFunc, NULL, appen); } /* 8002B2B0-8002B324 .text fop_Timer_create__FsUcUsUcUcffffPFPv_i */ -fpc_ProcID fop_Timer_create(s16 param_1, u8 param_2, u16 param_3, u8 param_4, u8 param_5, f32 param_6, f32 param_7, f32 param_8, f32 param_9, fopMsgCreateFunc param_10) { - fopMsg_prm_timer* appen = createTimerAppend(param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, -1); - if(appen == NULL) { +fpc_ProcID fop_Timer_create(s16 i_procName, u8 i_mode, u16 i_limitTimeMs, u8 i_showType, u8 i_iconType, f32 i_posX, f32 i_posY, f32 i_rupeePosX, f32 i_rupeePosY, fopMsgCreateFunc i_createFunc) { + fopMsg_prm_timer* appen = createTimerAppend(i_mode, i_limitTimeMs, i_showType, i_iconType, i_posX, i_posY, i_rupeePosX, i_rupeePosY, -1); + if (appen == NULL) { return fpcM_ERROR_PROCESS_ID_e; } - return fpcSCtRq_Request(fpcLy_CurrentLayer(), param_1, (stdCreateFunc)param_10, NULL, appen); + return fpcSCtRq_Request(fpcLy_CurrentLayer(), i_procName, (stdCreateFunc)i_createFunc, NULL, appen); } /* 8002B324-8002B520 .text fopMsgM_messageTypeSelect__FP10fopAc_ac_cP4cXyzPUlPUl */ -fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* param_1, cXyz* param_2, u32* param_3, u32* param_4) { +fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* i_actor, cXyz* i_pos, u32* i_msgNo, u32* param_4) { fopMsgM_msgGet_c msgGet; msgGet.mMsgIdx = 0; msgGet.mGroupID = 0; msgGet.mMsgNo = 0; - msgGet.mResMsgNo = 0; + msgGet.mResMsgNo = 0; fpc_ProcID pcId; - if(*param_3 >> 0x10 == 0x63) { - pcId = fopMsgM_create(fpcNm_SCP_e, param_1, param_2, param_3, param_4, NULL); - } - else if(*param_3 >> 0x10 == 0x59) { - pcId = fopMsgM_create(fpcNm_PB_e, param_1, param_2, param_3, param_4, NULL); - } - else { - mesg_header* header = msgGet.getMesgHeader(*param_3); - if(header != NULL) { - if(msgGet.getMessage(header) != NULL) { + if (*i_msgNo >> 0x10 == 0x63) { + pcId = fopMsgM_create(fpcNm_SCP_e, i_actor, i_pos, i_msgNo, param_4, NULL); + } else if (*i_msgNo >> 0x10 == 0x59) { + pcId = fopMsgM_create(fpcNm_PB_e, i_actor, i_pos, i_msgNo, param_4, NULL); + } else { + mesg_header* header = msgGet.getMesgHeader(*i_msgNo); + if (header != NULL) { + if (msgGet.getMessage(header) != NULL) { const JMSMesgEntry_c& entry = msgGet.getMesgEntry(header); u16 price = entry.mItemPrice; u16 type = entry.mTextboxType; @@ -391,23 +376,20 @@ fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* param_1, cXyz* param_2, u32* pa dComIfGp_setMesgCameraAttrInfo(entry.mInitialCamera); dComIfGp_setMessageRupee(price); - if(type == 2 || type == 6 || type == 7) { - pcId = fopMsgM_create(fpcNm_MSG2_e, param_1, param_2, param_3, param_4, NULL); - } - else { - pcId = fopMsgM_create(fpcNm_MSG_e, param_1, param_2, param_3, param_4, NULL); + if (type == 2 || type == 6 || type == 7) { + pcId = fopMsgM_create(fpcNm_MSG2_e, i_actor, i_pos, i_msgNo, param_4, NULL); + } else { + pcId = fopMsgM_create(fpcNm_MSG_e, i_actor, i_pos, i_msgNo, param_4, NULL); } + } else { + *i_msgNo = 1; + *param_4 = *i_msgNo; + pcId = fopMsgM_create(fpcNm_MSG_e, i_actor, i_pos, i_msgNo, param_4, NULL); } - else { - *param_3 = 1; - *param_4 = *param_3; - pcId = fopMsgM_create(fpcNm_MSG_e, param_1, param_2, param_3, param_4, NULL); - } - } - else { - *param_3 = 1; - *param_4 = *param_3; - pcId = fopMsgM_create(fpcNm_MSG_e, param_1, param_2, param_3, param_4, NULL); + } else { + *i_msgNo = 1; + *param_4 = *i_msgNo; + pcId = fopMsgM_create(fpcNm_MSG_e, i_actor, i_pos, i_msgNo, param_4, NULL); } JKRFileLoader::removeResource(header, NULL); @@ -417,7 +399,7 @@ fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* param_1, cXyz* param_2, u32* pa } /* 8002B568-8002B634 .text fopMsgM_searchMessageNumber__FUl */ -u32 fopMsgM_searchMessageNumber(u32 msgNo) { +u32 fopMsgM_searchMessageNumber(u32 i_msgNo) { fopMsgM_msgGet_c msgGet; msgGet.mMsgIdx = 0; msgGet.mGroupID = 0; @@ -425,20 +407,20 @@ u32 fopMsgM_searchMessageNumber(u32 msgNo) { msgGet.mResMsgNo = 0; mesg_header* header; - for(u32 i = msgNo & 0xFFFF; i < 0xFFFF; i++) { + for (u32 i = i_msgNo & 0xFFFF; i < 0xFFFF; i++) { header = msgGet.getMesgHeader(i); - if(header != NULL && msgGet.getMessage(header) != NULL) { + if (header != NULL && msgGet.getMessage(header) != NULL) { return i; } JKRFileLoader::removeResource(header, NULL); } - return msgNo; + return i_msgNo; } /* 8002B634-8002B778 .text fopMsgM_messageSet__FUlP10fopAc_ac_c */ -fpc_ProcID fopMsgM_messageSet(u32 msgNo, fopAc_ac_c* pActor) { +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo, fopAc_ac_c* i_actor) { if (dComIfGp_isHeapLockFlag() != 0 && dComIfGp_isHeapLockFlag() != 7 && dComIfGp_isHeapLockFlag() != 8 && dComIfGp_isHeapLockFlag() != 9) { return fpcM_ERROR_PROCESS_ID_e; } @@ -446,33 +428,30 @@ fpc_ProcID fopMsgM_messageSet(u32 msgNo, fopAc_ac_c* pActor) { dComIfGp_clearMesgAnimeTagInfo(); dComIfGp_clearMesgCameraTagInfo(); - cXyz lookAtPos = pActor->eyePos; - if(i_msgID == fpcM_ERROR_PROCESS_ID_e) { - i_msgID = fopMsgM_messageTypeSelect(pActor, &lookAtPos, &msgNo, &msgNo); - } - else if(fopMsgM_IsExecuting(i_msgID)) { + cXyz lookAtPos = i_actor->eyePos; + if (i_msgID == fpcM_ERROR_PROCESS_ID_e) { + i_msgID = fopMsgM_messageTypeSelect(i_actor, &lookAtPos, &i_msgNo, &i_msgNo); + } else if (fopMsgM_IsExecuting(i_msgID)) { msg_class* pMsg = fopMsgM_SearchByID(i_msgID); - if(pMsg == NULL) { + if (pMsg == NULL) { i_msgID = fpcM_ERROR_PROCESS_ID_e; - } - else { - pMsg->mMsgNo = msgNo; - pMsg->field_0xf0 = msgNo; - if(fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { + } else { + pMsg->mMsgNo = i_msgNo; + pMsg->field_0xf0 = i_msgNo; + if (fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { fopMsgM_Delete(pMsg); i_msgID = fpcM_ERROR_PROCESS_ID_e; } } - } - else { - i_msgID = fopMsgM_messageTypeSelect(pActor, &lookAtPos, &msgNo, &msgNo); + } else { + i_msgID = fopMsgM_messageTypeSelect(i_actor, &lookAtPos, &i_msgNo, &i_msgNo); } return i_msgID; } /* 8002B778-8002B8A4 .text fopMsgM_messageSet__FUlP4cXyz */ -fpc_ProcID fopMsgM_messageSet(u32 msgNo, cXyz* lookAtPos) { +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo, cXyz* i_lookAtPos) { if (dComIfGp_isHeapLockFlag() != 0 && dComIfGp_isHeapLockFlag() != 7 && dComIfGp_isHeapLockFlag() != 8 && dComIfGp_isHeapLockFlag() != 9) { return fpcM_ERROR_PROCESS_ID_e; } @@ -480,76 +459,69 @@ fpc_ProcID fopMsgM_messageSet(u32 msgNo, cXyz* lookAtPos) { dComIfGp_clearMesgAnimeTagInfo(); dComIfGp_clearMesgCameraTagInfo(); - if(i_msgID == fpcM_ERROR_PROCESS_ID_e) { - i_msgID = fopMsgM_messageTypeSelect(NULL, lookAtPos, &msgNo, &msgNo); - } - else if(fopMsgM_IsExecuting(i_msgID)) { + if (i_msgID == fpcM_ERROR_PROCESS_ID_e) { + i_msgID = fopMsgM_messageTypeSelect(NULL, i_lookAtPos, &i_msgNo, &i_msgNo); + } else if (fopMsgM_IsExecuting(i_msgID)) { msg_class* pMsg = fopMsgM_SearchByID(i_msgID); - if(pMsg == NULL) { + if (pMsg == NULL) { i_msgID = fpcM_ERROR_PROCESS_ID_e; - } - else { - pMsg->mMsgNo = msgNo; - pMsg->field_0xf0 = msgNo; - if(fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { + } else { + pMsg->mMsgNo = i_msgNo; + pMsg->field_0xf0 = i_msgNo; + if (fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { fopMsgM_Delete(pMsg); i_msgID = fpcM_ERROR_PROCESS_ID_e; } } - } - else { - i_msgID = fopMsgM_messageTypeSelect(NULL, lookAtPos, &msgNo, &msgNo); + } else { + i_msgID = fopMsgM_messageTypeSelect(NULL, i_lookAtPos, &i_msgNo, &i_msgNo); } return i_msgID; } /* 8002B8A4-8002B9C4 .text fopMsgM_messageSet__FUl */ -fpc_ProcID fopMsgM_messageSet(u32 msgNo) { +fpc_ProcID fopMsgM_messageSet(u32 i_msgNo) { if (dComIfGp_isHeapLockFlag() != 0 && dComIfGp_isHeapLockFlag() != 7 && dComIfGp_isHeapLockFlag() != 8 && dComIfGp_isHeapLockFlag() != 9) { return fpcM_ERROR_PROCESS_ID_e; } cXyz lookAtPos; lookAtPos.x = lookAtPos.y = lookAtPos.z = 0.0f; - if(i_msgID == fpcM_ERROR_PROCESS_ID_e) { - i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &msgNo, &msgNo); - } - else if(fopMsgM_IsExecuting(i_msgID)) { + if (i_msgID == fpcM_ERROR_PROCESS_ID_e) { + i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &i_msgNo, &i_msgNo); + } else if (fopMsgM_IsExecuting(i_msgID)) { msg_class* pMsg = fopMsgM_SearchByID(i_msgID); - if(pMsg == NULL) { + if (pMsg == NULL) { i_msgID = fpcM_ERROR_PROCESS_ID_e; - } - else { - pMsg->mMsgNo = msgNo; - pMsg->field_0xf0 = msgNo; - if(fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { + } else { + pMsg->mMsgNo = i_msgNo; + pMsg->field_0xf0 = i_msgNo; + if (fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { fopMsgM_Delete(pMsg); i_msgID = fpcM_ERROR_PROCESS_ID_e; } } - } - else { - i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &msgNo, &msgNo); + } else { + i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &i_msgNo, &i_msgNo); } return i_msgID; } /* 8002B9C4-8002BA4C .text fopMsgM_scopeMessageSet__FUl */ -fpc_ProcID fopMsgM_scopeMessageSet(u32 msgNo) { - if(fopMsgM_IsExecuting(i_msgID)) { +fpc_ProcID fopMsgM_scopeMessageSet(u32 i_msgNo) { + if (fopMsgM_IsExecuting(i_msgID)) { msg_class* pMsg = fopMsgM_SearchByID(i_msgID); - if(pMsg == NULL) { + if (pMsg == NULL) { i_msgID = fpcM_ERROR_PROCESS_ID_e; - } - else { - if(dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e) && dComIfGp_getScopeMesgStatus() == fopMsgStts_UNKB_e) { + } else { + if (dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e) && dComIfGp_getScopeMesgStatus() == fopMsgStts_UNKB_e) { dComIfGp_setScopeMesgStatus(fopMsgStts_BOX_OPENING_e); } - pMsg->mMsgNo = msgNo; - pMsg->field_0xf0 = msgNo; + pMsg->mMsgNo = i_msgNo; + pMsg->field_0xf0 = i_msgNo; } } @@ -565,25 +537,22 @@ u32 fopMsgM_tactMessageSet() { u32 msgNoTemp = 0x5AC; cXyz lookAtPos; lookAtPos.x = lookAtPos.y = lookAtPos.z = 0.0f; - if(i_msgID == fpcM_ERROR_PROCESS_ID_e) { + if (i_msgID == fpcM_ERROR_PROCESS_ID_e) { i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &msgNoTemp, &msgNoTemp); fopMsgM_tactMsgFlagOn(); - } - else if(fopMsgM_IsExecuting(i_msgID)) { + } else if (fopMsgM_IsExecuting(i_msgID)) { msg_class* pMsg = fopMsgM_SearchByID(i_msgID); - if(pMsg == NULL) { + if (pMsg == NULL) { i_msgID = fpcM_ERROR_PROCESS_ID_e; - } - else { + } else { pMsg->mMsgNo = msgNoTemp; pMsg->field_0xf0 = msgNoTemp; - if(fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { + if (fopMsgM_SearchByName(fpcNm_SCP_e) || fopMsgM_SearchByName(fpcNm_PB_e)) { fopMsgM_Delete(pMsg); i_msgID = fpcM_ERROR_PROCESS_ID_e; } } - } - else { + } else { i_msgID = fopMsgM_messageTypeSelect(NULL, &lookAtPos, &msgNoTemp, &msgNoTemp); fopMsgM_tactMsgFlagOn(); } @@ -592,54 +561,52 @@ u32 fopMsgM_tactMessageSet() { } /* 8002BB78-8002BDBC .text fopMsgM_messageGet__FPcUl */ -char* fopMsgM_messageGet(char* dst, u32 msgNo) { +char* fopMsgM_messageGet(char* i_dest, u32 i_msgNo) { fopMsgM_itemMsgGet_c msgGet; - mesg_header* head_p = msgGet.getMesgHeader(msgNo); + mesg_header* head_p = msgGet.getMesgHeader(i_msgNo); JUT_ASSERT(VERSION_SELECT(0x690, 0x690, 0x6BD, 0x6BD), head_p); const char* src = msgGet.getMessage(head_p); const char* cursor = src; - char* dstPtr = dst; + char* dstPtr = i_dest; char dstBuf[20]; s32 current; - while(current = *cursor, *cursor != '\0') { - if((u8)*cursor == 0x1A) { + while (current = *cursor, *cursor != '\0') { + if ((u8)*cursor == 0x1A) { u32 next_as_int = *(u32*)(++cursor); if ((next_as_int & 0xFFFFFF) == 0x1E) { *dstPtr = 0x1A; dstPtr++; - } - else if ((next_as_int & 0xFFFFFF) == 0) { + } else if ((next_as_int & 0xFFFFFF) == 0) { #if VERSION > VERSION_JPN // There are some modifications done to the player name before // writing it to the dst pointer when the language is set to German. strcpy(dstBuf, dComIfGs_getPlayerName()); - if( - dComIfGs_getPalLanguage() == 1 && + if (dComIfGs_getPalLanguage() == 1 && ( #if VERSION == VERSION_PAL - // Version is PAL - msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 + // Version is PAL + i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 #else - // Version is USA, we know it's not DEMO or JPN because of the outer #if - msgNo == 0x33B || msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 || msgNo == 0x37DD || msgNo == 0x37DE + // Version is USA, we know it's not DEMO or JPN because of the outer #if + i_msgNo == 0x33B || i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 || i_msgNo == 0x37DD || + i_msgNo == 0x37DE #endif ) ) { s32 bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; - if(current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); - } - else { + } else { strcat(dstBuf, "s"); } } - for (char* bufPtr = dstBuf; *bufPtr != '\0'; bufPtr ++) { + for (char* bufPtr = dstBuf; *bufPtr != '\0'; bufPtr++) { *dstPtr = *bufPtr; dstPtr++; } @@ -647,7 +614,7 @@ char* fopMsgM_messageGet(char* dst, u32 msgNo) { // In the JPN and DEMO versions, the player name is just written // to dst directly. - for (const char* bufPtr = dComIfGs_getPlayerName(); *bufPtr != '\0'; bufPtr ++) { + for (const char* bufPtr = dComIfGs_getPlayerName(); *bufPtr != '\0'; bufPtr++) { *dstPtr = *bufPtr; dstPtr++; } @@ -655,38 +622,36 @@ char* fopMsgM_messageGet(char* dst, u32 msgNo) { } cursor += *cursor - 1; - } - else { + } else { int shifted = ((u32)*cursor >> 4) & 0xF; - if((shifted == 8 || shifted == 9) && VERSION != VERSION_PAL) { + if ((shifted == 8 || shifted == 9) && VERSION != VERSION_PAL) { *(dstPtr++) = *(cursor++); *(dstPtr++) = *(cursor++); - } - else { + } else { *(dstPtr++) = *(cursor++); } } } *dstPtr = '\0'; - return dst; + return i_dest; } /* 8002BE04-8002C02C .text fopMsgM_passwordGet__FPcUl */ -char* fopMsgM_passwordGet(char* dst, u32 msgNo) { +char* fopMsgM_passwordGet(char* i_dest, u32 i_msgNo) { fopMsgM_itemMsgGet_c msgGet; - mesg_header* head_p = msgGet.getMesgHeader(msgNo); + mesg_header* head_p = msgGet.getMesgHeader(i_msgNo); JUT_ASSERT(VERSION_SELECT(0x6F6, 0x6F6, 0x735, 0x739), head_p); const char* src = msgGet.getMessage(head_p); const char* cursor = src; - char* dstPtr = dst; + char* dstPtr = i_dest; char dstBuf[20]; s32 current; - while(current = *cursor, *cursor != '\0') { - if((u8)*cursor == 0x1A) { + while (current = *cursor, *cursor != '\0') { + if ((u8)*cursor == 0x1A) { u32 next_as_int = *(u32*)(++cursor); if ((next_as_int & 0xFFFFFF) == 0) { #if VERSION > VERSION_JPN @@ -694,29 +659,28 @@ char* fopMsgM_passwordGet(char* dst, u32 msgNo) { // writing it to the dst pointer when the language is set to German. strcpy(dstBuf, dComIfGs_getPlayerName()); - if( - dComIfGs_getPalLanguage() == 1 && + if (dComIfGs_getPalLanguage() == 1 && ( #if VERSION == VERSION_PAL - // Version is PAL - msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 + // Version is PAL + i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 #else - // Version is USA, we know it's not DEMO or JPN because of the outer #if - msgNo == 0x33B || msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 || msgNo == 0x37DD || msgNo == 0x37DE + // Version is USA, we know it's not DEMO or JPN because of the outer #if + i_msgNo == 0x33B || i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 || i_msgNo == 0x37DD || + i_msgNo == 0x37DE #endif ) ) { s32 bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; - if(current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); - } - else { + } else { strcat(dstBuf, "s"); } } - for (char* bufPtr = dstBuf; *bufPtr != '\0'; bufPtr ++) { + for (char* bufPtr = dstBuf; *bufPtr != '\0'; bufPtr++) { *dstPtr = *bufPtr; dstPtr++; } @@ -724,7 +688,7 @@ char* fopMsgM_passwordGet(char* dst, u32 msgNo) { // In the JPN and DEMO versions, the player name is just written // to dst directly. - for (const char* bufPtr = dComIfGs_getPlayerName(); *bufPtr != '\0'; bufPtr ++) { + for (const char* bufPtr = dComIfGs_getPlayerName(); *bufPtr != '\0'; bufPtr++) { *dstPtr = *bufPtr; dstPtr++; } @@ -732,41 +696,45 @@ char* fopMsgM_passwordGet(char* dst, u32 msgNo) { } cursor += *cursor - 1; - } - else { + } else { int shifted = ((u32)*cursor >> 4) & 0xF; - if((shifted == 8 || shifted == 9) && VERSION != VERSION_PAL) { + if ((shifted == 8 || shifted == 9) && VERSION != VERSION_PAL) { *(dstPtr++) = *(cursor++); *(dstPtr++) = *(cursor++); - } - else { + } else { *(dstPtr++) = *(cursor++); } } } *dstPtr = '\0'; - return dst; + return i_dest; } static f32 dummyfloat0(int _) { switch (_) { - case 0: return 0.0f; - case 1: return 0.5f; + case 0: + return 0.0f; + case 1: + return 0.5f; } } static f64 dummyfloat1(int _) { switch (_) { - case 0: return 4503601774854144.0; - case 1: return 0.5; - case 2: return 3.0; + case 0: + return 4503601774854144.0; + case 1: + return 0.5; + case 2: + return 3.0; } } static f32 dummyfloat2(int _) { switch (_) { - case 0: return 2.0f; + case 0: + return 2.0f; } } @@ -783,7 +751,7 @@ struct fopMsgM_unk_struct { }; /* 8002C02C-8002C568 .text fopMsgM_selectMessageGet__FP7J2DPaneP7J2DPanePcPcPcPcUl */ -fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* param_1, J2DPane* param_2, char* param_3, char* param_4, char* param_5, char* param_6, u32 param_7) { +fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* i_textPane, J2DPane* i_rubyPane, char* param_3, char* param_4, char* param_5, char* param_6, u32 i_msgNo) { fopMsgM_msgDataProc_c msgData; fopMsgM_itemMsgGet_c msgGet; @@ -794,30 +762,30 @@ fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* param_1, J2DPane* param_2, J2DTextBox::TFontSize size; J2DTextBox::TFontSize size2; - ((J2DTextBox*)param_2)->getFontSize(size); - ((J2DTextBox*)param_1)->getFontSize(size2); + ((J2DTextBox*)i_rubyPane)->getFontSize(size); + ((J2DTextBox*)i_textPane)->getFontSize(size2); - mesg_header* head_p = msgGet.getMesgHeader(param_7); + mesg_header* head_p = msgGet.getMesgHeader(i_msgNo); JUT_ASSERT(1947, head_p); - char* src = (char*)msgGet.getMessage(head_p); + char* bmgData = (char*)msgGet.getMessage(head_p); fopMsgM_unk_struct sp40; JMSMesgEntry_c entry; entry = msgGet.getMesgEntry(head_p); msgData.dataInit(); - msgData.setBmgData(src); + msgData.setBmgData(bmgData); msgData.setOutMessage(param_3, param_4, param_5, param_6); - msgData.setFont(((J2DTextBox*)param_1)->getFont()); - msgData.setRubyFont(((J2DTextBox*)param_2)->getFont()); - msgData.setCharSpace(((J2DTextBox*)param_1)->getCharSpace()); - msgData.setRubyCharSpace(((J2DTextBox*)param_2)->getCharSpace()); - msgData.setLineSpace(((J2DTextBox*)param_1)->getLineSpace()); + msgData.setFont(((J2DTextBox*)i_textPane)->getFont()); + msgData.setRubyFont(((J2DTextBox*)i_rubyPane)->getFont()); + msgData.setCharSpace(((J2DTextBox*)i_textPane)->getCharSpace()); + msgData.setRubyCharSpace(((J2DTextBox*)i_rubyPane)->getCharSpace()); + msgData.setLineSpace(((J2DTextBox*)i_textPane)->getLineSpace()); msgData.setMesgEntry(&entry); msgData.setFontSize(size2.mSizeX); msgData.setRubyFontSize(size.mSizeX); - msgData.setLineWidth(param_1->getWidth()); - msgData.setCenterLineWidth(param_1->getWidth()); + msgData.setLineWidth(i_textPane->getWidth()); + msgData.setCenterLineWidth(i_textPane->getWidth()); msgData.setSendSpeed(2); msgData.setSpaceTimer(0); msgData.shortCut(); @@ -825,22 +793,22 @@ fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* param_1, J2DPane* param_2, msgData.stringLength(); msgData.stringShift(); msgData.iconIdxRefresh(); - + s16 temp_r3 = msgData.getLineCount(); msgData.setLineCount(0); int temp_r30_2 = 2 - temp_r3; - f32 fVar2 = temp_r30_2 * (((J2DTextBox*)param_1)->getLineSpace() / 2); - ((J2DTextBox*)param_2)->shiftSet(0.0f, fVar2); - ((J2DTextBox*)param_1)->shiftSet(0.0f, fVar2); + f32 fVar2 = temp_r30_2 * (((J2DTextBox*)i_textPane)->getLineSpace() / 2); + ((J2DTextBox*)i_rubyPane)->shiftSet(0.0f, fVar2); + ((J2DTextBox*)i_textPane)->shiftSet(0.0f, fVar2); msgData.stringSet(); - ((J2DTextBox*)param_1)->setString(param_3); - ((J2DTextBox*)param_2)->setString(param_4); + ((J2DTextBox*)i_textPane)->setString(param_3); + ((J2DTextBox*)i_rubyPane)->setString(param_4); - int temp_r5 = ((J2DTextBox*)param_1)->getLineSpace() / 2; - s16 temp_r6 = ((J2DTextBox*)param_1)->getBounds().i.x; - s16 temp_r3_3 = ((J2DTextBox*)param_1)->getBounds().i.y; + int temp_r5 = ((J2DTextBox*)i_textPane)->getLineSpace() / 2; + s16 temp_r6 = ((J2DTextBox*)i_textPane)->getBounds().i.x; + s16 temp_r3_3 = ((J2DTextBox*)i_textPane)->getBounds().i.y; u8 var_r7 = false; for (int i = 0; i < 15; i++) { @@ -889,7 +857,6 @@ bool fopMsgM_demoMsgFlagCheck() { return demoFlag; } - /* 8002C588-8002C594 .text fopMsgM_tactMsgFlagOn__Fv */ void fopMsgM_tactMsgFlagOn() { tactFlag = true; @@ -917,11 +884,11 @@ bool fopMsgM_nextMsgFlagCheck() { /* 8002C5BC-8002C624 .text fopMsgM_getScopeMode__Fv */ bool fopMsgM_getScopeMode() { - if(dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e) && dComIfGp_getScopeMesgStatus() == fopMsgStts_UNKB_e && !dComIfGp_event_runCheck()) { + if (dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e) && dComIfGp_getScopeMesgStatus() == fopMsgStts_UNKB_e && !dComIfGp_event_runCheck()) { dComIfGp_setScopeMesgStatus(fopMsgStts_UNKD_e); return true; } - if(dComIfGp_getScopeMesgStatus() == fopMsgStts_BOX_CLOSING_e) { + if (dComIfGp_getScopeMesgStatus() == fopMsgStts_BOX_CLOSING_e) { dComIfGp_setMesgStatus(fopMsgStts_UNKD_e); return true; } @@ -1029,491 +996,461 @@ static GXColor fopMsgM_buttonW[] = { }; /* 8002C6B0-8002C6C4 .text fopMsgM_outFontTex__Fi */ -const char* fopMsgM_outFontTex(int i) { - return fopMsgM_buttonTex[i]; +const char* fopMsgM_outFontTex(int i_no) { + return fopMsgM_buttonTex[i_no]; } /* 8002C6C4-8002C6D8 .text fopMsgM_outFontColorWhite__Fi */ -GXColor fopMsgM_outFontColorWhite(int i) { - return fopMsgM_buttonW[i]; +GXColor fopMsgM_outFontColorWhite(int i_no) { + return fopMsgM_buttonW[i_no]; } /* 8002C6D8-8002C9B0 .text fopMsgM_outFontSet__FP10J2DPictureP10J2DPicturePsUlUc */ -void fopMsgM_outFontSet(J2DPicture* param_1, J2DPicture* param_2, s16* param_3, u32 param_4, u8 param_5) { +void fopMsgM_outFontSet(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, s16* i_timer, u32 i_color, u8 i_iconNo) { /* Nonmatching */ - if(param_5 == 0x17) { - param_5 = 0x14; - } - else if(param_5 == 0x18) { - param_5 = 0x15; - } - else if(param_5 == 0x19) { - param_5 = 0x16; - } - else if(param_5 == 0x1A) { - param_5 = 0x17; - } - - param_1->show(); - param_2->show(); - fopMsgM_blendDraw(param_1, fopMsgM_buttonTex[param_5]); - fopMsgM_blendDraw(param_2, fopMsgM_buttonTex[param_5]); - if(param_5 == 0xA || param_5 == 0xB || param_5 == 0xC || param_5 == 0xD || param_5 == 0x15 || param_5 == 0x17) { + if (i_iconNo == 0x17) { + i_iconNo = 0x14; + } else if (i_iconNo == 0x18) { + i_iconNo = 0x15; + } else if (i_iconNo == 0x19) { + i_iconNo = 0x16; + } else if (i_iconNo == 0x1A) { + i_iconNo = 0x17; + } + + i_iconPic->show(); + i_sdwPic->show(); + fopMsgM_blendDraw(i_iconPic, fopMsgM_buttonTex[i_iconNo]); + fopMsgM_blendDraw(i_sdwPic, fopMsgM_buttonTex[i_iconNo]); + if (i_iconNo == 0xA || i_iconNo == 0xB || i_iconNo == 0xC || i_iconNo == 0xD || i_iconNo == 0x15 || i_iconNo == 0x17) { GXColor col; - col.r = param_4 >> 0x18; - col.g = param_4 >> 0x10; - col.b = param_4 >> 0x8; + col.r = i_color >> 0x18; + col.g = i_color >> 0x10; + col.b = i_color >> 0x8; col.a = 0xFF; - param_1->setWhite(col); - param_1->setBlack(0x00000000); - } - else { - param_1->setWhite(fopMsgM_buttonW[param_5]); - param_1->setBlack(0x00000000); + i_iconPic->setWhite(col); + i_iconPic->setBlack(0x00000000); + } else { + i_iconPic->setWhite(fopMsgM_buttonW[i_iconNo]); + i_iconPic->setBlack(0x00000000); } - param_2->setWhite(0x000000FF); - param_2->setBlack(0x00000000); - param_1->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - param_2->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + i_sdwPic->setWhite(0x000000FF); + i_sdwPic->setBlack(0x00000000); + i_iconPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + i_sdwPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - *param_3 = 0; + *i_timer = 0; } /* 8002C9B0-8002CBDC .text fopMsgM_outFontSet__FP10J2DPicturePsUlUc */ -void fopMsgM_outFontSet(J2DPicture* param_1, s16* param_2, u32 param_3, u8 param_4) { +void fopMsgM_outFontSet(J2DPicture* i_iconPic, s16* i_timer, u32 i_color, u8 i_iconNo) { /* Nonmatching */ - if(param_4 == 0x17) { - param_4 = 0x14; - } - else if(param_4 == 0x18) { - param_4 = 0x15; - } - else if(param_4 == 0x19) { - param_4 = 0x16; - } - else if(param_4 == 0x1A) { - param_4 = 0x17; - } - - param_1->show(); - fopMsgM_blendDraw(param_1, fopMsgM_buttonTex[param_4]); - if(param_4 == 0xA || param_4 == 0xB || param_4 == 0xC || param_4 == 0xD || param_4 == 0x15 || param_4 == 0x17) { + if (i_iconNo == 0x17) { + i_iconNo = 0x14; + } else if (i_iconNo == 0x18) { + i_iconNo = 0x15; + } else if (i_iconNo == 0x19) { + i_iconNo = 0x16; + } else if (i_iconNo == 0x1A) { + i_iconNo = 0x17; + } + + i_iconPic->show(); + fopMsgM_blendDraw(i_iconPic, fopMsgM_buttonTex[i_iconNo]); + if (i_iconNo == 0xA || i_iconNo == 0xB || i_iconNo == 0xC || i_iconNo == 0xD || i_iconNo == 0x15 || i_iconNo == 0x17) { GXColor col; - col.r = param_3 >> 0x18; - col.g = param_3 >> 0x10; - col.b = param_3 >> 0x8; + col.r = i_color >> 0x18; + col.g = i_color >> 0x10; + col.b = i_color >> 0x8; col.a = 0xFF; - param_1->setWhite(col); + i_iconPic->setWhite(col); GXColor col2 = {0, 0, 0, 0}; - param_1->setBlack(0x00000000); - } - else { - param_1->setWhite(fopMsgM_buttonW[param_4]); - param_1->setBlack(0x00000000); + i_iconPic->setBlack(0x00000000); + } else { + i_iconPic->setWhite(fopMsgM_buttonW[i_iconNo]); + i_iconPic->setBlack(0x00000000); } - param_1->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + i_iconPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - *param_2 = 0; + *i_timer = 0; } /* 8002CBDC-8002CEB0 .text fopMsgM_outFontStickAnimePiece__FP10J2DPictureP10J2DPicturess */ -void fopMsgM_outFontStickAnimePiece(J2DPicture* param_1, J2DPicture* param_2, s16 param_3, s16 param_4) { +void fopMsgM_outFontStickAnimePiece(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, s16 param_3, s16 param_4) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; s16 temp2 = g_msgHIO.field_0x88 + temp * param_4; s16 temp3 = g_msgHIO.field_0x87 + temp2; s16 temp4 = g_msgHIO.field_0x89 + temp3; s16 temp5 = g_msgHIO.field_0x87 + temp4; - if(param_3 < temp2) { - param_1->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - param_2->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - } - else if(param_3 < temp3) { + if (param_3 < temp2) { + i_iconPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + i_sdwPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + } else if (param_3 < temp3) { float temp6 = fopMsgM_valueIncrease(temp, param_3 - temp2, 0); - param_1->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); - param_2->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); - } - else if(param_3 < temp4) { - param_1->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); - param_2->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); - } - else if(param_3 < temp5) { + i_iconPic->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); + i_sdwPic->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); + } else if (param_3 < temp4) { + i_iconPic->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); + i_sdwPic->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); + } else if (param_3 < temp5) { float temp6 = fopMsgM_valueIncrease(temp, param_3 - temp4, 0); - param_1->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); - param_2->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); + i_iconPic->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); + i_sdwPic->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); } } /* 8002CEB0-8002D088 .text fopMsgM_outFontStickAnimePiece__FP10J2DPicturess */ -void fopMsgM_outFontStickAnimePiece(J2DPicture* param_1, s16 param_2, s16 param_3) { +void fopMsgM_outFontStickAnimePiece(J2DPicture* i_iconPic, s16 param_2, s16 param_3) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; s16 temp2 = g_msgHIO.field_0x88 + temp * param_3; s16 temp3 = g_msgHIO.field_0x87 + temp2; s16 temp4 = g_msgHIO.field_0x89 + temp3; s16 temp5 = g_msgHIO.field_0x87 + temp4; - if(param_2 < temp2) { - param_1->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); - } - else if(param_2 < temp3) { + if (param_2 < temp2) { + i_iconPic->setBlendRatio(0.0f, 1.0f, 1.0f, 1.0f); + } else if (param_2 < temp3) { float temp6 = fopMsgM_valueIncrease(temp, param_2 - temp2, 0); - param_1->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); - } - else if(param_2 < temp4) { - param_1->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); - } - else if(param_2 < temp5) { + i_iconPic->setBlendRatio(temp6, 1.0f - temp6, 1.0f, 1.0f); + } else if (param_2 < temp4) { + i_iconPic->setBlendRatio(1.0f, 0.0f, 1.0f, 1.0f); + } else if (param_2 < temp5) { float temp6 = fopMsgM_valueIncrease(temp, param_2 - temp4, 0); - param_1->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); + i_iconPic->setBlendRatio(1.0f - temp6, temp6, 1.0f, 1.0f); } } /* 8002D0E4-8002D2B8 .text fopMsgM_outFontStickAnime__FP10J2DPictureP10J2DPicturePiPiiPs */ -void fopMsgM_outFontStickAnime(J2DPicture* param_1, J2DPicture* param_2, int* param_3, int* param_4, int param_5, s16* param_6) { +void fopMsgM_outFontStickAnime(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int* param_3, int* param_4, int param_5, s16* i_timer) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 0); - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 1); + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 0); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 1); *param_3 += param_5; - } - else if(*param_6 < temp * 3) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 2); + } else if (*i_timer < temp * 3) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 2); *param_3 += param_5; *param_4 += param_5; - } - else if(*param_6 < temp * 4) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 3); + } else if (*i_timer < temp * 4) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 3); *param_4 += param_5; } - if(*param_6 % temp == 0) { - param_1->rotate(0.0f, 0.0f, ROTATE_Z, (*param_6 / temp) * -90.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, (*param_6 / temp) * -90.0f); + if (*i_timer % temp == 0) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, (*i_timer / temp) * -90.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, (*i_timer / temp) * -90.0f); } - *param_6 += 1; - if(*param_6 >= temp * 4) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp * 4) { + *i_timer = 0; } } /* 8002D2B8-8002D464 .text fopMsgM_outFontStickAnime__FP10J2DPicturePiPiPiPiPs */ -void fopMsgM_outFontStickAnime(J2DPicture* param_1, int* param_2, int* param_3, int* param_4, int* param_5, s16* param_6) { +void fopMsgM_outFontStickAnime(J2DPicture* i_iconPic, int* param_2, int* param_3, int* param_4, int* param_5, s16* i_timer) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 0); - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 1); + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 0); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 1); int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_2 += *param_5; - } - else if(*param_6 < temp * 3) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 2); + } else if (*i_timer < temp * 3) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 2); *param_2 += *param_4; *param_3 += *param_5; - } - else if(*param_6 < temp * 4) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 3); + } else if (*i_timer < temp * 4) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 3); int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_3 += *param_4; } - if(*param_6 % temp == 0) { - param_1->rotate(0.0f, 0.0f, ROTATE_Z, (*param_6 / temp) * -90.0f); + if (*i_timer % temp == 0) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, (*i_timer / temp) * -90.0f); } - *param_6 += 1; - if(*param_6 >= temp * 4) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp * 4) { + *i_timer = 0; } } /* 8002D464-8002D620 .text fopMsgM_outFontStickAnime2__FP10J2DPictureP10J2DPicturePiPiiPsUc */ -void fopMsgM_outFontStickAnime2(J2DPicture* param_1, J2DPicture* param_2, int* param_3, int* param_4, int param_5, s16* param_6, u8 param_7) { +void fopMsgM_outFontStickAnime2(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int* param_3, int* param_4, int param_5, s16* i_timer, u8 param_7) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; int temp2; - if(param_7 == 0) { - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 0); + if (param_7 == 0) { + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 0); *param_3 += param_5; temp2 = 1; - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 1); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 1); *param_4 += param_5; temp2 = 3; } - } - else if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 0); + } else if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 0); temp2 = 0; - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 1); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 1); *param_3 += param_5; *param_4 += param_5; temp2 = 2; } - param_1->rotate(0.0f, 0.0f, ROTATE_Z, temp2 * -90.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, temp2 * -90.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, temp2 * -90.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, temp2 * -90.0f); - *param_6 += 1; - if(*param_6 >= temp * 2) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp * 2) { + *i_timer = 0; } } /* 8002D620-8002D7D0 .text fopMsgM_outFontStickAnime2__FP10J2DPicturePiPiPiPiPsUc */ -void fopMsgM_outFontStickAnime2(J2DPicture* param_1, int* param_2, int* param_3, int* param_4, int* param_5, s16* param_6, u8 param_7) { +void fopMsgM_outFontStickAnime2(J2DPicture* i_iconPic, int* param_2, int* param_3, int* param_4, int* param_5, s16* i_timer, u8 param_7) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; int temp3; - if(param_7 == 0) { - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 0); + if (param_7 == 0) { + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 0); int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_2 += *param_5; temp3 = 1; - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 1); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 1); int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_3 += *param_4; temp3 = 3; } - } - else if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 0); + } else if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 0); temp3 = 0; - } - else if(*param_6 < temp * 2) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 1); + } else if (*i_timer < temp * 2) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 1); *param_2 += *param_4; *param_3 += *param_5; temp3 = 2; } - param_1->rotate(0.0f, 0.0f, ROTATE_Z, temp3 * -90.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, temp3 * -90.0f); - *param_6 += 1; - if(*param_6 >= temp * 2) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp * 2) { + *i_timer = 0; } } /* 8002D7D0-8002D95C .text fopMsgM_outFontStickAnime__FP10J2DPictureP10J2DPicturePiPiiPsUc */ -void fopMsgM_outFontStickAnime(J2DPicture* param_1, J2DPicture* param_2, int* param_3, int* param_4, int param_5, s16* param_6, u8 param_7) { +void fopMsgM_outFontStickAnime(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int* param_3, int* param_4, int param_5, s16* i_timer, u8 param_7) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, param_2, *param_6, 0); - switch(param_7) { - case 1: - *param_3 += param_5; - break; - case 2: - *param_3 += param_5; - *param_4 += param_5; - break; - case 3: - *param_4 += param_5; - break; + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, i_sdwPic, *i_timer, 0); + switch (param_7) { + case 1: + *param_3 += param_5; + break; + case 2: + *param_3 += param_5; + *param_4 += param_5; + break; + case 3: + *param_4 += param_5; + break; } } - param_1->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); - *param_6 += 1; - if(*param_6 >= temp) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp) { + *i_timer = 0; } } /* 8002D95C-8002DAE4 .text fopMsgM_outFontStickAnime__FP10J2DPicturePiPiPiPiPsUc */ -void fopMsgM_outFontStickAnime(J2DPicture* param_1, int* param_2, int* param_3, int* param_4, int* param_5, s16* param_6, u8 param_7) { +void fopMsgM_outFontStickAnime(J2DPicture* i_iconPic, int* param_2, int* param_3, int* param_4, int* param_5, s16* i_timer, u8 param_7) { s16 temp = g_msgHIO.field_0x88 + g_msgHIO.field_0x87 + g_msgHIO.field_0x89 + g_msgHIO.field_0x87; s16 temp2; - if(*param_6 < temp) { - fopMsgM_outFontStickAnimePiece(param_1, *param_6, 0); - switch(param_7) { - case 1: - temp2 = *param_4; - *param_4 = *param_5; - *param_5 = temp2; - *param_2 += *param_5; - break; - case 2: - *param_2 += *param_4; - *param_3 += *param_5; - break; - case 3: - temp2 = *param_4; - *param_4 = *param_5; - *param_5 = temp2; - *param_3 += *param_4; - break; + if (*i_timer < temp) { + fopMsgM_outFontStickAnimePiece(i_iconPic, *i_timer, 0); + switch (param_7) { + case 1: + temp2 = *param_4; + *param_4 = *param_5; + *param_5 = temp2; + *param_2 += *param_5; + break; + case 2: + *param_2 += *param_4; + *param_3 += *param_5; + break; + case 3: + temp2 = *param_4; + *param_4 = *param_5; + *param_5 = temp2; + *param_3 += *param_4; + break; } } - param_1->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, param_7 * -90.0f); - *param_6 += 1; - if(*param_6 >= temp) { - *param_6 = 0; + *i_timer += 1; + if (*i_timer >= temp) { + *i_timer = 0; } } /* 8002DAE4-8002DC74 .text fopMsgM_outFontArrow__FP10J2DPictureP10J2DPicturePiPiiUc */ -void fopMsgM_outFontArrow(J2DPicture* param_1, J2DPicture* param_2, int* param_3, int* param_4, int param_5, u8 param_6) { - if(param_6 == 0xA) { +void fopMsgM_outFontArrow(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int* param_3, int* param_4, int param_5, u8 i_iconNo) { + if (i_iconNo == 0xA) { *param_3 += param_5; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); - } - else if(param_6 == 0xB) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); + } else if (i_iconNo == 0xB) { *param_4 += param_5; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); - } - else if(param_6 == 0xC) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); + } else if (i_iconNo == 0xC) { *param_3 += param_5; *param_4 += param_5; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); - param_2->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); + i_sdwPic->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); } } /* 8002DC74-8002DD98 .text fopMsgM_outFontArrow__FP10J2DPicturePiPiPiPiUc */ -void fopMsgM_outFontArrow(J2DPicture* param_1, int* param_2, int* param_3, int* param_4, int* param_5, u8 param_6) { - if(param_6 == 0xA) { +void fopMsgM_outFontArrow(J2DPicture* i_iconPic, int* param_2, int* param_3, int* param_4, int* param_5, u8 i_iconNo) { + if (i_iconNo == 0xA) { int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_2 += *param_5; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); - } - else if(param_6 == 0xB) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 270.0f); + } else if (i_iconNo == 0xB) { int temp2 = *param_4; *param_4 = *param_5; *param_5 = temp2; *param_3 += *param_4; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); - } - else if(param_6 == 0xC) { + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 90.0f); + } else if (i_iconNo == 0xC) { *param_2 += *param_4; *param_3 += *param_5; - param_1->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); + i_iconPic->rotate(0.0f, 0.0f, ROTATE_Z, 180.0f); } } /* 8002DD98-8002DFB4 .text fopMsgM_outFontDraw__FP10J2DPictureP10J2DPictureiiiPsUcUc */ -void fopMsgM_outFontDraw(J2DPicture* param_1, J2DPicture* param_2, int param_3, int param_4, int param_5, s16* param_6, u8 param_7, u8 param_8) { - switch(param_8) { - case 9: - fopMsgM_outFontStickAnime(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6); - break; - case 0xE: - fopMsgM_outFontStickAnime(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 1); - break; - case 0xF: - fopMsgM_outFontStickAnime(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 3); - break; - case 0x10: - fopMsgM_outFontStickAnime(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 0); - break; - case 0x11: - fopMsgM_outFontStickAnime(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 2); - break; - case 0x12: - fopMsgM_outFontStickAnime2(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 0); - break; - case 0x13: - fopMsgM_outFontStickAnime2(param_1, param_2, ¶m_3, ¶m_4, param_5, param_6, 1); - break; - case 0xA: - case 0xB: - case 0xC: - case 0xD: - fopMsgM_outFontArrow(param_1, param_2, ¶m_3, ¶m_4, param_5, param_8); - break; - } - - param_2->draw(param_3 + 2, param_4 + 1 + g_msgHIO.field_0x6a, param_5, param_5, false, false, false); - param_1->draw(param_3, param_4 - 1 + g_msgHIO.field_0x6a, param_5, param_5, false, false, false); - - param_1->setAlpha(param_7); - param_2->setAlpha(param_7); +void fopMsgM_outFontDraw(J2DPicture* i_iconPic, J2DPicture* i_sdwPic, int param_3, int param_4, int param_5, s16* i_timer, u8 i_alpha, u8 i_iconNo) { + switch (i_iconNo) { + case 9: + fopMsgM_outFontStickAnime(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer); + break; + case 0xE: + fopMsgM_outFontStickAnime(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 1); + break; + case 0xF: + fopMsgM_outFontStickAnime(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 3); + break; + case 0x10: + fopMsgM_outFontStickAnime(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 0); + break; + case 0x11: + fopMsgM_outFontStickAnime(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 2); + break; + case 0x12: + fopMsgM_outFontStickAnime2(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 0); + break; + case 0x13: + fopMsgM_outFontStickAnime2(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_timer, 1); + break; + case 0xA: + case 0xB: + case 0xC: + case 0xD: + fopMsgM_outFontArrow(i_iconPic, i_sdwPic, ¶m_3, ¶m_4, param_5, i_iconNo); + break; + } + + i_sdwPic->draw(param_3 + 2, param_4 + 1 + g_msgHIO.field_0x6a, param_5, param_5, false, false, false); + i_iconPic->draw(param_3, param_4 - 1 + g_msgHIO.field_0x6a, param_5, param_5, false, false, false); + + i_iconPic->setAlpha(i_alpha); + i_sdwPic->setAlpha(i_alpha); } /* 8002DFB4-8002E204 .text fopMsgM_outFontDraw2__FP10J2DPictureP10J2DPictureiiiiPsUcUc */ -void fopMsgM_outFontDraw2(J2DPicture* param_1, J2DPicture* param_2, int param_3, int param_4, int param_5, int param_6, s16* param_7, u8 param_8, u8 param_9) { +void fopMsgM_outFontDraw2(J2DPicture* i_iconPic, J2DPicture* param_2, int param_3, int param_4, int i_width, int i_height, s16* i_timer, u8 i_alpha, u8 i_iconNo) { int temp1 = 0, temp2 = 0; - switch(param_9) { - case 9: - fopMsgM_outFontStickAnime(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7); - break; - case 0xE: - fopMsgM_outFontStickAnime(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 1); - break; - case 0xF: - fopMsgM_outFontStickAnime(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 3); - break; - case 0x10: - fopMsgM_outFontStickAnime(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 0); - break; - case 0x11: - fopMsgM_outFontStickAnime(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 2); - break; - case 0x12: - fopMsgM_outFontStickAnime2(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 0); - break; - case 0x13: - fopMsgM_outFontStickAnime2(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_7, 1); - break; - case 0xA: - case 0xB: - case 0xC: - case 0xD: - fopMsgM_outFontArrow(param_1, &temp1, &temp2, ¶m_5, ¶m_6, param_9); - break; + switch (i_iconNo) { + case 9: + fopMsgM_outFontStickAnime(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer); + break; + case 0xE: + fopMsgM_outFontStickAnime(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 1); + break; + case 0xF: + fopMsgM_outFontStickAnime(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 3); + break; + case 0x10: + fopMsgM_outFontStickAnime(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 0); + break; + case 0x11: + fopMsgM_outFontStickAnime(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 2); + break; + case 0x12: + fopMsgM_outFontStickAnime2(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 0); + break; + case 0x13: + fopMsgM_outFontStickAnime2(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_timer, 1); + break; + case 0xA: + case 0xB: + case 0xC: + case 0xD: + fopMsgM_outFontArrow(i_iconPic, &temp1, &temp2, &i_width, &i_height, i_iconNo); + break; } param_2->move(param_3, param_4); - param_1->move(temp1, temp2); - param_1->resize(param_5, param_6); + i_iconPic->move(temp1, temp2); + i_iconPic->resize(i_width, i_height); - param_1->setAlpha(param_8); + i_iconPic->setAlpha(i_alpha); } /* 8002E204-8002E254 .text fopMsgM_Create__FsPFPv_iPv */ -fpc_ProcID fopMsgM_Create(s16 param_1, fopMsgCreateFunc param_2, void* param_3) { - return fpcSCtRq_Request(fpcLy_CurrentLayer(), param_1, (stdCreateFunc)param_2, NULL, param_3); +fpc_ProcID fopMsgM_Create(s16 i_name, fopMsgCreateFunc i_createFunc, void* i_append) { + return fpcSCtRq_Request(fpcLy_CurrentLayer(), i_name, (stdCreateFunc)i_createFunc, NULL, i_append); } /* 8002E254-8002E2D8 .text getMesgHeader__16fopMsgM_msgGet_cFUl */ -mesg_header* fopMsgM_msgGet_c::getMesgHeader(u32 msg) { - mGroupID = (msg >> 16); - mMsgNo = msg; +mesg_header* fopMsgM_msgGet_c::getMesgHeader(u32 i_msgNo) { + mGroupID = (i_msgNo >> 16); + mMsgNo = i_msgNo; #if VERSION <= VERSION_JPN char path[12]; @@ -1525,7 +1462,7 @@ mesg_header* fopMsgM_msgGet_c::getMesgHeader(u32 msg) { JKRArchive* arc = dComIfGp_getMsgDtArchive(); return (mesg_header*)JKRArchive::getGlbResource('ROOT', path, arc); #else - if (fopMsgM_hyrule_language_check(msg)) { + if (fopMsgM_hyrule_language_check(i_msgNo)) { JKRArchive* arc = dComIfGp_getMsgDt2Archive(); return (mesg_header*)JKRArchive::getGlbResource('ROOT', "zel_01.bmg", arc); } else { @@ -1536,25 +1473,25 @@ mesg_header* fopMsgM_msgGet_c::getMesgHeader(u32 msg) { } /* 8002E2D8-8002E2E0 .text getMesgInfo__16fopMsgM_msgGet_cFP11mesg_header */ -mesg_info* fopMsgM_msgGet_c::getMesgInfo(mesg_header* msg) { - return (mesg_info*)&msg->mFirstBlock; +mesg_info* fopMsgM_msgGet_c::getMesgInfo(mesg_header* i_head) { + return (mesg_info*)&i_head->mFirstBlock; } /* 8002E2E0-8002E308 .text getMesgData__16fopMsgM_msgGet_cFP11mesg_header */ -mesg_data* fopMsgM_msgGet_c::getMesgData(mesg_header* msg) { - return (mesg_data*)getMesgInfo(msg)->getNext(); +mesg_data* fopMsgM_msgGet_c::getMesgData(mesg_header* i_head) { + return (mesg_data*)getMesgInfo(i_head)->getNext(); } /* 8002E308-8002E378 .text getMesgEntry__16fopMsgM_msgGet_cFP11mesg_header */ -JMSMesgEntry_c fopMsgM_msgGet_c::getMesgEntry(mesg_header* msg) { - mesg_info* info = getMesgInfo(msg); +JMSMesgEntry_c fopMsgM_msgGet_c::getMesgEntry(mesg_header* i_head) { + mesg_info* info = getMesgInfo(i_head); return info->mEntries[mMsgIdx]; } /* 8002E378-8002E430 .text getMessage__16fopMsgM_msgGet_cFP11mesg_header */ -const char* fopMsgM_msgGet_c::getMessage(mesg_header* msg) { - mesg_info* info = getMesgInfo(msg); - const char* data = getMesgData(msg)->mData; +const char* fopMsgM_msgGet_c::getMessage(mesg_header* i_head) { + mesg_info* info = getMesgInfo(i_head); + const char* data = getMesgData(i_head)->mData; const char* ret = NULL; @@ -1574,11 +1511,11 @@ const char* fopMsgM_msgGet_c::getMessage(mesg_header* msg) { } /* 8002E430-8002E4AC .text getMesgHeader__20fopMsgM_itemMsgGet_cFUl */ -mesg_header* fopMsgM_itemMsgGet_c::getMesgHeader(u32 msg) { +mesg_header* fopMsgM_itemMsgGet_c::getMesgHeader(u32 i_msgNo) { #if VERSION <= VERSION_JPN - u16 groupID = msg >> 16; + u16 groupID = i_msgNo >> 16; #endif - mMsgNo = msg; + mMsgNo = i_msgNo; #if VERSION <= VERSION_JPN char path[12]; @@ -1590,7 +1527,7 @@ mesg_header* fopMsgM_itemMsgGet_c::getMesgHeader(u32 msg) { JKRArchive* arc = dComIfGp_getMsgDtArchive(); return (mesg_header*)JKRArchive::getGlbResource('ROOT', path, arc); #else - if (fopMsgM_hyrule_language_check(msg)) { + if (fopMsgM_hyrule_language_check(i_msgNo)) { JKRArchive* arc = dComIfGp_getMsgDt2Archive(); return (mesg_header*)JKRArchive::getGlbResource('ROOT', "zel_01.bmg", arc); } else { @@ -1601,25 +1538,25 @@ mesg_header* fopMsgM_itemMsgGet_c::getMesgHeader(u32 msg) { } /* 8002E4AC-8002E4B4 .text getMesgInfo__20fopMsgM_itemMsgGet_cFP11mesg_header */ -mesg_info* fopMsgM_itemMsgGet_c::getMesgInfo(mesg_header* msg) { - return (mesg_info*)&msg->mFirstBlock; +mesg_info* fopMsgM_itemMsgGet_c::getMesgInfo(mesg_header* i_head) { + return (mesg_info*)&i_head->mFirstBlock; } /* 8002E4B4-8002E4DC .text getMesgData__20fopMsgM_itemMsgGet_cFP11mesg_header */ -mesg_data* fopMsgM_itemMsgGet_c::getMesgData(mesg_header* msg) { - return (mesg_data*)getMesgInfo(msg)->getNext(); +mesg_data* fopMsgM_itemMsgGet_c::getMesgData(mesg_header* i_head) { + return (mesg_data*)getMesgInfo(i_head)->getNext(); } /* 8002E4DC-8002E54C .text getMesgEntry__20fopMsgM_itemMsgGet_cFP11mesg_header */ -JMSMesgEntry_c fopMsgM_itemMsgGet_c::getMesgEntry(mesg_header* msg) { - mesg_info* info = getMesgInfo(msg); +JMSMesgEntry_c fopMsgM_itemMsgGet_c::getMesgEntry(mesg_header* i_head) { + mesg_info* info = getMesgInfo(i_head); return info->mEntries[mMsgIdx]; } /* 8002E54C-8002E5FC .text getMessage__20fopMsgM_itemMsgGet_cFP11mesg_header */ -const char* fopMsgM_itemMsgGet_c::getMessage(mesg_header* msg) { - mesg_info* info = getMesgInfo(msg); - const char* data = getMesgData(msg)->mData; +const char* fopMsgM_itemMsgGet_c::getMessage(mesg_header* i_head) { + mesg_info* info = getMesgInfo(i_head); + const char* data = getMesgData(i_head)->mData; for (u16 i = 0; i < info->mNumEntry; i++) { if (info->mEntries[i].mDataOffs == 0) @@ -1644,14 +1581,14 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0x20 = 0.0f; field_0x24 = 0.0f; field_0x28 = 0.0f; - + for (int i = 0; i < 4; i++) { field_0xD8[i] = 0; field_0xF8[i] = 0; field_0x108[i] = 0; field_0xE8[i] = 0; } - + field_0x21C = 0; field_0xD4[2] = 0; field_0xD4[1] = 0; @@ -1698,7 +1635,7 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0x27E = 0; field_0x27F = 0; field_0x280 = 0; - + for (int i = 0; i < 0xF; i++) { field_0x168[i] = 0; field_0x1A4[i] = 0; @@ -1706,7 +1643,7 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0x281[i] = 0xFF; field_0x220[i] = 0; } - + field_0x10 = 0; field_0x299 = 0; field_0x29A = 0; @@ -1732,7 +1669,7 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0x20 = 0.0f; field_0x24 = 0.0f; field_0x28 = 0.0f; - for(int i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) { field_0xD8[i] = 0; field_0xF8[i] = 0; field_0xE8[i] = 0; @@ -1783,7 +1720,7 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0x27E = 0; field_0x27F = 0; field_0x280 = 0; - for(int i = 0; i < 0xF; i++) { + for (int i = 0; i < 0xF; i++) { field_0x168[i] = 0; field_0x1A4[i] = 0; field_0x1E0[i] = 0; @@ -1804,13 +1741,13 @@ void fopMsgM_msgDataProc_c::dataInit() { } /* 8002E95C-8002EA58 .text charLength__21fopMsgM_msgDataProc_cFiib */ -f32 fopMsgM_msgDataProc_c::charLength(int scale, int charNo, bool mode) { +f32 fopMsgM_msgDataProc_c::charLength(int i_scale, int i_charNo, bool param_2) { JUTFont::TWidth width; - font[0]->getWidthEntry(charNo, &width); + font[0]->getWidthEntry(i_charNo, &width); f32 charWidth = (f32)(int)width.field_0x1; - f32 cellWidth = (f32)scale / (f32)font[0]->getCellWidth(); + f32 cellWidth = (f32)i_scale / (f32)font[0]->getCellWidth(); - if (mode) { + if (param_2) { return charWidth * cellWidth; } else { return charSpace + (charWidth * cellWidth); @@ -1818,13 +1755,13 @@ f32 fopMsgM_msgDataProc_c::charLength(int scale, int charNo, bool mode) { } /* 8002EA58-8002EB4C .text rubyLength__21fopMsgM_msgDataProc_cFib */ -f32 fopMsgM_msgDataProc_c::rubyLength(int param_1, bool param_2) { +f32 fopMsgM_msgDataProc_c::rubyLength(int i_charNo, bool param_2) { JUTFont::TWidth width; - font[1]->getWidthEntry(param_1, &width); + font[1]->getWidthEntry(i_charNo, &width); s32 advance = width.field_0x1; f32 width2 = font[1]->getCellWidth(); f32 temp = ((s32)rubyFontSize / width2); - if(param_2) { + if (param_2) { return advance * temp; } @@ -1842,9 +1779,9 @@ void fopMsgM_msgDataProc_c::stringShift() { } /* 800312B4-80031420 .text iconSelect__21fopMsgM_msgDataProc_cFiUc */ -void fopMsgM_msgDataProc_c::iconSelect(int param_1, u8 param_2) { - if(field_0x280 < 0xF) { - field_0x281[field_0x280] = param_2; +void fopMsgM_msgDataProc_c::iconSelect(int param_1, u8 i_iconNo) { + if (field_0x280 < 0xF) { + field_0x281[field_0x280] = i_iconNo; field_0x168[field_0x280] = field_0x20; field_0x1A4[field_0x280] = lineCount; field_0x1E0[field_0x280] = param_1; @@ -1852,7 +1789,7 @@ void fopMsgM_msgDataProc_c::iconSelect(int param_1, u8 param_2) { field_0x280++; } - if(param_2 != 0x16) { + if (i_iconNo != 0x16) { field_0x150++; field_0x14 += param_1; field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; @@ -1866,7 +1803,7 @@ void fopMsgM_msgDataProc_c::iconSelect(int param_1, u8 param_2) { /* 80031420-8003144C .text iconIdxRefresh__21fopMsgM_msgDataProc_cFv */ void fopMsgM_msgDataProc_c::iconIdxRefresh() { - for(int i = 0; i < 0xF; i++) { + for (int i = 0; i < 0xF; i++) { field_0x281[i] = 0xFF; } @@ -1874,7 +1811,7 @@ void fopMsgM_msgDataProc_c::iconIdxRefresh() { } /* 8003144C-80031808 .text fopMsgM_arrowAnime__FP10J2DPicturePs */ -void fopMsgM_arrowAnime(J2DPicture* param_1, s16* param_2) { +void fopMsgM_arrowAnime(J2DPicture* i_iconPic, s16* param_2) { GXColor white, black; white.a = 0xFF; black.a = 0x0; @@ -1883,7 +1820,7 @@ void fopMsgM_arrowAnime(J2DPicture* param_1, s16* param_2) { static const GXColor color1 = {0xFF, 0x50, 0x50, 0x00}; static const GXColor color2 = {0xFF, 0x96, 0x96, 0x00}; - if(*param_2 < 0x16) { + if (*param_2 < 0x16) { float temp = fopMsgM_valueIncrease(0x16, *param_2, 2); black.r = temp * (color2.r - color1.r) + color1.r; white.r = black.r; @@ -1892,8 +1829,7 @@ void fopMsgM_arrowAnime(J2DPicture* param_1, s16* param_2) { black.b = temp * (color2.b - color1.b) + color1.b; white.b = black.b; alpha = g_msgHIO.field_0x2c + temp * (g_msgHIO.field_0x30 - g_msgHIO.field_0x2c); - } - else { + } else { float temp = fopMsgM_valueIncrease(0x16, *param_2 - 0x16, 2); black.r = temp * (color1.r - color2.r) + color2.r; white.r = black.r; @@ -1905,13 +1841,13 @@ void fopMsgM_arrowAnime(J2DPicture* param_1, s16* param_2) { } *param_2 += 1; - if(*param_2 >= 0x2D) { + if (*param_2 >= 45) { *param_2 = 0; } - param_1->setWhite(white); - param_1->setBlack(black); - param_1->setAlpha(alpha); + i_iconPic->setWhite(white); + i_iconPic->setBlack(black); + i_iconPic->setAlpha(alpha); } /* 80031808-800319D8 .text selectCheck2__21fopMsgM_msgDataProc_cFP7J2DPaneiii */ @@ -1923,16 +1859,15 @@ int fopMsgM_msgDataProc_c::selectCheck2(J2DPane* param_1, int param_2, int param int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; field_0x164 = temp; - if(!temp) { - if(g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { - if(field_0x27D == 1) { + if (!temp) { + if (g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { + if (field_0x27D == 1) { field_0x27D = 0; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } - } - else if(g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { - if(field_0x27D == 0) { + } else if (g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { + if (field_0x27D == 0) { field_0x27D = 1; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); @@ -1954,26 +1889,23 @@ int fopMsgM_msgDataProc_c::selectCheck3(J2DPane* param_1, int param_2, int param int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; field_0x164 = temp; - if(!temp) { - if(g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { - if(field_0x27D == 1) { + if (!temp) { + if (g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { + if (field_0x27D == 1) { field_0x27D = 0; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); - } - else if(field_0x27D == 2) { + } else if (field_0x27D == 2) { field_0x27D = 1; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } - } - else if(g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { - if(field_0x27D == 0) { + } else if (g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { + if (field_0x27D == 0) { field_0x27D = 1; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); - } - else if(field_0x27D == 1) { + } else if (field_0x27D == 1) { field_0x27D = 2; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); @@ -1995,16 +1927,15 @@ int fopMsgM_msgDataProc_c::selectCheckYoko(J2DPane* param_1, int param_2, int pa int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; field_0x164 = temp; - if(!temp) { - if(g_mDoCPd_cpadInfo[0].mMainStickPosX < -0.7f) { - if(field_0x27D == 1) { + if (!temp) { + if (g_mDoCPd_cpadInfo[0].mMainStickPosX < -0.7f) { + if (field_0x27D == 1) { field_0x27D = 0; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } - } - else if(g_mDoCPd_cpadInfo[0].mMainStickPosX > 0.7f) { - if(field_0x27D == 0) { + } else if (g_mDoCPd_cpadInfo[0].mMainStickPosX > 0.7f) { + if (field_0x27D == 0) { field_0x27D = 1; field_0x164 = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); @@ -2024,68 +1955,62 @@ int fopMsgM_msgDataProc_c::inputNumber(int param_1) { stick.setWaitParm(5, 2, 3, 2, 0.9f, 0.5f, 0, 0x2000); stick.checkTrigger(); - if(stick.checkRightTrigger()) { - if(field_0x27D != 0) { + if (stick.checkRightTrigger()) { + if (field_0x27D != 0) { field_0x27D--; mDoAud_seStart(JA_SE_AUC_BID_CURSOR_LR); } - } - else if(stick.checkLeftTrigger()) { - if(field_0x27D < param_1 - 1) { + } else if (stick.checkLeftTrigger()) { + if (field_0x27D < param_1 - 1) { field_0x27D++; mDoAud_seStart(JA_SE_AUC_BID_CURSOR_LR); } } - if(stick.checkUpTrigger()) { - if(field_0x27D == 0) { - if(temp < 999) { + if (stick.checkUpTrigger()) { + if (field_0x27D == 0) { + if (temp < 999) { temp2 = true; temp += 1; } - } - else if(field_0x27D == 1) { - if(temp < 999) { + } else if (field_0x27D == 1) { + if (temp < 999) { temp += 10; - if(temp > 999) { + if (temp > 999) { temp = 99; } temp2 = true; } - } - else if(field_0x27D == 2) { - if(temp < 999) { + } else if (field_0x27D == 2) { + if (temp < 999) { temp += 100; - if(temp > 999) { + if (temp > 999) { temp = 999; } temp2 = true; } } - } - else if(stick.checkDownTrigger()) { - if(field_0x27D == 0) { - if(temp > 0) { + } else if (stick.checkDownTrigger()) { + if (field_0x27D == 0) { + if (temp > 0) { temp2 = true; temp -= 1; } - } - else if(field_0x27D == 1) { - if(temp > 0) { + } else if (field_0x27D == 1) { + if (temp > 0) { temp -= 10; - if(temp < 0) { + if (temp < 0) { temp = 0; } temp2 = true; } - } - else if(field_0x27D == 2) { - if(temp > 0) { + } else if (field_0x27D == 2) { + if (temp > 0) { temp -= 100; - if(temp < 0) { + if (temp < 0) { temp = 0; } @@ -2094,18 +2019,15 @@ int fopMsgM_msgDataProc_c::inputNumber(int param_1) { } } - if(param_1 == 2) { - if(temp > daNpc_Bs1_c::m_tag_buy_item_max) { + if (param_1 == 2) { + if (temp > daNpc_Bs1_c::m_tag_buy_item_max) { temp = daNpc_Bs1_c::m_tag_buy_item_max; - } - else if(temp < 1) { + } else if (temp < 1) { temp = 1; - } - else if(temp2) { + } else if (temp2) { mDoAud_seStart(JA_SE_AUC_BID_CURSOR_UD); } - } - else if(temp2) { + } else if (temp2) { mDoAud_seStart(JA_SE_AUC_BID_CURSOR_UD); } @@ -2136,8 +2058,8 @@ void fopMsgM_msgDataProc_c::selectArrow(J2DPicture* param_1, f32 param_2, f32 pa } /* 80032288-800322B4 .text colorAnime__21fopMsgM_msgDataProc_cFP10J2DPicture */ -void fopMsgM_msgDataProc_c::colorAnime(J2DPicture* picture) { - fopMsgM_arrowAnime(picture, &field_0x260); +void fopMsgM_msgDataProc_c::colorAnime(J2DPicture* i_pic) { + fopMsgM_arrowAnime(i_pic, &field_0x260); } /* 800322B4-80034F3C .text stringSet__21fopMsgM_msgDataProc_cFv */ @@ -2149,45 +2071,43 @@ void fopMsgM_msgDataProc_c::stringSet() { field_0x6C = field_0x4C; mesgStatus = 6; - if(bmgData[count] == '\0') { - if(field_0x27E != 0) { + if (bmgData[count] == '\0') { + if (field_0x27E != 0) { field_0x27E = 0; field_0x60[field_0x2C] = '\0'; field_0x68[field_0x30] = '\0'; strcat(field_0x60, field_0xD4); strcat(field_0x68, field_0xD4); } - if(field_0x27F != 0) { + if (field_0x27F != 0) { field_0x27F = 0; field_0x64[field_0x34] = '\0'; field_0x6C[field_0x38] = '\0'; strcat(field_0x64, field_0x70); strcat(field_0x6C, field_0x70); } - if(mesgStatus != 8 && mesgStatus != 9 && mesgStatus != 0x14 && mesgStatus != 0x15) { - if(mesgEntry->mTextboxType != 2 && mesgEntry->mTextboxType != 6 && mesgEntry->mTextboxType != 7 && mesgEntry->mTextboxType != 0xB && mesgEntry->mTextboxType != 5 && mesgEntry->mTextboxType != 0xD && mesgEntry->mTextboxType != 9) { - if(dComIfGp_roomControl_getStayNo()) { + if (mesgStatus != 8 && mesgStatus != 9 && mesgStatus != 0x14 && mesgStatus != 0x15) { + if (mesgEntry->mTextboxType != 2 && mesgEntry->mTextboxType != 6 && mesgEntry->mTextboxType != 7 && mesgEntry->mTextboxType != 0xB && + mesgEntry->mTextboxType != 5 && mesgEntry->mTextboxType != 0xD && mesgEntry->mTextboxType != 9) + { + if (dComIfGp_roomControl_getStayNo()) { mDoAud_messageSePlay(0, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); - } - else { + } else { mDoAud_messageSePlay(0, 0, 0); } } - if(fopMsgM_nextMsgFlagCheck()) { - if(mesgEntry->mNextMsgNo != 0) { + if (fopMsgM_nextMsgFlagCheck()) { + if (mesgEntry->mNextMsgNo != 0) { fopMsgM_messageSet(mesgEntry->mNextMsgNo); mesgStatus = 0xF; - } - else { + } else { mesgStatus = 0x10; } - } - else { - if(getAutoSendFlag() || getHandSendFlag()) { + } else { + if (getAutoSendFlag() || getHandSendFlag()) { mesgStatus = 0xA; - } - else { + } else { mesgStatus = 0xE; } } @@ -2196,21 +2116,21 @@ void fopMsgM_msgDataProc_c::stringSet() { return; } - while(true) { - while(true) { - if(bmgData[count] == '\0') { - if(field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag) { + while (true) { + while (true) { + if (bmgData[count] == '\0') { + if (field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag) { return; } - if(field_0x27E != 0) { + if (field_0x27E != 0) { field_0x27E = 0; field_0x60[field_0x2C] = '\0'; field_0x68[field_0x30] = '\0'; strcat(field_0x60, field_0xD4); strcat(field_0x68, field_0xD4); } - if(field_0x27F != 0) { + if (field_0x27F != 0) { field_0x27F = 0; field_0x64[field_0x34] = '\0'; field_0x6C[field_0x38] = '\0'; @@ -2218,58 +2138,60 @@ void fopMsgM_msgDataProc_c::stringSet() { strcat(field_0x6C, field_0x70); } - if(mesgStatus == 8 || mesgStatus == 9 || mesgStatus == 0x14 || mesgStatus == 0x15) { + if (mesgStatus == 8 || mesgStatus == 9 || mesgStatus == 0x14 || mesgStatus == 0x15) { return; } - if(mesgEntry->mTextboxType != 2 && mesgEntry->mTextboxType != 6 && mesgEntry->mTextboxType != 7 && mesgEntry->mTextboxType != 0xB && mesgEntry->mTextboxType != 5 && mesgEntry->mTextboxType != 0xD && mesgEntry->mTextboxType != 9) { - if(dComIfGp_roomControl_getStayNo()) { + if (mesgEntry->mTextboxType != 2 && mesgEntry->mTextboxType != 6 && mesgEntry->mTextboxType != 7 && mesgEntry->mTextboxType != 0xB && + mesgEntry->mTextboxType != 5 && mesgEntry->mTextboxType != 0xD && mesgEntry->mTextboxType != 9) + { + if (dComIfGp_roomControl_getStayNo()) { mDoAud_messageSePlay(0, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); - } - else { + } else { mDoAud_messageSePlay(0, 0, 0); } } - if(fopMsgM_nextMsgFlagCheck()) { - if(mesgEntry->mNextMsgNo != 0) { + if (fopMsgM_nextMsgFlagCheck()) { + if (mesgEntry->mNextMsgNo != 0) { fopMsgM_messageSet(mesgEntry->mNextMsgNo); mesgStatus = 0xF; - } - else { + } else { mesgStatus = 0x10; } - } - else { - if(getAutoSendFlag() || getHandSendFlag()) { + } else { + if (getAutoSendFlag() || getHandSendFlag()) { mesgStatus = 0xA; - } - else { + } else { mesgStatus = 0xE; } } } - if(field_0x27E != 0) { + if (field_0x27E != 0) { field_0x27E = 0; field_0x60[field_0x2C] = '\0'; field_0x68[field_0x30] = '\0'; strcat(field_0x60, field_0xD4); strcat(field_0x68, field_0xD4); } - if(field_0x27F != 0) { + if (field_0x27F != 0) { field_0x27F = 0; field_0x64[field_0x34] = '\0'; field_0x6C[field_0x38] = '\0'; strcat(field_0x64, field_0x70); strcat(field_0x6C, field_0x70); } - + u32 origOffset = count; const char* temp = &bmgData[origOffset]; - if(*temp != 0x1A) break; - if(temp[2] == 0xFF && temp[3] == 0 && temp[4] == 0) { - if(mesgEntry->mMsgNo == 0x42 || mesgEntry->mMsgNo == 0x43 || mesgEntry->mMsgNo == 0x44 || mesgEntry->mMsgNo == 0x45 || mesgEntry->mMsgNo == 0x46 || mesgEntry->mMsgNo == 0x47 || mesgEntry->mMsgNo == 0x48 || mesgEntry->mMsgNo == 0x49 || mesgEntry->mMsgNo == 0x4A || mesgEntry->mMsgNo == 0x4B) { + if (*temp != 0x1A) + break; + if (temp[2] == 0xFF && temp[3] == 0 && temp[4] == 0) { + if (mesgEntry->mMsgNo == 0x42 || mesgEntry->mMsgNo == 0x43 || mesgEntry->mMsgNo == 0x44 || mesgEntry->mMsgNo == 0x45 || + mesgEntry->mMsgNo == 0x46 || mesgEntry->mMsgNo == 0x47 || mesgEntry->mMsgNo == 0x48 || mesgEntry->mMsgNo == 0x49 || + mesgEntry->mMsgNo == 0x4A || mesgEntry->mMsgNo == 0x4B) + { static const u32 colorTable[9] = { 0x000000FF, 0xB40000FF, @@ -2285,10 +2207,9 @@ void fopMsgM_msgDataProc_c::stringSet() { char buf[16]; sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); strcat(field_0x60, buf); - } - else { - if(temp[5] > -1 && temp[5] < 9) { - if(mesgEntry->mTextboxType == 2 || mesgEntry->mTextboxType == 6 || mesgEntry->mTextboxType == 7) { + } else { + if (temp[5] > -1 && temp[5] < 9) { + if (mesgEntry->mTextboxType == 2 || mesgEntry->mTextboxType == 6 || mesgEntry->mTextboxType == 7) { static const u32 colorTable[9] = { 0x00000000, 0xB4000000, @@ -2302,11 +2223,10 @@ void fopMsgM_msgDataProc_c::stringSet() { }; field_0x25C = colorTable[mesgEntry->mTextboxType]; char buf[16]; - sprintf(buf, "\x1B""CC[%08x]\x1B""GC[%08x]", field_0x25C | field_0x290, field_0x25C | field_0x291); + sprintf(buf,"\x1B""CC[%08x]\x1B""GC[%08x]", field_0x25C | field_0x290, field_0x25C | field_0x291); strcat(field_0x60, buf); } - } - else if(temp[5] == 0xB) { + } else if (temp[5] == 0xB) { static const u32 colorTable[9] = { 0x000000FF, 0xB40000FF, @@ -2320,10 +2240,9 @@ void fopMsgM_msgDataProc_c::stringSet() { }; field_0x25C = colorTable[temp[5]]; char buf[16]; - sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); + sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); strcat(field_0x60, buf); - } - else { + } else { field_0x25C = fopMsgM_getColorTable(temp[5]); char buf[16]; sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); @@ -2332,19 +2251,17 @@ void fopMsgM_msgDataProc_c::stringSet() { } count += bmgData[count + 1]; - } - else if(temp[2] == 0xFF && temp[3] == 0 && temp[4] == 1) { + } else if (temp[2] == 0xFF && temp[3] == 0 && temp[4] == 1) { f32 temp2 = *(u16*)(&temp[5]); u32 temp3 = field_0x148; field_0x148 = fontSize * temp2 * 0.1f + 0.5f; - if(field_0x134 == 0) { + if (field_0x134 == 0) { fopMsgM_setFontsizeCenter(field_0x60, field_0x68, field_0x64, field_0x6C, temp3, field_0x148); - if(temp2 * 0.1f > 1.0f && field_0x29D == 0) { + if (temp2 * 0.1f > 1.0f && field_0x29D == 0) { field_0x29D = 1; } - } - else { - if(temp2 * 0.1f > 1.0f && field_0x29D == 0) { + } else { + if (temp2 * 0.1f > 1.0f && field_0x29D == 0) { strcat(field_0x60, "\n"); strcat(field_0x64, "\n"); strcat(field_0x68, "\n"); @@ -2359,79 +2276,72 @@ void fopMsgM_msgDataProc_c::stringSet() { } count += bmgData[count + 1]; - } - else if(temp[2] == 0xFF && temp[3] == 0 && temp[4] == 2) { - if(temp[1] != 5) { + } else if (temp[2] == 0xFF && temp[3] == 0 && temp[4] == 2) { + if (temp[1] != 5) { strcpy(field_0x70, ""); field_0x18 = 0.0f; field_0x1C = 0.0f; field_0x28 = field_0x20; field_0x154 = bmgData[count + 5]; count += 6; - while(count < origOffset + temp[2]) { + while (count < origOffset + temp[2]) { char buf[3]; buf[0] = bmgData[count]; buf[1] = bmgData[count + 1]; buf[2] = '\0'; strcat(field_0x70, buf); u16 temp2 = *(u16*)(&bmgData[count]); - if(field_0x29B == 0) { + if (field_0x29B == 0) { field_0x18 = rubyLength(temp2, true); field_0x29B = 1; - } - else { + } else { field_0x18 += rubyLength(temp2, false); } count += 2; } } - } - else if(temp[2] == 0 && temp[3] == 0 && temp[4] == 0) { + } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 0) { char buf[12]; strcpy(buf, dComIfGs_getPlayerName()); if ( #if VERSION > VERSION_JPN dComIfGs_getPalLanguage() == 1 && -#endif - ( - mesgEntry->mMsgNo == 0x33B || - mesgEntry->mMsgNo == 0xC8B || +#endif + (mesgEntry->mMsgNo == 0x33B || + mesgEntry->mMsgNo == 0xC8B || mesgEntry->mMsgNo == 0x1D21 || mesgEntry->mMsgNo == 0x31D7 || mesgEntry->mMsgNo == 0x37DD || - mesgEntry->mMsgNo == 0x37DE - ) + mesgEntry->mMsgNo == 0x37DE) ) { s32 bufLen = strlen(buf); char current = (buf)[bufLen - 1]; - if(current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(buf, "\'"); - } - else { + } else { strcat(buf, "s"); } } u32 curOffset = 0; - for(s32 i = 0; buf[i] != '\0'; i++) { + for (s32 i = 0; buf[i] != '\0'; i++) { char c = buf[i]; - if(c == '\0') break; - if((c >> 4) == 8 || (c >> 4) == 9) { + if (c == '\0') + break; + if ((c >> 4) == 8 || (c >> 4) == 9) { field_0xD4[0] = buf[curOffset]; field_0xD4[1] = buf[curOffset + 1]; field_0xD4[2] = '\0'; curOffset += 2; - } - else { + } else { field_0xD4[0] = buf[curOffset]; field_0xD4[1] = '\0'; curOffset += 1; } - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -2440,24 +2350,20 @@ void fopMsgM_msgDataProc_c::stringSet() { field_0x150 += 1; } - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; - } - else if(temp[2] == 0 && temp[3] == 0 && temp[4] == 1) { + } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 1) { field_0x29A = 1; count = bmgData[count + 1]; - } - else if(temp[2] == 0 && temp[3] == 0 && temp[4] == 2) { + } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 2) { field_0x29A = 0; count = bmgData[count + 1]; - } - else if(temp[2] == 0 && temp[3] == 0 && temp[4] == 3) { + } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 3) { field_0x158 = temp[5] << 8; field_0x158 |= bmgData[count + 6]; setAutoSendFlagOn(); @@ -2468,19 +2374,18 @@ void fopMsgM_msgDataProc_c::stringSet() { } } - if(field_0x154 != 0) { + if (field_0x154 != 0) { field_0x1C = field_0x20 - field_0x28; int temp1 = field_0x28 + field_0x1C / 2.0f - field_0x18 / 2.0f + 0.5f; - if(field_0x24 > temp1) { + if (field_0x24 > temp1) { char temp[16]; sprintf(temp, "\x1b""CR[%d]", (int)(field_0x24 - temp1 + 0.5f)); strcat(field_0x64, temp); strcat(field_0x6C, temp); - } - else if(temp1 == 0.0f) { + } else if (temp1 == 0.0f) { char temp[16]; - sprintf(temp, "\x1b""CL[%d]", (int)(temp1 - field_0x24 + 0.5f)); + sprintf(temp, "\x1b""CL[%d]", (int)(temp1 - field_0x24 + 0.5f)); strcat(field_0x64, temp); strcat(field_0x6C, temp); } @@ -2496,7 +2401,7 @@ void fopMsgM_msgDataProc_c::stringSet() { strcat(field_0x6C, "\n"); count++; lineCount++; - if(field_0x29D) { + if (field_0x29D) { lineCount++; field_0x29D = 0; } @@ -2533,15 +2438,15 @@ u8 fopMsgM_msgDataProc_c::getAutoSendFlag() { } /* 80034FE0-80034FF4 .text fopMsgM_itemNumIdx__FUc */ -u8 fopMsgM_itemNumIdx(u8 i) { - return itemicon[i].itemNo; +u8 fopMsgM_itemNumIdx(u8 i_no) { + return itemicon[i_no].itemNo; } /* 80034FF4-80035060 .text fopMsgM_itemNum__FUc */ -u8 fopMsgM_itemNum(u8 itemNo) { +u8 fopMsgM_itemNum(u8 i_itemNo) { u8 invIdx = 0; for (u8 i = 0; i < ARRAY_SIZE(itemicon); i++) { - if (itemNo == fopMsgM_itemNumIdx(i)) { + if (i_itemNo == fopMsgM_itemNumIdx(i)) { invIdx = i; break; } @@ -2550,14 +2455,14 @@ u8 fopMsgM_itemNum(u8 itemNo) { } /* 80035060-800350B8 .text fopMsgM_getColorTable__FUs */ -u32 fopMsgM_getColorTable(u16 param_1) { +u32 fopMsgM_getColorTable(u16 i_colorNo) { JKRArchive* arc = dComIfGp_getMsgDtArchive(); - u32* resource = (u32*) JKRArchive::getGlbResource('ROOT', "color.bmc", arc); - return resource[param_1 + 0x0b]; // probably a struct i have no idea what it looks like though + u32* resource = (u32*)JKRArchive::getGlbResource('ROOT', "color.bmc", arc); + return resource[i_colorNo + 0x0b]; // probably a struct i have no idea what it looks like though } /* 800350B8-80035170 .text fopMsgM_int_to_char__FPcib */ -void fopMsgM_int_to_char(char* dst, int num, bool param_3) { +void fopMsgM_int_to_char(char* i_dest, int i_value, bool param_3) { int temp = 10000; bool temp2 = false; #if VERSION > VERSION_JPN @@ -2571,42 +2476,42 @@ void fopMsgM_int_to_char(char* dst, int num, bool param_3) { buf[2] = '\0'; #endif - if(!param_3) { - strcpy(dst, ""); + if (!param_3) { + strcpy(i_dest, ""); } - for(int i = 0; i < 5; i++) { - if(num / temp != 0 || temp2 || temp == 1) { + for (int i = 0; i < 5; i++) { + if (i_value / temp != 0 || temp2 || temp == 1) { #if VERSION > VERSION_JPN - buf[0] = (num / temp) + '0'; + buf[0] = (i_value / temp) + '0'; #else - buf[1] = (num / temp) + '\x4F'; + buf[1] = (i_value / temp) + '\x4F'; #endif - strcat(dst, buf); - if(!temp2) { + strcat(i_dest, buf); + if (!temp2) { temp2 = true; } } - num %= temp; + i_value %= temp; temp /= 10; } } #if VERSION >= VERSION_USA /* 80035170-800351E8 .text fopMsgM_int_to_char2__FPci */ -void fopMsgM_int_to_char2(char* dst, int num) { +void fopMsgM_int_to_char2(char* i_dest, int i_value) { char buf[2]; buf[1] = '\0'; - buf[0] = (num / 10) + '0'; - strcat(dst, buf); - buf[0] = num % 10 + '0'; - strcat(dst, buf); + buf[0] = (i_value / 10) + '0'; + strcat(i_dest, buf); + buf[0] = i_value % 10 + '0'; + strcat(i_dest, buf); } #endif /* 800351E8-80035408 .text getString__21fopMsgM_msgDataProc_cFPcUl */ -void fopMsgM_msgDataProc_c::getString(char* dst, u32 msgNo) { +void fopMsgM_msgDataProc_c::getString(char* i_dest, u32 i_msgNo) { /* Nonmatching */ s32 i; fopMsgM_msgGet_c msgGet; @@ -2624,13 +2529,12 @@ void fopMsgM_msgDataProc_c::getString(char* dst, u32 msgNo) { mesg_header* header; const char* src; #if VERSION > VERSION_JPN - if(msgNo == 0) { + if (i_msgNo == 0) { src = name; - } - else + } else #endif { - header = msgGet.getMesgHeader(msgNo); + header = msgGet.getMesgHeader(i_msgNo); src = msgGet.getMessage(header); } @@ -2641,31 +2545,30 @@ void fopMsgM_msgDataProc_c::getString(char* dst, u32 msgNo) { const u8* cursor; s32 current; - while(cursor = (u8*)src + curOffset, current = *cursor, (s8)*cursor != '\0') { - if(*cursor == 0x1A) { + while (cursor = (u8*)src + curOffset, current = *cursor, (s8)*cursor != '\0') { + if (*cursor == 0x1A) { int codeLen = cursor[1]; - if(cursor[2] == 0 && cursor[3] == 0 && cursor[4] == 0) { + if (cursor[2] == 0 && cursor[3] == 0 && cursor[4] == 0) { #if VERSION > VERSION_JPN char str[24]; strcpy(str, dComIfGs_getPlayerName()); - if( - dComIfGs_getPalLanguage() == 1 && + if (dComIfGs_getPalLanguage() == 1 && ( #if VERSION == VERSION_PAL - // Version is PAL - msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 + // Version is PAL + i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 #else - // Version is USA, we know it's not DEMO or JPN because of the outer #if - msgNo == 0x33B || msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 || msgNo == 0x37DD || msgNo == 0x37DE + // Version is USA, we know it's not DEMO or JPN because of the outer #if + i_msgNo == 0x33B || i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 || i_msgNo == 0x37DD || + i_msgNo == 0x37DE #endif ) ) { s32 bufLen = strlen(str); current = (str)[bufLen - 1]; - if(current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(str, "\'"); - } - else { + } else { strcat(str, "s"); } } @@ -2673,26 +2576,25 @@ void fopMsgM_msgDataProc_c::getString(char* dst, u32 msgNo) { const char* str = dComIfGs_getPlayerName(); #endif - for(i = 0; str[i] != '\0'; i++) { - dst[numRead] = str[i]; + for (i = 0; str[i] != '\0'; i++) { + i_dest[numRead] = str[i]; numRead++; } } curOffset += codeLen; - } - else { - dst[numRead] = current; + } else { + i_dest[numRead] = current; curOffset++; numRead++; } } - dst[numRead] = '\0'; + i_dest[numRead] = '\0'; } /* 80035408-80035A24 .text getString__21fopMsgM_msgDataProc_cFPcPcPcPcUlPfPfPi */ -void fopMsgM_msgDataProc_c::getString(char* dst, char*, char*, char*, u32 msgNo, f32*, f32*, int*) { +void fopMsgM_msgDataProc_c::getString(char* i_dest, char*, char*, char*, u32 i_msgNo, f32*, f32*, int*) { /* Nonmatching */ fopMsgM_msgGet_c msgGet; msgGet.mMsgIdx = 0; @@ -2706,54 +2608,51 @@ void fopMsgM_msgDataProc_c::getString(char* dst, char*, char*, char*, u32 msgNo, mesg_header* header; const char* src; - if(msgNo == 0) { + if (i_msgNo == 0) { src = name; - } - else { - header = msgGet.getMesgHeader(msgNo); + } else { + header = msgGet.getMesgHeader(i_msgNo); src = msgGet.getMessage(header); } char dstBuf[24]; const u8* cursor; s32 current; - while(cursor = (u8*)src + curOffset, current = *cursor, (s8)*cursor != '\0') { - if(*cursor == 0x1A) { + while (cursor = (u8*)src + curOffset, current = *cursor, (s8)*cursor != '\0') { + if (*cursor == 0x1A) { int codeLen = cursor[1]; - if(cursor[2] == 0 && cursor[3] == 0 && cursor[4] == 0) { + if (cursor[2] == 0 && cursor[3] == 0 && cursor[4] == 0) { strcpy(dstBuf, dComIfGs_getPlayerName()); if( #if VERSION > VERSION_JPN dComIfGs_getPalLanguage() == 1 && #endif - (msgNo == 0x33B || msgNo == 0xC8B || msgNo == 0x1D21 || msgNo == 0x31D7 || msgNo == 0x37DD || msgNo == 0x37DE) + (i_msgNo == 0x33B || i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 || i_msgNo == 0x37DD || i_msgNo == 0x37DE) ) { s32 bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; - if(current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); - } - else { + } else { strcat(dstBuf, "s"); } } - for(s32 i = 0; dstBuf[i] != '\0'; i++) { - dst[numRead] = dstBuf[i]; + for (s32 i = 0; dstBuf[i] != '\0'; i++) { + i_dest[numRead] = dstBuf[i]; numRead++; } } curOffset += codeLen; - } - else { - dst[numRead] = current; + } else { + i_dest[numRead] = current; curOffset++; numRead++; } } - dst[numRead] = '\0'; + i_dest[numRead] = '\0'; } /* 80035A24-80035D28 .text getRubyString__21fopMsgM_msgDataProc_cFPcPcPcPcPcPcPfPfPi */ @@ -2762,13 +2661,12 @@ void fopMsgM_msgDataProc_c::getRubyString(char* param_1, char* param_2, char* pa f32 temp = *param_7; char* p1 = param_5; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *(u8*)p1; p1++; - if(*param_9 == 0) { + if (*param_9 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -2778,32 +2676,30 @@ void fopMsgM_msgDataProc_c::getRubyString(char* param_1, char* param_2, char* pa strcat(param_1, param_5); strcat(param_2, param_5); - if(selectFlag != 1) { + if (selectFlag != 1) { *param_7 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { *param_7 = field_0x108[lineCount] + field_0x14 + 0.5f; } f32 temp3 = 0.0f; p1 = param_6; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *(u8*)p1; p1++; - + temp3 += rubyLength(c, false); } char buf[12]; int temp2 = temp + (*param_7 - temp) / 2.0f - (temp3 / 2.0f) + 0.5f; temp2 = (temp2 - *param_8) + 0.5f; - if(temp2 > 0) { + if (temp2 > 0) { sprintf(buf, "\x1B""CR[%d]", temp2); strcat(param_3, buf); strcat(param_4, buf); *param_8 += temp2; - } - else if(temp2 == 0) { + } else if (temp2 == 0) { sprintf(buf, "\x1B""CL[%d]", temp2); strcat(param_3, buf); strcat(param_4, buf); @@ -2838,13 +2734,12 @@ void fopMsgM_msgDataProc_c::tag_len_kaisen_game(int* param_1, f32* param_2, int* #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -2894,13 +2789,12 @@ void fopMsgM_msgDataProc_c::tag_len_rupee(int* param_1, f32* param_2, int* param #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -2914,7 +2808,7 @@ void fopMsgM_msgDataProc_c::tag_len_rupee(int* param_1, f32* param_2, int* param void fopMsgM_msgDataProc_c::tag_len_num_input(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[12]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -2935,13 +2829,12 @@ void fopMsgM_msgDataProc_c::tag_len_num_input(int* param_1, f32* param_2, int* p #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -2991,13 +2884,12 @@ void fopMsgM_msgDataProc_c::tag_len_sword_game(int* param_1, f32* param_2, int* #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3014,13 +2906,12 @@ void fopMsgM_msgDataProc_c::tag_len_letter_game(int* param_1, f32* param_2, int* fopMsgM_int_to_char(buf, dComIfGp_getMiniGameRupee(), false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3036,13 +2927,12 @@ void fopMsgM_msgDataProc_c::tag_len_letter_game_max(int* param_1, f32* param_2, fopMsgM_int_to_char(buf, dComIfGs_getEventReg(dSv_event_flag_c::UNK_8AFF), false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3058,13 +2948,12 @@ void fopMsgM_msgDataProc_c::tag_len_fish(int* param_1, f32* param_2, int* param_ fopMsgM_int_to_char(buf, dComIfGp_getMessageCountNumber(), false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3114,13 +3003,12 @@ void fopMsgM_msgDataProc_c::tag_len_fish_rupee(int* param_1, f32* param_2, int* #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3182,13 +3070,12 @@ void fopMsgM_msgDataProc_c::tag_len_letter(int* param_1, f32* param_2, int* para #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3225,13 +3112,12 @@ void fopMsgM_msgDataProc_c::tag_len_rescue(int* param_1, f32* param_2, int* para #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3293,7 +3179,7 @@ void fopMsgM_msgDataProc_c::tag_len_forest_timer(int* param_1, f32* param_2, int #endif int seconds = (dComIfGs_getFwaterTimer() % 1800) / 30; - if(minutes == 0 && seconds == 0) { + if (minutes == 0 && seconds == 0) { seconds = 1; } @@ -3341,13 +3227,12 @@ void fopMsgM_msgDataProc_c::tag_len_forest_timer(int* param_1, f32* param_2, int #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3393,22 +3278,20 @@ void fopMsgM_msgDataProc_c::tag_len_birdman(int* param_1, f32* param_2, int* par } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " yards"); - } - else { + } else { strcat(buf, " yard"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3458,22 +3341,20 @@ void fopMsgM_msgDataProc_c::tag_len_point(int* param_1, f32* param_2, int* param } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " points"); - } - else { + } else { strcat(buf, " point"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3523,22 +3404,20 @@ void fopMsgM_msgDataProc_c::tag_len_get_pendant(int* param_1, f32* param_2, int* } } #else - if(num != 1) { + if (num != 1) { strcat(buf, ""); - } - else { + } else { strcat(buf, ""); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3588,22 +3467,20 @@ void fopMsgM_msgDataProc_c::tag_len_rev_pendant(int* param_1, f32* param_2, int* } } #else - if(num != 1) { + if (num != 1) { strcat(buf, ""); - } - else { + } else { strcat(buf, ""); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3665,7 +3542,7 @@ void fopMsgM_msgDataProc_c::tag_len_pig_timer(int* param_1, f32* param_2, int* p #endif int seconds = (dComIfGp_getItemTimer() % 1800) / 30; - if(minutes == 0 && seconds == 0) { + if (minutes == 0 && seconds == 0) { seconds = 1; } @@ -3713,13 +3590,12 @@ void fopMsgM_msgDataProc_c::tag_len_pig_timer(int* param_1, f32* param_2, int* p #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3757,22 +3633,20 @@ void fopMsgM_msgDataProc_c::tag_len_get_bomb(int* param_1, f32* param_2, int* pa } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " bombs"); - } - else { + } else { strcat(buf, " bomb"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3810,22 +3684,20 @@ void fopMsgM_msgDataProc_c::tag_len_get_arrow(int* param_1, f32* param_2, int* p } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " arrows"); - } - else { + } else { strcat(buf, " arrow"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3867,22 +3739,20 @@ void fopMsgM_msgDataProc_c::tag_len_stock_bokobaba(int* param_1, f32* param_2, i } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " seeds"); - } - else { + } else { strcat(buf, " seed"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3928,22 +3798,20 @@ void fopMsgM_msgDataProc_c::tag_len_stock_dokuro(int* param_1, f32* param_2, int } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " neckalces"); - } - else { + } else { strcat(buf, " neckalce"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -3989,13 +3857,12 @@ void fopMsgM_msgDataProc_c::tag_len_stock_chuchu(int* param_1, f32* param_2, int #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4041,22 +3908,20 @@ void fopMsgM_msgDataProc_c::tag_len_stock_pendant(int* param_1, f32* param_2, in } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " necklaces"); - } - else { + } else { strcat(buf, " necklace"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4102,22 +3967,20 @@ void fopMsgM_msgDataProc_c::tag_len_stock_hane(int* param_1, f32* param_2, int* } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " feathers"); - } - else { + } else { strcat(buf, " feather"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4159,22 +4022,20 @@ void fopMsgM_msgDataProc_c::tag_len_stock_kenshi(int* param_1, f32* param_2, int } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " crests"); - } - else { + } else { strcat(buf, " crest"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4224,13 +4085,12 @@ void fopMsgM_msgDataProc_c::tag_len_terry_rupee(int* param_1, f32* param_2, int* #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4244,7 +4104,7 @@ void fopMsgM_msgDataProc_c::tag_len_terry_rupee(int* param_1, f32* param_2, int* void fopMsgM_msgDataProc_c::tag_len_input_bokobaba(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4265,17 +4125,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_bokobaba(int* param_1, f32* param_2, i #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4289,7 +4148,7 @@ void fopMsgM_msgDataProc_c::tag_len_input_bokobaba(int* param_1, f32* param_2, i void fopMsgM_msgDataProc_c::tag_len_input_dokuro(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4310,17 +4169,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_dokuro(int* param_1, f32* param_2, int #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4334,7 +4192,7 @@ void fopMsgM_msgDataProc_c::tag_len_input_dokuro(int* param_1, f32* param_2, int void fopMsgM_msgDataProc_c::tag_len_input_chuchu(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4355,17 +4213,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_chuchu(int* param_1, f32* param_2, int #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4379,7 +4236,7 @@ void fopMsgM_msgDataProc_c::tag_len_input_chuchu(int* param_1, f32* param_2, int void fopMsgM_msgDataProc_c::tag_len_input_pendant(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4400,17 +4257,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_pendant(int* param_1, f32* param_2, in #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4424,7 +4280,7 @@ void fopMsgM_msgDataProc_c::tag_len_input_pendant(int* param_1, f32* param_2, in void fopMsgM_msgDataProc_c::tag_len_input_hane(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4445,17 +4301,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_hane(int* param_1, f32* param_2, int* #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4469,7 +4324,7 @@ void fopMsgM_msgDataProc_c::tag_len_input_hane(int* param_1, f32* param_2, int* void fopMsgM_msgDataProc_c::tag_len_input_kenshi(int* param_1, f32* param_2, int* param_3, int* param_4, int* param_5) { char buf[28]; - if(*param_5 != lineCount) { + if (*param_5 != lineCount) { lineCount = *param_5; } @@ -4490,17 +4345,16 @@ void fopMsgM_msgDataProc_c::tag_len_input_kenshi(int* param_1, f32* param_2, int #endif char* p1; - u8 *p2; + u8* p2; p2 = (u8*)buf; p1 = buf; - while(*p1 != '\0') { + while (*p1 != '\0') { u8 c = *p2; p1++; p2++; - if(*param_1 == 0) { + if (*param_1 == 0) { *param_2 = charLength(*param_4, c, true); - } - else { + } else { *param_2 += charLength(*param_4, c, false); } @@ -4518,13 +4372,12 @@ void fopMsgM_msgDataProc_c::tag_kaisen_game() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4534,10 +4387,9 @@ void fopMsgM_msgDataProc_c::tag_kaisen_game() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4599,22 +4451,20 @@ void fopMsgM_msgDataProc_c::tag_rupee() { } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " Rupees"); - } - else { + } else { strcat(buf, " Rupee"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4624,10 +4474,9 @@ void fopMsgM_msgDataProc_c::tag_rupee() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4666,13 +4515,12 @@ void fopMsgM_msgDataProc_c::tag_num_input() { #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4682,10 +4530,9 @@ void fopMsgM_msgDataProc_c::tag_num_input() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4700,13 +4547,12 @@ void fopMsgM_msgDataProc_c::tag_sword_game() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4716,10 +4562,9 @@ void fopMsgM_msgDataProc_c::tag_sword_game() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4750,10 +4595,9 @@ void fopMsgM_msgDataProc_c::tag_sword_game() { } } #else - if(num != 1) { + if (num != 1) { strcpy(buf2, " blows"); - } - else { + } else { strcpy(buf2, " blow"); } #endif @@ -4770,13 +4614,12 @@ void fopMsgM_msgDataProc_c::tag_letter_game() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4786,10 +4629,9 @@ void fopMsgM_msgDataProc_c::tag_letter_game() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4804,13 +4646,12 @@ void fopMsgM_msgDataProc_c::tag_letter_game_max() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4820,10 +4661,9 @@ void fopMsgM_msgDataProc_c::tag_letter_game_max() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4838,13 +4678,12 @@ void fopMsgM_msgDataProc_c::tag_fish() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4854,10 +4693,9 @@ void fopMsgM_msgDataProc_c::tag_fish() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4896,22 +4734,20 @@ void fopMsgM_msgDataProc_c::tag_fish_rupee() { } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " Rupees"); - } - else { + } else { strcat(buf, " Rupee"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4921,10 +4757,9 @@ void fopMsgM_msgDataProc_c::tag_fish_rupee() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -4939,13 +4774,12 @@ void fopMsgM_msgDataProc_c::tag_letter() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -4955,10 +4789,9 @@ void fopMsgM_msgDataProc_c::tag_letter() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5001,10 +4834,9 @@ void fopMsgM_msgDataProc_c::tag_letter() { } } #else - if(num != 1) { + if (num != 1) { strcpy(buf2, " letters"); - } - else { + } else { strcpy(buf2, " letter"); } #endif @@ -5021,13 +4853,12 @@ void fopMsgM_msgDataProc_c::tag_rescue() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5037,10 +4868,9 @@ void fopMsgM_msgDataProc_c::tag_rescue() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5080,13 +4910,12 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { fopMsgM_int_to_char(buf, minutes, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5095,10 +4924,9 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } strcpy(buf2, ":"); @@ -5106,19 +4934,18 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { buf[0] = '\0'; int seconds = (dComIfGs_getFwaterTimer() % 1800) / 30; - if(minutes == 0 && seconds == 0) { + if (minutes == 0 && seconds == 0) { seconds = 1; } fopMsgM_int_to_char2(buf, seconds); i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5128,10 +4955,9 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5175,22 +5001,20 @@ void fopMsgM_msgDataProc_c::tag_birdman() { } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " yards"); - } - else { + } else { strcat(buf, " yard"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5200,10 +5024,9 @@ void fopMsgM_msgDataProc_c::tag_birdman() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5250,22 +5073,20 @@ void fopMsgM_msgDataProc_c::tag_point() { } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " points"); - } - else { + } else { strcat(buf, " point"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5275,10 +5096,9 @@ void fopMsgM_msgDataProc_c::tag_point() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5293,13 +5113,12 @@ void fopMsgM_msgDataProc_c::tag_get_pendant() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5309,10 +5128,9 @@ void fopMsgM_msgDataProc_c::tag_get_pendant() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5353,10 +5171,9 @@ void fopMsgM_msgDataProc_c::tag_get_pendant() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, ""); - } - else { + } else { strcpy(buf2, ""); } #endif @@ -5373,13 +5190,12 @@ void fopMsgM_msgDataProc_c::tag_rev_pendant() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5389,10 +5205,9 @@ void fopMsgM_msgDataProc_c::tag_rev_pendant() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5433,10 +5248,9 @@ void fopMsgM_msgDataProc_c::tag_rev_pendant() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, ""); - } - else { + } else { strcpy(buf2, ""); } #endif @@ -5454,13 +5268,12 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { fopMsgM_int_to_char(buf, minutes, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5469,10 +5282,9 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } strcpy(buf2, ":"); @@ -5480,19 +5292,18 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { buf[0] = '\0'; int seconds = (dComIfGp_getItemTimer() % 1800) / 30; - if(minutes == 0 && seconds == 0) { + if (minutes == 0 && seconds == 0) { seconds = 1; } fopMsgM_int_to_char2(buf, seconds); i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5502,10 +5313,9 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5521,13 +5331,12 @@ void fopMsgM_msgDataProc_c::tag_get_bomb() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5537,10 +5346,9 @@ void fopMsgM_msgDataProc_c::tag_get_bomb() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5567,10 +5375,9 @@ void fopMsgM_msgDataProc_c::tag_get_bomb() { } } #else - if(num != 1) { + if (num != 1) { strcpy(buf2, " bombs"); - } - else { + } else { strcpy(buf2, " bomb"); } #endif @@ -5587,13 +5394,12 @@ void fopMsgM_msgDataProc_c::tag_get_arrow() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5603,10 +5409,9 @@ void fopMsgM_msgDataProc_c::tag_get_arrow() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5633,10 +5438,9 @@ void fopMsgM_msgDataProc_c::tag_get_arrow() { } } #else - if(num != 1) { + if (num != 1) { strcpy(buf2, " arrows"); - } - else { + } else { strcpy(buf2, " arrow"); } #endif @@ -5653,13 +5457,12 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5669,10 +5472,9 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5706,10 +5508,9 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, " seeds"); - } - else { + } else { strcpy(buf2, " seed"); } getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); @@ -5726,13 +5527,12 @@ void fopMsgM_msgDataProc_c::tag_stock_dokuro() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5742,10 +5542,9 @@ void fopMsgM_msgDataProc_c::tag_stock_dokuro() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5782,10 +5581,9 @@ void fopMsgM_msgDataProc_c::tag_stock_dokuro() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, " necklaces"); - } - else { + } else { strcpy(buf2, " necklace"); } #endif @@ -5802,13 +5600,12 @@ void fopMsgM_msgDataProc_c::tag_stock_chuchu() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5818,10 +5615,9 @@ void fopMsgM_msgDataProc_c::tag_stock_chuchu() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5867,13 +5663,12 @@ void fopMsgM_msgDataProc_c::tag_stock_pendant() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5883,10 +5678,9 @@ void fopMsgM_msgDataProc_c::tag_stock_pendant() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5923,10 +5717,9 @@ void fopMsgM_msgDataProc_c::tag_stock_pendant() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, " necklaces"); - } - else { + } else { strcpy(buf2, " necklace"); } #endif @@ -5943,13 +5736,12 @@ void fopMsgM_msgDataProc_c::tag_stock_hane() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -5959,10 +5751,9 @@ void fopMsgM_msgDataProc_c::tag_stock_hane() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -5999,10 +5790,9 @@ void fopMsgM_msgDataProc_c::tag_stock_hane() { #else char buf2[12]; - if(num != 1) { + if (num != 1) { strcpy(buf2, " feathers"); - } - else { + } else { strcpy(buf2, " feather"); } #endif @@ -6019,13 +5809,12 @@ void fopMsgM_msgDataProc_c::tag_stock_kenshi() { fopMsgM_int_to_char(buf, num, false); int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -6035,10 +5824,9 @@ void fopMsgM_msgDataProc_c::tag_stock_kenshi() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6069,10 +5857,9 @@ void fopMsgM_msgDataProc_c::tag_stock_kenshi() { } } #else - if(num != 1) { + if (num != 1) { strcpy(buf2, " crests"); - } - else { + } else { strcpy(buf2, " crest"); } #endif @@ -6113,22 +5900,20 @@ void fopMsgM_msgDataProc_c::tag_terry_rupee() { } } #else - if(num != 1) { + if (num != 1) { strcat(buf, " Rupees"); - } - else { + } else { strcat(buf, " Rupee"); } #endif int i = 0; - while(buf[i] != '\0') { - u8 c = ((u8*) buf)[i]; + while (buf[i] != '\0') { + u8 c = ((u8*)buf)[i]; i++; - if(field_0x150 == 0) { + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); - } - else { + } else { field_0x14 += charLength(field_0x148, c, false); } @@ -6138,10 +5923,9 @@ void fopMsgM_msgDataProc_c::tag_terry_rupee() { strcat(field_0x60, buf); strcat(field_0x68, buf); - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6163,10 +5947,9 @@ void fopMsgM_msgDataProc_c::tag_input_bokobaba() { field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6208,10 +5991,9 @@ void fopMsgM_msgDataProc_c::tag_input_dokuro() { field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6253,10 +6035,9 @@ void fopMsgM_msgDataProc_c::tag_input_chuchu() { field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6297,10 +6078,9 @@ void fopMsgM_msgDataProc_c::tag_input_pendant() { field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6342,10 +6122,9 @@ void fopMsgM_msgDataProc_c::tag_input_hane() { field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6381,16 +6160,15 @@ void fopMsgM_msgDataProc_c::tag_input_kenshi() { selectFlag = 3; iconSelect(field_0x148, 0x16); mesgStatus = 0x15; - sprintf(buf, "\x1B""CR[%d]", temp); + sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); field_0x14 = temp; field_0x150 += 2; - if(selectFlag != 1) { + if (selectFlag != 1) { field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; - } - else { + } else { field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; } @@ -6427,162 +6205,175 @@ fopMsgM_f2d_class fopMsgM_centerPosCalc(fopMsgM_f2d_class param_1, fopMsgM_f2d_c } /* 8003BA40-8003BB34 .text fopMsgM_pane_parts_set__FP18fopMsgM_pane_class */ -void fopMsgM_pane_parts_set(fopMsgM_pane_class* i_this) { - i_this->mPosTopLeftOrig.x = i_this->pane->mBounds.i.x; - i_this->mPosTopLeftOrig.y = i_this->pane->mBounds.i.y; - i_this->mSizeOrig.x = i_this->pane->mBounds.f.x - i_this->pane->mBounds.i.x; - i_this->mSizeOrig.y = i_this->pane->mBounds.f.y - i_this->pane->mBounds.i.y; - fopMsgM_f2d_class center = fopMsgM_centerPosCalc(i_this->mPosTopLeftOrig, i_this->mSizeOrig); - i_this->mPosCenterOrig.x = center.x; - i_this->mPosCenterOrig.y = center.y; - i_this->mInitAlpha = i_this->pane->getAlpha(); - i_this->mPosTopLeft = i_this->mPosTopLeftOrig; - i_this->mPosCenter = i_this->mPosCenterOrig; - i_this->mSize = i_this->mSizeOrig; - i_this->mNowAlpha = 0; - i_this->mUserArea = 0; +void fopMsgM_pane_parts_set(fopMsgM_pane_class* i_pane) { + i_pane->mPosTopLeftOrig.x = i_pane->pane->mBounds.i.x; + i_pane->mPosTopLeftOrig.y = i_pane->pane->mBounds.i.y; + i_pane->mSizeOrig.x = i_pane->pane->mBounds.f.x - i_pane->pane->mBounds.i.x; + i_pane->mSizeOrig.y = i_pane->pane->mBounds.f.y - i_pane->pane->mBounds.i.y; + fopMsgM_f2d_class center = fopMsgM_centerPosCalc(i_pane->mPosTopLeftOrig, i_pane->mSizeOrig); + i_pane->mPosCenterOrig.x = center.x; + i_pane->mPosCenterOrig.y = center.y; + i_pane->mInitAlpha = i_pane->pane->getAlpha(); + i_pane->mPosTopLeft = i_pane->mPosTopLeftOrig; + i_pane->mPosCenter = i_pane->mPosCenterOrig; + i_pane->mSize = i_pane->mSizeOrig; + i_pane->mNowAlpha = 0; + i_pane->mUserArea = 0; } /* 8003BB34-8003BB4C .text fopMsgM_pane_parts_set__FP24fopMsgM_pane_alpha_class */ -void fopMsgM_pane_parts_set(fopMsgM_pane_alpha_class* i_this) { - i_this->mInitAlpha = i_this->pane->getAlpha(); - i_this->mNowAlpha = 0; +void fopMsgM_pane_parts_set(fopMsgM_pane_alpha_class* i_pane) { + i_pane->mInitAlpha = i_pane->pane->getAlpha(); + i_pane->mNowAlpha = 0; } /* 8003BB4C-8003BB78 .text fopMsgM_setPaneData__FP18fopMsgM_pane_classP7J2DPane */ -void fopMsgM_setPaneData(fopMsgM_pane_class* i_this, J2DPane* pane) { - if (pane != NULL) { - i_this->pane = pane; - fopMsgM_pane_parts_set(i_this); +void fopMsgM_setPaneData(fopMsgM_pane_class* i_pane, J2DPane* i_paneData) { + if (i_paneData != NULL) { + i_pane->pane = i_paneData; + fopMsgM_pane_parts_set(i_pane); } } /* 8003BB78-8003BBCC .text fopMsgM_setPaneData__FP18fopMsgM_pane_classP9J2DScreenUl */ -void fopMsgM_setPaneData(fopMsgM_pane_class* i_this, J2DScreen* scrn, u32 id) { - J2DPane * pane = scrn->search(id); - if (pane != NULL) { - i_this->pane = pane; - fopMsgM_pane_parts_set(i_this); +void fopMsgM_setPaneData(fopMsgM_pane_class* i_pane, J2DScreen* i_scrn, u32 i_tag) { + J2DPane* paneData = i_scrn->search(i_tag); + if (paneData != NULL) { + i_pane->pane = paneData; + fopMsgM_pane_parts_set(i_pane); } } /* 8003BBCC-8003BBF8 .text fopMsgM_setPaneData__FP24fopMsgM_pane_alpha_classP7J2DPane */ -void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_this, J2DPane* pane) { - if (pane != NULL) { - i_this->pane = pane; - fopMsgM_pane_parts_set(i_this); +void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_pane, J2DPane* i_paneData) { + if (i_paneData != NULL) { + i_pane->pane = i_paneData; + fopMsgM_pane_parts_set(i_pane); } } /* 8003BBF8-8003BC88 .text fopMsgM_setPaneData__FP24fopMsgM_pane_alpha_classP9J2DScreenUl */ -void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_this, J2DScreen* scrn, u32 id) { - J2DPane * pane = scrn->search(id); - if (pane != NULL) { - i_this->pane = pane; - fopMsgM_pane_parts_set(i_this); +void fopMsgM_setPaneData(fopMsgM_pane_alpha_class* i_pane, J2DScreen* i_scrn, u32 i_tag) { + J2DPane* paneData = i_scrn->search(i_tag); + if (paneData != NULL) { + i_pane->pane = paneData; + fopMsgM_pane_parts_set(i_pane); } else { JUT_ASSERT(VERSION_SELECT(0x22F9, 0x22F9, 0x398D, 0x3A73), FALSE); } } /* 8003BC88-8003BCC0 .text fopMsgM_paneTrans__FP18fopMsgM_pane_classff */ -void fopMsgM_paneTrans(fopMsgM_pane_class* i_this, f32 x, f32 y) { - i_this->mPosCenter.x = i_this->mPosCenterOrig.x + x; - i_this->mPosCenter.y = i_this->mPosCenterOrig.y + y; - fopMsgM_cposMove(i_this); +void fopMsgM_paneTrans(fopMsgM_pane_class* i_pane, f32 i_transX, f32 i_transY) { + i_pane->mPosCenter.x = i_pane->mPosCenterOrig.x + i_transX; + i_pane->mPosCenter.y = i_pane->mPosCenterOrig.y + i_transY; + fopMsgM_cposMove(i_pane); } /* 8003BCC0-8003BCEC .text fopMsgM_paneScaleX__FP18fopMsgM_pane_classf */ -void fopMsgM_paneScaleX(fopMsgM_pane_class* i_this, f32 s) { - i_this->mSize.x = i_this->mSizeOrig.x * s; - fopMsgM_cposMove(i_this); +void fopMsgM_paneScaleX(fopMsgM_pane_class* i_pane, f32 i_scale) { + i_pane->mSize.x = i_pane->mSizeOrig.x * i_scale; + fopMsgM_cposMove(i_pane); } /* 8003BCEC-8003BD18 .text fopMsgM_paneScaleY__FP18fopMsgM_pane_classf */ -void fopMsgM_paneScaleY(fopMsgM_pane_class* i_this, f32 s) { - i_this->mSize.y = i_this->mSizeOrig.y * s; - fopMsgM_cposMove(i_this); +void fopMsgM_paneScaleY(fopMsgM_pane_class* i_pane, f32 i_scale) { + i_pane->mSize.y = i_pane->mSizeOrig.y * i_scale; + fopMsgM_cposMove(i_pane); } /* 8003BD18-8003BD50 .text fopMsgM_paneScale__FP18fopMsgM_pane_classff */ -void fopMsgM_paneScale(fopMsgM_pane_class* i_this, f32 sx, f32 sy) { - i_this->mSize.x = i_this->mSizeOrig.x * sx; - i_this->mSize.y = i_this->mSizeOrig.y * sy; - fopMsgM_cposMove(i_this); +void fopMsgM_paneScale(fopMsgM_pane_class* i_pane, f32 i_scaleX, f32 i_scaleY) { + i_pane->mSize.x = i_pane->mSizeOrig.x * i_scaleX; + i_pane->mSize.y = i_pane->mSizeOrig.y * i_scaleY; + fopMsgM_cposMove(i_pane); } /* 8003BD50-8003BD88 .text fopMsgM_paneScaleXY__FP18fopMsgM_pane_classf */ -void fopMsgM_paneScaleXY(fopMsgM_pane_class* i_this, f32 s) { - i_this->mSize.x = i_this->mSizeOrig.x * s; - i_this->mSize.y = i_this->mSizeOrig.y * s; - fopMsgM_cposMove(i_this); +void fopMsgM_paneScaleXY(fopMsgM_pane_class* i_pane, f32 i_scale) { + i_pane->mSize.x = i_pane->mSizeOrig.x * i_scale; + i_pane->mSize.y = i_pane->mSizeOrig.y * i_scale; + fopMsgM_cposMove(i_pane); } /* 8003BD88-8003BE14 .text fopMsgM_cposMove__FP18fopMsgM_pane_class */ -void fopMsgM_cposMove(fopMsgM_pane_class* i_this) { - i_this->mPosTopLeft.x = i_this->mPosCenter.x - i_this->mSize.x / 2.0f; - i_this->mPosTopLeft.y = i_this->mPosCenter.y - i_this->mSize.y / 2.0f; - i_this->pane->move(i_this->mPosTopLeft.x, i_this->mPosTopLeft.y); - i_this->pane->resize(i_this->mSize.x, i_this->mSize.y); +void fopMsgM_cposMove(fopMsgM_pane_class* i_pane) { + i_pane->mPosTopLeft.x = i_pane->mPosCenter.x - i_pane->mSize.x / 2.0f; + i_pane->mPosTopLeft.y = i_pane->mPosCenter.y - i_pane->mSize.y / 2.0f; + i_pane->pane->move(i_pane->mPosTopLeft.x, i_pane->mPosTopLeft.y); + i_pane->pane->resize(i_pane->mSize.x, i_pane->mSize.y); } /* 8003BE14-8003BE24 .text fopMsgM_setAlpha__FP18fopMsgM_pane_class */ -void fopMsgM_setAlpha(fopMsgM_pane_class* i_this) { - i_this->pane->setAlpha(i_this->mNowAlpha); +void fopMsgM_setAlpha(fopMsgM_pane_class* i_pane) { + i_pane->pane->setAlpha(i_pane->mNowAlpha); } /* 8003BE24-8003BE30 .text fopMsgM_setInitAlpha__FP18fopMsgM_pane_class */ -void fopMsgM_setInitAlpha(fopMsgM_pane_class* i_this) { - i_this->mNowAlpha = i_this->mInitAlpha; +void fopMsgM_setInitAlpha(fopMsgM_pane_class* i_pane) { + i_pane->mNowAlpha = i_pane->mInitAlpha; } /* 8003BE30-8003BE6C .text fopMsgM_setNowAlpha__FP18fopMsgM_pane_classf */ -void fopMsgM_setNowAlpha(fopMsgM_pane_class* i_this, f32 v) { - i_this->mNowAlpha = i_this->mInitAlpha * v; +void fopMsgM_setNowAlpha(fopMsgM_pane_class* i_pane, f32 i_alpha) { + i_pane->mNowAlpha = i_pane->mInitAlpha * i_alpha; } /* 8003BE6C-8003BE78 .text fopMsgM_setNowAlphaZero__FP18fopMsgM_pane_class */ -void fopMsgM_setNowAlphaZero(fopMsgM_pane_class* i_this) { - i_this->mNowAlpha = 0; +void fopMsgM_setNowAlphaZero(fopMsgM_pane_class* i_pane) { + i_pane->mNowAlpha = 0; } /* 8003BE78-8003BE88 .text fopMsgM_setAlpha__FP24fopMsgM_pane_alpha_class */ -void fopMsgM_setAlpha(fopMsgM_pane_alpha_class* i_this) { - i_this->pane->setAlpha(i_this->mNowAlpha); +void fopMsgM_setAlpha(fopMsgM_pane_alpha_class* i_pane) { + i_pane->pane->setAlpha(i_pane->mNowAlpha); } /* 8003BE88-8003BEC4 .text fopMsgM_setNowAlpha__FP24fopMsgM_pane_alpha_classf */ -void fopMsgM_setNowAlpha(fopMsgM_pane_alpha_class* i_this, f32 v) { - i_this->mNowAlpha = i_this->mInitAlpha * v; +void fopMsgM_setNowAlpha(fopMsgM_pane_alpha_class* i_pane, f32 i_alpha) { + i_pane->mNowAlpha = i_pane->mInitAlpha * i_alpha; } /* 8003BEC4-8003C07C .text fopMsgM_valueIncrease__FiiUc */ -f32 fopMsgM_valueIncrease(int max, int value, u8 mode) { - if (max <= 0) +f32 fopMsgM_valueIncrease(int i_max, int i_value, u8 i_mode) { + if (i_max <= 0) return 1.0f; - if (value < 0) - value = 0; - else if (value > max) - value = max; + if (i_value < 0) + i_value = 0; + else if (i_value > i_max) + i_value = i_max; f32 ret; - f32 v = ((f32)value) / ((f32)max); - switch (mode) { - case 0: ret = v * v; break; - case 1: ret = std::sqrtf(v); break; - case 2: default: ret = v; break; - case 3: ret = (v * 2.0f - 1.0f) * 2.0f - 1.0f; break; - case 4: ret = JMASSin(v * 32768.0f * 0.5f) * JMASSin(v * 32768.0f * 0.5f); break; - case 5: ret = JMASSin(v * 65535.0f * 0.5f) * JMASSin(v * 65535.0f * 0.5f); break; + f32 v = ((f32)i_value) / ((f32)i_max); + switch (i_mode) { + case 0: + ret = v * v; + break; + case 1: + ret = std::sqrtf(v); + break; + case 2: + default: + ret = v; + break; + case 3: + ret = (v * 2.0f - 1.0f) * 2.0f - 1.0f; + break; + case 4: + ret = JMASSin(v * 32768.0f * 0.5f) * JMASSin(v * 32768.0f * 0.5f); + break; + case 5: + ret = JMASSin(v * 65535.0f * 0.5f) * JMASSin(v * 65535.0f * 0.5f); + break; } return ret; } /* 8003C07C-8003C0F8 .text fopMsgM_blendInit__FP18fopMsgM_pane_classPCc */ -void fopMsgM_blendInit(fopMsgM_pane_class* i_this, const char* data) { - ((J2DPicture*)i_this->pane)->append(data, 1.0f); - J2DPicture* pic = (J2DPicture*)i_this->pane; +void fopMsgM_blendInit(fopMsgM_pane_class* i_pane, const char* data) { + ((J2DPicture*)i_pane->pane)->append(data, 1.0f); + J2DPicture* pic = (J2DPicture*)i_pane->pane; pic->setBlendColorRatio(0.0f, 1.0f, 1.0f, 1.0f); pic->setBlendAlphaRatio(0.0f, 1.0f, 1.0f, 1.0f); } @@ -6595,10 +6386,10 @@ void fopMsgM_blendInit(J2DPicture* pic, const char* data) { } /* 8003C16C-8003C1D4 .text fopMsgM_blendDraw__FP18fopMsgM_pane_classPCc */ -void fopMsgM_blendDraw(fopMsgM_pane_class* i_this, const char* data) { - i_this->pane->show(); - ((J2DPicture*)i_this->pane)->remove(); - ((J2DPicture*)i_this->pane)->append(data, 1.0f); +void fopMsgM_blendDraw(fopMsgM_pane_class* i_pane, const char* data) { + i_pane->pane->show(); + ((J2DPicture*)i_pane->pane)->remove(); + ((J2DPicture*)i_pane->pane)->append(data, 1.0f); } /* 8003C1D4-8003C234 .text fopMsgM_blendDraw__FP10J2DPicturePCc */ @@ -6614,23 +6405,21 @@ void fopMsgM_setFontsizeCenter(char* param_1, char* param_2, char* param_3, char char buf1[44]; char buf2[12]; - if(temp > 0) { + if (temp > 0) { sprintf(buf1, "\x1b""FX[%d]\x1b""FY[%d]", param_6, param_6); buf2[0] = '\0'; strcat(param_1, buf1); strcat(param_2, buf1); strcat(param_3, buf2); strcat(param_4, buf2); - } - else if(temp < 0) { + } else if (temp < 0) { sprintf(buf1, "\x1b""FX[%d]\x1b""FY[%d]", param_6, param_6); buf2[0] = '\0'; strcat(param_1, buf1); strcat(param_2, buf1); strcat(param_3, buf2); strcat(param_4, buf2); - } - else if(param_5 != param_6) { + } else if (param_5 != param_6) { sprintf(buf1, "\x1b""FX[%d]\x1b""FY[%d]", param_6, param_6); strcat(param_1, buf1); strcat(param_2, buf1); @@ -6649,13 +6438,13 @@ void fopMsgM_setFontsizeCenter2(char* a, char* b, char* c, char* d, int, int siz } /* 8003C414-8003C450 .text fopMsgM_createExpHeap__FUl */ -JKRExpHeap* fopMsgM_createExpHeap(u32 size) { - return JKRExpHeap::create(size, mDoExt_getGameHeap(), FALSE); +JKRExpHeap* fopMsgM_createExpHeap(u32 i_size) { + return JKRExpHeap::create(i_size, mDoExt_getGameHeap(), FALSE); } /* 8003C450-8003C470 .text fopMsgM_destroyExpHeap__FP10JKRExpHeap */ -void fopMsgM_destroyExpHeap(JKRExpHeap* heap) { - heap->destroy(); +void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap) { + i_heap->destroy(); } static const char* dummy1 = "\x1B""CU[%d]"; diff --git a/src/m_Do/m_Do_MemCard.cpp b/src/m_Do/m_Do_MemCard.cpp index 59de78a305..47b6f64eb3 100644 --- a/src/m_Do/m_Do_MemCard.cpp +++ b/src/m_Do/m_Do_MemCard.cpp @@ -27,7 +27,7 @@ void mDoMemCd_Ctrl_c::ThdInit() { mPictDataPtr = NULL; mPictDataWritePtr = NULL; mCopyToPos = 0; - field_0x165A = 2; + mProbeStat = 2; field_0x1660 = CARD_NO_COMMAND; mCommand = CARD_NO_COMMAND; mCardSlot = 0; @@ -85,7 +85,7 @@ void mDoMemCd_Ctrl_c::update() { if (mDoRst::isReset()) { OSLockMutex(&mMutex); mCommand = CARD_DETACH; - field_0x165A = 3; + mProbeStat = 3; OSUnlockMutex(&mMutex); OSSignalCond(&mCond); } else @@ -94,13 +94,13 @@ void mDoMemCd_Ctrl_c::update() { if (getStatus(0) != 14) { if (CARDProbe(0) && getStatus(0) == 0) { OSLockMutex(&mMutex); - field_0x165A = 0; + mProbeStat = 0; mCommand = CARD_ATTACH; OSUnlockMutex(&mMutex); OSSignalCond(&mCond); } else if (!CARDProbe(0) && getStatus(0) != 0) { OSLockMutex(&mMutex); - field_0x165A = 1; + mProbeStat = 1; mCommand = CARD_DETACH; OSUnlockMutex(&mMutex); OSSignalCond(&mCond);