Link d_msg_class (all) and d_msg_unit (JP only), minor alink fix (#2846)

This commit is contained in:
Max Roncace
2025-11-21 21:45:29 -08:00
committed by GitHub
parent e2fddadf32
commit f2ad303961
9 changed files with 545 additions and 231 deletions
+2 -2
View File
@@ -22243,7 +22243,7 @@ sTexMtxObj__17J3DDifferedTexMtx = .sbss:0x804515C4; // type:object size:0x4 scop
sInterruptFlag$903 = .sbss:0x804515C8; // type:object size:0x4 scope:local align:4 data:4byte
init$465 = .sbss:0x804515CC; // type:object size:0x1 scope:local align:1 data:byte
sOldVcdVatCmd__8J3DShape = .sbss:0x804515D0; // type:object size:0x4 scope:global align:4 data:4byte
sEnvelopeFlag__8J3DShape = .sbss:0x804515D4; // type:object size:0x4 scope:local align:4 data:byte
sEnvelopeFlag__8J3DShape = .sbss:0x804515D4; // type:object size:0x1 scope:local align:1 data:byte
SizeOfJ3DColorBlockLightOffLoad = .sbss:0x804515D8; // type:object size:0x4 scope:global align:4 data:4byte
SizeOfJ3DColorBlockAmbientOnLoad = .sbss:0x804515DC; // type:object size:0x4 scope:global align:4 data:4byte
entryNum__13J3DDrawBuffer = .sbss:0x804515E0; // type:object size:0x4 scope:global align:4 data:4byte
@@ -22424,7 +22424,7 @@ resetFuncRegistered$145 = .sbss:0x80451944; // type:object size:0x4 scope:local
CPUFifo = .sbss:0x80451948; // type:object size:0x4 scope:global align:4 data:4byte
GPFifo = .sbss:0x8045194C; // type:object size:0x4 scope:global align:4 data:4byte
__GXCurrentThread = .sbss:0x80451950; // type:object size:0x4 scope:global align:4 data:4byte
data_80451954 = .sbss:0x80451954; // type:object size:0x1 scope:local align:1 data:byte
CPGPLinked = .sbss:0x80451954; // type:object size:0x1 scope:local align:1 data:byte
GXOverflowSuspendInProgress = .sbss:0x80451958; // type:object size:0x4 scope:global align:4 data:4byte
BreakPointCB = .sbss:0x8045195C; // type:object size:0x4 scope:global align:4 data:4byte
__GXOverflowCount = .sbss:0x80451960; // type:object size:0x4 scope:global align:4 data:4byte
+138 -142
View File
File diff suppressed because it is too large Load Diff
+3 -6
View File
@@ -16414,12 +16414,9 @@ TRKTargetReadInstruction = .text:0x80371BB8; // type:function size:0x4C scope:gl
TRKTargetAccessMemory = .text:0x80371C04; // type:function size:0x14C scope:global align:4
TRKValidMemory32 = .text:0x80371D50; // type:function size:0x2A4 scope:global align:4
TRKAccessFile = .text:0x80372000; // type:function size:0x8 scope:global align:16
TRKOpenFile = .text:0x80372008; // type:label scope:global align:4
fn_80372008 = .text:0x80372008; // type:function size:0x8
TRKCloseFile = .text:0x80372010; // type:label scope:global align:4
fn_80372010 = .text:0x80372010; // type:function size:0x8
TRKPositionFile = .text:0x80372018; // type:label scope:global align:4
fn_80372018 = .text:0x80372018; // type:function size:0x8
TRKOpenFile = .text:0x80372008; // type:function size:0x8 scope:global align:4
TRKCloseFile = .text:0x80372010; // type:function size:0x8 scope:global align:4
TRKPositionFile = .text:0x80372018; // type:function size:0x8 scope:global align:4
TRKSaveExtended1Block = .text:0x80372020; // type:function size:0x1B8 scope:global align:4
TRKRestoreExtended1Block = .text:0x803721D8; // type:function size:0x1B8 scope:global align:4
InitMetroTRK = .text:0x80372390; // type:function size:0x98 scope:global align:4
+2 -2
View File
@@ -735,9 +735,9 @@ config.libs = [
Object(MatchingFor(ALL_GCN), "d/d_meter2_info.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_meter2.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_msg_out_font.cpp"),
Object(NonMatching, "d/d_msg_class.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_msg_class.cpp"),
Object(Equivalent, "d/d_msg_object.cpp"), # weak func order
Object(MatchingFor("GZ2P01"), "d/d_msg_unit.cpp"),
Object(MatchingFor("GZ2P01", "GZ2J01"), "d/d_msg_unit.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_3select.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_arrow.cpp"),
Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_base.cpp"),
+28 -34
View File
@@ -5,6 +5,16 @@
#include "JSystem/JMessage/JMessage.h"
#include "SSystem/SComponent/c_xyz.h"
#if REGION_JPN
#define D_MSG_CLASS_PAGE_CNT_MAX 30
#define D_MSG_CLASS_CHAR_CNT_MAX 0x210
#define D_MSG_CLASS_LINE_MAX 9
#else
#define D_MSG_CLASS_PAGE_CNT_MAX 40
#define D_MSG_CLASS_CHAR_CNT_MAX 0x200
#define D_MSG_CLASS_LINE_MAX 12
#endif
class JMSMesgEntry_c {
public:
/* 0x0 */ u32 string_offset;
@@ -258,7 +268,7 @@ struct jmessage_tReference : public JMessage::TReference {
s16 getCharCnt() { return mCharCnt; }
struct CharSoundInfo {
u16 data[0x200];
u16 data[D_MSG_CLASS_CHAR_CNT_MAX];
s16 field_0x40c;
s16 field_0x40e;
s16 mCountBackUp;
@@ -291,8 +301,8 @@ struct jmessage_tReference : public JMessage::TReference {
/* 0x045C */ f32 mCharAllAlphaRate;
/* 0x0460 */ f32 mAddCharAlpha;
/* 0x0464 */ f32 mCharAlpha;
/* 0x0468 */ f32 mStrLength[40];
/* 0x0508 */ f32 mSpaceLength[40];
/* 0x0468 */ f32 mStrLength[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x0508 */ f32 mSpaceLength[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x05A8 */ f32 mSelLength[3];
/* 0x05B4 */ u32 mDemoFrame;
/* 0x05B8 */ u32 mRevoMessageID;
@@ -311,19 +321,19 @@ struct jmessage_tReference : public JMessage::TReference {
/* 0x05DC */ u8 mNowLightCount;
/* 0x05DD */ u8 mDrawLightCount;
/* 0x05DE */ u16 mMsgID;
/* 0x05E0 */ u16 mLineScale[40];
/* 0x05E0 */ u16 mLineScale[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x0630 */ u16 mTopTagScale;
/* 0x0632 */ u16 mNowTagScale;
/* 0x0634 */ char mWord[10][100];
/* 0x0A1C */ char mText[0x200];
/* 0x0C1C */ char mTextS[0x200];
/* 0x0E1C */ char mRuby[0x200];
/* 0x0A1C */ char mText[D_MSG_CLASS_CHAR_CNT_MAX];
/* 0x0C1C */ char mTextS[D_MSG_CLASS_CHAR_CNT_MAX];
/* 0x0E1C */ char mRuby[D_MSG_CLASS_CHAR_CNT_MAX];
/* 0x101C */ char mSelText[3][50];
/* 0x10B2 */ char mSelRuby[3][80];
/* 0x11A2 */ s8 mPageLine[40];
/* 0x11CA */ s8 mPageLineMax[40];
/* 0x11F2 */ u8 mPageType[40];
/* 0x121A */ u8 mLineArrange[40];
/* 0x11A2 */ s8 mPageLine[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x11CA */ s8 mPageLineMax[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x11F2 */ u8 mPageType[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x121A */ u8 mLineArrange[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x1242 */ u8 mSelectNum;
/* 0x1243 */ u8 mSelectType;
/* 0x1244 */ u8 mSelectPos;
@@ -358,7 +368,6 @@ struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
/* 8022B458 */ void do_rubyset(void const*, u32);
/* 8022B4E0 */ void push_word(char*);
/* 8022B5F4 */ virtual ~jmessage_tMeasureProcessor() {}
/* 80229AC4 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80229CB4 */ virtual void do_end();
/* 80229E3C */ virtual void do_character(int iCharacter);
@@ -396,7 +405,6 @@ struct jmessage_tSequenceProcessor : public JMessage::TSequenceProcessor {
/* 8022CB10 */ void messageSePlay(u8, u8, cXyz*);
/* 8022CBE8 */ void calcStringLength();
/* 8023299C */ virtual ~jmessage_tSequenceProcessor() {}
/* 8022B654 */ virtual void do_reset();
/* 8022B658 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022BA3C */ virtual void do_end();
@@ -460,7 +468,6 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
/* 8022F734 */ void push_word();
/* 8022F784 */ void getCharInfo(f32, f32, f32, f32, f32);
/* 8023293C */ virtual ~jmessage_tRenderingProcessor() {}
/* 8022CDC8 */ virtual void do_reset();
/* 8022CDCC */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022CFD8 */ virtual void do_end();
@@ -499,7 +506,7 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
/* 0x060 */ f32 mSelTextInitPosX[3];
/* 0x06C */ f32 mSelTextInitPosY[3];
/* 0x078 */ f32 mTextInitOffsetPos;
/* 0x07C */ f32 field_0x7c[40];
/* 0x07C */ f32 field_0x7c[D_MSG_CLASS_PAGE_CNT_MAX];
/* 0x11C */ int field_0x11c;
/* 0x120 */ u32 mCCColor;
/* 0x124 */ u32 mGCColor;
@@ -529,8 +536,6 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
struct jmessage_string_tControl : public JMessage::TControl {
/* 8022FB5C */ jmessage_string_tControl();
/* 802328DC */ virtual ~jmessage_string_tControl() {}
};
struct jmessage_string_tReference : public JMessage::TReference {
@@ -572,19 +577,14 @@ struct jmessage_string_tReference : public JMessage::TReference {
void setLineMax(u8 lineMax) { mLineMax = lineMax; }
COutFont_c* getOutFontPtr() { return mOutFontPtr; }
/* 8022F94C */ virtual ~jmessage_string_tReference() {}
/* 8022F94C */ virtual ~jmessage_string_tReference();
/* 0x08 */ J2DTextBox* mPanePtr;
/* 0x0C */ J2DTextBox* mRubyPanePtr;
/* 0x10 */ COutFont_c* mOutFontPtr;
/* 0x14 */ JUTFont* mpFont;
#if VERSION == VERSION_GCN_JPN
/* 0x18 */ f32 mLineLength[9];
/* 0x3C */ f32 mOutfontLength[9];
#else
/* 0x18 */ f32 mLineLength[12];
/* 0x48 */ f32 mOutfontLength[12];
#endif
/* 0x18 */ f32 mLineLength[D_MSG_CLASS_LINE_MAX];
/* 0x3C */ f32 mOutfontLength[D_MSG_CLASS_LINE_MAX];
/* 0x78 */ u32 mCCColor;
/* 0x7C */ u32 mGCColor;
/* 0x80 */ s16 mLineCount;
@@ -597,7 +597,6 @@ struct jmessage_string_tMeasureProcessor : public JMessage::TRenderingProcessor
/* 8022FB98 */ jmessage_string_tMeasureProcessor(jmessage_string_tReference const* pReference);
/* 8023098C */ void do_rubyset(void const*, u32);
/* 80230A5C */ virtual ~jmessage_string_tMeasureProcessor() {}
/* 8022FBE4 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022FC14 */ virtual void do_end();
/* 8022FC28 */ virtual void do_character(int iCharacter);
@@ -610,7 +609,6 @@ struct jmessage_string_tSequenceProcessor : public JMessage::TSequenceProcessor
/* 80230A08 */ jmessage_string_tSequenceProcessor(jmessage_string_tReference const* pReference,
jmessage_string_tControl* pControl);
/* 80232858 */ virtual ~jmessage_string_tSequenceProcessor() {}
/* 80230ABC */ virtual void do_reset();
/* 80230AC0 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80230B7C */ virtual void do_end();
@@ -639,7 +637,6 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
/* 802326E4 */ void do_numset(s16);
/* 802327BC */ void push_word(char const*);
/* 802327F8 */ virtual ~jmessage_string_tRenderingProcessor() {}
/* 80230C5C */ virtual void do_reset();
/* 80230CA0 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80230CE8 */ virtual void do_end();
@@ -655,18 +652,15 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
/* 0x048 */ f32 field_0x48;
/* 0x04C */ f32 field_0x4c;
/* 0x050 */ f32 field_0x50;
/* 0x054 */ char field_0x54[0x200];
/* 0x254 */ char field_0x254[0x200];
/* 0x054 */ char field_0x54[D_MSG_CLASS_CHAR_CNT_MAX];
/* 0x254 */ char field_0x254[D_MSG_CLASS_CHAR_CNT_MAX];
/* 0x454 */ char field_0x454[0x486 - 0x454];
/* 0x486 */ char field_0x486[0x20]; // Unknown length
/* 0x4a6 */ u8 field_0x4a6[0x54e - 0x4a6];
/* 0x4A6 */ u8 field_0x4a6[0x54e - 0x4a6];
/* 0x54E */ s16 field_0x54e;
/* 0x550 */ s16 field_0x550;
/* 0x552 */ s16 field_0x552;
/* 0x554 */ u8 field_0x554;
#if VERSION == VERSION_GCN_JPN
/* 0x558 */ u8 field_0x558[0x578 - 0x558];
#endif
};
#define MSGTAG_GROUP(g) (g << 16)
+2 -2
View File
@@ -766,13 +766,13 @@ int daAlink_c::procCanoeRowInit(int param_0) {
}
if (spC == 1) {
var_r29 = var_r28 == 2 ? ANM_CANOE_ROW_RIGHT_BACK : ANM_CANOE_ROW_LEFT_BACK;
var_r29 = (daAlink_ANM)(var_r28 == 2 ? (int)ANM_CANOE_ROW_RIGHT_BACK : (int)ANM_CANOE_ROW_LEFT_BACK);
if ((var_r29 == ANM_CANOE_ROW_RIGHT_BACK && mProcVar5.field_0x3012 == 0) || (var_r29 == ANM_CANOE_ROW_LEFT_BACK && mProcVar5.field_0x3012 == 1)) {
return procCanoePaddleShiftInit(var_r29);
}
} else {
var_r29 = var_r28 == 2 ? ANM_CANOE_ROW_RIGHT : ANM_CANOE_ROW_LEFT;
var_r29 = (daAlink_ANM)(var_r28 == 2 ? (int)ANM_CANOE_ROW_RIGHT : (int)ANM_CANOE_ROW_LEFT);
if ((var_r29 == ANM_CANOE_ROW_RIGHT && mProcVar5.field_0x3012 == 0) || (var_r29 == ANM_CANOE_ROW_LEFT && mProcVar5.field_0x3012 == 1)) {
return procCanoePaddleShiftInit(var_r29);
+7
View File
@@ -73,10 +73,17 @@ void dFile_warning_c::screenSet() {
JUT_ASSERT(0, mpRootPane != NULL);
field_0x34 = mpRootPane->getTranslateY();
#if REGION_JPN
mFileWarn.Scr->search('ms_for_2')->hide();
mFileWarn.Scr->search('ms_for_3')->hide();
field_0x20 = static_cast<J2DTextBox*>(mFileWarn.Scr->search('w_msg_jp'));
#else
mFileWarn.Scr->search('w_msg_jp')->hide();
mFileWarn.Scr->search('ms_for_2')->hide();
field_0x20 = static_cast<J2DTextBox*>(mFileWarn.Scr->search('ms_for_3'));
#endif
field_0x20->show();
field_0x20->setFont(mFileWarn.mFont);
field_0x20->setString(0x200, "");
+179 -40
View File
@@ -11,6 +11,26 @@
#include "d/d_lib.h"
#include "JSystem/JUtility/JUTFont.h"
#if REGION_JPN
#define CHAR_CODE_MALE_ICON 0x8189
#define CHAR_CODE_FEMALE_ICON 0x818A
#define CHAR_CODE_STAR_ICON 0x819A
#define CHAR_CODE_REFMARK 0x81A6
#define CHAR_CODE_THIN_LEFT_ARROW 0x81A9
#define CHAR_CODE_THIN_RIGHT_ARROW 0x81A8
#define CHAR_CODE_THIN_UP_ARROW 0x81AA
#define CHAR_CODE_THIN_DOWN_ARROW 0x81AB
#else
#define CHAR_CODE_MALE_ICON 0xB2
#define CHAR_CODE_FEMALE_ICON 0xB3
#define CHAR_CODE_STAR_ICON 0xB1
#define CHAR_CODE_REFMARK 0x89
#define CHAR_CODE_THIN_LEFT_ARROW 0xB9
#define CHAR_CODE_THIN_RIGHT_ARROW 0xBC
#define CHAR_CODE_THIN_UP_ARROW 0xBD
#define CHAR_CODE_THIN_DOWN_ARROW 0xBE
#endif
/* 80228578-802285CC 222EB8 0054+00 1/1 0/0 0/0 .text checkCharInfoCharactor__Fi */
static bool checkCharInfoCharactor(int c) {
if (c != 0x8140 && c != 0x8141 && c != 0x8142 && c != 0x0020 && c != 0x0022 && c != 0x0027 &&
@@ -420,6 +440,19 @@ void jmessage_tReference::calcDistance() {
u8 jmessage_tReference::getLineMax() {
int line_max;
#if REGION_JPN
if (isKanban()) {
line_max = 6;
} else if (isBook()) {
line_max = 7;
} else if (isStaffRoll()) {
line_max = 10;
} else if (isSaveSeq()) {
line_max = 5;
} else {
line_max = 3;
}
#else
if (isKanban()) {
line_max = 7;
} else if (isBook()) {
@@ -431,6 +464,7 @@ u8 jmessage_tReference::getLineMax() {
} else {
line_max = 4;
}
#endif
return line_max;
}
@@ -732,7 +766,7 @@ void jmessage_tReference::addCharactor(u16 i_character) {
/* 802297B0-802297E4 2240F0 0034+00 3/3 0/0 0/0 .text resetCharactor__19jmessage_tReferenceFv */
void jmessage_tReference::resetCharactor() {
for (int i = 0; i < 0x200; i++) {
for (int i = 0; i < ARRAY_SIZE(mCharactor.data); i++) {
mCharactor.data[i] = 0;
}
@@ -896,7 +930,7 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex
mSeSpeaker = ((JMSMesgEntry_c*)pEntry)->se_speaker;
mSeMood = ((JMSMesgEntry_c*)pEntry)->se_mood;
for (int i = 0; i < 40; i++) {
for (int i = 0; i < D_MSG_CLASS_PAGE_CNT_MAX; i++) {
pReference->setLineLength(i, 0.0f, 0.0f);
pReference->setPageLine(i, 0);
pReference->setPageLineMax(i, 0);
@@ -913,9 +947,11 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex
pReference->setLineArrange(i, 1);
}
#if !REGION_JPN
if (((JMSMesgEntry_c*)pEntry)->unk_0xd == 0) {
pReference->setLineArrange(i, 1);
}
#endif
}
}
@@ -1524,28 +1560,28 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz
push_word(buffer);
return true;
case MSGTAG_MALE_ICON:
push_word(changeCodeToChar(0xB2));
push_word(changeCodeToChar(CHAR_CODE_MALE_ICON));
return true;
case MSGTAG_FEMALE_ICON:
push_word(changeCodeToChar(0xB3));
push_word(changeCodeToChar(CHAR_CODE_FEMALE_ICON));
return true;
case MSGTAG_STAR_ICON:
push_word(changeCodeToChar(0xB1));
push_word(changeCodeToChar(CHAR_CODE_STAR_ICON));
return true;
case MSGTAG_REFMARK:
push_word(changeCodeToChar(0x89));
push_word(changeCodeToChar(CHAR_CODE_REFMARK));
return true;
case MSGTAG_THIN_LEFT_ARROW:
push_word(changeCodeToChar(0xB9));
push_word(changeCodeToChar(CHAR_CODE_THIN_LEFT_ARROW));
return true;
case MSGTAG_THIN_RIGHT_ARROW:
push_word(changeCodeToChar(0xBC));
push_word(changeCodeToChar(CHAR_CODE_THIN_RIGHT_ARROW));
return true;
case MSGTAG_THIN_UP_ARROW:
push_word(changeCodeToChar(0xBD));
push_word(changeCodeToChar(CHAR_CODE_THIN_UP_ARROW));
return true;
case MSGTAG_THIN_DOWN_ARROW:
push_word(changeCodeToChar(0xBE));
push_word(changeCodeToChar(CHAR_CODE_THIN_DOWN_ARROW));
return true;
case MSGTAG_BULLET:
case MSGTAG_BULLET_SPACE:
@@ -1596,6 +1632,11 @@ void jmessage_tMeasureProcessor::do_scale(f32 i_scale) {
mPageLineMax--;
JUT_ASSERT(0x930, mPageLineMax > 0);
#if REGION_JPN
if (field_0x3e == 0) {
pReference->setPageType(field_0x40, 2);
}
#else
if (field_0x3e == 0) {
pReference->setPageType(field_0x40, 2);
} else if (field_0x3e == 2 && mPageLineMax == 3) {
@@ -1604,7 +1645,9 @@ void jmessage_tMeasureProcessor::do_scale(f32 i_scale) {
} else {
pReference->setPageType(field_0x40, 8);
}
} else {
}
#endif
else {
pReference->setPageType(field_0x40, 3);
if (field_0x3e == 1 && pReference->getPageType(field_0x40) == 2) {
pReference->setPageType(field_0x40, 4);
@@ -1764,6 +1807,13 @@ void jmessage_tMeasureProcessor::do_pageType(int param_0) {
/* 8022B454-8022B458 225D94 0004+00 1/1 0/0 0/0 .text do_name1__26jmessage_tMeasureProcessorFv */
void jmessage_tMeasureProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
push_word(changeCodeToChar(c));
}
#endif
}
/* 8022B458-8022B4E0 225D98 0088+00 1/1 0/0 0/0 .text
@@ -2036,7 +2086,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
field_0xae = 1;
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(0x200);
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
field_0xa4 = field_0xa8;
return true;
}
@@ -2056,7 +2106,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
field_0xae = 1;
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(0x200);
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
return true;
}
@@ -2079,7 +2129,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
if (mDoCPd_c::getTrigA(PAD_1) || field_0xb2 != 0) {
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(0x200);
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
}
break;
case 1:
@@ -2088,7 +2138,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
case 9:
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(0x200);
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
break;
case 2:
if (field_0xb2 != 0) {
@@ -2103,7 +2153,11 @@ bool jmessage_tSequenceProcessor::do_isReady() {
}
field_0xa6++;
#if REGION_JPN
if (field_0xa6 >= 1) {
#else
if (field_0xa6 >= 2) {
#endif
field_0xa4 = field_0xa8;
field_0xa6 = 0;
}
@@ -2519,6 +2573,13 @@ bool jmessage_tSequenceProcessor::do_jump_isReady() {
/* 8022C904-8022C908 227244 0004+00 1/1 0/0 0/0 .text do_name1__27jmessage_tSequenceProcessorFv */
void jmessage_tSequenceProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
push_word();
}
#endif
}
/* 8022C908-8022CA24 227248 011C+00 2/1 0/0 0/0 .text do_space__27jmessage_tSequenceProcessorFUl
@@ -2713,7 +2774,7 @@ jmessage_tRenderingProcessor::jmessage_tRenderingProcessor(jmessage_tReference c
field_0x151 = 0;
field_0x138 = 0.0f;
for (int i = 0; i < 40; i++) {
for (int i = 0; i < ARRAY_SIZE(field_0x7c); i++) {
field_0x7c[i] = 0.0f;
}
}
@@ -2767,7 +2828,7 @@ void jmessage_tRenderingProcessor::do_begin(void const* pEntry, char const* pszT
mpOutFont->initialize();
for (int i = 0; i < 40; i++) {
for (int i = 0; i < ARRAY_SIZE(field_0x7c); i++) {
field_0x7c[i] = 0.0f;
}
@@ -3367,6 +3428,73 @@ void jmessage_tRenderingProcessor::do_heightcenter() {
}
break;
}
#if REGION_JPN
case 2:
if ((s8)pReference->getLineMax() == 3) {
int nowPageLine = pReference->getNowPageLine();
field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine));
var_f31 += field_0x138;
break;
}
if (field_0x142 == 0) {
field_0x138 = pReference->getLineSpace();
var_f31 += field_0x138;
} else if (field_0x142 == 1) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
break;
case 3: {
if (field_0x142 == 1) {
int nowPageLine = pReference->getNowPageLine();
field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine));
var_f31 += field_0x138;
break;
}
break;
}
case 4: {
if (field_0x142 == 1) {
var_f31 += 0.5f * pReference->getLineSpace();
}
f32 sp8 = pReference->getLineScale(field_0x142) / 100.0f;
f32 dVar15 = (pReference->getLineSpace() - (sp8 * pReference->getFontSizeY())) / 2;
field_0x138 += dVar15;
var_f31 += dVar15;
break;
}
case 5: {
if (field_0x142 >= 1) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
f32 sp8 = pReference->getLineScale(field_0x142) / 100.0f;
f32 dVar15 = (pReference->getLineSpace() - (sp8 * pReference->getFontSizeY())) / 2;
field_0x138 += dVar15;
var_f31 += dVar15;
break;
}
case 6:
if (field_0x142 <= 1) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
break;
case 7:
if (field_0x142 == 1 || field_0x142 == 2) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
break;
case 8:
if (field_0x142 == 2) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
#else
case 2:
if (field_0x142 == 0) {
field_0x138 = pReference->getLineSpace();
@@ -3429,6 +3557,7 @@ void jmessage_tRenderingProcessor::do_heightcenter() {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
#endif
}
if (field_0x142 == 0) {
@@ -3620,7 +3749,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par
} else {
JUT_WARN(5316, "%s", "TextBox Alloc Byte Over!!");
}
} else if (field_0x11c < 0x200) {
} else if (field_0x11c < D_MSG_CLASS_CHAR_CNT_MAX) {
if (param_2) {
field_0x146++;
if (pReference->getBatchColorFlag() != 0) {
@@ -3655,7 +3784,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par
int length = 0;
length = strlen(buffer);
if (field_0x11c + length < 0x200) {
if (field_0x11c + length < D_MSG_CLASS_CHAR_CNT_MAX) {
field_0x148 = strlen(pReference->getTextPtr());
field_0x14a = strlen(pReference->getTextSPtr());
@@ -3756,6 +3885,13 @@ void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, char* i_dst, f32 i
*/
void jmessage_tRenderingProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
push_word();
}
#endif
}
/* 8022F540-8022F734 229E80 01F4+00 1/1 0/0 0/0 .text do_numset__28jmessage_tRenderingProcessorFs
@@ -3836,7 +3972,7 @@ jmessage_string_tReference::jmessage_string_tReference() {
mRubyPanePtr = NULL;
mpFont = mDoExt_getMesgFont();
for (int i = 0; i < 12; i++) {
for (int i = 0; i < ARRAY_SIZE(mLineLength); i++) {
mLineLength[i] = 0.0f;
mOutfontLength[i] = 0.0f;
}
@@ -3844,6 +3980,9 @@ jmessage_string_tReference::jmessage_string_tReference() {
resetCharactor();
}
jmessage_string_tReference::~jmessage_string_tReference() {
}
/* 8022F9AC-8022FA2C 22A2EC 0080+00 0/0 3/3 0/0 .text
* init__26jmessage_string_tReferenceFP10J2DTextBoxP10J2DTextBoxP7JUTFontP10COutFont_cUc */
void jmessage_string_tReference::init(J2DTextBox* panePtr, J2DTextBox* runyPanePtr,
@@ -3852,14 +3991,14 @@ void jmessage_string_tReference::init(J2DTextBox* panePtr, J2DTextBox* runyPaneP
mRubyPanePtr = runyPanePtr;
mOutFontPtr = outFontPtr;
mLineCount = 0;
mLineMax = 12;
mLineMax = D_MSG_CLASS_LINE_MAX;
mNowPage = 0;
mFlags = flags;
if (font != NULL) {
mpFont = font;
}
for (int i = 0; i < 12; i++) {
for (int i = 0; i < ARRAY_SIZE(mLineLength); i++) {
mLineLength[i] = 0.0f;
mOutfontLength[i] = 0.0f;
}
@@ -4299,28 +4438,28 @@ bool jmessage_string_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u3
stack_pushCurrent(buffer);
break;
case MSGTAG_MALE_ICON:
stack_pushCurrent(changeCodeToChar(0xB2));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_MALE_ICON));
break;
case MSGTAG_FEMALE_ICON:
stack_pushCurrent(changeCodeToChar(0xB3));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_FEMALE_ICON));
break;
case MSGTAG_STAR_ICON:
stack_pushCurrent(changeCodeToChar(0xB1));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_STAR_ICON));
break;
case MSGTAG_REFMARK:
stack_pushCurrent(changeCodeToChar(0x89));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_REFMARK));
break;
case MSGTAG_THIN_LEFT_ARROW:
stack_pushCurrent(changeCodeToChar(0xB9));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_THIN_LEFT_ARROW));
break;
case MSGTAG_THIN_RIGHT_ARROW:
stack_pushCurrent(changeCodeToChar(0xBC));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_THIN_RIGHT_ARROW));
break;
case MSGTAG_THIN_UP_ARROW:
stack_pushCurrent(changeCodeToChar(0xBD));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_THIN_UP_ARROW));
break;
case MSGTAG_THIN_DOWN_ARROW:
stack_pushCurrent(changeCodeToChar(0xBE));
stack_pushCurrent(changeCodeToChar(CHAR_CODE_THIN_DOWN_ARROW));
break;
case MSGTAG_BULLET:
case MSGTAG_BULLET_SPACE:
@@ -4942,28 +5081,28 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data,
push_word(buffer);
break;
case MSGTAG_MALE_ICON:
push_word(changeCodeToChar(0xB2));
push_word(changeCodeToChar(CHAR_CODE_MALE_ICON));
break;
case MSGTAG_FEMALE_ICON:
push_word(changeCodeToChar(0xB3));
push_word(changeCodeToChar(CHAR_CODE_FEMALE_ICON));
break;
case MSGTAG_STAR_ICON:
push_word(changeCodeToChar(0xB1));
push_word(changeCodeToChar(CHAR_CODE_STAR_ICON));
break;
case MSGTAG_REFMARK:
push_word(changeCodeToChar(0x89));
push_word(changeCodeToChar(CHAR_CODE_REFMARK));
break;
case MSGTAG_THIN_LEFT_ARROW:
push_word(changeCodeToChar(0xB9));
push_word(changeCodeToChar(CHAR_CODE_THIN_LEFT_ARROW));
break;
case MSGTAG_THIN_RIGHT_ARROW:
push_word(changeCodeToChar(0xBC));
push_word(changeCodeToChar(CHAR_CODE_THIN_RIGHT_ARROW));
break;
case MSGTAG_THIN_UP_ARROW:
push_word(changeCodeToChar(0xBD));
push_word(changeCodeToChar(CHAR_CODE_THIN_UP_ARROW));
break;
case MSGTAG_THIN_DOWN_ARROW:
push_word(changeCodeToChar(0xBE));
push_word(changeCodeToChar(CHAR_CODE_THIN_DOWN_ARROW));
break;
case MSGTAG_BULLET:
do_outfont(42);
@@ -5134,7 +5273,7 @@ void jmessage_string_tRenderingProcessor::do_heightcenter() {
void jmessage_string_tRenderingProcessor::do_strcat(char* i_str) {
if (getLineCountNowPage() >= 0) {
field_0x54e += strlen(i_str);
if (field_0x54e < 512) {
if (field_0x54e < ARRAY_SIZE(field_0x54)) {
strcat(field_0x54, i_str);
} else {
JUT_WARN(7531, "%s", "Message Alloc Byte Over!!");
@@ -5187,7 +5326,7 @@ void jmessage_string_tRenderingProcessor::do_rubyset(void const* i_data, u32 i_s
void jmessage_string_tRenderingProcessor::do_rubystrcat(char* i_str) {
if (getLineCountNowPage() >= 0) {
field_0x550 += strlen(i_str);
if (field_0x550 < 512) {
if (field_0x550 < ARRAY_SIZE(field_0x254)) {
strcat(field_0x254, i_str);
} else {
JUT_WARN(7613, "%s", "Message Alloc Byte Over!!");
+181
View File
@@ -14,8 +14,22 @@
// temporary until a better solution is found
typedef struct dMsgUnit_inf1_entry {
u32 dat1EntryOffset;
#if REGION_JPN
u16 field_0x04;
u16 field_0x06;
u16 field_0x08;
u16 field_0x0a;
u16 field_0x0c;
u16 field_0x0e;
u16 field_0x10;
u16 field_0x12;
u16 field_0x14;
u16 field_0x16;
u16 field_0x18;
#else
u16 startFrame;
u16 endFrame;
#endif
} dMsgUnit_inf1_entry;
typedef struct dMsgUnit_inf1_section_t {
@@ -35,6 +49,172 @@ dMsgUnit_c::~dMsgUnit_c() {}
/* 80238CEC-8023907C 23362C 0390+00 0/0 5/5 0/0 .text setTag__10dMsgUnit_cFiiPcb */
// NONMATCHING - regalloc
#if REGION_JPN
void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
*o_buffer = 0;
bool stack9 = false;
bool stack8 = false;
int value = i_value;
if (i_type == 0x10000) {
sprintf(o_buffer, "%d", i_value);
return;
}
if (i_type == 0x10001) {
int tens_digit = i_value / 10;
int ones_digit = i_value % 10;
sprintf(o_buffer, "%d-%d", tens_digit, ones_digit);
return;
}
if ((i_type == 4 && param_4 == true) || (i_type == 5 && param_4 == false)) {
int seconds = i_value / 1000;
int minutes = seconds / 60;
seconds -= minutes * 60;
if (minutes > 99) {
minutes = 99;
seconds = 59;
}
if (minutes == 0 && seconds == 0) {
if (strcmp(dComIfGp_getStartStageName(), "F_SP00") == 0) {
return;
}
}
if (i_type == 4) {
i_value = minutes;
if (minutes == 0) {
stack9 = true;
}
}
if (i_type == 5) {
if (seconds == 0 && minutes != 0) {
return;
}
i_value = seconds;
}
}
if ((i_type == 3 && param_4 == true) || i_type == 4 && param_4 == false) {
f32 dayTime = g_env_light.getDaytime();
f32 hour = dayTime / 15.0f;
f32 iVar8b = ((s32)(1000000.0f * dayTime) % 15000000) / 1000000.0f;
f32 minute = 60.0f * (iVar8b / 15.0f);
// not sure why this affects codegen, in theory it should be optimized out
f32 minute2 = 60.0f * (iVar8b / 15.0f);
if (i_type == 3) {
i_value = (s32)hour;
}
if (i_type == 4) {
i_value = (s32)minute;
}
}
if (i_type == 9 && param_4 == true) {
sprintf(o_buffer, "%d", i_value);
stack8 = true;
}
if (!stack9) {
bmg_header_t* pHeader = (bmg_header_t*)dMeter2Info_getMsgUnitResource();
dMsgUnit_inf1_section_t* pInfoBlock = NULL;
const void* pMsgDataBlock = NULL;
str1_section_t* pStrAttributeBlock = NULL;
int filepos = sizeof(bmg_header_t);
u32 filesize = pHeader->size;
bmg_section_t* pSection = (bmg_section_t*)(((u8*)pHeader) + filepos);
for (; filepos < filesize; filepos += pSection->size) {
switch(pSection->magic) {
case 'FLW1':
break;
case 'FLI1':
break;
case 'INF1':
pInfoBlock = (dMsgUnit_inf1_section_t*)pSection;
break;
case 'DAT1':
pMsgDataBlock = pSection;
break;
case 'STR1':
pStrAttributeBlock = (str1_section_t*)pSection;
break;
}
pSection = (bmg_section_t*)((u8*)pSection + pSection->size);
}
u16 vals[12];
vals[0] = pInfoBlock->entries[i_type].field_0x04;
vals[1] = pInfoBlock->entries[i_type].field_0x06;
vals[2] = pInfoBlock->entries[i_type].field_0x08;
vals[3] = pInfoBlock->entries[i_type].field_0x0a;
vals[4] = pInfoBlock->entries[i_type].field_0x0c;
vals[5] = pInfoBlock->entries[i_type].field_0x0e;
vals[6] = pInfoBlock->entries[i_type].field_0x10;
vals[7] = pInfoBlock->entries[i_type].field_0x12;
vals[8] = pInfoBlock->entries[i_type].field_0x14;
vals[9] = pInfoBlock->entries[i_type].field_0x16;
vals[10] = pInfoBlock->entries[i_type].field_0x18;
int entryOff = pInfoBlock->entries[i_type].dat1EntryOffset;
char* value2 = (char*)((uintptr_t)pMsgDataBlock + entryOff + 8);
const char* uVar5;
if (i_value == 0) {
uVar5 = pStrAttributeBlock->entries->str + vals[0];
} else {
if ((i_value % 10) == 0) {
uVar5 = pStrAttributeBlock->entries->str + (vals[10]);
} else {
uVar5 = pStrAttributeBlock->entries->str + vals[i_value % 10];
}
}
int uVar5Len = strlen(uVar5);
if (uVar5Len == 0) {
if (stack8) {
strcat(o_buffer, value2);
} else {
sprintf(o_buffer, "%d%s", i_value, value2);
}
} else {
char unkCharArr[7];
unkCharArr[0] = 26;
unkCharArr[1] = uVar5Len + 6;
unkCharArr[2] = -1;
unkCharArr[3] = -1;
unkCharArr[4] = 2;
unkCharArr[5] = strlen(value2) / 2;
unkCharArr[6] = 0;
if (stack8) {
strcat(o_buffer, unkCharArr);
strcat(o_buffer, uVar5);
strcat(o_buffer, value2);
} else {
sprintf(o_buffer, "%d%s%s%s", i_value, unkCharArr, uVar5, value2);
}
}
}
if (i_type == 3 && param_4 == true) {
char buffer[20];
setTag(4, 0, buffer, false);
strcat(o_buffer, buffer);
}
if (i_type == 4 && param_4 == true) {
char buffer[20];
setTag(5, value, buffer, false);
strcat(o_buffer, buffer);
}
}
#else
void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
*o_buffer = 0;
bool stack9 = false;
@@ -162,6 +342,7 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) {
}
}
}
#endif
/* 804510D0-804510D8 0005D0 0004+04 1/1 5/5 0/0 .sbss g_msg_unit */
dMsgUnit_c g_msg_unit;