fix GC JPN dol splits / d_a_npc_prayer mostly done (#2488)

* jmessage cleanup pass

* more JMessage cleanup

* d_msg_class cleanup

* fix a bunch of gc jpn dol splits

* d_a_npc_prayer pretty much equivalent
This commit is contained in:
TakaRikka
2025-06-18 01:05:44 -07:00
committed by GitHub
parent 23cba4d117
commit 0a899a404e
14 changed files with 1867 additions and 1973 deletions
+11 -89
View File
@@ -1977,97 +1977,19 @@ void daNpcF_clearMessageTmpBit() {
daNpcF_offTmpBit(0x37);
}
/* 80155B54-80155BB4 150494 0060+00 1/0 0/0 0/0 .text __dt__20daNpcF_MoveBgActor_cFv */
daNpcF_MoveBgActor_c::~daNpcF_MoveBgActor_c() {}
/* 80155BB8-80155BBC 1504F8 0004+00 2/0 0/0 0/0 .text setAttnPos__8daNpcF_cFv */
void daNpcF_c::setAttnPos() {}
/* 80155BC0-80155BC8 150500 0008+00 2/0 0/0 0/0 .text main__8daNpcF_cFv */
BOOL daNpcF_c::main() {
return true;
// TODO: dummy to generate weak functions, proper fix later
static void dummyVirtual(daNpcF_MoveBgActor_c* dummy) {
dummy->~daNpcF_MoveBgActor_c();
dummy->CreateHeap();
dummy->Create();
dummy->Execute(NULL);
dummy->Draw();
dummy->Delete();
dummy->IsDelete();
dummy->ToFore();
dummy->ToBack();
}
/* 80155BC8-80155BCC 150508 0004+00 2/0 0/0 0/0 .text setParam__8daNpcF_cFv */
void daNpcF_c::setParam() {}
/* 80155BD0-80155BD8 150510 0008+00 2/0 0/0 0/0 .text drawDbgInfo__8daNpcF_cFv */
BOOL daNpcF_c::drawDbgInfo() {
return true;
}
/* 80155BD8-80155BE0 150518 0008+00 2/0 0/0 0/0 .text ctrlBtk__8daNpcF_cFv */
BOOL daNpcF_c::ctrlBtk() {
return false;
}
/* 80155BE0-80155BE8 150520 0008+00 2/0 0/0 0/0 .text setExpressionAnm__8daNpcF_cFib */
bool daNpcF_c::setExpressionAnm(int param_0, bool param_1) {
return true;
}
/* 80155BE8-80155BEC 150528 0004+00 2/0 0/0 0/0 .text setMotionAnm__8daNpcF_cFif */
void daNpcF_c::setMotionAnm(int param_0, f32 param_1) {}
/* 80155BEC-80155BF0 15052C 0004+00 2/0 0/0 0/0 .text setMotion__8daNpcF_cFifi */
void daNpcF_c::setMotion(int param_0, f32 param_1, int param_2) {}
/* 80155BF0-80155BF4 150530 0004+00 2/0 0/0 0/0 .text setExpression__8daNpcF_cFif */
void daNpcF_c::setExpression(int param_0, f32 param_1) {}
/* 80155E88-80155E90 1507C8 0008+00 1/0 0/0 0/0 .text CreateHeap__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::CreateHeap() {
return true;
}
/* 80155E90-80155E98 1507D0 0008+00 1/0 0/0 0/0 .text Create__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::Create() {
return true;
}
/* 80155E98-80155EA0 1507D8 0008+00 1/0 0/0 0/0 .text Delete__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::Delete() {
return true;
}
/* 80155EA0-80155EA8 1507E0 0008+00 1/0 0/0 0/0 .text Execute__20daNpcF_MoveBgActor_cFPPA3_A4_f */
bool daNpcF_MoveBgActor_c::Execute(f32 (**param_0)[3][4]) {
return true;
}
/* 80155EA8-80155EB0 1507E8 0008+00 1/0 0/0 0/0 .text Draw__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::Draw() {
return true;
}
/* 80155EB0-80155EB8 1507F0 0008+00 1/0 0/0 0/0 .text IsDelete__20daNpcF_MoveBgActor_cFv
*/
bool daNpcF_MoveBgActor_c::IsDelete() {
return true;
}
/* 80155EB8-80155EC0 1507F8 0008+00 1/0 0/0 0/0 .text ToFore__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::ToFore() {
return true;
}
/* 80155EC0-80155EC8 150800 0008+00 1/0 0/0 0/0 .text ToBack__20daNpcF_MoveBgActor_cFv */
bool daNpcF_MoveBgActor_c::ToBack() {
return true;
}
/* 80155EC8-80155ED0 150808 0008+00 2/0 0/0 0/0 .text setExpressionBtp__8daNpcF_cFi */
bool daNpcF_c::setExpressionBtp(int param_0) {
return true;
}
/* 80155ED0-80155FB0 150810 00E0+00 1/0 0/0 0/0 .text __dt__15daNpcF_MatAnm_cFv */
daNpcF_MatAnm_c::~daNpcF_MatAnm_c() {}
/* 80155FB0-80156010 1508F0 0060+00 1/0 0/0 0/0 .text __dt__23daBaseNpc_moveBgActor_cFv
*/
daBaseNpc_moveBgActor_c::~daBaseNpc_moveBgActor_c() {}
/* 803926B0-803926E0 01ED10 0030+00 0/0 0/0 0/0 .rodata mCcDObj__11daBaseNpc_c */
dCcD_SrcGObjInf const daBaseNpc_c::mCcDObj = {
{0, {{0, 0, 0}, {0x0, 0x0}, {0x79}}},
File diff suppressed because it is too large Load Diff
+29
View File
@@ -60,23 +60,43 @@ void dBrightCheck_c::screenSet() {
'font_a1', 'font_at2', 'font_at3', 'font_at4', 'font_at',
};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 const txTV[] = {
'menu_t6s', 'menu_t6', 'menu_t9s', 'menu_t9', 'menut10s',
'menu_t10', 'menu_t7s', 'menu_t7', 'menu_t8s', 'menu_t8',
};
#else
static u64 const txTV[] = {
'menu_t61', 'menu_t2', 'menu_t91', 'menu_t1', 'menut101',
'menu_t01', 'menu_t71', 'menu_t3', 'menu_t81', 'menu_t4',
};
#endif
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 const txTVhide[] = {
'fmenu_6n', 'fmenu_9n', 'fmenu_10', 'fmenu_7n', 'fmenu_8n',
};
#else
static u64 const txTVhide[] = {
'menu_6n', 'menu_9n', 'menu_10n', 'menu_7n', 'menu_8n',
};
#endif
mBrightCheck.Scr = new J2DScreen();
JUT_ASSERT(0, mBrightCheck.Scr != 0);
mBrightCheck.Scr->setPriority("zelda_option_check.blo", 0x1100000, mArchive);
mBrightCheck.Scr->search('g_abtn_n')->hide();
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
J2DTextBox* settings_text = (J2DTextBox*)mBrightCheck.Scr->search('t_t00');
mBrightCheck.Scr->search('t_t00')->show();
mBrightCheck.Scr->search('f_t00')->hide();
#else
J2DTextBox* settings_text = (J2DTextBox*)mBrightCheck.Scr->search('f_t00');
mBrightCheck.Scr->search('f_t00')->show();
mBrightCheck.Scr->search('t_t00')->hide();
#endif
settings_text->setFont(mDoExt_getRubyFont());
settings_text->setString(0x40, "");
@@ -84,8 +104,14 @@ void dBrightCheck_c::screenSet() {
J2DTextBox* btna_text[5];
for (int i = 0; i < 5; i++) {
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
btna_text[i] = (J2DTextBox*)mBrightCheck.Scr->search(tv_btnA[i]);
mBrightCheck.Scr->search(ftv_btnA[i])->hide();
#else
btna_text[i] = (J2DTextBox*)mBrightCheck.Scr->search(ftv_btnA[i]);
mBrightCheck.Scr->search(tv_btnA[i])->hide();
#endif
btna_text[i]->setFont(mDoExt_getMesgFont());
btna_text[i]->setString(0x40, "");
mBrightCheck.mMsgString->getString(0x564, btna_text[i], NULL, NULL, NULL, 0); // "Complete"
@@ -98,7 +124,10 @@ void dBrightCheck_c::screenSet() {
for (int i = 0; i < 10; i++) {
J2DTextBox* check_text = (J2DTextBox*)mBrightCheck.Scr->search(txTV[i]);
check_text->setFont(mDoExt_getMesgFont());
#if (VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN)
check_text->setCharSpace(0.0f);
#endif
if (i < 2) {
check_text->setString(0x100, "");
+34 -7
View File
@@ -30,6 +30,16 @@ struct BMG_INF1 : JUTDataBlockHeader {
/* 0x10 */ u32 entries[6];
};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#define LINE_HEIGHT 30.0f
#define LINE_SPACE 30.0f
#define CHAR_SPACE 3.0f
#else
#define LINE_HEIGHT 23.0f
#define LINE_SPACE 23.0f
#define CHAR_SPACE 1.0f
#endif
/* 8009CB88-8009D194 0974C8 060C+00 1/1 0/0 0/0 .text messageSet__FUlb */
static void messageSet(u32 status, bool i_drawBg) {
BMG_INF1* inf1 = (BMG_INF1*)&msg_data[0x20];
@@ -58,22 +68,22 @@ static void messageSet(u32 status, bool i_drawBg) {
size.mSizeY = 22.0f;
tpane.setFontSize(size);
tpane.setCharSpace(1.0f);
tpane.setLineSpace(23.0f);
tpane.setCharSpace(CHAR_SPACE);
tpane.setLineSpace(LINE_SPACE);
tpane.setCharColor(tcharcolor);
tpane.setGradColor(tgradcolor);
tpane.setBlackWhite(tblack, twhite);
spane.setFontSize(size);
spane.setCharSpace(1.0f);
spane.setLineSpace(23.0f);
spane.setCharSpace(CHAR_SPACE);
spane.setLineSpace(LINE_SPACE);
spane.setCharColor(scharcolor);
spane.setGradColor(sgradcolor);
spane.setBlackWhite(sblack, swhite);
const int lineMax = 10;
f32 height = 23.0f;
f32 height = LINE_HEIGHT;
f32 maxWidth = 0.0f;
int cnt = 0;
f32 lineWidth[lineMax];
@@ -83,19 +93,23 @@ static void messageSet(u32 status, bool i_drawBg) {
for (; *msg_p != '\0'; msg_p++) {
if (*msg_p == '\n') {
height += 23.0f;
height += LINE_HEIGHT;
cnt++;
JUT_ASSERT(191, cnt < lineMax);
continue;
}
int c = (u8)*msg_p;
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
if (pfont->isLeadByte_ShiftJIS(c)) {
#else
if (pfont->isLeadByte_EUC(c)) {
#endif
msg_p++;
c = (c << 8) | (u8)*msg_p;
}
lineWidth[cnt] += 1.0f + size.mSizeX * ((f32)pfont->getWidth(c) / (f32)pfont->getCellWidth());
lineWidth[cnt] += CHAR_SPACE + size.mSizeX * ((f32)pfont->getWidth(c) / (f32)pfont->getCellWidth());
}
for (int i = 0; i < lineMax; i++) {
@@ -104,6 +118,18 @@ static void messageSet(u32 status, bool i_drawBg) {
maxWidth = width;
}
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
f32 temp_0 = 0.0f; // fixes load order
f32 y = temp_0 + ((448.0f - height) / 2);
if (i_drawBg) {
ppane.mAlpha = 0x82;
ppane.draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false);
}
spane.draw(2.0f, y + 10.0f + 2.0f, 608.0f, HBIND_CENTER);
tpane.draw(0.0f, y + 10.0f, 608.0f, HBIND_CENTER);
#else
f32 temp_0 = 0.0f; // fixes load order
f32 x = temp_0 + ((608.0f - maxWidth) / 2);
f32 y = temp_0 + ((448.0f - height) / 2);
@@ -115,6 +141,7 @@ static void messageSet(u32 status, bool i_drawBg) {
spane.draw(x + 2.0f, y + 10.0f + 2.0f, 608.0f, HBIND_LEFT);
tpane.draw(x, y + 10.0f, 608.0f, HBIND_LEFT);
#endif
}
/* 8009D194-8009D354 097AD4 01C0+00 1/1 0/0 0/0 .text draw__14dDvdErrorMsg_cFl */
+22
View File
@@ -64,10 +64,19 @@ void dFile_info_c::screenSet() {
mNoDatBase = new CPaneMgrAlpha(mFileInfo.Scr, 'w_nda_i1', 2, NULL);
J2DTextBox* info_text[4];
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search('w_s_t_01');
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search('w_p_t_01');
mFileInfo.Scr->search('f_s_t_02')->hide();
mFileInfo.Scr->search('f_p_t_02')->hide();
#else
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search('f_s_t_02');
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search('f_p_t_02');
mFileInfo.Scr->search('w_s_t_01')->hide();
mFileInfo.Scr->search('w_p_t_01')->hide();
#endif
for (int i = 0; i < 2; i++) {
info_text[i]->setFont(mFileInfo.mFont);
@@ -76,10 +85,17 @@ void dFile_info_c::screenSet() {
dMeter2Info_getString(0x3D0, info_text[0]->getStringPtr(), NULL); // Save time
dMeter2Info_getString(0x3D1, info_text[1]->getStringPtr(), NULL); // Total play time
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search('w_name01');
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search('w_new_1');
mFileInfo.Scr->search('f_name01')->hide();
mFileInfo.Scr->search('f_new_1')->hide();
#else
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search('f_name01');
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search('f_new_1');
mFileInfo.Scr->search('w_name01')->hide();
mFileInfo.Scr->search('w_new_1')->hide();
#endif
info_text[2] = (J2DTextBox*)mFileInfo.Scr->search('w_time01');
info_text[3] = (J2DTextBox*)mFileInfo.Scr->search('w_ptim01');
@@ -177,8 +193,14 @@ static procFunc fileWarningProc[] = {&dFile_info_c::modeWait, &dFile_info_c::mod
void dFile_info_c::setSaveDate(dSv_save_c* i_savedata) {
OSCalendarTime time;
OSTicksToCalendarTime(i_savedata->getPlayer().getPlayerStatusB().getDateIpl(), &time);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday,
time.hour, time.min);
#else
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mon + 1, time.mday, time.year,
time.hour, time.min);
#endif
}
/* 80192C70-80192D58 18D5B0 00E8+00 1/1 0/0 0/0 .text setPlayTime__12dFile_info_cFP10dSv_save_c */
+50
View File
@@ -2356,10 +2356,22 @@ void dFile_select_c::screenSet() {
static u64 l_nouseTag[15] = {
'w_mcheck', 'w_tabi1', 'w_tabi2', 'w_tabi3', 'w_doko_c', 'w_uwa_c', 'w_cp_chu', 'w_cpsita',
'w_cp_x', 'w_de', 'w_de_chu', 'w_desita', 'w_de_x', 'w_name', 'w_h_name'};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName21[2] = {'w_tabi_s', 'w_tabi_x'};
#else
static u64 l_tagName21[2] = {'t_for', 't_for1'};
#endif
static u64 l_tagName18[3] = {'w_de_ef0', 'w_de_ef1', 'w_de_ef2'};
static u64 l_tagName19[3] = {'w_cp_ef0', 'w_cp_ef1', 'w_cp_ef2'};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName20[2] = {'w_er_msg', 'w_er_msR'};
#else
static u64 l_tagName20[2] = {'er_for0', 'er_for1'};
#endif
static u64 l_tagName131[3] = {'N_sel_00', 'N_sel_01', 'N_sel_02'};
fileSel.Scr = new J2DScreen();
@@ -2385,10 +2397,19 @@ void dFile_select_c::screenSet() {
fileSel.Scr->search('Wi_btn_n')->hide();
field_0x0238 = new CPaneMgrAlpha(fileSel.Scr, 'w_n_bbtn', 2, NULL);
field_0x023c = new CPaneMgrAlpha(fileSel.Scr, 'w_n_abtn', 2, NULL);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
field_0x0240 = new CPaneMgrAlpha(fileSel.Scr, 'w_modo', 2, NULL);
field_0x0244 = new CPaneMgrAlpha(fileSel.Scr, 'w_kete', 2, NULL);
fileSel.Scr->search('f_modo')->hide();
fileSel.Scr->search('f_kete')->hide();
#else
field_0x0240 = new CPaneMgrAlpha(fileSel.Scr, 'f_modo', 2, NULL);
field_0x0244 = new CPaneMgrAlpha(fileSel.Scr, 'f_kete', 2, NULL);
fileSel.Scr->search('w_modo')->hide();
fileSel.Scr->search('w_kete')->hide();
#endif
((J2DTextBox*)field_0x0240->getPanePtr())->setFont(fileSel.mpMessageFont[0]);
((J2DTextBox*)field_0x0244->getPanePtr())->setFont(fileSel.mpMessageFont[0]);
((J2DTextBox*)field_0x0240->getPanePtr())->setString(32, "");
@@ -2442,10 +2463,17 @@ void dFile_select_c::screenSet() {
for (int i = 0; i < 15; i++) {
fileSel.Scr->search(l_nouseTag[i])->hide();
}
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search('t_for')->hide();
fileSel.Scr->search('t_for1')->hide();
#else
fileSel.Scr->search('w_tabi_s')->hide();
fileSel.Scr->search('w_tabi_x')->hide();
fileSel.Scr->search('w_mgn1')->hide();
fileSel.Scr->search('w_mgn2')->hide();
#endif
for (int i = 0; i < 2; i++) {
field_0x020c[i] = new CPaneMgrAlpha(fileSel.Scr, l_tagName21[i], 0, NULL);
((J2DTextBox*)field_0x020c[i]->getPanePtr())->setFont(fileSel.mpMessageFont[0]);
@@ -2480,17 +2508,35 @@ void dFile_select_c::screenSet() {
field_0x0208 = 0;
field_0x0209 = 0;
field_0x012c = fileSel.Scr->search('w_er_n');
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search('er_for0')->hide();
fileSel.Scr->search('er_for1')->hide();
#else
fileSel.Scr->search('w_er_msg')->hide();
fileSel.Scr->search('w_er_msR')->hide();
#endif
fileSel.Scr->search('w_er_msE')->hide();
for (int i = 0; i < 2; i++) {
field_0x0138[i] = new CPaneMgrAlpha(fileSel.Scr, l_tagName20[i], 0, NULL);
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setFont(fileSel.mpMessageFont[0]);
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setString(512, "");
#if (VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN)
field_0x0138[i]->getPanePtr()->resize(440.0f, 198.0f);
#endif
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setCharSpace(2.0f);
#else
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setLineSpace(21.0f);
((J2DTextBox*)field_0x0138[i]->getPanePtr())->setCharSpace(1.0f);
#endif
field_0x0140[i] = ((J2DTextBox*)field_0x0138[i]->getPanePtr())->getStringPtr();
field_0x0138[i]->show();
}
@@ -3302,7 +3348,11 @@ void dFile_select_c::MemCardStatCheck() {
field_0x0280 = false;
field_0x0284 = NULL;
field_0x0273 = 2;
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
field_0x0290 = &dFile_select_c::noFileSpaceDispInit;
#else
field_0x0290 = &dFile_select_c::noSaveSelDispInit;
#endif
field_0x0274 = 18;
break;
case 2:
+2
View File
@@ -9,6 +9,7 @@
#include "m_Do/m_Do_lib.h"
#include "dol2asm.h"
#if VERSION == VERSION_GCN_USA
// This is a HACK to get d_insect data at correct address due to
// issues with the d_a_obj_item vtable. TODO: fix daItem_c vtable
#pragma push
@@ -24,6 +25,7 @@ SECTION_DATA extern void* __vt__8daItem_c__HACK[] = {
NULL,
};
#pragma pop
#endif
/* 8015E010-8015E078 158950 0068+00 0/0 0/0 13/13 .text __ct__9dInsect_cFv */
dInsect_c::dInsect_c() {
+8 -1
View File
@@ -297,8 +297,15 @@ void dMenu_Fishing_c::screenSetBase() {
}
mpFishInfoParent[0] = new CPaneMgr(mpScreen, 'info_blu', 0, NULL);
mpFishInfoParent[1] = new CPaneMgr(mpScreen, 'info_red', 0, NULL);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search('t_t00');
mpScreen->search('f_t00')->hide();
#else
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search('f_t00');
mpScreen->search('t_t00')->hide();
#endif
textBox->setFont(mDoExt_getSubFont());
textBox->setString(0x200, "");
mpString->getString(0x5a1, textBox, NULL, NULL, NULL, 0);
@@ -509,4 +516,4 @@ void dMenu_Fishing_c::setHIO(bool i_useHIO) {
g_drawHIO.mCollectScreen.mButtonBTextScale);
}
}
}
}