From 4e88b4aec785bd1468bbe4716941e2681a8387e9 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 13:36:11 +0200 Subject: [PATCH] auto_caption, auto_explain largely matching --- config/SOUE01/splits.txt | 10 + config/SOUE01/symbols.txt | 162 ++++++++-------- include/d/d_tag_processor.h | 10 +- include/d/lyt/d_lyt_auto_caption.h | 45 +++++ include/d/lyt/d_lyt_auto_explain.h | 45 +++++ include/d/lyt/d_lyt_common_a_btn.h | 2 +- include/d/lyt/d_textbox.h | 1 + .../lyt/msg_window/d_lyt_msg_window_common.h | 14 +- .../d/lyt/msg_window/d_lyt_msg_window_stone.h | 17 +- .../d/lyt/msg_window/d_lyt_msg_window_wood.h | 17 +- include/nw4r/lyt/lyt_textBox.h | 4 + src/d/d_tag_processor.cpp | 14 +- src/d/lyt/d_lyt_auto_caption.cpp | 176 ++++++++++++++++++ src/d/lyt/d_lyt_auto_explain.cpp | 169 +++++++++++++++++ .../lyt/msg_window/d_lyt_msg_window_stone.cpp | 10 +- .../lyt/msg_window/d_lyt_msg_window_wood.cpp | 10 +- 16 files changed, 584 insertions(+), 122 deletions(-) create mode 100644 include/d/lyt/d_lyt_auto_caption.h create mode 100644 include/d/lyt/d_lyt_auto_explain.h create mode 100644 src/d/lyt/d_lyt_auto_caption.cpp create mode 100644 src/d/lyt/d_lyt_auto_explain.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 5af1cf27..6c52dec7 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -487,10 +487,20 @@ d/lyt/msg_window/d_lyt_simple_window.cpp: d/lyt/d_lyt_auto_caption.cpp: .text start:0x8012B950 end:0x8012C568 .ctors start:0x804DB760 end:0x804DB764 + .rodata start:0x804E7668 end:0x804E7688 + .data start:0x8051E548 end:0x8051E7C0 + .sdata start:0x80572638 end:0x80572648 + .sdata2 start:0x80579EF8 end:0x80579F10 + .bss start:0x805AF1F0 end:0x805AF2F0 d/lyt/d_lyt_auto_explain.cpp: .text start:0x8012C570 end:0x8012D188 .ctors start:0x804DB764 end:0x804DB768 + .rodata start:0x804E7688 end:0x804E76A0 + .data start:0x8051E7C0 end:0x8051EA08 + .sdata start:0x80572648 end:0x80572658 + .sdata2 start:0x80579F10 end:0x80579F28 + .bss start:0x805AF2F0 end:0x805AF3F0 d/lyt/d_lyt_map_capture.cpp: .text start:0x8012D190 end:0x8012DC28 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 9592a204..f9564118 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3843,7 +3843,7 @@ fn_800AF3E0 = .text:0x800AF3E0; // type:function size:0x8C fn_800AF470 = .text:0x800AF470; // type:function size:0xCC fn_800AF540__10dTextBox_cFPCwP15dTagProcessor_ce = .text:0x800AF540; // type:function size:0x8C fn_800AF5D0 = .text:0x800AF5D0; // type:function size:0xD4 -fn_800AF6B0 = .text:0x800AF6B0; // type:function size:0x64 +fn_800AF6B0__10dTextBox_cFPCwP15dTagProcessor_c = .text:0x800AF6B0; // type:function size:0x64 fn_800AF720 = .text:0x800AF720; // type:function size:0x8C fn_800AF7B0 = .text:0x800AF7B0; // type:function size:0x84 fn_800AF840 = .text:0x800AF840; // type:function size:0xEC @@ -3949,7 +3949,7 @@ fn_800B8340 = .text:0x800B8340; // type:function size:0x18C fn_800B84D0 = .text:0x800B84D0; // type:function size:0x8C fn_800B8560 = .text:0x800B8560; // type:function size:0x54 fn_800B85C0 = .text:0x800B85C0; // type:function size:0x290 -getNumLines__15dTagProcessor_cFl = .text:0x800B8850; // type:function size:0x38 +getMaxNumLines__15dTagProcessor_cFl = .text:0x800B8850; // type:function size:0x38 getTextCommand__15dTagProcessor_cFwPCwPUcPlPPw = .text:0x800B8890; // type:function size:0x38 process0xFCommand__15dTagProcessor_cFwPCwPl = .text:0x800B88D0; // type:function size:0xC tick0x830__15dTagProcessor_cFv = .text:0x800B88E0; // type:function size:0x30 @@ -6764,14 +6764,14 @@ LytMsgWindow__stateInUpdate = .text:0x80115910; // type:function size:0x60 LytMsgWindow__stateInLeave = .text:0x80115970; // type:function size:0x4 LytMsgWindow__stateOutputTextEnter = .text:0x80115980; // type:function size:0x18 LytMsgWindow__stateOutputTextUpdate = .text:0x801159A0; // type:function size:0x2A0 -fn_80115C40 = .text:0x80115C40; // type:function size:0x8 +vt_0x34__20dLytMsgWindowSubtypeFv = .text:0x80115C40; // type:function size:0x8 LytMsgWindow__stateOutputTextLeave = .text:0x80115C50; // type:function size:0x4 stateChangePageNonFinalTextboxEnter = .text:0x80115C60; // type:function size:0x30 stateChangePageNonFinalTextboxUpdate = .text:0x80115C90; // type:function size:0x140 LytMsgWindow__stateChangePageNonFinalTextboxLeave = .text:0x80115DD0; // type:function size:0x4 LytMsgWindow__stateWaitKeyChangePage1Enter = .text:0x80115DE0; // type:function size:0x4 LytMsgWindow__stateWaitKeyChangePage1Update = .text:0x80115DF0; // type:function size:0xB4 -fn_80115EB0 = .text:0x80115EB0; // type:function size:0x8 +vt_0x38__20dLytMsgWindowSubtypeFb = .text:0x80115EB0; // type:function size:0x8 LytMsgWindow__stateWaitKeyChangePage1Leave = .text:0x80115EC0; // type:function size:0x4 stateChangePageFinalTextboxEnter = .text:0x80115ED0; // type:function size:0x40 stateChangePageFinalTextboxUpdate = .text:0x80115F10; // type:function size:0x258 @@ -6781,7 +6781,7 @@ LytMsgWindow__stateWaitKeyMsgEnd1Update = .text:0x80116190; // type:function siz LytMsgWindow__stateWaitKeyMsgEnd1Leave = .text:0x80116370; // type:function size:0x4 LytMsgWindow__stateWaitKeyMsgEnd2Enter = .text:0x80116380; // type:function size:0x4 LytMsgWindow__stateWaitKeyMsgEnd2Update = .text:0x80116390; // type:function size:0x60 -fn_801163F0 = .text:0x801163F0; // type:function size:0x8 +vt_0x3C__20dLytMsgWindowSubtypeCFv = .text:0x801163F0; // type:function size:0x8 LytMsgWindow__stateWaitKeyMsgEnd2Leave = .text:0x80116400; // type:function size:0x4 LytMsgWindow__stateWaitKeySelectQuestionEnter = .text:0x80116410; // type:function size:0xD0 LytMsgWindow__stateWaitKeySelectQuestionUpdate = .text:0x801164E0; // type:function size:0x15C @@ -6881,8 +6881,8 @@ __dt__19dLytMsgWindowWood_cFv = .text:0x80119DB0; // type:function size:0x170 __dt__20dLytMsgWindowStone_cFv = .text:0x80119F20; // type:function size:0x170 fn_8011A090 = .text:0x8011A090; // type:function size:0x198 fn_8011A230 = .text:0x8011A230; // type:function size:0x158 -fn_8011A390 = .text:0x8011A390; // type:function size:0x118 -fn_8011A4B0 = .text:0x8011A4B0; // type:function size:0x118 +__dt__17dLytAutoExplain_cFv = .text:0x8011A390; // type:function size:0x118 +__dt__17dLytAutoCaption_cFv = .text:0x8011A4B0; // type:function size:0x118 fn_8011A5D0 = .text:0x8011A5D0; // type:function size:0x1AC fn_8011A780 = .text:0x8011A780; // type:function size:0x10 fn_8011A790 = .text:0x8011A790; // type:function size:0x10 @@ -7034,12 +7034,12 @@ fn_8011B7A0 = .text:0x8011B7A0; // type:function size:0x30 fn_8011B7D0 = .text:0x8011B7D0; // type:function size:0x30 fn_8011B800 = .text:0x8011B800; // type:function size:0x30 fn_8011B830 = .text:0x8011B830; // type:function size:0x30 -fn_8011B860 = .text:0x8011B860; // type:function size:0x30 -fn_8011B890 = .text:0x8011B890; // type:function size:0x30 -fn_8011B8C0 = .text:0x8011B8C0; // type:function size:0x30 -fn_8011B8F0 = .text:0x8011B8F0; // type:function size:0x30 -fn_8011B920 = .text:0x8011B920; // type:function size:0x30 -fn_8011B950 = .text:0x8011B950; // type:function size:0x30 +finalizeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B860; // type:function size:0x30 +executeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B890; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B8C0; // type:function size:0x30 +finalizeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B8F0; // type:function size:0x30 +executeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B920; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B950; // type:function size:0x30 LytMsgWindow__initStates = .text:0x8011B980; // type:function size:0xE58 LytMsgWindow__dtor = .text:0x8011C7E0; // type:function size:0x58 fn_8011C840 = .text:0x8011C840; // type:function size:0x88 @@ -7253,7 +7253,7 @@ fn_801256B0 = .text:0x801256B0; // type:function size:0x8 LytMsgWindowSword__initStates = .text:0x801256C0; // type:function size:0x3F4 LytMsgWindowSword__dtor2 = .text:0x80125AC0; // type:function size:0x58 fn_80125B20 = .text:0x80125B20; // type:function size:0x88 -build__19dLytMsgWindowWood_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80125BB0; // type:function size:0x278 +build__19dLytMsgWindowWood_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80125BB0; // type:function size:0x278 remove__19dLytMsgWindowWood_cFv = .text:0x80125E30; // type:function size:0xD8 initializeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F10; // type:function size:0x8 executeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F20; // type:function size:0x28 @@ -7281,7 +7281,7 @@ vt_0x30__19dLytMsgWindowWood_cFv = .text:0x801263C0; // type:function size:0x8 __sinit_\d_lyt_msg_window_wood_cpp = .text:0x801263D0; // type:function size:0x338 scope:local __dt__34sFStateID_c<19dLytMsgWindowWood_c>Fv = .text:0x80126710; // type:function size:0x58 isSameName__34sFStateID_c<19dLytMsgWindowWood_c>CFPCc = .text:0x80126770; // type:function size:0x88 -build__20dLytMsgWindowStone_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80126800; // type:function size:0x284 +build__20dLytMsgWindowStone_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80126800; // type:function size:0x284 remove__20dLytMsgWindowStone_cFv = .text:0x80126A90; // type:function size:0xD8 initializeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B70; // type:function size:0x8 executeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B80; // type:function size:0x28 @@ -7421,58 +7421,58 @@ fn_8012B4F0 = .text:0x8012B4F0; // type:function size:0x30 LytSimpleWindow__initStates = .text:0x8012B520; // type:function size:0x338 LytSimpleWindow__dtor = .text:0x8012B860; // type:function size:0x58 fn_8012B8C0 = .text:0x8012B8C0; // type:function size:0x88 -fn_8012B950 = .text:0x8012B950; // type:function size:0x4 -fn_8012B960 = .text:0x8012B960; // type:function size:0x28 -fn_8012B990 = .text:0x8012B990; // type:function size:0x4 -fn_8012B9A0 = .text:0x8012B9A0; // type:function size:0xFC -fn_8012BAA0 = .text:0x8012BAA0; // type:function size:0x78 -fn_8012BB20 = .text:0x8012BB20; // type:function size:0x4 -fn_8012BB30 = .text:0x8012BB30; // type:function size:0x4 -fn_8012BB40 = .text:0x8012BB40; // type:function size:0x28 -fn_8012BB70 = .text:0x8012BB70; // type:function size:0x4 -fn_8012BB80 = .text:0x8012BB80; // type:function size:0x48 -fn_8012BBD0 = .text:0x8012BBD0; // type:function size:0x78 -fn_8012BC50 = .text:0x8012BC50; // type:function size:0x4 -fn_8012BC60 = .text:0x8012BC60; // type:function size:0x178 -fn_8012BDE0 = .text:0x8012BDE0; // type:function size:0x50 -fn_8012BE30 = .text:0x8012BE30; // type:function size:0xA8 -fn_8012BEE0 = .text:0x8012BEE0; // type:function size:0x14 -fn_8012BF00 = .text:0x8012BF00; // type:function size:0xC -fn_8012BF10 = .text:0x8012BF10; // type:function size:0x4C -fn_8012BF60 = .text:0x8012BF60; // type:function size:0xC -fn_8012BF70 = .text:0x8012BF70; // type:function size:0x4C -fn_8012BFC0 = .text:0x8012BFC0; // type:function size:0x64 -fn_8012C030 = .text:0x8012C030; // type:function size:0xF4 -fn_8012C130 = .text:0x8012C130; // type:function size:0x8 -LytAutoCaption__initStates = .text:0x8012C140; // type:function size:0x338 -LytAutoCaption__dtor = .text:0x8012C480; // type:function size:0x58 -fn_8012C4E0 = .text:0x8012C4E0; // type:function size:0x88 -fn_8012C570 = .text:0x8012C570; // type:function size:0x4 -fn_8012C580 = .text:0x8012C580; // type:function size:0x28 -fn_8012C5B0 = .text:0x8012C5B0; // type:function size:0x4 -fn_8012C5C0 = .text:0x8012C5C0; // type:function size:0xCC -fn_8012C690 = .text:0x8012C690; // type:function size:0x78 -fn_8012C710 = .text:0x8012C710; // type:function size:0x4 -fn_8012C720 = .text:0x8012C720; // type:function size:0x4 -fn_8012C730 = .text:0x8012C730; // type:function size:0x28 -fn_8012C760 = .text:0x8012C760; // type:function size:0x4 -fn_8012C770 = .text:0x8012C770; // type:function size:0x48 -fn_8012C7C0 = .text:0x8012C7C0; // type:function size:0x78 -fn_8012C840 = .text:0x8012C840; // type:function size:0x4 -fn_8012C850 = .text:0x8012C850; // type:function size:0x194 -fn_8012C9F0 = .text:0x8012C9F0; // type:function size:0x50 -fn_8012CA40 = .text:0x8012CA40; // type:function size:0xA8 -fn_8012CAF0 = .text:0x8012CAF0; // type:function size:0x14 -fn_8012CB10 = .text:0x8012CB10; // type:function size:0xC -fn_8012CB20 = .text:0x8012CB20; // type:function size:0x4C -fn_8012CB70 = .text:0x8012CB70; // type:function size:0xC -fn_8012CB80 = .text:0x8012CB80; // type:function size:0x4C -fn_8012CBD0 = .text:0x8012CBD0; // type:function size:0x7C -fn_8012CC50 = .text:0x8012CC50; // type:function size:0xF4 -fn_8012CD50 = .text:0x8012CD50; // type:function size:0x8 -LytAutoExplain__initStates = .text:0x8012CD60; // type:function size:0x338 -LytAutoExplain__dtor = .text:0x8012D0A0; // type:function size:0x58 -fn_8012D100 = .text:0x8012D100; // type:function size:0x88 +initializeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B950; // type:function size:0x4 +executeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B960; // type:function size:0x28 +finalizeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B990; // type:function size:0x4 +initializeState_In__17dLytAutoCaption_cFv = .text:0x8012B9A0; // type:function size:0xFC +executeState_In__17dLytAutoCaption_cFv = .text:0x8012BAA0; // type:function size:0x78 +finalizeState_In__17dLytAutoCaption_cFv = .text:0x8012BB20; // type:function size:0x4 +initializeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB30; // type:function size:0x4 +executeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB40; // type:function size:0x28 +finalizeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB70; // type:function size:0x4 +initializeState_Out__17dLytAutoCaption_cFv = .text:0x8012BB80; // type:function size:0x48 +executeState_Out__17dLytAutoCaption_cFv = .text:0x8012BBD0; // type:function size:0x78 +finalizeState_Out__17dLytAutoCaption_cFv = .text:0x8012BC50; // type:function size:0x4 +build__17dLytAutoCaption_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x8012BC60; // type:function size:0x178 +remove__17dLytAutoCaption_cFv = .text:0x8012BDE0; // type:function size:0x50 +execute__17dLytAutoCaption_cFv = .text:0x8012BE30; // type:function size:0xA8 +draw__17dLytAutoCaption_cFv = .text:0x8012BEE0; // type:function size:0x14 +open__17dLytAutoCaption_cFv = .text:0x8012BF00; // type:function size:0xC +isOpening__17dLytAutoCaption_cCFv = .text:0x8012BF10; // type:function size:0x4C +close__17dLytAutoCaption_cFv = .text:0x8012BF60; // type:function size:0xC +isClosing__17dLytAutoCaption_cCFv = .text:0x8012BF70; // type:function size:0x4C +setText__17dLytAutoCaption_cFPCw = .text:0x8012BFC0; // type:function size:0x64 +checkSomethingMeter__17dLytAutoCaption_cFv = .text:0x8012C030; // type:function size:0xF4 +vt_0x30__17dLytAutoCaption_cFv = .text:0x8012C130; // type:function size:0x8 +__sinit_\d_lyt_auto_caption_cpp = .text:0x8012C140; // type:function size:0x338 +__dt__32sFStateID_c<17dLytAutoCaption_c>Fv = .text:0x8012C480; // type:function size:0x58 +isSameName__32sFStateID_c<17dLytAutoCaption_c>CFPCc = .text:0x8012C4E0; // type:function size:0x88 +initializeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C570; // type:function size:0x4 +executeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C580; // type:function size:0x28 +finalizeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C5B0; // type:function size:0x4 +initializeState_In__17dLytAutoExplain_cFv = .text:0x8012C5C0; // type:function size:0xCC +executeState_In__17dLytAutoExplain_cFv = .text:0x8012C690; // type:function size:0x78 +finalizeState_In__17dLytAutoExplain_cFv = .text:0x8012C710; // type:function size:0x4 +initializeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C720; // type:function size:0x4 +executeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C730; // type:function size:0x28 +finalizeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C760; // type:function size:0x4 +initializeState_Out__17dLytAutoExplain_cFv = .text:0x8012C770; // type:function size:0x48 +executeState_Out__17dLytAutoExplain_cFv = .text:0x8012C7C0; // type:function size:0x78 +finalizeState_Out__17dLytAutoExplain_cFv = .text:0x8012C840; // type:function size:0x4 +build__17dLytAutoExplain_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x8012C850; // type:function size:0x194 +remove__17dLytAutoExplain_cFv = .text:0x8012C9F0; // type:function size:0x50 +execute__17dLytAutoExplain_cFv = .text:0x8012CA40; // type:function size:0xA8 +draw__17dLytAutoExplain_cFv = .text:0x8012CAF0; // type:function size:0x14 +open__17dLytAutoExplain_cFv = .text:0x8012CB10; // type:function size:0xC +isOpening__17dLytAutoExplain_cCFv = .text:0x8012CB20; // type:function size:0x4C +close__17dLytAutoExplain_cFv = .text:0x8012CB70; // type:function size:0xC +isClosing__17dLytAutoExplain_cCFv = .text:0x8012CB80; // type:function size:0x4C +setText__17dLytAutoExplain_cFPCw = .text:0x8012CBD0; // type:function size:0x7C +checkSomethingMeter__17dLytAutoExplain_cFv = .text:0x8012CC50; // type:function size:0xF4 +vt_0x30__17dLytAutoExplain_cFv = .text:0x8012CD50; // type:function size:0x8 +__sinit_\d_lyt_auto_explain_cpp = .text:0x8012CD60; // type:function size:0x338 +__dt__32sFStateID_c<17dLytAutoExplain_c>Fv = .text:0x8012D0A0; // type:function size:0x58 +isSameName__32sFStateID_c<17dLytAutoExplain_c>CFPCc = .text:0x8012D100; // type:function size:0x88 fn_8012D190 = .text:0x8012D190; // type:function size:0x68 fn_8012D200 = .text:0x8012D200; // type:function size:0x108 projectForMapMaybe = .text:0x8012D310; // type:function size:0x18 @@ -32317,8 +32317,8 @@ lbl_8051E5E0 = .data:0x8051E5E0; // type:object size:0x10 lbl_8051E5F0 = .data:0x8051E5F0; // type:object size:0x10 lbl_8051E600 = .data:0x8051E600; // type:object size:0x10 lbl_8051E610 = .data:0x8051E610; // type:object size:0x18 -lbl_8051E628 = .data:0x8051E628; // type:object size:0x164 -lbl_8051E78C = .data:0x8051E78C; // type:object size:0x34 +__vt__17dLytAutoCaption_c = .data:0x8051E628; // type:object size:0x44 +__vt__32sFStateID_c<17dLytAutoCaption_c> = .data:0x8051E78C; // type:object size:0x34 lbl_8051E7C0 = .data:0x8051E7C0; // type:object size:0x18 data:string lbl_8051E7D8 = .data:0x8051E7D8; // type:object size:0xC lbl_8051E7E4 = .data:0x8051E7E4; // type:object size:0x1C @@ -32328,8 +32328,8 @@ lbl_8051E828 = .data:0x8051E828; // type:object size:0x10 lbl_8051E838 = .data:0x8051E838; // type:object size:0x10 lbl_8051E848 = .data:0x8051E848; // type:object size:0x10 lbl_8051E858 = .data:0x8051E858; // type:object size:0x18 -lbl_8051E870 = .data:0x8051E870; // type:object size:0x164 -lbl_8051E9D4 = .data:0x8051E9D4; // type:object size:0x34 +__vt__17dLytAutoExplain_c = .data:0x8051E870; // type:object size:0x44 +__vt__32sFStateID_c<17dLytAutoExplain_c> = .data:0x8051E9D4; // type:object size:0x34 lbl_8051EA08 = .data:0x8051EA08; // type:object size:0xA0 data:4byte lbl_8051EAA8 = .data:0x8051EAA8; // type:object size:0x38 lbl_8051EAE0 = .data:0x8051EAE0; // type:object size:0x14 @@ -48878,16 +48878,16 @@ LytSimpleWindow__STATE_INVISIBLE = .bss:0x805AF100; // type:object size:0x40 dat LytSimpleWindow__STATE_IN = .bss:0x805AF140; // type:object size:0x40 data:4byte LytSimpleWindow__STATE_OUTPUT_TEXT = .bss:0x805AF180; // type:object size:0x40 data:4byte LytSimpleWindow__STATE_OUT = .bss:0x805AF1C0; // type:object size:0x30 data:4byte -lbl_805AF1F0 = .bss:0x805AF1F0; // type:object size:0x10 -LytAutoCaption__STATE_INVISIBLE = .bss:0x805AF200; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_IN = .bss:0x805AF240; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_OUTPUT_TEXT = .bss:0x805AF280; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_OUT = .bss:0x805AF2C0; // type:object size:0x30 data:4byte -lbl_805AF2F0 = .bss:0x805AF2F0; // type:object size:0x10 -LytAutoExplain__STATE_INVISIBLE = .bss:0x805AF300; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_IN = .bss:0x805AF340; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_OUTPUT_TEXT = .bss:0x805AF380; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_OUT = .bss:0x805AF3C0; // type:object size:0x30 data:4byte +lbl_805AF1F0 = .bss:0x805AF1F0; // type:object size:0xC +StateID_Invisible__17dLytAutoCaption_c = .bss:0x805AF200; // type:object size:0x30 data:4byte +StateID_In__17dLytAutoCaption_c = .bss:0x805AF240; // type:object size:0x30 data:4byte +StateID_OutputText__17dLytAutoCaption_c = .bss:0x805AF280; // type:object size:0x30 data:4byte +StateID_Out__17dLytAutoCaption_c = .bss:0x805AF2C0; // type:object size:0x30 data:4byte +lbl_805AF2F0 = .bss:0x805AF2F0; // type:object size:0xC +StateID_Invisible__17dLytAutoExplain_c = .bss:0x805AF300; // type:object size:0x30 data:4byte +StateID_In__17dLytAutoExplain_c = .bss:0x805AF340; // type:object size:0x30 data:4byte +StateID_OutputText__17dLytAutoExplain_c = .bss:0x805AF380; // type:object size:0x30 data:4byte +StateID_Out__17dLytAutoExplain_c = .bss:0x805AF3C0; // type:object size:0x30 data:4byte lbl_805AF3F0 = .bss:0x805AF3F0; // type:object size:0x10 StateID_RenderingWait__16dLytMapCapture_c = .bss:0x805AF400; // type:object size:0x40 data:4byte StateID_RenderingWaitStep2__16dLytMapCapture_c = .bss:0x805AF440; // type:object size:0x30 data:4byte diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index c68ad2f1..bb551637 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -45,7 +45,7 @@ public: u8 symbolToFontIdx(s32 s); void setStringArg(const wchar_t *arg, s32 index); - static s32 getNumLines(s32 arg); + static s32 getMaxNumLines(s32 arg); static void getTextCommand(wchar_t _0xe, const wchar_t *src, u8 *outCmdLen, s32 *outCmd, wchar_t **outEndPtr); static void process0xFCommand(wchar_t _0xf, const wchar_t *src, s32 *outCmd); @@ -68,6 +68,10 @@ public: s32 tickPauseFrame(); s32 tick0x830(); + s32 getNumLinesMaybe() const { + return mCommandInsert; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -121,8 +125,8 @@ private: /* 0x90D */ u8 field_0x90D; /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; - /* 0x914 */ f32 field_0x914[0x32]; - /* 0x9DC */ s32 mCommandInsert; + /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line + /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h new file mode 100644 index 00000000..d09c86fe --- /dev/null +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_CAPTION_H +#define D_LYT_AUTO_CAPTION_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoCaption_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoCaption_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoCaption_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoCaption_c, In); + STATE_FUNC_DECLARE(dLytAutoCaption_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoCaption_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[4]; + /* 0x54C */ dTextBox_c *mpTextboxes[2]; + /* 0x554 */ nw4r::lyt::Pane *mpPane; + /* 0x558 */ dTagProcessor_c *mpTagProcessor; + /* 0x55C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h new file mode 100644 index 00000000..e9e62e48 --- /dev/null +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_EXPLAIN_H +#define D_LYT_AUTO_EXPLAIN_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoExplain_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoExplain_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoExplain_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoExplain_c, In); + STATE_FUNC_DECLARE(dLytAutoExplain_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoExplain_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[3]; + /* 0x50C */ dTextBox_c *mpTextboxes[2]; + /* 0x514 */ nw4r::lyt::Pane *mpPane; + /* 0x518 */ dTagProcessor_c *mpTagProcessor; + /* 0x51C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h index 0a09b4e0..a2f9fe02 100644 --- a/include/d/lyt/d_lyt_common_a_btn.h +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -24,7 +24,7 @@ public: return mLyt.getName(); } - u8 isDoneOut() const { + bool isDoneOut() const { return mIsDoneOut; } diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index cfbd3396..134ceb75 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -44,6 +44,7 @@ public: // TODO } + s32 fn_800AF6B0(const wchar_t *, dTagProcessor_c *tagProcessor); void fn_800AF930(const wchar_t *); void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index cf65fb8e..d8f843e3 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -9,7 +9,7 @@ class dLytMsgWindowSubtype : public m2d::Base_c { public: /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} // vt 0x0C = m2d::Base_c::draw - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); /* vt 0x1C */ virtual void open(); @@ -18,9 +18,15 @@ public: /* vt 0x28 */ virtual bool isClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); - /* vt 0x34 */ virtual void vt_0x34(); - /* vt 0x38 */ virtual void vt_0x38(bool b); - /* vt 0x3C */ virtual u8 vt_0x3C() const; + /* vt 0x34 */ virtual bool vt_0x34() { + return true; + } + /* vt 0x38 */ virtual bool vt_0x38(bool b) { + return true; + } + /* vt 0x3C */ virtual bool vt_0x3C() const { + return true; + } /* vt 0x40 */ virtual bool vt_0x40() const; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index e7b16086..4a52f910 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -13,7 +13,8 @@ class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[3]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index b56499ae..795fdf97 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -13,7 +13,8 @@ class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[2]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/nw4r/lyt/lyt_textBox.h b/include/nw4r/lyt/lyt_textBox.h index 4dfd0549..f4d5bff9 100644 --- a/include/nw4r/lyt/lyt_textBox.h +++ b/include/nw4r/lyt/lyt_textBox.h @@ -77,6 +77,10 @@ public: mpTagProcessor = pTagProcessor; } + const wchar_t *GetString() const { + return mTextBuf; + } + virtual ~TextBox(); NW4R_UT_RTTI_DECL(TextBox); virtual void DrawSelf(const DrawInfo &drawInfo); // at 0x18 diff --git a/src/d/d_tag_processor.cpp b/src/d/d_tag_processor.cpp index 5d3fcd6f..cb7bf2e7 100644 --- a/src/d/d_tag_processor.cpp +++ b/src/d/d_tag_processor.cpp @@ -407,12 +407,12 @@ void dTagProcessor_c::eventFlowTextProcessingRelated( } } else { if (textBox != nullptr) { - if (c == 10) { + if (c == '\n') { *writePtr = c; src++; writePtr++; mCommandInsert++; - s32 i10 = getNumLines(field_0x90C); + s32 i10 = getMaxNumLines(field_0x90C); if (mCommandInsert % i10 == 0) { float1 = fn_800B8040(0, field_0x90C); float1 *= textBox->getMyScale(); @@ -628,11 +628,11 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContextGetSize(); nw4r::lyt::Size fontSize = field_0x004->GetFontSize(); - int i1 = getNumLines(field_0x90C); + int i1 = getMaxNumLines(field_0x90C); if (arg % i1 == 0 && field_0x90C != 31 && field_0x90C != 8) { int u = 0; int v = 0; - for (int i = arg; i < arg + getNumLines(field_0x90C) && i < 0x32; i++) { + for (int i = arg; i < arg + getMaxNumLines(field_0x90C) && i < 0x32; i++) { f32 f6 = getFloat(i); if (f6 > 0.0f) { v++; @@ -650,7 +650,7 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext