diff --git a/include/d/actor/d_a_agb.h b/include/d/actor/d_a_agb.h index aa916ca4c..4f428811e 100644 --- a/include/d/actor/d_a_agb.h +++ b/include/d/actor/d_a_agb.h @@ -32,6 +32,10 @@ public: int execute(); ~dMsgCtrl_c() {} + int getSelectNum() { return mpMsg->mSelectNum; } + void setMsgStatus(u16 status) { mpMsg->mStatus = status; } + +public: /* 0x00 */ u16 field_0x0; /* 0x04 */ u32 mMsgID; /* 0x08 */ msg_class* mpMsg; diff --git a/include/d/actor/d_a_obj_mknjd.h b/include/d/actor/d_a_obj_mknjd.h index 679dbe34a..455048ba8 100644 --- a/include/d/actor/d_a_obj_mknjd.h +++ b/include/d/actor/d_a_obj_mknjd.h @@ -5,6 +5,7 @@ #include "d/d_a_obj.h" #include "d/d_bg_s_movebg_actor.h" #include "d/d_particle.h" +#include "d/d_com_inf_game.h" #include "SSystem/SComponent/c_phase.h" class msg_class; @@ -12,10 +13,27 @@ class msg_class; namespace daObjMknjD { class Act_c : public dBgS_MoveBgActor { public: - void anmAtr(unsigned short) {} - void getMsg() {} - void prm_get_Type() const {} - void prm_get_swSave() const {} + enum Prm_e { + PRM_SWITCH_W = 0x08, + PRM_SWITCH_S = 0x00, + + PRM_TYPE_W = 0x01, + PRM_TYPE_S = 0x10, + }; + + int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWITCH_W, PRM_SWITCH_S); } + u8 prm_get_Type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } + + void anmAtr(u16) {} + u32 getMsg() { + if (m0500 == 0) { + dComIfGp_setMelodyNum(mTactMode); + return 0x05B3; + } + else { + return 0x1901; + } + } s32 Mthd_Create(); s32 Mthd_Delete(); @@ -41,64 +59,39 @@ namespace daObjMknjD { int Draw(); static const char M_arcname[]; - //static Mtx M_tmp_mtx; + static Mtx M_tmp_mtx; /* 0x02C8 */ cXyz mLeftHalfPos; /* 0x02D4 */ cXyz mRightHalfPos; - /* 0x02E0 */ cXyz mShardPositions[0x14]; - /* 0x03D0 */ float mShardHeights[0x14]; - + /* 0x03D0 */ f32 mShardHeights[0x14]; /* 0x0420 */ request_of_phase_process_class mPhs; - /* 0x0428 */ J3DModel* mMainMdl; /* 0x042C */ J3DModel* mBreakMdl; - /* 0x0430 */ u16 m0430; /* 0x0432 */ u16 m0432; /* 0x0434 */ u16 m0434; /* 0x0438 */ s32 mBreakTimer; - /* 0x043C */ u8 mMainMdlAlpha; /* 0x043D */ bool m043D; /* 0x043E */ u8 m043E; /* 0x043F */ u8 m043F; - /* 0x0440 */ JPABaseEmitter* mEmitters[4]; /* 0x0450 */ dPa_smokeEcallBack mSmokeCBs[4]; - /* 0x04D0 */ cXyz mBrokenPos; - /* 0x04DC */ s16 mCheckEventIdx; /* 0x04DE */ s16 mDemoEventIdx; /* 0x04E0 */ s16 mErrorEventIdx; /* 0x04E2 */ s16 mLessonEventIdx; - /* 0x04E4 */ s8 mActionIdx; /* 0x04E5 */ u8 mTactMode; /* 0x04E6 */ u8 mGiveItemNo; - /* 0x04E8 */ cXyz mGoalPos; - /* 0x04F4 */ u32 mMsgNo; /* 0x04F8 */ u32 mMsgPID; /* 0x04FC */ msg_class* mMsgPtr; - /* 0x0500 */ s32 m0500; /* 0x0504 */ bool m0504; - - enum Prm_e { - PRM_SWITCH_W = 0x08, - PRM_SWITCH_S = 0x00, - - PRM_TYPE_W = 0x01, - PRM_TYPE_S = 0x10, - }; - - int prm_get_swSave() { return daObj::PrmAbstract(this, PRM_SWITCH_W, PRM_SWITCH_S); } - u8 prm_get_Type() { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } - - static Mtx M_tmp_mtx; }; const char Act_c::M_arcname[] = "MknjD"; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 7ec56067e..56ba52f90 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -459,7 +459,7 @@ public: void setItemBeastNumCount(int i_idx, s16 num) { mItemBeastNumCounts[i_idx] += num; } - u8 checkMesgCancelButton() { return field_0x4949; } + u8 checkMesgCancelButton() { return mMesgCancelButton; } void setPlayerStatus(int param_0, int i, u32 flag) { mPlayerStatus[param_0][i] |= flag; } void clearPlayerStatus(int param_0, int i, u32 flag) { mPlayerStatus[param_0][i] &= ~flag; } @@ -536,14 +536,17 @@ public: ItemTableList* getItemTable() { return mpItemTable; } void setFmapData(void * pData) { mpFmapData = pData; } - inline void stopFwaterTimer() { mFwaterTimer = 0; } - inline u8 checkFwaterTimer() { return mFwaterTimer; } + void stopFwaterTimer() { mFwaterTimer = 0; } + u8 checkFwaterTimer() { return mFwaterTimer; } - inline u8 getMiniGameType() { return mMiniGameType; } + u8 getMiniGameType() { return mMiniGameType; } - inline void show2dOn() { m2dShow = true; } - inline void show2dOff() { m2dShow = false; } - inline bool show2dCheck() { return m2dShow; } + void show2dOn() { m2dShow = true; } + void show2dOff() { m2dShow = false; } + bool show2dCheck() { return m2dShow; } + + u8 getMelodyNum() { return mMelodyNum; } + void setMelodyNum(u8 melody) { mMelodyNum = melody; } /* 0x0000 */ dBgS mBgS; /* 0x1404 */ dCcS mCcS; @@ -666,9 +669,9 @@ public: /* 0x4946 */ u8 field_0x4946; /* 0x4947 */ u8 field_0x4947; /* 0x4948 */ u8 field_0x4948; - /* 0x4949 */ u8 field_0x4949; + /* 0x4949 */ u8 mMesgCancelButton; /* 0x494A */ u8 field_0x494a[6]; - /* 0x4950 */ u8 mTactMode; + /* 0x4950 */ u8 mMelodyNum; /* 0x4951 */ u8 field_0x4951; /* 0x4952 */ u8 field_0x4952; /* 0x4953 */ u8 field_0x4953; @@ -2315,6 +2318,14 @@ inline bool dComIfGp_2dShowCheck() { return g_dComIfG_gameInfo.play.show2dCheck(); } +inline u8 dComIfGp_setMelodyNum() { + return g_dComIfG_gameInfo.play.getMelodyNum(); +} + +inline void dComIfGp_setMelodyNum(u8 melody) { + g_dComIfG_gameInfo.play.setMelodyNum(melody); +} + /** * === EVENT === */ @@ -2355,7 +2366,7 @@ inline u8 dComIfGp_event_getPreItemNo() { return g_dComIfG_gameInfo.play.getEvent().getPreItemNo(); } -inline void dComIfGp_event_setItemPartnerId(u32 id) { +inline void dComIfGp_event_setItemPartnerId(unsigned int id) { g_dComIfG_gameInfo.play.getEvent().setPtI_Id(id); } diff --git a/include/d/d_event.h b/include/d/d_event.h index 530bf825c..021a6b41a 100644 --- a/include/d/d_event.h +++ b/include/d/d_event.h @@ -98,7 +98,7 @@ public: u8 getTalkXYBtn() { return mTalkButton; } bool chkTalkXY() { return mTalkButton == 1 || mTalkButton == 2 || mTalkButton == 3; } - void setPtI_Id(u32 id) { mPtItem = id; } + void setPtI_Id(unsigned int id) { mPtItem = id; } void setPtI(void* actor) { mPtItem = getPId(actor); } void setGtItm(u8 itemNo) { mGetItemNo = itemNo; } u8 getGtItm() { return mGetItemNo; } diff --git a/include/d/d_npc.h b/include/d/d_npc.h index 116eb1a30..b5fe2462c 100644 --- a/include/d/d_npc.h +++ b/include/d/d_npc.h @@ -208,20 +208,6 @@ public: /* 0x20 */ s16 field_0x20; }; -enum dNpc_MessageStatus_e { - dNpcMsgStts_MSG_PREPARING_e = 0x01, - dNpcMsgStts_BOX_OPENING_e = 0x02, - dNpcMsgStts_MSG_TYPING_e = 0x06, - dNpcMsgStts_MSG_DISPLAYED_e = 0x0E, - - dNpcMsgStts_MSG_CONTINUES_e = 0x0F, - dNpcMsgStts_MSG_ENDS_e = 0x10, - - dNpcMsgStts_BOX_CLOSING_e = 0x11, - dNpcMsgStts_BOX_CLOSED_e = 0x12, - dNpcMsgStts_MSG_DESTROYED_e = 0x13, -}; - class fopNpc_npc_c : public fopAc_ac_c { public: fopNpc_npc_c() { @@ -241,7 +227,7 @@ public: /* 0x6B0 */ msg_class* mpCurrMsg; /* 0x6B4 */ u8 pad_0x6B4[0x6C0 - 0x6B4]; - virtual u16 next_msgStatus(u32* msgId) { return dNpcMsgStts_MSG_ENDS_e; } + virtual u16 next_msgStatus(u32* msgId) { return fopMsgStts_MSG_ENDS_e; } virtual u32 getMsg() { return 0; } virtual void anmAtr(u16) {} diff --git a/include/f_op/f_op_msg.h b/include/f_op/f_op_msg.h index 47ed2a070..d6041ba85 100644 --- a/include/f_op/f_op_msg.h +++ b/include/f_op/f_op_msg.h @@ -6,6 +6,19 @@ class fopAc_ac_c; +enum fopMsg_MessageStatus_e { + fopMsgStts_MSG_PREPARING_e = 0x01, + fopMsgStts_BOX_OPENING_e = 0x02, + fopMsgStts_MSG_TYPING_e = 0x06, + fopMsgStts_MSG_DISPLAYED_e = 0x0E, + fopMsgStts_MSG_CONTINUES_e = 0x0F, + fopMsgStts_MSG_ENDS_e = 0x10, + fopMsgStts_BOX_CLOSING_e = 0x11, + fopMsgStts_BOX_CLOSED_e = 0x12, + fopMsgStts_MSG_DESTROYED_e = 0x13, + fopMsgStts_UNK15_e = 0x15, +}; + struct msg_method_class { /* 0x00 */ leafdraw_method_class base; }; @@ -20,8 +33,8 @@ public: /* 0xEC */ u32 mMsgID; /* 0xF0 */ u32 field_0xf0; /* 0xF4 */ u32 field_0xf4; - /* 0xF8 */ u16 mMode; - /* 0xFA */ u8 mSelectedChoiceIdx; + /* 0xF8 */ u16 mStatus; + /* 0xFA */ u8 mSelectNum; // The index of the choice the player selected. }; // Size: 0xFC extern leafdraw_method_class g_fopMsg_Method; diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index 1a8c3c189..4d224785e 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -78,12 +78,12 @@ int dMsgCtrl_c::execute() { } else if (mpMsg == NULL) { mpMsg = fopMsgM_SearchByID(mMsgID); } else { - if (mpMsg->mMode == 18) { - mpMsg->mMode = 19; + if (mpMsg->mStatus == fopMsgStts_BOX_CLOSED_e) { + mpMsg->mStatus = fopMsgStts_MSG_DESTROYED_e; dComIfGp_event_reset(); } - return mpMsg->mMode; + return mpMsg->mStatus; } return -1; @@ -202,12 +202,12 @@ extern JKRHeap* dMsg_getAgbWorkArea(); /* 800CFB68-800CFC94 .text uploadSelect__7daAgb_cFv */ int daAgb_c::uploadSelect() { - if (l_msgCtrl.execute() == 14) { - if (dComIfGp_checkMesgCancelButton() || (int)l_msgCtrl.mpMsg->mSelectedChoiceIdx != 0) { - l_msgCtrl.mpMsg->mMode = 16; + if (l_msgCtrl.execute() == fopMsgStts_MSG_DISPLAYED_e) { + if (dComIfGp_checkMesgCancelButton() != 0 || l_msgCtrl.getSelectNum() != 0) { + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_ENDS_e); mDoGaC_ConnectWake(); } else { - l_msgCtrl.mpMsg->mMode = 15; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_CONTINUES_e); fopMsgM_messageSet(6); // "Now calling Tingle..." mUploadAction = 3; @@ -253,7 +253,7 @@ int daAgb_c::uploadJoyboot2() { field_0x664 = 15; mUploadAction = 6; } else { - l_msgCtrl.mpMsg->mMode = 15; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_CONTINUES_e); fopMsgM_messageSet(7); // "An error has occurred." fopMsgM_messageSendOn(); mUploadAction = 10; @@ -261,7 +261,7 @@ int daAgb_c::uploadJoyboot2() { } else { field_0x664--; if (field_0x664 == 0) { - l_msgCtrl.mpMsg->mMode = 15; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_CONTINUES_e); fopMsgM_messageSet(7); // "An error has occurred." fopMsgM_messageSendOn(); mUploadAction = 10; @@ -312,7 +312,7 @@ int daAgb_c::uploadConnect() { dMap_c::mapAGBSendIslandData(); } else { mDoGaC_GbaReboot(); - l_msgCtrl.mpMsg->mMode = 15; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_CONTINUES_e); fopMsgM_messageSet(7); // "An error has occurred." fopMsgM_messageSendOn(); mUploadAction = 10; @@ -329,7 +329,7 @@ int daAgb_c::uploadMessageSend() { if (mDoGaC_getDataStatus(0) == 0) { mIsMsgSend = true; if (field_0x67a != 0) { - l_msgCtrl.mpMsg->mMode = 15; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_CONTINUES_e); fopMsgM_messageSet(8); // "Tingle appeared on your Game Boy Advance!" fopMsgM_messageSendOn(); mUploadAction = 11; @@ -361,8 +361,8 @@ int daAgb_c::uploadRetryWait() { /* 800D021C-800D0264 .text uploadMsgEndWait__7daAgb_cFv */ int daAgb_c::uploadMsgEndWait() { - if (l_msgCtrl.execute() == 14) { - l_msgCtrl.mpMsg->mMode = 16; + if (l_msgCtrl.execute() == fopMsgStts_MSG_DISPLAYED_e) { + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_ENDS_e); } return 1; @@ -375,7 +375,7 @@ int daAgb_c::uploadMsgEndTimer() { field_0x664--; if (field_0x664 == 0) { - l_msgCtrl.mpMsg->mMode = 16; + l_msgCtrl.setMsgStatus(fopMsgStts_MSG_ENDS_e); fopMsgM_messageSendOn(); } else if (field_0x664 == 30) { field_0x66f = 1; diff --git a/src/d/actor/d_a_branch.cpp b/src/d/actor/d_a_branch.cpp index 731549ca9..de85ee74f 100644 --- a/src/d/actor/d_a_branch.cpp +++ b/src/d/actor/d_a_branch.cpp @@ -77,7 +77,6 @@ int daBranch_c::solidHeapCB(fopAc_ac_c* i_this) { /* 00000248-0000049C .text CreateHeap__10daBranch_cFv */ int daBranch_c::CreateHeap() { - /* Nonmatching */ int bmd[] = { KWOOD_00_BMD_WS, KWOOD_00_BMD_WB }; int bck[] = { KWOOD_00_BCK_SWING02, KWOOD_00_BCK_BREAK }; int bas[] = { KWOOD_00_BAS_SWING02, KWOOD_00_BAS_BREAK }; @@ -86,9 +85,10 @@ int daBranch_c::CreateHeap() { for (int i = 0; i < (s32)ARRAY_SIZE(mAnims); i++) { J3DModelData* modelData = static_cast(dComIfG_getObjectIDRes(m_arcname, bmd[i])); - static_cast(dComIfG_getObjectIDRes(m_arcname, bck[i])); + J3DAnmTransformKey* bckData = static_cast(dComIfG_getObjectIDRes(m_arcname, bck[i])); JUT_ASSERT(0x1CC, modelData != 0); + // Bug: They probably meant to assert that bckData isn't null, but accidentally used the array of bck file IDs. JUT_ASSERT(0x1CD, bck != 0); mAnims[i] = new mDoExt_McaMorf( diff --git a/src/d/actor/d_a_kytag06.cpp b/src/d/actor/d_a_kytag06.cpp index 0d948aeb0..ede6b155d 100644 --- a/src/d/actor/d_a_kytag06.cpp +++ b/src/d/actor/d_a_kytag06.cpp @@ -19,10 +19,10 @@ static BOOL daKytag06_Execute(kytag06_class* i_this) { f32 time; int date; - if (g_dComIfG_gameInfo.play.mEvtCtrl.mMode == 0) { + if (!dComIfGp_event_runCheck()) { return TRUE; } - if(dComIfGp_evmng_startCheck("ARRIVAL_BRK") == 0) { + if(!dComIfGp_evmng_startCheck("ARRIVAL_BRK")) { return TRUE; } diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index c15c06e23..b3a1f2db0 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -1962,10 +1962,10 @@ bool daNpc_Md_c::checkCommandTalk() { /* 0000DCB0-0000E410 .text next_msgStatus__10daNpc_Md_cFPUl */ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { - u16 msgStatus = dNpcMsgStts_MSG_CONTINUES_e; + u16 msgStatus = fopMsgStts_MSG_CONTINUES_e; switch (*pCurrMsgNo) { case 0x5AC: - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17D5: case 0x1805: @@ -1979,7 +1979,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x17D8: mCurEventMode = 4; - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17D9: *pCurrMsgNo = 0x1802; @@ -1992,14 +1992,14 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x17DB: dComIfGs_onEventBit(0x0E02); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17DD: *pCurrMsgNo = 0x17DE; break; case 0x17DE: mCurEventMode = 5; - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17DF: *pCurrMsgNo = 0x17E0; @@ -2015,11 +2015,11 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x17E4: dComIfGs_onEventBit(0x1101); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17E5: dComIfGs_onEventBit(0x1280); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17E6: *pCurrMsgNo = 0x17E7; @@ -2046,7 +2046,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { *pCurrMsgNo = 0x17EE; break; case 0x17EE: - if (l_msg->mSelectedChoiceIdx == 1) { + if (l_msg->mSelectNum == 1) { *pCurrMsgNo = 0x17EF; } else { *pCurrMsgNo = 0x17F0; @@ -2060,7 +2060,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x17F1: mCurEventMode = 7; - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17F3: *pCurrMsgNo = 0x17F4; @@ -2070,7 +2070,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { // Fall-through case 0x17F8: cLib_onBit(m30F0, 0x40UL); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x17F7: *pCurrMsgNo = 0x17F8; @@ -2095,7 +2095,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x1801: dComIfGs_onEventBit(0x1102); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x19C9: *pCurrMsgNo = 0x19ca; @@ -2124,7 +2124,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { case 0x19D1: dComIfGs_onEventBit(0x1402); onSeaTalk(); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x19D2: *pCurrMsgNo = 0x19D3; @@ -2144,7 +2144,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { case 0x19D8: dComIfGs_onEventBit(0x1504); case 0x19D9: - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x19DA: *pCurrMsgNo = 0x19db; @@ -2192,7 +2192,7 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { // Fall-through case 0x1A01: dComIfGs_onEventBit(0x2C08); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; case 0x19FC: *pCurrMsgNo = 0x19FD; @@ -2208,10 +2208,10 @@ u16 daNpc_Md_c::next_msgStatus(u32* pCurrMsgNo) { break; case 0x1A02: dComIfGs_onEventBit(0x3B80); - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; default: - msgStatus = dNpcMsgStts_MSG_ENDS_e; + msgStatus = fopMsgStts_MSG_ENDS_e; break; } return msgStatus; diff --git a/src/d/actor/d_a_obj_mknjd.cpp b/src/d/actor/d_a_obj_mknjd.cpp index 387b44b4a..b84cdf2aa 100644 --- a/src/d/actor/d_a_obj_mknjd.cpp +++ b/src/d/actor/d_a_obj_mknjd.cpp @@ -393,21 +393,11 @@ void daObjMknjD::Act_c::setPlayerAngle(int i_staffIdx) { /* 00000E84-00000F88 .text talk__Q210daObjMknjD5Act_cFi */ u16 daObjMknjD::Act_c::talk(int i_param1) { - u16 msgMode = 0xFF; + u16 msgStatus = 0xFF; if (mMsgPID == fpcM_ERROR_PROCESS_ID_e) { if (i_param1 == 1) { - u32 msgId; - - if (m0500 == 0) { - g_dComIfG_gameInfo.play.mTactMode = mTactMode; - msgId = 0x05B3; - } - else { - msgId = 0x1901; - } - - mMsgNo = msgId; + mMsgNo = getMsg(); } mMsgPID = fopMsgM_messageSet(mMsgNo, this); @@ -415,18 +405,18 @@ u16 daObjMknjD::Act_c::talk(int i_param1) { } else { if (mMsgPtr) { - msgMode = mMsgPtr->mMode; + msgStatus = mMsgPtr->mStatus; - if (msgMode == 0x0E) { - if (g_dComIfG_gameInfo.play.field_0x4949 != 0) { + if (msgStatus == fopMsgStts_MSG_DISPLAYED_e) { + if (dComIfGp_checkMesgCancelButton() != 0) { m0504 = true; fopMsgM_messageSendOn(); } - mMsgPtr->mMode = 0x10; + mMsgPtr->mStatus = fopMsgStts_MSG_ENDS_e; } - else if (msgMode == 0x12) { - mMsgPtr->mMode = 0x13; + else if (msgStatus == fopMsgStts_BOX_CLOSED_e) { + mMsgPtr->mStatus = fopMsgStts_MSG_DESTROYED_e; mMsgPID = fpcM_ERROR_PROCESS_ID_e; } } @@ -435,7 +425,7 @@ u16 daObjMknjD::Act_c::talk(int i_param1) { } } - return msgMode; + return msgStatus; } /* 00000F88-00001348 .text privateCut__Q210daObjMknjD5Act_cFv */ @@ -511,7 +501,7 @@ void daObjMknjD::Act_c::privateCut() { doCutEnd = true; break; case ACT_INPUT: - if (talk(1) == 0x12) { + if (talk(1) == fopMsgStts_BOX_CLOSED_e) { doCutEnd = true; } break; @@ -541,9 +531,9 @@ void daObjMknjD::Act_c::privateCut() { } break; case ACT_LESSON: - u32 talkResult = talk(1); + u16 msgStatus = talk(1); - if (talkResult == 0x12 || talkResult == 0x15) { + if (msgStatus == fopMsgStts_BOX_CLOSED_e || msgStatus == fopMsgStts_UNK15_e) { doCutEnd = true; } break; @@ -870,7 +860,7 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) { case 10: privateCut(); - if (g_dComIfG_gameInfo.play.mEvtCtrl.mMode == 0) { + if (!dComIfGp_event_runCheck()) { if (checkItemGet(mGiveItemNo, 1) != 0) { m043F = 0; } @@ -885,9 +875,9 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) { m043F = 12; break; case 12: - if (talk(1) == 18) { + if (talk(1) == fopMsgStts_BOX_CLOSED_e) { player->offPlayerNoDraw(); - g_dComIfG_gameInfo.play.mEvtCtrl.mEventFlag |= 8; + dComIfGp_event_reset(); if (checkItemGet(mGiveItemNo, 1) != 0) { m043F = 0; diff --git a/src/d/actor/d_a_obj_paper.cpp b/src/d/actor/d_a_obj_paper.cpp index 8f3041952..40b05e356 100644 --- a/src/d/actor/d_a_obj_paper.cpp +++ b/src/d/actor/d_a_obj_paper.cpp @@ -212,12 +212,12 @@ namespace daObjPaper { /* 00000880-000008DC .text mode_talk2__Q210daObjPaper5Act_cFv */ void daObjPaper::Act_c::mode_talk2() { - if (mpMsg->mMode == dNpcMsgStts_BOX_CLOSED_e) { - mpMsg->mMode = dNpcMsgStts_MSG_DESTROYED_e; + if (mpMsg->mStatus == fopMsgStts_BOX_CLOSED_e) { + mpMsg->mStatus = fopMsgStts_MSG_DESTROYED_e; mpMsg = 0; mMsgId = fpcM_ERROR_PROCESS_ID_e; - g_dComIfG_gameInfo.play.mEvtCtrl.mEventFlag |= 8; + dComIfGp_event_reset(); mode_wait_init(); } } diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp index baf37b2b1..5d9839eea 100644 --- a/src/d/actor/d_a_obj_toripost.cpp +++ b/src/d/actor/d_a_obj_toripost.cpp @@ -223,7 +223,7 @@ void daObjTpost_c::cutDispLetterProc(int staffIdx) { if(mode == 5) { daPy_getPlayerActorClass()->onLetterReadEyeMove(); } - if(mode == dNpcMsgStts_BOX_CLOSED_e) { + if(mode == fopMsgStts_BOX_CLOSED_e) { dComIfGp_evmng_cutEnd(staffIdx); } } @@ -401,7 +401,7 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { 0x0CEE }; - u16 status = dNpcMsgStts_MSG_CONTINUES_e; + u16 status = fopMsgStts_MSG_CONTINUES_e; switch(*msgId) { case 0xCE5: case 0xCE6: @@ -424,7 +424,7 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { } else { field_0x8E9 = 1; - status = dNpcMsgStts_MSG_ENDS_e; + status = fopMsgStts_MSG_ENDS_e; } break; @@ -439,7 +439,7 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { break; case 0xCEF: - if(mpCurrMsg->mSelectedChoiceIdx == 0) { + if(mpCurrMsg->mSelectNum == 0) { if(dComIfGs_getRupee() >= getSendPrice()) { dComIfGp_setItemRupeeCount(-getSendPrice()); dComIfGs_setReserveItemEmpty(); @@ -470,7 +470,7 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { break; case 0xCF4: case 0xCF8: - if(mpCurrMsg->mSelectedChoiceIdx == 0) { + if(mpCurrMsg->mSelectNum == 0) { s32 price = 0x0A; if(m_letter[mNumReadable].mEventReg == 0xB203) { price = 0xC9; @@ -478,7 +478,7 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { if(dComIfGs_getRupee() >= price) { dComIfGp_setItemRupeeCount(-price); field_0x8E9 = 1; - status = dNpcMsgStts_MSG_ENDS_e; + status = fopMsgStts_MSG_ENDS_e; } else { *msgId = 0xCF6; @@ -499,17 +499,17 @@ u16 daObjTpost_c::next_msgStatus(u32* msgId) { *msgId = 0xCF7; } else { - status = dNpcMsgStts_MSG_ENDS_e; + status = fopMsgStts_MSG_ENDS_e; } break; default: - status = dNpcMsgStts_MSG_ENDS_e; + status = fopMsgStts_MSG_ENDS_e; break; } - if(mCurrMsgNo == m_letter[mNumReadable].mMsgNo && status == dNpcMsgStts_MSG_ENDS_e) { - status = dNpcMsgStts_MSG_DISPLAYED_e; + if(mCurrMsgNo == m_letter[mNumReadable].mMsgNo && status == fopMsgStts_MSG_ENDS_e) { + status = fopMsgStts_MSG_DISPLAYED_e; } return status; @@ -681,7 +681,7 @@ void daObjTpost_c::modeTalkInit() { } void daObjTpost_c::modeTalk() { - if(talk(1) == dNpcMsgStts_BOX_CLOSED_e) { + if(talk(1) == fopMsgStts_BOX_CLOSED_e) { if(field_0x8E9) { modeProc(PROC_INIT, 3); field_0x8E9 = 0; @@ -745,7 +745,7 @@ void daObjTpost_c::modeTalkXY() { bool stopped = true; if (!morf->mFrameCtrl.checkState(J3DFrameCtrl::STATE_STOP_E) && morf->mFrameCtrl.getRate() != 0.0f) { stopped = false; } if (stopped) { - if(cLib_calcTimer(&field_0x8DC) == 0 && talk(1) == dNpcMsgStts_BOX_CLOSED_e) { + if(cLib_calcTimer(&field_0x8DC) == 0 && talk(1) == fopMsgStts_BOX_CLOSED_e) { modeProc(PROC_INIT, 0); dComIfGp_event_reset(); field_0x8F5 = 0; @@ -846,7 +846,7 @@ bool daObjTpost_c::_execute() { modeProc(PROC_EXEC, 5); dBgS* bgs = dComIfG_Bgsp(); - if(g_dComIfG_gameInfo.play.mEvtCtrl.mMode != 0 && mEventCut.cutProc() == false) { + if(dComIfGp_event_runCheck() && !mEventCut.cutProc()) { cutProc(); } eventOrder(); diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index 8300fe7ab..e436c1bb4 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -158,20 +158,20 @@ static BOOL daTag_Msg_actionEvent(daTag_Msg_c* a_this) { break; case 3: JUT_ASSERT(0x13F, l_msg); - if (l_msg->mMode == 6) { + if (l_msg->mStatus == fopMsgStts_MSG_TYPING_e) { msg_mode++; } break; case 4: JUT_ASSERT(0x145, l_msg); - if (l_msg->mMode == 0xe) { + if (l_msg->mStatus == fopMsgStts_MSG_DISPLAYED_e) { msg_mode++; - l_msg->mMode = 0x10; + l_msg->mStatus = fopMsgStts_MSG_ENDS_e; } break; } - if (l_msg != NULL && l_msg->mMode == 0x12) { - l_msg->mMode = 0x13; + if (l_msg != NULL && l_msg->mStatus == fopMsgStts_BOX_CLOSED_e) { + l_msg->mStatus = fopMsgStts_MSG_DESTROYED_e; dComIfGp_event_reset(); if (a_this->getMessage() == 0x1902) { daPy_getPlayerLinkActorClass()->offPlayerNoDraw(); diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index f46d3e62a..752ba23e1 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -135,13 +135,13 @@ void dComIfG_play_c::itemInit() { field_0x4946 = 0; field_0x4947 = 0; field_0x4948 = 0; - field_0x4949 = 0; + mMesgCancelButton = 0; for (int i = 0; i < 6; i++) { field_0x494a[i] = 0; } - mTactMode = 0; + mMelodyNum = 0; field_0x4951 = 0; field_0x4952 = 0; field_0x4953 = 0; diff --git a/src/d/d_event.cpp b/src/d/d_event.cpp index 874ddfde4..465fd92e3 100644 --- a/src/d/d_event.cpp +++ b/src/d/d_event.cpp @@ -598,7 +598,7 @@ dStage_Event_dt_c* dEvt_control_c::nextStageEventDt(void* idxp) { int dEvt_control_c::getPId(void* ac) { if (ac == NULL) return -1; - return fpcM_GetID(ac); + return fopAcM_GetID(ac); } /* 800715DC-8007160C .text convPId__14dEvt_control_cFUi */ diff --git a/src/d/d_event_data.cpp b/src/d/d_event_data.cpp index fe846f50e..9cc2882aa 100644 --- a/src/d/d_event_data.cpp +++ b/src/d/d_event_data.cpp @@ -291,11 +291,11 @@ void dEvDtStaff_c::specialProcMessage() { case 3: // FINISH case 5: // END JUT_ASSERT(0x1D8, l_msg); - l_msg->mMode = 0x10; + l_msg->mStatus = fopMsgStts_MSG_ENDS_e; break; case 4: // CONTINUE JUT_ASSERT(0x1DC, l_msg); - l_msg->mMode = 0xF; + l_msg->mStatus = fopMsgStts_MSG_CONTINUES_e; idata = dComIfGp_evmng_getMyIntegerP(staffIdx, "msgNo"); JUT_ASSERT(0x1DF, idata); l_msgNo = *idata; @@ -339,7 +339,7 @@ void dEvDtStaff_c::specialProcMessage() { break; case 2: // PUSHBUTTON JUT_ASSERT(0x209, l_msg); - if (l_msg->mMode == 0xE) { + if (l_msg->mStatus == fopMsgStts_MSG_DISPLAYED_e) { dComIfGp_evmng_cutEnd(staffIdx); } break; @@ -347,8 +347,8 @@ void dEvDtStaff_c::specialProcMessage() { case 6: // DELETE if (!l_msg) { dComIfGp_evmng_cutEnd(staffIdx); - } else if (l_msg->mMode == 0x12) { - l_msg->mMode = 0x13; + } else if (l_msg->mStatus == fopMsgStts_BOX_CLOSED_e) { + l_msg->mStatus = fopMsgStts_MSG_DESTROYED_e; l_msgId = fpcM_ERROR_PROCESS_ID_e; l_msg = NULL; dComIfGp_evmng_cutEnd(staffIdx); @@ -358,9 +358,9 @@ void dEvDtStaff_c::specialProcMessage() { dComIfGp_evmng_cutEnd(staffIdx); break; case 5: // END - switch (l_msg->mMode) { - case 0x11: - case 0x12: + switch (l_msg->mStatus) { + case fopMsgStts_BOX_CLOSING_e: + case fopMsgStts_BOX_CLOSED_e: dComIfGp_evmng_cutEnd(staffIdx); break; } diff --git a/src/d/d_npc.cpp b/src/d/d_npc.cpp index 769d6300f..6bc2e49f9 100644 --- a/src/d/d_npc.cpp +++ b/src/d/d_npc.cpp @@ -661,15 +661,15 @@ u16 fopNpc_npc_c::talk(int param_1) { } else { if(mpCurrMsg) { - mode = mpCurrMsg->mMode; - if(mode == dNpcMsgStts_MSG_DISPLAYED_e) { - mpCurrMsg->mMode = next_msgStatus(&mCurrMsgNo); - if(mpCurrMsg->mMode == dNpcMsgStts_MSG_CONTINUES_e) { + mode = mpCurrMsg->mStatus; + if(mode == fopMsgStts_MSG_DISPLAYED_e) { + mpCurrMsg->mStatus = next_msgStatus(&mCurrMsgNo); + if(mpCurrMsg->mStatus == fopMsgStts_MSG_CONTINUES_e) { fopMsgM_messageSet(mCurrMsgNo); } } - else if (mode == dNpcMsgStts_BOX_CLOSED_e) { - mpCurrMsg->mMode = dNpcMsgStts_MSG_DESTROYED_e; + else if (mode == fopMsgStts_BOX_CLOSED_e) { + mpCurrMsg->mStatus = fopMsgStts_MSG_DESTROYED_e; mCurrMsgBsPcId = fpcM_ERROR_PROCESS_ID_e; } diff --git a/src/d/d_npc_event_cut.inc b/src/d/d_npc_event_cut.inc index e314286bd..8b83d24ff 100644 --- a/src/d/d_npc_event_cut.inc +++ b/src/d/d_npc_event_cut.inc @@ -590,7 +590,7 @@ void dNpc_EventCut_c::cutTalkMsgProc() { } else { u16 status = mpTalkActor->talk(0); - if(status == dNpcMsgStts_BOX_CLOSED_e) { + if(status == fopMsgStts_BOX_CLOSED_e) { field_0x52 = 0; dComIfGp_evmng_cutEnd(mEvtStaffId); } diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index 12fa352f0..04c171bda 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -242,10 +242,10 @@ void dScnPly_msg_HIO_c::dScnPly_msg_HIO_messageProc() { } else { msg_class* msg_p = fopMsgM_SearchByID(field_0x10); if (msg_p != NULL) { - if (msg_p->mMode == 14) { - msg_p->mMode = 16; - } else if (msg_p->mMode == 18) { - msg_p->mMode = 19; + if (msg_p->mStatus == fopMsgStts_MSG_DISPLAYED_e) { + msg_p->mStatus = fopMsgStts_MSG_ENDS_e; + } else if (msg_p->mStatus == fopMsgStts_BOX_CLOSED_e) { + msg_p->mStatus = fopMsgStts_MSG_DESTROYED_e; field_0x10 = fpcM_ERROR_PROCESS_ID_e; field_0x06 = 0; mID++; diff --git a/src/d/d_shop.cpp b/src/d/d_shop.cpp index 88f02ffe1..2b65906bb 100644 --- a/src/d/d_shop.cpp +++ b/src/d/d_shop.cpp @@ -1304,7 +1304,7 @@ BOOL dShop_now_triggercheck(msg_class* msg, STControl* stickControl, ShopItems_c } } - msg->mMode = 0xF; + msg->mStatus = fopMsgStts_MSG_CONTINUES_e; fopMsgM_messageSet(*pMsgID); fopMsgM_messageSendOn(); shopItems->mSelectedItemIdx = nextIdx;