Some large functions in d_tag_processor (#86)

* d_tag_processor WIP

* Progress

* Unconst

* Fix switch command (thanks Roeming!)

* Match a random text related file instead

* More progress

* More progress

* No missing breaks

* Some repair

* Some repair and shuffling

* More repair

* a bit better

* a bit better 2

* what a switch order

* Closer unrolling

* Minor cleanup

* Fix accidental cases

* More fixes

* even better

* More fixes

* Down to regswaps

* Some renames

* Review feedback

* cleanup more sdata2 values and eventFlowTextProcessingRelated match

---------

Co-authored-by: elijah-thomas774 <elijahthomas774@gmail.com>
This commit is contained in:
robojumper
2024-11-06 23:19:40 +01:00
committed by GitHub
parent 25f6797ab8
commit d3d4bd253c
13 changed files with 1644 additions and 77 deletions
+18 -2
View File
@@ -192,9 +192,22 @@ d/lyt/d_window.cpp:
.data start:0x80510820 end:0x805108B0
.sdata2 start:0x805797F0 end:0x805797F8
d/d_text_writer.cpp:
d/d_textunk.cpp:
.text start:0x800B1890 end:0x800B20DC
.ctors start:0x804DB6D0 end:0x804DB6D4
.data start:0x805108C8 end:0x805108D8
.sdata start:0x805722D8 end:0x805722E0
.sbss start:0x805753B0 end:0x805753B8
.sdata2 start:0x805797F8 end:0x80579848
.bss start:0x805A6F70 end:0x805A7730
d/d_tag_processor.cpp:
.text start:0x800B35C0 end:0x800B9274
.ctors start:0x804DB6D4 end:0x804DB6D8
.rodata start:0x804E4C34 end:0x804E4C50
.data start:0x805108E8 end:0x805109A0
.sdata2 start:0x8057986C end:0x805798D0
.bss start:0x805A7730 end:0x805A78B8
toBeSorted/time_area_mgr.cpp:
.text start:0x800B9280 end:0x800BB2A0
@@ -347,8 +360,11 @@ d/lyt/d_lyt_msg_window_select_btn.cpp:
.text start:0x8011C8D0 end:0x80120988
.ctors start:0x804DB73C end:0x804DB740
d/lyt/d_lyt_msg_window_base.cpp:
.text start:0x80120A20 end:0x80120A98
d/lyt/d_lyt_msg_window_talk.cpp:
.text start:0x80120A20 end:0x801223C8
.text start:0x80120AA0 end:0x801223C8
.ctors start:0x804DB740 end:0x804DB744
d/lyt/d_lyt_msg_window_link.cpp:
+72 -72
View File
@@ -3783,7 +3783,7 @@ syncAnmFrame__Q23d2d14AnmGroupBase_cFv = .text:0x800AC910; // type:function size
setForward__Q23d2d14AnmGroupBase_cFv = .text:0x800AC920; // type:function size:0x14
setBackward__Q23d2d14AnmGroupBase_cFv = .text:0x800AC940; // type:function size:0x14
fn_800AC960 = .text:0x800AC960; // type:function size:0x4C
init__Q23d2d9AnmGroupsFPQ23d2d10AnmGroup_cPQ23d2d15LytBrlanMappingUlPQ23m2d10ResAccIf_cPQ23d2d8Layout_c = .text:0x800AC9B0; // type:function size:0x80
init__Q23d2d9AnmGroupsFPQ23d2d10AnmGroup_cPCQ23d2d15LytBrlanMappingUlPQ23m2d10ResAccIf_cPQ23d2d8Layout_c = .text:0x800AC9B0; // type:function size:0x80
remove__Q23d2d9AnmGroupsFv = .text:0x800ACA30; // type:function size:0x64
draw__Q23d2d9LytBase_cFv = .text:0x800ACAA0; // type:function size:0x18
fn_800ACAC0 = .text:0x800ACAC0; // type:function size:0x5C
@@ -3868,25 +3868,25 @@ UpdateSize__9dWindow_cFP10dTextBox_cf = .text:0x800B1670; // type:function size:
GetRuntimeTypeInfo__Q34nw4r3lyt6WindowCFv = .text:0x800B17B0; // type:function size:0x8 scope:weak
__dt__9dWindow_cFv = .text:0x800B17C0; // type:function size:0x58
__dt__Q34nw4r3lyt19ArcResourceAccessorFv = .text:0x800B1820; // type:function size:0x6C scope:weak
fn_800B1890 = .text:0x800B1890; // type:function size:0x40
fn_800B18D0 = .text:0x800B18D0; // type:function size:0x4D4
fn_800B1DB0 = .text:0x800B1DB0; // type:function size:0x15C
fn_800B1F10 = .text:0x800B1F10; // type:function size:0x34
fn_800B1F50 = .text:0x800B1F50; // type:function size:0x8
fn_800B1F60 = .text:0x800B1F60; // type:function size:0x4
fn_800B1F70 = .text:0x800B1F70; // type:function size:0x4C
fn_800B1FC0 = .text:0x800B1FC0; // type:function size:0x8
fn_800B1FD0 = .text:0x800B1FD0; // type:function size:0x8
fn_800B1FE0 = .text:0x800B1FE0; // type:function size:0x8
fn_800B1FF0 = .text:0x800B1FF0; // type:function size:0x8
fn_800B2000 = .text:0x800B2000; // type:function size:0x8
fn_800B2010 = .text:0x800B2010; // type:function size:0x8
fn_800B2020 = .text:0x800B2020; // type:function size:0x8
fn_800B2030 = .text:0x800B2030; // type:function size:0x8
fn_800B2040 = .text:0x800B2040; // type:function size:0x8
fn_800B2050 = .text:0x800B2050; // type:function size:0x40
fn_800B2090 = .text:0x800B2090; // type:function size:0x40
fn_800B20D0 = .text:0x800B20D0; // type:function size:0xC
__dt__12UnkTextThingFv = .text:0x800B1890; // type:function size:0x40
__ct__12UnkTextThingFv = .text:0x800B18D0; // type:function size:0x4D4
destroy__12UnkTextThingFv = .text:0x800B1DB0; // type:function size:0x15C
fn_800B1F10__12UnkTextThingFv = .text:0x800B1F10; // type:function size:0x34
allocUnk__12UnkTextThingFUli = .text:0x800B1F50; // type:function size:0x8
destroyUnk__12UnkTextThingFPv = .text:0x800B1F60; // type:function size:0x4
fn_800B1F70__12UnkTextThingFv = .text:0x800B1F70; // type:function size:0x4C
fn_800B1FC0__12UnkTextThingFv = .text:0x800B1FC0; // type:function size:0x8
fn_800B1FD0__12UnkTextThingFv = .text:0x800B1FD0; // type:function size:0x8
fn_800B1FE0__12UnkTextThingFv = .text:0x800B1FE0; // type:function size:0x8
fn_800B1FF0__12UnkTextThingFv = .text:0x800B1FF0; // type:function size:0x8
fn_800B2000__12UnkTextThingFv = .text:0x800B2000; // type:function size:0x8
fn_800B2010__12UnkTextThingFv = .text:0x800B2010; // type:function size:0x8
fn_800B2020__12UnkTextThingFv = .text:0x800B2020; // type:function size:0x8
fn_800B2030__12UnkTextThingFv = .text:0x800B2030; // type:function size:0x8
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
fn_800B2130 = .text:0x800B2130; // type:function size:0x370
textAdvancingRelated = .text:0x800B24A0; // type:function size:0x5FC
@@ -3900,69 +3900,69 @@ fn_800B32E0 = .text:0x800B32E0; // type:function size:0x84
drawTextBlur = .text:0x800B3370; // type:function size:0x138
fn_800B34B0 = .text:0x800B34B0; // type:function size:0x40
fn_800B34F0 = .text:0x800B34F0; // type:function size:0xD0
TextManager__ctor = .text:0x800B35C0; // type:function size:0x260
fn_800B3820 = .text:0x800B3820; // type:function size:0x58
__ct__15dTagProcessor_cFv = .text:0x800B35C0; // type:function size:0x260
__dt__15dTagProcessor_cFv = .text:0x800B3820; // type:function size:0x58
fn_800B3880 = .text:0x800B3880; // type:function size:0x8C
eventFlowTextProcessingRelated = .text:0x800B3910; // type:function size:0x980
eventFlowTextProcessingRelated__15dTagProcessor_cFP10dTextBox_cPCwPwUlPUl = .text:0x800B3910; // type:function size:0x980
fn_800B4290 = .text:0x800B4290; // type:function size:0x5AC
TextManager__Process = .text:0x800B4840; // type:function size:0x10
TextManager__CalcRect = .text:0x800B4850; // type:function size:0x4
TextManager__ProcessTags = .text:0x800B4860; // type:function size:0x78C
fn_800B4FF0 = .text:0x800B4FF0; // type:function size:0x274
TextManager__setColor = .text:0x800B5270; // type:function size:0x214
TextManager__setScale = .text:0x800B5490; // type:function size:0x5C
TextManager__setFramesLeftOnPause = .text:0x800B54F0; // type:function size:0xC
fn_800B5500 = .text:0x800B5500; // type:function size:0x18
fn_800B5520 = .text:0x800B5520; // type:function size:0x14
fn_800B5540 = .text:0x800B5540; // type:function size:0x28
fn_800B5570 = .text:0x800B5570; // type:function size:0x110
fn_800B5680 = .text:0x800B5680; // type:function size:0x1DC
fn_800B5860 = .text:0x800B5860; // type:function size:0x1C0
fn_800B5A20 = .text:0x800B5A20; // type:function size:0x3AC
fn_800B5DD0 = .text:0x800B5DD0; // type:function size:0x1FC
fn_800B5FD0 = .text:0x800B5FD0; // type:function size:0x10C
fn_800B60E0 = .text:0x800B60E0; // type:function size:0x24
fn_800B6110 = .text:0x800B6110; // type:function size:0x24
fn_800B6140 = .text:0x800B6140; // type:function size:0x14
fn_800B6160 = .text:0x800B6160; // type:function size:0x8
fn_800B6170 = .text:0x800B6170; // type:function size:0x14
fn_800B6190 = .text:0x800B6190; // type:function size:0x1C
fn_800B61B0 = .text:0x800B61B0; // type:function size:0x18
fn_800B61D0 = .text:0x800B61D0; // type:function size:0x64
TextManager__changeScale = .text:0x800B6240; // type:function size:0xDC
fn_800B6320 = .text:0x800B6320; // type:function size:0x12C
fn_800B6450 = .text:0x800B6450; // type:function size:0x340
Process__15dTagProcessor_cFUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4840; // type:function size:0x10
CalcRect__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4850; // type:function size:0x4
ProcessTags__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4860; // type:function size:0x78C
fn_800B4FF0__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B4FF0; // type:function size:0x274
setColor__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B5270; // type:function size:0x214
setScale__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B5490; // type:function size:0x5C
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
writeHeroname__15dTagProcessor_cFPwPll = .text:0x800B5570; // type:function size:0x110
writeItem__15dTagProcessor_cFPwPwPll = .text:0x800B5680; // type:function size:0x1DC
writeStringArg__15dTagProcessor_cFPwPwPll = .text:0x800B5860; // type:function size:0x1C0
writeNumericArg__15dTagProcessor_cFPwPwPll = .text:0x800B5A20; // type:function size:0x3AC
fn_800B5DD0__15dTagProcessor_cFPwPwPll = .text:0x800B5DD0; // type:function size:0x1FC
fn_800B5FD0__15dTagProcessor_cFUlPwPl = .text:0x800B5FD0; // type:function size:0x10C
fn_800B60E0__15dTagProcessor_cFUcPw = .text:0x800B60E0; // type:function size:0x24
fn_800B6110__15dTagProcessor_cFUcPw = .text:0x800B6110; // type:function size:0x24
fn_800B6140__15dTagProcessor_cFUcPw = .text:0x800B6140; // type:function size:0x14
playSound__15dTagProcessor_cFUcPw = .text:0x800B6160; // type:function size:0x8
fn_800B6170__15dTagProcessor_cFUcPw = .text:0x800B6170; // type:function size:0x14
fn_800B6190__15dTagProcessor_cFUcPw = .text:0x800B6190; // type:function size:0x1C
fn_800B61B0__15dTagProcessor_cFUcPw = .text:0x800B61B0; // type:function size:0x18
fn_800B61D0__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B61D0; // type:function size:0x64
changeScale__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>b = .text:0x800B6240; // type:function size:0xDC
writeIcon__15dTagProcessor_cFP10dTextBox_cPwf = .text:0x800B6320; // type:function size:0x12C
fn_800B6450__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw = .text:0x800B6450; // type:function size:0x340
fn_800B6790 = .text:0x800B6790; // type:function size:0x750
fn_800B6EE0 = .text:0x800B6EE0; // type:function size:0x1E8
makeSpaceForIconMaybe__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>Pw = .text:0x800B6EE0; // type:function size:0x1E8
fn_800B70D0 = .text:0x800B70D0; // type:function size:0x3A4
somethingWithScrapperAndMusic = .text:0x800B7480; // type:function size:0xB8
fn_800B7540 = .text:0x800B7540; // type:function size:0x250
fn_800B7790 = .text:0x800B7790; // type:function size:0xD8
symbolToFontIdx = .text:0x800B7870; // type:function size:0x10
restoreColor__15dTagProcessor_cFPQ34nw4r2ut15PrintContext<w>Uc = .text:0x800B7540; // type:function size:0x250
writeTextNormal__15dTagProcessor_cFPCwPwPlUcl = .text:0x800B7790; // type:function size:0xD8
symbolToFontIdx__15dTagProcessor_cFl = .text:0x800B7870; // type:function size:0x10
fn_800B7880 = .text:0x800B7880; // type:function size:0x210
fn_800B7A90 = .text:0x800B7A90; // type:function size:0x9C
fn_800B7B30 = .text:0x800B7B30; // type:function size:0x46C
TextManager__setStringArg = .text:0x800B7FA0; // type:function size:0xA0
fn_800B8040 = .text:0x800B8040; // type:function size:0x1F0
setStringArg__15dTagProcessor_cFPCwl = .text:0x800B7FA0; // type:function size:0xA0
fn_800B8040__15dTagProcessor_cFScUl = .text:0x800B8040; // type:function size:0x1F0
fn_800B8230 = .text:0x800B8230; // type:function size:0x10C
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
fn_800B8850 = .text:0x800B8850; // type:function size:0x38
TextManager__getTextCommands = .text:0x800B8890; // type:function size:0x38
TextManager__process0xFCommand = .text:0x800B88D0; // type:function size:0xC
fn_800B88E0 = .text:0x800B88E0; // type:function size:0x30
fn_800B8910 = .text:0x800B8910; // type:function size:0x1C
fn_800B8930 = .text:0x800B8930; // type:function size:0x30
fn_800B8960 = .text:0x800B8960; // type:function size:0xD8
fn_800B8A40 = .text:0x800B8A40; // type:function size:0x10
TextManager__setNumericArg0 = .text:0x800B8A50; // type:function size:0xC
TextManager__setNumericArgs = .text:0x800B8A60; // type:function size:0xDC
getNumLines__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
resetSomething__15dTagProcessor_cFv = .text:0x800B8910; // type:function size:0x1C
tickPauseFrame__15dTagProcessor_cFv = .text:0x800B8930; // type:function size:0x30
resetSomeFloats__15dTagProcessor_cFv = .text:0x800B8960; // type:function size:0xD8
getFloat__15dTagProcessor_cFl = .text:0x800B8A40; // type:function size:0x10
setNumericArg0__15dTagProcessor_cFl = .text:0x800B8A50; // type:function size:0xC
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
TextManager__sinit = .text:0x800B8C20; // type:function size:0x654
__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
__dt__19dTimeAreaMgrProcB_cFv = .text:0x800B93D0; // type:function size:0x58
@@ -30989,12 +30989,12 @@ lbl_8051078C = .data:0x8051078C; // type:object size:0xC
lbl_80510798 = .data:0x80510798; // type:object size:0x88
__vt__9dWindow_c = .data:0x80510820; // type:object size:0x8C
__vt__Q23d2d10ResAccIf_c = .data:0x805108B0; // type:object size:0x18
lbl_805108C8 = .data:0x805108C8; // type:object size:0x10
__vt__12UnkTextThing = .data:0x805108C8; // type:object size:0xC
lbl_805108D8 = .data:0x805108D8; // type:object size:0x10
lbl_805108E8 = .data:0x805108E8; // type:object size:0x10
lbl_805108F8 = .data:0x805108F8; // type:object size:0x14 data:string
jumptable_8051090C = .data:0x8051090C; // type:object size:0x80 scope:local
lbl_8051098C = .data:0x8051098C; // type:object size:0x14
__vt__15dTagProcessor_c = .data:0x8051098C; // type:object size:0x14
lbl_805109A0 = .data:0x805109A0; // type:object size:0x20
lbl_805109C0 = .data:0x805109C0; // type:object size:0x20
lbl_805109E0 = .data:0x805109E0; // type:object size:0x88
@@ -37965,7 +37965,7 @@ lbl_805722BC = .sdata:0x805722BC; // type:object size:0x4
lbl_805722C0 = .sdata:0x805722C0; // type:object size:0x4 data:wstring
lbl_805722C4 = .sdata:0x805722C4; // type:object size:0x8
lbl_805722CC = .sdata:0x805722CC; // type:object size:0xC
lbl_805722D8 = .sdata:0x805722D8; // type:object size:0x8
lbl_805722D8 = .sdata:0x805722D8; // type:object size:0x1
lbl_805722E0 = .sdata:0x805722E0; // type:object size:0x8
lbl_805722E8 = .sdata:0x805722E8; // type:object size:0x8
lbl_805722F0 = .sdata:0x805722F0; // type:object size:0x4 data:4byte
@@ -39932,7 +39932,7 @@ lbl_80575398 = .sbss:0x80575398; // type:object size:0x8 data:byte
SCRAPPER_PICKUP_TARGET = .sbss:0x805753A0; // type:object size:0x8 data:4byte
lbl_805753A8 = .sbss:0x805753A8; // type:object size:0x1 data:byte
lbl_805753AC = .sbss:0x805753AC; // type:object size:0x4 data:4byte
lbl_805753B0 = .sbss:0x805753B0; // type:object size:0x8 data:4byte
sInstance__12UnkTextThing = .sbss:0x805753B0; // type:object size:0x4 data:4byte
lbl_805753B8 = .sbss:0x805753B8; // type:object size:0x1 data:byte
lbl_805753BC = .sbss:0x805753BC; // type:object size:0x4 data:4byte
sInstance__14dTimeAreaMgr_c = .sbss:0x805753C0; // type:object size:0x4 data:4byte
@@ -48338,7 +48338,7 @@ lbl_805A6340 = .bss:0x805A6340; // type:object size:0x30 data:4byte
eventFlowTextStringMaybe1 = .bss:0x805A6370; // type:object size:0x400
eventFlowTextStringMaybe2 = .bss:0x805A6770; // type:object size:0x400
eventFlowTextStringMaybe3 = .bss:0x805A6B70; // type:object size:0x400
eventFlowTextStringMaybe4 = .bss:0x805A6F70; // type:object size:0x7C0
textThing = .bss:0x805A6F70; // type:object size:0x7C0
FontColors1 = .bss:0x805A7730; // type:object size:0xC4 data:byte
FontColors2 = .bss:0x805A77F4; // type:object size:0xC4 data:byte
lbl_805A78B8 = .bss:0x805A78B8; // type:object size:0xC
+2
View File
@@ -365,6 +365,8 @@ config.libs = [
Object(NonMatching, "d/lyt/d2d.cpp"),
Object(NonMatching, "d/lyt/d_textbox.cpp"),
Object(Matching, "d/lyt/d_window.cpp"),
Object(Matching, "d/d_textunk.cpp"),
Object(NonMatching, "d/d_tag_processor.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_unk.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_a_btn.cpp"),
+148
View File
@@ -0,0 +1,148 @@
#ifndef D_TAG_PROCESSOR_H
#define D_TAG_PROCESSOR_H
#include "d/lyt/d_textbox.h"
#include "nw4r/ut/ut_TagProcessorBase.h"
#include "nw4r/ut/ut_TextWriterBase.h"
// inofficial name
// size: 0xEF4
class dTagProcessor_c : public nw4r::ut::TagProcessorBase<wchar_t> {
public:
dTagProcessor_c();
virtual ~dTagProcessor_c();
void
eventFlowTextProcessingRelated(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen);
virtual nw4r::ut::Operation Process(u16 ch, nw4r::ut::PrintContext<wchar_t> *ctx) override;
virtual nw4r::ut::Operation CalcRect(nw4r::ut::Rect *rect, u16 ch, nw4r::ut::PrintContext<wchar_t> *ctx) override;
nw4r::ut::Operation ProcessTags(nw4r::ut::Rect *rect, u16 ch, nw4r::ut::PrintContext<wchar_t> *ctx);
void changeScale(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, bool);
wchar_t *writeItem(wchar_t *dest, wchar_t *src, s32 *, s32);
wchar_t *writeStringArg(wchar_t *dest, wchar_t *src, s32 *, s32);
wchar_t *writeNumericArg(wchar_t *dest, wchar_t *src, s32 *, s32);
void fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
void fn_800B6450(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
void makeSpaceForIconMaybe(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, wchar_t *ptr);
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 fn_800B60E0(u8 cmdLen, wchar_t *ptr);
void fn_800B6110(u8 cmdLen, wchar_t *ptr);
void fn_800B6140(u8 cmdLen, wchar_t *ptr);
void playSound(u8 cmdLen, wchar_t *ptr);
void fn_800B6170(u8 cmdLen, wchar_t *ptr);
void fn_800B6190(u8 cmdLen, wchar_t *ptr);
void fn_800B61B0(u8 cmdLen, wchar_t *ptr);
void setColor(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
void restoreColor(nw4r::ut::PrintContext<wchar_t> *ctx, u8 windowType);
void setScale(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr);
u8 symbolToFontIdx(s32 s);
void setStringArg(const wchar_t *arg, s32 index);
static s32 getNumLines(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);
static f32 fn_800B8040(s8, u32);
wchar_t *fn_800B5FD0(u32, wchar_t *, s32 *);
wchar_t *writeTextNormal(const wchar_t *src, wchar_t *dest, s32 *, u8 cmdLen, s32);
wchar_t *writeHeroname(wchar_t *dest, s32 *, s32);
wchar_t *fn_800B5DD0(wchar_t *dest, wchar_t *src, s32 *, s32);
void fn_800B5520(wchar_t *src);
void writeIcon(dTextBox_c *textBox, wchar_t *cmd, f32);
char fn_800B7880(u32);
void fn_800B70D0(nw4r::ut::TextWriterBase<wchar_t> *, nw4r::ut::PrintContext<wchar_t> *ctx, u16 c, s32);
void resetSomething();
void resetSomeFloats();
void setNumericArg0(s32 arg);
void setNumericArgs(const s32 *args, s32 numArgs);
f32 getFloat(s32 i);
s32 tickPauseFrame();
s32 tick0x830();
private:
/* 0x004 */ dTextBox_c *field_0x004;
/* 0x008 */ wchar_t field_0x008[4][256];
/* 0x808 */ wchar_t field_0x808[4];
/* 0x810 */ f32 field_0x810;
/* 0x814 */ f32 field_0x814;
/* 0x818 */ f32 field_0x818;
/* 0x81C */ s32 field_0x81C;
/* 0x820 */ s32 field_0x820;
/* 0x824 */ s32 field_0x824;
/* 0x828 */ s32 field_0x828;
/* 0x82C */ s32 field_0x82C;
/* 0x830 */ s32 field_0x830;
/* 0x834 */ s32 mPauseFramesLeft;
/* 0x838 */ s32 field_0x838;
/* 0x83C */ s32 field_0x83C;
/* 0x840 */ s32 field_0x840;
/* 0x844 */ s32 field_0x844;
/* 0x848 */ s32 field_0x848;
/* 0x84C */ s32 field_0x84C;
/* 0x850 */ s32 field_0x850;
/* 0x854 */ s32 field_0x854;
/* 0x858 */ s32 field_0x858;
/* 0x85C */ s32 field_0x85C;
/* 0x860 */ s32 field_0x860;
/* 0x864 */ s32 field_0x864;
/* 0x868 */ s32 field_0x868;
/* 0x86C */ s32 field_0x86C;
/* 0x870 */ s32 field_0x870;
/* 0x874 */ s32 field_0x874;
/* 0x878 */ s32 field_0x878;
/* 0x87C */ s32 field_0x87C;
/* 0x880 */ s32 field_0x880;
/* 0x884 */ s32 field_0x884;
/* 0x888 */ s32 field_0x888;
/* 0x88C */ s32 field_0x88C;
/* 0x890 */ s32 field_0x890;
/* 0x894 */ s32 field_0x894;
/* 0x898 */ s32 field_0x898;
/* 0x89C */ s32 mNumericArgs[10];
/* 0x8C4 */ s32 mNumericArgsCopy[10];
/* 0x8EC */ s32 field_0x8EC;
/* 0x8EC */ s32 field_0x8F0;
/* 0x8F4 */ s32 field_0x8F4;
/* 0x8F8 */ s32 field_0x8F8;
/* 0x8FC */ s32 field_0x8FC;
/* 0x900 */ s32 field_0x900;
/* 0x904 */ f32 field_0x904;
/* 0x908 */ f32 field_0x908;
/* 0x90C */ u8 field_0x90C;
/* 0x90D */ u8 field_0x90D;
/* 0x90E */ u8 field_0x90E;
/* 0x90F */ u8 field_0x90F[4];
/* 0x914 */ f32 field_0x914[0x32];
/* 0x9DC */ s32 mCommandInsert;
/* 0x9E0 */ wchar_t mStringArgs[8][64];
/* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0];
/* 0xEE0 */ u8 field_0xEE0;
/* 0xEE1 */ u8 field_0xEE1;
/* 0xEE2 */ u8 field_0xEE2;
/* 0xEE3 */ u8 field_0xEE3;
/* 0xEE4 */ u8 field_0xEE4;
/* 0xEE5 */ u8 field_0xEE5;
/* 0xEE6 */ u8 field_0xEE6;
/* 0xEE7 */ u8 field_0xEE7;
/* 0xEE8 */ u8 field_0xEE8;
/* 0xEE9 */ u8 field_0xEE9;
/* 0xEEA */ u8 field_0xEEA;
/* 0xEEB */ u8 field_0xEEB;
/* 0xEEC */ u8 field_0xEEC;
/* 0xEED */ u8 field_0xEED;
/* 0xEEE */ u8 field_0xEEE;
/* 0xEEF */ u8 field_0xEEF;
/* 0xEF0 */ u8 field_0xEF0;
/* 0xEF1 */ u8 field_0xEF1;
};
#endif
+118
View File
@@ -0,0 +1,118 @@
#ifndef D_TEXTUNK_H
#define D_TEXTUNK_H
#include "common.h"
#include "libms/flowfile.h"
#include "libms/msgfile.h"
#include "nw4r/ut/ut_Color.h"
#include "sized_string.h"
class UnkTextThing {
public:
UnkTextThing();
virtual ~UnkTextThing() {}
void destroy();
inline static f32 getField0x758() {
if (sInstance != nullptr) {
return sInstance->field_0x758;
}
return 0.0f;
}
inline static f32 getField0x768() {
if (sInstance != nullptr) {
return sInstance->field_0x768;
}
return 0.0f;
}
inline static f32 getField0x76C() {
if (sInstance != nullptr) {
return sInstance->field_0x76C;
}
return 0.0f;
}
inline static f32 getFn800B1F70() {
if (sInstance != nullptr) {
return sInstance->fn_800B1F70();
}
return 1.0f;
}
inline static f32 getFn800B1F10() {
return sInstance->fn_800B1F10();
}
private:
static UnkTextThing *sInstance;
void *allocUnk(size_t size, int align);
void destroyUnk(void *thing);
void destroyFlow(MsbfInfo *flow);
void destroyMsg(MsbtInfo *msg);
f32 fn_800B1F10();
f32 fn_800B1F70();
f32 fn_800B1FC0();
f32 fn_800B1FD0();
f32 fn_800B1FE0();
f32 fn_800B1FF0();
f32 fn_800B2000();
f32 fn_800B2010();
f32 fn_800B2020();
f32 fn_800B2030();
f32 fn_800B2040();
/* 0x004 */ SizedString<0x80> field_0x004;
/* 0x084 */ SizedString<0x80> field_0x084;
/* 0x104 */ SizedString<0x80> field_0x104;
/* 0x184 */ void *field_buf0[82];
/* 0x2CC */ void *field_buf4[23];
/* 0x328 */ void *field_buf1[80];
/* 0x468 */ MsbtInfo *field_buf2[82];
/* 0x5B0 */ MsbtInfo *field_buf5[23];
/* 0x60C */ MsbfInfo *field_buf3[80];
/* 0x74C */ void *field_0x74C;
/* 0x750 */ void *field_0x750;
/* 0x754 */ f32 field_0x754;
/* 0x758 */ f32 field_0x758;
/* 0x75C */ f32 field_0x75C;
/* 0x760 */ f32 field_0x760;
/* 0x764 */ f32 field_0x764;
/* 0x768 */ f32 field_0x768;
/* 0x76C */ f32 field_0x76C;
/* 0x770 */ f32 field_0x770;
/* 0x774 */ f32 field_0x774;
/* 0x778 */ f32 field_0x778;
/* 0x77C */ f32 field_0x77C;
/* 0x780 */ f32 field_0x780;
/* 0x784 */ f32 field_0x784;
/* 0x788 */ f32 field_0x788;
/* 0x78C */ f32 field_0x78C;
/* 0x790 */ f32 field_0x790;
/* 0x794 */ s16 field_0x794;
/* 0x796 */ s16 field_0x796;
/* 0x798 */ UNKWORD field_0x798;
/* 0x79C */ UNKWORD field_0x79C;
/* 0x7A0 */ UNKWORD field_0x7A0;
/* 0x7A4 */ s16 field_0x7A4;
/* 0x7A6 */ s16 field_0x7A6;
/* 0x7A8 */ s16 field_0x7A8;
/* 0x7AA */ s16 field_0x7AA;
/* 0x7AC */ s16 field_0x7AC;
/* 0x7AE */ s16 field_0x7AE;
/* 0x7B0 */ s16 field_0x7B0;
/* 0x7B2 */ bool field_0x7B2;
/* 0x7B3 */ bool field_0x7B3;
/* 0x7B4 */ bool field_0x7B4;
/* 0x7B5 */ bool field_0x7B5;
/* 0x7B6 */ bool field_0x7B6;
/* 0x7B6 */ bool field_0x7B7;
/* 0x7B8 */ nw4r::ut::Color field_0x7B8;
/* 0x7BC */ nw4r::ut::Color field_0x7BC;
};
#endif
+13 -3
View File
@@ -27,6 +27,14 @@ public:
nw4r::lyt::TextBox::SetScale(value);
}
void set0x1F8(u8 val) {
field_0x1F8 = val;
}
f32 getMyScale() const {
return mScale;
}
static inline f32 GetTranslateX1() {
if (lbl_805753B0 != nullptr) {
return GetTranslateX1_();
@@ -46,11 +54,13 @@ public:
private:
void MySetScale(const nw4r::math::VEC2 &value);
d2d::LytBase_c *mpLytBase;
u8 field_0x108[0x118 - 0x108];
/* 0x104 */ d2d::LytBase_c *mpLytBase;
/* 0x108 */ u8 field_0x108[0x118 - 0x108];
/* 0x118 */ nw4r::math::VEC2 mTextScale;
/* 0x120 */ f32 mScale;
u8 field_0x124[0x204 - 0x124];
/* 0x124 */ u8 field_0x124[0x1F8 - 0x124];
/* 0x1F8 */ u8 field_0x1F8;
/* 0x1F9 */ u8 field_0x1F9[0x204 - 0x1F9];
};
#endif
+5
View File
@@ -1,3 +1,6 @@
#ifndef LIBMS_COMMONLIB_H
#define LIBMS_COMMONLIB_H
#include "common.h"
#ifdef __cplusplus
@@ -49,3 +52,5 @@ int LMSi_GetHashTableIndexFromLabel(const char *label, int tableSize);
#ifdef __cplusplus
}
#endif
#endif
+5
View File
@@ -1,3 +1,6 @@
#ifndef LIBMS_FLOWFILE_H
#define LIBMS_FLOWFILE_H
#include "common.h"
#ifdef __cplusplus
@@ -28,3 +31,5 @@ const unsigned short *LMS_GetBranchPoints(struct MsbfInfo *info, int index);
#ifdef __cplusplus
}
#endif
#endif
+5
View File
@@ -1,3 +1,6 @@
#ifndef LIBMS_LIBMS_H
#define LIBMS_LIBMS_H
#include "common.h"
#ifdef __cplusplus
@@ -15,3 +18,5 @@ void LMSi_MemCopy(char *p1, const char *p2, int n);
#ifdef __cplusplus
}
#endif
#endif
+5
View File
@@ -1,3 +1,6 @@
#ifndef LIBMS_MSGFILE_H
#define LIBMS_MSGFILE_H
#include "common.h"
#ifdef __cplusplus
@@ -22,3 +25,5 @@ struct MsbtAttrInfo *LMS_GetAttribute(struct MsbtInfo *info, int index);
#ifdef __cplusplus
}
#endif
#endif
+4
View File
@@ -84,6 +84,10 @@ public:
mAlpha = value;
}
u8 GetGlobalAlpha() const {
return mGlbAlpha;
}
const Size &GetSize() const {
return mSize;
}
File diff suppressed because it is too large Load Diff
+188
View File
@@ -0,0 +1,188 @@
#include "d/d_textunk.h"
#include "common.h"
#include "nw4r/ut/ut_Color.h"
UnkTextThing textThing;
UnkTextThing *UnkTextThing::sInstance;
// UnkTextThing::~UnkTextThing() {}
UnkTextThing::UnkTextThing() {
sInstance = this;
field_0x754 = 0.0f;
field_0x758 = 12.0f;
field_0x75C = 0.04f;
field_0x760 = 0.22f;
field_0x764 = 42.0f;
field_0x768 = 0.8f;
field_0x76C = 0.3f;
field_0x7B3 = false;
field_0x798 = 0;
field_0x79C = 0;
field_0x7A0 = 0;
field_0x770 = 80.0f;
field_0x774 = 30.0f;
field_0x796 = 3;
field_0x778 = 10.0f;
field_0x780 = 8.0f;
field_0x77C = 8.0f;
field_0x784 = 6.0f;
field_0x7A4 = 0xB6;
field_0x7A6 = 0x16C;
for (int i = 0; i < 82; i++) {
field_buf0[i] = 0;
field_buf2[i] = 0;
}
for (int i = 0; i < 23; i++) {
field_buf4[i] = 0;
field_buf5[i] = 0;
}
for (int i = 0; i < 80; i++) {
field_buf1[i] = 0;
field_buf3[i] = 0;
}
field_0x74C = 0;
field_0x750 = 0;
field_0x7B4 = false;
field_0x7B5 = false;
field_0x004 = "";
field_0x084 = "";
field_0x104 = "";
field_0x7B6 = 0;
field_0x7A8 = 0;
field_0x788 = 0.45;
field_0x78C = -5.0f;
field_0x7AE = 4;
field_0x7B7 = 0;
field_0x7AA = 5;
field_0x7AC = 15;
field_0x7B0 = 0;
field_0x7B2 = false;
// Weird init order
field_0x7B8.a = 0;
field_0x7B8.b = 0;
field_0x7B8.g = 0;
field_0x7B8.r = 0;
field_0x7BC.a = 0;
field_0x7BC.b = 0;
field_0x7BC.g = 0;
field_0x7BC.r = 0;
field_0x790 = -1.0f;
field_0x794 = 100.0f;
}
void UnkTextThing::destroy() {
for (int i = 0; i < 82; i++) {
if (field_buf0[i] != nullptr) {
destroyUnk(field_buf0[i]);
field_buf0[i] = nullptr;
}
if (field_buf2[i] != nullptr) {
destroyMsg(field_buf2[i]);
field_buf2[i] = nullptr;
}
}
for (int i = 0; i < 23; i++) {
if (field_buf4[i] != nullptr) {
destroyUnk(field_buf4[i]);
field_buf4[i] = nullptr;
}
if (field_buf5[i] != nullptr) {
destroyMsg(field_buf5[i]);
field_buf5[i] = nullptr;
}
}
for (int i = 0; i < 80; i++) {
if (field_buf1[i] != nullptr) {
destroyUnk(field_buf1[i]);
field_buf1[i] = nullptr;
}
if (field_buf3[i] != nullptr) {
destroyFlow(field_buf3[i]);
field_buf3[i] = nullptr;
}
}
if (field_0x74C != nullptr) {
destroyUnk(field_0x74C);
field_0x74C = nullptr;
}
if (field_0x750 != nullptr) {
destroyUnk(field_0x750);
field_0x750 = nullptr;
}
}
f32 UnkTextThing::fn_800B1F10() {
return field_0x794 / 100.0f;
}
void *UnkTextThing::allocUnk(size_t size, int align) {
return nullptr;
}
void UnkTextThing::destroyUnk(void *_thing) {}
f32 UnkTextThing::fn_800B1F70() {
f32 v = fn_800B1FC0();
v *= fn_800B1FE0();
return v;
}
f32 UnkTextThing::fn_800B1FC0() {
return 1.0f;
}
f32 UnkTextThing::fn_800B1FD0() {
return 0.9f;
}
f32 UnkTextThing::fn_800B1FE0() {
return 1.0f;
}
f32 UnkTextThing::fn_800B1FF0() {
return 0.0f;
}
f32 UnkTextThing::fn_800B2000() {
return 0.0f;
}
f32 UnkTextThing::fn_800B2010() {
return -1.0f;
}
f32 UnkTextThing::fn_800B2020() {
return 0.0f;
}
f32 UnkTextThing::fn_800B2030() {
return 0.0f;
}
f32 UnkTextThing::fn_800B2040() {
return 0.0f;
}
void UnkTextThing::destroyMsg(MsbtInfo *msg) {
field_0x7B6 = true;
LMS_CloseMessage(msg);
field_0x7B6 = false;
}
void UnkTextThing::destroyFlow(MsbfInfo *flow) {
field_0x7B6 = true;
LMS_CloseFlow(flow);
field_0x7B6 = false;
}