From b3be0f9e6441519a31593b5eb8e0c43192202887 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Mon, 25 May 2026 20:13:09 -0400 Subject: [PATCH] d_menu_option OK (#1020) --- configure.py | 2 +- include/JSystem/J2DGraph/J2DTextBox.h | 9 +- include/JSystem/JUtility/JUTFont.h | 11 ++ include/d/d_menu_option.h | 7 + include/d/d_msg.h | 2 +- include/f_op/f_op_msg_mng.h | 93 +++++++-- src/JSystem/JUtility/JUTFont.cpp | 3 +- src/d/actor/d_a_bdk.cpp | 4 +- src/d/d_menu_option.cpp | 262 ++++++++++++++++++++------ src/d/d_mesg.cpp | 16 +- src/d/d_meter.cpp | 2 +- src/d/d_msg.cpp | 132 +++++++------ src/f_op/f_op_msg_mng.cpp | 112 +++++++++-- 13 files changed, 501 insertions(+), 154 deletions(-) diff --git a/configure.py b/configure.py index 87797fa97..b5f0c13e6 100755 --- a/configure.py +++ b/configure.py @@ -616,7 +616,7 @@ config.libs = [ Object(NonMatching, "d/d_menu_fmap.cpp"), Object(NonMatching, "d/d_menu_fmap2.cpp"), Object(NonMatching, "d/d_menu_item.cpp"), - Object(NonMatching, "d/d_menu_option.cpp"), + Object(Matching, "d/d_menu_option.cpp"), Object(NonMatching, "d/d_menu_save.cpp"), Object(MatchingFor("GZLE01"), "d/d_menu_window.cpp"), Object(NonMatching, "d/d_mesg.cpp"), diff --git a/include/JSystem/J2DGraph/J2DTextBox.h b/include/JSystem/J2DGraph/J2DTextBox.h index 06786acba..6e70e7657 100644 --- a/include/JSystem/J2DGraph/J2DTextBox.h +++ b/include/JSystem/J2DGraph/J2DTextBox.h @@ -37,7 +37,7 @@ public: void initiate(const ResFONT*, const char*, J2DTextBoxHBinding, J2DTextBoxVBinding); void setFont(JUTFont*); - JUTFont* getFont() { return mpFont; } + JUTFont* getFont() const { return mpFont; } void setFontSize(f32 sizeX, f32 sizeY) { mFontSizeX = sizeX > 0.0f ? sizeX : 0.0f; mFontSizeY = sizeY > 0.0f ? sizeY : 0.0f; @@ -49,6 +49,10 @@ public: size.mSizeX = mFontSizeX; size.mSizeY = mFontSizeY; } + void shiftSet(f32 x, f32 y) { + field_0xd8 = x; + field_0xdc = y; + } void setCharColor(JUtility::TColor c) { mCharColor.set(c); } void setGradColor(JUtility::TColor c) { mGradColor.set(c); } void setBlack(JUtility::TColor c) { mBlack = c; } @@ -62,6 +66,9 @@ public: char* getStringPtr() const; s32 setString(const char*, ...); + // TODO + void setFontColor(JUtility::TColor, JUtility::TColor) {} + virtual ~J2DTextBox(); virtual bool setConnectParent(bool); virtual void drawSelf(f32, f32); diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h index e655985fb..b9e2b4f26 100644 --- a/include/JSystem/JUtility/JUTFont.h +++ b/include/JSystem/JUtility/JUTFont.h @@ -99,6 +99,11 @@ public: drawString_size_scale(posX, posY, width, height, str, strlen(str), visible); } + int getOffset(int i_no) const { + TWidth width; + getWidthEntry(i_no, &width); + return width.field_0x0; + } int getWidth(int i_no) const { TWidth width; getWidthEntry(i_no, &width); @@ -108,6 +113,12 @@ public: bool isValid() const { return mValid; } bool isFixed() const { return mFixed; } int getFixedWidth() const { return mFixedWidth; } + void setFixedWidth(bool fixed, int width) { + mFixed = fixed; + mFixedWidth = width; + } + + void drawChar(int, int, int, bool) {} /* 0x04 */ bool mValid; /* 0x05 */ bool mFixed; diff --git a/include/d/d_menu_option.h b/include/d/d_menu_option.h index e00ed9991..e48347737 100644 --- a/include/d/d_menu_option.h +++ b/include/d/d_menu_option.h @@ -46,10 +46,12 @@ public: void outFontInit(); void outFontMove(); void outFontDraw(); +#if VERSION > VERSION_JPN f32 stringlength(fopMsgM_pane_class*, char*); void changeScaleCenter(fopMsgM_pane_class*, char*); void setSoundMode(u32); void changeScaleRight(fopMsgM_pane_class*, char*); +#endif void initialize(); void _create(); void _delete(); @@ -72,6 +74,9 @@ private: /* 0x858 */ fopMsgM_pane_class m858[2]; /* 0x8C8 */ fopMsgM_pane_class m8C8[4]; /* 0x9A8 */ fopMsgM_pane_class m9A8[2]; +#if VERSION != VERSION_USA + fopMsgM_pane_class mA18_jpn[2]; +#endif /* 0xA18 */ fopMsgM_pane_class mA18[3]; /* 0xAC0 */ fopMsgM_pane_class mAC0[2]; /* 0xB30 */ fopMsgM_pane_class mB30[6]; @@ -85,11 +90,13 @@ private: /* 0xD3C */ char* mD3C; /* 0xD40 */ char* mD40; /* 0xD44 */ char* mD44; +#if VERSION > VERSION_JPN /* 0xD48 */ char mD48[20]; /* 0xD5C */ char mD5C[2][20]; /* 0xD84 */ char mD84[2][20]; /* 0xDAC */ char mDAC[3][20]; /* 0xDE8 */ char mDE8[4][20]; +#endif /* 0xE38 */ u8 mE38; /* 0xE39 */ u8 mE39; /* 0xE3A */ u8 mE3A; diff --git a/include/d/d_msg.h b/include/d/d_msg.h index a640e11fe..f24370b80 100644 --- a/include/d/d_msg.h +++ b/include/d/d_msg.h @@ -13,7 +13,7 @@ class sub_msg_class; class sub_msg_class : public msg_class { public: /* 0x00FC */ JKRExpHeap* mpHeap; - /* 0x0100 */ mesg_entry mMesgEntry; + /* 0x0100 */ JMSMesgEntry_c mMesgEntry; /* 0x0118 */ mesg_header* head_p; /* 0x011C */ fopMsgM_pane_class m011C[4]; /* 0x01FC */ fopMsgM_pane_class m01FC; diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 5059a636d..8e0b0491e 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -19,9 +19,7 @@ struct mesg_data; struct mesg_info; // BMG INF1 messageEntry -struct mesg_entry { - // mesg_entry() {} // fixes fopMsgM_selectMessageGet, but messes up getMesgEntry - +struct JMSMesgEntry_c { /* 0x00 */ u32 mDataOffs; /* 0x04 */ u16 mMsgNo; /* 0x06 */ s16 mItemPrice; @@ -96,7 +94,7 @@ public: mesg_header* getMesgHeader(u32); mesg_info* getMesgInfo(mesg_header*); mesg_data* getMesgData(mesg_header*); - mesg_entry getMesgEntry(mesg_header*); + JMSMesgEntry_c getMesgEntry(mesg_header*); const char* getMessage(mesg_header*); public: @@ -108,11 +106,16 @@ public: class fopMsgM_itemMsgGet_c { public: + fopMsgM_itemMsgGet_c() { + mMsgIdx = 0; + mMsgNo = 0; + mResMsgNo = 0; + } virtual ~fopMsgM_itemMsgGet_c() {} mesg_header* getMesgHeader(u32); mesg_info* getMesgInfo(mesg_header*); mesg_data* getMesgData(mesg_header*); - mesg_entry getMesgEntry(mesg_header*); + JMSMesgEntry_c getMesgEntry(mesg_header*); const char* getMessage(mesg_header*); public: @@ -143,7 +146,7 @@ public: class fopMsgM_msgDataProc_c { public: fopMsgM_msgDataProc_c(); - virtual ~fopMsgM_msgDataProc_c() {} + virtual ~fopMsgM_msgDataProc_c(); void dataInit(); f32 charLength(int, int, bool); f32 rubyLength(int, bool); @@ -233,9 +236,73 @@ public: void tag_input_kenshi(); #endif + void getIconColor(int) {} + void getIconNum(int) {} + void getIconPosX(int) {} + void getIconPosY(int) {} + void getIconScale(int) {} + + void setCharSpace(int) {} + void setRubyCharSpace(int) {} + void setLineSpace(int) {} + + void setOutMessage(char* param_0, char* param_1, char* param_2, char* param_3) { + field_0x60 = param_0; + field_0x40 = param_0; + field_0x64 = param_1; + field_0x44 = param_1; + field_0x68 = param_2; + field_0x48 = param_2; + field_0x6C = param_3; + field_0x4C = param_3; + } + void setSelectMessage(char*, char*, char*, char*) {} + + void setMesgEntry(JMSMesgEntry_c*) {} + + void dec_keyWaitTimer() {} + void dec_waitTimer() {} + void getCharAlpha() {} + void getGradAlpha() {} + void getLineCount() {} + void getMesgStatus() {} + void getNowCursorPos() {} + void getRCharAlpha() {} + void getRGradAlpha() {} + void getSelectFlag() {} + void getSelectLength() {} + void getStringColor() {} + void get_waitTimer() {} + void resetNowLine() {} + void selectArrow(J2DPicture*) {} + void setActorPosition(cXyz*) {} + void setAimLine(int) {} + void setAutoSendFlagOff() {} + void setBmgData(char*) {} + void setCenterLineWidth(int) {} + void setCharAlpha(u8, u8, u8, u8) {} + void setCount(int) {} + void setFont(JUTFont*) {} + void setFontSize(int) {} + void setHandSendFlagOff() {} + void setLineCount(int) {} + void setLineWidth(int) {} + void setRubyFont(JUTFont*) {} + void setRubyFontSize(int) {} + void setSelectFlagOff() {} + void setSelectNum(u8) {} + void setSendSpeed(int) {} + void setSpaceFlagOff() {} + void setSpaceFlagOn() {} + void setSpaceTimer(int) {} + void setStringColor(u32) {} + void set_waitTimer(int) {} + void set_waitTimerZero() {} + void shortCut() {} + public: /* 0x004 */ JUTFont* font[2]; - /* 0x00C */ mesg_entry* field_0x0C; + /* 0x00C */ JMSMesgEntry_c* field_0x0C; /* 0x010 */ u32 field_0x10; /* 0x014 */ f32 field_0x14; /* 0x018 */ f32 field_0x18; @@ -247,7 +314,7 @@ public: /* 0x030 */ u32 field_0x30; /* 0x034 */ u32 field_0x34; /* 0x038 */ u32 field_0x38; - /* 0x03C */ char* field_0x3C; + /* 0x03C */ const char* field_0x3C; /* 0x040 */ char* field_0x40; /* 0x044 */ char* field_0x44; /* 0x048 */ char* field_0x48; @@ -259,8 +326,8 @@ public: /* 0x06C */ char* field_0x6C; /* 0x070 */ char field_0x70[0x64]; // no idea how big this array is /* 0x0D4 */ char field_0xD4[4]; - /* 0x0D4 */ s32 field_0xD8[4]; - /* 0x0D4 */ s32 field_0xE8[4]; + /* 0x0D8 */ s32 field_0xD8[4]; + /* 0x0E8 */ s32 field_0xE8[4]; /* 0x0F8 */ s32 field_0xF8[4]; /* 0x108 */ s32 field_0x108[4]; /* 0x118 */ u32 field_0x118; @@ -286,7 +353,7 @@ public: /* 0x168 */ s32 field_0x168[0xF]; /* 0x1A4 */ u32 field_0x1A4[0xF]; /* 0x1A4 */ u32 field_0x1E0[0xF]; - /* 0x21C */ u32 field_0x21C; + /* 0x21C */ int field_0x21C; /* 0x21C */ u32 field_0x220[0xF]; /* 0x25C */ u32 field_0x25C; /* 0x260 */ s16 field_0x260; @@ -301,14 +368,16 @@ public: /* 0x27E */ u8 field_0x27E; /* 0x27F */ u8 field_0x27F; /* 0x280 */ u8 field_0x280; - /* 0x281 */ u8 field_0x281[0xF]; + /* 0x281 */ u8 field_0x281[0xF]; // IconNum? /* 0x290 */ u8 field_0x290; /* 0x291 */ u8 field_0x291; /* 0x292 */ u8 field_0x292; /* 0x293 */ u8 field_0x293; /* 0x294 */ u8 field_0x294; /* 0x295 */ u8 field_0x295; +#if VERSION > VERSION_DEMO /* 0x296 */ u8 field_0x296; +#endif /* 0x297 */ u8 field_0x297; /* 0x298 */ u8 field_0x298; /* 0x299 */ u8 field_0x299; diff --git a/src/JSystem/JUtility/JUTFont.cpp b/src/JSystem/JUtility/JUTFont.cpp index d04180ab3..d7051bbeb 100644 --- a/src/JSystem/JUtility/JUTFont.cpp +++ b/src/JSystem/JUtility/JUTFont.cpp @@ -16,8 +16,7 @@ JUTFont::JUTFont() { /* 802C1DD0-802C1E1C .text initialize_state__7JUTFontFv */ void JUTFont::initialize_state() { setCharColor(JUtility::TColor()); - mFixed = false; - mFixedWidth = 0; + setFixedWidth(false, 0); mValid = false; } diff --git a/src/d/actor/d_a_bdk.cpp b/src/d/actor/d_a_bdk.cpp index 282c951da..91e954ae0 100644 --- a/src/d/actor/d_a_bdk.cpp +++ b/src/d/actor/d_a_bdk.cpp @@ -1607,7 +1607,7 @@ static void end_set(bdk_class* i_this) { } i_this->m25A0 = 100; fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); - mDoAud_bgmStop(0x1E); + mDoAud_bgmStop(30); } /* 000049C0-00005018 .text damage_check__FP9bdk_class */ @@ -1648,7 +1648,7 @@ static void damage_check(bdk_class* i_this) { fopAcM_monsSeStart(actor, JA_SE_CV_DK_LAST_DAMAGE, 0); dScnPly_ply_c::setPauseTimer(8); - mDoAud_bgmStop(0x1E); + mDoAud_bgmStop(30); } else { dComIfGs_onEventBit(dSv_event_flag_c::UNK_3C01); #if VERSION > VERSION_DEMO diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index 3f015dfc5..f98ffc4c3 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -8,6 +8,9 @@ #include "JSystem/J2DGraph/J2DTextBox.h" #include "JSystem/JUtility/JUTAssert.h" #include "d/d_lib.h" +#if VERSION <= VERSION_JPN +#include "d/d_s_play.h" +#endif #include "m_Do/m_Do_audio.h" #include "m_Do/m_Do_controller_pad.h" #include "global.h" @@ -55,6 +58,11 @@ void dMenu_Option_c::screenSet() { fopMsgM_setPaneData(&m8C8[0], scrn->search('ttyu')); fopMsgM_setPaneData(&m9A8[0], scrn->search('thld')); fopMsgM_setPaneData(&m9A8[1], scrn->search('tsic')); +#if VERSION <= VERSION_JPN + fopMsgM_setPaneData(&m8C8[1], scrn->search('trub')); + fopMsgM_setPaneData(&m9A8[2], scrn->search('ton')); + fopMsgM_setPaneData(&m9A8[3], scrn->search('toff')); +#endif fopMsgM_setPaneData(&m8C8[3], scrn->search('tsou')); fopMsgM_setPaneData(&mA18[0], scrn->search('tmon')); fopMsgM_setPaneData(&mA18[1], scrn->search('tste')); @@ -72,6 +80,7 @@ void dMenu_Option_c::screenSet() { fopMsgM_setPaneData(&mC80[1], scrn->search('bs00')); fopMsgM_setPaneData(&mCF0, scrn->search('blak')); +#if VERSION > VERSION_JPN fopMsgM_messageGet(mD48, 0x19D); fopMsgM_messageGet(mD5C[0], 0x19B); fopMsgM_messageGet(mD5C[1], 0x1A9); @@ -84,32 +93,48 @@ void dMenu_Option_c::screenSet() { fopMsgM_messageGet(mDE8[1], 0x19A); fopMsgM_messageGet(mDE8[2], 0x1D1); fopMsgM_messageGet(mDE8[3], 0x1D6); +#endif ((J2DTextBox*)m008.pane)->setFont(mD2C); +#if VERSION > VERSION_JPN ((J2DTextBox*)m008.pane)->setString(mD48); +#endif ((J2DTextBox*)m740[0].pane)->setFont(mD2C); ((J2DTextBox*)m740[1].pane)->setFont(mD30); for (int i = 0; i < 2; i++) { ((J2DTextBox*)m9A8[i].pane)->setFont(mD2C); +#if VERSION <= VERSION_JPN + ((J2DTextBox*)mA18_jpn[i].pane)->setFont(mD2C); +#endif +#if VERSION > VERSION_JPN ((J2DTextBox*)m9A8[i].pane)->setString(mD5C[i]); +#endif ((J2DTextBox*)mAC0[i].pane)->setFont(mD2C); +#if VERSION > VERSION_JPN ((J2DTextBox*)mAC0[i].pane)->setString(mD84[i]); changeScaleCenter(&m9A8[i], mD5C[i]); changeScaleCenter(&mAC0[i], mD84[i]); +#endif } for (int i = 0; i < 3; i++) { ((J2DTextBox*)mA18[i].pane)->setFont(mD2C); +#if VERSION > VERSION_JPN ((J2DTextBox*)mA18[i].pane)->setString(mDAC[i]); changeScaleCenter(&mA18[i], mDAC[i]); +#endif } for (int i = 0; i < 4; i++) { +#if VERSION > VERSION_JPN if (i == 1) continue; +#endif ((J2DTextBox*)m8C8[i].pane)->setFont(mD2C); +#if VERSION > VERSION_JPN ((J2DTextBox*)m8C8[i].pane)->setString(mDE8[i]); changeScaleRight(&m8C8[i], mDE8[i]); +#endif } m820.mUserArea = m820.pane->mRotation; @@ -136,6 +161,9 @@ void dMenu_Option_c::mainInit() { fopMsgM_setNowAlphaZero(&mC80[i]); fopMsgM_setNowAlphaZero(&m858[i]); fopMsgM_setNowAlphaZero(&m9A8[i]); +#if VERSION <= VERSION_JPN + fopMsgM_setNowAlphaZero(&mA18_jpn[i]); +#endif fopMsgM_setNowAlphaZero(&mAC0[i]); } @@ -144,9 +172,10 @@ void dMenu_Option_c::mainInit() { } for (int i = 0; i < 4; i++) { - if (i != 1) { - fopMsgM_setNowAlphaZero(&m8C8[i]); - } +#if VERSION > VERSION_JPN + if (i == 1) continue; +#endif + fopMsgM_setNowAlphaZero(&m8C8[i]); } for (int i = 0; i < 6; i++) { @@ -164,10 +193,12 @@ void dMenu_Option_c::mainInit() { } /* 801D3518-801D35DC .text noteInit__14dMenu_Option_cFv */ -void dMenu_Option_c::noteInit() { +void dMenu_Option_c::noteInit() { + f32 f31 = -12.0f; + fopMsgM_paneTrans(&m820, 0.0f, 35.0f); - m820.pane->rotate(m820.mSize.x / 2.0f, m820.mSize.y / 2.0f, ROTATE_Z, m820.mUserArea + -12.0f); + m820.pane->rotate(m820.mSize.x / 2.0f, m820.mSize.y / 2.0f, ROTATE_Z, f31 + m820.mUserArea); fopMsgM_setNowAlphaZero(&m740[0]); fopMsgM_setNowAlphaZero(&m740[1]); @@ -207,6 +238,9 @@ void dMenu_Option_c::mainMove() { fopMsgM_setNowAlpha(&mCF0, alpha); fopMsgM_setNowAlpha(&m9A8[mE3C], alpha); +#if VERSION <= VERSION_JPN + fopMsgM_setNowAlpha(&mA18_jpn[mE3D], alpha); +#endif fopMsgM_setNowAlpha(&mAC0[mE3F], alpha); fopMsgM_setNowAlpha(&mA18[mE3E], alpha); @@ -216,9 +250,10 @@ void dMenu_Option_c::mainMove() { } for (int i = 0; i < 4; i++) { - if (i != 1) { - fopMsgM_setNowAlpha(&m8C8[i], alpha); - } +#if VERSION > VERSION_JPN + if (i == 1) continue; +#endif + fopMsgM_setNowAlpha(&m8C8[i], alpha); } fopMsgM_setNowAlpha(&mB30[0], alpha); @@ -230,9 +265,10 @@ void dMenu_Option_c::noteMove() { float alpha; alpha = fopMsgM_valueIncrease(7, mC80[0].mUserArea + -7, 0); + f32 f30 = (1.0f - alpha) * -12.0f; fopMsgM_paneTrans(&m820, 0.0f, (1.0f - alpha) * 35.0f); - m820.pane->rotate(m820.mSize.x / 2.0f, m820.mSize.y / 2.0f, ROTATE_Z, (1.0f - alpha) * -12.0f + m820.mUserArea); + m820.pane->rotate(m820.mSize.x / 2.0f, m820.mSize.y / 2.0f, ROTATE_Z, f30 + m820.mUserArea); fopMsgM_setNowAlpha(&m740[0], alpha); fopMsgM_setNowAlpha(&m740[1], alpha); @@ -305,6 +341,14 @@ void dMenu_Option_c::cursorScale() { y = m9A8[mE3C].mPosCenterOrig.y; break; } +#if VERSION <= VERSION_JPN + case 1: { + x[0] = mA18_jpn[mE3D].mPosTopLeftOrig.x - 20.0f; + x[1] = mA18_jpn[mE3D].mPosTopLeftOrig.x + mA18_jpn[mE3D].mSizeOrig.x + 20.0f; + y = mA18_jpn[mE3D].mPosCenterOrig.y; + break; + } +#endif case 3: { x[0] = mA18[mE3E].mPosTopLeftOrig.x - 20.0f; x[1] = mA18[mE3E].mPosTopLeftOrig.x + mA18[mE3E].mSizeOrig.x + 20.0f; @@ -340,6 +384,19 @@ void dMenu_Option_c::typeMove() { } break; } +#if VERSION <= VERSION_JPN + case 1: { + for (int i = 0; i < 2; i++) { + if(i == mE3D) { + fopMsgM_setInitAlpha(&mA18_jpn[i]); + } + else { + fopMsgM_setNowAlphaZero(&mA18_jpn[i]); + } + } + break; + } +#endif case 3: { for (int i = 0; i < 3; i++) { if(i == mE3E) { @@ -429,7 +486,12 @@ void dMenu_Option_c::stickMove(u8 param_1) { case 4: { if (mB30[1].mUserArea > 0) { mB30[1].mUserArea--; - if (mB30[1].mUserArea == 1) { + if ( +#if VERSION <= VERSION_JPN + g_msgDHIO.field_0x08 && +#endif + mB30[1].mUserArea == 1 + ) { mB30[1].mUserArea = 0; } cursorMove(); @@ -441,7 +503,12 @@ void dMenu_Option_c::stickMove(u8 param_1) { case 8: { if (mB30[1].mUserArea < 3) { mB30[1].mUserArea++; - if (mB30[1].mUserArea == 1) { + if ( +#if VERSION <= VERSION_JPN + g_msgDHIO.field_0x08 && +#endif + mB30[1].mUserArea == 1 + ) { mB30[1].mUserArea = 2; } cursorMove(); @@ -485,11 +552,16 @@ void dMenu_Option_c::stickMove(u8 param_1) { m858[1].mUserArea = 6; mDoAud_seStart(JA_SE_ITM_MENU_OPT_SW); mDoAud_setOutputMode(soundMode[mE3E]); +#if VERSION > VERSION_JPN setSoundMode(soundMode[mE3E]); +#endif break; } case 2: { - if ((JUTGamePad::sRumbleSupported & 0x80000000) != 0) { +#if VERSION > VERSION_DEMO + if ((JUTGamePad::sRumbleSupported & 0x80000000) != 0) +#endif + { if (mE3F) { mE3F = 0; } @@ -540,11 +612,16 @@ void dMenu_Option_c::stickMove(u8 param_1) { m858[1].mUserArea = -6; mDoAud_seStart(JA_SE_ITM_MENU_OPT_SW); mDoAud_setOutputMode(soundMode[mE3E]); +#if VERSION > VERSION_JPN setSoundMode(soundMode[mE3E]); +#endif break; } case 2: { - if ((JUTGamePad::sRumbleSupported & 0x80000000) != 0) { +#if VERSION > VERSION_DEMO + if ((JUTGamePad::sRumbleSupported & 0x80000000) != 0) +#endif + { if (mE3F) { mE3F = 0; } @@ -566,7 +643,6 @@ void dMenu_Option_c::stickMove(u8 param_1) { /* 801D47A4-801D4C00 .text noteSet__14dMenu_Option_cFv */ void dMenu_Option_c::noteSet() { - /* Nonmatching - heavily inlined, Ghidra output isn't helpful */ fopMsgM_itemMsgGet_c msgGet; fopMsgM_msgDataProc_c msgDataProc; @@ -577,37 +653,66 @@ void dMenu_Option_c::noteSet() { outFontInit(); - float fVar1 = m740[0].pane[1].mBounds.getHeight(); - float fVar2 = m740[1].pane[1].mBounds.getHeight(); + f32 f31 = m740[0].pane[1].getGlbBounds().i.x; + f32 f30 = m740[1].pane[1].getGlbBounds().i.x; mesg_header* head_p = msgGet.getMesgHeader(0x262); - JUT_ASSERT(0x313, head_p); + JUT_ASSERT(VERSION_SELECT(713, 717, 787, 787), head_p); const char* mesg = msgGet.getMessage(head_p); - mesg_entry msg_entry = msgGet.getMesgEntry(head_p); + JMSMesgEntry_c msg_entry; + msg_entry = msgGet.getMesgEntry(head_p); msgDataProc.dataInit(); + msgDataProc.field_0x3C = mesg; + msgDataProc.setOutMessage(mD38, mD3C, mD40, mD44); + msgDataProc.font[0] = mD2C; + msgDataProc.font[1] = mD30; + msgDataProc.field_0x11C = ((J2DTextBox*)m740[0].pane)->getCharSpace(); + msgDataProc.field_0x124 = ((J2DTextBox*)m740[1].pane)->getCharSpace(); + msgDataProc.field_0x120 = ((J2DTextBox*)m740[0].pane)->getLineSpace(); + msgDataProc.field_0x0C = &msg_entry; + msgDataProc.field_0x144 = f31; + msgDataProc.field_0x14C = f30; + msgDataProc.field_0x128 = 0x1D0; + msgDataProc.field_0x12C = 0x1D0; + msgDataProc.field_0x160 = 2; + msgDataProc.field_0x15C = 0; + msgDataProc.field_0x299 = 1; + msgDataProc.field_0x29C = 0; msgDataProc.stringLength(); msgDataProc.stringShift(); msgDataProc.iconIdxRefresh(); + s16 r26 = msgDataProc.field_0x130; + msgDataProc.field_0x130 = 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); + ((J2DTextBox*)m740[1].pane)->shiftSet(0.0f, f30_2); ((J2DTextBox*)m740[0].pane)->setString(mD38); ((J2DTextBox*)m740[1].pane)->setString(mD3C); + int r31 = ((J2DTextBox*)m740[0].pane)->getLineSpace() / 2.0f; for (int i = 0; i < 0xf; i++) { - if(m0B0[i].mUserArea == -1) { - m0B0[i].mPosTopLeft.x = m740[0].mPosTopLeft.x; - m0B0[i].mPosTopLeftOrig.x = m740[0].mPosTopLeftOrig.x; - - m0B0[i].mPosTopLeft.y = m740[0].mPosTopLeft.y; - m0B0[i].mPosTopLeftOrig.y = m740[0].mPosTopLeftOrig.y; - - fopMsgM_outFontSet((J2DPicture*)&m0B0[i], &m0B0[i].mUserArea, 0, 0); + u32 r6 = msgDataProc.field_0x281[i]; + if (r6 == 0xFF) { + continue; } + if(m0B0[i].mUserArea != -1) { + continue; + } + 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].mPosTopLeftOrig.y = (f32)r6; + + fopMsgM_outFontSet((J2DPicture*)m0B0[i].pane, &m0B0[i].mUserArea, 0xFF, r6); } } @@ -650,11 +755,44 @@ void dMenu_Option_c::outFontDraw() { } } +#if VERSION > VERSION_JPN /* 801D4E34-801D505C .text stringlength__14dMenu_Option_cFP18fopMsgM_pane_classPc */ -f32 dMenu_Option_c::stringlength(fopMsgM_pane_class*, char*) { - /* Nonmatching - also heavily inlined */ +f32 dMenu_Option_c::stringlength(fopMsgM_pane_class* r30, char* r31) { + f32 f30; + f32 f29 = 0.0f; + bool r27 = false; + J2DTextBox::TFontSize sp18; + ((J2DTextBox*)r30->pane)->getFontSize(sp18); + f32 f31 = ((J2DTextBox*)r30->pane)->getCharSpace(); + f30 = sp18.mSizeX / mD2C->getCellWidth(); + while (*r31 != 0) { + if ((u8)*r31 == 0x1A) { + r31++; + r31 += (*r31 - 1); + } else { + int r26 = (u8)*r31++; + int r28 = mD2C->getWidth(r26); + if (!r27) { + f29 = f30 * (r28 + mD2C->getOffset(r26)); + r27 = true; + } else{ + f29 += f31 + r28 * f30; + } + } + } + + if (f29 > 196.0f) { + sp18.mSizeX = (int)(sp18.mSizeX * (196.0f / f29)); + J2DTextBox::TFontSize sp10 = sp18; + ((J2DTextBox*)r30->pane)->setFontSize(sp10); + f29 = 196.0f; + } + + return f29; } +#endif +#if VERSION > VERSION_JPN /* 801D505C-801D50A0 .text changeScaleCenter__14dMenu_Option_cFP18fopMsgM_pane_classPc */ void dMenu_Option_c::changeScaleCenter(fopMsgM_pane_class* param_1, char* i_str) { f32 str_length = stringlength(param_1, i_str); @@ -666,7 +804,9 @@ void dMenu_Option_c::changeScaleCenter(fopMsgM_pane_class* param_1, char* i_str) param_1->mPosTopLeftOrig.x = param_1->mPosTopLeft.x; } +#endif +#if VERSION > VERSION_JPN /* 801D50A0-801D50E8 .text setSoundMode__14dMenu_Option_cFUl */ void dMenu_Option_c::setSoundMode(u32 i_soundMode) { switch(i_soundMode) { @@ -681,7 +821,9 @@ void dMenu_Option_c::setSoundMode(u32 i_soundMode) { break; } } +#endif +#if VERSION > VERSION_JPN /* 801D50E8-801D5148 .text changeScaleRight__14dMenu_Option_cFP18fopMsgM_pane_classPc */ void dMenu_Option_c::changeScaleRight(fopMsgM_pane_class* param_1, char* i_str) { float str_length = stringlength(param_1, i_str); @@ -697,6 +839,7 @@ void dMenu_Option_c::changeScaleRight(fopMsgM_pane_class* param_1, char* i_str) fopMsgM_cposMove(param_1); } +#endif /* 801D5148-801D5224 .text initialize__14dMenu_Option_cFv */ void dMenu_Option_c::initialize() { @@ -733,20 +876,19 @@ void dMenu_Option_c::initialize() { mE41 = 0; mDoAud_setOutputMode(soundMode[mE3E]); -#if VERSION > VERSION_DEMO +#if VERSION > VERSION_JPN setSoundMode(soundMode[mE3E]); #endif } /* 801D5224-801D53F0 .text _create__14dMenu_Option_cFv */ void dMenu_Option_c::_create() { - /* Nonmatching - Code 100% */ scrn = new J2DScreen(); - JUT_ASSERT(1074, scrn != NULL); + JUT_ASSERT(VERSION_SELECT(882, 891, 1074, 1074), scrn != NULL); scrn->set("option.blo", mpArchive); stick = new STControl(5, 2, 3, 2); - JUT_ASSERT(1078, stick != NULL); + JUT_ASSERT(VERSION_SELECT(886, 895, 1078, 1078), stick != NULL); screenSet(); initialize(); @@ -892,7 +1034,6 @@ void dMenu_Option_c::_move() { /* 801D576C-801D5C04 .text _draw__14dMenu_Option_cFv */ void dMenu_Option_c::_draw() { - /* Nonmatching - probably some inlining, tried using `setAlpha` and `getAlpha` but didn't work */ if (mE41 == 0) { fopMsgM_setAlpha(&m008); fopMsgM_setAlpha(&m040); @@ -902,6 +1043,9 @@ void dMenu_Option_c::_draw() { fopMsgM_setAlpha(&m740[i]); fopMsgM_setAlpha(&m858[i]); fopMsgM_setAlpha(&m9A8[i]); +#if VERSION <= VERSION_JPN + fopMsgM_setAlpha(&mA18_jpn[i]); +#endif fopMsgM_setAlpha(&mAC0[i]); fopMsgM_setAlpha(&mC80[i]); } @@ -911,9 +1055,10 @@ void dMenu_Option_c::_draw() { fopMsgM_setAlpha(&m820); for (int i = 0; i < 4; i++) { - if (i != 1) { - fopMsgM_setAlpha(&m8C8[i]); - } +#if VERSION > VERSION_JPN + if (i == 1) continue; +#endif + fopMsgM_setAlpha(&m8C8[i]); } for (int i = 0; i < 3; i++) { @@ -927,39 +1072,44 @@ void dMenu_Option_c::_draw() { fopMsgM_setAlpha(&mCF0); } else { - float alpha_scale = 1.0f - fopMsgM_valueIncrease(10, mC80[0].mUserArea, 0); + s16 r4 = mC80[0].mUserArea; + f32 alpha_scale = 1.0f - fopMsgM_valueIncrease(10, r4, 0); - m008.pane->mAlpha *= alpha_scale; - m040.pane->mAlpha *= alpha_scale; - m078.pane->mAlpha *= alpha_scale; + m008.pane->setAlpha(m008.mNowAlpha * alpha_scale); + m040.pane->setAlpha(m040.mNowAlpha * alpha_scale); + m078.pane->setAlpha(m078.mNowAlpha * alpha_scale); for (int i = 0; i < 2; i++) { - m740[i].pane->mAlpha *= alpha_scale; - m8C8[i].pane->mAlpha *= alpha_scale; - m9A8[i].pane->mAlpha *= alpha_scale; - mAC0[i].pane->mAlpha *= alpha_scale; - mC80[i].pane->mAlpha *= alpha_scale; + m740[i].pane->setAlpha(m740[i].mNowAlpha * alpha_scale); + m858[i].pane->setAlpha(m858[i].mNowAlpha * alpha_scale); + m9A8[i].pane->setAlpha(m9A8[i].mNowAlpha * alpha_scale); +#if VERSION <= VERSION_JPN + mA18_jpn[i].pane->setAlpha(mA18_jpn[i].mNowAlpha * alpha_scale); +#endif + mAC0[i].pane->setAlpha(mAC0[i].mNowAlpha * alpha_scale); + mC80[i].pane->setAlpha(mC80[i].mNowAlpha * alpha_scale); } - m7B0.pane->mAlpha *= alpha_scale; - m7E8.pane->mAlpha *= alpha_scale; - m820.pane->mAlpha *= alpha_scale; + m7B0.pane->setAlpha(m7B0.mNowAlpha * alpha_scale); + m7E8.pane->setAlpha(m7E8.mNowAlpha * alpha_scale); + m820.pane->setAlpha(m820.mNowAlpha * alpha_scale); for (int i = 0; i < 4; i++) { - if (i != 1) { - m8C8[i].pane->mAlpha *= alpha_scale; - } +#if VERSION > VERSION_JPN + if (i == 1) continue; +#endif + m8C8[i].pane->setAlpha(m8C8[i].mNowAlpha * alpha_scale); } for (int i = 0; i < 3; i++) { - mA18[i].pane->mAlpha *= alpha_scale; + mA18[i].pane->setAlpha(mA18[i].mNowAlpha * alpha_scale); } for (int i = 0; i < 6; i++) { - mAC0[i].pane->mAlpha = mB30[i].pane->mAlpha * alpha_scale; + mB30[i].pane->setAlpha(mB30[i].mNowAlpha * alpha_scale); } - mCF0.pane->mAlpha *= alpha_scale; + mCF0.pane->setAlpha(mCF0.mNowAlpha * alpha_scale); } outFontDraw(); @@ -1004,6 +1154,8 @@ bool dMenu_Option_c::_open() { /* 801D5CBC-801D5D38 .text _close__14dMenu_Option_cFv */ bool dMenu_Option_c::_close() { bool ret = false; + + int r30 = 10; int value = ++mC80[0].mUserArea; @@ -1011,7 +1163,7 @@ bool dMenu_Option_c::_close() { dMenu_setPushMenuButton(2); - if (value >= 10) { + if (r30 <= value) { initialize(); mE40 = 0; ret = true; diff --git a/src/d/d_mesg.cpp b/src/d/d_mesg.cpp index 61602c479..933125148 100644 --- a/src/d/d_mesg.cpp +++ b/src/d/d_mesg.cpp @@ -186,7 +186,7 @@ void dMesg_tSequenceProcessor::initialize(int param_1) { processor.process(NULL); int r31_2 = mesgControl->getLineCount(); - mesg_entry stack_8c = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_8c = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); for (int i = 0; i < r31_2; i++) { if (stack_8c.mTextAlignment != 3) { @@ -241,7 +241,7 @@ void dMesg_tSequenceProcessor::do_end() { bool dMesg_tSequenceProcessor::do_isReady() { bool ret = false; if (mStopFlag == 0) { - mesg_entry stack_2c = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_2c = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); if (stack_2c.mDrawType == 1) { mShortCutFlag = 1; #if VERSION > VERSION_DEMO @@ -450,7 +450,7 @@ bool dMesg_tSequenceProcessor::do_tag(u32 param_1, const void* param_2, u32 para r29 = true; int r30 = 0; char sp54[17]; - mesg_entry sp38 = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c sp38 = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); strcpy(sp54, dComIfGs_getPlayerName()); #if VERSION > VERSION_JPN @@ -798,7 +798,7 @@ void dMesg_tMeasureProcessor::do_character(int param_1) { retFlag = 0; } r29 = true; - mesg_entry stack_58 = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_58 = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); if (dComIfGs_getClearCount() == 0 && stack_58.mTextboxType == 12) { for (int i = 0; i < 97; i++) { if (zfont[i][0] == u16(param_1)) { @@ -861,7 +861,7 @@ bool dMesg_tMeasureProcessor::do_tag(u32 param_1, const void* param_2, u32 param int r25 = 0; char sp44[17]; #if VERSION > VERSION_DEMO - mesg_entry stack_98 = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_98 = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); strcpy(sp44, dComIfGs_getPlayerName()); #endif @@ -1536,7 +1536,7 @@ void dMesg_screenDataItem_c::createScreen() { field_0x88[3].pane->show(); messageOffsetY = 0; } - mesg_entry stack_message = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_message = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); if (dItem_data::getTexture(stack_message.mMsgNo - 101)) { JKRArchive* archive = dComIfGp_getItemIconArchive(); JKRArchive::readTypeResource(texBuffer, 0xc00, 'TIMG', dItem_data::getTexture(stack_message.mMsgNo - 101), archive); @@ -1958,7 +1958,7 @@ void dMesg_waitProc(sub_mesg_class* i_Msg) { } } if (!i_Msg->screen) { - mesg_entry stack_3c = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_3c = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); if (stack_3c.mTextboxType == 9) { i_Msg->screen = new dMesg_screenDataItem_c(); } else { @@ -2005,7 +2005,7 @@ void dMesg_openProc(sub_mesg_class* i_Msg) { i_Msg->screen->setString(i_Msg->text[i], i); } i_Msg->field_0x164 = 6; - mesg_entry stack_3c = *(mesg_entry*)dMesg_gpControl->getMessageEntry(nowMesgCode); + JMSMesgEntry_c stack_3c = *(JMSMesgEntry_c*)dMesg_gpControl->getMessageEntry(nowMesgCode); if (stack_3c.mInitialSound) { mDoAud_messageSePlay(stack_3c.mInitialSound, NULL, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo())); } diff --git a/src/d/d_meter.cpp b/src/d/d_meter.cpp index 7648a68a7..08310fc14 100644 --- a/src/d/d_meter.cpp +++ b/src/d/d_meter.cpp @@ -4258,7 +4258,7 @@ void dMeter_gaugeAlpha(sub_meter_class* i_Meter) { fopMsgM_setNowAlpha(&i_Meter->mHeartShadow[i], dVar4); } i_Meter->field_0x0f00.mNowAlpha = i_Meter->field_0x0f00.mNowAlpha * dVar4; - i_Meter->field_0x0f00.pane->mAlpha = i_Meter->field_0x0f00.mNowAlpha * dVar4; + i_Meter->field_0x0f00.pane->setAlpha(i_Meter->field_0x0f00.mNowAlpha * dVar4); for (s32 i = 0; i < 8; i++) { fopMsgM_setNowAlpha(&i_Meter->field_0x0f38[i], dVar3); } diff --git a/src/d/d_msg.cpp b/src/d/d_msg.cpp index bffb2540b..fde8d7155 100644 --- a/src/d/d_msg.cpp +++ b/src/d/d_msg.cpp @@ -150,10 +150,11 @@ void dDlst_2DMSG_c::outFontDraw() { 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)) { + 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); @@ -179,7 +180,7 @@ void dDlst_2DMSG_c::outFontDraw() { } bVar6 = pdVar4->m0544[0].mNowAlpha; } - fopMsgM_outFontDraw(button_icon[i], button_kage[i], (int)(dVar1 + pJVar3->mBounds.i.x), iVar7, uVar5, &buttonTimer[i], bVar6, cVar2); + fopMsgM_outFontDraw(button_icon[i], button_kage[i], r5, iVar7, uVar5, &buttonTimer[i], bVar6, cVar2); } } } @@ -1395,7 +1396,7 @@ void dMsg_arrowMove(sub_msg_class* i_Msg) { } (i_Msg->mPane_Arrow).mSize.x = (i_Msg->mPane_Arrow).mSizeOrig.x * fVar1; (i_Msg->mPane_Arrow).mSize.y = (i_Msg->mPane_Arrow).mSizeOrig.y * fVar2; - (i_Msg->mPane_Arrow).mPosCenter.y = (f32)((int)g_msgHIO.field_0x66) + ((f32)(i_Msg->m1114) - (i_Msg->mPane_Arrow).mSize.y * 0.5f); + (i_Msg->mPane_Arrow).mPosCenter.y = (f32)((int)g_msgHIO.field_0x66) + ((f32)(i_Msg->m1114) - (i_Msg->mPane_Arrow).mSize.y / 2.0f); fopMsgM_cposMove(&i_Msg->mPane_Arrow); } } @@ -1415,31 +1416,30 @@ void dMsg_dotMove(sub_msg_class* i_Msg) { } } else { iVar4 = i_Msg->m1100; - if (iVar4 >= 0x3C) { + if (iVar4 >= 60) { i_Msg->m10C0 = i_Msg->m10BC; i_Msg->m10C8 = i_Msg->m10C4; fopMsgM_setInitAlpha(&i_Msg->m050C); i_Msg->m1100 = 0; + } else if (iVar4 > 30) { + iVar4 = 60 - iVar4; + dVar5 = fopMsgM_valueIncrease(30, iVar4, 0); + i_Msg->m10C0.r = (u8)(int)((f32)(i_Msg->m10BC.r) + (f32)((150.0f - (f32)(i_Msg->m10BC.r)) * dVar5)); + i_Msg->m10C0.g = (u8)(int)((f32)(i_Msg->m10BC.g) + (f32)((150.0f - (f32)(i_Msg->m10BC.g)) * dVar5)); + i_Msg->m10C0.b = (u8)(int)((f32)(i_Msg->m10BC.b) + (f32)((150.0f - (f32)(i_Msg->m10BC.b)) * dVar5)); + i_Msg->m10C8.r = (u8)(int)((f32)(i_Msg->m10C4.r) + (f32)((255.0f - (f32)(i_Msg->m10C4.r)) * dVar5)); + i_Msg->m10C8.g = (u8)(int)((f32)(i_Msg->m10C4.g) + (f32)((255.0f - (f32)(i_Msg->m10C4.g)) * dVar5)); + i_Msg->m10C8.b = (u8)(int)((f32)(i_Msg->m10C4.b) + (f32)((220.0f - (f32)(i_Msg->m10C4.b)) * dVar5)); + i_Msg->m050C.mNowAlpha = (u8)(int)((f32)(i_Msg->m050C.mInitAlpha) + (f32)((255.0f - (f32)(i_Msg->m050C.mInitAlpha)) * dVar5)); } else { - if (iVar4 > 0x1E) { - dVar5 = fopMsgM_valueIncrease(0x1e, 0x3c - iVar4, 0); - i_Msg->m10C0.r = (u8)(int)((f32)(i_Msg->m10BC.r) + (f32)((150.0f - (f32)(i_Msg->m10BC.r)) * dVar5)); - i_Msg->m10C0.g = (u8)(int)((f32)(i_Msg->m10BC.g) + (f32)((150.0f - (f32)(i_Msg->m10BC.g)) * dVar5)); - i_Msg->m10C0.b = (u8)(int)((f32)(i_Msg->m10BC.b) + (f32)((150.0f - (f32)(i_Msg->m10BC.b)) * dVar5)); - i_Msg->m10C8.r = (u8)(int)((f32)(i_Msg->m10C4.r) + (f32)((255.0f - (f32)(i_Msg->m10C4.r)) * dVar5)); - i_Msg->m10C8.g = (u8)(int)((f32)(i_Msg->m10C4.g) + (f32)((255.0f - (f32)(i_Msg->m10C4.g)) * dVar5)); - i_Msg->m10C8.b = (u8)(int)((f32)(i_Msg->m10C4.b) + (f32)((220.0f - (f32)(i_Msg->m10C4.b)) * dVar5)); - i_Msg->m050C.mNowAlpha = (u8)(int)((f32)(i_Msg->m050C.mInitAlpha) + (f32)((255.0f - (f32)(i_Msg->m050C.mInitAlpha)) * dVar5)); - } else { - dVar5 = fopMsgM_valueIncrease(0x1e, iVar4, 0); - i_Msg->m10C0.r = (u8)(int)((f32)(i_Msg->m10BC.r) + (f32)((150.0f - (f32)(i_Msg->m10BC.r)) * dVar5)); - i_Msg->m10C0.g = (u8)(int)((f32)(i_Msg->m10BC.g) + (f32)((150.0f - (f32)(i_Msg->m10BC.g)) * dVar5)); - i_Msg->m10C0.b = (u8)(int)((f32)(i_Msg->m10BC.b) + (f32)((150.0f - (f32)(i_Msg->m10BC.b)) * dVar5)); - i_Msg->m10C8.r = (u8)(int)((f32)(i_Msg->m10C4.r) + (f32)((255.0f - (f32)(i_Msg->m10C4.r)) * dVar5)); - i_Msg->m10C8.g = (u8)(int)((f32)(i_Msg->m10C4.g) + (f32)((255.0f - (f32)(i_Msg->m10C4.g)) * dVar5)); - i_Msg->m10C8.b = (u8)(int)((f32)(i_Msg->m10C4.b) + (f32)((220.0f - (f32)(i_Msg->m10C4.b)) * dVar5)); - i_Msg->m050C.mNowAlpha = (u8)(int)((f32)(i_Msg->m050C.mInitAlpha) + (f32)((255.0f - (f32)(i_Msg->m050C.mInitAlpha)) * dVar5)); - } + dVar5 = fopMsgM_valueIncrease(30, iVar4, 0); + i_Msg->m10C0.r = (u8)(int)((f32)(i_Msg->m10BC.r) + (f32)((150.0f - (f32)(i_Msg->m10BC.r)) * dVar5)); + i_Msg->m10C0.g = (u8)(int)((f32)(i_Msg->m10BC.g) + (f32)((150.0f - (f32)(i_Msg->m10BC.g)) * dVar5)); + i_Msg->m10C0.b = (u8)(int)((f32)(i_Msg->m10BC.b) + (f32)((150.0f - (f32)(i_Msg->m10BC.b)) * dVar5)); + i_Msg->m10C8.r = (u8)(int)((f32)(i_Msg->m10C4.r) + (f32)((255.0f - (f32)(i_Msg->m10C4.r)) * dVar5)); + i_Msg->m10C8.g = (u8)(int)((f32)(i_Msg->m10C4.g) + (f32)((255.0f - (f32)(i_Msg->m10C4.g)) * dVar5)); + i_Msg->m10C8.b = (u8)(int)((f32)(i_Msg->m10C4.b) + (f32)((220.0f - (f32)(i_Msg->m10C4.b)) * dVar5)); + i_Msg->m050C.mNowAlpha = (u8)(int)((f32)(i_Msg->m050C.mInitAlpha) + (f32)((255.0f - (f32)(i_Msg->m050C.mInitAlpha)) * dVar5)); } ((J2DPicture*)i_Msg->m050C.pane)->setBlack(JUtility::TColor(i_Msg->m10C0)); ((J2DPicture*)i_Msg->m050C.pane)->setWhite(JUtility::TColor(i_Msg->m10C8)); @@ -1452,14 +1452,14 @@ void dMsg_ringMove(sub_msg_class* i_Msg) { f32 dVar2; i_Msg->m0624[9].mUserArea++; - if (i_Msg->m0624[9].mUserArea >= 0x78) { + if (i_Msg->m0624[9].mUserArea >= 120) { i_Msg->m0624[9].mUserArea = 0; } iVar1 = (int)i_Msg->m0624[9].mUserArea; - if (iVar1 < 0x3c) { - dVar2 = fopMsgM_valueIncrease(0x3c, iVar1, 0); + if (iVar1 < 60) { + dVar2 = fopMsgM_valueIncrease(60, iVar1, 0); } else { - dVar2 = fopMsgM_valueIncrease(0x3c, 0x78 - iVar1, 0); + dVar2 = fopMsgM_valueIncrease(60, 120 - iVar1, 0); } fopMsgM_setNowAlpha(i_Msg->m0624 + 9, (dVar2 * 0.25f) + 0.25f); } @@ -1498,7 +1498,7 @@ void dMsg_cornerMove(sub_msg_class* param_1) { if (param_1->m049C.mUserArea >= 240) { param_1->m049C.mUserArea = 0; } - f32 tmp = fopMsgM_valueIncrease(0x3c, param_1->m049C.mUserArea % 0x3c, 2); + f32 tmp = fopMsgM_valueIncrease(60, param_1->m049C.mUserArea % 60, 2); GXColor local_68[4]; if (param_1->mMesgEntry.mTextboxType == 1) { for (int i = 0; i < 4; i++) { @@ -1523,17 +1523,17 @@ void dMsg_cornerMove(sub_msg_class* param_1) { local_68[i].a = 255; } } - if (param_1->m049C.mUserArea < 0x3c) { + if (param_1->m049C.mUserArea < 60) { ((J2DPicture*)param_1->m049C.pane) ->setCornerColor( *(JUtility::TColor*)&local_68[0], *(JUtility::TColor*)&local_68[1], *(JUtility::TColor*)&local_68[3], *(JUtility::TColor*)&local_68[2] ); - } else if (param_1->m049C.mUserArea < 0x78) { + } else if (param_1->m049C.mUserArea < 120) { ((J2DPicture*)param_1->m049C.pane) ->setCornerColor( *(JUtility::TColor*)&local_68[1], *(JUtility::TColor*)&local_68[2], *(JUtility::TColor*)&local_68[0], *(JUtility::TColor*)&local_68[3] ); - } else if (param_1->m049C.mUserArea < 0xB4) { + } else if (param_1->m049C.mUserArea < 180) { ((J2DPicture*)param_1->m049C.pane) ->setCornerColor( *(JUtility::TColor*)&local_68[2], *(JUtility::TColor*)&local_68[3], *(JUtility::TColor*)&local_68[1], *(JUtility::TColor*)&local_68[0] @@ -1693,7 +1693,6 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { f32 fVar5; int uVar6; int iVar7; - f32 dVar10; f32 dVar11; f32 local_78; f32 local_68; @@ -1706,10 +1705,9 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { } fVar1 = i_Msg->m049C.mPosCenter.y; if (fVar1 >= 240.0f) { - local_78 = (int)g_msgHIO.field_0x7c; - fVar1 = (local_78) + (fVar1 - i_Msg->m049C.mSize.y * 0.5f); + fVar1 = (int)g_msgHIO.field_0x7c + (fVar1 - i_Msg->m049C.mSize.y / 2.0f); } else { - fVar1 = (fVar1 + i_Msg->m049C.mSize.y * 0.5f) - ((int)g_msgHIO.field_0x7c); + 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); @@ -1726,7 +1724,7 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { i_Msg->m026C[6].mSize.y = i_Msg->m026C[6].mSizeOrig.y + fVar3; i_Msg->m026C[7].mSize.y = i_Msg->m026C[7].mSizeOrig.y + fVar3; i_Msg->m026C[9].mSize.y = i_Msg->m026C[9].mSizeOrig.y + fVar3; - fVar3 = (i_Msg->m026C[9].mSizeOrig.x - i_Msg->m026C[9].mSize.x) * 0.5f; + fVar3 = (i_Msg->m026C[9].mSizeOrig.x - i_Msg->m026C[9].mSize.x) / 2.0f; i_Msg->m026C[0].mPosCenter.x = i_Msg->m026C[0].mPosCenterOrig.x + fVar3; i_Msg->m026C[1].mPosCenter.x = i_Msg->m026C[1].mPosCenterOrig.x + fVar3; i_Msg->m026C[2].mPosCenter.x = i_Msg->m026C[2].mPosCenterOrig.x - fVar3; @@ -1734,12 +1732,12 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { i_Msg->m026C[4].mPosCenter.x = i_Msg->m026C[4].mPosCenterOrig.x - fVar3; i_Msg->m026C[6].mPosCenter.x = i_Msg->m026C[6].mPosCenterOrig.x + fVar3; i_Msg->m026C[7].mPosCenter.x = i_Msg->m026C[7].mPosCenterOrig.x - fVar3; - fVar3 = (i_Msg->m011C[0].mSizeOrig.x - i_Msg->m011C[0].mSize.x) * 0.5f; + fVar3 = (i_Msg->m011C[0].mSizeOrig.x - i_Msg->m011C[0].mSize.x) / 2.0f; for (s32 i = 0; i < 4; i++) { i_Msg->m011C[i].mPosCenter.x = ((g_msgHIO.field_0x7e) + i_Msg->m011C[i].mPosCenterOrig.x) + fVar3; } - fVar5 = (i_Msg->m026C[9].mSizeOrig.y - i_Msg->m026C[9].mSize.y) * 0.5f; - fVar2 = i_Msg->m026C[0].mPosCenterOrig.y; + fVar5 = (i_Msg->m026C[9].mSizeOrig.y - i_Msg->m026C[9].mSize.y) / 2.0f; + fVar2 = fVar1 - i_Msg->m026C[0].mPosCenterOrig.y; i_Msg->m026C[0].mPosCenter.y = fVar1; i_Msg->m026C[1].mPosCenter.y = i_Msg->m026C[1].mPosCenterOrig.y - fVar5; i_Msg->m026C[2].mPosCenter.y = i_Msg->m026C[2].mPosCenterOrig.y - fVar5; @@ -1748,12 +1746,14 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { i_Msg->m026C[5].mPosCenter.y = i_Msg->m026C[5].mPosCenterOrig.y - fVar5; i_Msg->m026C[8].mPosCenter.y = i_Msg->m026C[8].mPosCenterOrig.y + fVar5; for (s32 i = 0; i < 4; i++) { - i_Msg->m011C[i].mPosCenter.y = i_Msg->m011C[i].mPosCenterOrig.y + (fVar1 - fVar2); + i_Msg->m011C[i].mPosCenter.y = i_Msg->m011C[i].mPosCenterOrig.y + fVar2; } - i_Msg->m01FC.mPosCenterOrig.x = fVar3 + i_Msg->m01FC.mPosTopLeftOrig.x + i_Msg->m01FC.mSizeOrig.x * 0.5f; - i_Msg->m0234.mPosCenterOrig.x = (g_msgHIO.field_0x7e) * 2.0f + i_Msg->m01FC.mPosCenterOrig.x + i_Msg->m01FC.mSizeOrig.x + (i_Msg->mMsgDataProc.field_0x21C); - i_Msg->m01FC.mPosCenterOrig.y = fVar5 + i_Msg->m01FC.mPosTopLeftOrig.y + i_Msg->m01FC.mSizeOrig.y * 0.5f; - i_Msg->m0234.mPosCenterOrig.y = fVar5 + i_Msg->m0234.mPosTopLeftOrig.y + i_Msg->m0234.mSizeOrig.y * 0.5f; + 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->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++) { fopMsgM_cposMove(&i_Msg->m011C[i]); } @@ -1766,15 +1766,14 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { fVar1 = 3.0f; } dVar11 = fVar1; - fVar3 = i_Msg->m026C[0].mSize.y * 0.5f; - i_Msg->m026C[0].pane->rotate(i_Msg->m026C[0].mSize.x * 0.5f, fVar3, ROTATE_Z, fVar1); - dVar10 = 0.5f; + fVar3 = i_Msg->m026C[0].mSize.y / 2.0f; + i_Msg->m026C[0].pane->rotate(i_Msg->m026C[0].mSize.x / 2.0f, fVar3, ROTATE_Z, fVar1); for (s32 i = 0; i < 4; i++) { - fVar1 = i_Msg->m011C[i].mSize.y * dVar10; + fVar1 = i_Msg->m011C[i].mSize.y / 2.0f; fVar3 = fVar1 + i_Msg->m026C[0].mPosCenter.y; fVar2 = fVar3 - i_Msg->m011C[i].mPosCenter.y; i_Msg->m011C[i].pane->rotate( - ((i_Msg->m011C[i].mSize.x * dVar10) + i_Msg->m026C[0].mPosCenter.x) - i_Msg->m011C[i].mPosCenter.x, fVar2, ROTATE_Z, dVar11 + ((i_Msg->m011C[i].mSize.x / 2.0f) + i_Msg->m026C[0].mPosCenter.x) - i_Msg->m011C[i].mPosCenter.x, fVar2, ROTATE_Z, dVar11 ); } fVar1 = i_Msg->m026C[9].mSize.x; @@ -1782,7 +1781,7 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { if ((uVar6) <= fVar1) { fVar1 = 1.0f; } else { - fVar1 = ((int)(fVar1 / (uVar6)) + 0.5f); + fVar1 = (int)((fVar1 / uVar6) + 0.5f); } fVar3 = i_Msg->m026C[9].mSize.y; uVar6 = (int)g_msgHIO.field_0x74; @@ -1790,7 +1789,7 @@ void dMsg_subTextSizeSet(sub_msg_class* i_Msg) { if ((local_78) <= fVar3) { fVar3 = 1.0f; } else { - fVar3 = ((int)(fVar3 / (uVar6)) + 0.5f); + fVar3 = (int)((fVar3 / uVar6) + 0.5f); } ((MyPicture*)i_Msg->m026C[5].pane)->m134 = 1; ((MyPicture*)i_Msg->m026C[5].pane)->m124 = 0.0f; @@ -1958,7 +1957,9 @@ s32 dMsg_stopProc(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.field_0x158 = uVar2; if (uVar2 == 0) { i_Msg->mMsgDataProc.field_0x297 = 0; +#if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; +#endif i_Msg->mStatus = fopMsgStts_MSG_TYPING_e; dMsg_value_init(i_Msg); dMsg_yose_select(i_Msg); @@ -1998,12 +1999,17 @@ s32 dMsg_stopProc(sub_msg_class* i_Msg) { mDoAud_seStart(JA_SE_TALK_NEXT); } if (((i_Msg->mMesgEntry.mDrawType == 0) && (CPad_CHECK_TRIG_B(0))) && (!dComIfGp_checkMesgBgm())) { - if (i_Msg->mMsgDataProc.field_0x296 == 0) { +#if VERSION > VERSION_DEMO + if (i_Msg->mMsgDataProc.field_0x296 == 0) +#endif + { i_Msg->mMsgDataProc.field_0x299 = 1; } if (((i_Msg->mMsgDataProc.field_0x297 == 0) && (i_Msg->mMsgDataProc.field_0x298 == 0)) && ((s32)i_Msg->mMsgDataProc.field_0x158 != 0)) { i_Msg->mMsgDataProc.field_0x158 = 0; +#if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; +#endif } } i_Msg->m116A++; @@ -2458,12 +2464,17 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) { i_Msg->m10DC = (int)i_Msg->m049C.mPosCenter.y; } if (((i_Msg->mMesgEntry.mDrawType == 0) && (CPad_CHECK_TRIG_B(0))) && (!dComIfGp_checkMesgBgm())) { - if (i_Msg->mMsgDataProc.field_0x296 == 0) { +#if VERSION > VERSION_DEMO + if (i_Msg->mMsgDataProc.field_0x296 == 0) +#endif + { i_Msg->mMsgDataProc.field_0x299 = 1; } if (((i_Msg->mMsgDataProc.field_0x297 == 0) && (i_Msg->mMsgDataProc.field_0x298 == 0)) && ((s32)i_Msg->mMsgDataProc.field_0x158 != 0)) { i_Msg->mMsgDataProc.field_0x158 = 0; +#if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; +#endif } } i_Msg->mStatus = fopMsgStts_MSG_TYPING_e; @@ -2486,7 +2497,9 @@ s32 dMsg_closewaitProc(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.field_0x158 = uVar3; if ((uVar3 == 0) || (fopMsgM_checkMessageSend())) { i_Msg->mMsgDataProc.field_0x297 = 0; +#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.field_0x158 = 0; @@ -2549,7 +2562,7 @@ s32 dMsg_finishProc(sub_msg_class* i_Msg) { i_Msg->m116A++; dComIfGp_setMesgSendButton(i_Msg->m116A); if (i_Msg->mMsgNo == 0x1072) { - mDoAud_bgmStop(0x3c); + mDoAud_bgmStop(60); } } else { if ((i_Msg->mMesgEntry.mTextboxType != 5) && (i_Msg->mMesgEntry.mTextboxType != 0xe)) { @@ -2738,7 +2751,7 @@ s32 dMsg_initProc(sub_msg_class* i_Msg) { s32 dMsg_tactProc(sub_msg_class* i_Msg) { if (fopMsgM_checkMessageSend()) { i_Msg->mMsgDataProc.field_0x297 = 1; - i_Msg->mMsgDataProc.field_0x158 = 0x1e; + i_Msg->mMsgDataProc.field_0x158 = 30; i_Msg->mStatus = fopMsgStts_CLOSE_WAIT_e; } return TRUE; @@ -2764,10 +2777,17 @@ s32 dMsg_outnowProc(sub_msg_class* i_Msg) { i_Msg->mMsgDataProc.field_0x299 = 1; if ((i_Msg->mMsgDataProc.field_0x297 == 0 && (i_Msg->mMsgDataProc.field_0x298 == 0)) && ((s32)i_Msg->mMsgDataProc.field_0x158 != 0)) { i_Msg->mMsgDataProc.field_0x158 = 0; +#if VERSION > VERSION_DEMO i_Msg->mMsgDataProc.field_0x296 = 0; +#endif } } - } else if ((i_Msg->mMesgEntry.mDrawType == 1) && (i_Msg->mMsgDataProc.field_0x296 == 0)) { + } else if ( + i_Msg->mMesgEntry.mDrawType == 1 +#if VERSION > VERSION_DEMO + && i_Msg->mMsgDataProc.field_0x296 == 0 +#endif + ) { i_Msg->mMsgDataProc.field_0x299 = 1; } if (((i_Msg->mMsgDataProc.field_0x297 == 0) && (i_Msg->mMsgDataProc.field_0x298 == 0)) && ((int)i_Msg->mMsgDataProc.field_0x158 != 0)) { diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index 4ccbea39b..390dbb09f 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -40,7 +40,7 @@ struct mesg_info : JUTDataBlockHeader { /* 0x0A */ u16 mEntrySize; /* 0x0C */ u16 mGroupID; /* 0x10 */ u8 mColor; - /* 0x14 */ mesg_entry mEntries[]; + /* 0x14 */ JMSMesgEntry_c mEntries[]; }; struct mesg_data : JUTDataBlockHeader { @@ -367,7 +367,7 @@ fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* param_1, cXyz* param_2, u32* pa mesg_header* header = msgGet.getMesgHeader(*param_3); if(header != NULL) { if(msgGet.getMessage(header) != NULL) { - const mesg_entry& entry = msgGet.getMesgEntry(header); + const JMSMesgEntry_c& entry = msgGet.getMesgEntry(header); u16 price = entry.mItemPrice; u16 type = entry.mTextboxType; dComIfGp_setMesgAnimeAttrInfo(entry.mInitialAnimation); @@ -577,9 +577,6 @@ u32 fopMsgM_tactMessageSet() { /* 8002BB78-8002BDBC .text fopMsgM_messageGet__FPcUl */ char* fopMsgM_messageGet(char* dst, u32 msgNo) { fopMsgM_itemMsgGet_c msgGet; - msgGet.mMsgIdx = 0; - msgGet.mMsgNo = 0; - msgGet.mResMsgNo = 0; mesg_header* head_p = msgGet.getMesgHeader(msgNo); JUT_ASSERT(VERSION_SELECT(0x690, 0x690, 0x6BD, 0x6BD), head_p); @@ -661,9 +658,6 @@ char* fopMsgM_messageGet(char* dst, u32 msgNo) { /* 8002BE04-8002C02C .text fopMsgM_passwordGet__FPcUl */ char* fopMsgM_passwordGet(char* dst, u32 msgNo) { fopMsgM_itemMsgGet_c msgGet; - msgGet.mMsgIdx = 0; - msgGet.mMsgNo = 0; - msgGet.mResMsgNo = 0; mesg_header* head_p = msgGet.getMesgHeader(msgNo); JUT_ASSERT(VERSION_SELECT(0x6F6, 0x6F6, 0x735, 0x739), head_p); @@ -743,9 +737,6 @@ void fopMsgM_selectMessageGet(J2DPane* param_1, J2DPane* param_2, char* param_3, /* Nonmatching */ fopMsgM_msgDataProc_c temp; fopMsgM_itemMsgGet_c msgGet; - msgGet.mMsgIdx = 0; - msgGet.mMsgNo = 0; - msgGet.mResMsgNo = 0; strcpy(param_3, "\x1B""CC[000000FF]\x1B""GM[0]"); strcpy(param_4, ""); @@ -761,7 +752,8 @@ void fopMsgM_selectMessageGet(J2DPane* param_1, J2DPane* param_2, char* param_3, JUT_ASSERT(0x79B, head_p); const char* src = (char*)msgGet.getMessage(head_p); - mesg_entry entry = msgGet.getMesgEntry(head_p); + JMSMesgEntry_c entry; + entry = msgGet.getMesgEntry(head_p); temp.dataInit(); temp.font[0] = ((J2DTextBox*)param_1)->getFont(); temp.font[1] = ((J2DTextBox*)param_2)->getFont(); @@ -1464,7 +1456,7 @@ mesg_data* fopMsgM_msgGet_c::getMesgData(mesg_header* msg) { } /* 8002E308-8002E378 .text getMesgEntry__16fopMsgM_msgGet_cFP11mesg_header */ -mesg_entry fopMsgM_msgGet_c::getMesgEntry(mesg_header* msg) { +JMSMesgEntry_c fopMsgM_msgGet_c::getMesgEntry(mesg_header* msg) { mesg_info* info = getMesgInfo(msg); return info->mEntries[mMsgIdx]; } @@ -1482,7 +1474,7 @@ const char* fopMsgM_msgGet_c::getMessage(mesg_header* msg) { mMsgIdx = i; if (mMsgNo == info->mEntries[i].mMsgNo) { - mesg_entry* entry = &info->mEntries[mMsgIdx]; + JMSMesgEntry_c* entry = &info->mEntries[mMsgIdx]; mResMsgNo = entry->mMsgNo; ret = &data[entry->mDataOffs]; break; @@ -1530,7 +1522,7 @@ mesg_data* fopMsgM_itemMsgGet_c::getMesgData(mesg_header* msg) { } /* 8002E4DC-8002E54C .text getMesgEntry__20fopMsgM_itemMsgGet_cFP11mesg_header */ -mesg_entry fopMsgM_itemMsgGet_c::getMesgEntry(mesg_header* msg) { +JMSMesgEntry_c fopMsgM_itemMsgGet_c::getMesgEntry(mesg_header* msg) { mesg_info* info = getMesgInfo(msg); return info->mEntries[mMsgIdx]; } @@ -1555,6 +1547,94 @@ const char* fopMsgM_itemMsgGet_c::getMessage(mesg_header* msg) { return result; } +/* 8002E5FC-8002E794 .text __ct__21fopMsgM_msgDataProc_cFv */ +fopMsgM_msgDataProc_c::fopMsgM_msgDataProc_c() { + field_0x14 = 0.0f; + field_0x18 = 0.0f; + field_0x1C = 0.0f; + field_0x20 = 0.0f; + field_0x24 = 0.0f; + field_0x28 = 0.0f; + + for (int i = 0; i < 4; i++) { + field_0xD8[i] = 0; + field_0xF8[i] = 0; + field_0x108[i] = 0; + field_0xE8[i] = 0; + } + + field_0x21C = 0; + field_0xD4[2] = 0; + field_0xD4[1] = 0; + field_0xD4[0] = 0; + field_0x2C = 0; + field_0x30 = 0; + field_0x34 = 0; + field_0x38 = 0; + field_0x118 = 0; + field_0x11C = 0; + field_0x124 = 0; + field_0x120 = 0; + field_0x128 = 0; + field_0x12C = 0; + field_0x130 = 0; + field_0x134 = 0; + field_0x138 = 0; + field_0x13C = 0; + field_0x140 = 0; + field_0x144 = 0; + field_0x148 = 0; + field_0x14C = 0; + field_0x150 = 0; + field_0x154 = 0; + field_0x158 = 0; + field_0x15C = 1; + field_0x160 = 1; + field_0x164 = 0; + field_0x25C = -1; + field_0x29D = 0; + field_0x260 = 0; + field_0x264 = 0.0f; + field_0x268 = 0.0f; + field_0x26C = 0.0f; + field_0x270 = 0.0f; + field_0x278 = 0.0f; + field_0x274 = 0.0f; + field_0x293 = 0; + field_0x292 = 0; + field_0x291 = 0; + field_0x290 = 0; + field_0x27C = 6; + field_0x27D = 0; + field_0x27E = 0; + 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; + } + + field_0x10 = 0; + field_0x299 = 0; + field_0x29A = 0; + field_0x294 = 0; + field_0x29B = 0; + field_0x297 = 0; + field_0x298 = 0; + field_0x29C = 0; + field_0x295 = 0; +#if VERSION > VERSION_DEMO + field_0x296 = 0; +#endif +} + +/* 8002E794-8002E7DC .text __dt__21fopMsgM_msgDataProc_cFv */ +fopMsgM_msgDataProc_c::~fopMsgM_msgDataProc_c() {} + /* 8002E7DC-8002E95C .text dataInit__21fopMsgM_msgDataProc_cFv */ void fopMsgM_msgDataProc_c::dataInit() { field_0x14 = 0.0f; @@ -1629,7 +1709,9 @@ void fopMsgM_msgDataProc_c::dataInit() { field_0x298 = 0; field_0x29C = 0; field_0x295 = 0; +#if VERSION > VERSION_DEMO field_0x296 = 0; +#endif } /* 8002E95C-8002EA58 .text charLength__21fopMsgM_msgDataProc_cFiib */