summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2026-07-26 19:02:31 +0200
committerGitHub <noreply@github.com>2026-07-26 19:02:31 +0200
commit021593e951c316bfeae3bf031a4b81ac48962dba (patch)
tree16d77b47614cfd797512966fd04d5ea9ef6028c3
parente6c69576b45e355c3218cd8c183bf14392c7b591 (diff)
parentae8cfeed65be77921ec6752f0d9e5546fb4bade6 (diff)
Merge pull request #327 from robojumper/msg_window_equivalent
d_lyt_msg_window equivalent
-rw-r--r--config/SOUE01/symbols.txt20
-rw-r--r--include/d/d_tag_processor.h4
-rw-r--r--include/d/lyt/d_lyt_boss_caption.h7
-rw-r--r--include/d/lyt/msg_window/d_lyt_msg_window.h13
-rw-r--r--src/d/d_message.cpp4
-rw-r--r--src/d/d_tag_processor.cpp8
-rw-r--r--src/d/lyt/msg_window/d_lyt_msg_window.cpp150
7 files changed, 165 insertions, 41 deletions
diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt
index 09c67879..fe721dc1 100644
--- a/config/SOUE01/symbols.txt
+++ b/config/SOUE01/symbols.txt
@@ -1251,9 +1251,9 @@ fn_80033240 = .text:0x80033240; // type:function size:0xD4
fn_80033320 = .text:0x80033320; // type:function size:0xD0
acNpc_vt_0xE8__8dAcNpc_cFv = .text:0x800333F0; // type:function size:0x290
fn_80033680 = .text:0x80033680; // type:function size:0x60
-fn_800336E0 = .text:0x800336E0; // type:function size:0x30
-fn_80033710 = .text:0x80033710; // type:function size:0xBC
-fn_800337D0 = .text:0x800337D0; // type:function size:0xB4
+loadMainPos__8dAcNpc_cFff = .text:0x800336E0; // type:function size:0x30
+loadMainAndHeadPos__8dAcNpc_cFffPQ23d3d13AnmMdlWrapper = .text:0x80033710; // type:function size:0xBC
+loadMainAndHeadPos__8dAcNpc_cFPC7mVec3_cPC7mVec3_cPQ23d3d13AnmMdlWrapper = .text:0x800337D0; // type:function size:0xB4
fn_80033890 = .text:0x80033890; // type:function size:0xAC
fn_80033940 = .text:0x80033940; // type:function size:0x14
__ct__8dAcNpc_cFv = .text:0x80033960; // type:function size:0x284
@@ -1269,7 +1269,7 @@ __dt__46sFStateMgr_c<8dAcNpc_c,20sStateMethodUsr_FI_c>Fv = .text:0x80033F60; //
__ct__8dAcNpc_cFP14dFlowMgrBase_c = .text:0x80034010; // type:function size:0x27C
ActorNpcBase__addToNpcList = .text:0x80034290; // type:function size:0x50
fn_800342E0 = .text:0x800342E0; // type:function size:0x34
-fn_80034320 = .text:0x80034320; // type:function size:0x88
+loadMainPos__8dAcNpc_cFPC7mVec3_c = .text:0x80034320; // type:function size:0x88
acNpc_vt_0xAC__8dAcNpc_cFv = .text:0x800343B0; // type:function size:0x4
acNpc_vt_0x130__8dAcNpc_cFv = .text:0x800343C0; // type:function size:0x4
acNpc_vt_0x134__8dAcNpc_cFv = .text:0x800343D0; // type:function size:0x4
@@ -3914,7 +3914,7 @@ setScale__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .
setFramesLeftOnPause__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B54F0; // type:function size:0xC
fn_800B5500__15dTagProcessor_cFUcPw = .text:0x800B5500; // type:function size:0x18
fn_800B5520__15dTagProcessor_cFPw = .text:0x800B5520; // type:function size:0x14
-fn_800B5540__15dTagProcessor_cFPw = .text:0x800B5540; // type:function size:0x28
+enableChangeBtn__15dTagProcessor_cFPw = .text:0x800B5540; // type:function size:0x28
writeHeroname__15dTagProcessor_cFPwPlb = .text:0x800B5570; // type:function size:0x110
writeItem__15dTagProcessor_cFPwPwPlb = .text:0x800B5680; // type:function size:0x1DC
writeStringArg__15dTagProcessor_cFPwPwPlb = .text:0x800B5860; // type:function size:0x1C0
@@ -6826,9 +6826,9 @@ setCurrentLabelName__15dLytMsgWindow_cFPCcb = .text:0x80117090; // type:function
isVisible__15dLytMsgWindow_cCFv = .text:0x80117240; // type:function size:0x4C
setTextToDisplay__15dLytMsgWindow_cFPCw = .text:0x80117290; // type:function size:0x24
isOutputtingText__15dLytMsgWindow_cCFv = .text:0x801172C0; // type:function size:0x50
-fn_80117310 = .text:0x80117310; // type:function size:0x4C
-fn_80117360 = .text:0x80117360; // type:function size:0x14
-fn_80117380 = .text:0x80117380; // type:function size:0xC
+fn_80117310__15dLytMsgWindow_cCFv = .text:0x80117310; // type:function size:0x4C
+fn_80117360__15dLytMsgWindow_cFv = .text:0x80117360; // type:function size:0x14
+fn_80117380__15dLytMsgWindow_cFv = .text:0x80117380; // type:function size:0xC
fn_80117390__15dLytMsgWindow_cCFb = .text:0x80117390; // type:function size:0x54
setCurrentEntrypointName__15dLytMsgWindow_cFPCc = .text:0x801173F0; // type:function size:0xB4
setCurrentFlowFilename__15dLytMsgWindow_cFPCc = .text:0x801174B0; // type:function size:0xB4
@@ -6884,7 +6884,7 @@ __dt__18dLytMsgWindowGet_cFv = .text:0x8011A090; // type:function size:0x198
__dt__19dLytMsgWindowDemo_cFv = .text:0x8011A230; // type:function size:0x158
__dt__17dLytAutoExplain_cFv = .text:0x8011A390; // type:function size:0x118
__dt__17dLytAutoCaption_cFv = .text:0x8011A4B0; // type:function size:0x118
-fn_8011A5D0__15dLytMsgWindow_cCFv = .text:0x8011A5D0; // type:function size:0x1AC
+fn_8011A5D0__15dLytMsgWindow_cFv = .text:0x8011A5D0; // type:function size:0x1AC
changeState__86sStateMgr_c<17dLytAutoCaption_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x8011A780; // type:function size:0x10
changeState__86sStateMgr_c<17dLytAutoExplain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x8011A790; // type:function size:0x10
changeState__88sStateMgr_c<19dLytMsgWindowDemo_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x8011A7A0; // type:function size:0x10
@@ -42358,7 +42358,7 @@ sDoButtonRelatedClass = .sbss:0x80575470; // type:object size:0x8 scope:local
sInstance__18LytDoButtonRelated = .sbss:0x80575478; // type:object size:0x4 data:4byte
sInstance__16dLytTargetBird_c = .sbss:0x80575480; // type:object size:0x8 data:4byte
sInstance__15dLytMsgWindow_c = .sbss:0x80575488; // type:object size:0x4 data:4byte
-lbl_8057548C = .sbss:0x8057548C; // type:object size:0x4 data:4byte
+sFlowMgr__15dLytMsgWindow_c = .sbss:0x8057548C; // type:object size:0x4 data:4byte
CURRENT_ACTOR_EVENT_FLOW_MANAGER = .sbss:0x80575490; // type:object size:0x8 data:4byte
sInstance__18dLytSimpleWindow_c = .sbss:0x80575498; // type:object size:0x4 data:4byte
sInstance__15dLytMapGlobal_c = .sbss:0x805754A0; // type:object size:0x4 data:4byte
diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h
index c643e3f3..970382db 100644
--- a/include/d/d_tag_processor.h
+++ b/include/d/d_tag_processor.h
@@ -47,7 +47,7 @@ public:
void fn_800B61D0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
void setFramesLeftOnPause(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
void fn_800B5500(u8 cmdLen, wchar_t *ptr);
- void fn_800B5540(wchar_t *ptr);
+ void enableChangeBtn(wchar_t *ptr);
void fn_800B60E0(u8 cmdLen, wchar_t *ptr);
void fn_800B6110(u8 cmdLen, wchar_t *ptr);
void fn_800B6140(u8 cmdLen, wchar_t *ptr);
@@ -217,6 +217,8 @@ private:
TAG_CMD_OPTION_2 = 0x10002,
TAG_CMD_OPTION_3 = 0x10003,
+ TAG_CMD_CHANGE_BTN = 0x10011,
+
TAG_CMD_WRITE_HERONAME = 0x20000,
TAG_CMD_WRITE_ITEM = 0x20001,
TAG_CMD_WRITE_STRING_ARG = 0x20002,
diff --git a/include/d/lyt/d_lyt_boss_caption.h b/include/d/lyt/d_lyt_boss_caption.h
index 65436c12..5da6ca56 100644
--- a/include/d/lyt/d_lyt_boss_caption.h
+++ b/include/d/lyt/d_lyt_boss_caption.h
@@ -17,12 +17,19 @@ public:
field_0x646 = 0;
}
+ static void unk_inline2() {
+ if (sInstance != nullptr) {
+ sInstance->field_0x647 = 1;
+ }
+ }
+
private:
static dLytBossCaption_c *sInstance;
u8 _0x00[0x645 - 0x00];
u8 field_0x645;
u8 field_0x646;
+ u8 field_0x647;
};
#endif
diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h
index e0e0e2e1..d3cb9ae3 100644
--- a/include/d/lyt/msg_window/d_lyt_msg_window.h
+++ b/include/d/lyt/msg_window/d_lyt_msg_window.h
@@ -10,6 +10,7 @@
#include "m/m_vec.h"
#include "s/s_State.hpp"
#include "sized_string.h"
+#include "toBeSorted/d_flow_mgr.h"
// Forward declarations required for vtable order
class dLytMsgWindowTalk_c;
@@ -84,6 +85,9 @@ public:
return mNameCopy;
}
+ bool fn_80117310() const;
+ void fn_80117360();
+ void fn_80117380();
const char *fn_80117390(bool) const;
// This function appears to be related to a compiler quirk.
@@ -118,17 +122,18 @@ public:
return mTextOptionSelection;
}
- void onFlag0x820(u16 flag) {
- field_0x820 |= flag;
+ void enableChangeBtn(u16 flag) {
+ mValidChangeBtnMask |= flag;
}
private:
bool setTextToDisplay(const wchar_t *text);
void createSubMsgManager(u8 type);
void removeSubMsgManagers();
- bool fn_8011A5D0() const;
+ bool checkChangeBtnTrig();
static dLytMsgWindow_c *sInstance;
+ static dFlowMgrBase_c *sFlowMgr;
STATE_FUNC_DECLARE(dLytMsgWindow_c, Invisible);
STATE_FUNC_DECLARE(dLytMsgWindow_c, In);
@@ -203,7 +208,7 @@ private:
/* 0x81D */ u8 field_0x81D;
/* 0x81E */ u8 field_0x81E;
- /* 0x820 */ u16 field_0x820;
+ /* 0x820 */ u16 mValidChangeBtnMask;
/* 0x824 */ s32 mNumOptions;
/* 0x828 */ dLytMsgWindowCharData *field_0x828;
diff --git a/src/d/d_message.cpp b/src/d/d_message.cpp
index d4b97316..5d7b1d35 100644
--- a/src/d/d_message.cpp
+++ b/src/d/d_message.cpp
@@ -47,8 +47,8 @@
#include "rvl/OS.h"
#include <cstring>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <cstdio>
s32 dFlow_c::sExitId = -1;
diff --git a/src/d/d_tag_processor.cpp b/src/d/d_tag_processor.cpp
index 675c0e8b..5a6c0e94 100644
--- a/src/d/d_tag_processor.cpp
+++ b/src/d/d_tag_processor.cpp
@@ -927,10 +927,10 @@ nw4r::ut::Operation dTagProcessor_c::ProcessTags(nw4r::ut::Rect *rect, u16 ch, n
}
}
break;
- case 0x10011:
+ case TAG_CMD_CHANGE_BTN:
if (rect == nullptr && !mIsShadowText) {
if (field_0xEEF == 0 && mNumericArgsCopy[10] == field_0x840) {
- fn_800B5540(endPtr);
+ enableChangeBtn(endPtr);
field_0xEEF = 1;
field_0x840++;
}
@@ -1104,8 +1104,8 @@ void dTagProcessor_c::fn_800B5520(wchar_t *src) {
field_0x820 = READ_U32(src, 4);
}
-void dTagProcessor_c::fn_800B5540(wchar_t *src) {
- dLytMsgWindow_c::getInstance()->onFlag0x820(sMsgWindowFlags[READ_U8(src, 0)]);
+void dTagProcessor_c::enableChangeBtn(wchar_t *src) {
+ dLytMsgWindow_c::getInstance()->enableChangeBtn(sMsgWindowFlags[READ_U8(src, 0)]);
}
wchar_t *dTagProcessor_c::writeHeroname(wchar_t *dest, s32 *outArg, bool isProcessingOption) {
diff --git a/src/d/lyt/msg_window/d_lyt_msg_window.cpp b/src/d/lyt/msg_window/d_lyt_msg_window.cpp
index 8e65ddcc..193779b6 100644
--- a/src/d/lyt/msg_window/d_lyt_msg_window.cpp
+++ b/src/d/lyt/msg_window/d_lyt_msg_window.cpp
@@ -1,6 +1,7 @@
#include "d/lyt/msg_window/d_lyt_msg_window.h"
#include "common.h"
+#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_lyt_hio.h"
#include "d/d_message.h"
@@ -8,11 +9,11 @@
#include "d/d_stage_mgr.h"
#include "d/d_tag_processor.h"
#include "d/d_textwindow_unk.h"
+#include "d/lyt/d_lyt_boss_caption.h"
#include "d/lyt/d_lyt_control_game.h"
#include "d/lyt/d_lyt_map.h"
#include "d/lyt/d_textbox.h"
-
// clang-format off
// vtable order
#include "d/lyt/meter/d_lyt_meter.h"
@@ -33,7 +34,6 @@
#include "d/snd/d_snd_player_mgr.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "f/f_base.h"
-#include "m/m_fader_base.h"
#include "m/m_vec.h"
#include "s/s_State.hpp"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
@@ -41,7 +41,7 @@
#include "toBeSorted/event_manager.h"
#include "toBeSorted/fi_context.h"
-#include <cstring>
+#include <cstdlib>
class dLytMsgWindow_HIO_c {
public:
@@ -143,7 +143,7 @@ bool dLytMsgWindow_c::build() {
field_0x81D = 0;
mNumOptions = 0;
- field_0x820 = 0;
+ mValidChangeBtnMask = 0;
field_0x81E = 0;
@@ -289,7 +289,7 @@ void dLytMsgWindow_c::finalizeState_In() {}
void dLytMsgWindow_c::initializeState_OutputText() {
field_0x81C = 0;
field_0x81D = 0;
- field_0x820 = 0;
+ mValidChangeBtnMask = 0;
field_0x81E = 0;
}
void dLytMsgWindow_c::executeState_OutputText() {
@@ -362,7 +362,7 @@ void dLytMsgWindow_c::executeState_WaitKeyChangePage0() {
field_0x813 = 0;
allowChange = true;
}
- } else if (dPad::getDownTrigA() || fn_8011A5D0()) {
+ } else if (dPad::getDownTrigA() || checkChangeBtnTrig()) {
dSndPlayerMgr_c::GetInstance()->leaveMsgWait();
allowChange = true;
}
@@ -422,7 +422,7 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() {
field_0x813 = 0;
allowChange = true;
}
- } else if (dPad::getDownTrigA() || fn_8011A5D0()) {
+ } else if (dPad::getDownTrigA() || checkChangeBtnTrig()) {
dSndPlayerMgr_c::GetInstance()->leaveMsgWait();
allowChange = true;
}
@@ -491,6 +491,8 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd2() {
void dLytMsgWindow_c::finalizeState_WaitKeyMsgEnd2() {}
static wchar_t *sBufs[4];
+// Not sure about this one
+wchar_t *sEmptyBuf[0x400];
void dLytMsgWindow_c::initializeState_WaitKeySelectQuestion() {
// TODO regswaps
@@ -671,12 +673,7 @@ bool dLytMsgWindow_c::execute() {
u8 old_field_0x816 = field_0x816;
if (*mStateMgr.getStateID() == StateID_DemoIn || *mStateMgr.getStateID() == StateID_DemoVisible ||
*mStateMgr.getStateID() == StateID_DemoOut) {
- dStageMgr_c *mgr = dStageMgr_c::GetInstance();
- // Bleh
- bool b =
- !(mgr->getFader()->isNotStatus(static_cast<mFaderBase_c::EStatus>(-1)) ||
- mgr->getFader()->isNotStatus(mFaderBase_c::FADED_OUT));
- if (!b) {
+ if (!dStageMgr_c::GetInstance()->isFaderSettled()) {
field_0x819 = 1;
field_0x81B = 1;
}
@@ -688,11 +685,14 @@ bool dLytMsgWindow_c::execute() {
mStateMgr.changeState(StateID_Invisible);
}
mpMsgWindowUnk->reset();
- mSelectBtn.remove();
+ mSelectBtn.execute();
field_0x81B = 0;
- // TODO boss caption
+ dLytBossCaption_c::unk_inline2();
+ }
+
+ if (dMessage_c::getInstance()->getInMapEvent() && sFlowMgr != nullptr) {
+ sFlowMgr->checkFinished();
}
- // TODO ActorEventFlowManagerRelated::checkEventFinished
mStateMgr.executeState();
@@ -722,7 +722,7 @@ bool dLytMsgWindow_c::execute() {
bool dLytMsgWindow_c::draw() {
if (isVisible() || field_0x1220 != 0) {
if (mpCurrentSubtype != nullptr) {
- // TODO tag processor
+ mpTagProcessor->resetSomeThings();
mpCurrentSubtype->addToDrawList();
}
mSelectBtn.draw();
@@ -732,9 +732,48 @@ bool dLytMsgWindow_c::draw() {
}
bool dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) {
- // TODO
- mName = name;
- return !std::strcmp(name, "FR_SIREN_04");
+ if (!isVisible()) {
+ if (storeFile) {
+ s32 idx = dMessage_c::getMsbtIndexForLabel(name);
+ if (idx < 0) {
+ return false;
+ }
+ dMessage_c::getInstance()->setCurrentTextFileNumber(idx);
+ }
+ field_0x80C = 1;
+ field_0x810 = 0;
+ field_0x815 = 0;
+ field_0x813 = 0;
+ if (!std::strcmp(name, "FR_SIREN_04")) {
+ dLytMeter_c::GetInstance()->setMeterField_0x13773(1);
+ }
+
+ s32 idx = -1;
+ if (field_0x80E) {
+ int i = 0;
+ const char *p;
+ bool found = false;
+ for (p = name; *p != '\0'; p++) {
+ if (found) {
+ if (idx == -1) {
+ idx = atoi(name + i);
+ }
+ } else if (*p == ':') {
+ found = true;
+ }
+ i++;
+ }
+ }
+ mName = name;
+ mMsgIdx = idx;
+ if (field_0x1220 == 0) {
+ dAcBase_c *ac = EventManager::fn_800A08F0(fBase_c::ACTOR);
+ dSndPlayerMgr_c::GetInstance()->setMsgActor(mMsgIdx, ac);
+ }
+ return true;
+ } else {
+ return false;
+ }
}
bool dLytMsgWindow_c::isVisible() const {
@@ -752,6 +791,29 @@ bool dLytMsgWindow_c::isOutputtingText() const {
return *mStateMgr.getStateID() == StateID_OutputText;
}
+bool dLytMsgWindow_c::fn_80117310() const {
+ if (isOutputtingText() && field_0x81E) {
+ return true;
+ }
+ return false;
+}
+
+void dLytMsgWindow_c::fn_80117360() {
+ field_0x815 = true;
+ field_0x816 = false;
+}
+
+void dLytMsgWindow_c::fn_80117380() {
+ field_0x815 = false;
+}
+
+const char *dLytMsgWindow_c::fn_80117390(bool b) const {
+ if (isOutputtingText() || b) {
+ return mCurrentEntrypointName;
+ }
+ return nullptr;
+}
+
void dLytMsgWindow_c::setCurrentEntrypointName(const char *name) {
mCurrentEntrypointName = name;
}
@@ -760,6 +822,14 @@ void dLytMsgWindow_c::setCurrentFlowFilename(const char *name) {
mCurrentFlowFileName = name;
}
+void dLytMsgWindow_c::setNumericArg0(s32 arg) {
+ mpTagProcessor->setNumericArg0(arg);
+}
+
+void dLytMsgWindow_c::setNumericArgs(s32 *args, s32 count) {
+ mpTagProcessor->setNumericArgs(args, count);
+}
+
void dLytMsgWindow_c::createSubMsgManager(u8 type) {
switch (type) {
case MSG_WINDOW_WOOD:
@@ -866,3 +936,43 @@ void dLytMsgWindow_c::removeSubMsgManagers() {
dLyt_HIO_c::getInstance()->setStr1("");
dLyt_HIO_c::getInstance()->setStr3("");
}
+
+bool dLytMsgWindow_c::checkChangeBtnTrig() {
+ if ((mValidChangeBtnMask & 0x1) && dPad::getDownTrigA()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x2) && dPad::getDownTrigB()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x4) && dPad::getDownTrigMinus()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x8) && dPad::getDownTrigPlus()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x10) && dPad::getDownTrig1()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x20) && dPad::getDownTrig2()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x40) && dPad::getDownTrigC()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x80) && dPad::getDownTrigZ()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x100) && dPad::getDownTrigUp()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x200) && dPad::getDownTrigDown()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x400) && dPad::getDownTrigLeft()) {
+ return true;
+ }
+ if ((mValidChangeBtnMask & 0x800) && dPad::getDownTrigRight()) {
+ return true;
+ }
+ return false;
+}