From 380407dd2691ca4c0f3772092f39a7b3b528d1e4 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sun, 2 Aug 2026 21:04:29 -0400 Subject: [PATCH] msg work (#1143) * fopMsgM_msgDataProc_c::stringSet work * Fix JPN * More stringSet work * work * get rid of fake temps * stringSet 99.99% * fopMsgM_msgDataProc_c::stringLength 100% * d_msg work * fix pal * fix message_paper, d_meter version diff fixes --- include/d/d_com_inf_game.h | 10 + include/d/d_message_paper.h | 13 +- include/d/d_msg.h | 6 +- include/f_op/f_op_msg_mng.h | 126 +- include/f_pc/f_pc_draw_priority.h | 7 +- include/f_pc/f_pc_name.h | 7 + include/global.h | 19 + include/m_Do/m_Do_audio.h | 2 +- src/JSystem/J2DGraph/J2DTextBox.cpp | 5 +- src/JSystem/JKernel/JKRArchivePub.cpp | 1 - src/JSystem/JUtility/JUTProcBar.cpp | 1 - src/d/actor/d_a_agb.cpp | 6 +- src/d/actor/d_a_bgn.cpp | 89 +- src/d/actor/d_a_bgn2.cpp | 11 +- src/d/actor/d_a_bpw.cpp | 354 ++--- src/d/actor/d_a_btd.cpp | 320 ++--- src/d/actor/d_a_mo2.cpp | 1 - src/d/actor/d_a_npc_hi1.cpp | 4 +- src/d/actor/d_a_obj_auzu.cpp | 19 +- src/d/actor/d_a_player_main.cpp | 41 +- src/d/d_attention.cpp | 2 +- src/d/d_camera.cpp | 2 +- src/d/d_file_error.cpp | 2 +- src/d/d_menu_option.cpp | 39 +- src/d/d_mesg.cpp | 4 +- src/d/d_message.cpp | 59 +- src/d/d_message_paper.cpp | 67 + src/d/d_meter.cpp | 406 +++--- src/d/d_msg.cpp | 806 +++++------ src/d/d_picture_box.cpp | 44 +- src/d/d_s_title.cpp | 2 +- src/d/d_scope.cpp | 4 +- src/f_op/f_op_msg_mng.cpp | 1838 ++++++++++++++++++++----- src/m_Do/m_Do_main.cpp | 2 +- 34 files changed, 2719 insertions(+), 1600 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index bcc7db8b9..13001ea5e 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -444,7 +444,9 @@ public: int getItemNowMagic() { return mItemNowMagicCount; } void setItemNowMagic(s16 num) { mItemNowMagicCount = num; } + u32 getNpcNameMessageID() { return mNpcNameMessageID; } void setNpcNameMessageID(u32 id) { mNpcNameMessageID = id; } + u32 getItemNameMessageID() { return mItemNameMessageID; } void setItemNameMessageID(u32 id) { mItemNameMessageID = id; } s16 getItemKeyNumCount() { return mItemKeyNumCount; } @@ -1010,6 +1012,14 @@ inline s16 dComIfGp_getAuctionGauge() { return g_dComIfG_gameInfo.play.getAuctionGauge(); } +inline u32 dComIfGp_getNpcNameMessageID() { + return g_dComIfG_gameInfo.play.getNpcNameMessageID(); +} + +inline u32 dComIfGp_getItemNameMessageID() { + return g_dComIfG_gameInfo.play.getItemNameMessageID(); +} + inline void dComIfGs_setRupee(u16 rupee) { g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().setRupee(rupee); } diff --git a/include/d/d_message_paper.h b/include/d/d_message_paper.h index 2b5d856a2..4f4e1e1a4 100644 --- a/include/d/d_message_paper.h +++ b/include/d/d_message_paper.h @@ -2,8 +2,12 @@ #define D_MESSAGE_PAPER_H #include "dolphin/types.h" +#include "f_op/f_op_msg.h" -class sub_msg3_class; +#if VERSION < VERSION_PAL +struct sub_msg3_class : public msg_class { + /* 0x0FC */ u8 m0FC[0xEE8 - 0x0FC]; +}; class dmsg3_3d_c { public: @@ -22,5 +26,12 @@ public: void draw(); void outFontDraw(); }; +#endif + +#if VERSION == VERSION_PAL +struct dMessage_Paper_c : public msg_class { + /* 0x0FC */ u8 m0FC[0x104 - 0x0FC]; +}; +#endif #endif /* D_MESSAGE_PAPER_H */ diff --git a/include/d/d_msg.h b/include/d/d_msg.h index f24370b80..b59217d59 100644 --- a/include/d/d_msg.h +++ b/include/d/d_msg.h @@ -79,7 +79,10 @@ public: virtual void draw(); void outFontDraw(); - sub_msg_class* field_0x4; + void setActorP(sub_msg_class* i_msg) { mpMsg = i_msg; } + +private: + sub_msg_class* mpMsg; }; class dDlst_2Dtact_c : public dDlst_base_c { @@ -87,6 +90,7 @@ public: virtual ~dDlst_2Dtact_c(); virtual void draw(); +private: u8 field_0x4[4]; void* field_0x8; }; diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 51989cbb1..a049eb192 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -165,12 +165,6 @@ public: void selectArrow(J2DPicture*, f32, f32); void colorAnime(J2DPicture*); void stringSet(); - void setSelectFlagYokoOn(); - void setSelectFlagOn(); - void setHandSendFlagOn(); - void setAutoSendFlagOn(); - u8 getHandSendFlag(); - u8 getAutoSendFlag(); void getString(char*, u32); void getString(char*, char*, char*, char*, u32, f32*, f32*, int*); void getRubyString(char*, char*, char*, char*, char*, char*, f32*, f32*, int*); @@ -239,11 +233,11 @@ public: void tag_input_kenshi(); #endif - u32 getIconColor(int i_no) { return field_0x1E0[i_no]; } - u8 getIconNum(int i_no) { return field_0x281[i_no]; } - int getIconPosX(int i_no) { return field_0x168[i_no]; } - int getIconPosY(int i_no) { return field_0x1A4[i_no]; } - void getIconScale(int) {} + u8 getIconNum(int i_no) { return iconNum[i_no]; } + int getIconPosX(int i_no) { return iconPosX[i_no]; } + int getIconPosY(int i_no) { return iconPosY[i_no]; } + int getIconScale(int i_no) { return iconScale[i_no]; } + u32 getIconColor(int i_no) { return iconColor[i_no]; } void setCharSpace(int i_space) { charSpace = i_space; } void setRubyCharSpace(int i_space) { rubyCharSpace = i_space; } @@ -259,31 +253,52 @@ public: field_0x6C = param_3; field_0x4C = param_3; } - void setSelectMessage(char*, char*, char*, char*) {} + void setSelectMessage(char* param_0, char* param_1, char* param_2, char* param_3) { + selectMessage[0] = param_0; + selectMessage[1] = param_1; + selectMessage[2] = param_2; + selectMessage[3] = param_3; + } void setMesgEntry(JMSMesgEntry_c* i_entry) { mesgEntry = i_entry; } - void dec_keyWaitTimer() {} - void dec_waitTimer() { waitTimer = (int)waitTimer > 0 ? waitTimer - 1 : 0; } - u8 getCharAlpha() { return field_0x293; } // ? - u8 getGradAlpha() { return field_0x292; } // ? + u8 getSelectFlag() { return selectFlag; } + void setSelectFlagOff() { selectFlag = 0; } + void setSelectFlagOn() { selectFlag = 1; } + void setSelectFlagYokoOn() { selectFlag = 2; } + u8 getAutoSendFlag() { return autoSendFlag; } + void setAutoSendFlagOff() { autoSendFlag = 0; } + void setAutoSendFlagOn() { autoSendFlag = 1; } + u8 getHandSendFlag() { return handSendFlag; } + void setHandSendFlagOff() { handSendFlag = 0; } + void setHandSendFlagOn() { handSendFlag = 1; } + + int get_waitTimer() { return waitTimer; } + void set_waitTimer(int value) { waitTimer = value; } + void set_waitTimerZero() { waitTimer = 0; } + int dec_waitTimer() { return waitTimer = waitTimer > 0 ? waitTimer - 1 : 0; } + + int dec_keyWaitTimer() { return keyWaitTimer = keyWaitTimer > 0 ? keyWaitTimer - 1 : 0; } + int getLineCount() { return lineCount; } u8 getMesgStatus() { return mesgStatus; } - f32 getNowCursorPos() { return field_0x20; } - u8 getRCharAlpha() { return field_0x291; } // ? - u8 getRGradAlpha() { return field_0x290; } // ? - u8 getSelectFlag() { return selectFlag; } - void getSelectLength() {} - u32 getStringColor() { return field_0x25C;} - u32 get_waitTimer() { return waitTimer; } + f32 getNowCursorPos() { return nowCursorPos; } + int getSelectLength() { return selectLength; } + u32 getStringColor() { return stringColor; } + void setStringColor(u32 i_color) { stringColor = i_color; } void resetNowLine() { nowLine = 0; } - void selectArrow(J2DPicture*) {} - void setActorPosition(cXyz*) {} + void selectArrow(J2DPicture* i_arrowPane) { + selectArrow(i_arrowPane, field_0x26C, field_0x270, field_0x278, field_0x274); + } + void setActorPosition(cXyz* i_pos) { actorPosition = i_pos; } void setAimLine(int i_line) { aimLine = i_line; } - void setAutoSendFlagOff() { autoSendFlag = 0; } void setBmgData(char* i_data) { bmgData = i_data; } void setCenterLineWidth(int i_width) { centerLineWidth = i_width; } + u8 getCharAlpha() { return field_0x290; } + u8 getGradAlpha() { return field_0x291; } + u8 getRCharAlpha() { return field_0x292; } + u8 getRGradAlpha() { return field_0x293; } void setCharAlpha(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { field_0x290 = param_0; field_0x291 = param_1; @@ -292,35 +307,28 @@ public: } void setCount(int i_count) { count = i_count; } - void setFont(JUTFont* i_font) { font[0] = i_font; } + void setFont(JUTFont* i_font) { font = i_font; } void setFontSize(int i_size) { fontSize = i_size; } - void setHandSendFlagOff() { handSendFlag = 0; } + void setRubyFont(JUTFont* i_font) { rubyFont = i_font; } + void setRubyFontSize(int i_size) { rubyFontSize = i_size; } void setLineCount(int i_count) { lineCount = i_count; } void setLineWidth(int i_width) { lineWidth = i_width; } - void setRubyFont(JUTFont* i_font) { font[1] = i_font; } - void setRubyFontSize(int i_size) { rubyFontSize = i_size; } - void setSelectFlagOff() { selectFlag = 0; } void setSelectNum(u8) {} void setSendSpeed(int i_speed) { sendSpeed = i_speed; } void setSpaceFlagOff() { spaceFlag = 0; } void setSpaceFlagOn() { spaceFlag = 1; } void setSpaceTimer(int i_timer) { spaceTimer = i_timer; } - void setStringColor(u32 color) { field_0x25C = color; } - void set_waitTimer(int i_timer) { waitTimer = i_timer; } - void set_waitTimerZero() { waitTimer = 0; } void shortCut() { field_0x299 = 1; } - // fake, replace with real inline once it's figured out - u32 get_0x220(int i) { return field_0x220[i]; } - public: - /* 0x004 */ JUTFont* font[2]; + /* 0x004 */ JUTFont* font; + /* 0x008 */ JUTFont* rubyFont; /* 0x00C */ JMSMesgEntry_c* mesgEntry; - /* 0x010 */ u32 field_0x10; + /* 0x010 */ cXyz* actorPosition; /* 0x014 */ f32 field_0x14; /* 0x018 */ f32 field_0x18; /* 0x01C */ f32 field_0x1C; - /* 0x020 */ f32 field_0x20; // NowCursorPos? + /* 0x020 */ f32 nowCursorPos; /* 0x024 */ f32 field_0x24; /* 0x028 */ f32 field_0x28; /* 0x02C */ u32 field_0x2C; @@ -332,17 +340,17 @@ public: /* 0x044 */ char* field_0x44; /* 0x048 */ char* field_0x48; /* 0x04C */ char* field_0x4C; - /* 0x050 */ char* field_0x50[4]; + /* 0x050 */ char* selectMessage[4]; // TODO: should this be 4 separate fields? or should field_0x40 and field_0x60 also be arrays? /* 0x060 */ char* field_0x60; /* 0x064 */ char* field_0x64; /* 0x068 */ char* field_0x68; /* 0x06C */ char* field_0x6C; /* 0x070 */ char field_0x70[0x64]; // no idea how big this array is /* 0x0D4 */ char field_0xD4[4]; - /* 0x0D8 */ s32 field_0xD8[4]; - /* 0x0E8 */ s32 field_0xE8[4]; - /* 0x0F8 */ s32 field_0xF8[4]; - /* 0x108 */ s32 field_0x108[4]; + /* 0x0D8 */ int field_0xD8[4]; + /* 0x0E8 */ int field_0xE8[4]; + /* 0x0F8 */ int field_0xF8[4]; + /* 0x108 */ int field_0x108[4]; /* 0x118 */ int count; /* 0x11C */ int charSpace; /* 0x120 */ int lineSpace; @@ -350,25 +358,25 @@ public: /* 0x128 */ int lineWidth; /* 0x12C */ int centerLineWidth; /* 0x130 */ int lineCount; - /* 0x134 */ u32 field_0x134; + /* 0x134 */ int field_0x134; /* 0x138 */ int nowLine; /* 0x13C */ int aimLine; - /* 0x140 */ u32 field_0x140; + /* 0x140 */ int field_0x140; /* 0x144 */ int fontSize; - /* 0x148 */ u32 field_0x148; + /* 0x148 */ int field_0x148; // size/scale? /* 0x14C */ int rubyFontSize; /* 0x150 */ int field_0x150; - /* 0x154 */ u32 field_0x154; - /* 0x158 */ u32 waitTimer; + /* 0x154 */ int field_0x154; + /* 0x158 */ int waitTimer; /* 0x15C */ int spaceTimer; /* 0x160 */ int sendSpeed; - /* 0x164 */ int field_0x164; // keyWaitTimer? - /* 0x168 */ int field_0x168[0xF]; // IconPosX - /* 0x1A4 */ int field_0x1A4[0xF]; // IconPosY - /* 0x1E0 */ u32 field_0x1E0[0xF]; // IconColor - /* 0x21C */ int field_0x21C; - /* 0x220 */ u32 field_0x220[0xF]; - /* 0x25C */ u32 field_0x25C; + /* 0x164 */ int keyWaitTimer; + /* 0x168 */ int iconPosX[0xF]; + /* 0x1A4 */ int iconPosY[0xF]; + /* 0x1E0 */ int iconScale[0xF]; + /* 0x21C */ int selectLength; + /* 0x220 */ u32 iconColor[0xF]; + /* 0x25C */ u32 stringColor; /* 0x260 */ s16 field_0x260; /* 0x264 */ f32 field_0x264; /* 0x268 */ f32 field_0x268; @@ -381,7 +389,7 @@ public: /* 0x27E */ u8 field_0x27E; /* 0x27F */ u8 field_0x27F; /* 0x280 */ u8 field_0x280; - /* 0x281 */ u8 field_0x281[0xF]; // IconNum? + /* 0x281 */ u8 iconNum[0xF]; /* 0x290 */ u8 field_0x290; /* 0x291 */ u8 field_0x291; /* 0x292 */ u8 field_0x292; @@ -398,7 +406,7 @@ public: /* 0x29B */ u8 field_0x29B; /* 0x29C */ u8 spaceFlag; /* 0x29D */ u8 field_0x29D; -}; +}; // Size: 0x2A0 typedef int (*fopMsgCreateFunc)(void*); diff --git a/include/f_pc/f_pc_draw_priority.h b/include/f_pc/f_pc_draw_priority.h index cfca036bd..4078496bd 100644 --- a/include/f_pc/f_pc_draw_priority.h +++ b/include/f_pc/f_pc_draw_priority.h @@ -2,7 +2,7 @@ #ifndef F_PC_DRAW_PRIORITY_H_ #define F_PC_DRAW_PRIORITY_H_ -#include "dolphin/types.h" +#include "global.h" typedef struct draw_priority_class { s16 mPriority; @@ -488,10 +488,15 @@ enum { /* 0x01D5 */ fpcDwPi_SCP_e, /* 0x01D6 */ fpcDwPi_PB_e, /* 0x01D7 */ fpcDwPi_METER_e, +#if VERSION == VERSION_PAL + /* 0x01D8 */ fpcDwPi_MSG3_e, +#endif /* 0x01D8 */ fpcDwPi_MESG_e, /* 0x01D9 */ fpcDwPi_MSG_e, /* 0x01DA */ fpcDwPi_MSG2_e, +#if VERSION < VERSION_PAL /* 0x01DB */ fpcDwPi_MSG3_e, +#endif /* 0x01DC */ fpcDwPi_AUCTION_SCREEN_e, /* 0x01DD */ fpcDwPi_PLACE_NAME_e, /* 0x01DE */ fpcDwPi_GAMEOVER_e, diff --git a/include/f_pc/f_pc_name.h b/include/f_pc/f_pc_name.h index 614c15d5a..ec9f013c7 100644 --- a/include/f_pc/f_pc_name.h +++ b/include/f_pc/f_pc_name.h @@ -2,6 +2,8 @@ #ifndef F_PC_NAME_H #define F_PC_NAME_H +#include "global.h" + // The fpcNm prefix is from an error string in TP. enum { /* 0x0000 */ fpcNm_OVERLAP0_e, @@ -494,10 +496,15 @@ enum { /* 0x01E3 */ fpcNm_CAMERA2_e, /* 0x01E4 */ fpcNm_KYEFF_e, /* 0x01E5 */ fpcNm_KYEFF2_e, +#if VERSION == VERSION_PAL + /* 0x01E6 */ fpcNm_MSG3_e, +#endif /* 0x01E6 */ fpcNm_MESG_e, /* 0x01E7 */ fpcNm_MSG_e, /* 0x01E8 */ fpcNm_MSG2_e, +#if VERSION < VERSION_PAL /* 0x01E9 */ fpcNm_MSG3_e, +#endif /* 0x01EA */ fpcNm_MENUWINDOW_e, /* 0x01EB */ fpcNm_Menu_Cloth_e, /* 0x01EC */ fpcNm_TIMER_e, diff --git a/include/global.h b/include/global.h index a598a4a0d..32bc78eaa 100644 --- a/include/global.h +++ b/include/global.h @@ -79,4 +79,23 @@ extern void __sync(); #define SJIS(character, value) ((u32)value) #endif +// Hack to trick the compiler into not inlining functions that use this macro. +#define FORCE_DONT_INLINE \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; + #endif diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 23b14f8ef..7f767d11a 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -294,7 +294,7 @@ inline void mDoAud_rainPlay(s32 param_0) { mDoAud_zelAudio_c::getInterface()->rainPlay(param_0); } -inline f32 mDoAud_tact_getMelodyPattern(s32 melody_no, s32 note_no, s32 * pattern) { +inline f32 mDoAud_tact_getMelodyPattern(s32 melody_no, s32 note_no, s32* pattern) { return mDoAud_zelAudio_c::mTact.getMelodyPattern(melody_no, note_no, pattern); } diff --git a/src/JSystem/J2DGraph/J2DTextBox.cpp b/src/JSystem/J2DGraph/J2DTextBox.cpp index ea8db23f4..cd17b9905 100644 --- a/src/JSystem/J2DGraph/J2DTextBox.cpp +++ b/src/JSystem/J2DGraph/J2DTextBox.cpp @@ -190,9 +190,8 @@ void J2DTextBox::drawSelf(f32 x, f32 y, Mtx* pMtx) { MTXConcat(*pMtx, mDrawMtx, mtx); GXLoadPosMtxImm(mtx, 0); print.locate(x, y); - f32 w = mBounds.f.x - mBounds.i.x + 0.0001f; - f32 h = mBounds.f.y - mBounds.i.y; - print.printReturn(mStringPtr, w, h, (J2DTextBoxHBinding)mBindingH, (J2DTextBoxVBinding)mBindingV, field_0xd8, field_0xdc, mDrawAlpha); + print.printReturn(mStringPtr, mBounds.getWidth() + 0.0001f, mBounds.getHeight(), + (J2DTextBoxHBinding)mBindingH, (J2DTextBoxVBinding)mBindingV, field_0xd8, field_0xdc, mDrawAlpha); } /* 802D5DA4-802D5EB0 .text resize__10J2DTextBoxFff */ diff --git a/src/JSystem/JKernel/JKRArchivePub.cpp b/src/JSystem/JKernel/JKRArchivePub.cpp index 05111d1d7..b36d7f9b3 100644 --- a/src/JSystem/JKernel/JKRArchivePub.cpp +++ b/src/JSystem/JKernel/JKRArchivePub.cpp @@ -171,7 +171,6 @@ void* JKRArchive::getResource(u32 type, const char* path) { } /* 802B8528-802B85F0 .text readTypeResource__10JKRArchiveFPvUlUlPCcP10JKRArchive */ -// missing instructions u32 JKRArchive::readTypeResource(void* buffer, u32 bufferSize, u32 type, const char* path, JKRArchive* archive) { u32 ret = 0; diff --git a/src/JSystem/JUtility/JUTProcBar.cpp b/src/JSystem/JUtility/JUTProcBar.cpp index f61e231fd..2b87167f1 100644 --- a/src/JSystem/JUtility/JUTProcBar.cpp +++ b/src/JSystem/JUtility/JUTProcBar.cpp @@ -12,7 +12,6 @@ #include "dolphin/types.h" /* 802C882C-802C8944 .text __ct__10JUTProcBarFv */ -// missing instruction JUTProcBar::JUTProcBar() { mVisible = true; mHeapBarVisible = true; diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index edc82418b..4fde6f3e6 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -1653,9 +1653,9 @@ static BOOL daAgb_Execute(daAgb_c* i_this) { } else { daPy_lk_c* player_p2 = daPy_getPlayerLinkActorClass(); if ((dComIfGp_getPlayer(0) == player_p2 && !player->checkPlayerFly()) || - ((fopAcM_GetName(player) == fpcNm_NPC_MD_e && !daNpc_Md_c::isFlying()) || - (fopAcM_GetName(player) == fpcNm_NPC_CB1_e && !daNpc_Cb1_c::isFlying()) || - fopAcM_GetName(player) == fpcNm_NPC_OS_e)) + (fopAcM_GetName(player) == fpcNm_NPC_MD_e && !daNpc_Md_c::isFlying()) || + (fopAcM_GetName(player) == fpcNm_NPC_CB1_e && !daNpc_Cb1_c::isFlying()) || + fopAcM_GetName(player) == fpcNm_NPC_OS_e) { f32 speedF = fabs(player->speedF); diff --git a/src/d/actor/d_a_bgn.cpp b/src/d/actor/d_a_bgn.cpp index 2f461c2dd..b63b1e806 100644 --- a/src/d/actor/d_a_bgn.cpp +++ b/src/d/actor/d_a_bgn.cpp @@ -1982,56 +1982,57 @@ static void dance_0(bgn_class* i_this) { } i_this->mC74E = 0; i_this->mC74A++; - goto block_51; + break; case 1: - if (((i_this->mC7AC[0] == 0) && (!ki_check(i_this))) && (l_HIO.m028 != 0)) { - if (((i_this->mC754 == 1) || (i_this->mC754 == 2)) || (i_this->mC754 == 3)) { - if (((i_this->mAAA8[0].m2D0 != 0) && (i_this->mAAA8[1].m2D0 != 0)) && (i_this->mC7AC[2] == 0)) { - i_this->mC748 = 4; - i_this->mC74A = 0; - i_this->mCA98 = 0.0f; - return; - } - i_this->mC748 = 1; - i_this->mC7AC[0] = REG0_S(0) + 0x32; - uVar2 = i_this->mAAA8[3].m2D0; - if ((uVar2 == 0) && (i_this->mAAA8[4].m2D0 == 0)) { - i_this->mC74A = 5; - i_this->mC7AC[0] = REG0_S(6) + 0x40; - fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); - } else if (uVar2 == 0) { - i_this->mC74A = 3; - fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); - } else if (i_this->mAAA8[4].m2D0 == 0) { - i_this->mC74A = 1; - fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); - } else if (i_this->mAAA8[7].m2D0 == 0) { - i_this->mC748 = 3; - i_this->mC74A = 0; - } else { - i_this->mC748 = 2; - i_this->mC74A = 0; - } - } else if ((i_this->mC754 == 0) || (i_this->mC754 == 5)) { + if (i_this->mC7AC[0] != 0 || ki_check(i_this) || l_HIO.m028 == 0) { + break; + } + if (i_this->mC754 == 1 || i_this->mC754 == 2 || i_this->mC754 == 3) { + if (i_this->mAAA8[0].m2D0 != 0 && i_this->mAAA8[1].m2D0 != 0 && i_this->mC7AC[2] == 0) { + i_this->mC748 = 4; + i_this->mC74A = 0; + i_this->mCA98 = 0.0f; + return; + } + i_this->mC748 = 1; + i_this->mC7AC[0] = REG0_S(0) + 0x32; + uVar2 = i_this->mAAA8[3].m2D0; + if (uVar2 == 0 && i_this->mAAA8[4].m2D0 == 0) { + i_this->mC74A = 5; + i_this->mC7AC[0] = REG0_S(6) + 0x40; + fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); + } else if (uVar2 == 0) { + i_this->mC74A = 3; + fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); + } else if (i_this->mAAA8[4].m2D0 == 0) { + i_this->mC74A = 1; + fopAcM_monsSeStart(actor, JA_SE_CV_BGN_D_ATTACK, 0); + } else if (i_this->mAAA8[7].m2D0 == 0) { + i_this->mC748 = 3; + i_this->mC74A = 0; + } else { + i_this->mC748 = 2; i_this->mC74A = 0; } - i_this->mC754++; - if (i_this->mC754 > 5) { - i_this->mC754 = 0; - } - // fallthrough + } else if (i_this->mC754 == 0 || i_this->mC754 == 5) { + i_this->mC74A = 0; } - default: - block_51: - switch (i_this->mC74C) { - case 0: - dance_A(i_this); - break; - case 1: - dance_B(i_this); - break; + i_this->mC754++; + if (i_this->mC754 > 5) { + i_this->mC754 = 0; } + break; } + + switch (i_this->mC74C) { + case 0: + dance_A(i_this); + break; + case 1: + dance_B(i_this); + break; + } + move_s* pmVar8 = i_this->mAAA8; for (s32 i = 0; i < 8; i++, pmVar8++) { if (pmVar8->m2D0 == 0) { diff --git a/src/d/actor/d_a_bgn2.cpp b/src/d/actor/d_a_bgn2.cpp index 6b612b498..c25472226 100644 --- a/src/d/actor/d_a_bgn2.cpp +++ b/src/d/actor/d_a_bgn2.cpp @@ -403,7 +403,7 @@ static void jumpattack(bgn2_class* i_this) { case 0: anm_init(i_this, dRes_INDEX_BGN_BCK_JUMP1_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m0314 = 1; - // fallthrough + // fallthrough case 1: actor->speedF = 0.0f; if (frame == 6) { @@ -417,10 +417,13 @@ static void jumpattack(bgn2_class* i_this) { actor->speed.y = REG0_F(8) + 250.0f; i_this->m0314 = 2; fopAcM_seStart(actor, JA_SE_CM_BGN_T_JUMP_UP, 0); - case 2: - actor->speedF = REG0_F(9) + 50.0f; - break; + } else { + break; } + // fallthrough + case 2: + actor->speedF = REG0_F(9) + 50.0f; + break; } if (i_this->m2EC8[0] != NULL) { i_this->m2EC8[0]->setGlobalRTMatrix(pBrk->getAnmMtx(2)); diff --git a/src/d/actor/d_a_bpw.cpp b/src/d/actor/d_a_bpw.cpp index fbb244a71..ab9499fbc 100644 --- a/src/d/actor/d_a_bpw.cpp +++ b/src/d/actor/d_a_bpw.cpp @@ -1093,163 +1093,168 @@ void action_dousa(bpw_class* i_this) { case 1: if (i_this->mSomeCountdownTimers[0] == 0) { i_this->mActionState++; - // fallthrough + } else { + break; + } + // fallthrough + case 2: + i_this->mSomeCountdownTimers[0] = 0x41; + i_this->m490 = 10.0f; + i_this->mSomeCountdownTimers[0] += (int)cM_rndF(i_this->mSomeCountdownTimers[0]); + i_this->m488 = 1.0f; + if (i_this->m3F6 == 2) { + i_this->m490 = i_this->m490 * DEMO_SELECT(REG11_F(4) + 1.75f, REG8_F(0) + 1.35f); + i_this->m488 = 5.0f; + } + if (i_this->m3F8 != 0x1d) { + anm_init(i_this, dRes_INDEX_BPW_BCK_MOVEF1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + } + i_this->mActionState++; + case 3: + if (i_this->mSomeCountdownTimers[0] != 0) { + break; + } + i_this->m490 = 0.0f; + switch (i_this->m3F6) { + case 0: + i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; + i_this->mActionState = 0x14; + break; + case 1: case 2: - i_this->mSomeCountdownTimers[0] = 0x41; - i_this->m490 = 10.0f; - i_this->mSomeCountdownTimers[0] += (int)cM_rndF(i_this->mSomeCountdownTimers[0]); - i_this->m488 = 1.0f; - if (i_this->m3F6 == 2) { - i_this->m490 = i_this->m490 * DEMO_SELECT(REG11_F(4) + 1.75f, REG8_F(0) + 1.35f); - i_this->m488 = 5.0f; - } - if (i_this->m3F8 != 0x1d) { - anm_init(i_this, dRes_INDEX_BPW_BCK_MOVEF1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - } - i_this->mActionState++; - case 3: - if (i_this->mSomeCountdownTimers[0] == 0) { - i_this->m490 = 0.0f; - switch (i_this->m3F6) { - case 0: - i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; - i_this->mActionState = 0x14; - break; - case 1: - case 2: - if (dComIfGp_getDetect().chk_light(&player->current.pos)) { - i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; - i_this->mActionState = 0x28; - } else if (REG12_S(9) != 0) { - i_this->mActionState = 4; - } else { - if (cM_rnd() < 0.5f) { - f32 f5 = 1100.0f; - f32 fVar15 = i_this->mBodyPos.x - actor->current.pos.x; - f32 fVar3 = i_this->mBodyPos.z - actor->current.pos.z; - if (std::sqrtf(SQUARE(fVar15) + SQUARE(fVar3)) < f5) { - i_this->mBodyAction = ACTION_BODY_DOWN_KARADA_TAORE; - i_this->mActionState = 0x46; - break; - } - } - i_this->mActionState = 4; + if (dComIfGp_getDetect().chk_light(&player->current.pos)) { + i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; + i_this->mActionState = 0x28; + } else if (REG12_S(9) != 0) { + i_this->mActionState = 4; + } else { + if (cM_rnd() < 0.5f) { + f32 f5 = 1100.0f; + f32 fVar15 = i_this->mBodyPos.x - actor->current.pos.x; + f32 fVar3 = i_this->mBodyPos.z - actor->current.pos.z; + if (std::sqrtf(SQUARE(fVar15) + SQUARE(fVar3)) < f5) { + i_this->mBodyAction = ACTION_BODY_DOWN_KARADA_TAORE; + i_this->mActionState = 0x46; + break; } } - break; - case 4: - anm_init(i_this, dRes_INDEX_BPW_BCK_MOVEB1_e, REG12_F(0) + 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG12_F(1) + 40.0f); - noroi_brk_check(i_this, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_BPW_CURSE, 0); - i_this->mActionState++; - case 5: - maai_sub(i_this); - if (i_this->mSomeCountdownTimers[0] == 0) { - i_this->m3E6 = 1; - actor->speedF = REG8_F(12) + 75.0f; - i_this->m488 = REG8_F(13) + 2.0f; - i_this->m490 = 0.0f; - anm_init(i_this, dRes_INDEX_BPW_BCK_MOVES1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mActionState++; - - // fallthrough - case 6: { - if (actor->speedF < 1.0f) { - actor->speedF = 0.0f; - } - cMtx_YrotS(*calc_mtx, actor->current.angle.y); - local_c0.x = 0.0f; - local_c0.y = 0.0f; - local_c0.z = 500.0f; - MtxPosition(&local_c0, i_this->m328); - i_this->m328[0] += actor->current.pos; - i_this->m328[0].y += 400.0f; - i_this->m304[0] = actor->current.pos; - i_this->m304[0].y += 400.0f; - linChk.Set(i_this->m304, i_this->m328, actor); - if (dComIfG_Bgsp()->LineCross(&linChk)) { - actor->speedF = 0.0f; - } - f32 f0; - f32 f1; - f1 = actor->speedF; - f0 = 0.0f; - if (f1 == f0) { - noroi_brk_check(i_this, 1); - next_status_clear(i_this, 1); - if (player->checkConfuse()) { - i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; - i_this->mActionState = 0x14; - } else { - i_this->mActionState = 0; - } - } - break; - } - case 10: - search_get_skull(i_this, 2); - for (s32 i = 0; i < 10; i++) { - i_this->mSomeCountdownTimers[i + 10] = 0; - } - if (i_this->m3F8 != 0x2a) { - anm_init(i_this, dRes_INDEX_BPW_BCK_WAIT1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - } - i_this->mActionState++; - case 0xb: - cLib_addCalcAngleS2(&i_this->m47E, 0, 1, 10); - if (i_this->m47E < 2) { - i_this->m47E = 0; - if (kantera_pos_search(i_this)) { - i_this->mActionState++; - } - } - break; - case 0xc: - cLib_addCalcAngleS2(&i_this->m47E, 0x96, 1, 0x1e); - if (i_this->m47E >= 0x95) { - i_this->m47E = 0x96; - i_this->m480 = 0x96; - anm_init(i_this, dRes_INDEX_BPW_BCK_HIROU1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); - kantera_pos_search(i_this); - i_this->mActionState++; - } - break; - case 0xd: - if (i_this->m462 == 0) { - kantera_pos_search(i_this); - } - if (i_this->mpMorf->checkFrame(12.0f)) { - fopAcM_seStart(actor, JA_SE_CM_BPW_GET_KANTERA, 0); - if (i_this->m3FC != fpcM_ERROR_PROCESS_ID_e) { - bpw_class* pfVar6 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); - if (pfVar6 != NULL) { - pfVar6->actor.gravity = 0.0f; - pfVar6->actor.speedF = 0.0f; - pfVar6->actor.speed.setall(0.0f); - pfVar6->actor.attention_info.flags = 0; - pfVar6->mActionState = 0; - i_this->m462 = 1; - } - } - i_this->m482 = 0; - i_this->m388 = 0.0f; - i_this->m38C = 0.0f; - i_this->m390 = 0.0f; - i_this->mAttWaitTimer = 1; - } - if (i_this->mpMorf->isStop()) { - next_status_clear(i_this, 1); -#if VERSION > VERSION_DEMO - i_this->mSomeCountdownTimers[2] = 0; -#endif - i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; - i_this->mActionState = 0x14; - } - // fallthrough - } + i_this->mActionState = 4; } } + break; + case 4: + anm_init(i_this, dRes_INDEX_BPW_BCK_MOVEB1_e, REG12_F(0) + 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG12_F(1) + 40.0f); + noroi_brk_check(i_this, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_BPW_CURSE, 0); + i_this->mActionState++; + case 5: + maai_sub(i_this); + if (i_this->mSomeCountdownTimers[0] == 0) { + i_this->m3E6 = 1; + actor->speedF = REG8_F(12) + 75.0f; + i_this->m488 = REG8_F(13) + 2.0f; + i_this->m490 = 0.0f; + anm_init(i_this, dRes_INDEX_BPW_BCK_MOVES1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + i_this->mActionState++; + } else { + break; + } + + // fallthrough + case 6: { + if (actor->speedF < 1.0f) { + actor->speedF = 0.0f; + } + cMtx_YrotS(*calc_mtx, actor->current.angle.y); + local_c0.x = 0.0f; + local_c0.y = 0.0f; + local_c0.z = 500.0f; + MtxPosition(&local_c0, i_this->m328); + i_this->m328[0] += actor->current.pos; + i_this->m328[0].y += 400.0f; + i_this->m304[0] = actor->current.pos; + i_this->m304[0].y += 400.0f; + linChk.Set(i_this->m304, i_this->m328, actor); + if (dComIfG_Bgsp()->LineCross(&linChk)) { + actor->speedF = 0.0f; + } + f32 f0; + f32 f1; + f1 = actor->speedF; + f0 = 0.0f; + if (f1 == f0) { + noroi_brk_check(i_this, 1); + next_status_clear(i_this, 1); + if (player->checkConfuse()) { + i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; + i_this->mActionState = 0x14; + } else { + i_this->mActionState = 0; + } + } + break; + } + case 10: + search_get_skull(i_this, 2); + for (s32 i = 0; i < 10; i++) { + i_this->mSomeCountdownTimers[i + 10] = 0; + } + if (i_this->m3F8 != 0x2a) { + anm_init(i_this, dRes_INDEX_BPW_BCK_WAIT1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + } + i_this->mActionState++; + case 0xb: + cLib_addCalcAngleS2(&i_this->m47E, 0, 1, 10); + if (i_this->m47E < 2) { + i_this->m47E = 0; + if (kantera_pos_search(i_this)) { + i_this->mActionState++; + } + } + break; + case 0xc: + cLib_addCalcAngleS2(&i_this->m47E, 0x96, 1, 0x1e); + if (i_this->m47E >= 0x95) { + i_this->m47E = 0x96; + i_this->m480 = 0x96; + anm_init(i_this, dRes_INDEX_BPW_BCK_HIROU1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); + kantera_pos_search(i_this); + i_this->mActionState++; + } + break; + case 0xd: + if (i_this->m462 == 0) { + kantera_pos_search(i_this); + } + if (i_this->mpMorf->checkFrame(12.0f)) { + fopAcM_seStart(actor, JA_SE_CM_BPW_GET_KANTERA, 0); + if (i_this->m3FC != fpcM_ERROR_PROCESS_ID_e) { + bpw_class* pfVar6 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); + if (pfVar6 != NULL) { + pfVar6->actor.gravity = 0.0f; + pfVar6->actor.speedF = 0.0f; + pfVar6->actor.speed.setall(0.0f); + pfVar6->actor.attention_info.flags = 0; + pfVar6->mActionState = 0; + i_this->m462 = 1; + } + } + i_this->m482 = 0; + i_this->m388 = 0.0f; + i_this->m38C = 0.0f; + i_this->m390 = 0.0f; + i_this->mAttWaitTimer = 1; + } + if (i_this->mpMorf->isStop()) { + next_status_clear(i_this, 1); +#if VERSION > VERSION_DEMO + i_this->mSomeCountdownTimers[2] = 0; +#endif + i_this->mBodyAction = ACTION_ATTACK_KOUGEKI; + i_this->mActionState = 0x14; + } + // fallthrough } i_this->m4A0 = 0.0f; cLib_addCalc2(&actor->speedF, i_this->m490, 1.0f, i_this->m488); @@ -3988,32 +3993,33 @@ void torituki_execute(bpw_class* i_this) { case 1: cLib_addCalc2(&actor->scale.x, 0.4f, 1.0f, 0.1f); actor->scale.y = actor->scale.z = actor->scale.x; - if (!(actor->scale.x < 0.3f)) { - anm_init(i_this, dRes_INDEX_BPW_BCK_TORITUKI1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mSomeCountdownTimers[8] = DEMO_SELECT(0xD2, 0x96); - actor->scale.setall(0.4f); - i_this->mActionState++; - // fallthrough - case 2: - actor->shape_angle.y += 1000; - if (i_this->mSomeCountdownTimers[8] != 0) { - daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); - if (((i_this->mSomeCountdownTimers[8] == 1 || (dComIfGp_getDetect().chk_light(&actor->current.pos))) || - (dComIfGp_checkPlayerStatus1(0, daPyStts1_UNK2000_e))) || - (player->getDamageWaitTimer() != 0 || (player->checkFairyUse()))) - { - player->offConfuse(); - i_this->mSomeCountdownTimers[8] = 0; - if (dComIfGp_getStartStageName()[0] == 'X') { - mDoAud_bgmStart(JA_BGM_PAST_BIG_POW); - } else { - mDoAud_bgmStart(JA_BGM_BIG_POW); - } - i_this->mActionState++; + if (actor->scale.x < 0.3f) { + break; + } + anm_init(i_this, dRes_INDEX_BPW_BCK_TORITUKI1_e, DEMO_SELECT(REG11_F(0) + 15.0f, 15.0f), J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + i_this->mSomeCountdownTimers[8] = DEMO_SELECT(0xD2, 0x96); + actor->scale.setall(0.4f); + i_this->mActionState++; + // fallthrough + case 2: { + actor->shape_angle.y += 1000; + if (i_this->mSomeCountdownTimers[8] != 0) { + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + if (i_this->mSomeCountdownTimers[8] == 1 || dComIfGp_getDetect().chk_light(&actor->current.pos) || + dComIfGp_checkPlayerStatus1(0, daPyStts1_UNK2000_e) || player->getDamageWaitTimer() != 0 || player->checkFairyUse()) + { + player->offConfuse(); + i_this->mSomeCountdownTimers[8] = 0; + if (dComIfGp_getStartStageName()[0] == 'X') { + mDoAud_bgmStart(JA_BGM_PAST_BIG_POW); + } else { + mDoAud_bgmStart(JA_BGM_BIG_POW); } + i_this->mActionState++; } } break; + } case 3: cLib_addCalc0(&actor->scale.x, 1.0f, 0.1f); actor->scale.y = actor->scale.z = actor->scale.x; diff --git a/src/d/actor/d_a_btd.cpp b/src/d/actor/d_a_btd.cpp index 73bcae8e9..e540d35ea 100644 --- a/src/d/actor/d_a_btd.cpp +++ b/src/d/actor/d_a_btd.cpp @@ -670,177 +670,179 @@ static s32 damage(btd_class* i_this) anm_init(i_this, dRes_INDEX_BTD_BCK_SIZUMU2_e, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->m02EC[0] = (REG0_S(7) + 0x14) * 5; i_this->mGohmaState++; - - case 0x16: - if (i_this->m02EC[0] == REG0_S(5) + 0x28) { - J3DModel* model = morf->getModel(); - i_this->brk->init( - model->getModelData(), - (J3DAnmTevRegKey*)dComIfG_getObjectRes("Btd", hibi_brk[i_this->m6190]), - true, - J3DFrameCtrl::EMode_LOOP, - 1.0f, - 0, - -1, - true, - 0 - ); - i_this->m6190++; - fopAcM_seStart(actor, JA_SE_CM_BTD_BRK_SHIELD_S, 0); - for (int i = 0, j = 0; i < 3; i++, j++) { - JPABaseEmitter* emitter = dComIfGp_particle_set(hibi_eff_name[j], &actor->current.pos); - if (emitter != NULL) { - emitter->setGlobalRTMatrix(morf->getModel()->getAnmMtx(BTD_JNT_HEAD_e)); - } - } - if (l_HIO.m06 != 0) { - i_this->m6190 = 3; - } - if ((l_HIO.m07 != 0) && (i_this->m6190 >= 3)) { - i_this->m6190 = 2; - } - } - if (i_this->m02EC[0] == 0) { - if (i_this->m6190 >= 3) { - i_this->mGohmaState = 0x28; - } else { - anm_init(i_this, dRes_INDEX_BTD_BCK_SIZUMU3_e, 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mGohmaState++; - static_center_pos.setall(0.0f); - mDoAud_seStart(JA_SE_CM_BTD_INTO_MAGMA_N, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - fopAcM_monsSeStart(actor, JA_SE_CV_BTD_WAIT, 0); - i_this->m6E7C = 0.0f; - i_this->m02EC[0] = 0x96; - } - } + } else { break; - case 0x17: - if ((i_this->m02EC[0] == 1) || (i_this->m02EC[0] == 0x46)) { - i_this->m6E7C = 0.0f; + } + // Fall-through + case 0x16: + if (i_this->m02EC[0] == REG0_S(5) + 0x28) { + J3DModel* model = morf->getModel(); + i_this->brk->init( + model->getModelData(), + (J3DAnmTevRegKey*)dComIfG_getObjectRes("Btd", hibi_brk[i_this->m6190]), + true, + J3DFrameCtrl::EMode_LOOP, + 1.0f, + 0, + -1, + true, + 0 + ); + i_this->m6190++; + fopAcM_seStart(actor, JA_SE_CM_BTD_BRK_SHIELD_S, 0); + for (int i = 0, j = 0; i < 3; i++, j++) { + JPABaseEmitter* emitter = dComIfGp_particle_set(hibi_eff_name[j], &actor->current.pos); + if (emitter != NULL) { + emitter->setGlobalRTMatrix(morf->getModel()->getAnmMtx(BTD_JNT_HEAD_e)); + } } - if (morf->isStop()) { - i_this->mGohmaState = 0x1e; - i_this->m02EC[0] = 0; + if (l_HIO.m06 != 0) { + i_this->m6190 = 3; } - break; - case 0x1e: - i_this->m6E88 = 0; - if (i_this->m02EC[0] == 0) { - anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE1_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + if ((l_HIO.m07 != 0) && (i_this->m6190 >= 3)) { + i_this->m6190 = 2; + } + } + if (i_this->m02EC[0] == 0) { + if (i_this->m6190 >= 3) { + i_this->mGohmaState = 0x28; + } else { + anm_init(i_this, dRes_INDEX_BTD_BCK_SIZUMU3_e, 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mGohmaState++; - i_this->m02F6 = 0; - mDoAud_seStart(JA_SE_CM_BTD_ENT_BLAST, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - fopAcM_monsSeStart(actor, JA_SE_CV_BTD_ENTER, 0); - i_this->m02EC[0] = 0x3c; + static_center_pos.setall(0.0f); + mDoAud_seStart(JA_SE_CM_BTD_INTO_MAGMA_N, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + fopAcM_monsSeStart(actor, JA_SE_CV_BTD_WAIT, 0); i_this->m6E7C = 0.0f; - i_this->mKankyoTimer = 0x14; + i_this->m02EC[0] = 0x96; } - break; - case 0x1f: - if (i_this->m02EC[0] == 0x37) { - sibuki_set(i_this); - } - if (i_this->m02EC[0] == 1) { - i_this->m6E7C = 0.0f; - } - if (morf->isStop()) { - anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE2_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mGohmaState++; - mDoAud_seStart(JA_SE_CM_BTD_LIFT_UP, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - i_this->m6E7C = 0.0f; - } - break; - case 0x20: - i_this->m6E88 = 0; - if (morf->isStop()) { - anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE3_e, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - dr2_class* tmp = (dr2_class*)dr2; - mDoAud_seStart(JA_SE_CM_BTD_JUMP_DOWN, &tmp->unk_4A8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - dComIfGp_particle_set(dPa_name::ID_AK_SN_BTDSPLASHMAGMA00, &actor->current.pos, &actor->current.angle); - i_this->mGohmaState++; - i_this->m02EC[0] = 0x1e; - } - break; - case 0x21: - if (i_this->m02EC[0] == 0x14) { - mDoAud_seStart(JA_SE_CM_BTD_LANDING, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - i_this->m6E7C = 0.0f; - sibuki_set(i_this); - } - if (morf->isStop()) { - i_this->m02E4 = 0; - i_this->mGohmaState = 0; - i_this->m02EC[0] = cM_rndF(50.0f) + 50.0f; - } - break; - case 0x28: - anm_init(i_this, dRes_INDEX_BTD_BCK_WARERU1_e, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mGohmaState++; - fopAcM_seStart(actor, JA_SE_CM_BTD_FALL_FWD, 0); - mDoAud_bgmStop(30); - i_this->m02EC[0] = 0x96; + } + break; + case 0x17: + if ((i_this->m02EC[0] == 1) || (i_this->m02EC[0] == 0x46)) { i_this->m6E7C = 0.0f; - case 0x29: - if (i_this->m02EC[0] == (s16)(REG0_S(5) + 0x26)) { - dr2_class* tmp = dr2; - tmp->unk_4BA = 10; - if (dComIfGp_getStartStageName()[0] == 'X') { - mDoAud_bgmStart(JA_BGM_PAST_GOMA_2); - } else { - mDoAud_bgmStart(JA_BGM_GOMA_2); - }; - btd_hahen_s* hahen = &i_this->hahen[0]; - for (s32 i = 0; i < ARRAY_SSIZE(i_this->hahen); i++, hahen++) { - if (hahen->m04 == 0) { - int iVar3; - if (i < 5) { - iVar3 = 2; - } else { - iVar3 = cM_rndF(18.999f); - } - hahen->m04 = 1; - hahen->m08.x = i_this->m02FC[iVar3].x; - hahen->m08.y = i_this->m02FC[iVar3].y; - hahen->m08.z = i_this->m02FC[iVar3].z; - hahen->m08.x = hahen->m08.x + cM_rndFX(REG0_F(2) + 50.0f); - hahen->m08.y = hahen->m08.y + cM_rndFX(REG0_F(2) + 50.0f); - hahen->m08.z = hahen->m08.z + cM_rndFX(REG0_F(2) + 50.0f); - s16 r0 = cM_atan2s(hahen->m08.x, hahen->m08.z); - cMtx_YrotS(*calc_mtx, r0 + (s16)cM_rndFX(2000.0f)); - local_58.x = 0.0f; - local_58.y = REG0_F(1) + (cM_rndF(5.0f) + 20.0f); - local_58.z = REG0_F(0) + (cM_rndF(5.0f) + 20.0f); - MtxPosition(&local_58, &hahen->m14); - hahen->m22 = cM_rndF(0x10000); - hahen->m20 = cM_rndF(0x10000); - } - } - for (s32 i = 0, j = 0, k = 0; i < ARRAY_SSIZE(hahen_eff_name); i++, j++, k++) { - JPABaseEmitter* emitter = dComIfGp_particle_set(hahen_eff_name[k], &actor->current.pos); - if (emitter != NULL) { - emitter->setGlobalRTMatrix(morf->getModel()->getAnmMtx(hahen_eff_index[j])); + } + if (morf->isStop()) { + i_this->mGohmaState = 0x1e; + i_this->m02EC[0] = 0; + } + break; + case 0x1e: + i_this->m6E88 = 0; + if (i_this->m02EC[0] == 0) { + anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE1_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mGohmaState++; + i_this->m02F6 = 0; + mDoAud_seStart(JA_SE_CM_BTD_ENT_BLAST, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + fopAcM_monsSeStart(actor, JA_SE_CV_BTD_ENTER, 0); + i_this->m02EC[0] = 0x3c; + i_this->m6E7C = 0.0f; + i_this->mKankyoTimer = 0x14; + } + break; + case 0x1f: + if (i_this->m02EC[0] == 0x37) { + sibuki_set(i_this); + } + if (i_this->m02EC[0] == 1) { + i_this->m6E7C = 0.0f; + } + if (morf->isStop()) { + anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE2_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mGohmaState++; + mDoAud_seStart(JA_SE_CM_BTD_LIFT_UP, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + i_this->m6E7C = 0.0f; + } + break; + case 0x20: + i_this->m6E88 = 0; + if (morf->isStop()) { + anm_init(i_this, dRes_INDEX_BTD_BCK_MOTIAGE3_e, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + dr2_class* tmp = (dr2_class*)dr2; + mDoAud_seStart(JA_SE_CM_BTD_JUMP_DOWN, &tmp->unk_4A8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + dComIfGp_particle_set(dPa_name::ID_AK_SN_BTDSPLASHMAGMA00, &actor->current.pos, &actor->current.angle); + i_this->mGohmaState++; + i_this->m02EC[0] = 0x1e; + } + break; + case 0x21: + if (i_this->m02EC[0] == 0x14) { + mDoAud_seStart(JA_SE_CM_BTD_LANDING, &static_center_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + i_this->m6E7C = 0.0f; + sibuki_set(i_this); + } + if (morf->isStop()) { + i_this->m02E4 = 0; + i_this->mGohmaState = 0; + i_this->m02EC[0] = cM_rndF(50.0f) + 50.0f; + } + break; + case 0x28: + anm_init(i_this, dRes_INDEX_BTD_BCK_WARERU1_e, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mGohmaState++; + fopAcM_seStart(actor, JA_SE_CM_BTD_FALL_FWD, 0); + mDoAud_bgmStop(30); + i_this->m02EC[0] = 0x96; + i_this->m6E7C = 0.0f; + case 0x29: + if (i_this->m02EC[0] == (s16)(REG0_S(5) + 0x26)) { + dr2_class* tmp = dr2; + tmp->unk_4BA = 10; + if (dComIfGp_getStartStageName()[0] == 'X') { + mDoAud_bgmStart(JA_BGM_PAST_GOMA_2); + } else { + mDoAud_bgmStart(JA_BGM_GOMA_2); + }; + btd_hahen_s* hahen = &i_this->hahen[0]; + for (s32 i = 0; i < ARRAY_SSIZE(i_this->hahen); i++, hahen++) { + if (hahen->m04 == 0) { + int iVar3; + if (i < 5) { + iVar3 = 2; + } else { + iVar3 = cM_rndF(18.999f); } + hahen->m04 = 1; + hahen->m08.x = i_this->m02FC[iVar3].x; + hahen->m08.y = i_this->m02FC[iVar3].y; + hahen->m08.z = i_this->m02FC[iVar3].z; + hahen->m08.x = hahen->m08.x + cM_rndFX(REG0_F(2) + 50.0f); + hahen->m08.y = hahen->m08.y + cM_rndFX(REG0_F(2) + 50.0f); + hahen->m08.z = hahen->m08.z + cM_rndFX(REG0_F(2) + 50.0f); + s16 r0 = cM_atan2s(hahen->m08.x, hahen->m08.z); + cMtx_YrotS(*calc_mtx, r0 + (s16)cM_rndFX(2000.0f)); + local_58.x = 0.0f; + local_58.y = REG0_F(1) + (cM_rndF(5.0f) + 20.0f); + local_58.z = REG0_F(0) + (cM_rndF(5.0f) + 20.0f); + MtxPosition(&local_58, &hahen->m14); + hahen->m22 = cM_rndF(0x10000); + hahen->m20 = cM_rndF(0x10000); } } - if (i_this->m02EC[0] == 0x65) { - fopAcM_seStart(actor, JA_SE_CM_BTD_GET_UP, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_BTD_ENTER, 0); - } - if (morf->isStop()) { - fopAcM_seStart(actor, JA_SE_CM_BTD_BRK_SHIELD_L, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_BTD_AFT_DAMAGE, 0); - i_this->m02E0 = 1; - anm_init(i_this, dRes_INDEX_BTD_BCK_WARERU2_e, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mGohmaState++; - } - break; - case 0x2a: - if (morf->isStop()) { - i_this->m02E4 = 0; - i_this->mGohmaState = 0; - i_this->m02EC[0] = cM_rndF(50.0f) + 50.0f; + for (s32 i = 0, j = 0, k = 0; i < ARRAY_SSIZE(hahen_eff_name); i++, j++, k++) { + JPABaseEmitter* emitter = dComIfGp_particle_set(hahen_eff_name[k], &actor->current.pos); + if (emitter != NULL) { + emitter->setGlobalRTMatrix(morf->getModel()->getAnmMtx(hahen_eff_index[j])); + } } } + if (i_this->m02EC[0] == 0x65) { + fopAcM_seStart(actor, JA_SE_CM_BTD_GET_UP, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_BTD_ENTER, 0); + } + if (morf->isStop()) { + fopAcM_seStart(actor, JA_SE_CM_BTD_BRK_SHIELD_L, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_BTD_AFT_DAMAGE, 0); + i_this->m02E0 = 1; + anm_init(i_this, dRes_INDEX_BTD_BCK_WARERU2_e, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mGohmaState++; + } + break; + case 0x2a: + if (morf->isStop()) { + i_this->m02E4 = 0; + i_this->mGohmaState = 0; + i_this->m02EC[0] = cM_rndF(50.0f) + 50.0f; + } } #if VERSION == VERSION_DEMO return; diff --git a/src/d/actor/d_a_mo2.cpp b/src/d/actor/d_a_mo2.cpp index 858e1e0a2..4a47f35d4 100644 --- a/src/d/actor/d_a_mo2.cpp +++ b/src/d/actor/d_a_mo2.cpp @@ -654,7 +654,6 @@ static void daMo2_shadowDraw(mo2_class* i_this) { i_this->mDamageReaction.mAcch.m_gnd, &actor->tevStr ); - ; } } diff --git a/src/d/actor/d_a_npc_hi1.cpp b/src/d/actor/d_a_npc_hi1.cpp index bcd314a1b..0a466e880 100644 --- a/src/d/actor/d_a_npc_hi1.cpp +++ b/src/d/actor/d_a_npc_hi1.cpp @@ -227,7 +227,7 @@ bool daNpc_Hi1_c::setBtp(s8 param_1, bool param_2) { if(param_1 < 0) { return false; } - int resID = btpResID((int)param_1) ; + int resID = btpResID(param_1); J3DAnmTexPattern* a_btp = (J3DAnmTexPattern *)dComIfG_getObjectIDRes(mArcName, resID); JUT_ASSERT(0x192, a_btp != NULL); field_0x7BE = param_1; @@ -243,7 +243,7 @@ bool daNpc_Hi1_c::setBtk(s8 param_1, bool param_2) { if(param_1 < 0) { return false; } - int resID = btkResID((int)param_1); + int resID = btkResID(param_1); J3DAnmTextureSRTKey* a_btk = (J3DAnmTextureSRTKey *)dComIfG_getObjectIDRes(mArcName, resID); JUT_ASSERT(0x1aa, a_btk != NULL); diff --git a/src/d/actor/d_a_obj_auzu.cpp b/src/d/actor/d_a_obj_auzu.cpp index 392e9f5f2..8a0acd1a7 100644 --- a/src/d/actor/d_a_obj_auzu.cpp +++ b/src/d/actor/d_a_obj_auzu.cpp @@ -154,17 +154,13 @@ void daObjAuzu::Act_c::ship_whirl() { if (ship_p && fopAcM_GetName(ship_p) == fpcNm_SHIP_e) { f32 sqr_mag_xz = fopAcM_searchActorDistanceXZ2(this, ship_p); #if VERSION > VERSION_DEMO - f32 inner_activation = (daObjAuzu::L_radius * attr().mInnerActivationMult) * - (daObjAuzu::L_radius * attr().mInnerActivationMult); + f32 inner_activation = SQUARE(daObjAuzu::L_radius * attr().mInnerActivationMult); - f32 outer_activation = (daObjAuzu::L_radius * attr().mOuterActivationMult) * - (daObjAuzu::L_radius * attr().mOuterActivationMult); + f32 outer_activation = SQUARE(daObjAuzu::L_radius * attr().mOuterActivationMult); #else - f32 outer_activation = (daObjAuzu::L_radius * attr().mOuterActivationMult) * - (daObjAuzu::L_radius * attr().mOuterActivationMult); + f32 outer_activation = SQUARE(daObjAuzu::L_radius * attr().mOuterActivationMult); - f32 inner_activation = (daObjAuzu::L_radius * attr().mInnerActivationMult) * - (daObjAuzu::L_radius * attr().mInnerActivationMult); + f32 inner_activation = SQUARE(daObjAuzu::L_radius * attr().mInnerActivationMult); #endif if (sqr_mag_xz < outer_activation) { if (mScaleAnimFactor > 0.01f) { @@ -191,10 +187,10 @@ void daObjAuzu::Act_c::bgm_start() { /* 000007DC-00000AF8 .text _execute__Q29daObjAuzu5Act_cFv */ bool daObjAuzu::Act_c::_execute() { - f32 scale_target; #if VERSION > VERSION_JPN set_mtx(); #endif + if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) { ship_whirl(); } else { @@ -202,9 +198,7 @@ bool daObjAuzu::Act_c::_execute() { daPy_lk_c* link_p = daPy_getPlayerLinkActorClass(); fopAcM_searchActorDistanceXZ2(this, daPy_getPlayerLinkActorClass()); if ( - fopAcM_searchActorDistanceXZ2(this, link_p) < - ((daObjAuzu::L_radius * attr().mOuterActivationMult) * - (daObjAuzu::L_radius * attr().mOuterActivationMult)) + fopAcM_searchActorDistanceXZ2(this, link_p) < SQUARE(daObjAuzu::L_radius * attr().mOuterActivationMult) ) { link_p->setWhirlId(fopAcM_GetID(this)); } @@ -213,6 +207,7 @@ bool daObjAuzu::Act_c::_execute() { mBtkAnm.play(); + f32 scale_target; if (prm_get_appear() == 1) { if (mbToAppear) { scale_target = 1.0f; diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 368089919..bb8c84408 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -3912,23 +3912,14 @@ void daPy_lk_c::checkItemAction() { { J3DFrameCtrl& frameCtrl = mFrameCtrlUpper[UPPER_MOVE2_e]; if (checkUpperAnime(dRes_INDEX_LKANM_BCK_BOOMCATCH_e)) { - if (!(frameCtrl.getRate() < 0.01f)) { - if (!(mStickDistance > 0.05f)) { - return; + if (frameCtrl.getRate() < 0.01f || (mStickDistance > 0.05f && frameCtrl.getFrame() > m_HIO->mItem.mBoom.m.field_0x2C)) { + resetActAnimeUpper(UPPER_MOVE2_e, m_HIO->mBasic.m.field_0xC); + if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) { + procShipPaddle_init(); } - if (!(frameCtrl.getFrame() > m_HIO->mItem.mBoom.m.field_0x2C)) { - return; - } - } - resetActAnimeUpper(UPPER_MOVE2_e, m_HIO->mBasic.m.field_0xC); - if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) { - procShipPaddle_init(); } } else if (checkUpperAnime(dRes_INDEX_LKANM_BCK_BOOMTHROW_e)) { - if (frameCtrl.getRate() < 0.01f || - ((mStickDistance > 0.05f && - (frameCtrl.getFrame() > m_HIO->mItem.mBoom.m.field_0x10)))) - { + if (frameCtrl.getRate() < 0.01f || (mStickDistance > 0.05f && frameCtrl.getFrame() > m_HIO->mItem.mBoom.m.field_0x10)) { resetActAnimeUpper(UPPER_MOVE2_e, m_HIO->mBasic.m.field_0xC); } else { if (frameCtrl.checkPass(m_HIO->mItem.mBoom.m.field_0x14)) { @@ -4247,9 +4238,7 @@ BOOL daPy_lk_c::checkNextActionFromButton() { } if (mEquipItem == dItemNo_SKULL_HAMMER_e) { direction = getDirectionFromShapeAngle(); - if (mStickDistance > 0.05f && - ((direction == DIR_LEFT || direction == DIR_RIGHT))) - { + if (mStickDistance > 0.05f && (direction == DIR_LEFT || direction == DIR_RIGHT)) { return procHammerSideSwing_init(); } else { return procHammerFrontSwingReady_init(); @@ -4948,11 +4937,9 @@ BOOL daPy_lk_c::changeLandProc(f32 param_1) { } else { bVar2 = false; } - if ((((!checkGrabAnime() && mStickDistance > 0.5f) && direction != DIR_BACKWARD) && - (!bVar2)) && - (((mCurProc == daPyProc_CUT_EX_MJ_e || (m3688.y - current.pos.y >= 300.0f)) && - ((!checkNoResetFlg1(daPyFlg1_UNK8000000) && - getDirectionFromCurrentAngle() == DIR_FORWARD))))) + if (!checkGrabAnime() && mStickDistance > 0.5f && direction != DIR_BACKWARD && !bVar2 && + (mCurProc == daPyProc_CUT_EX_MJ_e || (m3688.y - current.pos.y) >= 300.0f) && + !checkNoResetFlg1(daPyFlg1_UNK8000000) && getDirectionFromCurrentAngle() == DIR_FORWARD) { voiceStart(7); if (direction == DIR_FORWARD) { @@ -6465,7 +6452,7 @@ BOOL daPy_lk_c::procCrouchDefenseSlip_init() { m35A8 = m_HIO->mNockback.m.field_0x24; m35AC = m_HIO->mNockback.m.field_0x28; dVar5 = cM_rnd(); - mProcVar6.m3570 = (dVar5 < 0.2f) ? 1 : 0; + mProcVar6.m3570 = dVar5 < 0.2f ? 1 : 0; } else { setSingleMoveAnime(ANM_DIFENCEA, m_HIO->mGuard.m.field_0x4, m_HIO->mGuard.m.field_0x8, m_HIO->mGuard.m.field_0x0, m_HIO->mGuard.m.field_0xC); dVar5 = damage_vec->absXZ(); @@ -8260,7 +8247,7 @@ BOOL daPy_lk_c::procGuardSlip_init() { m35A4 = m_HIO->mNockback.m.field_0x20; m35A8 = m_HIO->mNockback.m.field_0x24; m35AC = m_HIO->mNockback.m.field_0x28; - mProcVar6.m3570 = (cM_rnd() < 0.2f) ? 1 : 0; + mProcVar6.m3570 = cM_rnd() < 0.2f ? 1 : 0; } else { setSingleMoveAnime(dVar5, m_HIO->mGuard.m.field_0x4, m_HIO->mGuard.m.field_0x8, m_HIO->mGuard.m.field_0x0, m_HIO->mGuard.m.field_0xC); mNormalSpeed = (m_HIO->mGuard.m.field_0x14 * damage_vec->absXZ()) + m_HIO->mGuard.m.field_0x10; @@ -9083,7 +9070,7 @@ void daPy_lk_c::setNeckAngle() { s16 r25_3; s16 r24_2 = cM_atan2s(-spAC.y, spAC.absXZ()); r24_4 = (r24_2 - m3564.x); - s16 r25_2 = (cM_atan2s(spAC.x, spAC.z)); + s16 r25_2 = cM_atan2s(spAC.x, spAC.z); r25_3 = r25_2; r25_3 -= m34DE; r25_3 = r25_3 - m3564.y; @@ -13026,7 +13013,7 @@ BOOL daPy_lk_c::setThrowDamage(cXyz* r4, s16 r5, f32 f30, f32 f31, int r6) { /* 80128B50-80128C10 .text setPlayerPosAndAngle__9daPy_lk_cFP4cXyzs */ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, s16 param_2) { - if (!(dComIfGp_event_runCheck()) && dComIfGp_getScopeType() != 1) { + if (!dComIfGp_event_runCheck() && dComIfGp_getScopeType() != 1) { return; } if (param_1 != NULL) { @@ -13045,7 +13032,7 @@ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, s16 param_2) { /* 80128C10-80128CE4 .text setPlayerPosAndAngle__9daPy_lk_cFP4cXyzP5csXyz */ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, csXyz* param_2) { - if (!(dComIfGp_event_runCheck())) { + if (!dComIfGp_event_runCheck()) { return; } if (param_1 != NULL) { diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp index e6441a101..7045d8510 100644 --- a/src/d/d_attention.cpp +++ b/src/d/d_attention.cpp @@ -1176,7 +1176,7 @@ void dAttLook_c::init() { /* 8009FE58-8009FE74 .text proc__10dAttLook_cFv */ void dAttLook_c::proc() { - mLookTargetID = mRequestActorID ; + mLookTargetID = mRequestActorID; mRequestActorID = fpcM_ERROR_PROCESS_ID_e; field_0x4 = 3; } diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index e223d609d..b047dd9d6 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -2424,7 +2424,7 @@ f32 dCamera_c::getWaterSurfaceHeight(cXyz* param_0) { dBgS_CamGndChk_Wtr gndchk; gndchk.SetPos(&spF8); - f32 gnd_y = dComIfG_Bgsp()->GroundCross(&gndchk) ; + f32 gnd_y = dComIfG_Bgsp()->GroundCross(&gndchk); if (gnd_y + 5.0f > param_0->y) { var_f31 = gnd_y + 5.0f; diff --git a/src/d/d_file_error.cpp b/src/d/d_file_error.cpp index 684d43c9d..e100415b6 100644 --- a/src/d/d_file_error.cpp +++ b/src/d/d_file_error.cpp @@ -123,7 +123,7 @@ void dFile_error_c::closeMessage() { /* 8017E068-8017E228 .text resizeMsgBoard__13dFile_error_cFi */ void dFile_error_c::resizeMsgBoard(int param_1) { J2DPane *pane_2_pane = msgPanes[2].pane; - f32 pane_2_height = pane_2_pane->mBounds.f.y - pane_2_pane->mBounds.i.y; + f32 pane_2_height = pane_2_pane->mBounds.getHeight(); f32 scale = ((pane_2_height / VERSION_SELECT(9.0f, 9.0f, 12.0f, 12.0f)) * (f32) param_1) / pane_2_height; fopMsgM_paneScaleY(&msgPanes[2], scale); diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index 19cf9eb8a..054baa841 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -539,7 +539,6 @@ void dMenu_Option_c::stickMove(u8 param_1) { } m858[1].mUserArea = 6; mDoAud_seStart(JA_SE_ITM_MENU_OPT_SW); - ; break; } case 3: { @@ -665,29 +664,29 @@ void dMenu_Option_c::noteSet() { msg_entry = msgGet.getMesgEntry(head_p); msgDataProc.dataInit(); - msgDataProc.bmgData = mesg; + msgDataProc.setBmgData((char*)mesg); msgDataProc.setOutMessage(mD38, mD3C, mD40, mD44); - msgDataProc.font[0] = mD2C; - msgDataProc.font[1] = mD30; - msgDataProc.charSpace = ((J2DTextBox*)m740[0].pane)->getCharSpace(); - msgDataProc.rubyCharSpace = ((J2DTextBox*)m740[1].pane)->getCharSpace(); - msgDataProc.lineSpace = ((J2DTextBox*)m740[0].pane)->getLineSpace(); - msgDataProc.mesgEntry = &msg_entry; - msgDataProc.fontSize = f31; - msgDataProc.rubyFontSize = f30; - msgDataProc.lineWidth = 0x1D0; - msgDataProc.centerLineWidth = 0x1D0; - msgDataProc.sendSpeed = 2; - msgDataProc.spaceTimer = 0; + msgDataProc.setFont(mD2C); + msgDataProc.setRubyFont(mD30); + msgDataProc.setCharSpace(((J2DTextBox*)m740[0].pane)->getCharSpace()); + msgDataProc.setRubyCharSpace(((J2DTextBox*)m740[1].pane)->getCharSpace()); + msgDataProc.setLineSpace(((J2DTextBox*)m740[0].pane)->getLineSpace()); + msgDataProc.setMesgEntry(&msg_entry); + msgDataProc.setFontSize(f31); + msgDataProc.setRubyFontSize(f30); + msgDataProc.setLineWidth(0x1D0); + msgDataProc.setCenterLineWidth(0x1D0); + msgDataProc.setSendSpeed(2); + msgDataProc.setSpaceTimer(0); msgDataProc.field_0x299 = 1; - msgDataProc.spaceFlag = 0; + msgDataProc.setSpaceFlagOff(); msgDataProc.stringLength(); msgDataProc.stringShift(); msgDataProc.iconIdxRefresh(); - s16 r26 = msgDataProc.lineCount; - msgDataProc.lineCount = 0; + s16 r26 = msgDataProc.getLineCount(); + msgDataProc.setLineCount(0); msgDataProc.stringSet(); f32 f30_2 = (m740[0].pane->getHeight() - f31 - (f32)r26 * ((J2DTextBox*)m740[0].pane)->getLineSpace()) / 2.0f; ((J2DTextBox*)m740[0].pane)->shiftSet(0.0f, f30_2); @@ -698,7 +697,7 @@ void dMenu_Option_c::noteSet() { int r31 = ((J2DTextBox*)m740[0].pane)->getLineSpace() / 2.0f; for (int i = 0; i < 0xf; i++) { - u32 r6 = msgDataProc.field_0x281[i]; + u8 r6 = msgDataProc.getIconNum(i); if (r6 == 0xFF) { continue; } @@ -708,8 +707,8 @@ void dMenu_Option_c::noteSet() { if (r6 == 0x16) { continue; } - m0B0[i].mPosTopLeft.x = (f32)msgDataProc.field_0x168[i]; - m0B0[i].mPosTopLeft.y = f30_2 + (f32)(int)(msgDataProc.field_0x1A4[i] * 2 * r31); + m0B0[i].mPosTopLeft.x = (f32)msgDataProc.getIconPosX(i); + m0B0[i].mPosTopLeft.y = f30_2 + (f32)(msgDataProc.getIconPosY(i) * 2 * r31); m0B0[i].mPosTopLeftOrig.y = (f32)r6; fopMsgM_outFontSet((J2DPicture*)m0B0[i].pane, &m0B0[i].mUserArea, 0xFF, r6); diff --git a/src/d/d_mesg.cpp b/src/d/d_mesg.cpp index 212e64aa8..3011b2032 100644 --- a/src/d/d_mesg.cpp +++ b/src/d/d_mesg.cpp @@ -194,7 +194,7 @@ void dMesg_tSequenceProcessor::initialize(int param_1) { } } - mesgControl->setNowFontSize(mesgControl->getInitFontSize()) ; + mesgControl->setNowFontSize(mesgControl->getInitFontSize()); mesgControl->setCharCode(0); mesgControl->setHeaderOff(); mesgControl->setCode16FgOff(); @@ -768,7 +768,7 @@ dMesg_tMeasureProcessor::dMesg_tMeasureProcessor(JMessage::TControl* param_1, in field_0x54 = 0; linemax = 4; dMesg_tControl* mesgControl = (dMesg_tControl*)getControl(); - mesgControl->setNowFontSize(mesgControl->getInitFontSize()) ; + mesgControl->setNowFontSize(mesgControl->getInitFontSize()); mesgControl->setLineCount(0); mesgControl->setCharCode(0); mesgControl->setHeaderOff(); diff --git a/src/d/d_message.cpp b/src/d/d_message.cpp index d193f951f..3758fa149 100644 --- a/src/d/d_message.cpp +++ b/src/d/d_message.cpp @@ -61,10 +61,10 @@ void dMsg2_value_init(sub_msg2_class* i_Msg, u8 i_index) { const u32 color = colorTable[i_Msg->colorNo]; int i = i_index; - int temp_r5 = i_Msg->msgDataProc[i].getRGradAlpha(); - int temp_r6 = i_Msg->msgDataProc[i].getRCharAlpha(); - int var_r30 = i_Msg->msgDataProc[i].getGradAlpha(); - int var_r29 = i_Msg->msgDataProc[i].getCharAlpha(); + int temp_r5 = i_Msg->msgDataProc[i].getCharAlpha(); + int temp_r6 = i_Msg->msgDataProc[i].getGradAlpha(); + int var_r30 = i_Msg->msgDataProc[i].getRCharAlpha(); + int var_r29 = i_Msg->msgDataProc[i].getRGradAlpha(); u32 temp_a = color | temp_r5; u32 temp_b = color | temp_r6; @@ -407,7 +407,7 @@ void dMsg2_messageOut(sub_msg2_class* i_Msg, u8 i_index, int i_aimLine) { for (int i = 0; i < 8; i++) { u8 var_r30 = i_Msg->msgDataProc[i_index].getIconNum(i); - u32 var_r29 = i_Msg->msgDataProc[i_index].get_0x220(i); + u32 var_r29 = i_Msg->msgDataProc[i_index].getIconColor(i); if (var_r30 != 0xFF && bbuttonTimer[i][i_index] == -1) { JKRHeap* heap = mDoExt_setCurrentHeap(i_Msg->Heap); @@ -428,8 +428,8 @@ void dMsg2_messageOut(sub_msg2_class* i_Msg, u8 i_index, int i_aimLine) { /* 801E8668-801E86E8 .text dMsg2_yose_select__FP14sub_msg2_classUc */ void dMsg2_yose_select(sub_msg2_class* i_Msg, u8 i_index) { i_Msg->msgDataProc[i_index].count = i_Msg->msgDataProc[i_index].stringLength(); - i_Msg->field_0xecc[i_index] = i_Msg->msgDataProc[i_index].lineCount; - i_Msg->msgDataProc[i_index].lineCount = 0; + i_Msg->field_0xecc[i_index] = i_Msg->msgDataProc[i_index].getLineCount(); + i_Msg->msgDataProc[i_index].setLineCount(0); i_Msg->msgDataProc[i_index].stringShift(); dMsg2_textPosition(i_Msg, i_index); } @@ -605,9 +605,9 @@ void dMsg2_setCharAlpha(sub_msg2_class* i_Msg, u8 i_index) { } i_Msg->msgDataProc[var_r31].setCharAlpha(i_Msg->field_0xedf[0][var_r31], - i_Msg->field_0xedf[1][var_r31], - i_Msg->field_0xedf[2][var_r31], - i_Msg->field_0xedf[3][var_r31]); + i_Msg->field_0xedf[1][var_r31], + i_Msg->field_0xedf[2][var_r31], + i_Msg->field_0xedf[3][var_r31]); } /* 801E9054-801E9108 .text dMsg2_messageShow__FP14sub_msg2_class */ @@ -931,7 +931,7 @@ void dDlst_2DMSG2_c::draw() { } /* 801E9CDC-801E9FC4 .text outFontDraw__14dDlst_2DMSG2_cFv */ -// NONMATCHING - a lot wrong here +// NONMATCHING - regswap void dDlst_2DMSG2_c::outFontDraw() { J2DPane* ppane = ((sub_msg2_class*)actorP)->field_0xd00[0].pane; f32 var_f31 = ppane->getGlbBounds().i.y; @@ -939,32 +939,35 @@ void dDlst_2DMSG2_c::outFontDraw() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 8; j++) { - sub_msg2_class* msg = (sub_msg2_class*)actorP; - u8 iconNum = msg->msgDataProc[i].field_0x281[j]; - fopMsgM_msgDataProc_c* dataProc = msg->msgDataProc; - int temp_r6 = dataProc->field_0x168[i]; - int temp_r4 = dataProc->field_0x1A4[i]; - int var_r22 = dataProc->field_0x1E0[i]; + u8 iconNum = actorP->msgDataProc[i].getIconNum(j); + int posX = actorP->msgDataProc[i].getIconPosX(j); + int posY = actorP->msgDataProc[i].getIconPosY(j); + int scale = actorP->msgDataProc[i].getIconScale(j); if (iconNum != 0xFF) { - J2DTextBox* pJVar3 = (J2DTextBox*)msg->text_pane[i].pane; - int sp10 = (f32)temp_r6 + pJVar3->getGlbBounds().i.x; + u8 r14; + J2DTextBox* scrn = (J2DTextBox*)actorP->text_pane[i].pane; + int r18 = (f32)posX + scrn->getGlbBounds().i.x; - if (var_r22 > msg->field_0xeb4) { - if (msg->field_0xecc[i] > 1) { - temp_r4 = ((msg->field_0xeb0 * (3 - temp_r4)) + pJVar3->getGlbBounds().i.y); + int r17; + if (scale > actorP->field_0xeb4) { + if (actorP->field_0xecc[i] > 1) { + f32 temp = (actorP->field_0xeb0 * (DEMO_SELECT(2, 3) - posY)); + r17 = temp + scrn->getGlbBounds().i.y - (f32)(int)(scale / 2); } else { - temp_r4 = (msg->field_0xeb0 + pJVar3->getGlbBounds().i.y); + f32 temp = actorP->field_0xeb0 * DEMO_SELECT(3, 4); + r17 = (temp + scrn->getGlbBounds().i.y - (f32)(int)(scale / 2)); } } else { - temp_r4 = ((msg->field_0xeb0 * (3 - msg->field_0xecc[i])) + pJVar3->getGlbBounds().i.y); + f32 temp = (actorP->field_0xeb0 * (DEMO_SELECT(2, 3) - actorP->field_0xecc[i] + (posY * 2))); + r17 = (temp + scrn->getGlbBounds().i.y); } - u8 sp20 = msg->field_0xeac; - JKRHeap* heap = mDoExt_setCurrentHeap(msg->Heap); + r14 = actorP->field_0xeac; + JKRHeap* heap = mDoExt_setCurrentHeap(actorP->Heap); - if ((f32)temp_r4 > var_f31 && (f32)temp_r4 < var_f30 - (f32)var_r22) { - fopMsgM_outFontDraw(bbutton_icon[j][i], bbutton_kage[j][i], sp10, temp_r4, var_r22, &bbuttonTimer[j][i], sp20, iconNum); + if ((f32)r17 > var_f31 && (f32)r17 < var_f30 - (f32)scale) { + fopMsgM_outFontDraw(bbutton_icon[j][i], bbutton_kage[j][i], r18, r17, scale, &bbuttonTimer[j][i], r14, iconNum); } mDoExt_setCurrentHeap(heap); diff --git a/src/d/d_message_paper.cpp b/src/d/d_message_paper.cpp index 8dd735061..fd5e3373b 100644 --- a/src/d/d_message_paper.cpp +++ b/src/d/d_message_paper.cpp @@ -7,6 +7,7 @@ #include "d/d_message_paper.h" #include "f_op/f_op_msg.h" +#if VERSION < VERSION_PAL /* 801EB128-801EB420 .text setDummyTexture__10dmsg3_3d_cFv */ void dmsg3_3d_c::setDummyTexture() { /* Nonmatching */ @@ -256,3 +257,69 @@ static BOOL dMsg3_Delete(sub_msg3_class*) { static cPhs_State dMsg3_Create(msg_class*) { /* Nonmatching */ } +static msg_method_class l_dMsg3_Method = { + (process_method_func)dMsg3_Create, + (process_method_func)dMsg3_Delete, + (process_method_func)dMsg3_Execute, + (process_method_func)dMsg3_IsDelete, + (process_method_func)dMsg3_Draw +}; + +msg_process_profile_definition g_profile_MSG3 = { + /* Layer ID */ fpcLy_CURRENT_e, + /* List ID */ 12, + /* List Prio */ fpcPi_CURRENT_e, + /* Proc Name */ fpcNm_MSG3_e, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(sub_msg3_class), + /* Size Other */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopMsg_Method, + /* Draw Prio */ fpcDwPi_MSG3_e, + /* Msg SubMtd */ &l_dMsg3_Method, +}; +#endif + +#if VERSION == VERSION_PAL +static BOOL dMessage_Paper_Draw(dMessage_Paper_c*) { + /* Nonmatching */ +} + +static BOOL dMessage_Paper_Execute(dMessage_Paper_c*) { + /* Nonmatching */ +} + +static BOOL dMessage_Paper_IsDelete(dMessage_Paper_c*) { + /* Nonmatching */ +} + +static BOOL dMessage_Paper_Delete(dMessage_Paper_c*) { + /* Nonmatching */ +} + +static cPhs_State dMessage_Paper_Create(msg_class*) { + /* Nonmatching */ +} + +static msg_method_class l_dMessage_Paper_Method = { + (process_method_func)dMessage_Paper_Create, + (process_method_func)dMessage_Paper_Delete, + (process_method_func)dMessage_Paper_Execute, + (process_method_func)dMessage_Paper_IsDelete, + (process_method_func)dMessage_Paper_Draw +}; + +msg_process_profile_definition g_profile_MSG3 = { + /* Layer ID */ fpcLy_CURRENT_e, + /* List ID */ 12, + /* List Prio */ fpcPi_CURRENT_e, + /* Proc Name */ fpcNm_MSG3_e, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dMessage_Paper_c), + /* Size Other */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopMsg_Method, + /* Draw Prio */ fpcDwPi_MSG3_e, + /* Msg SubMtd */ &l_dMessage_Paper_Method, +}; +#endif diff --git a/src/d/d_meter.cpp b/src/d/d_meter.cpp index b20a14704..e56215210 100644 --- a/src/d/d_meter.cpp +++ b/src/d/d_meter.cpp @@ -897,67 +897,73 @@ void dMeter_rupy_num(char* buf, s16 num) { sprintf(buf, "rupy_num_%02d.bti", num); } +#if VERSION < VERSION_PAL +#define TEXNAME(a) a ".bti" +#else +#define TEXNAME(a) a +#endif + /* 801F0320-801F0378 .text dMeter_actionTex__Fs */ const char* dMeter_actionTex(s16 id) { static const struct { u8 id; const char* filename; } act[] = { - {dActStts_BLANK_e, "ba_shiraberu.bti"}, - {dActStts_LOOK_e, "ba_miru.bti"}, - {dActStts_SPEAK_e, "ba_syaberu.bti"}, - {dActStts_CHARTS_e, "ba_shiraberu.bti"}, - {dActStts_LIFT_e, "ba_motu.bti"}, - {dActStts_CLIMB_e, "ba_noru.bti"}, - {dActStts_LET_GO_e, "ba_oriru.bti"}, - {dActStts_RETURN_e, "ba_modoru.bti"}, - {dActStts_PUT_AWAY_e, "ba_shimau.bti"}, - {dActStts_DROP_e, "ba_oku.bti"}, - {dActStts_CHECK_e, "ba_chekku.bti"}, - {dActStts_OPEN_e, "ba_hiraku.bti"}, - {dActStts_ATTACK_e, "ba_attack.bti"}, - {dActStts_ba_osu, "ba_osu.bti"}, - {dActStts_THROW_e, "ba_nageru.bti"}, - {dActStts_CROUCH_e, "ba_shagamu.bti"}, - {dActStts_SIDLE_e, "ba_harituku.bti"}, - {dActStts_GRAB_e, "ba_tukamu.bti"}, - {dActStts_JUMP_e, "ba_jump.bti"}, - {dActStts_STOP_e, "ba_tomeru.bti"}, - {dActStts_ba_haru, "ba_haru.bti"}, - {dActStts_ba_tatamu, "ba_tatamu.bti"}, - {dActStts_LET_GO_ROPE_e, "ba_hanasu.bti"}, - {dActStts_CHOOSE_e, "ba_kettei.bti"}, - {dActStts_ba_kogu, "ba_kogu.bti"}, - {dActStts_NEXT_e, "ba_tugihe.bti"}, - {dActStts_PARRY_e, "ba_sake.bti"}, - {dActStts_PICK_UP_e, "ba_motu_buki.bti"}, - {dActStts_GET_IN_SHIP_e, "ba_noru_hune.bti"}, - {dActStts_GET_OUT_SHIP_e, "ba_oriru_hune.bti"}, - {dActStts_ba_save, "ba_save.bti"}, - {dActStts_ba_option, "ba_option.bti"}, - {dActStts_TAKE_PHOTO_e, "ba_toru.bti"}, - {dActStts_INFO_e, "ba_setumei.bti"}, - {dActStts_SWAP_MODES_e, "ba_kirikae.bti"}, - {dActStts_FLY_e, "ba_tobu.bti"}, - {dActStts_CALL_e, "ba_yobu.bti"}, - {dActStts_BID_e, "ba_hoshii.bti"}, - {dActStts_READ_e, "ba_yomu.bti"}, - {dActStts_CANCEL_e, "ba_yameru.bti"}, - {dActStts_ba_kakudai, "ba_kakudai.bti"}, - {dActStts_ba_hikaku, "ba_hikaku.bti"}, - {dActStts_ba_zoom01, "ba_zoom01.bti"}, - {dActStts_ba_zoom02, "ba_zoom02.bti"}, - {dActStts_CRUISE_e, "ba_susumu.bti"}, - {dActStts_ba_nageru__dupe_2D, "ba_nageru.bti"}, - {dActStts_ba_motu__dupe_2E, "ba_motu.bti"}, - {dActStts_SWING_e, "ba_huru.bti"}, - {dActStts_SEA_CHART_e, "ba_kaizuhe.bti"}, - {dActStts_ba_sake__dupe_31, "ba_sake.bti"}, - {dActStts_ba_modoru__dupe_32, "ba_modoru.bti"}, - {dActStts_ba_save__dupe_33, "ba_save.bti"}, - {dActStts_ba_save__dupe_34, "ba_save.bti"}, + {dActStts_BLANK_e, TEXNAME("ba_shiraberu")}, + {dActStts_LOOK_e, TEXNAME("ba_miru")}, + {dActStts_SPEAK_e, TEXNAME("ba_syaberu")}, + {dActStts_CHARTS_e, TEXNAME("ba_shiraberu")}, + {dActStts_LIFT_e, TEXNAME("ba_motu")}, + {dActStts_CLIMB_e, TEXNAME("ba_noru")}, + {dActStts_LET_GO_e, TEXNAME("ba_oriru")}, + {dActStts_RETURN_e, TEXNAME("ba_modoru")}, + {dActStts_PUT_AWAY_e, TEXNAME("ba_shimau")}, + {dActStts_DROP_e, TEXNAME("ba_oku")}, + {dActStts_CHECK_e, TEXNAME("ba_chekku")}, + {dActStts_OPEN_e, TEXNAME("ba_hiraku")}, + {dActStts_ATTACK_e, TEXNAME("ba_attack")}, + {dActStts_ba_osu, TEXNAME("ba_osu")}, + {dActStts_THROW_e, TEXNAME("ba_nageru")}, + {dActStts_CROUCH_e, TEXNAME("ba_shagamu")}, + {dActStts_SIDLE_e, TEXNAME("ba_harituku")}, + {dActStts_GRAB_e, TEXNAME("ba_tukamu")}, + {dActStts_JUMP_e, TEXNAME("ba_jump")}, + {dActStts_STOP_e, TEXNAME("ba_tomeru")}, + {dActStts_ba_haru, TEXNAME("ba_haru")}, + {dActStts_ba_tatamu, TEXNAME("ba_tatamu")}, + {dActStts_LET_GO_ROPE_e, TEXNAME("ba_hanasu")}, + {dActStts_CHOOSE_e, TEXNAME("ba_kettei")}, + {dActStts_ba_kogu, TEXNAME("ba_kogu")}, + {dActStts_NEXT_e, TEXNAME("ba_tugihe")}, + {dActStts_PARRY_e, TEXNAME("ba_sake")}, + {dActStts_PICK_UP_e, TEXNAME("ba_motu_buki")}, + {dActStts_GET_IN_SHIP_e, TEXNAME("ba_noru_hune")}, + {dActStts_GET_OUT_SHIP_e, TEXNAME("ba_oriru_hune")}, + {dActStts_ba_save, TEXNAME("ba_save")}, + {dActStts_ba_option, TEXNAME("ba_option")}, + {dActStts_TAKE_PHOTO_e, TEXNAME("ba_toru")}, + {dActStts_INFO_e, TEXNAME("ba_setumei")}, + {dActStts_SWAP_MODES_e, TEXNAME("ba_kirikae")}, + {dActStts_FLY_e, TEXNAME("ba_tobu")}, + {dActStts_CALL_e, TEXNAME("ba_yobu")}, + {dActStts_BID_e, TEXNAME("ba_hoshii")}, + {dActStts_READ_e, TEXNAME("ba_yomu")}, + {dActStts_CANCEL_e, TEXNAME("ba_yameru")}, + {dActStts_ba_kakudai, TEXNAME("ba_kakudai")}, + {dActStts_ba_hikaku, TEXNAME("ba_hikaku")}, + {dActStts_ba_zoom01, TEXNAME("ba_zoom01")}, + {dActStts_ba_zoom02, TEXNAME("ba_zoom02")}, + {dActStts_CRUISE_e, TEXNAME("ba_susumu")}, + {dActStts_ba_nageru__dupe_2D, TEXNAME("ba_nageru")}, + {dActStts_ba_motu__dupe_2E, TEXNAME("ba_motu")}, + {dActStts_SWING_e, TEXNAME("ba_huru")}, + {dActStts_SEA_CHART_e, TEXNAME("ba_kaizuhe")}, + {dActStts_ba_sake__dupe_31, TEXNAME("ba_sake")}, + {dActStts_ba_modoru__dupe_32, TEXNAME("ba_modoru")}, + {dActStts_ba_save__dupe_33, TEXNAME("ba_save")}, + {dActStts_ba_save__dupe_34, TEXNAME("ba_save")}, {dActStts_sword_01, "sword_01.bti"}, - {dActStts_DEFEND_e, "ba_husegu.bti"}, + {dActStts_DEFEND_e, TEXNAME("ba_husegu")}, {dActStts_boko_stick, "boko_stick.bti"}, {dActStts_hatchet, "hatchet.bti"}, {dActStts_iron_club, "iron_club.bti"}, @@ -965,7 +971,7 @@ const char* dMeter_actionTex(s16 id) { {dActStts_spear, "spear.bti"}, {dActStts_spear__dupe_3C, "spear.bti"}, {dActStts_bow_01, "bow_01.bti"}, - {dActStts_HIDDEN_e, "ba_modoru.bti"}, + {dActStts_HIDDEN_e, TEXNAME("ba_modoru")}, }; int found = 0; for (int i = 0; i < ARRAY_SIZE(act); i++) { @@ -974,7 +980,29 @@ const char* dMeter_actionTex(s16 id) { break; } } +#if VERSION < VERSION_PAL return act[found].filename; +#else + if ( + found == dActStts_sword_01 || + found == dActStts_boko_stick || + found == dActStts_hatchet || + found == dActStts_iron_club || + found == dActStts_longsword || + found == dActStts_spear || + found == dActStts_spear__dupe_3C || + found == dActStts_bow_01 + ) { + return act[found].filename; + } + static char tex_name[20]; + char suffix[16]; + sprintf(suffix, "_%d.bti", dComIfGs_getPalLanguage()); + const char* filename = act[found].filename; + strcpy(tex_name, filename); + strcat(tex_name, suffix); + return tex_name; +#endif } /* 801F0378-801F041C .text dMeter_weponTex__Fv */ @@ -1423,18 +1451,14 @@ void dMeter_LifeMove(sub_meter_class* i_Meter, bool bForce) { /* 801F17F0-801F1A48 .text dMeter_BattleLifeMove__FP15sub_meter_classb */ void dMeter_BattleLifeMove(sub_meter_class* i_Meter, bool param_2) { /* Nonmatching */ - const char* pFilename; - f32 dVar4; - static u8 point = 0; - dVar4 = (i_Meter->mHeart[1].mPosCenterOrig.x - i_Meter->mHeart[0].mPosCenterOrig.x); + f32 dVar4 = (i_Meter->mHeart[1].mPosCenterOrig.x - i_Meter->mHeart[0].mPosCenterOrig.x); if (point != daNpc_Ji1_c::game_life_point || !param_2) { for (s32 i = 0; i < 20; i++) { point = daNpc_Ji1_c::game_life_point; if (i == 1 || i == 2) { - i_Meter->mHeart[i].mPosCenter.x = (s32)(g_meterHIO.field_0x4c + i_Meter->mHeart[i].mPosCenterOrig.x) * (g_meterHIO.field_0x58 * dVar4); - i_Meter->mHeartShadow[i].mPosCenter.x = - (s32)(g_meterHIO.field_0x4c + i_Meter->mHeartShadow[i].mPosCenterOrig.x) * (g_meterHIO.field_0x58 * dVar4); + i_Meter->mHeart[i].mPosCenter.x = (g_meterHIO.field_0x58 * dVar4 * (f32)i) + i_Meter->mHeart[0].mPosCenterOrig.x + g_meterHIO.field_0x4c; + i_Meter->mHeartShadow[i].mPosCenter.x = (g_meterHIO.field_0x58 * dVar4 * (f32)i) + i_Meter->mHeartShadow[i].mPosCenterOrig.x + g_meterHIO.field_0x4c; i_Meter->mHeart[i].mPosCenter.y = i_Meter->mHeart[i].mPosCenterOrig.y + g_meterHIO.field_0x5c; i_Meter->mHeartShadow[i].mPosCenter.y = i_Meter->mHeartShadow[i].mPosCenterOrig.y + g_meterHIO.field_0x5c; } else if (i == 0) { @@ -1444,8 +1468,7 @@ void dMeter_BattleLifeMove(sub_meter_class* i_Meter, bool param_2) { i_Meter->mHeartShadow[i].mPosCenter.y = i_Meter->mHeartShadow[i].mPosCenterOrig.y + g_meterHIO.field_0x5c; } if (i < point) { - pFilename = dMeter_heartTex(0); - dMeter_heartChangeTexture(i_Meter, pFilename, i); + dMeter_heartChangeTexture(i_Meter, dMeter_heartTex(0), i); if (i == point - 1) { dMeter_setNowHeartScaleXY2(&i_Meter->mHeart[i]); dMeter_setNowHeartScaleXY2(&i_Meter->mHeartShadow[i]); @@ -1454,8 +1477,7 @@ void dMeter_BattleLifeMove(sub_meter_class* i_Meter, bool param_2) { dMeter_setHeartScaleXY2(&i_Meter->mHeartShadow[i], 0); } } else if (i < 3) { - pFilename = dMeter_heartTex(4); - dMeter_heartChangeTexture(i_Meter, pFilename, i); + dMeter_heartChangeTexture(i_Meter, dMeter_heartTex(4), i); dMeter_setHeartScaleXY2(&i_Meter->mHeart[i], 4); dMeter_setHeartScaleXY2(&i_Meter->mHeartShadow[i], 4); } else { @@ -1657,24 +1679,35 @@ void dMeter_weponDraw(sub_meter_class* i_Meter) { /* 801F2408-801F2688 .text dMeter_weponChange__FP15sub_meter_class */ void dMeter_weponChange(sub_meter_class* i_Meter) { - const char* pFilename; - JKRArchive* pArc; +#if VERSION == VERSION_DEMO + if (i_Meter->field_0x301a == dComIfGp_getAStatus()) { + return; + } +#endif - if (i_Meter->field_0x2828.mUserArea != 0) { - if (i_Meter->field_0x301a == 0x25) { +#if VERSION > VERSION_DEMO + if (i_Meter->field_0x2828.mUserArea != 0) +#endif + { + if (i_Meter->field_0x301a == dActStts_BID_e) { i_Meter->field_0x1d00.mUserArea = 0; ((J2DPicture*)i_Meter->field_0x1d00.pane)->setWhite(0xFFFFFFFF); ((J2DPicture*)i_Meter->field_0x1d00.pane)->setBlack(0x0000FF00); } if (dComIfGp_getAStatus() != dActStts_BLANK_e) { if (dComIfGp_getAStatus() == dActStts_sword_01) { - pArc = dComIfGp_getItemIconArchive(); - pFilename = dMeter_weponTex(); - JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive* pArc = dComIfGp_getItemIconArchive(); + JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', dMeter_weponTex(), pArc); +#if VERSION <= VERSION_JPN + DCFlushRangeNoSync(i_Meter->actionTex[0], 0xc00); +#else DCStoreRangeNoSync(i_Meter->actionTex[0], 0xc00); +#endif ((J2DPicture*)i_Meter->field_0x2828.pane)->changeTexture(i_Meter->actionTex[0], 0); ((J2DPicture*)i_Meter->field_0x2860.pane)->changeTexture(i_Meter->actionTex[0], 0); +#if VERSION > VERSION_DEMO ((J2DPicture*)i_Meter->field_0x1d00.pane)->changeTexture(i_Meter->actionTex[0], 0); +#endif } else if (dComIfGp_getAStatus() == dActStts_boko_stick || dComIfGp_getAStatus() == dActStts_hatchet || dComIfGp_getAStatus() == dActStts_iron_club || @@ -1682,34 +1715,53 @@ void dMeter_weponChange(sub_meter_class* i_Meter) { dComIfGp_getAStatus() == dActStts_spear || dComIfGp_getAStatus() == dActStts_spear__dupe_3C) { - pArc = dComIfGp_getItemIconArchive(); - pFilename = dMeter_actionTex(dComIfGp_getAStatus()); - JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive* pArc = dComIfGp_getItemIconArchive(); + JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', dMeter_actionTex(dComIfGp_getAStatus()), pArc); +#if VERSION <= VERSION_JPN + DCFlushRangeNoSync(i_Meter->actionTex[0], 0xc00); +#else DCStoreRangeNoSync(i_Meter->actionTex[0], 0xc00); +#endif ((J2DPicture*)i_Meter->field_0x2828.pane)->changeTexture(i_Meter->actionTex[0], 0); ((J2DPicture*)i_Meter->field_0x2860.pane)->changeTexture(i_Meter->actionTex[0], 0); +#if VERSION > VERSION_DEMO ((J2DPicture*)i_Meter->field_0x1d00.pane)->changeTexture(i_Meter->actionTex[0], 0); +#endif } else { + JKRArchive* pArc; if (dComIfGp_getAStatus() == dActStts_RETURN_e || dComIfGp_getAStatus() == dActStts_RETURN_e) { pArc = dComIfGp_getMenuArchive(); } else { pArc = dComIfGp_getActionIconArchive(); } - pFilename = dMeter_actionTex(dComIfGp_getAStatus()); - JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive::readTypeResource(i_Meter->actionTex[0], 0xc00, 'TIMG', dMeter_actionTex(dComIfGp_getAStatus()), pArc); +#if VERSION <= VERSION_JPN + DCFlushRangeNoSync(i_Meter->actionTex[0], 0xc00); +#else DCStoreRangeNoSync(i_Meter->actionTex[0], 0xc00); +#endif +#if VERSION > VERSION_DEMO ((J2DPicture*)i_Meter->field_0x2828.pane)->changeTexture(i_Meter->actionTex[0], 0); ((J2DPicture*)i_Meter->field_0x2860.pane)->changeTexture(i_Meter->actionTex[0], 0); +#endif ((J2DPicture*)i_Meter->field_0x1d00.pane)->changeTexture(i_Meter->actionTex[0], 0); } } +#if VERSION > VERSION_DEMO i_Meter->field_0x2828.mUserArea = 0; +#endif } + +#if VERSION == VERSION_DEMO + i_Meter->field_0x28d0.mUserArea = 1; + i_Meter->field_0x301a = dComIfGp_getAStatus(); +#else if (i_Meter->field_0x301a != dComIfGp_getAStatus()) { i_Meter->field_0x2828.mUserArea = 1; i_Meter->field_0x28d0.mUserArea = 1; i_Meter->field_0x301a = dComIfGp_getAStatus(); } +#endif } /* 801F2688-801F2818 .text dMeter_weponAnime__FP15sub_meter_class */ @@ -2019,8 +2071,7 @@ void dMeter_actionInit(sub_meter_class* i_Meter) { i_Meter->field_0x301b = 0; dComIfGp_setDoStatus(dActStts_BLANK_e); JKRArchive* pArc = dComIfGp_getActionIconArchive(); - const char* pFilename = dMeter_actionTex(dActStts_BLANK_e); - JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', dMeter_actionTex(dActStts_BLANK_e), pArc); DCStoreRangeNoSync(i_Meter->actionTex[1], 0xc00); ((J2DPicture*)i_Meter->field_0x27b8.pane)->changeTexture(i_Meter->actionTex[1], 0); ((J2DPicture*)i_Meter->field_0x27f0.pane)->changeTexture(i_Meter->actionTex[1], 0); @@ -2127,7 +2178,6 @@ void dMeter_actionForce(sub_meter_class* i_Meter) { /* 801F3B60-801F3CFC .text dMeter_actionChange__FP15sub_meter_class */ void dMeter_actionChange(sub_meter_class* i_Meter) { - const char* pFilename; JKRArchive* pArc; if (i_Meter->field_0x27b8.mUserArea != 0) { @@ -2140,8 +2190,7 @@ void dMeter_actionChange(sub_meter_class* i_Meter) { { if (dComIfGp_getDoStatus() == dActStts_bow_01) { pArc = dComIfGp_getItemIconArchive(); - pFilename = dMeter_actionTex(dComIfGp_getDoStatus()); - JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', dMeter_actionTex(dComIfGp_getDoStatus()), pArc); DCStoreRangeNoSync(i_Meter->actionTex[1], 0xc00); ((J2DPicture*)i_Meter->field_0x27b8.pane)->changeTexture(i_Meter->actionTex[1], 0); ((J2DPicture*)i_Meter->field_0x27f0.pane)->changeTexture(i_Meter->actionTex[1], 0); @@ -2151,8 +2200,7 @@ void dMeter_actionChange(sub_meter_class* i_Meter) { } else { pArc = dComIfGp_getActionIconArchive(); } - pFilename = dMeter_actionTex(dComIfGp_getDoStatus()); - JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', pFilename, pArc); + JKRArchive::readTypeResource(i_Meter->actionTex[1], 0xc00, 'TIMG', dMeter_actionTex(dComIfGp_getDoStatus()), pArc); DCStoreRangeNoSync(i_Meter->actionTex[1], 0xc00); ((J2DPicture*)i_Meter->field_0x1d38.pane)->changeTexture(i_Meter->actionTex[1], 0); i_Meter->field_0x1e18[0].mUserArea = 1; @@ -2882,24 +2930,23 @@ void dMeter_xyItemChange(sub_meter_class* i_Meter, int i_itemBtn) { } else { dMeter_PaneShow(&i_Meter->field_0x2080[i_itemBtn]); dMeter_PaneShow(&i_Meter->field_0x2128[i_itemBtn]); - u8 uVar2 = dComIfGp_getSelectItem(i_itemBtn); - u8 var_r4 = uVar2; - if (uVar2 == dItemNo_MAGIC_ARROW_e) { + u8 itemNo = dComIfGp_getSelectItem(i_itemBtn); + if (itemNo == dItemNo_MAGIC_ARROW_e) { i_Meter->field_0x2320[i_itemBtn].pane->show(); i_Meter->field_0x23c8[i_itemBtn].pane->show(); i_Meter->field_0x2470[i_itemBtn].pane->hide(); - var_r4 = dItemNo_BOW_e; - } else if (uVar2 == dItemNo_LIGHT_ARROW_e) { + itemNo = dItemNo_BOW_e; + } else if (itemNo == dItemNo_LIGHT_ARROW_e) { i_Meter->field_0x2320[i_itemBtn].pane->show(); i_Meter->field_0x23c8[i_itemBtn].pane->show(); i_Meter->field_0x2470[i_itemBtn].pane->show(); - var_r4 = dItemNo_BOW_e; + itemNo = dItemNo_BOW_e; } - if (var_r4 == dItemNo_MAGIC_ARROW_e || var_r4 == dItemNo_LIGHT_ARROW_e) { - var_r4 = dItemNo_BOW_e; + if (itemNo == dItemNo_MAGIC_ARROW_e || itemNo == dItemNo_LIGHT_ARROW_e) { + itemNo = dItemNo_BOW_e; } pArc = dComIfGp_getItemIconArchive(); - pFilename = dItem_data::getTexture(var_r4); + pFilename = dItem_data::getTexture(itemNo); JKRArchive::readTypeResource(i_Meter->xyIconTex[i_itemBtn], 0xc00, 'TIMG', pFilename, pArc); DCStoreRangeNoSync(i_Meter->xyIconTex[i_itemBtn], 0xc00); ((J2DPicture*)i_Meter->field_0x2080[i_itemBtn].pane)->changeTexture(i_Meter->xyIconTex[i_itemBtn], 0); @@ -3169,14 +3216,12 @@ void dMeter_xyTrans(sub_meter_class* i_Meter) { static f32 nowY = 0.0f; if ((i_Meter->mStatusFlags & dMtrStts_UNK4000_e) || ((i_Meter->mStatusFlags & dMtrStts_UNK40_e) && dComIfGp_event_checkHind(1)) || (i_Meter->mStatusFlags & dMtrStts_UNK100_e) || - (((dMenu_flag() && (dMenu_getPushMenuButton() == 2 || (dMenu_getMenuStatus() == 2 && dMenu_getPushMenuButton() == 0))) || - (i_Meter->mStatusFlags & dMtrStts_UNK800000_e)) || - (((((i_Meter->mStatusFlags & dMtrStts_UNK20_e) && (dStage_stagInfo_GetUpButton(dComIfGp_getStageStagInfo()) == 1)) || - (i_Meter->mStatusFlags & dMtrStts_UNK80_e)) || - (((i_Meter->mStatusFlags & dMtrStts_UNK100000_e) || (i_Meter->mStatusFlags & dMtrStts_UNK200000_e)) || - ((i_Meter->mStatusFlags & dMtrStts_UNK20000_e) || ((i_Meter->mStatusFlags & dMtrStts_UNK40000_e) || (i_Meter->mStatusFlags & dMtrStts_UNK80000_e)))) - ) || - (i_Meter->mStatusFlags & dMtrStts_UNK400000_e)))) + (dMenu_flag() && (dMenu_getPushMenuButton() == 2 || (dMenu_getMenuStatus() == 2 && dMenu_getPushMenuButton() == 0))) || + (i_Meter->mStatusFlags & dMtrStts_UNK800000_e) || + ((i_Meter->mStatusFlags & dMtrStts_UNK20_e) && (dStage_stagInfo_GetUpButton(dComIfGp_getStageStagInfo()) == 1)) || + (i_Meter->mStatusFlags & dMtrStts_UNK80_e) || (i_Meter->mStatusFlags & dMtrStts_UNK100000_e) || (i_Meter->mStatusFlags & dMtrStts_UNK200000_e) || + (i_Meter->mStatusFlags & dMtrStts_UNK20000_e) || (i_Meter->mStatusFlags & dMtrStts_UNK40000_e) || (i_Meter->mStatusFlags & dMtrStts_UNK80000_e) || + (i_Meter->mStatusFlags & dMtrStts_UNK400000_e)) { if (moveStatus != 1) { moveFlag = 1; @@ -4259,8 +4304,8 @@ void dMeter_magicTransScale(sub_meter_class* i_Meter, f32 param_2, f32 param_3, (param_3 + (i_Meter->field_0x11a0.mPosCenterOrig.y + (param_4 * (i_Meter->field_0x0f38[i].mPosCenterOrig.y - i_Meter->field_0x11a0.mPosCenterOrig.y)))); i_Meter->field_0x0f38[i].mPosCenter.x -= ((i_Meter->field_0x0f38[i].mSizeOrig.x * param_4) / 2.0f); - i_Meter->field_0x0f38[i].mSize.x = (param_4 * (i_Meter->field_0x0f38[i].pane->mBounds.f.x - i_Meter->field_0x0f38[i].pane->mBounds.i.x)); - i_Meter->field_0x0f38[i].mSize.y = (param_4 * (i_Meter->field_0x0f38[i].pane->mBounds.f.y - i_Meter->field_0x0f38[i].pane->mBounds.i.y)); + i_Meter->field_0x0f38[i].mSize.x = (param_4 * (i_Meter->field_0x0f38[i].pane->mBounds.getWidth())); + i_Meter->field_0x0f38[i].mSize.y = (param_4 * (i_Meter->field_0x0f38[i].pane->mBounds.getHeight())); i_Meter->field_0x0f38[i].mPosCenter.x += (i_Meter->field_0x0f38[i].mSize.x / 2.0f); fopMsgM_cposMove(&i_Meter->field_0x0f38[i]); i_Meter->field_0x0f38[i].mSize.x = i_Meter->field_0x0f38[i].mSizeOrig.x; @@ -5153,9 +5198,10 @@ void dMeter_keyMove(sub_meter_class* i_Meter) { /* 801FD09C-801FD104 .text dMeter_compassRotate__FP18fopMsgM_pane_classP18fopMsgM_pane_classf */ void dMeter_compassRotate(fopMsgM_pane_class* param_1, fopMsgM_pane_class* param_2, f32 param_3) { - /* Nonmatching */ - f32 offsetX = (param_1->pane->mBounds.f.x - param_1->pane->mBounds.i.x) / 2.0f; - f32 offsetY = (param_1->pane->mBounds.f.y - param_1->pane->mBounds.i.y) / 2.0f; + f32 offsetX = param_1->pane->mBounds.getWidth(); + offsetX /= 2.0f; + f32 offsetY = param_1->pane->mBounds.getHeight(); + offsetY /= 2.0f; param_1->pane->rotate(offsetX, offsetY, ROTATE_Z, param_3); } @@ -5262,11 +5308,11 @@ void dMeter_compassDirOpen(sub_meter_class* i_Meter) { f32 dVar5; f32 fVar1; - fVar1 = i_Meter->field_0x13d0.pane->mBounds.f.x - i_Meter->field_0x13d0.pane->mBounds.i.x; - dVar9 = ((i_Meter->field_0x1948.pane->mBounds.f.x - i_Meter->field_0x1948.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - dVar8 = ((i_Meter->field_0x1948.pane->mBounds.f.y - i_Meter->field_0x1948.pane->mBounds.i.y) / 2.0f); - dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.f.x - i_Meter->field_0x16a8.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.f.y - i_Meter->field_0x16a8.pane->mBounds.i.y) / 2.0f); + fVar1 = i_Meter->field_0x13d0.pane->mBounds.getWidth(); + dVar9 = ((i_Meter->field_0x1948.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + dVar8 = ((i_Meter->field_0x1948.pane->mBounds.getHeight()) / 2.0f); + dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.getHeight()) / 2.0f); i_Meter->field_0x12f0.mUserArea++; if (i_Meter->field_0x12f0.mUserArea >= 5) { i_Meter->field_0x12f0.mUserArea = 5; @@ -5294,11 +5340,11 @@ void dMeter_compassDirOpen(sub_meter_class* i_Meter) { /* 801FD6C8-801FD8C0 .text dMeter_compassWindOpen__FP15sub_meter_class */ void dMeter_compassWindOpen(sub_meter_class* i_Meter) { /* Nonmatching */ - f32 fVar1 = i_Meter->field_0x13d0.pane->mBounds.f.x - i_Meter->field_0x13d0.pane->mBounds.i.x; - f32 dVar9 = ((i_Meter->field_0x1948.pane->mBounds.f.x - i_Meter->field_0x1948.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - f32 dVar8 = ((i_Meter->field_0x1948.pane->mBounds.f.y - i_Meter->field_0x1948.pane->mBounds.i.y) / 2.0f); - f32 dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.f.x - i_Meter->field_0x16a8.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - f32 dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.f.y - i_Meter->field_0x16a8.pane->mBounds.i.y) / 2.0f); + f32 fVar1 = i_Meter->field_0x13d0.pane->mBounds.getWidth(); + f32 dVar9 = ((i_Meter->field_0x1948.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + f32 dVar8 = ((i_Meter->field_0x1948.pane->mBounds.getHeight()) / 2.0f); + f32 dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + f32 dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.getHeight()) / 2.0f); i_Meter->field_0x12f0.mUserArea++; f32 dVar5; if (i_Meter->field_0x12f0.mUserArea >= 10) { @@ -5331,11 +5377,11 @@ void dMeter_compassWindClose(sub_meter_class* i_Meter) { f32 dVar7; f32 fVar1; - fVar1 = i_Meter->field_0x13d0.pane->mBounds.f.x - i_Meter->field_0x13d0.pane->mBounds.i.x; - dVar11 = ((i_Meter->field_0x1948.pane->mBounds.f.x - i_Meter->field_0x1948.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - dVar10 = ((i_Meter->field_0x1948.pane->mBounds.f.y - i_Meter->field_0x1948.pane->mBounds.i.y) / 2.0f); - dVar9 = ((i_Meter->field_0x16a8.pane->mBounds.f.x - i_Meter->field_0x16a8.pane->mBounds.i.x) / 2.0f - (fVar1 / 2.0f)); - dVar8 = ((i_Meter->field_0x16a8.pane->mBounds.f.y - i_Meter->field_0x16a8.pane->mBounds.i.y) / 2.0f); + fVar1 = i_Meter->field_0x13d0.pane->mBounds.getWidth(); + dVar11 = ((i_Meter->field_0x1948.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + dVar10 = ((i_Meter->field_0x1948.pane->mBounds.getHeight()) / 2.0f); + dVar9 = ((i_Meter->field_0x16a8.pane->mBounds.getWidth()) / 2.0f - (fVar1 / 2.0f)); + dVar8 = ((i_Meter->field_0x16a8.pane->mBounds.getHeight()) / 2.0f); i_Meter->field_0x12f0.mUserArea--; if (dComIfGs_getTime() >= 90.0f && dComIfGs_getTime() < 270.0f) { sVar6 = 0; @@ -5380,11 +5426,11 @@ void dMeter_compassDirClose(sub_meter_class* i_Meter) { f32 dVar5; f32 fVar2; - fVar2 = i_Meter->field_0x13d0.pane->mBounds.f.x - i_Meter->field_0x13d0.pane->mBounds.i.x; - dVar9 = ((i_Meter->field_0x1948.pane->mBounds.f.x - i_Meter->field_0x1948.pane->mBounds.i.x) / 2.0f - (fVar2 / 2.0f)); - dVar8 = ((i_Meter->field_0x1948.pane->mBounds.f.y - i_Meter->field_0x1948.pane->mBounds.i.y) / 2.0f); - dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.f.x - i_Meter->field_0x16a8.pane->mBounds.i.x) / 2.0f - (fVar2 / 2.0f)); - dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.f.y - i_Meter->field_0x16a8.pane->mBounds.i.y) / 2.0f); + fVar2 = i_Meter->field_0x13d0.pane->mBounds.getWidth(); + dVar9 = ((i_Meter->field_0x1948.pane->mBounds.getWidth()) / 2.0f - (fVar2 / 2.0f)); + dVar8 = ((i_Meter->field_0x1948.pane->mBounds.getHeight()) / 2.0f); + dVar7 = ((i_Meter->field_0x16a8.pane->mBounds.getWidth()) / 2.0f - (fVar2 / 2.0f)); + dVar6 = ((i_Meter->field_0x16a8.pane->mBounds.getHeight()) / 2.0f); i_Meter->field_0x12f0.mUserArea = i_Meter->field_0x12f0.mUserArea + -1; if (i_Meter->field_0x12f0.mUserArea <= 0) { dMeter_compassValueInit(i_Meter); @@ -5456,11 +5502,11 @@ void dMeter_compassValueInit(sub_meter_class* i_Meter) { } i_Meter->field_0x12f0.mUserArea = 0; i_Meter->field_0x302a = 0; - dVar8 = i_Meter->field_0x13d0.pane->mBounds.f.x - i_Meter->field_0x13d0.pane->mBounds.i.x; - dVar7 = i_Meter->field_0x1948.pane->mBounds.f.x - i_Meter->field_0x1948.pane->mBounds.i.x; - dVar6 = i_Meter->field_0x1948.pane->mBounds.f.y - i_Meter->field_0x1948.pane->mBounds.i.y; - dVar5 = i_Meter->field_0x16a8.pane->mBounds.f.x - i_Meter->field_0x16a8.pane->mBounds.i.x; - dVar4 = i_Meter->field_0x16a8.pane->mBounds.f.y - i_Meter->field_0x16a8.pane->mBounds.i.y; + dVar8 = i_Meter->field_0x13d0.pane->mBounds.getWidth(); + dVar7 = i_Meter->field_0x1948.pane->mBounds.getWidth(); + dVar6 = i_Meter->field_0x1948.pane->mBounds.getHeight(); + dVar5 = i_Meter->field_0x16a8.pane->mBounds.getWidth(); + dVar4 = i_Meter->field_0x16a8.pane->mBounds.getHeight(); x = -(i_Meter->field_0x1948.mPosTopLeftOrig.x + i_Meter->field_0x1948.mSizeOrig.x); fopMsgM_paneTrans(&i_Meter->field_0x12f0, x, 0.0f); fopMsgM_paneTrans(&i_Meter->field_0x1948, x, 0.0f); @@ -6087,7 +6133,7 @@ void dMeter_arwMove(sub_meter_class* i_Meter) { /* 801FFEB0-801FFF30 .text dMeter_moveItemInit__FP15sub_meter_class */ void dMeter_moveItemInit(sub_meter_class* i_Meter) { JKRArchive* archive = dComIfGp_getItemIconArchive(); - const char* pFilename = dItem_data::getTexture(0x27); + const char* pFilename = dItem_data::getTexture(dItemNo_BOW_e); JKRArchive::readTypeResource(i_Meter->moveIconTex[0], 0xc00, 'TIMG', pFilename, archive); DCStoreRangeNoSync(i_Meter->moveIconTex[0], 0xc00); moveItemPane = new J2DPicture(i_Meter->moveIconTex[0]); @@ -6371,32 +6417,39 @@ void dMeter_swimDraw(sub_meter_class* i_Meter) { /* 80200E18-802011D0 .text dMeter_swimOpenProc__FP15sub_meter_class */ void dMeter_swimOpenProc(sub_meter_class* i_Meter) { - /* Nonmatching */ int r31 = ++i_Meter->field_0x2c88.mUserArea; static f32 dist_buf = 0.0f; - f32 dVar3; + f32 alpha; + f32 scale; if (r31 == 1) { fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, 0.1f); fopMsgM_setNowAlphaZero(&i_Meter->field_0x2dd8); } else if (r31 < 5) { - dVar3 = fopMsgM_valueIncrease(4, r31 - 1, 0); - fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, (dVar3 * 0.9f) + 0.1f); - fopMsgM_setNowAlpha(&i_Meter->field_0x2dd8, dVar3); + alpha = fopMsgM_valueIncrease(4, r31 - 1, 0); + scale = (alpha * 0.9f) + 0.1f; + fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, scale); + fopMsgM_setNowAlpha(&i_Meter->field_0x2dd8, alpha); } else if (r31 < 8) { - dVar3 = fopMsgM_valueIncrease(3, r31 - 5, 0); - fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, 1.0f - (dVar3 * 0.3f)); + alpha = fopMsgM_valueIncrease(3, r31 - 5, 0); + scale = 1.0f - (alpha * 0.3f); + fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, scale); } else if (r31 < 10) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 8, 0); - fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, (dVar3 * 0.3f) + 0.7f); - } else if (r31 < 0xc) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 10, 0); - fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, 1.0f - (dVar3 * 0.100000024f)); - } else if (r31 < 0xe) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 0xc, 0); - fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, (dVar3 * 0.100000024f) + 0.9f); - } else if (r31 == 0xe) { + alpha = fopMsgM_valueIncrease(2, r31 - 8, 0); + scale = (alpha * 0.3f) + 0.7f; + fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, scale); + } else if (r31 < 12) { + alpha = fopMsgM_valueIncrease(2, r31 - 10, 0); + scale = 1.0f - (alpha * 0.100000024f); + fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, scale); + } else if (r31 < 14) { + alpha = fopMsgM_valueIncrease(2, r31 - 12, 0); + scale = (alpha * 0.100000024f) + 0.9f; + fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, scale); + } else if (r31 == 14) { fopMsgM_paneScaleXY(&i_Meter->field_0x2dd8, 1.0f); } + + f32 transY; if (r31 == 1) { dMeter_swimPaneTransY(i_Meter, -130.0f); fopMsgM_paneScaleY(&i_Meter->field_0x2cf8, 1.0f); @@ -6408,26 +6461,31 @@ void dMeter_swimOpenProc(sub_meter_class* i_Meter) { fopMsgM_setNowAlphaZero(&i_Meter->field_0x2d30); fopMsgM_setNowAlphaZero(&i_Meter->field_0x2c88); } else if (r31 <= 5) { - dVar3 = fopMsgM_valueIncrease(4, r31 - 1, 0); - dMeter_swimPaneTransY(i_Meter, -((1.0f - dVar3) * 130.0f)); - dMeter_swimPaneAlpha(i_Meter, dVar3); + alpha = fopMsgM_valueIncrease(4, r31 - 1, 0); + transY = -((1.0f - alpha) * 130.0f); + dMeter_swimPaneTransY(i_Meter, transY); + dMeter_swimPaneAlpha(i_Meter, alpha); } else if (r31 <= 8) { - dVar3 = fopMsgM_valueIncrease(3, r31 - 5, 0); - dMeter_swimPaneTransY(i_Meter, (-25.0f - (1.0f - dVar3) * -25.0f)); + alpha = fopMsgM_valueIncrease(3, r31 - 5, 0); + transY = -25.0f - (1.0f - alpha) * -25.0f; + dMeter_swimPaneTransY(i_Meter, transY); dMeter_swimPaneShow(i_Meter); } else if (r31 <= 0xa) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 8, 0); - dMeter_swimPaneTransY(i_Meter, -((1.0f - dVar3) * 25.0f)); + alpha = fopMsgM_valueIncrease(2, r31 - 8, 0); + transY = -((1.0f - alpha) * 25.0f); + dMeter_swimPaneTransY(i_Meter, transY); dMeter_swimPaneShow(i_Meter); - } else if (r31 <= 0xc) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 10, 0); - dMeter_swimPaneTransY(i_Meter, (-6.0f - (1.0f - dVar3) * -6.0f)); + } else if (r31 <= 12) { + alpha = fopMsgM_valueIncrease(2, r31 - 10, 0); + transY = -6.0f - (1.0f - alpha) * -6.0f; + dMeter_swimPaneTransY(i_Meter, transY); dMeter_swimPaneShow(i_Meter); - } else if (r31 < 0xe) { - dVar3 = fopMsgM_valueIncrease(2, r31 - 0xc, 0); - dMeter_swimPaneTransY(i_Meter, -((1.0f - dVar3) * 6.0f)); + } else if (r31 < 14) { + alpha = fopMsgM_valueIncrease(2, r31 - 12, 0); + transY = -((1.0f - alpha) * 6.0f); + dMeter_swimPaneTransY(i_Meter, transY); dMeter_swimPaneShow(i_Meter); - } else if (r31 == 0xe) { + } else if (r31 == 14) { dMeter_swimPaneTransY(i_Meter, 0); fopMsgM_paneScaleY(&i_Meter->field_0x2cf8, 1.0f); fopMsgM_paneScaleY(&i_Meter->field_0x2da0, 1.0f); @@ -7410,41 +7468,41 @@ static cPhs_State dMeter_Create(msg_class* i_this) { #endif i_Meter->heap = fopMsgM_createExpHeap(0x2a819); - JUT_ASSERT(13475, i_Meter->heap != NULL); + JUT_ASSERT(VERSION_SELECT(13172, 13354, 13475, 13474), i_Meter->heap != NULL); JKRHeap* oldHeap = mDoExt_setCurrentHeap(i_Meter->heap); sMainParts1 = new MyScreen(); - JUT_ASSERT(13480, sMainParts1 != NULL); + JUT_ASSERT(VERSION_SELECT(13177, 13359, 13480, 13479), sMainParts1 != NULL); sMainParts1->set("main_parts1.blo", dComIfGp_getMenuArchive()); sMainParts2 = new J2DScreen(); - JUT_ASSERT(13484, sMainParts2 != NULL); + JUT_ASSERT(VERSION_SELECT(13181, 13363, 13484, 13483), sMainParts2 != NULL); sMainParts2->set("main_parts2.blo", dComIfGp_getMenuArchive()); sMainParts3 = new J2DScreen(); - JUT_ASSERT(13488, sMainParts3 != NULL); + JUT_ASSERT(VERSION_SELECT(13185, 13367, 13488, 13487), sMainParts3 != NULL); sMainParts3->set("main_parts3.blo", dComIfGp_getMenuArchive()); sChoiceRoad = new J2DScreen(); - JUT_ASSERT(13492, sChoiceRoad != NULL); + JUT_ASSERT(VERSION_SELECT(13189, 13371, 13492, 13491), sChoiceRoad != NULL); sChoiceRoad->set("choice_road.blo", dComIfGp_getMenuArchive()); for (s32 i = 0; i < 3; i++) { i_Meter->actionTex[i] = (ResTIMG*)i_Meter->heap->alloc(0xc00, 0x20); - JUT_ASSERT(13497, i_Meter->actionTex[i] != NULL); + JUT_ASSERT(VERSION_SELECT(13194, 13376, 13497, 13496), i_Meter->actionTex[i] != NULL); i_Meter->xyIconTex[i] = (ResTIMG*)i_Meter->heap->alloc(0xc00, 0x20); - JUT_ASSERT(13499, i_Meter->xyIconTex[i] != NULL); + JUT_ASSERT(VERSION_SELECT(13196, 13378, 13499, 13498), i_Meter->xyIconTex[i] != NULL); } for (s32 i = 0; i < 2; i++) { if (i == 0) { i_Meter->moveIconTex[i] = (ResTIMG*)i_Meter->heap->alloc(0xc00, 0x20); - JUT_ASSERT(13506, i_Meter->moveIconTex[i] != NULL); + JUT_ASSERT(VERSION_SELECT(13203, 13385, 13506, 13505), i_Meter->moveIconTex[i] != NULL); } i_Meter->arrowTex[i] = (ResTIMG*)i_Meter->heap->alloc(0xc00, 0x20); - JUT_ASSERT(13509, i_Meter->arrowTex[i] != NULL); + JUT_ASSERT(VERSION_SELECT(13206, 13388, 13509, 13508), i_Meter->arrowTex[i] != NULL); } #if VERSION == VERSION_DEMO @@ -7461,8 +7519,8 @@ static cPhs_State dMeter_Create(msg_class* i_this) { dComIfGp_setRStatusForce(dActStts_BLANK_e); dComIfGp_setAStatusForce(dActStts_BLANK_e); - g_meterHIO.mNo = mDoHIO_createChild("通常画面表示", &g_meterHIO); // "Normal Screen Display" - g_menuHIO.mNo = mDoHIO_createChild("メニュー画面", &g_menuHIO); // "Menu Screen" + g_meterHIO.mNo = mDoHIO_createChild("通常画面表示", &g_meterHIO); // "Normal Screen Display" + g_menuHIO.mNo = mDoHIO_createChild("メニュー画面", &g_menuHIO); // "Menu Screen" g_msgHIO.mNo = mDoHIO_createChild("Message(会話)", &g_msgHIO); // "Message (Talk)" g_messageHIO.mNo = mDoHIO_createChild("Message(看板)", &g_messageHIO); // "Message (Sign)" g_meter_mapHIO.mNo = mDoHIO_createChild("マップ2", &g_meter_mapHIO); // "Map 2" diff --git a/src/d/d_msg.cpp b/src/d/d_msg.cpp index 487a728ef..a3dad21b1 100644 --- a/src/d/d_msg.cpp +++ b/src/d/d_msg.cpp @@ -70,58 +70,47 @@ JKRHeap* dMsg_getAgbWorkArea() { /* 8020A628-8020A950 .text draw__13dDlst_2DMSG_cFv */ void dDlst_2DMSG_c::draw() { - /* Nonmatching */ - fopMsgM_msgDataProc_c* temp_r3; - sub_msg_class* pmVar3; - sub_msg_class* pmVar2; - sub_msg_class* pmVar4; - f32 dVar3; - - pmVar4 = field_0x4; + sub_msg_class* msg = mpMsg; J2DOrthoGraph* graf = dComIfGp_getCurrentGrafPort(); graf->setPort(); sScreen->draw(0.0f, 0.0f, graf); if (sScreen2 != NULL) { sScreen2->draw(0.0f, 0.0f, graf); } + outFontDraw(); - if (pmVar4->mStatus == fopMsgStts_SELECT_YOKO_e) { - pmVar3 = field_0x4; - temp_r3 = &pmVar3->mMsgDataProc; - temp_r3->selectArrow(arrowPane, temp_r3->field_0x26C, temp_r3->field_0x270, temp_r3->field_0x278, temp_r3->field_0x274); - } else if (pmVar4->mStatus == fopMsgStts_INPUT_e) { - pmVar2 = field_0x4; - if ((pmVar2->mMesgEntry.mTextboxType == 0) || (pmVar2->mMesgEntry.mTextboxType == 10)) { - f32 f1 = (numberPane[0]->mBounds.f.x - numberPane[0]->mBounds.i.x); - dVar3 = (f1 + numberPane[0]->getCharSpace()); - if (pmVar4->mMsgNo == 0x1cfa) { - f32 f3; - f32 f4; - f4 = maskPane->mBounds.f.y - maskPane->mBounds.i.y; - f3 = maskPane->mBounds.f.x - maskPane->mBounds.i.x; - maskPane->draw(pmVar2->m10EC + (dVar3 * (2 - pmVar4->mSelectNum)), pmVar2->m10F0, f3, f4, false, false, false); - f4 = numberPane[2]->mBounds.f.x - numberPane[2]->mBounds.i.x; - f3 = numberPane[2]->mBounds.f.y - numberPane[2]->mBounds.i.y; - numberPane[2]->draw(field_0x4->m10EC, field_0x4->m10F0 + f3, f4, HBIND_CENTER); - f4 = numberPane[1]->mBounds.f.x - numberPane[1]->mBounds.i.x; - f3 = numberPane[1]->mBounds.f.y - numberPane[1]->mBounds.i.y; - numberPane[1]->draw((field_0x4->m10EC + dVar3), field_0x4->m10F0 + f3, f4, HBIND_CENTER); - f4 = numberPane[0]->mBounds.f.x - numberPane[0]->mBounds.i.x; - f3 = numberPane[0]->mBounds.f.y - numberPane[0]->mBounds.i.y; - numberPane[0]->draw(field_0x4->m10EC + (dVar3 * 2.0f), field_0x4->m10F0 + f3, f4, HBIND_CENTER); + + if (msg->mStatus == fopMsgStts_SELECT_YOKO_e) { + mpMsg->mMsgDataProc.selectArrow(arrowPane); + } else if (msg->mStatus == fopMsgStts_INPUT_e) { + if ((mpMsg->mMesgEntry.mTextboxType == 0) || (mpMsg->mMesgEntry.mTextboxType == 10)) { + f32 dVar3 = (numberPane[0]->mBounds.getWidth() + numberPane[0]->getCharSpace()); + f32 f3; + f32 f4; + if (msg->mMsgNo == 0x1cfa) { + f4 = maskPane->mBounds.getHeight(); + f3 = maskPane->mBounds.getWidth(); + maskPane->draw(mpMsg->m10EC + (dVar3 * (2 - msg->mSelectNum)), mpMsg->m10F0, f3, f4, false, false, false); + f4 = numberPane[2]->mBounds.getWidth(); + f3 = numberPane[2]->mBounds.getHeight(); + numberPane[2]->draw(mpMsg->m10EC, mpMsg->m10F0 + f3, f4, HBIND_CENTER); + f4 = numberPane[1]->mBounds.getWidth(); + f3 = numberPane[1]->mBounds.getHeight(); + numberPane[1]->draw((mpMsg->m10EC + dVar3), mpMsg->m10F0 + f3, f4, HBIND_CENTER); + f4 = numberPane[0]->mBounds.getWidth(); + f3 = numberPane[0]->mBounds.getHeight(); + numberPane[0]->draw(mpMsg->m10EC + (dVar3 * 2.0f), mpMsg->m10F0 + f3, f4, HBIND_CENTER); } else { numberPane[2]->hide(); - f32 f3; - f32 f4; - f4 = maskPane->mBounds.f.y - maskPane->mBounds.i.y; - f3 = maskPane->mBounds.f.x - maskPane->mBounds.i.x; - maskPane->draw(field_0x4->m10EC + (dVar3 * (1 - pmVar4->mSelectNum)), field_0x4->m10F0, f3, f4, false, false, false); - f4 = numberPane[1]->mBounds.f.x - numberPane[1]->mBounds.i.x; - f3 = numberPane[1]->mBounds.f.y - numberPane[1]->mBounds.i.y; - numberPane[1]->draw(field_0x4->m10EC, field_0x4->m10F0 + f3, f4, HBIND_CENTER); - f4 = numberPane[0]->mBounds.f.x - numberPane[0]->mBounds.i.x; - f3 = numberPane[0]->mBounds.f.y - numberPane[0]->mBounds.i.y; - numberPane[0]->draw((field_0x4->m10EC + dVar3), field_0x4->m10F0 + f3, f4, HBIND_CENTER); + f4 = maskPane->mBounds.getHeight(); + f3 = maskPane->mBounds.getWidth(); + maskPane->draw(mpMsg->m10EC + (dVar3 * (1 - msg->mSelectNum)), mpMsg->m10F0, f3, f4, false, false, false); + f4 = numberPane[1]->mBounds.getWidth(); + f3 = numberPane[1]->mBounds.getHeight(); + numberPane[1]->draw(mpMsg->m10EC, mpMsg->m10F0 + f3, f4, HBIND_CENTER); + f4 = numberPane[0]->mBounds.getWidth(); + f3 = numberPane[0]->mBounds.getHeight(); + numberPane[0]->draw((mpMsg->m10EC + dVar3), mpMsg->m10F0 + f3, f4, HBIND_CENTER); } } } @@ -129,85 +118,67 @@ void dDlst_2DMSG_c::draw() { /* 8020A950-8020AC40 .text outFontDraw__13dDlst_2DMSG_cFv */ void dDlst_2DMSG_c::outFontDraw() { - /* Nonmatching */ - f32 dVar1; - u8 cVar2; - J2DScreen* pJVar3; - sub_msg_class* pdVar4; - int uVar4; - int uVar5; - u8 bVar6; - int iVar7; - f32 local_38; - f32 local_30; - f32 local_28; - - for (s32 i = 0; i < 8; i++) { - pdVar4 = (sub_msg_class*)this->field_0x4; - cVar2 = pdVar4->mMsgDataProc.field_0x281[i]; - fopMsgM_msgDataProc_c* tmp = &pdVar4->mMsgDataProc; - iVar7 = tmp->field_0x1A4[i]; - uVar5 = tmp->field_0x1E0[i]; - if (cVar2 != 0xFF && cVar2 != 0x14 && cVar2 != 0x15 && cVar2 != 0x16) { - pJVar3 = (J2DScreen*)pdVar4->m0544[0].pane; - local_38 = tmp->field_0x168[i]; - dVar1 = local_38; - int r5 = dVar1 + pJVar3->mBounds.i.x; - if (pdVar4->mMesgEntry.mTextboxType == 5) { - local_30 = g_msgHIO.field_0x5e * iVar7; - local_38 = pdVar4->m1104 * (2 - pdVar4->m1108); - iVar7 = (int)((local_30) + (local_38) + pJVar3->mBounds.i.y); - bVar6 = pdVar4->m0544[0].mNowAlpha; - } else if (pdVar4->mMesgEntry.mTextboxType == 0xe) { - local_28 = g_msgHIO.field_0x5e * iVar7; - local_30 = pdVar4->m1104; - iVar7 = (int)((local_28) + (local_30) + pJVar3->mBounds.i.y); - bVar6 = pdVar4->m0544[0].mNowAlpha; + /* Nonmatching - regswap */ + for (int i = 0; i < 8; i++) { + u8 iconNum = mpMsg->mMsgDataProc.getIconNum(i); + int posX = mpMsg->mMsgDataProc.getIconPosX(i); + int posY = mpMsg->mMsgDataProc.getIconPosY(i); + int scale = mpMsg->mMsgDataProc.getIconScale(i); + if (iconNum != 0xFF && iconNum != 0x14 && iconNum != 0x15 && iconNum != 0x16) { + J2DScreen* scrn = (J2DScreen*)mpMsg->m0544[0].pane; + int r5 = posX + scrn->mBounds.i.x; + int r6; + u8 alpha; + if (mpMsg->mMesgEntry.mTextboxType == 5) { + f32 local_30 = g_msgHIO.field_0x5e * posY; + f32 local_38 = mpMsg->m1104 * (2 - mpMsg->m1108); + r6 = (int)(local_38 + scrn->mBounds.i.y + local_30); + alpha = mpMsg->m0544[0].mNowAlpha; + } else if (mpMsg->mMesgEntry.mTextboxType == 0xe) { + f32 local_28 = g_msgHIO.field_0x5e * posY; + f32 local_30 = mpMsg->m1104; + r6 = (int)(local_30 + scrn->mBounds.i.y + local_28); + alpha = mpMsg->m0544[0].mNowAlpha; } else { - if (pdVar4->m110C > (int)uVar5) { - if (pdVar4->m1108 > 1) { - uVar4 = uVar5 - pdVar4->m110C; - iVar7 = ((int)uVar4 / 2) + (int)(((pdVar4->m1104 * ((3 - iVar7) - (pdVar4->m1108 + -2))) + pJVar3->mBounds.i.y) - (int)(uVar5 / 2)); + if (scale > mpMsg->m110C) { + if (mpMsg->m1108 > 1) { + int temp1 = (mpMsg->m1104 * ((3 - posY) - (mpMsg->m1108 + -2))); + r6 = ((scale - mpMsg->m110C) / 2) + (int)((temp1 + scrn->mBounds.i.y) - (f32)(int)(scale / 2)); } else { - iVar7 = (int)(((pdVar4->m1104 << 2) + pJVar3->mBounds.i.y) - (int)(uVar5 / 2)); + r6 = (int)(((mpMsg->m1104 << 2) + scrn->mBounds.i.y) - (f32)(int)(scale / 2)); } } else { - local_28 = g_msgHIO.field_0x5e * iVar7; - local_30 = pdVar4->m1104 * (3 - pdVar4->m1108); - iVar7 = (int)((local_28) + (local_30) + pJVar3->mBounds.i.y); + f32 local_28 = g_msgHIO.field_0x5e * posY; + f32 local_30 = mpMsg->m1104 * (3 - mpMsg->m1108); + r6 = (int)(local_30 + scrn->mBounds.i.y + local_28); } - bVar6 = pdVar4->m0544[0].mNowAlpha; + alpha = mpMsg->m0544[0].mNowAlpha; } - fopMsgM_outFontDraw(button_icon[i], button_kage[i], r5, iVar7, uVar5, &buttonTimer[i], bVar6, cVar2); + fopMsgM_outFontDraw(button_icon[i], button_kage[i], r5, r6, scale, &buttonTimer[i], alpha, iconNum); } } } /* 8020AC40-8020AD3C .text draw__14dDlst_2Dtact_cFv */ void dDlst_2Dtact_c::draw() { - /* Nonmatching */ - J2DOrthoGraph* graf = dComIfGp_getCurrentGrafPort(); - GXBool uVar1; - f32 temp_r27; - f32 temp_r28; - f32 temp_r29; - f32 temp_r30; + int r27 = 0; + int r28 = 0; + int r26 = 372; + int r25 = 72; + J2DOrthoGraph* graf = dComIfGp_getCurrentGrafPort(); graf->setPort(); - temp_r30 = -9.0f; - temp_r29 = -21.0f; - temp_r28 = 383.04376f; - temp_r27 = 78.600006f; - GXSetScissor((s32)temp_r30, (s32)temp_r29, (s32)temp_r28, (s32)temp_r27); + + int left = r27 * 1.0296875f + -9.0f; + int top = r28 * 1.0916667f + -21.0f; + int width = r26 * 1.0296875f; + int height = r25 * 1.0916667f; + + GXSetScissor(left, top, width, height); sScreen->draw(0.0f, 0.0f, graf); - GXSetTexCopySrc((s32)temp_r30, (s32)temp_r29, (s32)temp_r28, (s32)temp_r27); - GXSetTexCopyDst((s32)temp_r28, (s32)temp_r27, GX_TF_RGB565, GX_FALSE); - if (REG1_S(6) != 0) { - uVar1 = GX_FALSE; - } else { - uVar1 = GX_TRUE; - } - GXCopyTex(field_0x8, uVar1); + GXSetTexCopySrc(left, top, width, height); + GXSetTexCopyDst(width, height, GX_TF_RGB565, GX_FALSE); + GXCopyTex(field_0x8, REG1_S(6) == 0 ? GX_TRUE : GX_FALSE); } /* 8020AD3C-8020ADD8 .text dMsg_msg_pane_parts_set__FP18fopMsgM_pane_classUc */ @@ -327,9 +298,6 @@ void dMsg_screenDataSetTalk(sub_msg_class* i_Msg) { /* 8020B958-8020CC6C .text dMsg_screenDataSetItem__FP13sub_msg_class */ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { - ResTIMG* pRVar6; - f32 dVar12; - sScreen = new MyScreen(); sScreen->set("hukidashi_09.blo", dComIfGp_getMsgArchive()); fopMsgM_setPaneData(&i_Msg->m049C, sScreen->search('ms90')); @@ -349,8 +317,7 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { fopMsgM_setPaneData(&i_Msg->m0624[5], sScreen->search('lig6')); fopMsgM_setPaneData(&i_Msg->m0624[6], sScreen->search('lig7')); fopMsgM_setPaneData(&i_Msg->m0624[7], sScreen->search('lig8')); - pRVar6 = (ResTIMG*)i_Msg->mpHeap->alloc(0xc00, 0x20); - i_Msg->buffer_p = pRVar6; + i_Msg->buffer_p = (ResTIMG*)i_Msg->mpHeap->alloc(0xc00, 0x20); JUT_ASSERT(661, i_Msg->buffer_p != NULL); if ((i_Msg->mMesgEntry.mTextboxType == 9) && (dItem_data::getTexture(i_Msg->mMsgNo - 101) != NULL)) { JKRArchive* archive = dComIfGp_getItemIconArchive(); @@ -361,7 +328,7 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { i_Msg->m0624[i].pane->hide(); } i_Msg->m0624[8].mUserArea = 1; - dVar12 = (i_Msg->m049C.mPosCenterOrig.x - i_Msg->m0544[0].mPosCenterOrig.x); + f32 dVar12 = (i_Msg->m049C.mPosCenterOrig.x - i_Msg->m0544[0].mPosCenterOrig.x); for (s32 i = 0; i < 4; i++) { i_Msg->m0544[i].mSize.x = 486.0f; fopMsgM_paneTrans(&i_Msg->m0544[i], dVar12, 0.0f); @@ -387,7 +354,6 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { ((J2DPicture*)i_Msg->m0624[8].pane)->setWhite(JUtility::TColor(0xBE78FFFF)); } else if (i_Msg->mMsgNo == 0x6b) { ((J2DPicture*)i_Msg->m0624[8].pane)->setBlack(JUtility::TColor(0x50280000)); - ; ((J2DPicture*)i_Msg->m0624[8].pane)->setWhite(JUtility::TColor(0xFF8C00FF)); } else if (i_Msg->mMsgNo == 0x74) { ((J2DPicture*)i_Msg->m0624[8].pane)->setBlack(JUtility::TColor(0x00000000)); @@ -456,8 +422,12 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { if (i_Msg->mMesgEntry.mTextboxType == 1) { ((J2DPicture*)i_Msg->m049C.pane)->setBlack(JUtility::TColor(0x00000000)); ((J2DPicture*)i_Msg->m049C.pane)->setWhite(JUtility::TColor(0xFFFFFFFF)); - ((J2DPicture*)i_Msg->m049C.pane) - ->setCornerColor(JUtility::TColor(0x3232B4FF), JUtility::TColor(0x3232B4FF), JUtility::TColor(0x3232B496), JUtility::TColor(0x646478FF)); + ((J2DPicture*)i_Msg->m049C.pane)->setCornerColor( + JUtility::TColor(0x3232B4FF), + JUtility::TColor(0x3232B4FF), + JUtility::TColor(0x3232B496), + JUtility::TColor(0x646478FF) + ); } ((J2DTextBox*)i_Msg->m0544[0].pane)->setFont(textFont); ((J2DTextBox*)i_Msg->m0544[1].pane)->setFont(rubyFont); @@ -517,17 +487,39 @@ void dMsg_screenDataSetDemo(sub_msg_class* i_Msg) { for (s32 i = 0; i < 3; i++) { numberPane[i]->setFont(textFont); } - textOffsetY = 2; + J2DTextBox::TFontSize size; - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); - for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + J2DTextBox::TFontSize size2; +#if VERSION <= VERSION_JPN + if (g_msgDHIO.field_0x08 == 0) { + size.mSizeX = (int)g_msgHIO.field_0x58; + size.mSizeY = (int)g_msgHIO.field_0x58; + size2.mSizeX = g_msgHIO.field_0x68; + size2.mSizeY = g_msgHIO.field_0x68; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); + ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(size2); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); + ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(size2); + for (s32 i = 0; i < 3; i++) { + numberPane[i]->setFontSize(size); + numberPane[i]->resize(size.mSizeX, size.mSizeY); + } + maskPane->resize(size.mSizeX, size.mSizeY); + } else +#endif + { + textOffsetY = VERSION_SELECT(4, 4, 2, 2); + size.mSizeX = g_msgHIO.field_0x70; + size.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); + for (s32 i = 0; i < 3; i++) { + numberPane[i]->setFontSize(size); + numberPane[i]->resize(size.mSizeX, size.mSizeY); + } + maskPane->resize(size.mSizeX, size.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); + ((J2DTextBox*)i_Msg->m0544[0].pane)->setCharSpace(g_msgHIO.field_0x5a); ((J2DTextBox*)i_Msg->m0544[1].pane)->setCharSpace(g_msgHIO.field_0x5c); ((J2DTextBox*)i_Msg->m0544[2].pane)->setCharSpace(g_msgHIO.field_0x5a); @@ -535,14 +527,28 @@ void dMsg_screenDataSetDemo(sub_msg_class* i_Msg) { for (s32 i = 0; i < 3; i++) { numberPane[i]->setCharSpace(g_msgHIO.field_0x5a); } - ((J2DTextBox*)i_Msg->m0544[0].pane)->setLineSpace(g_msgHIO.field_0x5e); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setLineSpace(g_msgHIO.field_0x5e); - for (s32 i = 0; i < 3; i++) { - numberPane[i]->setLineSpace(g_msgHIO.field_0x5e); + +#if VERSION <= VERSION_JPN + if (g_msgDHIO.field_0x08 == 0) { + ((J2DTextBox*)i_Msg->m0544[0].pane)->setLineSpace(42.0f); + ((J2DTextBox*)i_Msg->m0544[1].pane)->setLineSpace(42.0f); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setLineSpace(42.0f); + ((J2DTextBox*)i_Msg->m0544[3].pane)->setLineSpace(42.0f); + for (s32 i = 0; i < 3; i++) { + numberPane[i]->setLineSpace(42.0f); + } + } else +#endif + { + ((J2DTextBox*)i_Msg->m0544[0].pane)->setLineSpace(g_msgHIO.field_0x5e); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setLineSpace(g_msgHIO.field_0x5e); + for (s32 i = 0; i < 3; i++) { + numberPane[i]->setLineSpace(g_msgHIO.field_0x5e); + } } - J2DTextBox::TFontSize size2; + i_Msg->m110C = (int)size.mSizeX; - i_Msg->m1110 = (int)size2.mSizeY; + i_Msg->m1110 = (int)size2.mSizeX; // !@bug uninitialized use i_Msg->m026C[0].mUserArea = 0; } @@ -725,10 +731,6 @@ void dMsg_outFontHide(sub_msg_class*) { void dMsg_ScreenDataValueInitTalk(sub_msg_class* i_Msg) { int iVar1; int iVar2; - char* pcVar4; - char* pcVar5; - char* pcVar7; - char* pcVar8; cXyz VStack_3c; cXyz local_48; @@ -760,44 +762,27 @@ void dMsg_ScreenDataValueInitTalk(sub_msg_class* i_Msg) { i_Msg->m049C.mSize.y = (i_Msg->m049C.mSizeOrig.y / i_Msg->m049C.mSizeOrig.x) * 100.0f; fopMsgM_cposMove(&i_Msg->m049C); i_Msg->mMsgDataProc.dataInit(); - i_Msg->mMsgDataProc.field_0x25C = i_Msg->m1164; - i_Msg->mMsgDataProc.field_0x10 = (int)&i_Msg->mPos; - i_Msg->mMsgDataProc.bmgData = (char*)i_Msg->mpMesgStr; - pcVar8 = i_Msg->output_rubSdw; - pcVar7 = i_Msg->output_textSdw; - pcVar5 = i_Msg->output_rub; - pcVar4 = i_Msg->output_text; - i_Msg->mMsgDataProc.field_0x60 = pcVar4; - i_Msg->mMsgDataProc.field_0x40 = pcVar4; - i_Msg->mMsgDataProc.field_0x64 = pcVar5; - i_Msg->mMsgDataProc.field_0x44 = pcVar5; - i_Msg->mMsgDataProc.field_0x68 = pcVar7; - i_Msg->mMsgDataProc.field_0x48 = pcVar7; - i_Msg->mMsgDataProc.field_0x6C = pcVar8; - i_Msg->mMsgDataProc.field_0x4C = pcVar8; - pcVar4 = i_Msg->select_rubSdw; - pcVar5 = i_Msg->select_textSdw; - pcVar7 = i_Msg->select_rub; - i_Msg->mMsgDataProc.field_0x50[0] = i_Msg->select_text; - i_Msg->mMsgDataProc.field_0x50[1] = pcVar7; - i_Msg->mMsgDataProc.field_0x50[2] = pcVar5; - i_Msg->mMsgDataProc.field_0x50[3] = pcVar4; - i_Msg->mMsgDataProc.font[0] = textFont; - i_Msg->mMsgDataProc.font[1] = rubyFont; - i_Msg->mMsgDataProc.charSpace = iVar1; - i_Msg->mMsgDataProc.rubyCharSpace = iVar2; - i_Msg->mMsgDataProc.lineSpace = (int)((J2DTextBox*)i_Msg->m0544[0].pane)->getLineSpace(); - i_Msg->mMsgDataProc.mesgEntry = &i_Msg->mMesgEntry; - i_Msg->mMsgDataProc.fontSize = i_Msg->m110C; - i_Msg->mMsgDataProc.rubyFontSize = i_Msg->m1110; - i_Msg->mMsgDataProc.lineWidth = 0x1f7; - i_Msg->mMsgDataProc.centerLineWidth = 0x1e6; - i_Msg->mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - i_Msg->mMsgDataProc.spaceTimer = 2; + i_Msg->mMsgDataProc.setStringColor(i_Msg->m1164); + i_Msg->mMsgDataProc.setActorPosition(&i_Msg->mPos); + i_Msg->mMsgDataProc.setBmgData(i_Msg->mpMesgStr); + i_Msg->mMsgDataProc.setOutMessage(i_Msg->output_text, i_Msg->output_rub, i_Msg->output_textSdw, i_Msg->output_rubSdw); + i_Msg->mMsgDataProc.setSelectMessage(i_Msg->select_text, i_Msg->select_rub, i_Msg->select_textSdw, i_Msg->select_rubSdw); + i_Msg->mMsgDataProc.setFont(textFont); + i_Msg->mMsgDataProc.setRubyFont(rubyFont); + i_Msg->mMsgDataProc.setCharSpace(iVar1); + i_Msg->mMsgDataProc.setRubyCharSpace(iVar2); + i_Msg->mMsgDataProc.setLineSpace((int)((J2DTextBox*)i_Msg->m0544[0].pane)->getLineSpace()); + i_Msg->mMsgDataProc.setMesgEntry(&i_Msg->mMesgEntry); + i_Msg->mMsgDataProc.setFontSize(i_Msg->m110C); + i_Msg->mMsgDataProc.setRubyFontSize(i_Msg->m1110); + i_Msg->mMsgDataProc.setLineWidth(0x1f7); + i_Msg->mMsgDataProc.setCenterLineWidth(0x1e6); + i_Msg->mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + i_Msg->mMsgDataProc.setSpaceTimer(2); if (g_msgHIO.field_0x83 != 0) { - i_Msg->mMsgDataProc.spaceFlag = 1; + i_Msg->mMsgDataProc.setSpaceFlagOn(); } else { - i_Msg->mMsgDataProc.spaceFlag = 0; + i_Msg->mMsgDataProc.setSpaceFlagOff(); } i_Msg->m10D0 = (i_Msg->m10D8) - i_Msg->m049C.mPosCenter.x; i_Msg->m10D4 = (i_Msg->m10DC) - i_Msg->m049C.mPosCenter.y; @@ -810,10 +795,6 @@ void dMsg_ScreenDataValueInitItem(sub_msg_class* i_Msg) { int iVar9; int fVar3; int fVar4; - char* pcVar5; - char* pcVar6; - char* pcVar7; - char* pcVar8; fVar3 = (int)((J2DTextBox*)i_Msg->m0544[0].pane)->getCharSpace(); fVar4 = (int)((J2DTextBox*)i_Msg->m0544[1].pane)->getCharSpace(); @@ -853,47 +834,30 @@ void dMsg_ScreenDataValueInitItem(sub_msg_class* i_Msg) { i_Msg->m049C.mSize.y = (i_Msg->m049C.mSizeOrig.y / i_Msg->m049C.mSizeOrig.x) * 100.0f; fopMsgM_cposMove(&i_Msg->m049C); i_Msg->mMsgDataProc.dataInit(); - i_Msg->mMsgDataProc.field_0x10 = (int)&i_Msg->mPos; - i_Msg->mMsgDataProc.bmgData = (char*)i_Msg->mpMesgStr; - pcVar8 = i_Msg->output_rubSdw; - pcVar7 = i_Msg->output_textSdw; - pcVar6 = i_Msg->output_rub; - pcVar5 = i_Msg->output_text; - i_Msg->mMsgDataProc.field_0x60 = pcVar5; - i_Msg->mMsgDataProc.field_0x40 = pcVar5; - i_Msg->mMsgDataProc.field_0x64 = pcVar6; - i_Msg->mMsgDataProc.field_0x44 = pcVar6; - i_Msg->mMsgDataProc.field_0x68 = pcVar7; - i_Msg->mMsgDataProc.field_0x48 = pcVar7; - i_Msg->mMsgDataProc.field_0x6C = pcVar8; - i_Msg->mMsgDataProc.field_0x4C = pcVar8; - pcVar5 = i_Msg->select_rubSdw; - pcVar6 = i_Msg->select_textSdw; - pcVar7 = i_Msg->select_rub; - i_Msg->mMsgDataProc.field_0x50[0] = i_Msg->select_text; - i_Msg->mMsgDataProc.field_0x50[1] = pcVar7; - i_Msg->mMsgDataProc.field_0x50[2] = pcVar6; - i_Msg->mMsgDataProc.field_0x50[3] = pcVar5; - i_Msg->mMsgDataProc.font[0] = textFont; - i_Msg->mMsgDataProc.font[1] = rubyFont; - i_Msg->mMsgDataProc.charSpace = (int)fVar3; - i_Msg->mMsgDataProc.rubyCharSpace = (int)fVar4; - i_Msg->mMsgDataProc.mesgEntry = &i_Msg->mMesgEntry; - i_Msg->mMsgDataProc.fontSize = i_Msg->m110C; - i_Msg->mMsgDataProc.rubyFontSize = i_Msg->m1110; + i_Msg->mMsgDataProc.setActorPosition(&i_Msg->mPos); + i_Msg->mMsgDataProc.setBmgData(i_Msg->mpMesgStr); + i_Msg->mMsgDataProc.setOutMessage(i_Msg->output_text, i_Msg->output_rub, i_Msg->output_textSdw, i_Msg->output_rubSdw); + i_Msg->mMsgDataProc.setSelectMessage(i_Msg->select_text, i_Msg->select_rub, i_Msg->select_textSdw, i_Msg->select_rubSdw); + i_Msg->mMsgDataProc.setFont(textFont); + i_Msg->mMsgDataProc.setRubyFont(rubyFont); + i_Msg->mMsgDataProc.setCharSpace((int)fVar3); + i_Msg->mMsgDataProc.setRubyCharSpace((int)fVar4); + i_Msg->mMsgDataProc.setMesgEntry(&i_Msg->mMesgEntry); + i_Msg->mMsgDataProc.setFontSize(i_Msg->m110C); + i_Msg->mMsgDataProc.setRubyFontSize(i_Msg->m1110); if ((i_Msg->mMesgEntry.mTextboxType == 9) && (i_Msg->m0624[8].mUserArea == 0)) { - i_Msg->mMsgDataProc.lineWidth = 0x1a3; - i_Msg->mMsgDataProc.centerLineWidth = 0x192; + i_Msg->mMsgDataProc.setLineWidth(0x1a3); + i_Msg->mMsgDataProc.setCenterLineWidth(0x192); } else { - i_Msg->mMsgDataProc.lineWidth = 0x1f7; - i_Msg->mMsgDataProc.centerLineWidth = 0x1e6; + i_Msg->mMsgDataProc.setLineWidth(0x1f7); + i_Msg->mMsgDataProc.setCenterLineWidth(0x1e6); } - i_Msg->mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - i_Msg->mMsgDataProc.spaceTimer = 2; + i_Msg->mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + i_Msg->mMsgDataProc.setSpaceTimer(2); if (g_msgHIO.field_0x83 != 0) { - i_Msg->mMsgDataProc.spaceFlag = 1; + i_Msg->mMsgDataProc.setSpaceFlagOn(); } else { - i_Msg->mMsgDataProc.spaceFlag = 0; + i_Msg->mMsgDataProc.setSpaceFlagOff(); } i_Msg->m10D0 = (i_Msg->m10D8) - i_Msg->m049C.mPosCenter.x; i_Msg->m10D4 = (i_Msg->m10DC) - i_Msg->m049C.mPosCenter.y; @@ -906,10 +870,6 @@ void dMsg_ScreenDataValueInitItem(sub_msg_class* i_Msg) { void dMsg_ScreenDataValueInitTact(sub_msg_class* i_Msg) { int uVar1; int iVar2; - char* pcVar3; - char* pcVar4; - char* pcVar5; - char* pcVar6; f32 dVar7; f32 dVar8; @@ -936,47 +896,30 @@ void dMsg_ScreenDataValueInitTact(sub_msg_class* i_Msg) { i_Msg->m049C.mSize.y = (i_Msg->m049C.mSizeOrig.y / i_Msg->m049C.mSizeOrig.x) * 100.0f; fopMsgM_cposMove(&i_Msg->m049C); i_Msg->mMsgDataProc.dataInit(); - i_Msg->mMsgDataProc.field_0x10 = (int)&i_Msg->mPos; - i_Msg->mMsgDataProc.bmgData = (char*)i_Msg->mpMesgStr; - pcVar6 = i_Msg->output_rubSdw; - pcVar5 = i_Msg->output_textSdw; - pcVar4 = i_Msg->output_rub; - pcVar3 = i_Msg->output_text; - i_Msg->mMsgDataProc.field_0x60 = pcVar3; - i_Msg->mMsgDataProc.field_0x40 = pcVar3; - i_Msg->mMsgDataProc.field_0x64 = pcVar4; - i_Msg->mMsgDataProc.field_0x44 = pcVar4; - i_Msg->mMsgDataProc.field_0x68 = pcVar5; - i_Msg->mMsgDataProc.field_0x48 = pcVar5; - i_Msg->mMsgDataProc.field_0x6C = pcVar6; - i_Msg->mMsgDataProc.field_0x4C = pcVar6; - pcVar3 = i_Msg->select_rubSdw; - pcVar4 = i_Msg->select_textSdw; - pcVar5 = i_Msg->select_rub; - i_Msg->mMsgDataProc.field_0x50[0] = i_Msg->select_text; - i_Msg->mMsgDataProc.field_0x50[1] = pcVar5; - i_Msg->mMsgDataProc.field_0x50[2] = pcVar4; - i_Msg->mMsgDataProc.field_0x50[3] = pcVar3; - i_Msg->mMsgDataProc.font[0] = textFont; - i_Msg->mMsgDataProc.font[1] = rubyFont; - i_Msg->mMsgDataProc.charSpace = (int)dVar7; - i_Msg->mMsgDataProc.rubyCharSpace = (int)dVar8; - i_Msg->mMsgDataProc.mesgEntry = &i_Msg->mMesgEntry; - i_Msg->mMsgDataProc.fontSize = i_Msg->m110C; - i_Msg->mMsgDataProc.rubyFontSize = i_Msg->m1110; + i_Msg->mMsgDataProc.setActorPosition(&i_Msg->mPos); + i_Msg->mMsgDataProc.setBmgData(i_Msg->mpMesgStr); + i_Msg->mMsgDataProc.setOutMessage(i_Msg->output_text, i_Msg->output_rub, i_Msg->output_textSdw, i_Msg->output_rubSdw); + i_Msg->mMsgDataProc.setSelectMessage(i_Msg->select_text, i_Msg->select_rub, i_Msg->select_textSdw, i_Msg->select_rubSdw); + i_Msg->mMsgDataProc.setFont(textFont); + i_Msg->mMsgDataProc.setRubyFont(rubyFont); + i_Msg->mMsgDataProc.setCharSpace((int)dVar7); + i_Msg->mMsgDataProc.setRubyCharSpace((int)dVar8); + i_Msg->mMsgDataProc.setMesgEntry(&i_Msg->mMesgEntry); + i_Msg->mMsgDataProc.setFontSize(i_Msg->m110C); + i_Msg->mMsgDataProc.setRubyFontSize(i_Msg->m1110); if ((i_Msg->mMesgEntry.mTextboxType == 9) && (i_Msg->m0624[8].mUserArea == 0)) { - i_Msg->mMsgDataProc.lineWidth = 0x1a3; - i_Msg->mMsgDataProc.centerLineWidth = 0x192; + i_Msg->mMsgDataProc.setLineWidth(0x1a3); + i_Msg->mMsgDataProc.setCenterLineWidth(0x192); } else { - i_Msg->mMsgDataProc.lineWidth = 0x1f7; - i_Msg->mMsgDataProc.centerLineWidth = 0x1e6; + i_Msg->mMsgDataProc.setLineWidth(0x1f7); + i_Msg->mMsgDataProc.setCenterLineWidth(0x1e6); } - i_Msg->mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - i_Msg->mMsgDataProc.spaceTimer = 2; + i_Msg->mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + i_Msg->mMsgDataProc.setSpaceTimer(2); if (g_msgHIO.field_0x83 != 0) { - i_Msg->mMsgDataProc.spaceFlag = 1; + i_Msg->mMsgDataProc.setSpaceFlagOn(); } else { - i_Msg->mMsgDataProc.spaceFlag = 0; + i_Msg->mMsgDataProc.setSpaceFlagOff(); } i_Msg->m10D0 = (i_Msg->m10D8) - i_Msg->m049C.mPosCenter.x; i_Msg->m10D4 = (i_Msg->m10DC) - i_Msg->m049C.mPosCenter.y; @@ -988,53 +931,29 @@ void dMsg_ScreenDataValueInitTact(sub_msg_class* i_Msg) { /* 8020EAC4-8020EC28 .text dMsg_ScreenDataValueInitDemo__FP13sub_msg_class */ void dMsg_ScreenDataValueInitDemo(sub_msg_class* i_Msg) { - char* pcVar1; - char* pcVar2; - char* pcVar4; - char* pcVar5; - f32 dVar6; - f32 dVar7; - - dVar6 = ((J2DTextBox*)i_Msg->m0544[0].pane)->getCharSpace(); - dVar7 = ((J2DTextBox*)i_Msg->m0544[1].pane)->getCharSpace(); + f32 charSpace = ((J2DTextBox*)i_Msg->m0544[0].pane)->getCharSpace(); + f32 rubyCharSpace = ((J2DTextBox*)i_Msg->m0544[1].pane)->getCharSpace(); f32 tmp = 0.5f; i_Msg->m1104 = (((J2DTextBox*)i_Msg->m0544[0].pane)->mLineSpace * tmp); i_Msg->mMsgDataProc.dataInit(); - i_Msg->mMsgDataProc.bmgData = (char*)i_Msg->mpMesgStr; - pcVar5 = i_Msg->output_rubSdw; - pcVar4 = i_Msg->output_textSdw; - pcVar2 = i_Msg->output_rub; - pcVar1 = i_Msg->output_text; - i_Msg->mMsgDataProc.field_0x60 = pcVar1; - i_Msg->mMsgDataProc.field_0x40 = pcVar1; - i_Msg->mMsgDataProc.field_0x64 = pcVar2; - i_Msg->mMsgDataProc.field_0x44 = pcVar2; - i_Msg->mMsgDataProc.field_0x68 = pcVar4; - i_Msg->mMsgDataProc.field_0x48 = pcVar4; - i_Msg->mMsgDataProc.field_0x6C = pcVar5; - i_Msg->mMsgDataProc.field_0x4C = pcVar5; - pcVar1 = i_Msg->select_rubSdw; - pcVar2 = i_Msg->select_textSdw; - pcVar4 = i_Msg->select_rub; - i_Msg->mMsgDataProc.field_0x50[0] = i_Msg->select_text; - i_Msg->mMsgDataProc.field_0x50[1] = pcVar4; - i_Msg->mMsgDataProc.field_0x50[2] = pcVar2; - i_Msg->mMsgDataProc.field_0x50[3] = pcVar1; - i_Msg->mMsgDataProc.font[0] = textFont; - i_Msg->mMsgDataProc.font[1] = rubyFont; - i_Msg->mMsgDataProc.charSpace = dVar6; - i_Msg->mMsgDataProc.rubyCharSpace = dVar7; - i_Msg->mMsgDataProc.mesgEntry = &i_Msg->mMesgEntry; - i_Msg->mMsgDataProc.fontSize = i_Msg->m110C; - i_Msg->mMsgDataProc.rubyFontSize = i_Msg->m1110; - i_Msg->mMsgDataProc.lineWidth = 0x1f7; - i_Msg->mMsgDataProc.centerLineWidth = 0x1e6; - i_Msg->mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - i_Msg->mMsgDataProc.spaceTimer = 2; + i_Msg->mMsgDataProc.setBmgData(i_Msg->mpMesgStr); + i_Msg->mMsgDataProc.setOutMessage(i_Msg->output_text, i_Msg->output_rub, i_Msg->output_textSdw, i_Msg->output_rubSdw); + i_Msg->mMsgDataProc.setSelectMessage(i_Msg->select_text, i_Msg->select_rub, i_Msg->select_textSdw, i_Msg->select_rubSdw); + i_Msg->mMsgDataProc.setFont(textFont); + i_Msg->mMsgDataProc.setRubyFont(rubyFont); + i_Msg->mMsgDataProc.setCharSpace(charSpace); + i_Msg->mMsgDataProc.setRubyCharSpace(rubyCharSpace); + i_Msg->mMsgDataProc.setMesgEntry(&i_Msg->mMesgEntry); + i_Msg->mMsgDataProc.setFontSize(i_Msg->m110C); + i_Msg->mMsgDataProc.setRubyFontSize(i_Msg->m1110); + i_Msg->mMsgDataProc.setLineWidth(0x1f7); + i_Msg->mMsgDataProc.setCenterLineWidth(0x1e6); + i_Msg->mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + i_Msg->mMsgDataProc.setSpaceTimer(2); if (g_msgHIO.field_0x83 != 0) { - i_Msg->mMsgDataProc.spaceFlag = 1; + i_Msg->mMsgDataProc.setSpaceFlagOn(); } else { - i_Msg->mMsgDataProc.spaceFlag = 0; + i_Msg->mMsgDataProc.setSpaceFlagOff(); } } @@ -1057,7 +976,7 @@ void dMsg_value_init(sub_msg_class* i_Msg) { strcpy(i_Msg->select_rub, acStack_4c); strcpy(i_Msg->select_textSdw, acStack_68); strcpy(i_Msg->select_rubSdw, acStack_68); - i_Msg->mMsgDataProc.field_0x25C = i_Msg->m1164; + i_Msg->mMsgDataProc.setStringColor(i_Msg->m1164); dMsg_outFontHide(i_Msg); i_Msg->m1108 = 0; } @@ -1068,8 +987,8 @@ void dMsg_setString(sub_msg_class* i_Msg) { ((J2DTextBox*)i_Msg->m0544[1].pane)->setString(i_Msg->output_rub); ((J2DTextBox*)i_Msg->m0544[2].pane)->setString(i_Msg->output_textSdw); ((J2DTextBox*)i_Msg->m0544[3].pane)->setString(i_Msg->output_rubSdw); - if ((((i_Msg->mMesgEntry.mTextboxType != 9) && (i_Msg->mMesgEntry.mTextboxType != 0xe)) && (i_Msg->mMesgEntry.mTextboxType != 1)) && - (i_Msg->mMesgEntry.mTextboxType != 5)) + if (i_Msg->mMesgEntry.mTextboxType != 9 && i_Msg->mMesgEntry.mTextboxType != 0xe && i_Msg->mMesgEntry.mTextboxType != 1 && + i_Msg->mMesgEntry.mTextboxType != 5) { ((J2DTextBox*)i_Msg->m011C[0].pane)->setString(i_Msg->select_text); ((J2DTextBox*)i_Msg->m011C[1].pane)->setString(i_Msg->select_rub); @@ -1081,8 +1000,8 @@ void dMsg_setString(sub_msg_class* i_Msg) { /* 8020EDE0-8020EE38 .text dMsg_yose_select__FP13sub_msg_class */ void dMsg_yose_select(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.stringLength(); - i_Msg->m1108 = i_Msg->mMsgDataProc.lineCount; - i_Msg->mMsgDataProc.lineCount = 0; + i_Msg->m1108 = i_Msg->mMsgDataProc.getLineCount(); + i_Msg->mMsgDataProc.setLineCount(0); i_Msg->mMsgDataProc.stringShift(); i_Msg->mMsgDataProc.iconIdxRefresh(); dMsg_textPosition(i_Msg); @@ -1574,9 +1493,9 @@ void dMsg_numberInput(sub_msg_class* i_Msg) { static char* num_str[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; for (s32 i = 0; i < 8; i++) { - if (i_Msg->mMsgDataProc.field_0x281[i] == 0x16) { - i_Msg->m10EC = ((i_Msg->m0544[0].pane)->mBounds.i.x + i_Msg->mMsgDataProc.field_0x168[i]); - i_Msg->m10F0 = ((i_Msg->m0544[0].pane)->mBounds.i.y + (i_Msg->m1104 * (s32)((3 - i_Msg->m1108) + (i_Msg->mMsgDataProc.field_0x1A4[i]) * 2))); + if (i_Msg->mMsgDataProc.getIconNum(i) == 0x16) { + i_Msg->m10EC = ((i_Msg->m0544[0].pane)->mBounds.i.x + i_Msg->mMsgDataProc.getIconPosX(i)); + i_Msg->m10F0 = ((i_Msg->m0544[0].pane)->mBounds.i.y + (i_Msg->m1104 * (s32)((3 - i_Msg->m1108) + (i_Msg->mMsgDataProc.getIconPosY(i)) * 2))); } } if (i_Msg->mMsgNo == 0x1cfa) { @@ -1603,14 +1522,7 @@ static void dummy() { /* 80210CA4-80210F28 .text dMsg_tactInput__FP13sub_msg_class */ void dMsg_tactInput(sub_msg_class* i_Msg) { - s16 sVar1; - f32 alpha; - int iVar3; - s32 melody_no; - f32 dVar5; - s32 local_38; - - melody_no = dComIfGp_getMelodyNum(); + int melody_no = dComIfGp_getMelodyNum(); if (i_Msg->m1100 < mBeatNum[melody_no]) { if ((mBeatNum[melody_no] != mDoAud_tact_getBeat()) || (i_Msg->m1168 != mDoAud_tact_getBeat())) { i_Msg->m1100 = 0; @@ -1619,11 +1531,12 @@ void dMsg_tactInput(sub_msg_class* i_Msg) { dMsg_tactGuideShow(i_Msg, mBeatNum[melody_no]); } if (daPy_getPlayerActorClass()->checkTactInput()) { - sVar1 = daPy_getPlayerLinkActorClass()->getTactLeftHandPos(); + s16 sVar1 = daPy_getPlayerLinkActorClass()->getTactLeftHandPos(); + s32 local_38; mDoAud_tact_getMelodyPattern(melody_no, i_Msg->m1100, &local_38); i_Msg->m1100++; if ((sVar1 == local_38) && (mBeatNum[melody_no] == mDoAud_tact_getBeat())) { - iVar3 = (int)i_Msg->m0624[0].mUserArea; + int iVar3 = (int)i_Msg->m0624[0].mUserArea; if (iVar3 == i_Msg->m1100 + -1) { i_Msg->m0B64[iVar3].mUserArea = 1; i_Msg->m0624[0].mUserArea++; @@ -1640,19 +1553,18 @@ void dMsg_tactInput(sub_msg_class* i_Msg) { } } } - for (s32 i = 0; i < mBeatNum[melody_no]; i++) { - sVar1 = i_Msg->m0B64[i].mUserArea; + + for (int i = 0; i < mBeatNum[melody_no]; i++) { + s16 sVar1 = i_Msg->m0B64[i].mUserArea; if ((sVar1 > 0) && (sVar1 <= 5)) { - dVar5 = fopMsgM_valueIncrease(5, (int)sVar1, 0); - alpha = (dVar5 * 0.5f) + 0.5f; - dVar5 = alpha; + f32 alpha = (fopMsgM_valueIncrease(5, (int)sVar1, 0) * 0.5f) + 0.5f; if (dComIfGp_getMelodyNum() < 5) { fopMsgM_setNowAlpha(&i_Msg->m0A14[i], alpha); - fopMsgM_setNowAlpha(&i_Msg->m0B64[i], dVar5); + fopMsgM_setNowAlpha(&i_Msg->m0B64[i], alpha); } else { fopMsgM_setNowAlpha(&i_Msg->m0A14[i], alpha); - fopMsgM_setNowAlpha(&i_Msg->m08C4[i], dVar5); - fopMsgM_setNowAlpha(&i_Msg->m0CB4[i], dVar5); + fopMsgM_setNowAlpha(&i_Msg->m08C4[i], alpha); + fopMsgM_setNowAlpha(&i_Msg->m0CB4[i], alpha); } if (i_Msg->m0B64[mBeatNum[melody_no] - 1].mUserArea == 5) { i_Msg->mStatus = fopMsgStts_MSG_DISPLAYED_e; @@ -1705,7 +1617,7 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { fVar1 = (fVar1 + i_Msg->m049C.mSize.y / 2.0f) - ((int)g_msgHIO.field_0x7c); } local_68 = (int)g_msgHIO.field_0x78; - fVar3 = (local_68) + ((g_msgHIO.field_0x7e) * 2.0f + (i_Msg->mMsgDataProc.field_0x21C) - i_Msg->m011C[0].mSizeOrig.x); + fVar3 = (local_68) + ((g_msgHIO.field_0x7e) * 2.0f + (i_Msg->mMsgDataProc.getSelectLength()) - i_Msg->m011C[0].mSizeOrig.x); for (s32 i = 0; i < 4; i++) { i_Msg->m011C[i].mSize.x = i_Msg->m011C[i].mSizeOrig.x + fVar3; } @@ -1746,7 +1658,7 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { i_Msg->m01FC.mPosCenterOrig.x = i_Msg->m01FC.mPosTopLeftOrig.x + i_Msg->m01FC.mSizeOrig.x / 2.0f + fVar3; f32 f4 = g_msgHIO.field_0x7e * 2.0f; f32 f3 = i_Msg->m01FC.mPosCenterOrig.x + i_Msg->m01FC.mSizeOrig.x; - i_Msg->m0234.mPosCenterOrig.x = f3 + i_Msg->mMsgDataProc.field_0x21C + f4; + i_Msg->m0234.mPosCenterOrig.x = f3 + i_Msg->mMsgDataProc.getSelectLength() + f4; i_Msg->m01FC.mPosCenterOrig.y = i_Msg->m01FC.mPosTopLeftOrig.y + i_Msg->m01FC.mSizeOrig.y / 2.0f + fVar5; i_Msg->m0234.mPosCenterOrig.y = i_Msg->m0234.mPosTopLeftOrig.y + i_Msg->m0234.mSizeOrig.y / 2.0f + fVar5; for (s32 i = 0; i < 4; i++) { @@ -1904,9 +1816,6 @@ void dMsg_setCancelMode(sub_msg_class* i_Msg) { /* 80211BCC-80211DA0 .text dMsg_messageShow__FP13sub_msg_class */ void dMsg_messageShow(sub_msg_class* i_Msg) { - u8 cVar2; - u32 iVar1; - fopMsgM_paneScaleXY(&i_Msg->m049C, 1.0f); fopMsgM_setInitAlpha(&i_Msg->m049C); dMsg_messagePaneShow(i_Msg); @@ -1917,14 +1826,13 @@ void dMsg_messageShow(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.field_0x299 = 1; i_Msg->mMsgDataProc.stringSet(); for (s32 i = 0; i < 8; i++) { - cVar2 = i_Msg->mMsgDataProc.field_0x281[i]; - iVar1 = i_Msg->mMsgDataProc.field_0x220[i]; - u32 var_r6 = iVar1; - if (((((u8)(cVar2 - 10U) <= 3) || (cVar2 == 0x15)) || (cVar2 == 0x17)) && (iVar1 == 0)) { - var_r6 = -1; + u8 iconNum = i_Msg->mMsgDataProc.getIconNum(i); + u32 iconColor = i_Msg->mMsgDataProc.getIconColor(i); + if ((iconNum == 0xA || iconNum == 0xB || iconNum == 0xC || iconNum == 0xD || iconNum == 0x15 || iconNum == 0x17) && iconColor == 0) { + iconColor = -1; } - if (((cVar2 != 0xFF) && (buttonTimer[i] == -1)) && (cVar2 != 0x14 && (cVar2 != 0x15 && (cVar2 != 0x16)))) { - fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], var_r6, cVar2); + if (((iconNum != 0xFF) && (buttonTimer[i] == -1)) && (iconNum != 0x14 && (iconNum != 0x15 && (iconNum != 0x16)))) { + fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], iconColor, iconNum); } } dMsg_setString(i_Msg); @@ -1945,13 +1853,9 @@ void dMsg_messageShow(sub_msg_class* i_Msg) { /* 80211DA0-8021209C .text dMsg_stopProc__FP13sub_msg_class */ s32 dMsg_stopProc(sub_msg_class* i_Msg) { u8 bVar1; - u32 uVar2; - if (i_Msg->mMsgDataProc.autoSendFlag != 0) { - uVar2 = (int)i_Msg->mMsgDataProc.waitTimer > 0 ? i_Msg->mMsgDataProc.waitTimer - 1 : 0; - i_Msg->mMsgDataProc.waitTimer = uVar2; - if (uVar2 == 0) { - i_Msg->mMsgDataProc.autoSendFlag = 0; + if (i_Msg->mMsgDataProc.dec_waitTimer() == 0) { + i_Msg->mMsgDataProc.setAutoSendFlagOff(); #if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; #endif @@ -2000,8 +1904,8 @@ s32 dMsg_stopProc(sub_msg_class* i_Msg) { { i_Msg->mMsgDataProc.field_0x299 = 1; } - if (((i_Msg->mMsgDataProc.autoSendFlag == 0) && (i_Msg->mMsgDataProc.handSendFlag == 0)) && ((s32)i_Msg->mMsgDataProc.waitTimer != 0)) { - i_Msg->mMsgDataProc.waitTimer = 0; + if (i_Msg->mMsgDataProc.getAutoSendFlag() == 0 && i_Msg->mMsgDataProc.getHandSendFlag() == 0 && i_Msg->mMsgDataProc.get_waitTimer() != 0) { + i_Msg->mMsgDataProc.set_waitTimerZero(); #if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; #endif @@ -2023,7 +1927,6 @@ s32 dMsg_stopProc(sub_msg_class* i_Msg) { s32 dMsg_selectProc(sub_msg_class* i_Msg) { int uVar1; s16 sVar3; - u8 cVar6; J2DTextBox* pJVar8; u8 uVar9; int iVar10; @@ -2123,12 +2026,12 @@ s32 dMsg_selectProc(sub_msg_class* i_Msg) { s32 var_r6 = 0; s32 var_r11 = 0; for (s32 i = 0; i < 8; i++) { - cVar6 = i_Msg->mMsgDataProc.field_0x281[i]; - if (cVar6 == 0x14) { - var_r5 = (int)(i_Msg->m0544[0].pane->mBounds.i.x + ((int)i_Msg->mMsgDataProc.field_0x168[i])); - var_r6 = (int)(i_Msg->m0544[0].pane->mBounds.i.y + (int)(i_Msg->m1104 * ((2 - i_Msg->m1108) + (i_Msg->mMsgDataProc.field_0x1A4[i] * 2)))); - } else if (cVar6 == 0x15) { - var_r11 = (int)(i_Msg->m0544[0].pane->mBounds.i.x + ((int)i_Msg->mMsgDataProc.field_0x168[i])); + u8 iconNum = i_Msg->mMsgDataProc.getIconNum(i); + if (iconNum == 0x14) { + var_r5 = i_Msg->m0544[0].pane->mBounds.i.x + i_Msg->mMsgDataProc.getIconPosX(i); + var_r6 = i_Msg->m0544[0].pane->mBounds.i.y + i_Msg->m1104 * ((2 - i_Msg->m1108) + (i_Msg->mMsgDataProc.getIconPosY(i) * 2)); + } else if (iconNum == 0x15) { + var_r11 = (i_Msg->m0544[0].pane->mBounds.i.x + (i_Msg->mMsgDataProc.getIconPosX(i))); } } i_Msg->mSelectNum = i_Msg->mMsgDataProc.selectCheckYoko(arrowPane, var_r5, var_r6, var_r11 - var_r5); @@ -2196,22 +2099,14 @@ s32 dMsg_inputProc(sub_msg_class* i_Msg) { /* 80212910-80212DC0 .text dMsg_demoProc__FP13sub_msg_class */ s32 dMsg_demoProc(sub_msg_class* i_Msg) { - s16 sVar1; - u8 cVar3; - u32 iVar2; - int iVar4; - s32 melody_no; - f32 dVar9; - f32 fVar10; - s32 lStack_68; - f32 local_64[7]; - if (i_Msg->m116B == 0) { - melody_no = dComIfGp_getMelodyNum(); + int melody_no = dComIfGp_getMelodyNum(); static bool flag = 0; static s16 cnt = 0; + f32 local_64[7]; local_64[0] = 0.0f; - for (s32 i = 0; i < mBeatNum[melody_no]; i++) { + for (int i = 0; i < mBeatNum[melody_no]; i++) { + s32 lStack_68; local_64[i + 1] = mDoAud_tact_getMelodyPattern((u8)melody_no, i, &lStack_68); local_64[i + 1] += local_64[i]; } @@ -2226,21 +2121,17 @@ s32 dMsg_demoProc(sub_msg_class* i_Msg) { cnt++; } } - for (s32 i = 0; i < mBeatNum[melody_no]; i++) { - sVar1 = i_Msg->m0B64[i].mUserArea; - iVar4 = (int)sVar1; - if ((sVar1 > 0) && (iVar4 <= 0x23)) { - if (iVar4 < 5) { - dVar9 = fopMsgM_valueIncrease(5, iVar4, 0); - fVar10 = (dVar9 * 0.5f) + 0.5f; - dVar9 = fVar10; + for (int i = 0; i < mBeatNum[melody_no]; i++) { + if ((i_Msg->m0B64[i].mUserArea > 0) && (i_Msg->m0B64[i].mUserArea <= 0x23)) { + if (i_Msg->m0B64[i].mUserArea < 5) { + f32 fVar10 = (fopMsgM_valueIncrease(5, i_Msg->m0B64[i].mUserArea, 0) * 0.5f) + 0.5f; if (dComIfGp_getMelodyNum() < 5) { fopMsgM_setNowAlpha(&i_Msg->m0A14[i], fVar10); - fopMsgM_setNowAlpha(&i_Msg->m0B64[i], dVar9); + fopMsgM_setNowAlpha(&i_Msg->m0B64[i], fVar10); } else { fopMsgM_setNowAlpha(&i_Msg->m0A14[i], fVar10); - fopMsgM_setNowAlpha(&i_Msg->m08C4[i], dVar9); - fopMsgM_setNowAlpha(&i_Msg->m0CB4[i], dVar9); + fopMsgM_setNowAlpha(&i_Msg->m08C4[i], fVar10); + fopMsgM_setNowAlpha(&i_Msg->m0CB4[i], fVar10); } } else { fopMsgM_setInitAlpha(&i_Msg->m0A14[i]); @@ -2259,15 +2150,14 @@ s32 dMsg_demoProc(sub_msg_class* i_Msg) { } i_Msg->mMsgDataProc.field_0x299 = 1; i_Msg->mMsgDataProc.stringSet(); - for (s32 j = 0; j < 8; j++) { - cVar3 = i_Msg->mMsgDataProc.field_0x281[j]; - iVar2 = i_Msg->mMsgDataProc.field_0x220[j]; - u32 var_r6 = iVar2; - if (((((u8)(cVar3 - 10U) <= 3) || (cVar3 == 0x15)) || (cVar3 == 0x17)) && (iVar2 == 0)) { - var_r6 = -1; + for (int j = 0; j < 8; j++) { + u8 iconNum = i_Msg->mMsgDataProc.iconNum[j]; + u32 iconColor = i_Msg->mMsgDataProc.getIconColor(j); + if ((iconNum == 0xA || iconNum == 0xB || iconNum == 0xC || iconNum == 0xD || iconNum == 0x15 || iconNum == 0x17) && iconColor == 0) { + iconColor = -1; } - if (((cVar3 != 0xFF) && (buttonTimer[j] == -1)) && (cVar3 != 0x14 && (cVar3 != 0x15 && (cVar3 != 0x16)))) { - fopMsgM_outFontSet(button_icon[j], button_kage[j], &buttonTimer[j], var_r6, cVar3); + if (((iconNum != 0xFF) && (buttonTimer[j] == -1)) && (iconNum != 0x14 && (iconNum != 0x15 && (iconNum != 0x16)))) { + fopMsgM_outFontSet(button_icon[j], button_kage[j], &buttonTimer[j], iconColor, iconNum); } } dMsg_setString(i_Msg); @@ -2281,7 +2171,7 @@ s32 dMsg_demoProc(sub_msg_class* i_Msg) { flag += 1; } i_Msg->m1100 = 0; - for (s32 j = 0; j < mBeatNum[melody_no]; j++) { + for (int j = 0; j < mBeatNum[melody_no]; j++) { i_Msg->m0B64[j].mUserArea = 0; if (dComIfGp_getMelodyNum() < 5) { fopMsgM_setNowAlpha(&i_Msg->m0A14[j], 0.5f); @@ -2296,7 +2186,7 @@ s32 dMsg_demoProc(sub_msg_class* i_Msg) { } } } else { - dVar9 = fopMsgM_valueIncrease(5, i_Msg->m116B, 0); + f32 dVar9 = fopMsgM_valueIncrease(5, i_Msg->m116B, 0); fopMsgM_setNowAlpha(&i_Msg->m0544[0], dVar9); fopMsgM_setNowAlpha(&i_Msg->m0544[1], dVar9); fopMsgM_setNowAlpha(&i_Msg->m0544[2], dVar9); @@ -2317,18 +2207,15 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) { f32 dVar3; f32 fVar5; char* pcVar9; - char* pcVar10; - char* pcVar12; fopAc_ac_c* pActor; - char* pcVar13; iVar1 = (int)((J2DTextBox*)i_Msg->m0544[0].pane)->getCharSpace(); iVar2 = (int)((J2DTextBox*)i_Msg->m0544[1].pane)->getCharSpace(); - if (((((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) || (i_Msg->mMsgDataProc.selectFlag != 0)) || + if (((((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) || (i_Msg->mMsgDataProc.getSelectFlag() != 0)) || (fopMsgM_checkMessageSend() || (i_Msg->mMsgNo == 0x5ac && (dComIfGp_checkMesgCancelButton())))) && (!dComIfGp_checkMesgBgm())) { - i_Msg->mMsgDataProc.selectFlag = 0; + i_Msg->mMsgDataProc.setSelectFlagOff(); i_Msg->m1100 = 0; JKRFileLoader::removeResource(i_Msg->head_p, NULL); if ((i_Msg->mMesgEntry.mTextboxType != 5) && (i_Msg->mMesgEntry.mTextboxType != 0xe)) { @@ -2352,47 +2239,30 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) { i_Msg->m1164 = -1; dMsg_value_init(i_Msg); i_Msg->mMsgDataProc.dataInit(); - i_Msg->mMsgDataProc.field_0x25C = i_Msg->m1164; - i_Msg->mMsgDataProc.bmgData = (char*)i_Msg->mpMesgStr; - pcVar13 = i_Msg->output_rubSdw; - pcVar12 = i_Msg->output_textSdw; - pcVar10 = i_Msg->output_rub; - pcVar9 = i_Msg->output_text; - i_Msg->mMsgDataProc.field_0x60 = pcVar9; - i_Msg->mMsgDataProc.field_0x40 = pcVar9; - i_Msg->mMsgDataProc.field_0x64 = pcVar10; - i_Msg->mMsgDataProc.field_0x44 = pcVar10; - i_Msg->mMsgDataProc.field_0x68 = pcVar12; - i_Msg->mMsgDataProc.field_0x48 = pcVar12; - i_Msg->mMsgDataProc.field_0x6C = pcVar13; - i_Msg->mMsgDataProc.field_0x4C = pcVar13; - pcVar10 = i_Msg->select_rubSdw; - pcVar12 = i_Msg->select_textSdw; - pcVar9 = i_Msg->select_rub; - i_Msg->mMsgDataProc.field_0x50[0] = i_Msg->select_text; - i_Msg->mMsgDataProc.field_0x50[1] = pcVar9; - i_Msg->mMsgDataProc.field_0x50[2] = pcVar12; - i_Msg->mMsgDataProc.field_0x50[3] = pcVar10; - i_Msg->mMsgDataProc.font[0] = textFont; - i_Msg->mMsgDataProc.font[1] = rubyFont; - i_Msg->mMsgDataProc.charSpace = iVar1; - i_Msg->mMsgDataProc.rubyCharSpace = iVar2; - i_Msg->mMsgDataProc.mesgEntry = &i_Msg->mMesgEntry; - i_Msg->mMsgDataProc.fontSize = i_Msg->m110C; - i_Msg->mMsgDataProc.rubyFontSize = i_Msg->m1110; + i_Msg->mMsgDataProc.setStringColor(i_Msg->m1164); + i_Msg->mMsgDataProc.setBmgData(i_Msg->mpMesgStr); + i_Msg->mMsgDataProc.setOutMessage(i_Msg->output_text, i_Msg->output_rub, i_Msg->output_textSdw, i_Msg->output_rubSdw); + i_Msg->mMsgDataProc.setSelectMessage(i_Msg->select_text, i_Msg->select_rub, i_Msg->select_textSdw, i_Msg->select_rubSdw); + i_Msg->mMsgDataProc.setFont(textFont); + i_Msg->mMsgDataProc.setRubyFont(rubyFont); + i_Msg->mMsgDataProc.setCharSpace(iVar1); + i_Msg->mMsgDataProc.setRubyCharSpace(iVar2); + i_Msg->mMsgDataProc.setMesgEntry(&i_Msg->mMesgEntry); + i_Msg->mMsgDataProc.setFontSize(i_Msg->m110C); + i_Msg->mMsgDataProc.setRubyFontSize(i_Msg->m1110); if ((i_Msg->mMesgEntry.mTextboxType == 9) && (i_Msg->m0624[8].mUserArea == 0)) { - i_Msg->mMsgDataProc.lineWidth = 0x1a3; - i_Msg->mMsgDataProc.centerLineWidth = 0x192; + i_Msg->mMsgDataProc.setLineWidth(0x1a3); + i_Msg->mMsgDataProc.setCenterLineWidth(0x192); } else { - i_Msg->mMsgDataProc.lineWidth = 0x1f7; - i_Msg->mMsgDataProc.centerLineWidth = 0x1e6; + i_Msg->mMsgDataProc.setLineWidth(0x1f7); + i_Msg->mMsgDataProc.setCenterLineWidth(0x1e6); } - i_Msg->mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - i_Msg->mMsgDataProc.spaceTimer = 2; + i_Msg->mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + i_Msg->mMsgDataProc.setSpaceTimer(2); if (g_msgHIO.field_0x83 != 0) { - i_Msg->mMsgDataProc.spaceFlag = 1; + i_Msg->mMsgDataProc.setSpaceFlagOn(); } else { - i_Msg->mMsgDataProc.spaceFlag = 0; + i_Msg->mMsgDataProc.setSpaceFlagOff(); } dMsg_yose_select(i_Msg); if (i_Msg->mMesgEntry.mInitialSound != 0) { @@ -2462,7 +2332,7 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) { { i_Msg->mMsgDataProc.field_0x299 = 1; } - if (((i_Msg->mMsgDataProc.autoSendFlag == 0) && (i_Msg->mMsgDataProc.handSendFlag == 0)) && ((s32)i_Msg->mMsgDataProc.waitTimer != 0)) { + if (((i_Msg->mMsgDataProc.autoSendFlag == 0) && (i_Msg->mMsgDataProc.getHandSendFlag() == 0)) && (i_Msg->mMsgDataProc.get_waitTimer() !=0)) { i_Msg->mMsgDataProc.waitTimer = 0; #if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; @@ -2482,29 +2352,24 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) { /* 80213650-80213830 .text dMsg_closewaitProc__FP13sub_msg_class */ s32 dMsg_closewaitProc(sub_msg_class* i_Msg) { u8 bVar1; - u32 uVar3; if (i_Msg->mMsgDataProc.autoSendFlag != 0) { - uVar3 = (int)i_Msg->mMsgDataProc.waitTimer > 0 ? i_Msg->mMsgDataProc.waitTimer - 1 : 0; - i_Msg->mMsgDataProc.waitTimer = uVar3; - if ((uVar3 == 0) || (fopMsgM_checkMessageSend())) { - i_Msg->mMsgDataProc.autoSendFlag = 0; + if ((i_Msg->mMsgDataProc.dec_waitTimer() == 0) || (fopMsgM_checkMessageSend())) { + i_Msg->mMsgDataProc.setAutoSendFlagOff(); #if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; #endif i_Msg->mStatus = fopMsgStts_BOX_CLOSING_e; i_Msg->m1100 = 0; - i_Msg->mMsgDataProc.waitTimer = 0; + i_Msg->mMsgDataProc.set_waitTimerZero(); i_Msg->m116A++; dComIfGp_setMesgSendButton(i_Msg->m116A); } } else { if (i_Msg->mMsgDataProc.handSendFlag != 0) { - uVar3 = (int)i_Msg->mMsgDataProc.waitTimer > 0 ? i_Msg->mMsgDataProc.waitTimer - 1 : 0; - i_Msg->mMsgDataProc.waitTimer = uVar3; - if (uVar3 != 0) { + if (i_Msg->mMsgDataProc.dec_waitTimer() != 0) { if ((((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) || (fopMsgM_checkMessageSend())) && (!dComIfGp_checkMesgBgm())) { - i_Msg->mMsgDataProc.handSendFlag = 0; + i_Msg->mMsgDataProc.setHandSendFlagOff(); i_Msg->mStatus = fopMsgStts_BOX_CLOSING_e; bVar1 = i_Msg->mMesgEntry.mTextboxType; if ((bVar1 != 5) && (bVar1 != 0xe)) { @@ -2540,11 +2405,11 @@ s32 dMsg_closewaitProc(sub_msg_class* i_Msg) { /* 80213830-80213960 .text dMsg_finishProc__FP13sub_msg_class */ s32 dMsg_finishProc(sub_msg_class* i_Msg) { - if ((((((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) || (i_Msg->mMsgDataProc.selectFlag != 0)) || (fopMsgM_checkMessageSend())) || + if ((((((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) || (i_Msg->mMsgDataProc.getSelectFlag() != 0)) || (fopMsgM_checkMessageSend())) || (i_Msg->mMsgNo == 0x5ac && (dComIfGp_checkMesgCancelButton()))) && (!dComIfGp_checkMesgBgm())) { - i_Msg->mMsgDataProc.selectFlag = 0; + i_Msg->mMsgDataProc.setSelectFlagOff(); i_Msg->mStatus = fopMsgStts_BOX_CLOSING_e; if ((i_Msg->mMesgEntry.mTextboxType != 5) && (i_Msg->mMesgEntry.mTextboxType != 0xe)) { fopMsgM_setNowAlphaZero(&i_Msg->m050C); @@ -2620,14 +2485,10 @@ s32 dMsg_openItemProc(sub_msg_class* i_Msg) { /* 80213C20-80213E28 .text dMsg_openTactProc__FP13sub_msg_class */ s32 dMsg_openTactProc(sub_msg_class* i_Msg) { - u8 uVar2; - u8 cVar4; - u32 iVar3; - if (i_Msg->mMsgNo == 0x5ac) { i_Msg->mStatus = fopMsgStts_INPUT_e; } else if ((i_Msg->mMsgNo == 0x5b3) || (i_Msg->mMsgNo == 0x5b4)) { - uVar2 = dComIfGp_getMelodyNum(); + u8 uVar2 = dComIfGp_getMelodyNum(); if (((s32)uVar2 != 1) && ((s32)uVar2 != 5)) { dMsg_tactGuideShow(i_Msg, mBeatNum[uVar2]); i_Msg->mStatus = fopMsgStts_DEMO_e; @@ -2653,14 +2514,13 @@ s32 dMsg_openTactProc(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.field_0x299 = 1; i_Msg->mMsgDataProc.stringSet(); for (s32 i = 0; i < 8; i++) { - cVar4 = i_Msg->mMsgDataProc.field_0x281[i]; - iVar3 = i_Msg->mMsgDataProc.field_0x220[i]; - u32 var_r6 = iVar3; - if (((((u8)(cVar4 - 10U) <= 3) || (cVar4 == 0x15)) || (cVar4 == 0x17)) && (iVar3 == 0)) { - var_r6 = -1; + u8 iconNum = i_Msg->mMsgDataProc.getIconNum(i); + u32 iconColor = i_Msg->mMsgDataProc.getIconColor(i); + if ((iconNum == 0xA || iconNum == 0xB || iconNum == 0xC || iconNum == 0xD || iconNum == 0x15 || iconNum == 0x17) && iconColor == 0) { + iconColor = -1; } - if (((cVar4 != 0xFF) && (buttonTimer[i] == -1)) && (cVar4 != 0x14 && (cVar4 != 0x15 && (cVar4 != 0x16)))) { - fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], var_r6, cVar4); + if (((iconNum != 0xFF) && (buttonTimer[i] == -1)) && (iconNum != 0x14 && (iconNum != 0x15 && (iconNum != 0x16)))) { + fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], iconColor, iconNum); } } dMsg_setString(i_Msg); @@ -2700,7 +2560,7 @@ s32 dMsg_initProc(sub_msg_class* i_Msg) { const char* pcVar3; char acStack_28[24]; - if ((dComIfGp_checkCameraAttentionStatus(dComIfGp_getPlayerCameraID(0), dCamAttnStts_00000004_e)) || (fopMsgM_demoMsgFlagCheck())) { + if (dComIfGp_checkCameraAttentionStatus(dComIfGp_getPlayerCameraID(0), dCamAttnStts_00000004_e) || fopMsgM_demoMsgFlagCheck()) { pcVar3 = i_Msg->mpMesgStr; if (((u8)pcVar3[0] == 0x1A) && ((u8)pcVar3[2] == 0x02)) { dComIfGp_setMesgCameraTagInfo((s32)(u16)((((u8)pcVar3[3] << 8) & ~0xFFFF00FF) | (((u8)pcVar3[4]) & ~0xFF00))); @@ -2742,8 +2602,8 @@ s32 dMsg_initProc(sub_msg_class* i_Msg) { /* 802140CC-8021411C .text dMsg_tactProc__FP13sub_msg_class */ s32 dMsg_tactProc(sub_msg_class* i_Msg) { if (fopMsgM_checkMessageSend()) { - i_Msg->mMsgDataProc.autoSendFlag = 1; - i_Msg->mMsgDataProc.waitTimer = 30; + i_Msg->mMsgDataProc.setAutoSendFlagOn(); + i_Msg->mMsgDataProc.set_waitTimer(30); i_Msg->mStatus = fopMsgStts_CLOSE_WAIT_e; } return TRUE; @@ -2751,8 +2611,6 @@ s32 dMsg_tactProc(sub_msg_class* i_Msg) { /* 8021411C-802143A8 .text dMsg_outnowProc__FP13sub_msg_class */ s32 dMsg_outnowProc(sub_msg_class* i_Msg) { - u16 uVar2; - u8 cVar4; u32 iVar3; if (i_Msg->mMesgCameraTagInfo != dComIfGp_getMesgCameraTagInfo()) { @@ -2767,8 +2625,8 @@ s32 dMsg_outnowProc(sub_msg_class* i_Msg) { if (i_Msg->mMesgEntry.mDrawType == 0) { if (((CPad_CHECK_TRIG_A(0)) || (CPad_CHECK_TRIG_B(0))) && (!dComIfGp_checkMesgBgm())) { i_Msg->mMsgDataProc.field_0x299 = 1; - if ((i_Msg->mMsgDataProc.autoSendFlag == 0 && (i_Msg->mMsgDataProc.handSendFlag == 0)) && ((s32)i_Msg->mMsgDataProc.waitTimer != 0)) { - i_Msg->mMsgDataProc.waitTimer = 0; + if ((i_Msg->mMsgDataProc.autoSendFlag == 0 && (i_Msg->mMsgDataProc.getHandSendFlag() == 0)) && ((s32)i_Msg->mMsgDataProc.get_waitTimer() !=0)) { + i_Msg->mMsgDataProc.set_waitTimerZero(); #if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; #endif @@ -2782,27 +2640,25 @@ s32 dMsg_outnowProc(sub_msg_class* i_Msg) { ) { i_Msg->mMsgDataProc.field_0x299 = 1; } - if (((i_Msg->mMsgDataProc.autoSendFlag == 0) && (i_Msg->mMsgDataProc.handSendFlag == 0)) && ((int)i_Msg->mMsgDataProc.waitTimer != 0)) { - i_Msg->mMsgDataProc.waitTimer = (int)i_Msg->mMsgDataProc.waitTimer > 0 ? i_Msg->mMsgDataProc.waitTimer - 1 : 0; + if (((i_Msg->mMsgDataProc.getAutoSendFlag() == 0) && (i_Msg->mMsgDataProc.getHandSendFlag() == 0)) && (i_Msg->mMsgDataProc.get_waitTimer() != 0)) { + i_Msg->mMsgDataProc.dec_waitTimer(); } else { i_Msg->mMsgDataProc.stringSet(); - i_Msg->m1164 = i_Msg->mMsgDataProc.field_0x25C; + i_Msg->m1164 = i_Msg->mMsgDataProc.getStringColor(); i_Msg->mStatus = (u16)i_Msg->mMsgDataProc.mesgStatus; for (s32 i = 0; i < 8; i++) { - cVar4 = i_Msg->mMsgDataProc.field_0x281[i]; - iVar3 = i_Msg->mMsgDataProc.field_0x220[i]; - u32 var_r6 = iVar3; - if (((((u8)(cVar4 - 10U) <= 3) || (cVar4 == 0x15)) || (cVar4 == 0x15)) && (iVar3 == 0)) { - var_r6 = -1; + u8 iconNum = i_Msg->mMsgDataProc.getIconNum(i); + u32 iconColor = i_Msg->mMsgDataProc.getIconColor(i); + if ((iconNum == 0xA || iconNum == 0xB || iconNum == 0xC || iconNum == 0xD || iconNum == 0x15 || iconNum == 0x15) && iconColor == 0) { + iconColor = -1; } - if (((cVar4 != 0xFF) && (buttonTimer[i] == -1)) && (cVar4 != 0x14 && (cVar4 != 0x15 && (cVar4 != 0x16)))) { - fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], var_r6, cVar4); + if (iconNum != 0xFF && buttonTimer[i] == -1 && iconNum != 0x14 && iconNum != 0x15 && iconNum != 0x16) { + fopMsgM_outFontSet(button_icon[i], button_kage[i], &buttonTimer[i], iconColor, iconNum); } } - uVar2 = i_Msg->mStatus; - if (uVar2 == 7) { + if (i_Msg->mStatus == 7) { i_Msg->m1100 = 0; - } else if ((uVar2 == 10) && (i_Msg->mMsgDataProc.autoSendFlag == 0)) { + } else if (i_Msg->mStatus == 10 && i_Msg->mMsgDataProc.autoSendFlag == 0) { i_Msg->m1100 = 0; } } @@ -2812,9 +2668,12 @@ s32 dMsg_outnowProc(sub_msg_class* i_Msg) { /* 802143A8-80214560 .text dMsg_Draw__FP13sub_msg_class */ static BOOL dMsg_Draw(sub_msg_class* i_Msg) { - if ((i_Msg->mMesgEntry.mTextboxType != 5) && (fopMsgM_setAlpha(&i_Msg->m049C), i_Msg->mMesgEntry.mTextboxType != 0xe)) { - fopMsgM_setAlpha(&i_Msg->mPane_Arrow); - fopMsgM_setAlpha(&i_Msg->m050C); + if (i_Msg->mMesgEntry.mTextboxType != 5) { + fopMsgM_setAlpha(&i_Msg->m049C); + if (i_Msg->mMesgEntry.mTextboxType != 0xe) { + fopMsgM_setAlpha(&i_Msg->mPane_Arrow); + fopMsgM_setAlpha(&i_Msg->m050C); + } } fopMsgM_setAlpha(&i_Msg->m0544[0]); fopMsgM_setAlpha(&i_Msg->m0544[1]); @@ -2865,11 +2724,10 @@ static BOOL dMsg_Execute(sub_msg_class* i_Msg) { if (dComIfGp_checkMesgSendButton()) { dComIfGp_setMesgSendButton(0); } - if ((dComIfGp_checkMesgBgm()) && (i_Msg->mMesgEntry.mTextboxType != 9 || - ((((mDoAud_checkPlayingSubBgmFlag() != JA_BGM_ITEM_GET && (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_ITEM_GET_S)) && - (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_HEART)) && - (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_SONG && (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_MASTER_SWORD))) && - (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_PEARL)))) + if (dComIfGp_checkMesgBgm() && (i_Msg->mMesgEntry.mTextboxType != 9 || + (mDoAud_checkPlayingSubBgmFlag() != JA_BGM_ITEM_GET && mDoAud_checkPlayingSubBgmFlag() != JA_BGM_ITEM_GET_S && + mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_HEART && mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_SONG && + mDoAud_checkPlayingSubBgmFlag() != JA_BGM_MASTER_SWORD && mDoAud_checkPlayingSubBgmFlag() != JA_BGM_GET_PEARL))) { dComIfGp_setMesgBgmOff(); } @@ -3146,7 +3004,7 @@ static cPhs_State dMsg_Create(msg_class* i_this) { dComIfGp_setMesgSendButton(i_Msg->m116A); dComIfGp_setMesgCancelButton(0); mDoExt_setCurrentHeap(pJVar2); - message.field_0x4 = i_Msg; + message.setActorP(i_Msg); dComIfGp_setMesgStatus(i_Msg->mStatus); return cPhs_COMPLEATE_e; } diff --git a/src/d/d_picture_box.cpp b/src/d/d_picture_box.cpp index 82f5b387a..9d99a3460 100644 --- a/src/d/d_picture_box.cpp +++ b/src/d/d_picture_box.cpp @@ -1675,34 +1675,34 @@ void dJle_Pb_c::messageSet(u32 msgNo) { mMsgDataProc.setFont(font0); mMsgDataProc.setRubyFont(font1); - mMsgDataProc.charSpace = ((J2DTextBox*)pane_tx[0].pane)->mCharSpace; - mMsgDataProc.rubyCharSpace = ((J2DTextBox*)pane_tx[1].pane)->mCharSpace; - mMsgDataProc.lineSpace = ((J2DTextBox*)pane_tx[0].pane)->getLineSpace(); + mMsgDataProc.setCharSpace(((J2DTextBox*)pane_tx[0].pane)->mCharSpace); + mMsgDataProc.setRubyCharSpace(((J2DTextBox*)pane_tx[1].pane)->mCharSpace); + mMsgDataProc.setLineSpace(((J2DTextBox*)pane_tx[0].pane)->getLineSpace()); mMsgDataProc.setMesgEntry(&mMsgEntry); - mMsgDataProc.fontSize = tx0FontSizeX; - mMsgDataProc.rubyFontSize = tx1FontSizeX; + mMsgDataProc.setFontSize(tx0FontSizeX); + mMsgDataProc.setRubyFontSize(tx1FontSizeX); - mMsgDataProc.lineWidth = 0x1F7; - mMsgDataProc.centerLineWidth = 0x1E6; + mMsgDataProc.setLineWidth(0x1F7); + mMsgDataProc.setCenterLineWidth(0x1E6); - mMsgDataProc.sendSpeed = g_msgHIO.field_0x82; - mMsgDataProc.spaceTimer = g_msgHIO.field_0x6c; + mMsgDataProc.setSendSpeed(g_msgHIO.field_0x82); + mMsgDataProc.setSpaceTimer(g_msgHIO.field_0x6c); mMsgDataProc.field_0x299 = 1; if (g_msgHIO.field_0x83 != 0) { - mMsgDataProc.spaceFlag = 1; + mMsgDataProc.setSpaceFlagOn(); } else { - mMsgDataProc.spaceFlag = 0; + mMsgDataProc.setSpaceFlagOff(); } mMsgDataProc.stringLength(); mMsgDataProc.stringShift(); mMsgDataProc.iconIdxRefresh(); - mMsgLineCount = mMsgDataProc.lineCount; - mMsgDataProc.lineCount = 0; + mMsgLineCount = mMsgDataProc.getLineCount(); + mMsgDataProc.setLineCount(0); f32 yShift = ((VERSION_SELECT(1, 1, 2, 2) - mMsgLineCount) * (((J2DTextBox*)pane_tx[0].pane)->getLineSpace() / 2.0f)); @@ -1719,8 +1719,8 @@ void dJle_Pb_c::messageSet(u32 msgNo) { for (int i = 0; i < 15; i++) { int halfLine = ((J2DTextBox*)pane_tx[0].pane)->getLineSpace() / 2.0f; - u8 icon = mMsgDataProc.field_0x281[i]; - u32 fontData = mMsgDataProc.field_0x25C; + u8 icon = mMsgDataProc.getIconNum(i); + u32 fontColor = mMsgDataProc.getStringColor(); if (icon == 20) { mChoiceCursorX0 = (int)( @@ -1777,7 +1777,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) { mMsgIconFontMainPic, mMsgIconFontSubPic, &mMsgIconDrawState, - fontData, + fontColor, icon ); } @@ -2170,12 +2170,12 @@ void dJle_Pb_c::draw() { VERSION_SELECT(29.0f, 29.0f, g_msgHIO.field_0x70, g_msgHIO.field_0x70) ); } else { - u8 iconNo = mMsgDataProc.field_0x281[idx]; + u8 iconNo = mMsgDataProc.getIconNum(idx); if (iconNo != 0xFF && iconNo != 20 && iconNo != 0x15) { int posX = mMsgDataProc.getIconPosX(idx); int posY = mMsgDataProc.getIconPosY(idx); - u32 color = mMsgDataProc.getIconColor(idx); + int scale = mMsgDataProc.getIconScale(idx); J2DTextBox* base = (J2DTextBox*)pane_tx[0].pane; f32 lineSpace = base->getLineSpace(); int r9 = (int)(lineSpace / 2.0f); @@ -2189,7 +2189,7 @@ void dJle_Pb_c::draw() { mMsgIconFontSubPic, r5, r6, - color, + scale, &mMsgIconDrawState, alpha, iconNo @@ -2232,12 +2232,12 @@ void dJle_Pb_c::draw() { VERSION_SELECT(29.0f, 29.0f, g_msgHIO.field_0x70, g_msgHIO.field_0x70) ); } else { - u8 iconNo = mMsgDataProc.field_0x281[idx]; + u8 iconNo = mMsgDataProc.getIconNum(idx); if (iconNo != 0xFF && iconNo != 20 && iconNo != 0x15) { int posX = mMsgDataProc.getIconPosX(idx); int posY = mMsgDataProc.getIconPosY(idx); - u32 color = mMsgDataProc.getIconColor(idx); + int scale = mMsgDataProc.getIconScale(idx); J2DTextBox* base = (J2DTextBox*)pane_tx[0].pane; f32 lineSpace = base->getLineSpace(); int r9 = (int)(lineSpace / 2.0f); @@ -2251,7 +2251,7 @@ void dJle_Pb_c::draw() { mMsgIconFontSubPic, r5, r6, - color, + scale, &mMsgIconDrawState, alpha, iconNo diff --git a/src/d/d_s_title.cpp b/src/d/d_s_title.cpp index cf7d9fa29..a982c27b1 100644 --- a/src/d/d_s_title.cpp +++ b/src/d/d_s_title.cpp @@ -123,7 +123,7 @@ static cPhs_State dScnTitle_Create(scene_class* i_scn) { #if VERSION == VERSION_PAL dScnTitle_c::mMp = NULL; if (fpcM_GetName(i_this) == fpcNm_ENDING_SCENE_e) { - fopMsgM_Create(fpcNm_MESG_e, NULL, NULL); + fopMsgM_Create(fpcNm_MSG3_e, NULL, NULL); } #endif diff --git a/src/d/d_scope.cpp b/src/d/d_scope.cpp index 0120ab466..7ab24e743 100644 --- a/src/d/d_scope.cpp +++ b/src/d/d_scope.cpp @@ -82,7 +82,7 @@ void dDlst_2DSCP_c::outFontDraw() { u8 icon_no = mpScp->mMesgDataProc.getIconNum(i); int pos_x = mpScp->mMesgDataProc.getIconPosX(i); int pos_y = mpScp->mMesgDataProc.getIconPosY(i); - u32 color = mpScp->mMesgDataProc.getIconColor(i); + int scale = mpScp->mMesgDataProc.getIconScale(i); int line = mpScp->mpTextBox->getLineSpace() / 2; if (icon_no != 0xFF) { @@ -90,7 +90,7 @@ void dDlst_2DSCP_c::outFontDraw() { // for some reason y computation only match if split in two int y = line * (VERSION_SELECT(1, 1, 2, 2) - mpScp->mLineCount + pos_y * 2); int y2 = y + mpScp->mpTextBox->getBounds().i.y; - fopMsgM_outFontDraw(sbutton_icon[i], sbutton_kage[i], x, y2, color, &sbuttonTimer[i], 0xFF, icon_no); + fopMsgM_outFontDraw(sbutton_icon[i], sbutton_kage[i], x, y2, scale, &sbuttonTimer[i], 0xFF, icon_no); } } } diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index a6e58da80..4e29e6f2b 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -3,9 +3,6 @@ #include "JSystem/JKernel/JKRArchive.h" #include "JSystem/JUtility/JUTDataHeader.h" #include "d/d_meter.h" -#if VERSION <= VERSION_JPN -#include "d/d_s_play.h" -#endif #include "f_op/f_op_scene_mng.h" #include "f_pc/f_pc_manager.h" #include "f_pc/f_pc_layer_iter.h" @@ -20,6 +17,9 @@ #include "SSystem/SComponent/c_malloc.h" #include "m_Do/m_Do_controller_pad.h" #include +#if VERSION <= VERSION_JPN +#include "d/d_s_play.h" +#endif STControl stick; @@ -597,7 +597,7 @@ char* fopMsgM_messageGet(char* i_dest, u32 i_msgNo) { #endif ) ) { - s32 bufLen = strlen(dstBuf); + size_t bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); @@ -671,7 +671,7 @@ char* fopMsgM_passwordGet(char* i_dest, u32 i_msgNo) { #endif ) ) { - s32 bufLen = strlen(dstBuf); + size_t bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); @@ -1578,7 +1578,7 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0x14 = 0.0f; field_0x18 = 0.0f; field_0x1C = 0.0f; - field_0x20 = 0.0f; + nowCursorPos = 0.0f; field_0x24 = 0.0f; field_0x28 = 0.0f; @@ -1589,7 +1589,7 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0xE8[i] = 0; } - field_0x21C = 0; + selectLength = 0; field_0xD4[2] = 0; field_0xD4[1] = 0; field_0xD4[0] = 0; @@ -1616,8 +1616,8 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { waitTimer = 0; spaceTimer = 1; sendSpeed = 1; - field_0x164 = 0; - field_0x25C = -1; + keyWaitTimer = 0; + stringColor = -1; field_0x29D = 0; field_0x260 = 0; field_0x264 = 0.0f; @@ -1637,14 +1637,14 @@ fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { field_0x280 = 0; for (int i = 0; i < 0xF; i++) { - field_0x168[i] = 0; - field_0x1A4[i] = 0; - field_0x1E0[i] = 0; - field_0x281[i] = 0xFF; - field_0x220[i] = 0; + iconPosX[i] = 0; + iconPosY[i] = 0; + iconScale[i] = 0; + iconNum[i] = 0xFF; + iconColor[i] = 0; } - field_0x10 = 0; + actorPosition = NULL; field_0x299 = 0; field_0x29A = 0; selectFlag = 0; @@ -1666,7 +1666,7 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0x14 = 0.0f; field_0x18 = 0.0f; field_0x1C = 0.0f; - field_0x20 = 0.0f; + nowCursorPos = 0.0f; field_0x24 = 0.0f; field_0x28 = 0.0f; for (int i = 0; i < 4; i++) { @@ -1675,7 +1675,7 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0xE8[i] = 0; field_0x108[i] = 0; } - field_0x21C = 0; + selectLength = 0; field_0xD4[2] = 0; field_0xD4[1] = 0; field_0xD4[0] = 0; @@ -1702,7 +1702,7 @@ void fopMsgM_msgDataProc_c::dataInit() { waitTimer = 0; spaceTimer = 1; sendSpeed = 1; - field_0x164 = 0; + keyWaitTimer = 0; field_0x29D = 0; field_0x260 = 0; field_0x264 = 0.0f; @@ -1721,11 +1721,11 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0x27F = 0; field_0x280 = 0; for (int i = 0; i < 0xF; i++) { - field_0x168[i] = 0; - field_0x1A4[i] = 0; - field_0x1E0[i] = 0; - field_0x281[i] = 0xFF; - field_0x220[i] = 0; + iconPosX[i] = 0; + iconPosY[i] = 0; + iconScale[i] = 0; + iconNum[i] = 0xFF; + iconColor[i] = 0; } field_0x299 = 0; field_0x29A = 0; @@ -1743,9 +1743,9 @@ void fopMsgM_msgDataProc_c::dataInit() { /* 8002E95C-8002EA58 .text charLength__21fopMsgM_msgDataProc_cFiib */ f32 fopMsgM_msgDataProc_c::charLength(int i_scale, int i_charNo, bool param_2) { JUTFont::TWidth width; - font[0]->getWidthEntry(i_charNo, &width); + font->getWidthEntry(i_charNo, &width); f32 charWidth = (f32)(int)width.field_0x1; - f32 cellWidth = (f32)i_scale / (f32)font[0]->getCellWidth(); + f32 cellWidth = (f32)i_scale / (f32)font->getCellWidth(); if (param_2) { return charWidth * cellWidth; @@ -1757,9 +1757,9 @@ f32 fopMsgM_msgDataProc_c::charLength(int i_scale, int i_charNo, bool param_2) { /* 8002EA58-8002EB4C .text rubyLength__21fopMsgM_msgDataProc_cFib */ f32 fopMsgM_msgDataProc_c::rubyLength(int i_charNo, bool param_2) { JUTFont::TWidth width; - font[1]->getWidthEntry(i_charNo, &width); + rubyFont->getWidthEntry(i_charNo, &width); s32 advance = width.field_0x1; - f32 width2 = font[1]->getCellWidth(); + f32 width2 = rubyFont->getCellWidth(); f32 temp = ((s32)rubyFontSize / width2); if (param_2) { return advance * temp; @@ -1770,7 +1770,587 @@ f32 fopMsgM_msgDataProc_c::rubyLength(int i_charNo, bool param_2) { /* 8002EB4C-80031064 .text stringLength__21fopMsgM_msgDataProc_cFv */ u32 fopMsgM_msgDataProc_c::stringLength() { - /* Nonmatching */ + int sp18[4]; + int sp14 = 0; + int sp10 = 0; + u32 r30 = 0; + int r29 = count; + f32 sp0C = 0.0f; + bool r28 = false; + bool r27 = false; + lineCount = 0; + int sp08 = fontSize; + field_0x148 = fontSize; + for (int i = 0; i < 4; i++) { + sp18[i] = 0; + field_0xD8[i] = 0; + field_0xE8[i] = 0; + field_0x108[i] = 0; + } + + while (bmgData[r29] != '\0') { + if (bmgData[r29 + 0] == 0x1A) { + if ((u8)bmgData[r29 + 2] == 0xFF && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 1) { + f32 temp2 = (int)(((u8)bmgData[r29 + 5] << 8) | (u8)bmgData[r29 + 6]); + f32 f31 = temp2 * 0.01f; + if (f31 > 1.0f) { + r28 = true; + } + sp08 = f31 * fontSize + 0.5f; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0) { + char sp50[20]; + int r26 = 0; + strcpy(sp50, dComIfGs_getPlayerName()); +#if VERSION > VERSION_JPN + if ( + dComIfGs_getPalLanguage() == 1 && + ( +#if VERSION == VERSION_USA + mesgEntry->mMsgNo == 0x33B || + mesgEntry->mMsgNo == 0xC8B || + mesgEntry->mMsgNo == 0x1D21 || + mesgEntry->mMsgNo == 0x31D7 || + mesgEntry->mMsgNo == 0x37DD || + mesgEntry->mMsgNo == 0x37DE +#elif VERSION == VERSION_PAL + mesgEntry->mMsgNo == 0xC8B || + mesgEntry->mMsgNo == 0x1D21 || + mesgEntry->mMsgNo == 0x31D7 +#endif + ) + ) { + size_t bufLen = strlen(sp50); + char current = (sp50)[bufLen - 1]; + if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { + strcat(sp50, "\'"); + } else { + strcat(sp50, "s"); + } + } +#endif + while (sp50[r26] != '\0') { + int r5; +#if VERSION == VERSION_PAL + if (mesgEntry->mTextboxType == 0xC) +#endif + { + if ((((u8)sp50[r26 + 0] >> 4) & 0x0F) == 8 || (((u8)sp50[r26 + 0] >> 4) & 0x0F) == 9) { + r5 = ((u8)sp50[r26++] << 8); + r5 |= (u8)sp50[r26++]; + } else { + r5 = (u8)sp50[r26++]; + } + } +#if VERSION == VERSION_PAL + else { + r5 = (u8)sp50[r26++]; + } +#endif + + f32 f1; + if (sp10 != 0) { + f1 = charLength(sp08, r5, false) + sp0C; + } else { + f1 = charLength(sp08, r5, true); + } + sp0C = f1; + sp10 += 1; + } + sp18[sp14] = (int)(sp0C + 0.5f); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 8) { + r27 = true; + for (int i = 0; i < sp14; i++) { + field_0xD8[i] = sp18[i]; + } + lineCount = sp14 - 1; + sp14 = 0; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 9) { + r27 = true; + for (int i = 0; i < sp14; i++) { + field_0xD8[i] = sp18[i]; + sp18[i] = 0; + } + lineCount = sp14 - 1; + sp14 = 0; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xA) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xB) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xC) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xD) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xE) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0xF) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x10) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x11) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x12) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x13) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x14) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x15) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x16) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x17) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x18) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x19) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1A) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1B) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1C) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1D) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1E) { + sp0C += (f32)sp08; + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x1F) { + sp0C += (f32)sp08; + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x39) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3A) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x20) { + tag_len_kaisen_game(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ( + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x21) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x24) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x25) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2C) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x36) + ) { + tag_len_rupee(&sp10, &sp0C, sp18, &sp08, &sp14); + #endif + } else if ( + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x22) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x23) + ) { + int r26 = 0; + char sp3C[20]; + if ((u8)bmgData[r29 + 4] == 0x22) { + u32 msgNo = dComIfGp_getNpcNameMessageID(); + getString(sp3C, msgNo); + } else if ((u8)bmgData[r29 + 4] == 0x23) { + u32 msgNo = dComIfGp_getItemNameMessageID(); + getString(sp3C, msgNo); + } + while (sp3C[r26] != '\0') { + int r5 = (u8)sp3C[r26++]; + f32 f1; + if (sp10 != 0) { + f1 = charLength(sp08, r5, false) + sp0C; + } else { + f1 = charLength(sp08, r5, true); + } + sp0C = f1; + sp10 += 1; + } + sp18[sp14] = (int)(sp0C + 0.5f); + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x26) { + tag_len_num_input(&sp10, &sp0C, sp18, &sp08, &sp14); + #endif + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x27) { + sp0C += (f32)sp08; + sp10 += 1; + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x28) { + tag_len_sword_game(&sp10, &sp0C, sp18, &sp08, &sp14); + #endif + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x29) { + int r26 = 0; + char sp28[20]; + u32 msgNo = 0x1B37 + dComIfGs_getEventReg(dSv_event_flag_c::UNK_BA0F); + getString(sp28, msgNo); + while (sp28[r26] != '\0') { + int r5 = (u8)sp28[r26++]; + f32 f1; + if (sp10 != 0) { + f1 = charLength(sp08, r5, false) + sp0C; + } else { + f1 = charLength(sp08, r5, true); + } + sp0C = f1; + sp10 += 1; + } + sp18[sp14] = (int)(sp0C + 0.5f); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2A) { + if (field_0x295 == 0 && lineCount == 0 && field_0x14 == 0.0f) { + field_0x295 = 1; + } + sp0C += (f32)sp08; + sp18[sp14] = (int)(sp0C + 0.5f); + sp10 += 1; + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2B) { + tag_len_letter_game(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3B) { + tag_len_letter_game_max(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3C) { + tag_len_fish(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3D) { + tag_len_fish_rupee(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2D) { + tag_len_letter(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2E) { + tag_len_rescue(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x2F) { + tag_len_forest_timer(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ( + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x30) || + ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x31) + ) { + tag_len_birdman(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x32) { + tag_len_point(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x33) { + tag_len_get_pendant(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x34) { + tag_len_rev_pendant(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x35) { + tag_len_pig_timer(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x37) { + tag_len_get_bomb(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x38) { + tag_len_get_arrow(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3E) { + tag_len_stock_bokobaba(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x3F) { + tag_len_stock_dokuro(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x40) { + tag_len_stock_chuchu(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x41) { + tag_len_stock_pendant(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x42) { + tag_len_stock_hane(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x43) { + tag_len_stock_kenshi(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x44) { + tag_len_terry_rupee(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x45) { + tag_len_input_bokobaba(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x46) { + tag_len_input_dokuro(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x47) { + tag_len_input_chuchu(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x48) { + tag_len_input_pendant(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x49) { + tag_len_input_hane(&sp10, &sp0C, sp18, &sp08, &sp14); + } else if ((u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 0x4A) { + tag_len_input_kenshi(&sp10, &sp0C, sp18, &sp08, &sp14); + #endif + } + r29 += bmgData[r29 + 1]; + } else { + if (field_0x295 != 0 && bmgData[r29] != 0) { + field_0x295 = 0; + } + if (bmgData[r29 + 0] == 0xA) { + sp10 = 0; + sp0C = 0.0f; + + r29++; + if (bmgData[r29 + 0] == 0) { + f32 f3 = (int)(field_0x28 + field_0x1C / 2.0f - field_0x18 / 2.0f + 0.5f); + f32 f31; + if (field_0x24 < f3) { + f31 = f3 - field_0x24; + } else if (field_0x24 == 0.0f) { + f31 = field_0x24 - f3; + } + + field_0x140 = aimLine; + } + + if (!r27) { + if (r28) { + if (aimLine == nowLine) { + sp14++; + lineCount++; + } else { + nowLine++; + } + r28 = false; + } + if (aimLine == nowLine) { + sp14++; + if (sp14 >= mesgEntry->field_0x16) { + if ( + ((u8)bmgData[r29 + 0] == 0x1A && (u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 8) || + ((u8)bmgData[r29 + 0] == 0x1A && (u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 9) + ) { + r27 = true; + for (int i = 0; i < sp14; i++) { + field_0xD8[i] = sp18[i]; + } + lineCount = sp14 - 1; + sp14 = 0; + r29 += bmgData[r29 + 1]; + } else { + for (int i = 0; i < 4; i++) { + field_0xD8[i] = sp18[i]; + } + field_0x134 = lineCount; + return r30; + } + } + } else { + nowLine++; + r30 = r29; + sp18[0] = 0; + } + continue; + } else if (r27) { + field_0xE8[sp14] = sp18[sp14]; + } + sp14++; + } else { + int r28; + bool r25; +#if VERSION == VERSION_PAL + if (mesgEntry->mTextboxType == 0xC) +#endif + { + if (((u8)bmgData[r29 + 0] >> 4) == 8 || ((u8)bmgData[r29 + 0] >> 4) == 9) { + r28 = ((u8)bmgData[r29] << 8) | (u8)bmgData[r29 + 1]; + if ( + dComIfGs_getClearCount() == 0 +#if VERSION < VERSION_PAL + && mesgEntry->mTextboxType == 0xC +#endif + ) { + for (int i = 0; i < ARRAY_SIZE(zfont); i++) { + if (zfont[i][0] == (u16)r28) { + r28 = zfont[i][1]; + break; + } + } + } + r25 = false; + } else { + r28 = (u8)bmgData[r29]; + r25 = true; + } + } +#if VERSION == VERSION_PAL + else { + r28 = (u8)bmgData[r29]; + r25 = true; + } +#endif + + f32 f1; + if (sp10 != 0) { + f1 = charLength(sp08, r28, false) + sp0C; + } else { + f1 = charLength(sp08, r28, true); + } + sp0C = f1; + sp10 += 1; + + int r7 = sp18[sp14]; + sp18[sp14] = (int)((f32)(f64)sp0C + 0.5f); + if (!r27) { + if (sp14 != lineCount) { + lineCount++; + } + } + + if (lineWidth <= sp18[sp14]) { + sp18[sp14] = r7; + sp14++; + sp10 = 1; + sp0C = 0.0f; + + if (bmgData[r29] == '\0') { + field_0x140 = aimLine; + } + + if (aimLine == nowLine) { + if (sp14 >= mesgEntry->field_0x16) { + if ( + ((u8)bmgData[r29 + 0] == 0x1A && (u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 8) || + ((u8)bmgData[r29 + 0] == 0x1A && (u8)bmgData[r29 + 2] == 0 && (u8)bmgData[r29 + 3] == 0 && (u8)bmgData[r29 + 4] == 9) + ) { + r27 = true; + for (int i = 0; i < sp14; i++) { + field_0xD8[i] = sp18[i]; + } + lineCount = sp14 - 1; + sp14 = 0; + r29 += bmgData[r29 + 1]; + } else { + field_0x134 = lineCount; + for (int i = 0; i < 4; i++) { + field_0xD8[i] = sp18[i]; + } + return r30; + } + } else { + sp0C = charLength(sp08, r28, false); + sp18[sp14] = sp0C + 0.5f; + } + } else { + nowLine++; + sp14 = 0; + lineCount = 0; + sp18[0] = 0; + sp0C = charLength(sp08, r28, false); + sp18[sp14] = sp0C + 0.5f; + } + } + + if (r25) { + r29++; + } else { + r29 += 2; + } + } + } + } + + if (bmgData[r29] == '\0') { + field_0x140 = aimLine; + } + + if (r27) { + field_0xE8[sp14] = sp18[sp14]; + } else { + for (int i = 0; i < 4; i++) { + field_0xD8[i] = sp18[i]; + } + if (field_0x295 != 0 && lineCount == 0 && r28) { + lineCount = 1; + } + } + + field_0x134 = lineCount; + + return r30; } /* 800310E4-800312B4 .text stringShift__21fopMsgM_msgDataProc_cFv */ @@ -1781,18 +2361,18 @@ void fopMsgM_msgDataProc_c::stringShift() { /* 800312B4-80031420 .text iconSelect__21fopMsgM_msgDataProc_cFiUc */ 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; - field_0x220[field_0x280] = field_0x25C; + iconNum[field_0x280] = i_iconNo; + iconPosX[field_0x280] = nowCursorPos; + iconPosY[field_0x280] = lineCount; + iconScale[field_0x280] = param_1; + iconColor[field_0x280] = stringColor; field_0x280++; } if (i_iconNo != 0x16) { field_0x150++; field_0x14 += param_1; - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; char buf[16]; sprintf(buf, "\x1B""CR[%d]", param_1); strcat(field_0x60, buf); @@ -1804,7 +2384,7 @@ void fopMsgM_msgDataProc_c::iconSelect(int param_1, u8 i_iconNo) { /* 80031420-8003144C .text iconIdxRefresh__21fopMsgM_msgDataProc_cFv */ void fopMsgM_msgDataProc_c::iconIdxRefresh() { for (int i = 0; i < 0xF; i++) { - field_0x281[i] = 0xFF; + iconNum[i] = 0xFF; } field_0x280 = 0; @@ -1856,20 +2436,18 @@ u8 fopMsgM_msgDataProc_c::selectCheck2(J2DPane* param_1, int param_2, int param_ field_0x268 = param_1->getHeight() / 2.0f; field_0x278 = g_msgHIO.field_0x70; field_0x274 = g_msgHIO.field_0x70; - int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; - field_0x164 = temp; - if (!temp) { + if (dec_keyWaitTimer() == 0) { if (g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { if (field_0x27D == 1) { field_0x27D = 0; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } else if (g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { if (field_0x27D == 0) { field_0x27D = 1; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } @@ -1886,28 +2464,26 @@ u8 fopMsgM_msgDataProc_c::selectCheck3(J2DPane* param_1, int param_2, int param_ field_0x268 = param_1->getHeight() / 2.0f; field_0x278 = g_msgHIO.field_0x70; field_0x274 = g_msgHIO.field_0x70; - int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; - field_0x164 = temp; - if (!temp) { + if (dec_keyWaitTimer() == 0) { if (g_mDoCPd_cpadInfo[0].mMainStickPosY > 0.7f) { if (field_0x27D == 1) { field_0x27D = 0; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } else if (field_0x27D == 2) { field_0x27D = 1; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } else if (g_mDoCPd_cpadInfo[0].mMainStickPosY < -0.7f) { if (field_0x27D == 0) { field_0x27D = 1; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } else if (field_0x27D == 1) { field_0x27D = 2; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } @@ -1924,20 +2500,18 @@ u8 fopMsgM_msgDataProc_c::selectCheckYoko(J2DPane* param_1, int param_2, int par field_0x268 = param_1->getHeight() / 2.0f; field_0x278 = g_msgHIO.field_0x70; field_0x274 = g_msgHIO.field_0x70; - int temp = field_0x164 > 0 ? field_0x164 - 1 : 0; - field_0x164 = temp; - if (!temp) { + if (dec_keyWaitTimer() == 0) { if (g_mDoCPd_cpadInfo[0].mMainStickPosX < -0.7f) { if (field_0x27D == 1) { field_0x27D = 0; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } else if (g_mDoCPd_cpadInfo[0].mMainStickPosX > 0.7f) { if (field_0x27D == 0) { field_0x27D = 1; - field_0x164 = 10; + keyWaitTimer = 10; mDoAud_seStart(JA_SE_TALK_CURSOR); } } @@ -2064,7 +2638,9 @@ void fopMsgM_msgDataProc_c::colorAnime(J2DPicture* i_pic) { /* 800322B4-80034F3C .text stringSet__21fopMsgM_msgDataProc_cFv */ void fopMsgM_msgDataProc_c::stringSet() { - /* Nonmatching */ + /* Nonmatching - regswap */ + s8 r30 = g_msgHIO.field_0x6c; + field_0x60 = field_0x40; field_0x64 = field_0x44; field_0x68 = field_0x48; @@ -2093,7 +2669,7 @@ void fopMsgM_msgDataProc_c::stringSet() { 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 (dComIfGp_roomControl_getStayNo() != 0) { mDoAud_messageSePlay(0, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); } else { mDoAud_messageSePlay(0, 0, 0); @@ -2119,81 +2695,24 @@ 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) { - return; - } + while (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) { + field_0x27F = 0; + field_0x64[field_0x34] = '\0'; + field_0x6C[field_0x38] = '\0'; + strcat(field_0x64, field_0x70); + strcat(field_0x6C, field_0x70); + } - 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) { - 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 == fopMsgStts_SELECT_2_e || mesgStatus == fopMsgStts_SELECT_3_e || - mesgStatus == fopMsgStts_SELECT_YOKO_e || mesgStatus == fopMsgStts_INPUT_e - ) { - 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()) { - mDoAud_messageSePlay(0, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); - } else { - mDoAud_messageSePlay(0, 0, 0); - } - } - - if (fopMsgM_nextMsgFlagCheck()) { - if (mesgEntry->mNextMsgNo != 0) { - fopMsgM_messageSet(mesgEntry->mNextMsgNo); - mesgStatus = fopMsgStts_MSG_CONTINUES_e; - } else { - mesgStatus = fopMsgStts_MSG_ENDS_e; - } - } else { - if (getAutoSendFlag() || getHandSendFlag()) { - mesgStatus = fopMsgStts_CLOSE_WAIT_e; - } else { - mesgStatus = fopMsgStts_MSG_DISPLAYED_e; - } - } - } - - 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) { - 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 (bmgData[count + 0] == 0x1A) { + if ((u8)bmgData[count + 2] == 0xFF && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 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) @@ -2209,12 +2728,12 @@ void fopMsgM_msgDataProc_c::stringSet() { 0x505050FF, 0xFFB400FF, }; - field_0x25C = colorTable[temp[5]]; - char buf[16]; - sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); - strcat(field_0x60, buf); + stringColor = colorTable[bmgData[count + 5]]; + char spF0[32]; + sprintf(spF0, "\x1B""CC[%08x]\x1B""GM[0]", stringColor); + strcat(field_0x60, spF0); } else { - if (temp[5] > -1 && temp[5] < 9) { + if (bmgData[count + 5] >= 0 && bmgData[count + 5] <= 8) { if (mesgEntry->mTextboxType == 2 || mesgEntry->mTextboxType == 6 || mesgEntry->mTextboxType == 7) { static const u32 colorTable[9] = { 0x00000000, @@ -2227,124 +2746,157 @@ void fopMsgM_msgDataProc_c::stringSet() { 0x50505000, 0xFFB40000, }; - field_0x25C = colorTable[mesgEntry->mTextboxType]; - char buf[16]; - sprintf(buf,"\x1B""CC[%08x]\x1B""GC[%08x]", field_0x25C | field_0x290, field_0x25C | field_0x291); - strcat(field_0x60, buf); + stringColor = colorTable[bmgData[count + 5]]; + char spD0[32]; + u32 r5 = stringColor; + r5 |= field_0x290; + u32 r6 = stringColor; + r6 |= field_0x291; + sprintf(spD0,"\x1B""CC[%08x]\x1B""GC[%08x]", r5, r6); + strcat(field_0x60, spD0); + } else if (mesgEntry->mTextboxType == 0xB) { + static const u32 colorTable[9] = { + 0x000000FF, + 0xB40000FF, + 0x008282FF, + 0x0000AAFF, + 0xE67D0FFF, + 0x82FFFFFF, + 0x6400FFFF, + 0x3C3C3CFF, + 0xFFB400FF, + }; + stringColor = colorTable[bmgData[count + 5]]; + char spB4[28]; + sprintf(spB4, "\x1B""CC[%08x]\x1B""GM[0]", stringColor); + strcat(field_0x60, spB4); + } else { + stringColor = fopMsgM_getColorTable(bmgData[count + 5]); + char sp98[28]; + sprintf(sp98, "\x1B""CC[%08x]\x1B""GM[0]", stringColor); + strcat(field_0x60, sp98); } - } else if (temp[5] == 0xB) { - static const u32 colorTable[9] = { - 0x000000FF, - 0xB40000FF, - 0x008282FF, - 0x0000AAFF, - 0xE67D0FFF, - 0x82FFFFFF, - 0x6400FFFF, - 0x3C3C3CFF, - 0xFFB400FF, - }; - field_0x25C = colorTable[temp[5]]; - char buf[16]; - sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); - strcat(field_0x60, buf); - } else { - field_0x25C = fopMsgM_getColorTable(temp[5]); - char buf[16]; - sprintf(buf, "\x1B""CC[%08x]\x1B""GM[0]", field_0x25C); - strcat(field_0x60, buf); } } count += bmgData[count + 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; + } else if ((u8)bmgData[count + 2] == 0xFF && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 1) { + f32 temp2 = (int)(((u8)bmgData[count + 5] << 8) | (u8)bmgData[count + 6]); + f32 f31 = temp2 * 0.01f; + int temp3 = field_0x148; + field_0x148 = fontSize * f31 + 0.5f; 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 (f31 > 1.0f && field_0x29D == 0) { field_0x29D = 1; } } else { - if (temp2 * 0.1f > 1.0f && field_0x29D == 0) { + if (f31 > 1.0f && field_0x29D == 0) { strcat(field_0x60, "\n"); strcat(field_0x64, "\n"); strcat(field_0x68, "\n"); strcat(field_0x6C, "\n"); - char buf[16]; - sprintf(buf, "\x1B""CR[%d]", field_0x20); - strcat(field_0x60, buf); - strcat(field_0x68, buf); + char sp74[16]; + sprintf(sp74, "\x1B""CR[%d]", (int)nowCursorPos); + strcat(field_0x60, sp74); + strcat(field_0x68, sp74); field_0x29D = 1; } fopMsgM_setFontsizeCenter2(field_0x60, field_0x68, field_0x64, field_0x6C, temp3, field_0x148, fontSize, lineSpace); } count += bmgData[count + 1]; - } else if (temp[2] == 0xFF && temp[3] == 0 && temp[4] == 2) { - if (temp[1] != 5) { + } else if ((u8)bmgData[count + 2] == 0xFF && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 2) { +#if VERSION < VERSION_PAL + if ((u8)bmgData[count + 1] != 5) { + int r28 = count + (u8)bmgData[count + 1]; strcpy(field_0x70, ""); field_0x18 = 0.0f; field_0x1C = 0.0f; - field_0x28 = field_0x20; - field_0x154 = bmgData[count + 5]; + field_0x28 = nowCursorPos; + field_0x154 = (u8)bmgData[count + 5]; count += 6; - while (count < origOffset + temp[2]) { + while (r28 > count) { char buf[3]; buf[0] = bmgData[count]; buf[1] = bmgData[count + 1]; buf[2] = '\0'; + int c = (u8)bmgData[count] << 8 | (u8)bmgData[count + 1]; strcat(field_0x70, buf); - u16 temp2 = *(u16*)(&bmgData[count]); if (field_0x29B == 0) { - field_0x18 = rubyLength(temp2, true); + field_0x18 = rubyLength(c, true); field_0x29B = 1; } else { - field_0x18 += rubyLength(temp2, false); + field_0x18 += rubyLength(c, false); } count += 2; } + } else +#endif + { + count += (u8)bmgData[count + 1]; } - } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 0) { - char buf[12]; - strcpy(buf, dComIfGs_getPlayerName()); - if ( + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0) { + char sp84[20]; + int r28 = 0; + strcpy(sp84, dComIfGs_getPlayerName()); + #if VERSION > VERSION_JPN + if ( dComIfGs_getPalLanguage() == 1 && -#endif - (mesgEntry->mMsgNo == 0x33B || - mesgEntry->mMsgNo == 0xC8B || + ( +#if VERSION == VERSION_USA + mesgEntry->mMsgNo == 0x33B || + mesgEntry->mMsgNo == 0xC8B || mesgEntry->mMsgNo == 0x1D21 || mesgEntry->mMsgNo == 0x31D7 || mesgEntry->mMsgNo == 0x37DD || - mesgEntry->mMsgNo == 0x37DE) + mesgEntry->mMsgNo == 0x37DE +#elif VERSION == VERSION_PAL + mesgEntry->mMsgNo == 0xC8B || + mesgEntry->mMsgNo == 0x1D21 || + mesgEntry->mMsgNo == 0x31D7 +#endif + ) ) { - s32 bufLen = strlen(buf); - char current = (buf)[bufLen - 1]; + size_t bufLen = strlen(sp84); + char current = (sp84)[bufLen - 1]; if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { - strcat(buf, "\'"); + strcat(sp84, "\'"); } else { - strcat(buf, "s"); + strcat(sp84, "s"); } } +#endif - u32 curOffset = 0; - for (s32 i = 0; buf[i] != '\0'; i++) { - char c = buf[i]; - 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 { - field_0xD4[0] = buf[curOffset]; - field_0xD4[1] = '\0'; - curOffset += 1; + while (sp84[r28] != '\0') { + int c; +#if VERSION == VERSION_PAL + if (mesgEntry->mTextboxType == 0xC) +#endif + { + if (((u8)sp84[r28] >> 4) == 8 || ((u8)sp84[r28] >> 4) == 9) { + int tmp = (u8)sp84[r28]; + field_0xD4[0] = sp84[r28++]; + u8 tmp2 = sp84[r28++]; + c = tmp << 8 | tmp2; + field_0xD4[1] = tmp2; + field_0xD4[2] = '\0'; + } else { + c = (u8)sp84[r28]; + field_0xD4[0] = sp84[r28++]; + field_0xD4[1] = '\0'; + } } +#if VERSION == VERSION_PAL + else { + c = (u8)sp84[r28]; + field_0xD4[0] = sp84[r28++]; + field_0xD4[1] = '\0'; + } +#endif + if (field_0x150 == 0) { field_0x14 = charLength(field_0x148, c, true); } else { @@ -2357,90 +2909,610 @@ void fopMsgM_msgDataProc_c::stringSet() { } if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; - } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 1) { + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 1) { field_0x29A = 1; - count = bmgData[count + 1]; - } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 2) { + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 2) { field_0x29A = 0; - count = bmgData[count + 1]; - } else if (temp[2] == 0 && temp[3] == 0 && temp[4] == 3) { - waitTimer = temp[5] << 8; - waitTimer |= bmgData[count + 6]; + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 3) { + waitTimer = (u8)bmgData[count + 5] << 8; + waitTimer |= (u8)bmgData[count + 6]; setAutoSendFlagOn(); - count = bmgData[count + 1]; + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 4) { + #if VERSION > VERSION_DEMO + if ( + mesgEntry->mTextboxType == 0 || mesgEntry->mTextboxType == 1 || mesgEntry->mTextboxType == 5 || + mesgEntry->mTextboxType == 8 || mesgEntry->mTextboxType == 0xC || mesgEntry->mTextboxType == 0xE + ) { + field_0x296 = 1; + } + #endif + waitTimer = (u8)bmgData[count + 5] << 8; + waitTimer |= (u8)bmgData[count + 6]; + setAutoSendFlagOn(); + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 5) { + waitTimer = (u8)bmgData[count + 5] << 8; + waitTimer |= (u8)bmgData[count + 6]; + setHandSendFlagOn(); + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 6) { + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 7) { + if (field_0x299 == 0) { + #if VERSION > VERSION_DEMO + if ( + mesgEntry->mTextboxType == 0 || mesgEntry->mTextboxType == 1 || mesgEntry->mTextboxType == 5 || + mesgEntry->mTextboxType == 8 || mesgEntry->mTextboxType == 0xC || mesgEntry->mTextboxType == 0xE + ) { + field_0x296 = 1; + } + #endif + waitTimer = (u8)bmgData[count + 5] << 8; + waitTimer |= (u8)bmgData[count + 6]; + count += bmgData[count + 1]; + return; + } + if ( + mesgEntry->mTextboxType == 0 || mesgEntry->mTextboxType == 1 || mesgEntry->mTextboxType == 5 || + mesgEntry->mTextboxType == 8 || mesgEntry->mTextboxType == 0xC || mesgEntry->mTextboxType == 0xE + ) { + #if VERSION > VERSION_DEMO + field_0x296 = 1; + #endif + waitTimer = (u8)bmgData[count + 5] << 8; + waitTimer |= (u8)bmgData[count + 6]; + count += bmgData[count + 1]; + return; + } + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 8) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_2_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 9) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_3_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xA) { + iconSelect(field_0x148, 0x00); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xB) { + iconSelect(field_0x148, 0x01); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xC) { + iconSelect(field_0x148, 0x02); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xD) { + iconSelect(field_0x148, 0x03); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xE) { + iconSelect(field_0x148, 0x04); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0xF) { + iconSelect(field_0x148, 0x05); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x10) { + iconSelect(field_0x148, 0x06); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x11) { + iconSelect(field_0x148, 0x07); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x12) { + iconSelect(field_0x148, 0x08); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x13) { + iconSelect(field_0x148, 0x09); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x14) { + iconSelect(field_0x148, 0x0A); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x15) { + iconSelect(field_0x148, 0x0B); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x16) { + iconSelect(field_0x148, 0x0C); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x17) { + iconSelect(field_0x148, 0x0D); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x18) { + iconSelect(field_0x148, 0x0E); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x19) { + iconSelect(field_0x148, 0x0F); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1A) { + iconSelect(field_0x148, 0x10); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1B) { + iconSelect(field_0x148, 0x11); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1C) { + iconSelect(field_0x148, 0x12); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1D) { + iconSelect(field_0x148, 0x13); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1E) { + setSelectFlagYokoOn(); + iconSelect(field_0x148, 0x14); + mesgStatus = fopMsgStts_SELECT_YOKO_e; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x1F) { + if (selectFlag != 0) { + field_0x27D = 1; + } else { + field_0x27D = 0; + } + iconSelect(field_0x148, 0x15); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x39) { + iconSelect(field_0x148, 0x18); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3A) { + iconSelect(field_0x148, 0x19); + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x20) { + tag_kaisen_game(); + } else if ( + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x21) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x24) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x25) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2C) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x36) + ) { + tag_rupee(); + #endif + } else if ( + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x22) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x23) + ) { + if ((u8)bmgData[count + 4] == 0x22) { + u32 msgNo = dComIfGp_getNpcNameMessageID(); + getString(field_0x60, field_0x68, field_0x64, field_0x6C, msgNo, &nowCursorPos, &field_0x24, &field_0x150); + } else if ((u8)bmgData[count + 4] == 0x23) { + u32 msgNo = dComIfGp_getItemNameMessageID(); + getString(field_0x60, field_0x68, field_0x64, field_0x6C, msgNo, &nowCursorPos, &field_0x24, &field_0x150); + } + if (selectFlag != 1) { + field_0x14 = nowCursorPos - field_0xF8[lineCount]; + } else { + field_0x14 = nowCursorPos - field_0x108[lineCount]; + } + count += bmgData[count + 1]; + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x26) { + tag_num_input(); + #endif + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x27) { + iconSelect(field_0x148, 0x17); + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x28) { + tag_sword_game(); + #endif + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x29) { + u32 msgNo = 0x1B37 + dComIfGs_getEventReg(dSv_event_flag_c::UNK_BA0F); + getString(field_0x60, field_0x68, field_0x64, field_0x6C, msgNo, &nowCursorPos, &field_0x24, &field_0x150); + if (selectFlag != 1) { + field_0x14 = nowCursorPos - field_0xF8[lineCount]; + } else { + field_0x14 = nowCursorPos - field_0x108[lineCount]; + } + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2A) { + iconSelect(field_0x148, 0x1A); + #if VERSION > VERSION_JPN + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2B) { + tag_letter_game(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3B) { + tag_letter_game_max(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3C) { + tag_fish(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3D) { + tag_fish_rupee(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2D) { + tag_letter(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2E) { + tag_rescue(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x2F) { + tag_forest_timer(); + } else if ( + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x30) || + ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x31) + ) { + tag_birdman(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x32) { + tag_point(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x33) { + tag_get_pendant(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x34) { + tag_rev_pendant(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x35) { + tag_pig_timer(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x37) { + tag_get_bomb(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x38) { + tag_get_arrow(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3E) { + tag_stock_bokobaba(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x3F) { + tag_stock_dokuro(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x40) { + tag_stock_chuchu(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x41) { + tag_stock_pendant(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x42) { + tag_stock_hane(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x43) { + tag_stock_kenshi(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x44) { + tag_terry_rupee(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x45) { + tag_input_bokobaba(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x46) { + tag_input_dokuro(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x47) { + tag_input_chuchu(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x48) { + tag_input_pendant(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x49) { + tag_input_hane(); + } else if ((u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 0x4A) { + tag_input_kenshi(); + #endif + } else if ((u8)bmgData[count + 2] == 1) { + u16 r27 = ((u8)bmgData[count + 3] << 8) | (u8)bmgData[count + 4]; + if (dComIfGp_roomControl_getStayNo() != 0) { + s8 reverb = dComIfGp_getReverb(dComIfGp_roomControl_getStayNo()); + if (r27 == 8) { + mDoAud_messageSePlay(r27, 0, reverb); + } else { + mDoAud_messageSePlay(r27, actorPosition, reverb); + } + } else { + if (r27 == 8) { + mDoAud_messageSePlay(r27, 0, 0); + } else { + mDoAud_messageSePlay(r27, actorPosition, 0); + } + } + count += bmgData[count + 1]; + return; + } else if ((u8)bmgData[count + 2] == 2) { + u16 r0 = ((u8)bmgData[count + 3] << 8) | (u8)bmgData[count + 4]; + dComIfGp_setMesgCameraTagInfo(r0); + count += bmgData[count + 1]; + } else if ((u8)bmgData[count + 2] == 3) { + u16 r0 = ((u8)bmgData[count + 3] << 8) | (u8)bmgData[count + 4]; + dComIfGp_setMesgAnimeTagInfo(r0); + count += bmgData[count + 1]; + } else { + count += bmgData[count + 1]; + } + } else if (bmgData[count + 0] == 0xA) { + if (field_0x154 != 0) { + field_0x1C = nowCursorPos - field_0x28; + + f32 f3 = (int)(field_0x28 + field_0x1C / 2.0f - field_0x18 / 2.0f + 0.5f); + char sp64[16]; + f32 f31; + if (field_0x24 < f3) { + f31 = f3 - field_0x24; + sprintf(sp64, "\x1b""CR[%d]", (int)(f31 + 0.5f)); + strcat(field_0x64, sp64); + strcat(field_0x6C, sp64); + } else if (field_0x24 == 0.0f) { + f31 = field_0x24 - f3; + sprintf(sp64, "\x1b""CL[%d]", (int)(f31 + 0.5f)); + strcat(field_0x64, sp64); + strcat(field_0x6C, sp64); + } + + strcat(field_0x64, field_0x70); + strcat(field_0x6C, field_0x70); + field_0x154 = 0; } - sprintf(field_0x60, "\x1B""CL[%d]", 0.5f); + strcat(field_0x60, "\n"); + strcat(field_0x64, "\n"); + strcat(field_0x68, "\n"); + strcat(field_0x6C, "\n"); + count++; + lineCount++; + if (field_0x29D) { + lineCount++; + field_0x29D = 0; + } + + field_0x14 = 0.0f; + field_0x24 = 0.0f; + field_0x29B = 0; + if (selectFlag != 1) { + if (lineCount >= mesgEntry->field_0x16) { + if (bmgData[count + 0] == 0x1A && (u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 8) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_2_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + continue; + } else if (bmgData[count + 0] == 0x1A && (u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 9) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_3_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + continue; + } else if (bmgData[count + 0] != 0x00) { + mesgStatus = fopMsgStts_STOP_e; + } + + field_0x150 = 0; + field_0x299 = 0; + field_0x29A = 0; + return; + } + + field_0x150 = 0; + + nowCursorPos = field_0xF8[lineCount]; + + char sp54[16]; + sprintf(sp54, "\x1b""CR[%d]", (int)nowCursorPos); + strcat(field_0x60, sp54); + strcat(field_0x68, sp54); + + if (autoSendFlag == 0) { + waitTimer = spaceTimer; + } + + if (field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag == 0) { + return; + } + } else { + field_0x150 = 0; + + nowCursorPos = field_0x108[lineCount]; + + char sp44[16]; + sprintf(sp44, "\x1b""CR[%d]", (int)(nowCursorPos)); + strcat(field_0x60, sp44); + strcat(field_0x68, sp44); + } + } else { + int r28; + bool r27; +#if VERSION == VERSION_PAL + if (mesgEntry->mTextboxType == 0xC) +#endif + { + if ((((u8)bmgData[count + 0] >> 4) & 0x0F) == 8 || (((u8)bmgData[count + 0] >> 4) & 0x0F) == 9) { + field_0xD4[0] = bmgData[count + 0]; + field_0xD4[1] = bmgData[count + 1]; + field_0xD4[2] = '\0'; + r28 = ((u8)bmgData[count] << 8) | (u8)bmgData[count + 1]; + if ( + dComIfGs_getClearCount() == 0 +#if VERSION < VERSION_PAL + && mesgEntry->mTextboxType == 0xC +#endif + ) { + for (int i = 0; i < ARRAY_SIZE(zfont); i++) { + if (zfont[i][0] == (u16)r28) { + field_0xD4[0] = (zfont[i][1] >> 8) & 0xFF; + field_0xD4[1] = zfont[i][1] & 0xFF; + field_0xD4[2] = '\0'; + r28 = zfont[i][1]; + break; + } + } + } + r27 = false; + } else { + field_0xD4[0] = bmgData[count + 0]; + field_0xD4[1] = '\0'; + r28 = (u8)bmgData[count]; + r27 = true; + } + } +#if VERSION == VERSION_PAL + else { + field_0xD4[0] = bmgData[count + 0]; + field_0xD4[1] = '\0'; + r28 = (u8)bmgData[count]; + r27 = true; + } +#endif + + if (field_0x150 == 0) { + field_0x14 = charLength(field_0x148, r28, true); + } else { + field_0x14 += charLength(field_0x148, r28, false); + } + + field_0x150++; + + if (selectFlag != 1) { + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; + } else { + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; + } + + if (lineWidth <= (int)(field_0x14 + 0.5f)) { + strcat(field_0x60, "\n"); + strcat(field_0x64, "\n"); + strcat(field_0x68, "\n"); + strcat(field_0x6C, "\n"); + lineCount++; + field_0x24 = 0.0f; + + field_0x14 = charLength(field_0x148, r28, true); + + if (selectFlag != 1) { + if (lineCount >= mesgEntry->field_0x16) { + if (bmgData[count + 0] == 0x1A && (u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 8) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_2_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + } else if (bmgData[count + 0] == 0x1A && (u8)bmgData[count + 2] == 0 && (u8)bmgData[count + 3] == 0 && (u8)bmgData[count + 4] == 9) { + setSelectFlagOn(); + lineCount = 0; + nowCursorPos = field_0x108[lineCount]; + count += bmgData[count + 1]; + mesgStatus = fopMsgStts_SELECT_3_e; + field_0x60 = selectMessage[0]; + field_0x64 = selectMessage[1]; + field_0x68 = selectMessage[2]; + field_0x6C = selectMessage[3]; + } else { + if (bmgData[count + 0] != 0x00) { + mesgStatus = fopMsgStts_STOP_e; + } + field_0x299 = 0; + field_0x29A = 0; + return; + } + } else { + field_0x150 = 0; + nowCursorPos = field_0xF8[lineCount]; + + char sp34[16]; + sprintf(sp34, "\x1b""CR[%d]", (int)(nowCursorPos)); + strcat(field_0x60, sp34); + strcat(field_0x68, sp34); + + if (field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag == 0) { + return; + } + } + } else { + field_0x150 = 0; + nowCursorPos = field_0x108[lineCount]; + + char sp24[16]; + sprintf(sp24, "\x1b""CR[%d]", (int)(nowCursorPos)); + strcat(field_0x60, sp24); + strcat(field_0x68, sp24); + } + } + + if (field_0x154 != 0) { + field_0x154--; + if (field_0x154 == 0) { + field_0x1C = nowCursorPos - field_0x28; + + f32 f3 = (int)(field_0x28 + field_0x1C / 2.0f - field_0x18 / 2.0f + 0.5f); + char sp14[16]; + f32 f31; + if (field_0x24 < f3) { + f31 = f3 - field_0x24; + sprintf(sp14, "\x1b""CR[%d]", (int)(f31 + 0.5f)); + strcat(field_0x64, sp14); + strcat(field_0x6C, sp14); + field_0x24 += f31; + } else if (field_0x24 == 0.0f) { + f31 = field_0x24 - f3; + sprintf(sp14, "\x1b""CL[%d]", (int)(f31 + 0.5f)); + strcat(field_0x64, sp14); + strcat(field_0x6C, sp14); + field_0x24 -= f31; + } + + strcat(field_0x64, field_0x70); + strcat(field_0x6C, field_0x70); + field_0x24 += field_0x18; + } + } + + if (r27) { + count++; + } else { + count += 2; + } + + strcat(field_0x60, field_0xD4); + strcat(field_0x68, field_0xD4); + + if (autoSendFlag == 0) { + if (r28 == 0x8140 || r28 == 0x8141 || r28 == 0x878C) { + waitTimer = spaceTimer; + } + if (r28 == 0x20 && spaceFlag != 0) { + waitTimer = spaceTimer; + } + } + if (field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag == 0) { + if (r30 == 0) { + return; + } + r30--; + } } } - 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) { - 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) { - char temp[16]; - sprintf(temp, "\x1b""CL[%d]", (int)(temp1 - field_0x24 + 0.5f)); - strcat(field_0x64, temp); - strcat(field_0x6C, temp); - } + if (field_0x299 == 0 && field_0x29A == 0 && autoSendFlag == 0 && handSendFlag == 0 && selectFlag == 0) { + return; + } + if (bmgData[count] != '\0') { + return; + } + 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) { + field_0x27F = 0; + field_0x64[field_0x34] = '\0'; + field_0x6C[field_0x38] = '\0'; strcat(field_0x64, field_0x70); strcat(field_0x6C, field_0x70); - field_0x154 = 0; } - strcat(field_0x60, "\n"); - strcat(field_0x64, "\n"); - strcat(field_0x68, "\n"); - strcat(field_0x6C, "\n"); - count++; - lineCount++; - if (field_0x29D) { - lineCount++; - field_0x29D = 0; + if (mesgStatus == fopMsgStts_SELECT_2_e) return; + if (mesgStatus == fopMsgStts_SELECT_3_e) return; + if (mesgStatus == fopMsgStts_SELECT_YOKO_e) return; + if (mesgStatus == fopMsgStts_INPUT_e) 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() != 0) { + mDoAud_messageSePlay(0, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); + } else { + mDoAud_messageSePlay(0, 0, 0); + } } -} -/* 80034F5C-80034F68 .text setSelectFlagYokoOn__21fopMsgM_msgDataProc_cFv */ -void fopMsgM_msgDataProc_c::setSelectFlagYokoOn() { - selectFlag = 2; -} - -/* 80034F68-80034F74 .text setSelectFlagOn__21fopMsgM_msgDataProc_cFv */ -void fopMsgM_msgDataProc_c::setSelectFlagOn() { - selectFlag = 1; -} - -/* 80034F74-80034F80 .text setHandSendFlagOn__21fopMsgM_msgDataProc_cFv */ -void fopMsgM_msgDataProc_c::setHandSendFlagOn() { - handSendFlag = 1; -} - -/* 80034F80-80034F8C .text setAutoSendFlagOn__21fopMsgM_msgDataProc_cFv */ -void fopMsgM_msgDataProc_c::setAutoSendFlagOn() { - autoSendFlag = 1; -} - -/* 80034F8C-80034F94 .text getHandSendFlag__21fopMsgM_msgDataProc_cFv */ -u8 fopMsgM_msgDataProc_c::getHandSendFlag() { - return handSendFlag; -} - -/* 80034F94-80034F9C .text getAutoSendFlag__21fopMsgM_msgDataProc_cFv */ -u8 fopMsgM_msgDataProc_c::getAutoSendFlag() { - return autoSendFlag; + if (fopMsgM_nextMsgFlagCheck()) { + if (mesgEntry->mNextMsgNo != 0) { + fopMsgM_messageSet(mesgEntry->mNextMsgNo); + mesgStatus = fopMsgStts_MSG_CONTINUES_e; + } else { + mesgStatus = fopMsgStts_MSG_ENDS_e; + } + } else { + if (getAutoSendFlag() || getHandSendFlag()) { + mesgStatus = fopMsgStts_CLOSE_WAIT_e; + } else { + mesgStatus = fopMsgStts_MSG_DISPLAYED_e; + } + } } /* 80034FE0-80034FF4 .text fopMsgM_itemNumIdx__FUc */ @@ -2570,7 +3642,7 @@ void fopMsgM_msgDataProc_c::getString(char* i_dest, u32 i_msgNo) { #endif ) ) { - s32 bufLen = strlen(str); + size_t bufLen = strlen(str); current = (str)[bufLen - 1]; if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(str, "\'"); @@ -2635,7 +3707,7 @@ void fopMsgM_msgDataProc_c::getString(char* i_dest, char*, char*, char*, u32 i_m #endif (i_msgNo == 0x33B || i_msgNo == 0xC8B || i_msgNo == 0x1D21 || i_msgNo == 0x31D7 || i_msgNo == 0x37DD || i_msgNo == 0x37DE) ) { - s32 bufLen = strlen(dstBuf); + size_t bufLen = strlen(dstBuf); current = (dstBuf)[bufLen - 1]; if (current == 's' || current == 'S' || current == 'z' || current == 'Z' || current == 'x' || current == 'X') { strcat(dstBuf, "\'"); @@ -4394,9 +5466,9 @@ void fopMsgM_msgDataProc_c::tag_kaisen_game() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } dComIfGs_getEventReg(dSv_event_flag_c::UNK_BEFF); @@ -4421,7 +5493,7 @@ void fopMsgM_msgDataProc_c::tag_kaisen_game() { strcpy(buf2, ""); #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -4481,9 +5553,9 @@ void fopMsgM_msgDataProc_c::tag_rupee() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4497,7 +5569,7 @@ void fopMsgM_msgDataProc_c::tag_num_input() { int temp = (field_0x148 + charSpace) * 3; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf2, "\x1B""CR[%d]", temp); strcat(field_0x60, buf2); strcat(field_0x68, buf2); @@ -4537,9 +5609,9 @@ void fopMsgM_msgDataProc_c::tag_num_input() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4569,9 +5641,9 @@ void fopMsgM_msgDataProc_c::tag_sword_game() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } char buf2[12]; @@ -4608,7 +5680,7 @@ void fopMsgM_msgDataProc_c::tag_sword_game() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -4636,9 +5708,9 @@ void fopMsgM_msgDataProc_c::tag_letter_game() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4668,9 +5740,9 @@ void fopMsgM_msgDataProc_c::tag_letter_game_max() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4700,9 +5772,9 @@ void fopMsgM_msgDataProc_c::tag_fish() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4764,9 +5836,9 @@ void fopMsgM_msgDataProc_c::tag_fish_rupee() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -4796,9 +5868,9 @@ void fopMsgM_msgDataProc_c::tag_letter() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } char buf2[12]; @@ -4847,7 +5919,7 @@ void fopMsgM_msgDataProc_c::tag_letter() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -4875,9 +5947,9 @@ void fopMsgM_msgDataProc_c::tag_rescue() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -4899,9 +5971,9 @@ void fopMsgM_msgDataProc_c::tag_rescue() { strcpy(buf2, ""); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); #else - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -4931,12 +6003,12 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } strcpy(buf2, ":"); - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); buf[0] = '\0'; int seconds = (dComIfGs_getFwaterTimer() % 1800) / 30; @@ -4962,12 +6034,12 @@ void fopMsgM_msgDataProc_c::tag_forest_timer() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5031,9 +6103,9 @@ void fopMsgM_msgDataProc_c::tag_birdman() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -5103,9 +6175,9 @@ void fopMsgM_msgDataProc_c::tag_point() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -5135,9 +6207,9 @@ void fopMsgM_msgDataProc_c::tag_get_pendant() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5184,7 +6256,7 @@ void fopMsgM_msgDataProc_c::tag_get_pendant() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5212,9 +6284,9 @@ void fopMsgM_msgDataProc_c::tag_rev_pendant() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5261,7 +6333,7 @@ void fopMsgM_msgDataProc_c::tag_rev_pendant() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5289,12 +6361,12 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { strcat(field_0x60, buf); strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } strcpy(buf2, ":"); - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); buf[0] = '\0'; int seconds = (dComIfGp_getItemTimer() % 1800) / 30; @@ -5320,12 +6392,12 @@ void fopMsgM_msgDataProc_c::tag_pig_timer() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5353,9 +6425,9 @@ void fopMsgM_msgDataProc_c::tag_get_bomb() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } char buf2[12]; @@ -5388,7 +6460,7 @@ void fopMsgM_msgDataProc_c::tag_get_bomb() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5416,9 +6488,9 @@ void fopMsgM_msgDataProc_c::tag_get_arrow() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } char buf2[12]; @@ -5451,7 +6523,7 @@ void fopMsgM_msgDataProc_c::tag_get_arrow() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5479,9 +6551,9 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5510,7 +6582,7 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { strcpy(buf2, " seed"); } } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); #else char buf2[12]; @@ -5519,7 +6591,7 @@ void fopMsgM_msgDataProc_c::tag_stock_bokobaba() { } else { strcpy(buf2, " seed"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -5549,9 +6621,9 @@ void fopMsgM_msgDataProc_c::tag_stock_dokuro() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5594,7 +6666,7 @@ void fopMsgM_msgDataProc_c::tag_stock_dokuro() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5622,9 +6694,9 @@ void fopMsgM_msgDataProc_c::tag_stock_chuchu() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5653,9 +6725,9 @@ void fopMsgM_msgDataProc_c::tag_stock_chuchu() { } else { strcpy(text_buf, ""); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -5685,9 +6757,9 @@ void fopMsgM_msgDataProc_c::tag_stock_pendant() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5730,10 +6802,16 @@ void fopMsgM_msgDataProc_c::tag_stock_pendant() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } +#if VERSION == VERSION_PAL +static void dummy() { + OSReport(" "); +} +#endif + /* 8003AB00-8003ACEC .text tag_stock_hane__21fopMsgM_msgDataProc_cFv */ void fopMsgM_msgDataProc_c::tag_stock_hane() { char buf[20]; @@ -5758,9 +6836,9 @@ void fopMsgM_msgDataProc_c::tag_stock_hane() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5803,7 +6881,7 @@ void fopMsgM_msgDataProc_c::tag_stock_hane() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5831,9 +6909,9 @@ void fopMsgM_msgDataProc_c::tag_stock_kenshi() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } char buf2[12]; @@ -5870,7 +6948,7 @@ void fopMsgM_msgDataProc_c::tag_stock_kenshi() { } #endif - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, buf2, "", &nowCursorPos, &field_0x24, &field_0x150); count += bmgData[count + 1]; } @@ -5930,9 +7008,9 @@ void fopMsgM_msgDataProc_c::tag_terry_rupee() { strcat(field_0x68, buf); if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } count += bmgData[count + 1]; @@ -5946,7 +7024,7 @@ void fopMsgM_msgDataProc_c::tag_input_bokobaba() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -5954,9 +7032,9 @@ void fopMsgM_msgDataProc_c::tag_input_bokobaba() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -5973,10 +7051,10 @@ void fopMsgM_msgDataProc_c::tag_input_bokobaba() { } else { strcpy(text_buf, " seed(s)"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else char* text = "seed(s)"; - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -5990,7 +7068,7 @@ void fopMsgM_msgDataProc_c::tag_input_dokuro() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -5998,9 +7076,9 @@ void fopMsgM_msgDataProc_c::tag_input_dokuro() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -6017,10 +7095,10 @@ void fopMsgM_msgDataProc_c::tag_input_dokuro() { } else { strcpy(text_buf, " necklace(s)"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else char* text = "necklace(s)"; - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -6034,7 +7112,7 @@ void fopMsgM_msgDataProc_c::tag_input_chuchu() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -6042,9 +7120,9 @@ void fopMsgM_msgDataProc_c::tag_input_chuchu() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -6061,9 +7139,9 @@ void fopMsgM_msgDataProc_c::tag_input_chuchu() { } else { strcpy(text_buf, " "); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, "", "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -6077,7 +7155,7 @@ void fopMsgM_msgDataProc_c::tag_input_pendant() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -6085,9 +7163,9 @@ void fopMsgM_msgDataProc_c::tag_input_pendant() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -6104,10 +7182,10 @@ void fopMsgM_msgDataProc_c::tag_input_pendant() { } else { strcpy(text_buf, " pendant(s)"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else char* text = "pendant(s)"; - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -6121,7 +7199,7 @@ void fopMsgM_msgDataProc_c::tag_input_hane() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -6129,9 +7207,9 @@ void fopMsgM_msgDataProc_c::tag_input_hane() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -6148,10 +7226,10 @@ void fopMsgM_msgDataProc_c::tag_input_hane() { } else { strcpy(text_buf, " feather(s)"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else char* text = "feather(s)"; - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -6165,7 +7243,7 @@ void fopMsgM_msgDataProc_c::tag_input_kenshi() { int temp = (field_0x148 + charSpace) * 2; selectFlag = 3; iconSelect(field_0x148, 0x16); - mesgStatus = 0x15; + mesgStatus = fopMsgStts_INPUT_e; sprintf(buf, "\x1B""CR[%d]", temp); strcat(field_0x60, buf); strcat(field_0x68, buf); @@ -6173,9 +7251,9 @@ void fopMsgM_msgDataProc_c::tag_input_kenshi() { field_0x150 += 2; if (selectFlag != 1) { - field_0x20 = field_0xF8[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0xF8[lineCount] + field_0x14 + 0.5f; } else { - field_0x20 = field_0x108[lineCount] + field_0x14 + 0.5f; + nowCursorPos = field_0x108[lineCount] + field_0x14 + 0.5f; } #if VERSION == VERSION_PAL @@ -6192,10 +7270,10 @@ void fopMsgM_msgDataProc_c::tag_input_kenshi() { } else { strcpy(text_buf, " crest(s)"); } - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text_buf, "", &nowCursorPos, &field_0x24, &field_0x150); #else char* text = "crest(s)"; - getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &field_0x20, &field_0x24, &field_0x150); + getRubyString(field_0x60, field_0x68, field_0x64, field_0x6C, text, "", &nowCursorPos, &field_0x24, &field_0x150); #endif count += bmgData[count + 1]; @@ -6214,8 +7292,8 @@ fopMsgM_f2d_class fopMsgM_centerPosCalc(fopMsgM_f2d_class param_1, fopMsgM_f2d_c 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; + i_pane->mSizeOrig.x = i_pane->pane->mBounds.getWidth(); + i_pane->mSizeOrig.y = i_pane->pane->mBounds.getHeight(); fopMsgM_f2d_class center = fopMsgM_centerPosCalc(i_pane->mPosTopLeftOrig, i_pane->mSizeOrig); i_pane->mPosCenterOrig.x = center.x; i_pane->mPosCenterOrig.y = center.y; @@ -6453,5 +7531,7 @@ void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap) { i_heap->destroy(); } -static const char* dummy1 = "\x1B""CU[%d]"; -static const char* dummy2 = "\x1B""CD[%d]"; +static void dummy2() { + OSReport("\x1B""CU[%d]"); + OSReport("\x1B""CD[%d]"); +} diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 07dce73a5..dfa2f2ef7 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -274,7 +274,7 @@ bool Debug_console(JUTGamePad* i_pad) { if (console->isVisible()) { if ((i_pad->testButton(CButton::L) && i_pad->testButton(CButton::R)) || - ((i_pad->getAnalogL() != 0 && i_pad->getAnalogR() != 0))) + (i_pad->getAnalogL() != 0 && i_pad->getAnalogR() != 0)) { f32 stick_x = i_pad->getMainStickX(); f32 stick_y = i_pad->getMainStickY();