diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index b8695096..1dbe7814 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -409,7 +409,11 @@ d/lyt/meter/d_lyt_meter_cross_btn.cpp: d/lyt/meter/d_lyt_meter_dowsing.cpp: .text start:0x800FAFD0 end:0x801003E8 .ctors start:0x804DB710 end:0x804DB714 + .rodata start:0x804E6568 end:0x804E6928 .data start:0x80517CE0 end:0x80518A60 + .sdata start:0x805724A8 end:0x805724F0 + .sdata2 start:0x80579C38 end:0x80579C48 + .bss start:0x805ABE90 end:0x805AC550 d/lyt/meter/d_lyt_meter_rupy.cpp: .text start:0x801003F0 end:0x801026A8 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 499d9650..8963f97a 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -4742,7 +4742,7 @@ __dt__15dLytBirdGauge_cFv = .text:0x800D5010; // type:function size:0x164 __dt__15dLytBossGauge_cFv = .text:0x800D5180; // type:function size:0x108 fn_800D5290 = .text:0x800D5290; // type:function size:0xB4 fn_800D5350 = .text:0x800D5350; // type:function size:0x30 -fn_800D5380 = .text:0x800D5380; // type:function size:0x44 +fn_800D5380__11dLytMeter_cFUc = .text:0x800D5380; // type:function size:0x44 fn_800D53D0 = .text:0x800D53D0; // type:function size:0x50 fn_800D5420 = .text:0x800D5420; // type:function size:0x114 isSilentRealm__11dLytMeter_cFv = .text:0x800D5540; // type:function size:0x4C @@ -6091,115 +6091,115 @@ __dt__39sFStateID_c<24dLytMeterCrossBtnParts_c>Fv = .text:0x800FADF0; // type:fu __dt__34sFStateID_c<19dLytMeterCrossBtn_c>Fv = .text:0x800FAE50; // type:function size:0x58 isSameName__34sFStateID_c<19dLytMeterCrossBtn_c>CFPCc = .text:0x800FAEB0; // type:function size:0x88 isSameName__39sFStateID_c<24dLytMeterCrossBtnParts_c>CFPCc = .text:0x800FAF40; // type:function size:0x88 -fn_800FAFD0 = .text:0x800FAFD0; // type:function size:0x4 -fn_800FAFE0 = .text:0x800FAFE0; // type:function size:0x8C -fn_800FB070 = .text:0x800FB070; // type:function size:0x4 -fn_800FB080 = .text:0x800FB080; // type:function size:0x4 -fn_800FB090 = .text:0x800FB090; // type:function size:0x9C -fn_800FB130 = .text:0x800FB130; // type:function size:0x4 -fn_800FB140 = .text:0x800FB140; // type:function size:0x4 -fn_800FB150 = .text:0x800FB150; // type:function size:0x98 -fn_800FB1F0 = .text:0x800FB1F0; // type:function size:0x4 -fn_800FB200 = .text:0x800FB200; // type:function size:0x4 -fn_800FB210 = .text:0x800FB210; // type:function size:0x84 -fn_800FB2A0 = .text:0x800FB2A0; // type:function size:0x4 -fn_800FB2B0 = .text:0x800FB2B0; // type:function size:0x20 -fn_800FB2D0 = .text:0x800FB2D0; // type:function size:0x10 -fn_800FB2E0 = .text:0x800FB2E0; // type:function size:0x20 -fn_800FB300 = .text:0x800FB300; // type:function size:0x4 -fn_800FB310 = .text:0x800FB310; // type:function size:0x8C -fn_800FB3A0 = .text:0x800FB3A0; // type:function size:0x4 -fn_800FB3B0 = .text:0x800FB3B0; // type:function size:0x4 -fn_800FB3C0 = .text:0x800FB3C0; // type:function size:0x9C -fn_800FB460 = .text:0x800FB460; // type:function size:0x4 -fn_800FB470 = .text:0x800FB470; // type:function size:0x4 -fn_800FB480 = .text:0x800FB480; // type:function size:0x98 -fn_800FB520 = .text:0x800FB520; // type:function size:0x4 -fn_800FB530 = .text:0x800FB530; // type:function size:0x4 -fn_800FB540 = .text:0x800FB540; // type:function size:0x84 -fn_800FB5D0 = .text:0x800FB5D0; // type:function size:0x4 -fn_800FB5E0 = .text:0x800FB5E0; // type:function size:0x20 -fn_800FB600 = .text:0x800FB600; // type:function size:0x10 -fn_800FB610 = .text:0x800FB610; // type:function size:0x4 -fn_800FB620 = .text:0x800FB620; // type:function size:0x98 -fn_800FB6C0 = .text:0x800FB6C0; // type:function size:0x4 -fn_800FB6D0 = .text:0x800FB6D0; // type:function size:0x4 -fn_800FB6E0 = .text:0x800FB6E0; // type:function size:0x84 -fn_800FB770 = .text:0x800FB770; // type:function size:0x4 -fn_800FB780 = .text:0x800FB780; // type:function size:0x4 -fn_800FB790 = .text:0x800FB790; // type:function size:0x98 -fn_800FB830 = .text:0x800FB830; // type:function size:0x4 -fn_800FB840 = .text:0x800FB840; // type:function size:0x4 -fn_800FB850 = .text:0x800FB850; // type:function size:0x84 -fn_800FB8E0 = .text:0x800FB8E0; // type:function size:0x4 -fn_800FB8F0 = .text:0x800FB8F0; // type:function size:0x20 -fn_800FB910 = .text:0x800FB910; // type:function size:0x10 -fn_800FB920 = .text:0x800FB920; // type:function size:0x4 -fn_800FB930 = .text:0x800FB930; // type:function size:0x8C -fn_800FB9C0 = .text:0x800FB9C0; // type:function size:0x4 -fn_800FB9D0 = .text:0x800FB9D0; // type:function size:0x4 -fn_800FB9E0 = .text:0x800FB9E0; // type:function size:0x9C -fn_800FBA80 = .text:0x800FBA80; // type:function size:0x4 -fn_800FBA90 = .text:0x800FBA90; // type:function size:0x4 -fn_800FBAA0 = .text:0x800FBAA0; // type:function size:0x98 -fn_800FBB40 = .text:0x800FBB40; // type:function size:0x4 -fn_800FBB50 = .text:0x800FBB50; // type:function size:0x4 -fn_800FBB60 = .text:0x800FBB60; // type:function size:0x84 -fn_800FBBF0 = .text:0x800FBBF0; // type:function size:0x4 -fn_800FBC00 = .text:0x800FBC00; // type:function size:0x20 -fn_800FBC20 = .text:0x800FBC20; // type:function size:0x10 -fn_800FBC30 = .text:0x800FBC30; // type:function size:0x4 -fn_800FBC40 = .text:0x800FBC40; // type:function size:0x60 -fn_800FBCA0 = .text:0x800FBCA0; // type:function size:0x8 -fn_800FBCB0 = .text:0x800FBCB0; // type:function size:0xA0 -fn_800FBD50 = .text:0x800FBD50; // type:function size:0x4 -fn_800FBD60 = .text:0x800FBD60; // type:function size:0x2C0 -fn_800FC020 = .text:0x800FC020; // type:function size:0x4 -fn_800FC030 = .text:0x800FC030; // type:function size:0x2C0 -fn_800FC2F0 = .text:0x800FC2F0; // type:function size:0x84 -fn_800FC380 = .text:0x800FC380; // type:function size:0xC -fn_800FC390 = .text:0x800FC390; // type:function size:0x4 -fn_800FC3A0 = .text:0x800FC3A0; // type:function size:0x28 -fn_800FC3D0 = .text:0x800FC3D0; // type:function size:0x4 -fn_800FC3E0 = .text:0x800FC3E0; // type:function size:0xC8 -fn_800FC4B0 = .text:0x800FC4B0; // type:function size:0xF8 -fn_800FC5B0 = .text:0x800FC5B0; // type:function size:0x4 -fn_800FC5C0 = .text:0x800FC5C0; // type:function size:0x60 -fn_800FC620 = .text:0x800FC620; // type:function size:0x78 -fn_800FC6A0 = .text:0x800FC6A0; // type:function size:0x4 -fn_800FC6B0 = .text:0x800FC6B0; // type:function size:0x104 -fn_800FC7C0 = .text:0x800FC7C0; // type:function size:0x14C -fn_800FC910 = .text:0x800FC910; // type:function size:0x40 -fn_800FC950 = .text:0x800FC950; // type:function size:0x134 -fn_800FCA90 = .text:0x800FCA90; // type:function size:0xA8 -fn_800FCB40 = .text:0x800FCB40; // type:function size:0x40 -fn_800FCB80 = .text:0x800FCB80; // type:function size:0xC -fn_800FCB90 = .text:0x800FCB90; // type:function size:0x10C -fn_800FCCA0 = .text:0x800FCCA0; // type:function size:0x4 -fn_800FCCB0 = .text:0x800FCCB0; // type:function size:0x2D8 -fn_800FCF90 = .text:0x800FCF90; // type:function size:0x238 -fn_800FD1D0 = .text:0x800FD1D0; // type:function size:0x4 -fn_800FD1E0 = .text:0x800FD1E0; // type:function size:0x60 -fn_800FD240 = .text:0x800FD240; // type:function size:0x84 -fn_800FD2D0 = .text:0x800FD2D0; // type:function size:0x4 -fn_800FD2E0 = .text:0x800FD2E0; // type:function size:0x474 -fn_800FD760 = .text:0x800FD760; // type:function size:0x100 -fn_800FD860 = .text:0x800FD860; // type:function size:0x8B0 -fn_800FE110 = .text:0x800FE110; // type:function size:0x104 -fn_800FE220 = .text:0x800FE220; // type:function size:0x198 -fn_800FE3C0 = .text:0x800FE3C0; // type:function size:0xC4 -fn_800FE490 = .text:0x800FE490; // type:function size:0x14 -fn_800FE4B0 = .text:0x800FE4B0; // type:function size:0x158 -fn_800FE610 = .text:0x800FE610; // type:function size:0x88 -fn_800FE6A0 = .text:0x800FE6A0; // type:function size:0x88 -fn_800FE730 = .text:0x800FE730; // type:function size:0x40 -fn_800FE770 = .text:0x800FE770; // type:function size:0xB0 -fn_800FE820 = .text:0x800FE820; // type:function size:0x174 -fn_800FE9A0 = .text:0x800FE9A0; // type:function size:0x14 -fn_800FE9C0 = .text:0x800FE9C0; // type:function size:0x14 -fn_800FE9E0 = .text:0x800FE9E0; // type:function size:0xE4 -fn_800FEAD0 = .text:0x800FEAD0; // type:function size:0x8 -fn_800FEAE0 = .text:0x800FEAE0; // type:function size:0x8 +initializeState_Wait__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FAFD0; // type:function size:0x4 +executeState_Wait__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FAFE0; // type:function size:0x8C +finalizeState_Wait__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB070; // type:function size:0x4 +initializeState_On__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB080; // type:function size:0x4 +executeState_On__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB090; // type:function size:0x9C +finalizeState_On__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB130; // type:function size:0x4 +initializeState_Select__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB140; // type:function size:0x4 +executeState_Select__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB150; // type:function size:0x98 +finalizeState_Select__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB1F0; // type:function size:0x4 +initializeState_Off__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB200; // type:function size:0x4 +executeState_Off__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB210; // type:function size:0x84 +finalizeState_Off__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB2A0; // type:function size:0x4 +init__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB2B0; // type:function size:0x20 +execute__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB2D0; // type:function size:0x10 +reset__26dLytMeterDowsingMenuIcon_cFv = .text:0x800FB2E0; // type:function size:0x20 +initializeState_Wait__23dLytMeterDowsingBlink_cFv = .text:0x800FB300; // type:function size:0x4 +executeState_Wait__23dLytMeterDowsingBlink_cFv = .text:0x800FB310; // type:function size:0x8C +finalizeState_Wait__23dLytMeterDowsingBlink_cFv = .text:0x800FB3A0; // type:function size:0x4 +initializeState_On__23dLytMeterDowsingBlink_cFv = .text:0x800FB3B0; // type:function size:0x4 +executeState_On__23dLytMeterDowsingBlink_cFv = .text:0x800FB3C0; // type:function size:0x9C +finalizeState_On__23dLytMeterDowsingBlink_cFv = .text:0x800FB460; // type:function size:0x4 +initializeState_Select__23dLytMeterDowsingBlink_cFv = .text:0x800FB470; // type:function size:0x4 +executeState_Select__23dLytMeterDowsingBlink_cFv = .text:0x800FB480; // type:function size:0x98 +finalizeState_Select__23dLytMeterDowsingBlink_cFv = .text:0x800FB520; // type:function size:0x4 +initializeState_Off__23dLytMeterDowsingBlink_cFv = .text:0x800FB530; // type:function size:0x4 +executeState_Off__23dLytMeterDowsingBlink_cFv = .text:0x800FB540; // type:function size:0x84 +finalizeState_Off__23dLytMeterDowsingBlink_cFv = .text:0x800FB5D0; // type:function size:0x4 +init__23dLytMeterDowsingBlink_cFv = .text:0x800FB5E0; // type:function size:0x20 +execute__23dLytMeterDowsingBlink_cFv = .text:0x800FB600; // type:function size:0x10 +initializeState_Wait__23dLytMeterDowsingInput_cFv = .text:0x800FB610; // type:function size:0x4 +executeState_Wait__23dLytMeterDowsingInput_cFv = .text:0x800FB620; // type:function size:0x98 +finalizeState_Wait__23dLytMeterDowsingInput_cFv = .text:0x800FB6C0; // type:function size:0x4 +initializeState_On__23dLytMeterDowsingInput_cFv = .text:0x800FB6D0; // type:function size:0x4 +executeState_On__23dLytMeterDowsingInput_cFv = .text:0x800FB6E0; // type:function size:0x84 +finalizeState_On__23dLytMeterDowsingInput_cFv = .text:0x800FB770; // type:function size:0x4 +initializeState_Select__23dLytMeterDowsingInput_cFv = .text:0x800FB780; // type:function size:0x4 +executeState_Select__23dLytMeterDowsingInput_cFv = .text:0x800FB790; // type:function size:0x98 +finalizeState_Select__23dLytMeterDowsingInput_cFv = .text:0x800FB830; // type:function size:0x4 +initializeState_Off__23dLytMeterDowsingInput_cFv = .text:0x800FB840; // type:function size:0x4 +executeState_Off__23dLytMeterDowsingInput_cFv = .text:0x800FB850; // type:function size:0x84 +finalizeState_Off__23dLytMeterDowsingInput_cFv = .text:0x800FB8E0; // type:function size:0x4 +init__23dLytMeterDowsingInput_cFv = .text:0x800FB8F0; // type:function size:0x20 +execute__23dLytMeterDowsingInput_cFv = .text:0x800FB910; // type:function size:0x10 +initializeState_Wait__22dLytMeterDowsingText_cFv = .text:0x800FB920; // type:function size:0x4 +executeState_Wait__22dLytMeterDowsingText_cFv = .text:0x800FB930; // type:function size:0x8C +finalizeState_Wait__22dLytMeterDowsingText_cFv = .text:0x800FB9C0; // type:function size:0x4 +initializeState_On__22dLytMeterDowsingText_cFv = .text:0x800FB9D0; // type:function size:0x4 +executeState_On__22dLytMeterDowsingText_cFv = .text:0x800FB9E0; // type:function size:0x9C +finalizeState_On__22dLytMeterDowsingText_cFv = .text:0x800FBA80; // type:function size:0x4 +initializeState_Select__22dLytMeterDowsingText_cFv = .text:0x800FBA90; // type:function size:0x4 +executeState_Select__22dLytMeterDowsingText_cFv = .text:0x800FBAA0; // type:function size:0x98 +finalizeState_Select__22dLytMeterDowsingText_cFv = .text:0x800FBB40; // type:function size:0x4 +initializeState_Off__22dLytMeterDowsingText_cFv = .text:0x800FBB50; // type:function size:0x4 +executeState_Off__22dLytMeterDowsingText_cFv = .text:0x800FBB60; // type:function size:0x84 +finalizeState_Off__22dLytMeterDowsingText_cFv = .text:0x800FBBF0; // type:function size:0x4 +init__22dLytMeterDowsingText_cFv = .text:0x800FBC00; // type:function size:0x20 +execute__22dLytMeterDowsingText_cFv = .text:0x800FBC20; // type:function size:0x10 +initializeState_Invisible__18dLytMeterDowsing_cFv = .text:0x800FBC30; // type:function size:0x4 +executeState_Invisible__18dLytMeterDowsing_cFv = .text:0x800FBC40; // type:function size:0x60 +getPane__18dLytMeterDowsing_cFv = .text:0x800FBCA0; // type:function size:0x8 +finalizeState_Invisible__18dLytMeterDowsing_cFv = .text:0x800FBCB0; // type:function size:0xA0 +initializeState_Wait__18dLytMeterDowsing_cFv = .text:0x800FBD50; // type:function size:0x4 +executeState_Wait__18dLytMeterDowsing_cFv = .text:0x800FBD60; // type:function size:0x2C0 +finalizeState_Wait__18dLytMeterDowsing_cFv = .text:0x800FC020; // type:function size:0x4 +initializeState_MenuSelectingIn__18dLytMeterDowsing_cFv = .text:0x800FC030; // type:function size:0x2C0 +executeState_MenuSelectingIn__18dLytMeterDowsing_cFv = .text:0x800FC2F0; // type:function size:0x84 +finalizeState_MenuSelectingIn__18dLytMeterDowsing_cFv = .text:0x800FC380; // type:function size:0xC +initializeState_MenuSelecting__18dLytMeterDowsing_cFv = .text:0x800FC390; // type:function size:0x4 +executeState_MenuSelecting__18dLytMeterDowsing_cFv = .text:0x800FC3A0; // type:function size:0x28 +finalizeState_MenuSelecting__18dLytMeterDowsing_cFv = .text:0x800FC3D0; // type:function size:0x4 +initializeState_MenuSelectingOut__18dLytMeterDowsing_cFv = .text:0x800FC3E0; // type:function size:0xC8 +executeState_MenuSelectingOut__18dLytMeterDowsing_cFv = .text:0x800FC4B0; // type:function size:0xF8 +finalizeState_MenuSelectingOut__18dLytMeterDowsing_cFv = .text:0x800FC5B0; // type:function size:0x4 +initializeState_Reset__18dLytMeterDowsing_cFv = .text:0x800FC5C0; // type:function size:0x60 +executeState_Reset__18dLytMeterDowsing_cFv = .text:0x800FC620; // type:function size:0x78 +finalizeState_Reset__18dLytMeterDowsing_cFv = .text:0x800FC6A0; // type:function size:0x4 +initializeState_ToUse__18dLytMeterDowsing_cFv = .text:0x800FC6B0; // type:function size:0x104 +executeState_ToUse__18dLytMeterDowsing_cFv = .text:0x800FC7C0; // type:function size:0x14C +finalizeState_ToUse__18dLytMeterDowsing_cFv = .text:0x800FC910; // type:function size:0x40 +initializeState_ToUnuse__18dLytMeterDowsing_cFv = .text:0x800FC950; // type:function size:0x134 +executeState_ToUnuse__18dLytMeterDowsing_cFv = .text:0x800FCA90; // type:function size:0xA8 +finalizeState_ToUnuse__18dLytMeterDowsing_cFv = .text:0x800FCB40; // type:function size:0x40 +initializeState_Unuse__18dLytMeterDowsing_cFv = .text:0x800FCB80; // type:function size:0xC +executeState_Unuse__18dLytMeterDowsing_cFv = .text:0x800FCB90; // type:function size:0x10C +finalizeState_Unuse__18dLytMeterDowsing_cFv = .text:0x800FCCA0; // type:function size:0x4 +initializeState_DemoMove__18dLytMeterDowsing_cFv = .text:0x800FCCB0; // type:function size:0x2D8 +executeState_DemoMove__18dLytMeterDowsing_cFv = .text:0x800FCF90; // type:function size:0x238 +finalizeState_DemoMove__18dLytMeterDowsing_cFv = .text:0x800FD1D0; // type:function size:0x4 +initializeState_DemoOut__18dLytMeterDowsing_cFv = .text:0x800FD1E0; // type:function size:0x60 +executeState_DemoOut__18dLytMeterDowsing_cFv = .text:0x800FD240; // type:function size:0x84 +finalizeState_DemoOut__18dLytMeterDowsing_cFv = .text:0x800FD2D0; // type:function size:0x4 +build__18dLytMeterDowsing_cFPQ23d2d10ResAccIf_c = .text:0x800FD2E0; // type:function size:0x474 +remove__18dLytMeterDowsing_cFv = .text:0x800FD760; // type:function size:0x100 +execute__18dLytMeterDowsing_cFv = .text:0x800FD860; // type:function size:0x8B0 +fn_800FE110__18dLytMeterDowsing_cFv = .text:0x800FE110; // type:function size:0x104 +fn_800FE220__18dLytMeterDowsing_cFv = .text:0x800FE220; // type:function size:0x198 +fn_800FE3C0__18dLytMeterDowsing_cFl = .text:0x800FE3C0; // type:function size:0xC4 +fn_800FE490__18dLytMeterDowsing_cCFv = .text:0x800FE490; // type:function size:0x14 +fn_800FE4B0__18dLytMeterDowsing_cCFv = .text:0x800FE4B0; // type:function size:0x158 +fn_800FE610__18dLytMeterDowsing_cFv = .text:0x800FE610; // type:function size:0x88 +convertToLytIndex__18dLytMeterDowsing_cCFl = .text:0x800FE6A0; // type:function size:0x88 +getSelectedDowsingSlot__18dLytMeterDowsing_cCFv = .text:0x800FE730; // type:function size:0x40 +setItemName__18dLytMeterDowsing_cFl = .text:0x800FE770; // type:function size:0xB0 +setMessage__18dLytMeterDowsing_cFl = .text:0x800FE820; // type:function size:0x174 +convertSlotIndexToAnm__18dLytMeterDowsing_cCFl = .text:0x800FE9A0; // type:function size:0x14 +fn_800FE9C0__18dLytMeterDowsing_cCFl = .text:0x800FE9C0; // type:function size:0x14 +shouldCall__18dLytMeterDowsing_cCFv = .text:0x800FE9E0; // type:function size:0xE4 +getName__18dLytMeterDowsing_cCFv = .text:0x800FEAD0; // type:function size:0x8 +getLyt__18dLytMeterDowsing_cFv = .text:0x800FEAE0; // type:function size:0x8 __sinit_\d_lyt_meter_dowsing_cpp = .text:0x800FEAF0; // type:function size:0x144C scope:local __dt__41sFStateID_c<26dLytMeterDowsingMenuIcon_c>Fv = .text:0x800FFF40; // type:function size:0x58 __dt__38sFStateID_c<23dLytMeterDowsingBlink_c>Fv = .text:0x800FFFA0; // type:function size:0x58 @@ -9160,10 +9160,10 @@ fn_801676D0 = .text:0x801676D0; // type:function size:0x1C fn_801676F0 = .text:0x801676F0; // type:function size:0x24 fn_80167720 = .text:0x80167720; // type:function size:0x58 fn_80167780 = .text:0x80167780; // type:function size:0x34 -fn_801677C0 = .text:0x801677C0; // type:function size:0x30 -fn_801677F0 = .text:0x801677F0; // type:function size:0x24 +getDowsingItemIdForIndex__Fl = .text:0x801677C0; // type:function size:0x30 +dowsingSlotForIndex__Fl = .text:0x801677F0; // type:function size:0x24 fn_80167820 = .text:0x80167820; // type:function size:0x34 -getDowsingIconForPos = .text:0x80167860; // type:function size:0x5C +getLytIndexForDowsingIndex__Fl = .text:0x80167860; // type:function size:0x5C fn_801678C0 = .text:0x801678C0; // type:function size:0x2C fn_801678F0 = .text:0x801678F0; // type:function size:0x2C fn_80167920 = .text:0x80167920; // type:function size:0x24 @@ -31606,68 +31606,68 @@ lbl_805179BC = .data:0x805179BC; // type:object size:0x9 data:string __vt__19dLytMeterCrossBtn_c = .data:0x805179EC; // type:object size:0x34 __vt__34sFStateID_c<19dLytMeterCrossBtn_c> = .data:0x80517C78; // type:object size:0x34 __vt__39sFStateID_c<24dLytMeterCrossBtnParts_c> = .data:0x80517CAC; // type:object size:0x34 -lbl_80517CE0 = .data:0x80517CE0; // type:object size:0x10 -lbl_80517CF0 = .data:0x80517CF0; // type:object size:0x10 -lbl_80517D00 = .data:0x80517D00; // type:object size:0xC -lbl_80517D0C = .data:0x80517D0C; // type:object size:0xC -lbl_80517D18 = .data:0x80517D18; // type:object size:0xC -lbl_80517D24 = .data:0x80517D24; // type:object size:0xC -lbl_80517D30 = .data:0x80517D30; // type:object size:0xC -lbl_80517D3C = .data:0x80517D3C; // type:object size:0xC -lbl_80517D48 = .data:0x80517D48; // type:object size:0xC -lbl_80517D54 = .data:0x80517D54; // type:object size:0xC -lbl_80517D60 = .data:0x80517D60; // type:object size:0xC -lbl_80517D6C = .data:0x80517D6C; // type:object size:0xC -lbl_80517D78 = .data:0x80517D78; // type:object size:0xC -lbl_80517D84 = .data:0x80517D84; // type:object size:0x64 -lbl_80517DE8 = .data:0x80517DE8; // type:object size:0x14 -lbl_80517DFC = .data:0x80517DFC; // type:object size:0xC -lbl_80517E08 = .data:0x80517E08; // type:object size:0x18 -lbl_80517E20 = .data:0x80517E20; // type:object size:0xC -lbl_80517E2C = .data:0x80517E2C; // type:object size:0xC -lbl_80517E38 = .data:0x80517E38; // type:object size:0xC -lbl_80517E44 = .data:0x80517E44; // type:object size:0xC -lbl_80517E50 = .data:0x80517E50; // type:object size:0xC -lbl_80517E5C = .data:0x80517E5C; // type:object size:0xC -lbl_80517E68 = .data:0x80517E68; // type:object size:0xC -lbl_80517E74 = .data:0x80517E74; // type:object size:0xC -lbl_80517E80 = .data:0x80517E80; // type:object size:0xC -lbl_80517E8C = .data:0x80517E8C; // type:object size:0xC +lbl_80517CE0 = .data:0x80517CE0; // type:object size:0xF data:string +lbl_80517CF0 = .data:0x80517CF0; // type:object size:0xF data:string +lbl_80517D00 = .data:0x80517D00; // type:object size:0xA data:string +lbl_80517D0C = .data:0x80517D0C; // type:object size:0xB data:string +lbl_80517D18 = .data:0x80517D18; // type:object size:0xB data:string +lbl_80517D24 = .data:0x80517D24; // type:object size:0xB data:string +lbl_80517D30 = .data:0x80517D30; // type:object size:0xB data:string +lbl_80517D3C = .data:0x80517D3C; // type:object size:0xB data:string +lbl_80517D48 = .data:0x80517D48; // type:object size:0xB data:string +lbl_80517D54 = .data:0x80517D54; // type:object size:0xB data:string +lbl_80517D60 = .data:0x80517D60; // type:object size:0xB data:string +lbl_80517D6C = .data:0x80517D6C; // type:object size:0xB data:string +lbl_80517D78 = .data:0x80517D78; // type:object size:0xB data:string +lbl_80517D84 = .data:0x80517D84; // type:object size:0xB data:string +lbl_80517DE8 = .data:0x80517DE8; // type:object size:0x13 data:string +lbl_80517DFC = .data:0x80517DFC; // type:object size:0xB data:string +lbl_80517E08 = .data:0x80517E08; // type:object size:0x16 data:string +lbl_80517E20 = .data:0x80517E20; // type:object size:0xB data:string +lbl_80517E2C = .data:0x80517E2C; // type:object size:0xB data:string +lbl_80517E38 = .data:0x80517E38; // type:object size:0xB data:string +lbl_80517E44 = .data:0x80517E44; // type:object size:0xB data:string +lbl_80517E50 = .data:0x80517E50; // type:object size:0xB data:string +lbl_80517E5C = .data:0x80517E5C; // type:object size:0xB data:string +lbl_80517E68 = .data:0x80517E68; // type:object size:0xB data:string +lbl_80517E74 = .data:0x80517E74; // type:object size:0xB data:string +lbl_80517E80 = .data:0x80517E80; // type:object size:0xA data:string +lbl_80517E8C = .data:0x80517E8C; // type:object size:0xA data:string lbl_80517E98 = .data:0x80517E98; // type:object size:0x1C data:string -lbl_80517EB4 = .data:0x80517EB4; // type:object size:0x14 -lbl_80517EC8 = .data:0x80517EC8; // type:object size:0x20 +lbl_80517EB4 = .data:0x80517EB4; // type:object size:0x11 data:string +lbl_80517EC8 = .data:0x80517EC8; // type:object size:0x1B data:string lbl_80517EE8 = .data:0x80517EE8; // type:object size:0x10 data:string -lbl_80517EF8 = .data:0x80517EF8; // type:object size:0x18 -lbl_80517F10 = .data:0x80517F10; // type:object size:0x1C -lbl_80517F2C = .data:0x80517F2C; // type:object size:0x10 -lbl_80517F3C = .data:0x80517F3C; // type:object size:0x18 +lbl_80517EF8 = .data:0x80517EF8; // type:object size:0x15 data:string +lbl_80517F10 = .data:0x80517F10; // type:object size:0x1A data:string +lbl_80517F2C = .data:0x80517F2C; // type:object size:0xF data:string +lbl_80517F3C = .data:0x80517F3C; // type:object size:0x17 data:string lbl_80517F54 = .data:0x80517F54; // type:object size:0xC data:string -lbl_80517F60 = .data:0x80517F60; // type:object size:0x18 -lbl_80517F78 = .data:0x80517F78; // type:object size:0x18 -lbl_80517F90 = .data:0x80517F90; // type:object size:0xC -lbl_80517F9C = .data:0x80517F9C; // type:object size:0xC -lbl_80517FA8 = .data:0x80517FA8; // type:object size:0x18 -lbl_80517FC0 = .data:0x80517FC0; // type:object size:0xC -lbl_80517FCC = .data:0x80517FCC; // type:object size:0x18 -lbl_80517FE4 = .data:0x80517FE4; // type:object size:0xC -lbl_80517FF0 = .data:0x80517FF0; // type:object size:0x18 -lbl_80518008 = .data:0x80518008; // type:object size:0xC -lbl_80518014 = .data:0x80518014; // type:object size:0x18 -lbl_8051802C = .data:0x8051802C; // type:object size:0xC -lbl_80518038 = .data:0x80518038; // type:object size:0x10 -lbl_80518048 = .data:0x80518048; // type:object size:0x10 -lbl_80518058 = .data:0x80518058; // type:object size:0x10 -lbl_80518068 = .data:0x80518068; // type:object size:0x20 -lbl_80518088 = .data:0x80518088; // type:object size:0xC -lbl_80518094 = .data:0x80518094; // type:object size:0xC -lbl_805180A0 = .data:0x805180A0; // type:object size:0x18 -lbl_805180B8 = .data:0x805180B8; // type:object size:0x20 +lbl_80517F60 = .data:0x80517F60; // type:object size:0x16 data:string +lbl_80517F78 = .data:0x80517F78; // type:object size:0x16 data:string +lbl_80517F90 = .data:0x80517F90; // type:object size:0xB data:string +lbl_80517F9C = .data:0x80517F9C; // type:object size:0xB data:string +lbl_80517FA8 = .data:0x80517FA8; // type:object size:0x15 data:string +lbl_80517FC0 = .data:0x80517FC0; // type:object size:0xA data:string +lbl_80517FCC = .data:0x80517FCC; // type:object size:0x15 data:string +lbl_80517FE4 = .data:0x80517FE4; // type:object size:0xA data:string +lbl_80517FF0 = .data:0x80517FF0; // type:object size:0x15 data:string +lbl_80518008 = .data:0x80518008; // type:object size:0xA data:string +lbl_80518014 = .data:0x80518014; // type:object size:0x15 data:string +lbl_8051802C = .data:0x8051802C; // type:object size:0xA data:string +lbl_80518038 = .data:0x80518038; // type:object size:0xE data:string +lbl_80518048 = .data:0x80518048; // type:object size:0xF data:string +lbl_80518058 = .data:0x80518058; // type:object size:0xD data:string +lbl_80518068 = .data:0x80518068; // type:object size:0xE data:string +lbl_80518088 = .data:0x80518088; // type:object size:0x9 data:string +lbl_80518094 = .data:0x80518094; // type:object size:0x9 data:string +lbl_805180A0 = .data:0x805180A0; // type:object size:0x9 data:string +lbl_805180B8 = .data:0x805180B8; // type:object size:0x9 data:string lbl_805180D8 = .data:0x805180D8; // type:object size:0xC data:string -lbl_805180E4 = .data:0x805180E4; // type:object size:0x10 +lbl_805180E4 = .data:0x805180E4; // type:object size:0xE data:string lbl_805180F4 = .data:0x805180F4; // type:object size:0x14 data:string -lbl_80518108 = .data:0x80518108; // type:object size:0x10 -lbl_80518118 = .data:0x80518118; // type:object size:0x10 -__vt__18dLytMeterDowsing_c = .data:0x80518128; // type:object size:0x830 +lbl_80518108 = .data:0x80518108; // type:object size:0xE data:string +lbl_80518118 = .data:0x80518118; // type:object size:0xD data:string +__vt__18dLytMeterDowsing_c = .data:0x80518128; // type:object size:0x34 __vt__37sFStateID_c<22dLytMeterDowsingText_c> = .data:0x80518958; // type:object size:0x34 __vt__38sFStateID_c<23dLytMeterDowsingInput_c> = .data:0x8051898C; // type:object size:0x34 __vt__38sFStateID_c<23dLytMeterDowsingBlink_c> = .data:0x805189C0; // type:object size:0x34 @@ -38165,15 +38165,15 @@ lbl_80572488 = .sdata:0x80572488; // type:object size:0x7 data:string lbl_80572490 = .sdata:0x80572490; // type:object size:0x7 data:string lbl_80572498 = .sdata:0x80572498; // type:object size:0x7 data:string lbl_805724A0 = .sdata:0x805724A0; // type:object size:0x4 data:4byte -lbl_805724A8 = .sdata:0x805724A8; // type:object size:0x8 -lbl_805724B0 = .sdata:0x805724B0; // type:object size:0x8 -lbl_805724B8 = .sdata:0x805724B8; // type:object size:0x8 -lbl_805724C0 = .sdata:0x805724C0; // type:object size:0x8 -lbl_805724C8 = .sdata:0x805724C8; // type:object size:0x8 -lbl_805724D0 = .sdata:0x805724D0; // type:object size:0x8 -lbl_805724D8 = .sdata:0x805724D8; // type:object size:0x8 -lbl_805724E0 = .sdata:0x805724E0; // type:object size:0x8 -lbl_805724E8 = .sdata:0x805724E8; // type:object size:0x8 data:4byte +lbl_805724A8 = .sdata:0x805724A8; // type:object size:0x7 data:string +lbl_805724B0 = .sdata:0x805724B0; // type:object size:0x7 data:string +lbl_805724B8 = .sdata:0x805724B8; // type:object size:0x7 data:string +lbl_805724C0 = .sdata:0x805724C0; // type:object size:0x7 data:string +lbl_805724C8 = .sdata:0x805724C8; // type:object size:0x7 data:string +lbl_805724D0 = .sdata:0x805724D0; // type:object size:0x7 data:string +lbl_805724D8 = .sdata:0x805724D8; // type:object size:0x7 data:string +lbl_805724E0 = .sdata:0x805724E0; // type:object size:0x7 data:string +lbl_805724E8 = .sdata:0x805724E8; // type:object size:0x4 data:4byte lbl_805724F0 = .sdata:0x805724F0; // type:object size:0x8 lbl_805724F8 = .sdata:0x805724F8; // type:object size:0x8 lbl_80572500 = .sdata:0x80572500; // type:object size:0x8 data:4byte @@ -48737,30 +48737,30 @@ LytMeterCrossBtnParts__STATE_OFF = .bss:0x805ABD60; // type:object size:0x30 dat LytMeterCrossBtn__STATE_WAIT = .bss:0x805ABDA0; // type:object size:0x30 data:4byte LytMeterCrossBtn__STATE_TO_USE = .bss:0x805ABDE0; // type:object size:0x30 data:4byte LytMeterCrossBtn__STATE_UNUSE = .bss:0x805ABE60; // type:object size:0x30 data:4byte -lbl_805ABE90 = .bss:0x805ABE90; // type:object size:0x10 -LytMeterDowsingMenuIcon__STATE_WAIT = .bss:0x805ABEA0; // type:object size:0x40 data:4byte -LytMeterDowsingMenuIcon__STATE_ON = .bss:0x805ABEE0; // type:object size:0x40 data:4byte -LytMeterDowsingMenuIcon__STATE_SELECT = .bss:0x805ABF20; // type:object size:0x40 data:4byte -LytMeterDowsingMenuIcon__STATE_OFF = .bss:0x805ABF60; // type:object size:0x40 data:4byte -LytMeterDowsingBlink__STATE_WAIT = .bss:0x805ABFA0; // type:object size:0x40 data:4byte -LytMeterDowsingBlink__STATE_ON = .bss:0x805ABFE0; // type:object size:0x40 data:4byte -LytMeterDowsingBlink__STATE_SELECT = .bss:0x805AC020; // type:object size:0x40 data:4byte -LytMeterDowsingBlink__STATE_OFF = .bss:0x805AC060; // type:object size:0x40 data:4byte -LytMeterDowsingInput__STATE_WAIT = .bss:0x805AC0A0; // type:object size:0x40 data:4byte -LytMeterDowsingInput__STATE_ON = .bss:0x805AC0E0; // type:object size:0x40 data:4byte -LytMeterDowsingInput__STATE_SELECT = .bss:0x805AC120; // type:object size:0x40 data:4byte -LytMeterDowsingInput__STATE_OFF = .bss:0x805AC160; // type:object size:0x40 data:4byte -LytMeterDowsingText__STATE_WAIT = .bss:0x805AC1A0; // type:object size:0x40 data:4byte -LytMeterDowsingText__STATE_ON = .bss:0x805AC1E0; // type:object size:0x40 data:4byte -LytMeterDowsingText__STATE_SELECT = .bss:0x805AC220; // type:object size:0x40 data:4byte -LytMeterDowsingText__STATE_OFF = .bss:0x805AC260; // type:object size:0x40 data:4byte -LytMeterDowsing__STATE_INVISIBLE = .bss:0x805AC2A0; // type:object size:0x40 data:4byte -LytMeterDowsing__STATE_WAIT = .bss:0x805AC2E0; // type:object size:0x80 data:4byte -LytMeterDowsing__STATE_MENU_SELECTING = .bss:0x805AC360; // type:object size:0x40 data:4byte -LytMeterDowsing__STATE_MENU_SELECTING_OUT = .bss:0x805AC3A0; // type:object size:0x80 data:4byte -LytMeterDowsing__STATE_TO_USE = .bss:0x805AC420; // type:object size:0x80 data:4byte -LytMeterDowsing__STATE_UNUSE = .bss:0x805AC4A0; // type:object size:0x40 data:4byte -LytMeterDowsing__STATE_DEMO_MOVE = .bss:0x805AC4E0; // type:object size:0x40 data:4byte +lbl_805ABE90 = .bss:0x805ABE90; // type:object size:0xC +LytMeterDowsingMenuIcon__STATE_WAIT = .bss:0x805ABEA0; // type:object size:0x30 data:4byte +LytMeterDowsingMenuIcon__STATE_ON = .bss:0x805ABEE0; // type:object size:0x30 data:4byte +LytMeterDowsingMenuIcon__STATE_SELECT = .bss:0x805ABF20; // type:object size:0x30 data:4byte +LytMeterDowsingMenuIcon__STATE_OFF = .bss:0x805ABF60; // type:object size:0x30 data:4byte +LytMeterDowsingBlink__STATE_WAIT = .bss:0x805ABFA0; // type:object size:0x30 data:4byte +LytMeterDowsingBlink__STATE_ON = .bss:0x805ABFE0; // type:object size:0x30 data:4byte +LytMeterDowsingBlink__STATE_SELECT = .bss:0x805AC020; // type:object size:0x30 data:4byte +LytMeterDowsingBlink__STATE_OFF = .bss:0x805AC060; // type:object size:0x30 data:4byte +LytMeterDowsingInput__STATE_WAIT = .bss:0x805AC0A0; // type:object size:0x30 data:4byte +LytMeterDowsingInput__STATE_ON = .bss:0x805AC0E0; // type:object size:0x30 data:4byte +LytMeterDowsingInput__STATE_SELECT = .bss:0x805AC120; // type:object size:0x30 data:4byte +LytMeterDowsingInput__STATE_OFF = .bss:0x805AC160; // type:object size:0x30 data:4byte +LytMeterDowsingText__STATE_WAIT = .bss:0x805AC1A0; // type:object size:0x30 data:4byte +LytMeterDowsingText__STATE_ON = .bss:0x805AC1E0; // type:object size:0x30 data:4byte +LytMeterDowsingText__STATE_SELECT = .bss:0x805AC220; // type:object size:0x30 data:4byte +LytMeterDowsingText__STATE_OFF = .bss:0x805AC260; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_INVISIBLE = .bss:0x805AC2A0; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_WAIT = .bss:0x805AC2E0; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_MENU_SELECTING = .bss:0x805AC360; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_MENU_SELECTING_OUT = .bss:0x805AC3A0; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_TO_USE = .bss:0x805AC420; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_UNUSE = .bss:0x805AC4A0; // type:object size:0x30 data:4byte +LytMeterDowsing__STATE_DEMO_MOVE = .bss:0x805AC4E0; // type:object size:0x30 data:4byte LytMeterDowsing__STATE_DEMO_OUT = .bss:0x805AC520; // type:object size:0x30 data:4byte lbl_805AC550 = .bss:0x805AC550; // type:object size:0x10 LytMeterRupyStart__STATE_WAIT = .bss:0x805AC560; // type:object size:0x40 data:4byte diff --git a/configure.py b/configure.py index 3b0cbd72..77fdd972 100644 --- a/configure.py +++ b/configure.py @@ -397,7 +397,7 @@ config.libs = [ Object(Matching, "d/lyt/meter/d_lyt_meter_plus_btn.cpp"), Object(Matching, "d/lyt/meter/d_lyt_meter_minus_btn.cpp"), Object(Matching, "d/lyt/meter/d_lyt_meter_cross_btn.cpp"), - Object(NonMatching, "d/lyt/meter/d_lyt_meter_dowsing.cpp"), + Object(Matching, "d/lyt/meter/d_lyt_meter_dowsing.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter_rupy.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter_ganbari_gauge.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter_event_skip.cpp"), diff --git a/include/d/lyt/d_lyt_area_caption.h b/include/d/lyt/d_lyt_area_caption.h index 41e9f541..d707425f 100644 --- a/include/d/lyt/d_lyt_area_caption.h +++ b/include/d/lyt/d_lyt_area_caption.h @@ -47,7 +47,7 @@ public: static void check(); static void set0xAAC(u8 arg); - static u8 get0xAAC(); + static s32 get0xAAC(); private: dLytAreaCaption_c() { diff --git a/include/d/lyt/d_lyt_common_icon_item_maps.h b/include/d/lyt/d_lyt_common_icon_item_maps.h index 4ed2d95b..52456d34 100644 --- a/include/d/lyt/d_lyt_common_icon_item_maps.h +++ b/include/d/lyt/d_lyt_common_icon_item_maps.h @@ -34,7 +34,7 @@ #define LYT_CMN_ItemBigBugnet (15) // [14] uc_netB_00.tpl #define LYT_CMN_ItemBoatCannon (16) // [ 7] uc_boatCannon_00.tpl #define LYT_CMN_ItemHarp (17) // [ 0] tr_tategoto_00.tpl -#define LYT_CMN_ItemNone (18) // ------------------------- +#define LYT_CMN_ItemInvalid (18) // ------------------------- // Pouch Items #define LYT_CMN_PouchPotionHealyh (0) // [12] uc_bottleKusuriA_00.tpl @@ -113,5 +113,6 @@ #define LYT_CMN_DowsingZelda (19) // [13] tr_dauzTarget_19.tpl #define LYT_CMN_DowsingTrialGate (20) // [14] tr_dauzTarget_20.tpl #define LYT_CMN_DowsingNewPlantSpecies (21) // [15] tr_dauzTarget_21.tpl +#define LYT_CMN_DowsingInvalid (22) // ------------------------- #endif diff --git a/include/d/lyt/d_lyt_unknowns.h b/include/d/lyt/d_lyt_unknowns.h index 7763b4e5..ca6764f8 100644 --- a/include/d/lyt/d_lyt_unknowns.h +++ b/include/d/lyt/d_lyt_unknowns.h @@ -30,7 +30,7 @@ public: enum DoButton_e { DO_BUTTON_A = 0, DO_BUTTON_B = 1, - + DO_BUTTON_C = 2, DO_BUTTON_Z = 3, DO_BUTTON_NUN_STK = 4, DO_BUTTON_REMOCON_BG = 5, diff --git a/include/d/lyt/d_lyt_util_items.h b/include/d/lyt/d_lyt_util_items.h index 17675393..65b800b8 100644 --- a/include/d/lyt/d_lyt_util_items.h +++ b/include/d/lyt/d_lyt_util_items.h @@ -2,6 +2,7 @@ #define D_LYT_UTIL_ITEMS_H #include "common.h" +#include "toBeSorted/dowsing_target.h" bool isPouchBocoburinLocked(); @@ -11,4 +12,8 @@ s32 getPouchItemAmount(s32 slot, bool unk); u8 getPouchItemNumberColor(s32 slot, bool unk); f32 getShieldDurability(s32 slot, bool unk); +DowsingTarget::DowsingSlot dowsingSlotForIndex(s32 index); +s32 getLytIndexForDowsingIndex(s32 index); +u16 getDowsingItemIdForIndex(s32 index); + #endif diff --git a/include/d/lyt/meter/d_lyt_meter.h b/include/d/lyt/meter/d_lyt_meter.h index 4a68fb4a..4880a21c 100644 --- a/include/d/lyt/meter/d_lyt_meter.h +++ b/include/d/lyt/meter/d_lyt_meter.h @@ -43,7 +43,8 @@ public: bool build(d2d::ResAccIf_c *resAcc); bool remove(); bool draw(); - + + bool fn_800D5380(u8); bool fn_800D5650(); bool fn_800D5680(); @@ -64,6 +65,10 @@ public: return field_0x1377E; } + u8 getField_0x1377F() const { + return field_0x1377F; + } + dLytMeterNunStk_c *getNunStk() { return &mNunStk; } @@ -112,12 +117,17 @@ public: /* 0x13750 */ s32 field_0x13750; /* 0x13754 */ u8 field_0x13754[0x13770 - 0x13754]; /* 0x13770 */ u8 field_0x13770; - /* 0x13771 */ u8 field_0x13771[0x1377E - 0x13771]; + /* 0x13771 */ u8 field_0x13771[0x13774 - 0x13771]; + /* 0x13774 */ u8 field_0x13774; + /* 0x13775 */ u8 field_0x13775[0x1377E - 0x13775]; /* 0x1377E */ u8 field_0x1377E; - /* 0x1377F */ u8 field_0x1375F[0x13792 - 0x1377F]; + /* 0x1377F */ u8 field_0x1377F; + /* 0x13780 */ u8 field_0x13780[0x13792 - 0x13780]; /* 0x13792 */ u8 field_0x13792; /* 0x13793 */ u8 field_0x13793; - /* 0x13794 */ u8 field_0x13794[0x137B4 - 0x13794]; + /* 0x13794 */ u8 field_0x13794[0x1379A - 0x13794]; + /* 0x1379A */ u8 field_0x1379A; + /* 0x1379B */ u8 field_0x1379B[0x137B4 - 0x1379B]; /* 0x137B4 */ mVec3_c mPos3; /* 0x137C0 */ u32 field_0x137C0; }; @@ -172,6 +182,18 @@ public: return mMeter.field_0x13770; } + u8 getMeterField_0x13774() const { + return mMeter.field_0x13774; + } + + u8 getMeterField_0x1377F() const { + return mMeter.field_0x1377F; + } + + u8 getMeterField_0x1379A() const { + return mMeter.field_0x1379A; + } + bool checkAllFlags(u32 mask) const { return (mFlags & mask) == mask; } diff --git a/include/d/lyt/meter/d_lyt_meter_dowsing.h b/include/d/lyt/meter/d_lyt_meter_dowsing.h index e5a76743..91f2a351 100644 --- a/include/d/lyt/meter/d_lyt_meter_dowsing.h +++ b/include/d/lyt/meter/d_lyt_meter_dowsing.h @@ -3,23 +3,39 @@ #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_textbox.h" +#include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" class dLytMeterDowsingMenuIcon_c { public: dLytMeterDowsingMenuIcon_c() : mStateMgr(*this, sStateID::null) {} virtual ~dLytMeterDowsingMenuIcon_c() {} + void init(); + void execute(); + void reset(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterDowsingMenuIcon_c, Wait); STATE_FUNC_DECLARE(dLytMeterDowsingMenuIcon_c, On); STATE_FUNC_DECLARE(dLytMeterDowsingMenuIcon_c, Select); STATE_FUNC_DECLARE(dLytMeterDowsingMenuIcon_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterDowsingMenuIcon_c); - u32 field_0x40; - u32 field_0x44; + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterDowsingMenuIcon_c); + + /* 0x04 */ UI_STATE_MGR_DECLARE(dLytMeterDowsingMenuIcon_c); + + /* 0x40 */ d2d::AnmGroup_c *mpAnm; + /* 0x44 */ u32 mShouldBeSelect; }; class dLytMeterDowsingBlink_c { @@ -27,15 +43,29 @@ public: dLytMeterDowsingBlink_c() : mStateMgr(*this, sStateID::null) {} ~dLytMeterDowsingBlink_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterDowsingBlink_c, Wait); STATE_FUNC_DECLARE(dLytMeterDowsingBlink_c, On); STATE_FUNC_DECLARE(dLytMeterDowsingBlink_c, Select); STATE_FUNC_DECLARE(dLytMeterDowsingBlink_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterDowsingBlink_c); - u32 field_0x40; - u32 field_0x44; + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterDowsingBlink_c); + + /* 0x04 */ UI_STATE_MGR_DECLARE(dLytMeterDowsingBlink_c); + + /* 0x40 */ d2d::AnmGroup_c *mpAnm; + /* 0x44 */ u32 mShouldBeSelect; }; class dLytMeterDowsingInput_c { @@ -43,15 +73,29 @@ public: dLytMeterDowsingInput_c() : mStateMgr(*this, sStateID::null) {} ~dLytMeterDowsingInput_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterDowsingInput_c, Wait); STATE_FUNC_DECLARE(dLytMeterDowsingInput_c, On); STATE_FUNC_DECLARE(dLytMeterDowsingInput_c, Select); STATE_FUNC_DECLARE(dLytMeterDowsingInput_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterDowsingInput_c); - u32 field_0x40; - u32 field_0x44; + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterDowsingInput_c); + + /* 0x00 */ UI_STATE_MGR_DECLARE(dLytMeterDowsingInput_c); + + /* 0x3C */ d2d::AnmGroup_c *mpAnm; + /* 0x40 */ u32 mShouldBeSelect; }; class dLytMeterDowsingText_c { @@ -59,15 +103,29 @@ public: dLytMeterDowsingText_c() : mStateMgr(*this, sStateID::null) {} ~dLytMeterDowsingText_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterDowsingText_c, Wait); STATE_FUNC_DECLARE(dLytMeterDowsingText_c, On); STATE_FUNC_DECLARE(dLytMeterDowsingText_c, Select); STATE_FUNC_DECLARE(dLytMeterDowsingText_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterDowsingText_c); - u32 field_0x40; - u32 field_0x44; + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterDowsingText_c); + + /* 0x00 */ UI_STATE_MGR_DECLARE(dLytMeterDowsingText_c); + + /* 0x3C */ d2d::AnmGroup_c *mpAnm; + /* 0x40 */ u32 mShouldBeSelect; }; class dLytMeterDowsing_c : public d2d::dSubPane { @@ -76,13 +134,38 @@ public: virtual bool build(d2d::ResAccIf_c *resAcc) override; virtual bool remove() override; virtual bool execute() override; - virtual nw4r::lyt::Pane *getPane() override; - virtual d2d::LytBase_c *getLyt() override; - virtual const char *getName() const override; + virtual nw4r::lyt::Pane *getPane() override { + return mLyt.getLayout()->GetRootPane(); + } + virtual d2d::LytBase_c *getLyt() override { + return &mLyt; + } + virtual const char *getName() const override { + return mLyt.getName(); + } virtual ~dLytMeterDowsing_c() {} + bool shouldCall() const; + bool fn_800FE3C0(s32 arg); + bool fn_800FE490() const; + bool fn_800FE4B0() const; + bool fn_800FE610(); + private: + void setItemName(s32 id); + void setMessage(s32 id); + u8 getSelectedDowsingSlot() const; + void fn_800FE110(); + void fn_800FE220(); + s32 convertToLytIndex(s32 slot) const; + s32 convertSlotIndexToAnm(s32 slot) const; + s32 fn_800FE9C0(s32) const; + + nw4r::lyt::Pane *getPaneByIndex(s32 idx) const { + return mpPanes[idx]; + } + STATE_FUNC_DECLARE(dLytMeterDowsing_c, Invisible); STATE_FUNC_DECLARE(dLytMeterDowsing_c, Wait); STATE_FUNC_DECLARE(dLytMeterDowsing_c, MenuSelectingIn); @@ -95,21 +178,48 @@ private: STATE_FUNC_DECLARE(dLytMeterDowsing_c, DemoMove); STATE_FUNC_DECLARE(dLytMeterDowsing_c, DemoOut); - /* 0x008 */ dLytMeterDowsingMenuIcon_c mIcon[8]; - /* 0x248 */ dLytMeterDowsingBlink_c mBlink; - /* 0x28C */ dLytMeterDowsingInput_c mInput; - /* 0x2D0 */ dLytMeterDowsingText_c mText[2]; - /* 0x358 */ UI_STATE_MGR_DECLARE(dLytMeterDowsing_c); + STATE_MGR_DEFINE_UTIL_ISSTATE(dLytMeterDowsing_c); + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterDowsing_c); - /* 0x490 */ d2d::dLytSub mLyt; + /* 0x0008 */ dLytMeterDowsingMenuIcon_c mIcon[8]; + /* 0x0248 */ dLytMeterDowsingBlink_c mBlink; + /* 0x028C */ dLytMeterDowsingInput_c mInput; + /* 0x02D0 */ dLytMeterDowsingText_c mText[2]; + /* 0x0358 */ UI_STATE_MGR_DECLARE(dLytMeterDowsing_c); - /* 0x428 */ d2d::AnmGroup_c mAnmGroups[29]; - /* 0xB68 */ u8 field_0xB68[0xBEC - 0xB68]; - /* 0xBEC */ dLytCommonIconItem_c mItemIcons[9]; + /* 0x0490 */ d2d::dLytSub mLyt; - /* 0x5434 */ d2d::SubPaneList mNodeList; - /* 0x5440 */ d2d::SubPaneListNode mNodes[9]; - /* 0x??? */ u8 padding[0x11E34 - 0x11DF8]; + /* 0x0428 */ d2d::AnmGroup_c mAnm[29]; + /* 0x0B68 */ nw4r::lyt::Pane *mpPanes[22]; + /* 0x0BC0 */ nw4r::lyt::Pane *mpOwnerPane; + /* 0x0BC4 */ dWindow_c *mpWindows[3]; + /* 0x0BD0 */ dTextBox_c *mpSizeBoxes[3]; + /* 0x0BDC */ dTextBox_c *mpTextBoxes[4]; + /* 0x0BEC */ dLytCommonIconItem_c mItemIcons[9]; + + /* 0x5434 */ d2d::SubPaneList mSubpaneList; + /* 0x5440 */ d2d::SubPaneListNode mSubpanes[9]; + /* 0x54D0 */ f32 mArrowRotation; + /* 0x54D4 */ f32 mArrowLength; + /* 0x54D8 */ s32 field_0x54D8; + /* 0x54D8 */ s32 field_0x54DC; + /* 0x54E0 */ s32 field_0x54E0; + /* 0x54E4 */ s32 field_0x54E4; + /* 0x54E8 */ s32 field_0x54E8; + /* 0x54EC */ s32 field_0x54EC; + /* 0x54F0 */ s32 field_0x54F0; + /* 0x54F4 */ s32 field_0x54F4; + /* 0x54F8 */ u32 field_0x54F8; + /* 0x54FC */ s32 mDemoFrame; + /* 0x5500 */ s32 field_0x5500; + /* 0x5504 */ u8 field_0x5504; + /* 0x5505 */ u8 field_0x5505; + /* 0x5506 */ u8 field_0x5506; + /* 0x5507 */ u8 field_0x5507; + /* 0x5508 */ u8 field_0x5508; + /* 0x5509 */ u8 field_0x5509; + /* 0x550A */ u8 field_0x550A; + /* 0x550B */ u8 field_0x550B; }; #endif diff --git a/include/toBeSorted/dowsing_target.h b/include/toBeSorted/dowsing_target.h index c9d40026..d988e86c 100644 --- a/include/toBeSorted/dowsing_target.h +++ b/include/toBeSorted/dowsing_target.h @@ -65,8 +65,8 @@ public: static void init(); static void execute(); - static u8 getTopDowsingIcon(); - static u8 getLeftDowsingIcon(); + static s32 getTopDowsingIcon(); + static s32 getLeftDowsingIcon(); }; #endif diff --git a/src/d/lyt/d_lyt_area_caption.cpp b/src/d/lyt/d_lyt_area_caption.cpp index 8ba56ccd..abc295ce 100644 --- a/src/d/lyt/d_lyt_area_caption.cpp +++ b/src/d/lyt/d_lyt_area_caption.cpp @@ -188,7 +188,7 @@ void dLytAreaCaption_c::set0xAAC(u8 arg) { } } -u8 dLytAreaCaption_c::get0xAAC() { +s32 dLytAreaCaption_c::get0xAAC() { if (sInstance != nullptr) { return sInstance->field_0xAAC; } diff --git a/src/d/lyt/meter/d_lyt_meter_dowsing.cpp b/src/d/lyt/meter/d_lyt_meter_dowsing.cpp index 3086fe25..8c570162 100644 --- a/src/d/lyt/meter/d_lyt_meter_dowsing.cpp +++ b/src/d/lyt/meter/d_lyt_meter_dowsing.cpp @@ -1,5 +1,24 @@ #include "d/lyt/meter/d_lyt_meter_dowsing.h" +#include "common.h" +#include "d/flag/storyflag_manager.h" +#include "d/lyt/d_lyt_area_caption.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" +#include "d/lyt/d_lyt_control_game.h" +#include "d/lyt/d_lyt_do_button.h" +#include "d/lyt/d_lyt_unknowns.h" +#include "d/lyt/d_lyt_util_items.h" +#include "d/lyt/d_window.h" +#include "d/lyt/meter/d_lyt_meter.h" +#include "m/m_vec.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/math/math_types.h" +#include "sized_string.h" +#include "toBeSorted/dowsing_target.h" +#include "toBeSorted/effects_struct.h" +#include "toBeSorted/file_manager.h" +#include "toBeSorted/small_sound_mgr.h" + STATE_DEFINE(dLytMeterDowsingMenuIcon_c, Wait); STATE_DEFINE(dLytMeterDowsingMenuIcon_c, On); STATE_DEFINE(dLytMeterDowsingMenuIcon_c, Select); @@ -31,3 +50,1230 @@ STATE_DEFINE(dLytMeterDowsing_c, ToUnuse); STATE_DEFINE(dLytMeterDowsing_c, Unuse); STATE_DEFINE(dLytMeterDowsing_c, DemoMove); STATE_DEFINE(dLytMeterDowsing_c, DemoOut); + +void dLytMeterDowsingMenuIcon_c::initializeState_Wait() {} +void dLytMeterDowsingMenuIcon_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterDowsingMenuIcon_c::finalizeState_Wait() {} + +void dLytMeterDowsingMenuIcon_c::initializeState_On() {} +void dLytMeterDowsingMenuIcon_c::executeState_On() { + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingMenuIcon_c::finalizeState_On() {} + +void dLytMeterDowsingMenuIcon_c::initializeState_Select() {} +void dLytMeterDowsingMenuIcon_c::executeState_Select() { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + if (mShouldBeSelect == 0) { + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterDowsingMenuIcon_c::finalizeState_Select() {} + +void dLytMeterDowsingMenuIcon_c::initializeState_Off() {} +void dLytMeterDowsingMenuIcon_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingMenuIcon_c::finalizeState_Off() {} + +void dLytMeterDowsingMenuIcon_c::init() { + mShouldBeSelect = 0; + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterDowsingMenuIcon_c::execute() { + mStateMgr.executeState(); +} + +void dLytMeterDowsingMenuIcon_c::reset() { + mShouldBeSelect = 0; + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterDowsingBlink_c::initializeState_Wait() {} +void dLytMeterDowsingBlink_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterDowsingBlink_c::finalizeState_Wait() {} + +void dLytMeterDowsingBlink_c::initializeState_On() {} +void dLytMeterDowsingBlink_c::executeState_On() { + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingBlink_c::finalizeState_On() {} + +void dLytMeterDowsingBlink_c::initializeState_Select() {} +void dLytMeterDowsingBlink_c::executeState_Select() { + if (mShouldBeSelect == 0) { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterDowsingBlink_c::finalizeState_Select() {} + +void dLytMeterDowsingBlink_c::initializeState_Off() {} +void dLytMeterDowsingBlink_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingBlink_c::finalizeState_Off() {} + +void dLytMeterDowsingBlink_c::init() { + mShouldBeSelect = 0; + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterDowsingBlink_c::execute() { + mStateMgr.executeState(); +} + +void dLytMeterDowsingInput_c::initializeState_Wait() {} +void dLytMeterDowsingInput_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterDowsingInput_c::finalizeState_Wait() {} + +void dLytMeterDowsingInput_c::initializeState_On() {} +void dLytMeterDowsingInput_c::executeState_On() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingInput_c::finalizeState_On() {} + +void dLytMeterDowsingInput_c::initializeState_Select() {} +void dLytMeterDowsingInput_c::executeState_Select() { + if (mShouldBeSelect == 0) { + mpAnm->setForwardOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterDowsingInput_c::finalizeState_Select() {} + +void dLytMeterDowsingInput_c::initializeState_Off() {} +void dLytMeterDowsingInput_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingInput_c::finalizeState_Off() {} + +void dLytMeterDowsingInput_c::init() { + mShouldBeSelect = 0; + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterDowsingInput_c::execute() { + mStateMgr.executeState(); +} + +void dLytMeterDowsingText_c::initializeState_Wait() {} +void dLytMeterDowsingText_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterDowsingText_c::finalizeState_Wait() {} + +void dLytMeterDowsingText_c::initializeState_On() {} +void dLytMeterDowsingText_c::executeState_On() { + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingText_c::finalizeState_On() {} + +void dLytMeterDowsingText_c::initializeState_Select() {} +void dLytMeterDowsingText_c::executeState_Select() { + if (mShouldBeSelect == 0) { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterDowsingText_c::finalizeState_Select() {} + +void dLytMeterDowsingText_c::initializeState_Off() {} +void dLytMeterDowsingText_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterDowsingText_c::finalizeState_Off() {} + +void dLytMeterDowsingText_c::init() { + mShouldBeSelect = 0; + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterDowsingText_c::execute() { + mStateMgr.executeState(); +} + +static const char *sPaneNames[] = { + "N_itemArrow_00", "N_arrowHand_00", "N_bBtn_00", "N_A_00", "N_B_00", "N_C_00", + "N_D_00", "N_E_00", "N_F_00", "N_G_00", "N_H_00", "N_iconA_00", + "N_iconB_00", "N_iconC_00", "N_iconD_00", "N_iconE_00", "N_iconF_00", "N_iconG_00", + "N_iconH_00", "N_btnBg_01", "N_input_00", "N_input_01", +}; + +#define DOWSING_PANE_ITEM_ARROW 0 +#define DOWSING_PANE_ARROW_HAND 1 +#define DOWSING_PANE_N_BTN_0 2 +#define DOWSING_PANE_ITEM_OFFSET 3 +#define DOWSING_PANE_ICON_OFFSET 11 +#define DOWSING_PANE_BTN_BG_01 19 +#define DOWSING_PANE_INPUT_00 20 +#define DOWSING_PANE_INPUT_01 21 + +#define DOWSING_NUM_PANES 22 + +static const d2d::LytBrlanMapping brlanMap[] = { + { "nunBtn_03_in.brlan", "G_inOut_00"}, + { "nunBtn_03_onOff.brlan", "G_itemA_00"}, + { "nunBtn_03_onOff.brlan", "G_itemB_00"}, + { "nunBtn_03_onOff.brlan", "G_itemC_00"}, + { "nunBtn_03_onOff.brlan", "G_itemD_00"}, + { "nunBtn_03_onOff.brlan", "G_itemE_00"}, + { "nunBtn_03_onOff.brlan", "G_itemF_00"}, + { "nunBtn_03_onOff.brlan", "G_itemG_00"}, + { "nunBtn_03_onOff.brlan", "G_itemH_00"}, + { "nunBtn_03_onOff.brlan", "G_text_00"}, + { "nunBtn_03_onOff.brlan", "G_text_01"}, + {"nunBtn_03_selectOnOff.brlan", "G_selectOnOff_00"}, + { "nunBtn_03_selectLoop.brlan", "G_selectLoop_00"}, + { "nunBtn_03_have.brlan", "G_itemA_00"}, + { "nunBtn_03_have.brlan", "G_itemB_00"}, + { "nunBtn_03_have.brlan", "G_itemC_00"}, + { "nunBtn_03_have.brlan", "G_itemD_00"}, + { "nunBtn_03_have.brlan", "G_itemF_00"}, + { "nunBtn_03_have.brlan", "G_itemG_00"}, + { "nunBtn_03_have.brlan", "G_itemH_00"}, + { "nunBtn_03_itemArrow.brlan", "G_itemArrow_00"}, + { "nunBtn_03_decide.brlan", "G_decide_00"}, + { "nunBtn_03_reset.brlan", "G_inOut_00"}, + { "nunBtn_03_input.brlan", "G_input_00"}, + { "nunBtn_03_input.brlan", "G_input_01"}, + { "nunBtn_03_type.brlan", "G_type_00"}, + { "nunBtn_03_call.brlan", "G_call_00"}, + { "nunBtn_03_text.brlan", "G_text_02"}, + { "nunBtn_03_loop.brlan", "G_loop_00"}, +}; + +#define DOWSING_ANIM_IN 0 +#define DOWSING_ANIM_ITEM_ONOFF_OFFSET 1 +#define DOWSING_ANIM_TEXT_ONOFF_OFFSET 9 +#define DOWSING_ANIM_SELECT_ONOFF 11 +#define DOWSING_ANIM_SELECT_LOOP 12 +#define DOWSING_ANIM_HAVE_OFFSET 13 +#define DOWSING_ANIM_ARROW 20 +#define DOWSING_ANIM_DECIDE 21 +#define DOWSING_ANIM_RESET 22 +#define DOWSING_ANIM_INPUT_0 23 +#define DOWSING_ANIM_INPUT_1 24 +#define DOWSING_ANIM_TYPE 25 +#define DOWSING_ANIM_CALL 26 +#define DOWSING_ANIM_TEXT 27 +#define DOWSING_ANIM_LOOP 28 + +#define DOWSING_NUM_ANIMS 29 + +#define DOWSING_NUM_ITEMS 8 + +static const char *sTextboxNames[] = {"T_itemName_00", "T_itemNameS_00", "T_dawsing_00", "T_dawsingS_00"}; + +static const char *sWindowNames[] = { + "W_bgP_01", + "W_bgP_02", + "W_bgP_00", +}; + +static const char *sGroupName = "G_ref_00"; + +void dLytMeterDowsing_c::initializeState_Invisible() {} +void dLytMeterDowsing_c::executeState_Invisible() { + if (getPane()->IsVisible()) { + mStateMgr.changeState(StateID_Wait); + } +} +void dLytMeterDowsing_c::finalizeState_Invisible() { + if (getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) { + mAnm[DOWSING_ANIM_DECIDE].setToEnd(); + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(true); + mLyt.calc(); + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(false); + } +} + +void dLytMeterDowsing_c::initializeState_Wait() { + fn_800FE220(); +} +void dLytMeterDowsing_c::executeState_Wait() { + if (field_0x5507 != 0) { + fn_800FE220(); + field_0x5507 = 0; + } + + if (!getPane()->IsVisible()) { + mStateMgr.changeState(StateID_Invisible); + } else if (field_0x54F4 == 1) { + mStateMgr.changeState(StateID_DemoMove); + } else if (field_0x5505 != 0) { + mStateMgr.changeState(StateID_MenuSelectingIn); + } else if (field_0x550A != 0 && + (!dLytMeterContainer_c::GetMeter()->fn_800D5380(0) || dLytMeterContainer_c::GetMeter()->fn_800D5650() || + dLytMeterContainer_c::GetMeter()->fn_800D5680())) { + mStateMgr.changeState(StateID_Reset); + } else if (!dLytMeterContainer_c::GetInstance()->checkAllFlags(0x400)) { + mStateMgr.changeState(StateID_ToUnuse); + } else if (dLytMeterContainer_c::GetInstance()->getMeterField_0x1377F() != 0 && field_0x550A == 0 && + dLytMeterContainer_c::GetMeter()->fn_800D5380(0) && !dLytMeterContainer_c::GetMeter()->fn_800D5650() && + !dLytMeterContainer_c::GetMeter()->fn_800D5680() && + getSelectedDowsingSlot() != DowsingTarget::SLOT_LOOK && + getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) { + mAnm[DOWSING_ANIM_IN].setBackwardsOnce(); + mAnm[DOWSING_ANIM_IN].setToEnd2(); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); + mAnm[DOWSING_ANIM_DECIDE].setToEnd(); + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(true); + mItemIcons[0].setItem(convertToLytIndex(getSelectedDowsingSlot())); + mLyt.calc(); + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(false); + field_0x550A = 1; + } +} +void dLytMeterDowsing_c::finalizeState_Wait() {} + +void dLytMeterDowsing_c::initializeState_MenuSelectingIn() { + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(true); + mAnm[DOWSING_ANIM_DECIDE].setFrame(0.0f); + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (i != 4) { + // The bottom slot is always enabled? + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(true); + } + + DowsingTarget::DowsingSlot slot = dowsingSlotForIndex(i); + if (slot != DowsingTarget::SLOT_NONE && DowsingTarget::hasDowsingInSlot(slot)) { + mpPanes[i + DOWSING_PANE_ICON_OFFSET]->SetVisible(true); + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setFrame(0.0f); + } + mItemIcons[i + 1].setItem(getLytIndexForDowsingIndex(i)); + } else { + mpPanes[i + DOWSING_PANE_ICON_OFFSET]->SetVisible(false); + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setFrame(1.0f); + } + } + + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setForwardOnce(); + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(true); + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + + mIcon[i].reset(); + } + mAnm[DOWSING_ANIM_IN].setForwardOnce(); + mAnm[DOWSING_ANIM_IN].setFrame(0.0f); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); + if (StoryflagManager::sInstance->getCounterOrFlag(583)) { + mAnm[DOWSING_ANIM_TYPE].setFrame(1.0f); + } else { + mAnm[DOWSING_ANIM_TYPE].setFrame(0.0f); + } + + mLyt.getLayout()->Animate(0); + mLyt.calc(); + + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(false); + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(false); + } + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false); + } +} +void dLytMeterDowsing_c::executeState_MenuSelectingIn() { + if (mAnm[DOWSING_ANIM_IN].isEndReached()) { + mStateMgr.changeState(StateID_MenuSelecting); + } + + if (mAnm[DOWSING_ANIM_IN].isEnabled()) { + mAnm[DOWSING_ANIM_IN].play(); + } +} +void dLytMeterDowsing_c::finalizeState_MenuSelectingIn() { + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); +} + +void dLytMeterDowsing_c::initializeState_MenuSelecting() {} +void dLytMeterDowsing_c::executeState_MenuSelecting() { + if (field_0x5505 == 0) { + mStateMgr.changeState(StateID_MenuSelectingOut); + } +} +void dLytMeterDowsing_c::finalizeState_MenuSelecting() {} + +void dLytMeterDowsing_c::initializeState_MenuSelectingOut() { + fn_800FE220(); + mAnm[DOWSING_ANIM_IN].setBackwardsOnce(); + mAnm[DOWSING_ANIM_IN].setToStart(); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); + field_0x550A = 0; + if (getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) { + if (getSelectedDowsingSlot() != DowsingTarget::SLOT_LOOK) { + field_0x550A = 1; + } + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(true); + } +} +void dLytMeterDowsing_c::executeState_MenuSelectingOut() { + if (mAnm[DOWSING_ANIM_IN].isStop2()) { + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); + if (mAnm[DOWSING_ANIM_DECIDE].isEnabled()) { + if (mAnm[DOWSING_ANIM_DECIDE].isEndReached()) { + mAnm[DOWSING_ANIM_DECIDE].setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + } else { + mStateMgr.changeState(StateID_Wait); + } + } + + if (mAnm[DOWSING_ANIM_IN].isEnabled()) { + mAnm[DOWSING_ANIM_IN].play(); + } + + if (mAnm[DOWSING_ANIM_DECIDE].isEnabled()) { + mAnm[DOWSING_ANIM_DECIDE].play(); + } +} +void dLytMeterDowsing_c::finalizeState_MenuSelectingOut() {} + +void dLytMeterDowsing_c::initializeState_Reset() { + mAnm[DOWSING_ANIM_RESET].setForwardOnce(); + mAnm[DOWSING_ANIM_RESET].setToStart(); + mAnm[DOWSING_ANIM_RESET].setAnimEnable(true); +} +void dLytMeterDowsing_c::executeState_Reset() { + if (mAnm[DOWSING_ANIM_RESET].isStop2()) { + field_0x550A = 0; + mStateMgr.changeState(StateID_Wait); + } + + if (mAnm[DOWSING_ANIM_RESET].isEnabled()) { + mAnm[DOWSING_ANIM_RESET].play(); + } +} +void dLytMeterDowsing_c::finalizeState_Reset() {} + +void dLytMeterDowsing_c::initializeState_ToUse() { + mAnm[DOWSING_ANIM_INPUT_0].setBackwardsOnce(); + mAnm[DOWSING_ANIM_INPUT_0].setToStart(); + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(true); + + if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && + dLytMeterContainer_c::GetMeter()->fn_800D5380(0) && !dLytMeterContainer_c::GetMeter()->fn_800D5650() && + !dLytMeterContainer_c::GetMeter()->fn_800D5680()) { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(true); + mAnm[DOWSING_ANIM_RESET].setBackwardsOnce(); + mAnm[DOWSING_ANIM_RESET].setToStart(); + } +} +void dLytMeterDowsing_c::executeState_ToUse() { + if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && + dLytMeterContainer_c::GetMeter()->fn_800D5380(0) && !dLytMeterContainer_c::GetMeter()->fn_800D5650() && + !dLytMeterContainer_c::GetMeter()->fn_800D5680()) { + if (mAnm[DOWSING_ANIM_INPUT_0].isStop2()) { + if (!mAnm[DOWSING_ANIM_RESET].isEnabled() || mAnm[DOWSING_ANIM_RESET].isStop2()) { + mStateMgr.changeState(StateID_Wait); + } + } + } else if (mAnm[DOWSING_ANIM_INPUT_0].isStop2()) { + mStateMgr.changeState(StateID_Wait); + } + + if (mAnm[DOWSING_ANIM_INPUT_0].isEnabled()) { + mAnm[DOWSING_ANIM_INPUT_0].play(); + } + + if (mAnm[DOWSING_ANIM_RESET].isEnabled()) { + mAnm[DOWSING_ANIM_RESET].play(); + } +} +void dLytMeterDowsing_c::finalizeState_ToUse() { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(false); + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(false); +} + +void dLytMeterDowsing_c::initializeState_ToUnuse() { + mAnm[DOWSING_ANIM_INPUT_0].setForwardOnce(); + if (dLytMeterContainer_c::GetMeter()->fn_800D5650()) { + mAnm[DOWSING_ANIM_INPUT_0].setToEnd2(); + } else { + mAnm[DOWSING_ANIM_INPUT_0].setToStart(); + } + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(true); + + if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && + dLytMeterContainer_c::GetMeter()->fn_800D5380(0) && !dLytMeterContainer_c::GetMeter()->fn_800D5650() && + !dLytMeterContainer_c::GetMeter()->fn_800D5680()) { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(true); + mAnm[DOWSING_ANIM_RESET].setForwardOnce(); + mAnm[DOWSING_ANIM_RESET].setToStart(); + } +} +void dLytMeterDowsing_c::executeState_ToUnuse() { + if (mAnm[DOWSING_ANIM_INPUT_0].isStop2()) { + if (!mAnm[DOWSING_ANIM_RESET].isEnabled() || mAnm[DOWSING_ANIM_RESET].isStop2()) { + mStateMgr.changeState(StateID_Unuse); + } + } + + if (mAnm[DOWSING_ANIM_INPUT_0].isEnabled()) { + mAnm[DOWSING_ANIM_INPUT_0].play(); + } + + if (mAnm[DOWSING_ANIM_RESET].isEnabled()) { + mAnm[DOWSING_ANIM_RESET].play(); + } +} +void dLytMeterDowsing_c::finalizeState_ToUnuse() { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(false); + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(false); +} + +void dLytMeterDowsing_c::initializeState_Unuse() { + field_0x54D8 = 15; +} +void dLytMeterDowsing_c::executeState_Unuse() { + if (field_0x54F4 == 1) { + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(true); + mAnm[DOWSING_ANIM_INPUT_0].setFrame(0.0f); + mLyt.calc(); + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(false); + mStateMgr.changeState(StateID_DemoMove); + } else if (!dLytMeterContainer_c::GetMeter()->fn_800D5680() && + dLytMeterContainer_c::GetInstance()->getMeterField_0x13774() == 0 && + dLytMeterContainer_c::GetInstance()->checkAllFlags(0x400)) { + if (field_0x54D8 <= 0) { + mStateMgr.changeState(StateID_ToUse); + } else { + field_0x54D8--; + } + } else { + field_0x54D8 = 15; + } +} +void dLytMeterDowsing_c::finalizeState_Unuse() {} + +void dLytMeterDowsing_c::initializeState_DemoMove() { + field_0x550B = 1; + mDemoFrame = 0; + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (i != 4) { + // The bottom slot is always enabled? + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(true); + } + + DowsingTarget::DowsingSlot slot = dowsingSlotForIndex(i); + bool condition = slot != DowsingTarget::SLOT_NONE && DowsingTarget::hasDowsingInSlot(slot); + if (i == fn_800FE9C0(field_0x54F8)) { + condition = false; + } + if (condition) { + mpPanes[i + DOWSING_PANE_ICON_OFFSET]->SetVisible(true); + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setFrame(0.0f); + } + mItemIcons[i + 1].setItem(getLytIndexForDowsingIndex(i)); + } else { + mpPanes[i + DOWSING_PANE_ICON_OFFSET]->SetVisible(false); + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setFrame(1.0f); + } + } + + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setForwardOnce(); + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(true); + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + + mIcon[i].reset(); + } + + mAnm[DOWSING_ANIM_IN].setForwardOnce(); + mAnm[DOWSING_ANIM_IN].setToEnd2(); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); + + if (StoryflagManager::sInstance->getCounterOrFlag(583)) { + mAnm[DOWSING_ANIM_TYPE].setFrame(1.0f); + } else { + mAnm[DOWSING_ANIM_TYPE].setFrame(0.0f); + } + + mLyt.getLayout()->Animate(0); + mLyt.calc(); + + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (i != 4) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(false); + } + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false); + } +} +extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_970_; +void dLytMeterDowsing_c::executeState_DemoMove() { + mDemoFrame++; + if (mDemoFrame == 15) { + if (field_0x54F8 <= 21) { + s32 i = fn_800FE9C0(field_0x54F8); + s32 idx = i + DOWSING_PANE_ICON_OFFSET; + mpPanes[idx]->SetVisible(true); + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(true); + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setFrame(0.0f); + mItemIcons[i + 1].setItem(getLytIndexForDowsingIndex(i)); + + idx = i + DOWSING_PANE_ITEM_OFFSET; + nw4r::math::MTX34 mtx = mpPanes[idx]->GetGlobalMtx(); + mVec3_c pos(mtx._03, mtx._13, 0.0f); + EffectsStruct::fn_800298C0(PARTICLE_RESOURCE_ID_MAPPING_970_, &pos, nullptr, nullptr, nullptr, nullptr); + SmallSoundManager::GetInstance()->playSound(SE_S_DOWSING_ADD); + } + } else if (mDemoFrame == 16) { + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (i != 4 && mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].isEnabled()) { + mAnm[convertSlotIndexToAnm(i) + DOWSING_ANIM_HAVE_OFFSET].setAnimEnable(false); + } + } + } + + if (mDemoFrame > 80) { + mDemoFrame = 0; + mStateMgr.changeState(StateID_DemoOut); + } +} +void dLytMeterDowsing_c::finalizeState_DemoMove() {} + +void dLytMeterDowsing_c::initializeState_DemoOut() { + mAnm[DOWSING_ANIM_IN].setBackwardsOnce(); + mAnm[DOWSING_ANIM_IN].setToStart(); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); +} +void dLytMeterDowsing_c::executeState_DemoOut() { + if (mAnm[DOWSING_ANIM_IN].isStop2()) { + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); + field_0x54F4 = 4; + mStateMgr.changeState(StateID_Wait); + } + if (mAnm[DOWSING_ANIM_IN].isEnabled()) { + mAnm[DOWSING_ANIM_IN].play(); + } +} +void dLytMeterDowsing_c::finalizeState_DemoOut() {} + +bool dLytMeterDowsing_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("nunBtn_03.brlyt", nullptr); + + for (int i = 0; i < DOWSING_NUM_PANES; i++) { + mpPanes[i] = mLyt.findPane(sPaneNames[i]); + } + + for (int i = 0; i < DOWSING_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mAnm[DOWSING_ANIM_SELECT_LOOP].setAnimEnable(true); + mAnm[DOWSING_ANIM_TYPE].setAnimEnable(true); + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + mIcon[i].setAnm(&mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET]); + mIcon[i].init(); + } + + mBlink.setAnm(&mAnm[DOWSING_ANIM_SELECT_ONOFF]); + mBlink.init(); + mInput.setAnm(&mAnm[DOWSING_ANIM_INPUT_1]); + mInput.init(); + + for (int i = 0; i < 2; i++) { + mText[i].setAnm(&mAnm[i + DOWSING_ANIM_TEXT_ONOFF_OFFSET]); + mText[i].init(); + } + + for (int i = 0; i < 4; i++) { + mpTextBoxes[i] = mLyt.getTextBox(sTextboxNames[i]); + } + + for (int i = 0; i < 3; i++) { + mpWindows[i] = mLyt.getWindow(sWindowNames[i]); + mpSizeBoxes[i] = mLyt.getSizeBoxInWindow(sWindowNames[i]); + } + mpWindows[0]->UpdateSize(mpSizeBoxes[0], 32.0f); + + for (int i = 0; i < 9; i++) { + mSubpanes[i].mpLytPane = &mItemIcons[i]; + mItemIcons[i].build(resAcc, dLytCommonIconItem_c::DOWSING); + mSubpaneList.PushBack(&mSubpanes[i]); + } + + if (mLyt.getLayout()->GetGroupContainer() != nullptr) { + nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName); + if (g != nullptr) { + linkMeters(g, &mSubpaneList); + } + } + + for (int i = 0; i < 9; i++) { + mItemIcons[i].reset(); + mItemIcons[i].setVisible(false); + mItemIcons[i].setSize(true); + } + + field_0x54E0 = 8; + + mArrowRotation = 0.0f; + mArrowLength = 0.0f; + + mpOwnerPane = nullptr; + + field_0x54F4 = 0; + field_0x54F8 = -1; + mDemoFrame = 0; + field_0x5500 = 0; + field_0x54F0 = LytDoButtonRelated::DO_NONE; + field_0x54E4 = LytDoButtonRelated::DO_NONE; + field_0x54E8 = LytDoButtonRelated::DO_NONE; + field_0x54D8 = 15; + field_0x5505 = 0; + field_0x54EC = 1; + field_0x5504 = 0; + field_0x5508 = 0; + field_0x5509 = 0; + field_0x550A = 0; + + field_0x5506 = getPane()->IsVisible(); + field_0x5507 = 0; + field_0x550B = 0; + + mAnm[DOWSING_ANIM_IN].setForwardOnce(); + mAnm[DOWSING_ANIM_IN].setFrame(0.0f); + mAnm[DOWSING_ANIM_IN].setAnimEnable(true); + + mAnm[DOWSING_ANIM_CALL].setToEnd(); + mAnm[DOWSING_ANIM_CALL].setAnimEnable(true); + + mAnm[DOWSING_ANIM_INPUT_1].setForwardOnce(); + mAnm[DOWSING_ANIM_INPUT_1].setToEnd2(); + mAnm[DOWSING_ANIM_INPUT_1].setAnimEnable(true); + mAnm[DOWSING_ANIM_TEXT].setAnimEnable(true); + + setMessage(field_0x54E4); + + mAnm[DOWSING_ANIM_TEXT].setFrame(0.0f); + + mLyt.calc(); + + mAnm[DOWSING_ANIM_IN].setAnimEnable(false); + mAnm[DOWSING_ANIM_CALL].setAnimEnable(false); + mAnm[DOWSING_ANIM_INPUT_1].setAnimEnable(false); + mAnm[DOWSING_ANIM_LOOP].setAnimEnable(true); + + mStateMgr.changeState(StateID_Invisible); + + return true; +} + +bool dLytMeterDowsing_c::remove() { + for (d2d::SubPaneList::Iterator it = mSubpaneList.GetBeginIter(); it != mSubpaneList.GetEndIter(); ++it) { + if (!it->mpLytPane->LytMeter0x24()) { + continue; + } + // @bug checking nullptr after invoking virtual function on it + d2d::dSubPane *subPane = it->mpLytPane; + if (subPane != nullptr) { + nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); + parent->RemoveChild(subPane->getPane()); + } + } + + for (int i = 0; i < DOWSING_NUM_ITEMS + 1; i++) { + mSubpanes[i].mpLytPane->remove(); + } + + for (int i = 0; i < DOWSING_NUM_ANIMS; i++) { + mAnm[i].unbind(); + mAnm[i].remove(); + } + + return true; +} + +bool dLytMeterDowsing_c::execute() { + if (dLytControlGame_c::getInstance()->isStateNormal()) { + if (StoryflagManager::sInstance->getCounterOrFlag(566) && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::DO_NONE) { + if (dLytMeterContainer_c::GetMeter()->fn_800D5380(0)) { + field_0x5508 = 0; + StoryflagManager::sInstance->unsetFlag(566); + if (getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE) { + if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) { + StoryflagManager::sInstance->unsetFlag(818); + } + } + } else { + field_0x5508 = 1; + } + } else if (StoryflagManager::sInstance->getCounterOrFlag(818) && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) { + if (field_0x5505 != 0 || field_0x550A != 0) { + field_0x5508 = 0; + StoryflagManager::sInstance->unsetFlag(818); + } else { + field_0x5508 = 1; + } + } + } else { + field_0x5508 = 0; + } + + bool newVisible = getPane()->IsVisible(); + if (field_0x5506 != newVisible) { + field_0x5506 = newVisible; + if (!newVisible) { + field_0x5507 = 1; + } + } + + if (mpOwnerPane == nullptr) { + return true; + } + + if (!mpOwnerPane->IsVisible()) { + if (*mStateMgr.getStateID() != StateID_DemoMove && *mStateMgr.getStateID() != StateID_DemoOut && + field_0x550B != 0) { + mpPanes[DOWSING_PANE_INPUT_00]->SetVisible(true); + mpPanes[DOWSING_PANE_INPUT_01]->SetVisible(true); + if (mAnm[DOWSING_ANIM_INPUT_0].isEnabled()) { + mAnm[DOWSING_ANIM_INPUT_0].setFrame(0.0f); + mLyt.calc(); + mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(false); + } + field_0x550B = 0; + mStateMgr.changeState(StateID_Reset); + } + + if (*mStateMgr.getStateID() == StateID_MenuSelectingIn || *mStateMgr.getStateID() == StateID_MenuSelecting || + *mStateMgr.getStateID() == StateID_MenuSelectingOut) { + mStateMgr.changeState(StateID_Reset); + } + + if (*mStateMgr.getStateID() == StateID_Wait) { + field_0x5507 = 1; + } + return true; + } + + if (field_0x5506 == 0) { + return true; + } + + fn_800FE110(); + bool state = false; + s32 action = dLytDobutton_c::getFn0x8010E5E0(); + if (action == 8 || action == 10 || action == 30) { + LytDoButtonRelated::Action_e action = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getFn0x8010E5D0()); + if (action >= 0) { + state = true; + LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_C, action); + } + } + field_0x54E8 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C); + field_0x54EC = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_C) && + dLytMeterContainer_c::GetInstance()->checkAllFlags(0x400); + if (*mStateMgr.getStateID() != StateID_ToUnuse && + (dLytMeterContainer_c::GetMeter()->getUiMode() == 0 || field_0x54E8 != 0x51)) { + if (field_0x54E8 != field_0x54E4) { + if (field_0x5500 != 0) { + field_0x54E4 = field_0x54E8; + setMessage(field_0x54E8); + } else { + field_0x5500 += 1; + } + } else { + field_0x5500 = 0; + } + } else { + field_0x5500 = 0; + } + + mStateMgr.executeState(); + + if (field_0x5504 != state) { + if (state) { + mAnm[DOWSING_ANIM_TEXT].setFrame(1.0f); + } else { + mAnm[DOWSING_ANIM_TEXT].setFrame(0.0f); + } + field_0x5504 = state; + } + + if (field_0x5508 != 0) { + if (field_0x5509 == 0) { + mAnm[DOWSING_ANIM_CALL].setToEnd(); + mAnm[DOWSING_ANIM_CALL].setAnimEnable(true); + field_0x5509 = 1; + } + if (mAnm[DOWSING_ANIM_CALL].isEnabled()) { + mAnm[DOWSING_ANIM_CALL].play(); + if (dLytMeterContainer_c::GetInstance()->checkAllFlags(0x400) && + mAnm[DOWSING_ANIM_CALL].getFrame() == 1.0f) { + SmallSoundManager::GetInstance()->playSound(SE_S_C_BUTTON_BLINK); + } + } + } else if (field_0x5509 == 1) { + mAnm[DOWSING_ANIM_CALL].setToEnd(); + } else if (mAnm[DOWSING_ANIM_CALL].isEnabled()) { + mAnm[DOWSING_ANIM_CALL].setAnimEnable(false); + } + + if (field_0x5508 == 0) { + field_0x5509 = field_0x5508; + } + field_0x5508 = 0; + + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + mIcon[i].execute(); + } + + if (mLyt.findPane("N_setBtn_00")->IsVisible()) { + mBlink.execute(); + mInput.execute(); + + if (mAnm[DOWSING_ANIM_INPUT_1].isEnabled()) { + mLyt.getLayout()->Animate(0); + mLyt.calc(); + } + } + + for (int i = 0; i < 2; i++) { + mText[i].execute(); + } + + // Rotate the arrow + mVec3_c t1(0.0f, 0.0f, 0.0f); + t1.z = mArrowRotation; + mpPanes[DOWSING_PANE_ITEM_ARROW]->SetRotate(t1); + // But rotate the button and the pointer back so that + // they point up + mVec3_c t2(0.0f, 0.0f, 0.0f); + t2.z = -mArrowRotation; + mpPanes[DOWSING_PANE_ARROW_HAND]->SetRotate(t2); + mpPanes[DOWSING_PANE_N_BTN_0]->SetRotate(t2); + + f32 frame = mAnm[DOWSING_ANIM_ARROW].getAnimDuration(); + if (mArrowLength < 0.0f) { + mArrowLength = 0.0f; + } + if (mArrowLength > 1.0f) { + mArrowLength = 1.0f; + } + mAnm[DOWSING_ANIM_ARROW].setFrame(frame * mArrowLength); + mAnm[DOWSING_ANIM_ARROW].setAnimEnable(true); + + if (mAnm[DOWSING_ANIM_SELECT_LOOP].isEnabled()) { + mAnm[DOWSING_ANIM_SELECT_LOOP].play(); + } + + if (mAnm[DOWSING_ANIM_LOOP].isEnabled()) { + mAnm[DOWSING_ANIM_LOOP].play(); + } + + for (int i = 0; i < DOWSING_NUM_ITEMS + 1; i++) { + mSubpanes[i].mpLytPane->execute(); + } + + return true; +} + +void dLytMeterDowsing_c::fn_800FE110() { + bool anySelected = false; + s32 selectedIdx = -1; + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + DowsingTarget::DowsingSlot slot = dowsingSlotForIndex(i); + if (field_0x54E0 == slot && field_0x54F4 == 0 && slot != DowsingTarget::SLOT_NONE && + DowsingTarget::hasDowsingInSlot(slot)) { + mIcon[i].setShouldBeSelect(true); + anySelected = true; + selectedIdx = i; + } else { + mIcon[i].setShouldBeSelect(false); + } + } + + setItemName(selectedIdx); + + if (anySelected) { + mBlink.setShouldBeSelect(true); + mText[0].setShouldBeSelect(true); + } else { + mBlink.setShouldBeSelect(false); + mText[0].setShouldBeSelect(false); + } + + if (dLytMeterContainer_c::GetInstance()->getMeterField_0x1377F() != 0 && field_0x550A == 0) { + mInput.setShouldBeSelect(true); + } else { + mInput.setShouldBeSelect(false); + } +} + +void dLytMeterDowsing_c::fn_800FE220() { + if (getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && + dLytMeterContainer_c::GetMeter()->fn_800D5380(0) && !dLytMeterContainer_c::GetMeter()->fn_800D5650() && + !dLytMeterContainer_c::GetMeter()->fn_800D5680()) { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(true); + mAnm[DOWSING_ANIM_RESET].setForwardOnce(); + mAnm[DOWSING_ANIM_RESET].setToStart(); + mItemIcons[0].setItem(convertToLytIndex(getSelectedDowsingSlot())); + mLyt.calc(); + mAnm[DOWSING_ANIM_RESET].setAnimEnable(false); + mLyt.findPane("N_bBtnText_00")->SetVisible(true); + mLyt.findPane("N_bBtnText_00")->SetAlpha(255); + } else { + mAnm[DOWSING_ANIM_RESET].setAnimEnable(true); + mAnm[DOWSING_ANIM_RESET].setForwardOnce(); + mAnm[DOWSING_ANIM_RESET].setToEnd2(); + mLyt.calc(); + mAnm[DOWSING_ANIM_RESET].setAnimEnable(false); + } +} + +bool dLytMeterDowsing_c::fn_800FE3C0(s32 arg) { + if (field_0x54F4 == 0) { + field_0x54F4 = 1; + field_0x54F8 = arg; + mDemoFrame = 0; + mArrowRotation = 0.0f; + mArrowLength = 0.0f; + for (int i = 0; i < DOWSING_NUM_ITEMS; i++) { + mIcon[i].init(); + } + mpPanes[DOWSING_PANE_INPUT_00]->SetVisible(false); + mpPanes[DOWSING_PANE_INPUT_01]->SetVisible(false); + } else if (field_0x54F4 == 4) { + field_0x54F4 = 0; + return true; + } + return false; +} + +bool dLytMeterDowsing_c::fn_800FE490() const { + return field_0x54F4 != 0; +} + +bool dLytMeterDowsing_c::fn_800FE4B0() const { + if (field_0x5505 != 0 || field_0x54E0 < 8) { + if (*mStateMgr.getStateID() == StateID_ToUse || *mStateMgr.getStateID() == StateID_Wait) { + return true; + } + } + + return *mStateMgr.getStateID() == StateID_MenuSelectingIn || *mStateMgr.getStateID() == StateID_MenuSelecting || + *mStateMgr.getStateID() == StateID_MenuSelectingOut; +} + +bool dLytMeterDowsing_c::fn_800FE610() { + if ((!dLytMeterContainer_c::GetInstance()->getMeterField_0x1379A() && dLytAreaCaption_c::get0xAAC() == 0) || + !getPane()->IsVisible() || dLytMeterContainer_c::GetMeter()->fn_800D5680()) { + return false; + } + return true; +} + +static const s32 lytIndexes[] = { + LYT_CMN_DowsingInvalid, LYT_CMN_DowsingTreasure, LYT_CMN_DowsingHeart, LYT_CMN_DowsingGoddessCube, + LYT_CMN_DowsingLook, LYT_CMN_DowsingGratitudeCrystal, LYT_CMN_DowsingInvalid, LYT_CMN_DowsingRupee, +}; + +s32 dLytMeterDowsing_c::convertToLytIndex(s32 slot) const { + if (slot == DowsingTarget::SLOT_STORY_EVENT) { + return DowsingTarget::getTopDowsingIcon(); + } else if (slot == DowsingTarget::SLOT_QUEST) { + return DowsingTarget::getLeftDowsingIcon(); + } else { + for (s32 i = 0; i < DOWSING_NUM_ITEMS; i++) { + if (slot == dowsingSlotForIndex(i)) { + return lytIndexes[i]; + } + } + return LYT_CMN_DowsingInvalid; + } +} + +u8 dLytMeterDowsing_c::getSelectedDowsingSlot() const { + if (dLytMeterContainer_c::GetMeter()->fn_800D5650()) { + return DowsingTarget::SLOT_NONE; + } else { + return FileManager::GetInstance()->getDowsingSlotIdx(); + } +} + +void dLytMeterDowsing_c::setItemName(s32 idx) { + if (idx >= 0 && field_0x54F4 == 0) { + mText[1].setShouldBeSelect(true); + SizedString<32> label; + label.sprintf("NAME_DOWSING_%03d_R", getDowsingItemIdForIndex(idx)); + mpTextBoxes[0]->setMessageWithGlobalTextProcessor2(label, nullptr); + mpTextBoxes[1]->setMessageWithGlobalTextProcessor2(label, nullptr); + mpWindows[1]->UpdateSize(mpSizeBoxes[1], 32.0f); + } else { + mText[1].setShouldBeSelect(false); + } +} + +#include "d/lyt/meter/d_lyt_meter_action_table.inc" + +void dLytMeterDowsing_c::setMessage(s32 id) { + char buf[11]; + for (int i = 0; i < 11; i++) { + buf[i] = 0; + } + + if (id < LytDoButtonRelated::DO_NONE) { + if (id < 0x5D) { + sprintf(buf, "ACT_INFO_%03d", sActIds[id]); + } else { + s32 id2 = id - 0x5E; + sprintf(buf, "ACT_ETC_%03d", sActIds[id2]); + } + + for (int i = 2; i <= 3; i++) { + mpTextBoxes[i]->SetVisible(true); + mpTextBoxes[i]->setMessageWithGlobalTextProcessor2(buf, nullptr); + } + mpWindows[2]->SetVisible(true); + mpWindows[2]->UpdateSize(mpSizeBoxes[2], 32.0f); + field_0x54F0 = id; + } else { + mpTextBoxes[2]->SetVisible(false); + mpTextBoxes[3]->SetVisible(false); + mpWindows[2]->SetVisible(false); + } +} + +s32 dLytMeterDowsing_c::convertSlotIndexToAnm(s32 idx) const { + if (idx > 4) { + return idx - 1; + } else { + return idx; + } +} + +static const s32 unkTable[] = {0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 6, 6, 6, 6, 1, 5, 7, 3}; + +s32 dLytMeterDowsing_c::fn_800FE9C0(s32 unkId) const { + return unkTable[unkId]; +} + +bool dLytMeterDowsing_c::shouldCall() const { + if (dLytControlGame_c::getInstance()->isStateNormal() && + ((StoryflagManager::sInstance->getCounterOrFlag(566) && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::DO_NONE) || + (StoryflagManager::sInstance->getCounterOrFlag(818) && + LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52))) { + return true; + } + + return false; +} diff --git a/src/d/lyt/meter/d_lyt_meter_item_select.cpp b/src/d/lyt/meter/d_lyt_meter_item_select.cpp index db7f4868..fb2c0205 100644 --- a/src/d/lyt/meter/d_lyt_meter_item_select.cpp +++ b/src/d/lyt/meter/d_lyt_meter_item_select.cpp @@ -1804,6 +1804,7 @@ bool dLytMeterItemSelect_c::remove() { if (!it->mpLytPane->LytMeter0x24()) { continue; } + // @bug checking nullptr after invoking virtual function on it d2d::dSubPane *subPane = it->mpLytPane; if (subPane != nullptr) { nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); @@ -2708,7 +2709,7 @@ s32 dLytMeterItemSelect_c::getBaseItemLytIndexforInternalId(s32 idx) const { return sInternalItemToLytIndex[field_0x5797]; } - return LYT_CMN_ItemNone; + return LYT_CMN_ItemInvalid; } extern "C" bool checkIsInSkykeepPuzzle(); diff --git a/src/toBeSorted/dowsing_target.cpp b/src/toBeSorted/dowsing_target.cpp index bd375fca..bc474c8f 100644 --- a/src/toBeSorted/dowsing_target.cpp +++ b/src/toBeSorted/dowsing_target.cpp @@ -3,6 +3,7 @@ #include "c/c_math.h" #include "d/flag/itemflag_manager.h" #include "d/flag/storyflag_manager.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" #include "m/m_mtx.h" #include "toBeSorted/tlist.h" @@ -228,40 +229,40 @@ static bool removeDowsingTarget(DowsingTarget *target) { return false; } -u8 DowsingTarget::getTopDowsingIcon() { +s32 DowsingTarget::getTopDowsingIcon() { if (hasZeldaDowsing()) { - return 19; + return LYT_CMN_DowsingZelda; } else if (hasAnyTrialDowsing()) { - return 20; + return LYT_CMN_DowsingTrialGate; } else if (hasSacredWaterDowsing()) { - return 5; + return LYT_CMN_DowsingHolyWater; } else if (hasSandshipDowsing()) { - return 18; + return LYT_CMN_DowsingSandship; } else if (hasTadtoneDowsing()) { - return 17; + return LYT_CMN_DowsingTadtones; } else if (hasPropellerDowsing()) { - return 10; + return LYT_CMN_DowsingWindmillPropeller; } else if (hasWaterBasinDowsing()) { - return 14; + return LYT_CMN_DowsingWaterBasin; } - return 19; + return LYT_CMN_DowsingZelda; } -u8 DowsingTarget::getLeftDowsingIcon() { +s32 DowsingTarget::getLeftDowsingIcon() { if (hasCrystalBallDowsing()) { - return 15; + return LYT_CMN_DowsingCrystalBall; } else if (hasPumpkinDowsing()) { - return 12; + return LYT_CMN_DowsingPumpkinPatchPlower; } else if (hasNewPlantSpeciesDowsing()) { - return 21; + return LYT_CMN_DowsingNewPlantSpecies; } else if (hasPartyWheelDowsing()) { - return 13; + return LYT_CMN_DowsingPartyWheel; } else if (hasKikwiDowsing()) { - return 8; + return LYT_CMN_DowsingKikwi; } else if (hasKeyPieceDowsing()) { - return 11; + return LYT_CMN_DowsingEarthTempleKey; } else if (hasDesertNodeDowsing()) { - return 7; + return LYT_CMN_DowsingPowerGenerators; } - return 15; + return LYT_CMN_DowsingCrystalBall; }