This commit is contained in:
robojumper
2025-04-04 16:34:21 +02:00
parent 01d1c8c66a
commit 4612c35f45
18 changed files with 539 additions and 72 deletions
+1
View File
@@ -443,6 +443,7 @@ d/lyt/msg_window/d_lyt_msg_window.cpp:
.text start:0x801148F0 end:0x8011C8C8
.ctors start:0x804DB738 end:0x804DB73C
.data start:0x8051B6E8 end:0x8051C300
.bss start:0x805AD188 end:0x805AE670
d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp:
.text start:0x8011C8D0 end:0x80120A18
+24 -24
View File
@@ -3887,13 +3887,13 @@ fn_800B2040__12UnkTextThingFv = .text:0x800B2040; // type:function size:0x8
destroyMsg__12UnkTextThingFP8MsbtInfo = .text:0x800B2050; // type:function size:0x40
destroyFlow__12UnkTextThingFP8MsbfInfo = .text:0x800B2090; // type:function size:0x40
__sinit_\d_textunk_cpp = .text:0x800B20D0; // type:function size:0xC scope:local
LytMsgWindowUnk__ctor = .text:0x800B20E0; // type:function size:0x48
__ct__13TextWindowUnkFP15dTagProcessor_c = .text:0x800B20E0; // type:function size:0x48
fn_800B2130__13TextWindowUnkFPCcP10dTextBox_cPvb = .text:0x800B2130; // type:function size:0x370
textAdvancingRelated__13TextWindowUnkFbb = .text:0x800B24A0; // type:function size:0x5FC
fn_800B2AA0__13TextWindowUnkFv = .text:0x800B2AA0; // type:function size:0x80
somethingWithTextboxEndState = .text:0x800B2B20; // type:function size:0x48
LytMsgWindowUnk__checkTextEndReached = .text:0x800B2B70; // type:function size:0x1C
LytMsgWindowUnk__initSomethingMaybe = .text:0x800B2B90; // type:function size:0xD8
checkEndReached__13TextWindowUnkCFv = .text:0x800B2B70; // type:function size:0x1C
checkLastLineReachedMaybe__13TextWindowUnkCFv = .text:0x800B2B90; // type:function size:0xD8
fn_800B2C70 = .text:0x800B2C70; // type:function size:0x340
fn_800B2FB0 = .text:0x800B2FB0; // type:function size:0x324
fn_800B32E0 = .text:0x800B32E0; // type:function size:0x84
@@ -3961,7 +3961,7 @@ setNumericArg0__15dTagProcessor_cFl = .text:0x800B8A50; // type:function size:0x
setNumericArgs__15dTagProcessor_cFPCll = .text:0x800B8A60; // type:function size:0xDC
fn_800B8B40 = .text:0x800B8B40; // type:function size:0x4C
fn_800B8B90 = .text:0x800B8B90; // type:function size:0x4C
fn_800B8BE0 = .text:0x800B8BE0; // type:function size:0x34
execute__15dTagProcessor_cFv = .text:0x800B8BE0; // type:function size:0x34
__sinit_\d_tag_processor_cpp = .text:0x800B8C20; // type:function size:0x654 scope:local
__ct__14dTimeAreaMgr_cFv = .text:0x800B9280; // type:function size:0xF0
__dt__19dTimeAreaMgrProcA_cFv = .text:0x800B9370; // type:function size:0x58
@@ -6741,8 +6741,8 @@ draw__20LytBirdButtonRelatedFv = .text:0x80114280; // type:function size:0x44
fn_801142D0 = .text:0x801142D0; // type:function size:0x168
fn_80114440 = .text:0x80114440; // type:function size:0x248
fn_80114690 = .text:0x80114690; // type:function size:0x25C
fn_801148F0 = .text:0x801148F0; // type:function size:0x24
fn_80114920 = .text:0x80114920; // type:function size:0x40
__ct__22MsgWindowUnkLocalClassFv = .text:0x801148F0; // type:function size:0x24
__dt__22MsgWindowUnkLocalClassFv = .text:0x80114920; // type:function size:0x40
build__15dLytMsgWindow_cFv = .text:0x80114960; // type:function size:0x228
changeState__84sStateMgr_c<15dLytMsgWindow_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x80114B90; // type:function size:0x10
remove__15dLytMsgWindow_cFv = .text:0x80114BA0; // type:function size:0xB8
@@ -6785,7 +6785,7 @@ vt_0x3C__20dLytMsgWindowSubtypeCFv = .text:0x801163F0; // type:function size:0x8
finalizeState_WaitKeyMsgEnd2__15dLytMsgWindow_cFv = .text:0x80116400; // type:function size:0x4
initializeState_WaitKeySelectQuestion__15dLytMsgWindow_cFv = .text:0x80116410; // type:function size:0xD0
executeState_WaitKeySelectQuestion__15dLytMsgWindow_cFv = .text:0x801164E0; // type:function size:0x15C
fn_80116640 = .text:0x80116640; // type:function size:0x10
getStateID__93sStateMgr_c<24dLytMsgWindowSelectBtn_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80116640; // type:function size:0x10
finalizeState_WaitKeySelectQuestion__15dLytMsgWindow_cFv = .text:0x80116650; // type:function size:0x4
initializeState_MapOpen__15dLytMsgWindow_cFv = .text:0x80116660; // type:function size:0x4
executeState_MapOpen__15dLytMsgWindow_cFv = .text:0x80116670; // type:function size:0x7C
@@ -6817,20 +6817,20 @@ finalizeState_DemoVisible__15dLytMsgWindow_cFv = .text:0x80116C20; // type:funct
initializeState_DemoOut__15dLytMsgWindow_cFv = .text:0x80116C30; // type:function size:0x14
executeState_DemoOut__15dLytMsgWindow_cFv = .text:0x80116C50; // type:function size:0xC4
finalizeState_DemoOut__15dLytMsgWindow_cFv = .text:0x80116D20; // type:function size:0x4
LytMsgWindow__update = .text:0x80116D30; // type:function size:0x278
fn_80116FB0 = .text:0x80116FB0; // type:function size:0x10
fn_80116FC0 = .text:0x80116FC0; // type:function size:0x10
fn_80116FD0 = .text:0x80116FD0; // type:function size:0xC0
fn_80117090 = .text:0x80117090; // type:function size:0x1AC
LytMsgWindow__isNotStateInvisible = .text:0x80117240; // type:function size:0x4C
execute__15dLytMsgWindow_cFv = .text:0x80116D30; // type:function size:0x278
getStateID__84sStateMgr_c<15dLytMsgWindow_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80116FB0; // type:function size:0x10
executeState__84sStateMgr_c<15dLytMsgWindow_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80116FC0; // type:function size:0x10
draw__15dLytMsgWindow_cFv = .text:0x80116FD0; // type:function size:0xC0
setCurrentLabelName__15dLytMsgWindow_cFPCcb = .text:0x80117090; // type:function size:0x1AC
isVisible__15dLytMsgWindow_cCFv = .text:0x80117240; // type:function size:0x4C
setTextToDisplay__15dLytMsgWindow_cFPCw = .text:0x80117290; // type:function size:0x24
fn_801172C0 = .text:0x801172C0; // type:function size:0x50
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_80117390 = .text:0x80117390; // type:function size:0x54
LytMsgWindow__setCurrentEntrypointName = .text:0x801173F0; // type:function size:0xB4
LytMsgWindow__setCurrentEventFlowFilename = .text:0x801174B0; // type:function size:0xB4
setCurrentEntrypointName__15dLytMsgWindow_cFPCc = .text:0x801173F0; // type:function size:0xB4
setCurrentFlowFilename__15dLytMsgWindow_cFPCc = .text:0x801174B0; // type:function size:0xB4
LytMsgWindow__setNumericArg0 = .text:0x80117570; // type:function size:0x8
LytMsgWindow__setNumericArgs = .text:0x80117580; // type:function size:0x8
createSubMsgManager__15dLytMsgWindow_cFUc = .text:0x80117590; // type:function size:0x260
@@ -7831,7 +7831,7 @@ fn_80138E30 = .text:0x80138E30; // type:function size:0xD4
fn_80138F10 = .text:0x80138F10; // type:function size:0xA0
fn_80138FB0 = .text:0x80138FB0; // type:function size:0xA4
fn_80139060 = .text:0x80139060; // type:function size:0x28
fn_80139090 = .text:0x80139090; // type:function size:0x478
isOpenMaybe__13dLytMapMain_cCFv = .text:0x80139090; // type:function size:0x478
fn_80139510 = .text:0x80139510; // type:function size:0xA8
fn_801395C0 = .text:0x801395C0; // type:function size:0x64
fn_80139630 = .text:0x80139630; // type:function size:0x4C
@@ -16794,7 +16794,7 @@ LytControlGame__stateMapSetResLeave = .text:0x802CCC70; // type:function size:0x
LytControlGame__stateMapSyncResEnter = .text:0x802CCC80; // type:function size:0x4
LytControlGame__stateMapSetResUpdate2 = .text:0x802CCC90; // type:function size:0x9C
LytControlGame__stateMapSyncResLeave = .text:0x802CCD30; // type:function size:0x4
fn_802CCD40 = .text:0x802CCD40; // type:function size:0x10
fn_802CCD40__17dLytControlGame_cFb = .text:0x802CCD40; // type:function size:0x10
LytControlGame__stateMapEnter = .text:0x802CCD50; // type:function size:0x110
LytControlGame__stateMapUpdate = .text:0x802CCE60; // type:function size:0x138
LytControlGame__stateMapLeave = .text:0x802CCFA0; // type:function size:0x4
@@ -16834,8 +16834,8 @@ fn_802CFA90 = .text:0x802CFA90; // type:function size:0x2E0
fn_802CFD70 = .text:0x802CFD70; // type:function size:0x20
updateHelpText = .text:0x802CFD90; // type:function size:0x1C
fn_802CFDB0 = .text:0x802CFDB0; // type:function size:0x74
fn_802CFE30 = .text:0x802CFE30; // type:function size:0xD8
LytControlGame__isNotInStateMap = .text:0x802CFF10; // type:function size:0x4C
isInSomeMapState__17dLytControlGame_cCFv = .text:0x802CFE30; // type:function size:0xD8
isNotInStateMap__17dLytControlGame_cCFv = .text:0x802CFF10; // type:function size:0x4C
fn_802CFF60 = .text:0x802CFF60; // type:function size:0x90
fn_802CFFF0 = .text:0x802CFFF0; // type:function size:0x1C
somehowRelatedToEnteringLightPillars = .text:0x802D0010; // type:function size:0x254
@@ -20872,7 +20872,7 @@ fn_8037EE40 = .text:0x8037EE40; // type:function size:0x3C
fn_8037EE80 = .text:0x8037EE80; // type:function size:0x64
playSound = .text:0x8037EEF0; // type:function size:0xAC
fn_8037EFA0 = .text:0x8037EFA0; // type:function size:0x80
playButtonPressSoundWhenAdvancingTextBoxes = .text:0x8037F020; // type:function size:0xB4
playButtonPressSoundWhenAdvancingTextBoxes__17SmallSoundManagerFf = .text:0x8037F020; // type:function size:0xB4
fn_8037F0E0 = .text:0x8037F0E0; // type:function size:0xC
fn_8037F0F0 = .text:0x8037F0F0; // type:function size:0x60
fn_8037F150 = .text:0x8037F150; // type:function size:0x6D0
@@ -32057,7 +32057,7 @@ lbl_8051B6E8 = .data:0x8051B6E8; // type:object size:0xC
lbl_8051B6F4 = .data:0x8051B6F4; // type:object size:0xC
lbl_8051B700 = .data:0x8051B700; // type:object size:0xC data:string
jumptable_8051B70C = .data:0x8051B70C; // type:object size:0x7C scope:local
lbl_8051B788 = .data:0x8051B788; // type:object size:0x10
__vt__22MsgWindowUnkLocalClass = .data:0x8051B788; // type:object size:0x10
__vt__56sFStateMgr_c<17dLytAutoCaption_c,20sStateMethodUsr_FI_c> = .data:0x8051B798; // type:object size:0x30
__vt__86sStateMgr_c<17dLytAutoCaption_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8051B7C8; // type:object size:0x30
__vt__33sFStateFct_c<17dLytAutoCaption_c> = .data:0x8051B7F8; // type:object size:0x18
@@ -40111,7 +40111,7 @@ LYT_SIMPLE_WINDOW = .sbss:0x80575498; // type:object size:0x8 data:4byte
lbl_805754A0 = .sbss:0x805754A0; // type:object size:0x8 data:4byte
sMapFaderColor = .sbss:0x805754A8; // type:object size:0x4 data:byte
lbl_805754AC = .sbss:0x805754AC; // type:object size:0x1 data:byte
lbl_805754B0 = .sbss:0x805754B0; // type:object size:0x8 data:4byte
sInstance__9dLytMap_c = .sbss:0x805754B0; // type:object size:0x8 data:4byte
sInstance__13dLytBattery_c = .sbss:0x805754B8; // type:object size:0x8 data:4byte
sInstance__17dLytAreaCaption_c = .sbss:0x805754C0; // type:object size:0x8 data:4byte
LytWipe = .sbss:0x805754C8; // type:object size:0x8 data:4byte
@@ -40423,7 +40423,7 @@ lbl_805759F0 = .sbss:0x805759F0; // type:object size:0x1 data:byte
lbl_805759F1 = .sbss:0x805759F1; // type:object size:0x1 data:byte
lbl_805759F4 = .sbss:0x805759F4; // type:object size:0x4 data:float
lbl_805759F8 = .sbss:0x805759F8; // type:object size:0x8 data:byte
LYT_CONTROL_GAME = .sbss:0x80575A00; // type:object size:0x8 data:4byte
sInstance__17dLytControlGame_c = .sbss:0x80575A00; // type:object size:0x8 data:4byte
MENU_PAUSE = .sbss:0x80575A08; // type:object size:0x8 data:4byte
lbl_80575A10 = .sbss:0x80575A10; // type:object size:0x8 data:byte
lbl_80575A18 = .sbss:0x80575A18; // type:object size:0x1 data:byte
+4
View File
@@ -36,6 +36,10 @@ public:
return field_0x329;
}
void setField_0x329(bool v) {
field_0x329 = v;
}
bool getField_0x32A() const {
return field_0x32A;
}
+4
View File
@@ -114,6 +114,10 @@ public:
void addObjId(u16 id);
void addActorId(u16 actorId);
dFader_c *getFader() {
return &mFader;
}
private:
static void lastExecuteCallback();
+26
View File
@@ -69,6 +69,7 @@ public:
f32 getFloat(s32 i);
s32 tickPauseFrame();
s32 tick0x830();
void execute();
void setTextbox(dTextBox_c *box) {
field_0x004 = box;
@@ -90,6 +91,14 @@ public:
return field_0x90E;
}
s32 getField_0x828() const {
return field_0x828;
}
s32 getField_0x82C() const {
return field_0x82C;
}
s32 getField_0x830() const {
return field_0x830;
}
@@ -98,10 +107,23 @@ public:
field_0x90C = type;
}
void setField_0x828(s32 val) {
field_0x828 = val;
}
void setField_0x82C(s32 val) {
field_0x82C = val;
}
void setField_0x90D(u8 val) {
field_0x90D = val;
}
void setField_0x90E(u8 val) {
field_0x90E = val;
}
void setField_0xEE1(u8 val) {
field_0xEE1 = val;
}
@@ -114,6 +136,10 @@ public:
field_0xEE3 = val;
}
wchar_t *getBuf(s32 idx) {
return field_0x008[idx];
}
private:
/* 0x004 */ dTextBox_c *field_0x004;
/* 0x008 */ wchar_t field_0x008[4][256];
+16 -2
View File
@@ -17,13 +17,27 @@ public:
const wchar_t *getProcessedText() const {
return mProcessedTextBuffer;
}
u16 getField_0x147A() const {
return field_0x147A;
}
u16 getField_0x147C() const {
return field_0x147C;
}
bool checkEndReached() const;
bool checkLastLineReachedMaybe() const;
private:
/* 0x0004 */ dTagProcessor_c *mpTagProcessor;
/* 0x0008 */ wchar_t mRawTextBuffer[1023];
/* 0x0806 */ wchar_t mProcessedTextBuffer[1023];
/* 0x1004 */ wchar_t mUnkBuffer[679]; // ???
/* 0x1550 */ void* field_0x1559;
/* 0x1004 */ wchar_t mUnkBuffer[571]; // ???
/* 0x147A */ u16 field_0x147A;
/* 0x147C */ u16 field_0x147C;
/* 0x147E */ u8 _0x147E[0x1550 - 0x147E];
/* 0x1550 */ void* field_0x1550;
};
#endif
+2 -2
View File
@@ -31,9 +31,9 @@ public:
STATE_FUNC_DECLARE(dLytAutoCaption_c, OutputText);
STATE_FUNC_DECLARE(dLytAutoCaption_c, Out);
private:
static bool checkSomethingMeter();
bool checkSomethingMeter();
private:
/* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c);
/* 0x068 */ d2d::ResAccIf_c mResAcc;
/* 0x3C4 */ d2d::LytBase_c mLyt;
+2 -2
View File
@@ -31,9 +31,9 @@ public:
STATE_FUNC_DECLARE(dLytAutoExplain_c, OutputText);
STATE_FUNC_DECLARE(dLytAutoExplain_c, Out);
private:
static bool checkSomethingMeter();
bool checkSomethingMeter();
private:
/* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c);
/* 0x068 */ d2d::ResAccIf_c mResAcc;
/* 0x3C4 */ d2d::LytBase_c mLyt;
+25
View File
@@ -0,0 +1,25 @@
#ifndef D_LYT_CONTROL_GAME_H
#define D_LYT_CONTROL_GAME_H
#include "d/d_base.h"
class dLytControlGame_c : public dBase_c {
public:
dLytControlGame_c();
virtual ~dLytControlGame_c();
bool isInSomeMapState() const;
bool isNotInStateMap() const;
void fn_802CCD40(bool);
static dLytControlGame_c *getInstance() {
return sInstance;
}
private:
static dLytControlGame_c *sInstance;
};
#endif
+10
View File
@@ -263,6 +263,8 @@ public:
void build();
bool isOpenMaybe() const;
STATE_FUNC_DECLARE(dLytMapMain_c, Invisible);
STATE_FUNC_DECLARE(dLytMapMain_c, RenderingWait);
STATE_FUNC_DECLARE(dLytMapMain_c, In);
@@ -369,6 +371,14 @@ public:
return &sInstance->mResAcc;
}
static dLytMap_c *getInstance() {
return sInstance;
}
bool isOpenMaybe() const {
return mMapMain.isOpenMaybe();
}
void build();
private:
+16 -4
View File
@@ -22,13 +22,23 @@ public:
bool build();
bool remove();
bool execute();
bool draw();
bool isVisible() const;
bool isOutputtingText() const;
void setCurrentLabelName(const char *name, bool storeFile);
void setCurrentEntrypointName(const char *name);
void setCurrentFlowFilename(const char *name);
private:
void setTextToDisplay(const wchar_t *text);
bool setTextToDisplay(const wchar_t *text);
void createSubMsgManager(u8 type);
void removeSubMsgManagers();
bool fn_8011A5D0() const;
static dLytMsgWindow_c *sInstance;
STATE_FUNC_DECLARE(dLytMsgWindow_c, Invisible);
@@ -69,8 +79,8 @@ private:
/* 0x748 */ dLytAutoExplain_c *mpAutoExplain;
/* 0x74C */ dLytAutoCaption_c *mpAutoCaption;
/* 0x750 */ u8 _0x750[0x768 - 0x750];
/* 0x750 */ u8 _0x750[0x75C - 0x750];
/* 0x75C */ mVec3_c field_0x75C;
/* 0x768 */ mVec3_c field_0x768;
/* 0x774 */ s32 field_0x774;
/* 0x778 */ s32 field_0x778;
@@ -105,13 +115,15 @@ private:
/* 0x81E */ u8 field_0x81E;
/* 0x820 */ u16 field_0x820;
/* 0x824 */ void *field_0x824;
/* 0x824 */ s32 field_0x824;
/* 0x828 */ void *field_0x828;
/* 0x82C */ u32 mTextOptionSelection;
/* 0x830 */ u32 mSpecialFiMenuValue;
/* 0x834 */ dLytMsgWindowSelectBtn_c mSelectBtn;
/* 0x1208 */ SizedString<8> mCurrentEntrypointName;
/* 0x1210 */ SizedString<16> mCurrentFlowFileName;
/* 0x1220 */ u8 field_0x1220;
};
@@ -1,7 +1,9 @@
#ifndef D_LYT_MSG_WINDOW_SELECT_BTN_H
#define D_LYT_MSG_WINDOW_SELECT_BTN_H
#include "d/d_tag_processor.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_textbox.h"
#include "d/lyt/d_window.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
@@ -71,6 +73,36 @@ public:
bool draw();
s32 getField_0x9B4() const {
return field_0x9B4;
}
void setField_0x9B8(s32 value) {
field_0x9B8 = value;
}
void setField_0x9BC(s32 value) {
field_0x9BC = value;
}
void setField_0x990(s32 value) {
mBtnHelper.field_0x4C = value;
}
void setField_0x998(dTagProcessor_c *value) {
mpTagProcessor = value;
}
void fn_8011E5D0(u32, bool);
dTextBox_c *getSelectTextBox(s32 option, s32 idx) const {
return mpSelectTextBoxes[option][idx];
}
BOOL isStateWait() {
return *mStateMgr.getStateID() == StateID_Wait;
}
private:
s32 fn_8011FE50();
@@ -93,7 +125,7 @@ private:
/* 0x7F0 */ dTextBox_c *mpSizeBox;
/* 0x7F4 */ dLytMsgWindowSelectBtnParts_c mParts[4];
/* 0x944 */ SelectBtnHelper mBtnHelper;
/* 0x998 */ void *field_0x998;
/* 0x998 */ dTagProcessor_c *mpTagProcessor;
/* 0x99C */ s32 field_0x99C;
/* 0x9A0 */ s32 field_0x9A0;
/* 0x9A4 */ u8 field_0x9A4;
+7 -7
View File
@@ -19,14 +19,14 @@ public:
};
mFaderBase_c(const mColor &color, EStatus status);
virtual ~mFaderBase_c();
/* vt 0x08 */ virtual ~mFaderBase_c();
virtual void setStatus(EStatus status) = 0;
virtual EStatus getStatus() const;
virtual bool fadeIn();
virtual bool fadeOut();
virtual bool calc();
virtual void draw() = 0;
/* vt 0x0C */ virtual void setStatus(EStatus status) = 0;
/* vt 0x10 */ virtual EStatus getStatus() const;
/* vt 0x14 */ virtual bool fadeIn();
/* vt 0x18 */ virtual bool fadeOut();
/* vt 0x1C */ virtual bool calc();
/* vt 0x20 */ virtual void draw() = 0;
void setFrame(u16 frame);
void setColor(const mColor &color);
+11 -2
View File
@@ -1,8 +1,17 @@
#ifndef GLOBAL_FI_CONTEXT_H
#define GLOBAL_FI_CONTEXT_H
extern "C" void *GLOBAL_FI_CONTEXT;
extern "C" void fn_8016C9F0(void*);
#include "common.h"
struct FiContext {
/* 0x00 */ u8 _0x00[0x4B - 0x00];
/* 0x4B */ bool mDoSpecialFiMenuHandling;
static s32 getGlobalFiInfo0(s32);
};
extern "C" FiContext *GLOBAL_FI_CONTEXT;
extern "C" void fn_8016C9F0(FiContext *);
extern "C" void createGlobalFiContext();
#endif
+2
View File
@@ -3,6 +3,7 @@
// Thanks kiwi! https://gist.github.com/kiwi515/47bb17b07ed502bdfa7faa60bc48a3c7
#include "common.h"
enum WZSound {
/* 0x0000 */ SE_L_FLIPED,
/* 0x0001 */ SE_L_FS_START,
@@ -6471,6 +6472,7 @@ enum WZSound {
class SmallSoundManager {
public:
void playSound(WZSound id);
void playButtonPressSoundWhenAdvancingTextBoxes(f32);
static SmallSoundManager *GetInstance() {
return sInstance;
+2 -2
View File
@@ -11,6 +11,7 @@
#include "d/col/c/c_m3d.h"
#include "d/col/c/c_partition.h"
#include "d/d_sc_game.h"
#include "d/lyt/d_lyt_map.h"
#include "toBeSorted/arc_managers/oarc_manager.h"
const char *MAP_SOLID_MATERIAL_NAMES[31] = {
@@ -1022,9 +1023,8 @@ void dBgS::SetupMapMaterial(int matIdx, bool, s32 roomId) {
// TODO
}
extern "C" UNKTYPE *lbl_805754B0;
UNKTYPE *dBgS::GetMapAccessor() {
return lbl_805754B0;
return dLytMap_c::getInstance();
}
void dBgS::DrawMap(int roomId, mMtx_c *, bool bColor, int) {
+351 -23
View File
@@ -3,10 +3,14 @@
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/d_message.h"
#include "d/d_stage_mgr.h"
#include "d/d_tag_processor.h"
#include "d/d_textunk.h"
#include "d/d_textwindow_unk.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/msg_window/d_lyt_msg_window_wood.h"
@@ -15,6 +19,7 @@
#include "d/lyt/d_lyt_auto_caption.h"
// clang-format on
#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"
@@ -22,6 +27,28 @@
#include "toBeSorted/event_manager.h"
#include "toBeSorted/global_fi_context.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/small_sound_mgr.h"
#include <cstring>
class MsgWindowUnkLocalClass {
public:
MsgWindowUnkLocalClass();
virtual ~MsgWindowUnkLocalClass();
private:
/* 0x04 */ u32 field_0x04;
/* 0x08 */ u8 field_0x08;
/* 0x09 */ u8 field_0x09;
};
MsgWindowUnkLocalClass mUnk;
MsgWindowUnkLocalClass::MsgWindowUnkLocalClass() {
field_0x04 = 8;
field_0x08 = 0;
field_0x09 = 0;
}
MsgWindowUnkLocalClass::~MsgWindowUnkLocalClass() {}
STATE_DEFINE(dLytMsgWindow_c, Invisible);
STATE_DEFINE(dLytMsgWindow_c, In);
@@ -43,6 +70,11 @@ STATE_DEFINE(dLytMsgWindow_c, DemoIn);
STATE_DEFINE(dLytMsgWindow_c, DemoVisible);
STATE_DEFINE(dLytMsgWindow_c, DemoOut);
extern "C" bool checkButtonAPressed();
extern "C" bool checkButtonAHeld();
extern "C" bool checkButtonBPressed();
extern "C" bool checkButtonPlusPressed();
bool dLytMsgWindow_c::build() {
mResAcc1.attach(LayoutArcManager::GetInstance()->getLoadedData("DoButton"), "");
mResAcc2.attach(LayoutArcManager::GetInstance()->getLoadedData("System2D"), "");
@@ -102,7 +134,7 @@ bool dLytMsgWindow_c::build() {
field_0x81C = 0;
field_0x81D = 0;
field_0x824 = nullptr;
field_0x824 = 0;
field_0x820 = 0;
field_0x81E = 0;
@@ -245,10 +277,55 @@ void dLytMsgWindow_c::initializeState_OutputText() {
field_0x820 = 0;
field_0x81E = 0;
}
void dLytMsgWindow_c::executeState_OutputText() {}
void dLytMsgWindow_c::executeState_OutputText() {
u16 oldValue = mpMsgWindowUnk->getField_0x147A();
field_0x812 = 0;
if (mpTagProcessor->getField_0x830() != -1) {
field_0x811 = 1;
} else {
field_0x811 = 0;
}
if (field_0x815 == 0 && field_0x816 == 0) {
mpMsgWindowUnk->textAdvancingRelated(false, true);
if (field_0x811 == 0 && checkButtonAHeld() && field_0x815 == 0 && field_0x816 == 0) {
mpMsgWindowUnk->textAdvancingRelated(false, true);
}
}
if (mpTagProcessor->getMsgWindowSubtype() >= 2 && mpTagProcessor->getMsgWindowSubtype() < 5) {
// TODO
} else if (mpTagProcessor->getMsgWindowSubtype() < 2 && oldValue != mpMsgWindowUnk->getField_0x147A()) {
u16 a = mpMsgWindowUnk->getField_0x147C();
f32 b = (dTagProcessor_c::fn_800B8040(0, 0) * 100.0f);
SmallSoundManager::GetInstance()->playButtonPressSoundWhenAdvancingTextBoxes(a / b);
}
if (setTextToDisplay(mpMsgWindowUnk->getProcessedText())) {
if (field_0x81C != 0) {
if (field_0x811 != 0) {
mStateMgr.changeState(StateID_WaitKeyMsgEnd0);
} else if (mpTagProcessor->getField_0x90E() != 0) {
mStateMgr.changeState(StateID_WaitKeyMsgEnd0);
} else if (mpCurrentSubtype->vt_0x34()) {
field_0x817 = 1;
mStateMgr.changeState(StateID_WaitKeyMsgEnd0);
}
} else if (field_0x81D != 0) {
if (field_0x811 != 0) {
mStateMgr.changeState(StateID_WaitKeyChangePage0);
} else if (mpCurrentSubtype->vt_0x34()) {
field_0x817 = 1;
mStateMgr.changeState(StateID_WaitKeyChangePage0);
}
}
}
field_0x81C = mpMsgWindowUnk->checkEndReached();
field_0x81D = mpMsgWindowUnk->checkLastLineReachedMaybe();
}
void dLytMsgWindow_c::finalizeState_OutputText() {}
extern "C" bool checkButtonAPressed();
void dLytMsgWindow_c::initializeState_WaitKeyChangePage0() {
if (field_0x811 != 0) {
field_0x812 = 1;
@@ -344,8 +421,8 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() {
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
field_0x818 = 1;
mStateMgr.changeState(StateID_OutputText);
field_0x810 = 0;
}
field_0x810 = 0;
} else {
fn_8035E820(BGM_MGR);
if (mpTagProcessor->getField_0x90E() != 0) {
@@ -358,57 +435,308 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() {
void dLytMsgWindow_c::finalizeState_WaitKeyMsgEnd0() {}
void dLytMsgWindow_c::initializeState_WaitKeyMsgEnd1() {}
void dLytMsgWindow_c::executeState_WaitKeyMsgEnd1() {}
void dLytMsgWindow_c::executeState_WaitKeyMsgEnd1() {
if (mpCurrentSubtype->vt_0x38(false)) {
if (field_0x810 != 0) {
field_0x817 = 0;
if (dMessage_c::isValidTextLabel(mName)) {
mNameCopy = mName;
mpMsgWindowUnk->fn_800B2130(mNameCopy, mpCurrentSubtype->vt_0x30(), field_0x828, true);
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
field_0x818 = 1;
mStateMgr.changeState(StateID_OutputText);
}
field_0x810 = 0;
} else {
fn_8035E820(BGM_MGR);
if (mpTagProcessor->getField_0x90E() != 0) {
mStateMgr.changeState(StateID_WaitKeySelectQuestion);
} else if (field_0x817 == 0) {
mStateMgr.changeState(StateID_Out);
} else {
field_0x817 = 0;
mStateMgr.changeState(StateID_WaitKeyMsgEnd2);
}
}
}
}
void dLytMsgWindow_c::finalizeState_WaitKeyMsgEnd1() {}
void dLytMsgWindow_c::initializeState_WaitKeyMsgEnd2() {}
void dLytMsgWindow_c::executeState_WaitKeyMsgEnd2() {}
void dLytMsgWindow_c::executeState_WaitKeyMsgEnd2() {
if (mpCurrentSubtype->vt_0x3C()) {
mStateMgr.changeState(StateID_Out);
}
}
void dLytMsgWindow_c::finalizeState_WaitKeyMsgEnd2() {}
void dLytMsgWindow_c::initializeState_WaitKeySelectQuestion() {}
void dLytMsgWindow_c::executeState_WaitKeySelectQuestion() {}
static wchar_t *sBufs[4];
void dLytMsgWindow_c::initializeState_WaitKeySelectQuestion() {
// TODO regswaps
field_0x824 = mpTagProcessor->getField_0x90E();
mSelectBtn.setField_0x9B8(mpTagProcessor->getField_0x82C());
s32 tmp = mpTagProcessor->getField_0x828();
mSelectBtn.setField_0x9BC(tmp);
mSelectBtn.setField_0x990(tmp);
mSelectBtn.setField_0x998(mpTagProcessor);
wchar_t **buf = sBufs;
buf[0] = mpTagProcessor->getBuf(0);
buf[1] = mpTagProcessor->getBuf(1);
buf[2] = mpTagProcessor->getBuf(2);
buf[3] = mpTagProcessor->getBuf(3);
mSelectBtn.fn_8011E5D0(field_0x824, true);
for (int i = 0; i < field_0x824; i++) {
for (int j = 0; j < 2; j++) {
mSelectBtn.getSelectTextBox(i, j)->setTextWithGlobalTextProcessor(buf[i]);
}
}
}
void dLytMsgWindow_c::executeState_WaitKeySelectQuestion() {
s32 selection = mSelectBtn.getField_0x9B4();
if (selection >= 0) {
if (mSelectBtn.isStateWait()) {
bool doFiThing = false;
mpTagProcessor->setField_0x90E(0);
mpTagProcessor->setField_0x82C(-1);
mpTagProcessor->setField_0x828(-1);
mSelectBtn.setField_0x998(nullptr);
field_0x824 = 0;
mTextOptionSelection = selection;
field_0x1220 = 0;
if (GLOBAL_FI_CONTEXT != nullptr) {
doFiThing = GLOBAL_FI_CONTEXT->mDoSpecialFiMenuHandling;
}
if (doFiThing) {
switch ((int)mTextOptionSelection) {
case 0: mSpecialFiMenuValue = FiContext::getGlobalFiInfo0(0); break;
case 1: mSpecialFiMenuValue = FiContext::getGlobalFiInfo0(1); break;
case 2: mSpecialFiMenuValue = FiContext::getGlobalFiInfo0(2); break;
case 3: mSpecialFiMenuValue = 7; break;
}
}
if (field_0x1220 != 0) {
mStateMgr.changeState(StateID_Invisible);
} else {
mStateMgr.changeState(StateID_Out);
}
}
}
}
void dLytMsgWindow_c::finalizeState_WaitKeySelectQuestion() {}
void dLytMsgWindow_c::initializeState_MapOpen() {}
void dLytMsgWindow_c::executeState_MapOpen() {}
void dLytMsgWindow_c::executeState_MapOpen() {
if ((dLytMap_c::getInstance() != nullptr && dLytMap_c::getInstance()->isOpenMaybe()) ||
!dLytControlGame_c::getInstance()->isInSomeMapState()) {
dMessage_c::getInstance()->setField_0x329(0);
mStateMgr.changeState(StateID_Invisible);
}
}
void dLytMsgWindow_c::finalizeState_MapOpen() {}
void dLytMsgWindow_c::initializeState_WaitKeyMapClose() {}
void dLytMsgWindow_c::executeState_WaitKeyMapClose() {}
void dLytMsgWindow_c::executeState_WaitKeyMapClose() {
if ((checkButtonBPressed() || checkButtonPlusPressed()) && !dLytControlGame_c::getInstance()->isNotInStateMap()) {
dLytControlGame_c::getInstance()->fn_802CCD40(true);
mStateMgr.changeState(StateID_MapClose);
}
}
void dLytMsgWindow_c::finalizeState_WaitKeyMapClose() {}
void dLytMsgWindow_c::initializeState_MapClose() {}
void dLytMsgWindow_c::executeState_MapClose() {}
void dLytMsgWindow_c::finalizeState_MapClose() {}
void dLytMsgWindow_c::initializeState_Out() {}
void dLytMsgWindow_c::executeState_Out() {}
void dLytMsgWindow_c::initializeState_Out() {
field_0x768 = field_0x75C;
mpCurrentSubtype->close();
}
void dLytMsgWindow_c::executeState_Out() {
if (mpCurrentSubtype->isDoneClosing() && (field_0x817 == 0 || mpCurrentSubtype->vt_0x3C())) {
removeSubMsgManagers();
mStateMgr.changeState(StateID_Invisible);
}
}
void dLytMsgWindow_c::finalizeState_Out() {}
void dLytMsgWindow_c::initializeState_ExplainIn() {}
void dLytMsgWindow_c::executeState_ExplainIn() {}
void dLytMsgWindow_c::initializeState_ExplainIn() {
mpCurrentSubtype->open(nullptr, false);
}
void dLytMsgWindow_c::executeState_ExplainIn() {
if (mpCurrentSubtype->isDoneOpening()) {
mpMsgWindowUnk->textAdvancingRelated(true, true);
if (setTextToDisplay(mpMsgWindowUnk->getProcessedText())) {
mStateMgr.changeState(StateID_ExplainVisible);
}
}
}
void dLytMsgWindow_c::finalizeState_ExplainIn() {}
void dLytMsgWindow_c::initializeState_ExplainVisible() {}
void dLytMsgWindow_c::executeState_ExplainVisible() {}
void dLytMsgWindow_c::executeState_ExplainVisible() {
if ((mShowAutoMessage != 0 || (mpAutoExplain != nullptr && mpAutoExplain->checkSomethingMeter())) ||
((mpAutoCaption != nullptr && mpAutoCaption->checkSomethingMeter()))) {
mStateMgr.changeState(StateID_ExplainOut);
}
}
void dLytMsgWindow_c::finalizeState_ExplainVisible() {}
void dLytMsgWindow_c::initializeState_ExplainOut() {}
void dLytMsgWindow_c::executeState_ExplainOut() {}
void dLytMsgWindow_c::initializeState_ExplainOut() {
mpCurrentSubtype->close();
}
void dLytMsgWindow_c::executeState_ExplainOut() {
if (mpCurrentSubtype->isDoneClosing()) {
field_0x80D = 0;
mShowAutoMessage = 0;
removeSubMsgManagers();
mStateMgr.changeState(StateID_Invisible);
}
}
void dLytMsgWindow_c::finalizeState_ExplainOut() {}
void dLytMsgWindow_c::initializeState_DemoIn() {}
void dLytMsgWindow_c::executeState_DemoIn() {}
void dLytMsgWindow_c::initializeState_DemoIn() {
mpCurrentSubtype->open(nullptr, 0);
}
void dLytMsgWindow_c::executeState_DemoIn() {
if (mpCurrentSubtype->isDoneOpening()) {
mStateMgr.changeState(StateID_DemoVisible);
}
}
void dLytMsgWindow_c::finalizeState_DemoIn() {}
void dLytMsgWindow_c::initializeState_DemoVisible() {}
void dLytMsgWindow_c::executeState_DemoVisible() {}
void dLytMsgWindow_c::initializeState_DemoVisible() {
field_0x81C = 0;
field_0x812 = 1;
}
void dLytMsgWindow_c::executeState_DemoVisible() {
if (mpTagProcessor->getField_0x830() <= 0) {
mStateMgr.changeState(StateID_DemoOut);
}
field_0x81C = mpMsgWindowUnk->checkEndReached();
}
void dLytMsgWindow_c::finalizeState_DemoVisible() {}
void dLytMsgWindow_c::initializeState_DemoOut() {}
void dLytMsgWindow_c::executeState_DemoOut() {}
void dLytMsgWindow_c::initializeState_DemoOut() {
mpCurrentSubtype->close();
}
void dLytMsgWindow_c::executeState_DemoOut() {
if (mpCurrentSubtype->isDoneClosing()) {
if (field_0x81C != 0) {
field_0x81C = 0;
removeSubMsgManagers();
mStateMgr.changeState(StateID_Invisible);
} else {
mpMsgWindowUnk->fn_800B2AA0();
mpMsgWindowUnk->textAdvancingRelated(true, true);
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
mStateMgr.changeState(StateID_DemoIn);
}
}
}
void dLytMsgWindow_c::finalizeState_DemoOut() {}
bool dLytMsgWindow_c::execute() {
field_0x818 = 0;
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) {
field_0x819 = 1;
field_0x81B = 1;
}
}
if (field_0x81B != 0) {
if (isVisible()) {
removeSubMsgManagers();
mStateMgr.changeState(StateID_Invisible);
}
mpMsgWindowUnk->checkLastLineReachedMaybe();
mSelectBtn.remove();
field_0x81B = 0;
// TODO boss caption
}
// TODO ActorEventFlowManagerRelated::checkEventFinished
mStateMgr.executeState();
if (isVisible()) {
mSelectBtn.execute();
if (mpCurrentSubtype != nullptr) {
mpCurrentSubtype->execute();
}
}
if (field_0x812 != 0) {
if (mpTagProcessor->getField_0x830() != -1) {
mpTagProcessor->tick0x830();
} else {
field_0x811 = 0;
field_0x812 = 0;
}
}
mpTagProcessor->execute();
if (field_0x816 == 1 && old_field_0x816 == 1) {
field_0x816 = 0;
}
return true;
}
bool dLytMsgWindow_c::draw() {
if (isVisible() || field_0x1220 != 0) {
if (mpCurrentSubtype != nullptr) {
// TODO tag processor
mpCurrentSubtype->addToDrawList();
}
mSelectBtn.draw();
}
return true;
}
void dLytMsgWindow_c::setCurrentLabelName(const char *name, bool storeFile) {
// TODO
mName = name;
!std::strcmp(name, "FR_SIREN_04");
}
bool dLytMsgWindow_c::isVisible() const {
return !(*mStateMgr.getStateID() == StateID_Invisible);
}
bool dLytMsgWindow_c::setTextToDisplay(const wchar_t *text) {
if (mpCurrentSubtype != nullptr) {
return mpCurrentSubtype->setText(text);
}
return false;
}
bool dLytMsgWindow_c::isOutputtingText() const {
return *mStateMgr.getStateID() == StateID_OutputText;
}
void dLytMsgWindow_c::setCurrentEntrypointName(const char *name) {
mCurrentEntrypointName = name;
}
void dLytMsgWindow_c::setCurrentFlowFilename(const char *name) {
mCurrentFlowFileName = name;
}
#pragma dont_inline on
void dLytMsgWindow_c::createSubMsgManager(u8 type) {
switch (type) {
@@ -332,7 +332,7 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
field_0x9B0 = mBtnHelper.field_0x50;
mStateMgr.changeState(StateID_WaitDecide);
// TODO
if (field_0x998 != nullptr) {
if (mpTagProcessor != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
@@ -345,7 +345,7 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
field_0x9D0 = 0;
mStateMgr.changeState(StateID_WaitCancel);
// TODO
if (field_0x998 != nullptr) {
if (mpTagProcessor != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
@@ -473,7 +473,7 @@ bool dLytMsgWindowSelectBtn_c::build(d2d::ResAccIf_c *resAcc) {
mpBoundings[i] = mLyt.findPane(sBoundings[i]);
}
field_0x998 = nullptr;
mpTagProcessor = nullptr;
for (int i = 0; i < 7; i++) {
mpSelectPanes[i] = mLyt.findPane(sSelectPanes[i]);