diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 28f955d44..f491e6988 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -904,6 +904,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 +1472,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) { diff --git a/include/d/d_file_error.h b/include/d/d_file_error.h index 42aa44098..6903ad2db 100644 --- a/include/d/d_file_error.h +++ b/include/d/d_file_error.h @@ -69,10 +69,10 @@ public: 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 @@ public: /* 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_menu_save.h b/include/d/d_menu_save.h index 9d4733cb6..b41088512 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 @@ public: 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 @@ public: 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 3bf1ac8de..5b5d252a8 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -977,8 +977,8 @@ public: /* 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/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 2965cea14..cddc59c0a 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 @@ public: }; 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*); + 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; - } + u32 getMesgNumber() { return (mGroupID << 8) | mResMsgNo; } public: /* 0x04 */ u32 mMsgIdx; @@ -116,11 +114,11 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: /* 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 @@ public: /* 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 @@ public: 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_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*, 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*); +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); +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 2651d4323..938e28396 100644 --- a/include/m_Do/m_Do_MemCard.h +++ b/include/m_Do/m_Do_MemCard.h @@ -19,6 +19,19 @@ public: #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 @@ public: 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/d/d_file_error.cpp b/src/d/d_file_error.cpp index e006aaca3..684d43c9d 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 533cd5ad0..143ec0cf7 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_menu_save.cpp b/src/d/d_menu_save.cpp index 28428222a..038d6d9d3 100644 --- a/src/d/d_menu_save.cpp +++ b/src/d/d_menu_save.cpp @@ -1,423 +1,1897 @@ -// -// 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 */ +// NONMATCHING - instruction order +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 */ +// NONMATCHING - small float reg alloc 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; + } + + field_0x394.mNowAlpha = g_msHIO.field_0x22 + (u32)((g_msHIO.field_0x21 - g_msHIO.field_0x22) * 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); + fopMsgM_setNowAlpha(&field_0x20c[field_0x536 + 3], 1.0f - var_f31); + 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); + fopMsgM_paneTrans(&field_0x20c[0], 0.0f, param_2 + (var_f31 * (param_3 - param_2))); + + 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); + fopMsgM_paneTrans(&field_0x324, 0.0f, param_2 + (var_f31 * (param_3 - param_2))); + + 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); + fopMsgM_paneTrans(param_2, 0.0f, param_3 + (var_f31 * (param_4 - param_3))); + + 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_s_name.cpp b/src/d/d_s_name.cpp index f4d55826d..2bdc40d06 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 0a7d752c6..5ff752a35 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); + 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 { - drawTexCoord(0.0f, 0.0f, width, height, s0, t1, s0, t0, s1, t1, s1, t0, 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; + 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; } - 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) { + 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; + 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; } - 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) { + 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; +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; } - 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); + 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); - param_1->setAlpha(param_7); - param_2->setAlpha(param_7); + 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 59de78a30..47b6f64eb 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);