From 0f9ef3d33c5772d5240bfa1ff209d81abc934376 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 26 Sep 2024 00:34:35 +0200 Subject: [PATCH] Some main dol actor splits, dAcOsw_c OK, dTgSw_c OK (#34) * Some main dol actor splits and code * Match dAcOsw_c * diff clean * Fix * dTgSw_c OK --- config/SOUE01/rels/d_t_timerNP/symbols.txt | 4 +- config/SOUE01/splits.txt | 78 +++- config/SOUE01/symbols.txt | 436 +++++++++++---------- configure.py | 9 + include/c/c_math.h | 10 + include/d/a/d_a_base.h | 2 +- include/d/a/d_a_player.h | 186 +++++++++ include/d/a/d_a_t_wood_area.h | 1 - include/d/a/e/d_a_e_hb_leaf.h | 17 +- include/d/a/obj/d_a_obj_base.h | 15 +- include/d/a/obj/d_a_obj_fairy.h | 50 +++ include/d/a/obj/d_a_obj_switch.h | 89 +++++ include/d/d_player.h | 11 - include/d/tg/d_t_switch.h | 45 +++ include/d/tg/d_t_timer.h | 9 +- include/m/m3d/m_mdl.h | 8 +- include/m/m_mtx.h | 19 +- include/nw4r/g3d/g3d_calcworld.h | 22 +- include/nw4r/g3d/g3d_resnode.h | 5 +- include/s/s_StateMgr.hpp | 2 +- include/toBeSorted/actor_collision.h | 36 ++ include/toBeSorted/actor_event.h | 20 + include/toBeSorted/sceneflag_manager.h | 2 +- include/toBeSorted/time_area_mgr.h | 13 + src/REL/d/a/d_a_t_wood_area.cpp | 5 +- src/REL/d/a/e/d_a_e_hb_leaf.cpp | 8 +- src/REL/d/a/obj/d_a_obj_ring.cpp | 4 +- src/REL/d/t/d_t_holy_water.cpp | 6 +- src/REL/d/t/d_t_sound_area.cpp | 4 +- src/REL/d/t/d_t_sound_area_mgr.cpp | 6 +- src/d/a/d_a_base.cpp | 15 +- src/d/a/d_a_player.cpp | 3 + src/d/a/obj/d_a_obj_fairy.cpp | 128 ++++++ src/d/a/obj/d_a_obj_switch.cpp | 289 ++++++++++++++ src/d/d_player.cpp | 4 +- src/d/tg/d_t_switch.cpp | 187 +++++++++ src/m/m3d/m_mdl.cpp | 5 + src/toBeSorted/sceneflag_manager.cpp | 2 +- src/toBeSorted/special_item_drop_mgr.cpp | 4 +- 39 files changed, 1453 insertions(+), 306 deletions(-) create mode 100644 include/d/a/d_a_player.h create mode 100644 include/d/a/obj/d_a_obj_fairy.h create mode 100644 include/d/a/obj/d_a_obj_switch.h create mode 100644 include/d/tg/d_t_switch.h create mode 100644 include/toBeSorted/actor_collision.h create mode 100644 include/toBeSorted/actor_event.h create mode 100644 src/d/a/d_a_player.cpp create mode 100644 src/d/a/obj/d_a_obj_fairy.cpp create mode 100644 src/d/a/obj/d_a_obj_switch.cpp create mode 100644 src/d/tg/d_t_switch.cpp diff --git a/config/SOUE01/rels/d_t_timerNP/symbols.txt b/config/SOUE01/rels/d_t_timerNP/symbols.txt index a6825912..3a6af027 100644 --- a/config/SOUE01/rels/d_t_timerNP/symbols.txt +++ b/config/SOUE01/rels/d_t_timerNP/symbols.txt @@ -2,7 +2,7 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dTgTimer_c_classInit__Fv = .text:0x00000070; // type:function size:0x4C -__dt__14dTgTimerBase_cFv = .text:0x000000C0; // type:function size:0x58 +__dt__5dTg_cFv = .text:0x000000C0; // type:function size:0x58 increment__FPUs = .text:0x00000120; // type:function size:0x24 create__10dTgTimer_cFv = .text:0x00000150; // type:function size:0xD4 actorExecute__10dTgTimer_cFv = .text:0x00000230; // type:function size:0xB8 @@ -24,4 +24,4 @@ _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global g_profile_TIMER_TAG = .data:0x00000000; // type:object size:0x10 data:4byte __vt__10dTgTimer_c = .data:0x00000034; // type:object size:0x74 -__vt__14dTgTimerBase_c = .data:0x000000A8; // type:object size:0x74 +__vt__5dTg_c = .data:0x000000A8; // type:object size:0x74 diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 16976461..7493e4bb 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -237,6 +237,82 @@ toBeSorted/counters/extra_wallet_counter.cpp: .data start:0x805280B0 end:0x805280D0 .sbss start:0x80575640 end:0x80575648 +d/a/d_a_player.cpp: + .text start:0x801C5C30 end:0x802471F8 + .ctors start:0x804DB824 end:0x804DB828 + +d/a/obj/d_a_obj_item.cpp: + .text start:0x80247200 end:0x80258E58 + .ctors start:0x804DB828 end:0x804DB82C + +d/a/obj/d_a_obj_bomb.cpp: + .text start:0x80258E60 end:0x8025D5D8 + .ctors start:0x804DB82C end:0x804DB830 + .data start:0x80534490 end:0x805347A8 + +d/a/obj/d_a_obj_arrow.cpp: + .text start:0x8025D5E0 end:0x80260D38 + .ctors start:0x804DB830 end:0x804DB834 + .data start:0x805347A8 end:0x80534AD0 + +d/a/obj/d_a_obj_boomerang.cpp: + .text start:0x80260D40 end:0x80265618 + .ctors start:0x804DB834 end:0x804DB838 + .data start:0x80534AD0 end:0x80534E78 + +d/a/obj/d_a_obj_fairy.cpp: + .text start:0x80265620 end:0x80268598 + .ctors start:0x804DB838 end:0x804DB83C + .data start:0x80534E78 end:0x80535270 + .bss start:0x805B4DD8 end:0x805B4FA8 + +d/a/obj/d_a_obj_tbox.cpp: + .text start:0x802685A0 end:0x8026F488 + .ctors start:0x804DB83C end:0x804DB840 + .data start:0x80535270 end:0x80535A18 + +d/a/obj/d_a_obj_time_area.cpp: + .text start:0x8026F490 end:0x80271888 + .ctors start:0x804DB840 end:0x804DB844 + +d/a/obj/d_a_obj_switch.cpp: + .text start:0x80271890 end:0x80273368 + .ctors start:0x804DB844 end:0x804DB848 + .data start:0x80535CD8 end:0x80535FB8 + .sdata start:0x80573A60 end:0x80573A70 + .sdata2 start:0x8057C498 end:0x8057C4E0 + .bss start:0x805B5528 end:0x805B5668 + +d/tg/d_t_alldie.cpp: + .text start:0x80273BC0 end:0x8027405C + +d/tg/d_t_view_clip.cpp: + .text start:0x80274060 end:0x802743DC + +d/tg/d_t_switch.cpp: + .text start:0x802743E0 end:0x802756D8 + .ctors start:0x804DB848 end:0x804DB84C + .data start:0x805361B0 end:0x80536478 + .sdata start:0x80573A70 end:0x80573A80 + .sdata2 start:0x8057C518 end:0x8057C520 + .bss start:0x805B56A8 end:0x805B57A8 + +d/tg/d_t_mass_object.cpp: + .text start:0x802756E0 end:0x8027A0A4 + +d/tg/d_t_camera.cpp: + .text start:0x8027A0B0 end:0x8027A370 + +d/tg/d_t_event.cpp: + .text start:0x8027A370 end:0x8027A740 + +d/tg/d_t_event_f.cpp: + .text start:0x8027A740 end:0x8027AB30 + +d/tg/d_tk_event.cpp: + .text start:0x8027AB30 end:0x8027B408 + .ctors start:0x804DB84C end:0x804DB850 + s/s_StateID.cpp: .text start:0x802DDDB0 end:0x802DE1F4 .ctors start:0x804DB8B8 end:0x804DB8BC @@ -371,7 +447,7 @@ m/m3d/m_fanm.cpp: .sdata2 start:0x8057CD50 end:0x8057CD60 m/m3d/m_mdl.cpp: - .text start:0x802EAF80 end:0x802EBB5C + .text start:0x802EAF80 end:0x802EBBC4 .data start:0x805426C0 end:0x80542708 .sdata2 start:0x8057CD60 end:0x8057CD68 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index de81e135..d04c946a 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -1,4 +1,4 @@ -__check_pad3 = .init:0x80004000; // type:function size:0x28 scope:local +__check_pad3_80004000 = .init:0x80004000; // type:function size:0x28 scope:local __set_debug_bba = .init:0x80004030; // type:function size:0xC scope:local __get_debug_bba = .init:0x80004040; // type:function size:0x8 scope:local __start = .init:0x80004050; // type:function size:0x168 scope:weak @@ -1071,7 +1071,7 @@ updateRoomId__9dAcBase_cFf = .text:0x8002D4B0; // type:function size:0x90 isRoomFlags_0x6_Set__9dAcBase_cFv = .text:0x8002D540; // type:function size:0x44 FUN_8002d590__9dAcBase_cFv = .text:0x8002D590; // type:function size:0x20 FUN_8002d5b0__9dAcBase_cFv = .text:0x8002D5B0; // type:function size:0x20 -playSound__9dAcBase_cFv = .text:0x8002D5D0; // type:function size:0x28 +playSound__9dAcBase_cFUs = .text:0x8002D5D0; // type:function size:0x28 FUN_8002d600__9dAcBase_cFv = .text:0x8002D600; // type:function size:0x28 FUN_8002d630__9dAcBase_cFv = .text:0x8002D630; // type:function size:0x9C FUN_8002d6d0__9dAcBase_cFv = .text:0x8002D6D0; // type:function size:0x40 @@ -1108,8 +1108,8 @@ fn_8002DE60 = .text:0x8002DE60; // type:function size:0x14 getOarcResFile__12dAcObjBase_cFPCc = .text:0x8002DE80; // type:function size:0xC fn_8002DE90 = .text:0x8002DE90; // type:function size:0xC fn_8002DEA0 = .text:0x8002DEA0; // type:function size:0xC -fn_8002DEB0 = .text:0x8002DEB0; // type:function size:0x14 -fn_8002DED0 = .text:0x8002DED0; // type:function size:0x14 +getOarcDZB__12dAcObjBase_cFPCcPCc = .text:0x8002DEB0; // type:function size:0x14 +getOarcPLC__12dAcObjBase_cFPCcPCc = .text:0x8002DED0; // type:function size:0x14 __ct__12dAcObjBase_cFv = .text:0x8002DEF0; // type:function size:0x158 __dt__12dAcObjBase_cFv = .text:0x8002E050; // type:function size:0x84 preCreate__12dAcObjBase_cFv = .text:0x8002E0E0; // type:function size:0x70 @@ -1137,7 +1137,7 @@ drawModelType1__12dAcObjBase_cFPQ23m3d6smdl_c = .text:0x8002EC70; // type:functi fn_8002ECD0 = .text:0x8002ECD0; // type:function size:0x50 fn_8002ED20 = .text:0x8002ED20; // type:function size:0x88 fn_8002edb0__12dAcObjBase_cFRQ23m3d15mShadowCircle_cRQ23m3d6smdl_cPC7mQuat_cllf = .text:0x8002EDB0; // type:function size:0x8C -fn_8002EE40 = .text:0x8002EE40; // type:function size:0xFC +drawShadow__12dAcObjBase_cFRQ23m3d15mShadowCircle_cPvRC6mMtx_cPC7mQuat_clllllf = .text:0x8002EE40; // type:function size:0xFC fn_8002EF40 = .text:0x8002EF40; // type:function size:0x24 fn_8002EF70 = .text:0x8002EF70; // type:function size:0x28 fn_8002EFA0 = .text:0x8002EFA0; // type:function size:0x50 @@ -1418,13 +1418,13 @@ fn_80037A30 = .text:0x80037A30; // type:function size:0xCC fn_80037B00 = .text:0x80037B00; // type:function size:0x20 fn_80037B20 = .text:0x80037B20; // type:function size:0x4C fn_80037B70 = .text:0x80037B70; // type:function size:0x1D4 -fn_80037D50 = .text:0x80037D50; // type:function size:0x1C +calcTimer__2cMFPUs_Us = .text:0x80037D50; // type:function size:0x1C fn_80037D70 = .text:0x80037D70; // type:function size:0x158 fn_80037ED0 = .text:0x80037ED0; // type:function size:0x14 fn_80037EF0 = .text:0x80037EF0; // type:function size:0xA4 fn_80037FA0 = .text:0x80037FA0; // type:function size:0x220 fn_800381C0 = .text:0x800381C0; // type:function size:0x2F0 -fn_800384B0 = .text:0x800384B0; // type:function size:0x1C +calcTimer__2cMFPUc_Uc = .text:0x800384B0; // type:function size:0x1C fn_800384D0 = .text:0x800384D0; // type:function size:0x64 fn_80038540 = .text:0x80038540; // type:function size:0x108 fn_80038650 = .text:0x80038650; // type:function size:0x144 @@ -3410,7 +3410,7 @@ fn_80097420 = .text:0x80097420; // type:function size:0x28 fn_80097450 = .text:0x80097450; // type:function size:0x6C fn_800974C0 = .text:0x800974C0; // type:function size:0x18 fn_800974E0 = .text:0x800974E0; // type:function size:0x28 -fn_80097510 = .text:0x80097510; // type:function size:0x58 +__dt__5dTg_c = .text:0x80097510; // type:function size:0x58 __dt__13DowsingTargetFv = .text:0x80097570; // type:function size:0x60 initialize__13DowsingTargetFQ213DowsingTarget11DowsingSlotUsPC7mVec3_cf = .text:0x800975D0; // type:function size:0x68 doRegister__13DowsingTargetFv = .text:0x80097640; // type:function size:0x4 @@ -3508,9 +3508,9 @@ fn_8009C7D0 = .text:0x8009C7D0; // type:function size:0x104 fn_8009C8E0 = .text:0x8009C8E0; // type:function size:0x10 fn_8009C8F0 = .text:0x8009C8F0; // type:function size:0x8 fn_8009C900 = .text:0x8009C900; // type:function size:0x4 -fn_8009C910 = .text:0x8009C910; // type:function size:0x70 +__ct__17ActorEventRelatedFR9dAcBase_cPv = .text:0x8009C910; // type:function size:0x70 fn_8009C980 = .text:0x8009C980; // type:function size:0x70 -fn_8009C9F0 = .text:0x8009C9F0; // type:function size:0x70 +__dt__17ActorEventRelatedFv = .text:0x8009C9F0; // type:function size:0x70 fn_8009CA60 = .text:0x8009CA60; // type:function size:0x4C fn_8009CAB0 = .text:0x8009CAB0; // type:function size:0x44 fn_8009CB00 = .text:0x8009CB00; // type:function size:0xBC @@ -3539,9 +3539,9 @@ fn_8009D700 = .text:0x8009D700; // type:function size:0x78 fn_8009D780 = .text:0x8009D780; // type:function size:0xA0 fn_8009D820 = .text:0x8009D820; // type:function size:0x50 fn_8009D870 = .text:0x8009D870; // type:function size:0x7C -fn_8009D8F0 = .text:0x8009D8F0; // type:function size:0x54 +scheduleEvent__17ActorEventRelatedFR5EventUl = .text:0x8009D8F0; // type:function size:0x54 fn_8009D950 = .text:0x8009D950; // type:function size:0x54 -fn_8009D9B0 = .text:0x8009D9B0; // type:function size:0x5C +isThisActorInEvent__17ActorEventRelatedFv = .text:0x8009D9B0; // type:function size:0x5C fn_8009DA10 = .text:0x8009DA10; // type:function size:0x30 fn_8009DA40 = .text:0x8009DA40; // type:function size:0x40 fn_8009DA80 = .text:0x8009DA80; // type:function size:0xC @@ -3977,7 +3977,7 @@ checkPositionIsInPastState__14dTimeAreaMgr_cFlRC7mVec3_cPff = .text:0x800B9A50; fn_800B9B60 = .text:0x800B9B60; // type:function size:0xB4 fn_800B9C20 = .text:0x800B9C20; // type:function size:0xB4 fn_800B9CE0 = .text:0x800B9CE0; // type:function size:0xA0 -fn_800B9D80 = .text:0x800B9D80; // type:function size:0x214 +check__14TimeAreaStructFiRC7mVec3_cUlff = .text:0x800B9D80; // type:function size:0x214 fn_800B9FA0 = .text:0x800B9FA0; // type:function size:0x188 fn_800BA130 = .text:0x800BA130; // type:function size:0xC0 fn_800BA1F0 = .text:0x800BA1F0; // type:function size:0x124 @@ -14170,43 +14170,43 @@ fn_802650E0 = .text:0x802650E0; // type:function size:0x30 fn_80265110 = .text:0x80265110; // type:function size:0x41C fn_80265530 = .text:0x80265530; // type:function size:0x58 fn_80265590 = .text:0x80265590; // type:function size:0x88 -fn_80265620 = .text:0x80265620; // type:function size:0x144 -fn_80265770 = .text:0x80265770; // type:function size:0x58 -fn_802657D0 = .text:0x802657D0; // type:function size:0x6C -fn_80265840 = .text:0x80265840; // type:function size:0xA0 -fn_802658E0 = .text:0x802658E0; // type:function size:0xA4 -fn_80265990 = .text:0x80265990; // type:function size:0x78 -fn_80265A10 = .text:0x80265A10; // type:function size:0x478 -fn_80265E90 = .text:0x80265E90; // type:function size:0x10 -fn_80265EA0 = .text:0x80265EA0; // type:function size:0x78 -fn_80265F20 = .text:0x80265F20; // type:function size:0x578 -fn_802664A0 = .text:0x802664A0; // type:function size:0x10 -fn_802664B0 = .text:0x802664B0; // type:function size:0x10 -fn_802664C0 = .text:0x802664C0; // type:function size:0x10C -fn_802665D0 = .text:0x802665D0; // type:function size:0x64 -fn_80266640 = .text:0x80266640; // type:function size:0x38C -fn_802669D0 = .text:0x802669D0; // type:function size:0x4 -fn_802669E0 = .text:0x802669E0; // type:function size:0x178 -fn_80266B60 = .text:0x80266B60; // type:function size:0xE8 -fn_80266C50 = .text:0x80266C50; // type:function size:0x10 -fn_80266C60 = .text:0x80266C60; // type:function size:0x50 -fn_80266CB0 = .text:0x80266CB0; // type:function size:0x90 -fn_80266D40 = .text:0x80266D40; // type:function size:0x10 -fn_80266D50 = .text:0x80266D50; // type:function size:0xFC -fn_80266E50 = .text:0x80266E50; // type:function size:0x1AC -fn_80267000 = .text:0x80267000; // type:function size:0x4 -fn_80267010 = .text:0x80267010; // type:function size:0xA0 -fn_802670B0 = .text:0x802670B0; // type:function size:0x88 -fn_80267140 = .text:0x80267140; // type:function size:0x4 -fn_80267150 = .text:0x80267150; // type:function size:0x4 -fn_80267160 = .text:0x80267160; // type:function size:0x68 -fn_802671D0 = .text:0x802671D0; // type:function size:0x4 -fn_802671E0 = .text:0x802671E0; // type:function size:0x88 -fn_80267270 = .text:0x80267270; // type:function size:0x28 -fn_802672A0 = .text:0x802672A0; // type:function size:0x18 -fn_802672C0 = .text:0x802672C0; // type:function size:0xF0 -fn_802673B0 = .text:0x802673B0; // type:function size:0x10C -fn_802674C0 = .text:0x802674C0; // type:function size:0x74 +dAcObjFairy_c_classInit__Fv = .text:0x80265620; // type:function size:0x144 +__dt__26sFState_c<13dAcObjFairy_c>Fv = .text:0x80265770; // type:function size:0x58 +__dt__29sFStateFct_c<13dAcObjFairy_c>Fv = .text:0x802657D0; // type:function size:0x6C +__dt__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80265840; // type:function size:0xA0 +__dt__52sFStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c>Fv = .text:0x802658E0; // type:function size:0xA4 +createHeap__13dAcObjFairy_cFv = .text:0x80265990; // type:function size:0x78 +create__13dAcObjFairy_cFv = .text:0x80265A10; // type:function size:0x478 +changeState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x80265E90; // type:function size:0x10 +doDelete__13dAcObjFairy_cFv = .text:0x80265EA0; // type:function size:0x78 +actorExecute__13dAcObjFairy_cFv = .text:0x80265F20; // type:function size:0x578 +getStateID__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802664A0; // type:function size:0x10 +executeState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802664B0; // type:function size:0x10 +draw__13dAcObjFairy_cFv = .text:0x802664C0; // type:function size:0x10C +initializeState_Wait__13dAcObjFairy_cFv = .text:0x802665D0; // type:function size:0x64 +executeState_Wait__13dAcObjFairy_cFv = .text:0x80266640; // type:function size:0x38C +finalizeState_Wait__13dAcObjFairy_cFv = .text:0x802669D0; // type:function size:0x4 +initializeState_Avoid__13dAcObjFairy_cFv = .text:0x802669E0; // type:function size:0x178 +executeState_Avoid__13dAcObjFairy_cFv = .text:0x80266B60; // type:function size:0xE8 +finalizeState_Avoid__13dAcObjFairy_cFv = .text:0x80266C50; // type:function size:0x10 +initializeState_PlayerAvoid__13dAcObjFairy_cFv = .text:0x80266C60; // type:function size:0x50 +executeState_PlayerAvoid__13dAcObjFairy_cFv = .text:0x80266CB0; // type:function size:0x90 +finalizeState_PlayerAvoid__13dAcObjFairy_cFv = .text:0x80266D40; // type:function size:0x10 +initializeState_CureStart__13dAcObjFairy_cFv = .text:0x80266D50; // type:function size:0xFC +executeState_CureStart__13dAcObjFairy_cFv = .text:0x80266E50; // type:function size:0x1AC +finalizeState_CureStart__13dAcObjFairy_cFv = .text:0x80267000; // type:function size:0x4 +initializeState_Cure__13dAcObjFairy_cFv = .text:0x80267010; // type:function size:0xA0 +executeState_Cure__13dAcObjFairy_cFv = .text:0x802670B0; // type:function size:0x88 +finalizeState_Cure__13dAcObjFairy_cFv = .text:0x80267140; // type:function size:0x4 +initializeState_CureEnd__13dAcObjFairy_cFv = .text:0x80267150; // type:function size:0x4 +executeState_CureEnd__13dAcObjFairy_cFv = .text:0x80267160; // type:function size:0x68 +finalizeState_CureEnd__13dAcObjFairy_cFv = .text:0x802671D0; // type:function size:0x4 +initializeState_CatchDemo__13dAcObjFairy_cFv = .text:0x802671E0; // type:function size:0x88 +executeState_CatchDemo__13dAcObjFairy_cFv = .text:0x80267270; // type:function size:0x28 +finalizeState_CatchDemo__13dAcObjFairy_cFv = .text:0x802672A0; // type:function size:0x18 +shouldAvoidLink__13dAcObjFairy_cCFv = .text:0x802672C0; // type:function size:0xF0 +isCuring__13dAcObjFairy_cCFv = .text:0x802673B0; // type:function size:0x10C +canTargetWithBugNet__13dAcObjFairy_cCFv = .text:0x802674C0; // type:function size:0x74 fn_80267540 = .text:0x80267540; // type:function size:0xA4 fn_802675F0 = .text:0x802675F0; // type:function size:0x70 fn_80267660 = .text:0x80267660; // type:function size:0x74 @@ -14217,24 +14217,24 @@ fn_802679F0 = .text:0x802679F0; // type:function size:0x158 fn_80267B50 = .text:0x80267B50; // type:function size:0x2C fn_80267B80 = .text:0x80267B80; // type:function size:0x6C fn_80267BF0 = .text:0x80267BF0; // type:function size:0x60 -fn_80267C50 = .text:0x80267C50; // type:function size:0x124 -fn_80267D80 = .text:0x80267D80; // type:function size:0x60 -fn_80267DE0 = .text:0x80267DE0; // type:function size:0xC -fn_80267DF0 = .text:0x80267DF0; // type:function size:0x1C -fn_80267E10 = .text:0x80267E10; // type:function size:0x1C -fn_80267E30 = .text:0x80267E30; // type:function size:0x1C -fn_80267E50 = .text:0x80267E50; // type:function size:0x10 -fn_80267E60 = .text:0x80267E60; // type:function size:0x10 -fn_80267E70 = .text:0x80267E70; // type:function size:0x10 -fn_80267E80 = .text:0x80267E80; // type:function size:0x10 -fn_80267E90 = .text:0x80267E90; // type:function size:0x10 -fn_80267EA0 = .text:0x80267EA0; // type:function size:0x10 -fn_80267EB0 = .text:0x80267EB0; // type:function size:0x30 -fn_80267EE0 = .text:0x80267EE0; // type:function size:0x30 -fn_80267F10 = .text:0x80267F10; // type:function size:0x30 -fn_80267F40 = .text:0x80267F40; // type:function size:0x56C -fn_802684B0 = .text:0x802684B0; // type:function size:0x58 -fn_80268510 = .text:0x80268510; // type:function size:0x88 +__dt__13dAcObjFairy_cFv = .text:0x80267C50; // type:function size:0x124 +build__29sFStateFct_c<13dAcObjFairy_c>FRC12sStateIDIf_c = .text:0x80267D80; // type:function size:0x60 +dispose__29sFStateFct_c<13dAcObjFairy_c>FRP10sStateIf_c = .text:0x80267DE0; // type:function size:0xC +initialize__26sFState_c<13dAcObjFairy_c>Fv = .text:0x80267DF0; // type:function size:0x1C +execute__26sFState_c<13dAcObjFairy_c>Fv = .text:0x80267E10; // type:function size:0x1C +finalize__26sFState_c<13dAcObjFairy_c>Fv = .text:0x80267E30; // type:function size:0x1C +initializeState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80267E50; // type:function size:0x10 +finalizeState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80267E60; // type:function size:0x10 +refreshState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80267E70; // type:function size:0x10 +getState__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80267E80; // type:function size:0x10 +getNewStateID__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80267E90; // type:function size:0x10 +getOldStateID__82sStateMgr_c<13dAcObjFairy_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80267EA0; // type:function size:0x10 +finalizeState__28sFStateID_c<13dAcObjFairy_c>CFR13dAcObjFairy_c = .text:0x80267EB0; // type:function size:0x30 +executeState__28sFStateID_c<13dAcObjFairy_c>CFR13dAcObjFairy_c = .text:0x80267EE0; // type:function size:0x30 +initializeState__28sFStateID_c<13dAcObjFairy_c>CFR13dAcObjFairy_c = .text:0x80267F10; // type:function size:0x30 +__sinit_\d_a_obj_fairy_cpp = .text:0x80267F40; // type:function size:0x56C scope:local +__dt__28sFStateID_c<13dAcObjFairy_c>Fv = .text:0x802684B0; // type:function size:0x58 +isSameName__28sFStateID_c<13dAcObjFairy_c>CFPCc = .text:0x80268510; // type:function size:0x88 fn_802685A0 = .text:0x802685A0; // type:function size:0x30 fn_802685D0 = .text:0x802685D0; // type:function size:0x68 fn_80268640 = .text:0x80268640; // type:function size:0x4 @@ -14423,59 +14423,59 @@ fn_802714F0 = .text:0x802714F0; // type:function size:0x30 fn_80271520 = .text:0x80271520; // type:function size:0x27C fn_802717A0 = .text:0x802717A0; // type:function size:0x58 fn_80271800 = .text:0x80271800; // type:function size:0x88 -fn_80271890 = .text:0x80271890; // type:function size:0xE8 -fn_80271980 = .text:0x80271980; // type:function size:0x58 -fn_802719E0 = .text:0x802719E0; // type:function size:0x6C -fn_80271A50 = .text:0x80271A50; // type:function size:0xA0 -fn_80271AF0 = .text:0x80271AF0; // type:function size:0xA4 -fn_80271BA0 = .text:0x80271BA0; // type:function size:0x58 -fn_80271C00 = .text:0x80271C00; // type:function size:0x90 -fn_80271C90 = .text:0x80271C90; // type:function size:0x5C -fn_80271CF0 = .text:0x80271CF0; // type:function size:0x1CC -fn_80271EC0 = .text:0x80271EC0; // type:function size:0x10 -fn_80271ED0 = .text:0x80271ED0; // type:function size:0x1B4 -fn_80272090 = .text:0x80272090; // type:function size:0x1B4 -fn_80272250 = .text:0x80272250; // type:function size:0x10 -fn_80272260 = .text:0x80272260; // type:function size:0x158 -fn_802723C0 = .text:0x802723C0; // type:function size:0xC8 -fn_80272490 = .text:0x80272490; // type:function size:0x248 -fn_802726E0 = .text:0x802726E0; // type:function size:0x10 -fn_802726F0 = .text:0x802726F0; // type:function size:0x8 -fn_80272700 = .text:0x80272700; // type:function size:0x28 -fn_80272730 = .text:0x80272730; // type:function size:0x50 -fn_80272780 = .text:0x80272780; // type:function size:0x74 -fn_80272800 = .text:0x80272800; // type:function size:0x118 -fn_80272920 = .text:0x80272920; // type:function size:0x4 -fn_80272930 = .text:0x80272930; // type:function size:0x8 -fn_80272940 = .text:0x80272940; // type:function size:0x5C -fn_802729A0 = .text:0x802729A0; // type:function size:0x34 -fn_802729E0 = .text:0x802729E0; // type:function size:0x84 -fn_80272A70 = .text:0x80272A70; // type:function size:0x80 -fn_80272AF0 = .text:0x80272AF0; // type:function size:0x4 -fn_80272B00 = .text:0x80272B00; // type:function size:0x8 -fn_80272B10 = .text:0x80272B10; // type:function size:0x5C -fn_80272B70 = .text:0x80272B70; // type:function size:0x4 -fn_80272B80 = .text:0x80272B80; // type:function size:0x14 -fn_80272BA0 = .text:0x80272BA0; // type:function size:0x4 -fn_80272BB0 = .text:0x80272BB0; // type:function size:0x4 -fn_80272BC0 = .text:0x80272BC0; // type:function size:0xF8 -fn_80272CC0 = .text:0x80272CC0; // type:function size:0x60 -fn_80272D20 = .text:0x80272D20; // type:function size:0xC -fn_80272D30 = .text:0x80272D30; // type:function size:0x1C -fn_80272D50 = .text:0x80272D50; // type:function size:0x1C -fn_80272D70 = .text:0x80272D70; // type:function size:0x1C -fn_80272D90 = .text:0x80272D90; // type:function size:0x10 -fn_80272DA0 = .text:0x80272DA0; // type:function size:0x10 -fn_80272DB0 = .text:0x80272DB0; // type:function size:0x10 -fn_80272DC0 = .text:0x80272DC0; // type:function size:0x10 -fn_80272DD0 = .text:0x80272DD0; // type:function size:0x10 -fn_80272DE0 = .text:0x80272DE0; // type:function size:0x10 -fn_80272DF0 = .text:0x80272DF0; // type:function size:0x30 -fn_80272E20 = .text:0x80272E20; // type:function size:0x30 -fn_80272E50 = .text:0x80272E50; // type:function size:0x30 -fn_80272E80 = .text:0x80272E80; // type:function size:0x3F4 -fn_80273280 = .text:0x80273280; // type:function size:0x58 -fn_802732E0 = .text:0x802732E0; // type:function size:0x88 +dAcOsw_c_classInit__Fv = .text:0x80271890; // type:function size:0xE8 +__dt__20sFState_c<8dAcOsw_c>Fv = .text:0x80271980; // type:function size:0x58 +__dt__23sFStateFct_c<8dAcOsw_c>Fv = .text:0x802719E0; // type:function size:0x6C +__dt__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80271A50; // type:function size:0xA0 +__dt__46sFStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c>Fv = .text:0x80271AF0; // type:function size:0xA4 +__dt__19dAcOswMdlCallback_cFv = .text:0x80271BA0; // type:function size:0x58 +timingB__19dAcOswMdlCallback_cFUlPQ34nw4r3g3d13WorldMtxManipQ34nw4r3g3d6ResMdl = .text:0x80271C00; // type:function size:0x90 +isPushableBlock__FP9dAcBase_c = .text:0x80271C90; // type:function size:0x5C +interactCallback__8dAcOsw_cFPvP9dAcBase_cP12dAcObjBase_c = .text:0x80271CF0; // type:function size:0x1CC +getStateID__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80271EC0; // type:function size:0x10 +createHeap__8dAcOsw_cFv = .text:0x80271ED0; // type:function size:0x1B4 +actorCreate__8dAcOsw_cFv = .text:0x80272090; // type:function size:0x1B4 +changeState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x80272250; // type:function size:0x10 +actorPostCreate__8dAcOsw_cFv = .text:0x80272260; // type:function size:0x158 +doDelete__8dAcOsw_cFv = .text:0x802723C0; // type:function size:0xC8 +actorExecute__8dAcOsw_cFv = .text:0x80272490; // type:function size:0x248 +executeState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802726E0; // type:function size:0x10 +actorExecuteInEvent__8dAcOsw_cFv = .text:0x802726F0; // type:function size:0x8 +draw__8dAcOsw_cFv = .text:0x80272700; // type:function size:0x28 +someInteractCheck__8dAcOsw_cFb = .text:0x80272730; // type:function size:0x50 +initializeState_OnWait__8dAcOsw_cFv = .text:0x80272780; // type:function size:0x74 +executeState_OnWait__8dAcOsw_cFv = .text:0x80272800; // type:function size:0x118 +finalizeState_OnWait__8dAcOsw_cFv = .text:0x80272920; // type:function size:0x4 +initializeState_On__8dAcOsw_cFv = .text:0x80272930; // type:function size:0x8 +executeState_On__8dAcOsw_cFv = .text:0x80272940; // type:function size:0x5C +finalizeState_On__8dAcOsw_cFv = .text:0x802729A0; // type:function size:0x34 +initializeState_OffWait__8dAcOsw_cFv = .text:0x802729E0; // type:function size:0x84 +executeState_OffWait__8dAcOsw_cFv = .text:0x80272A70; // type:function size:0x80 +finalizeState_OffWait__8dAcOsw_cFv = .text:0x80272AF0; // type:function size:0x4 +initializeState_Off__8dAcOsw_cFv = .text:0x80272B00; // type:function size:0x8 +executeState_Off__8dAcOsw_cFv = .text:0x80272B10; // type:function size:0x5C +finalizeState_Off__8dAcOsw_cFv = .text:0x80272B70; // type:function size:0x4 +initializeState_None__8dAcOsw_cFv = .text:0x80272B80; // type:function size:0x14 +executeState_None__8dAcOsw_cFv = .text:0x80272BA0; // type:function size:0x4 +finalizeState_None__8dAcOsw_cFv = .text:0x80272BB0; // type:function size:0x4 +__dt__8dAcOsw_cFv = .text:0x80272BC0; // type:function size:0xF8 +build__23sFStateFct_c<8dAcOsw_c>FRC12sStateIDIf_c = .text:0x80272CC0; // type:function size:0x60 +dispose__23sFStateFct_c<8dAcOsw_c>FRP10sStateIf_c = .text:0x80272D20; // type:function size:0xC +initialize__20sFState_c<8dAcOsw_c>Fv = .text:0x80272D30; // type:function size:0x1C +execute__20sFState_c<8dAcOsw_c>Fv = .text:0x80272D50; // type:function size:0x1C +finalize__20sFState_c<8dAcOsw_c>Fv = .text:0x80272D70; // type:function size:0x1C +initializeState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80272D90; // type:function size:0x10 +finalizeState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80272DA0; // type:function size:0x10 +refreshState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80272DB0; // type:function size:0x10 +getState__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80272DC0; // type:function size:0x10 +getNewStateID__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80272DD0; // type:function size:0x10 +getOldStateID__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80272DE0; // type:function size:0x10 +finalizeState__22sFStateID_c<8dAcOsw_c>CFR8dAcOsw_c = .text:0x80272DF0; // type:function size:0x30 +executeState__22sFStateID_c<8dAcOsw_c>CFR8dAcOsw_c = .text:0x80272E20; // type:function size:0x30 +initializeState__22sFStateID_c<8dAcOsw_c>CFR8dAcOsw_c = .text:0x80272E50; // type:function size:0x30 +__sinit_\d_a_obj_switch_cpp = .text:0x80272E80; // type:function size:0x3F4 scope:local +__dt__22sFStateID_c<8dAcOsw_c>Fv = .text:0x80273280; // type:function size:0x58 +isSameName__22sFStateID_c<8dAcOsw_c>CFPCc = .text:0x802732E0; // type:function size:0x88 fn_80273370 = .text:0x80273370; // type:function size:0x30 fn_802733A0 = .text:0x802733A0; // type:function size:0x34 fn_802733E0 = .text:0x802733E0; // type:function size:0x38 @@ -14515,52 +14515,52 @@ fn_80274330 = .text:0x80274330; // type:function size:0x14 fn_80274350 = .text:0x80274350; // type:function size:0x18 fn_80274370 = .text:0x80274370; // type:function size:0x10 fn_80274380 = .text:0x80274380; // type:function size:0x5C -fn_802743E0 = .text:0x802743E0; // type:function size:0xBC -fn_802744A0 = .text:0x802744A0; // type:function size:0x58 -fn_80274500 = .text:0x80274500; // type:function size:0x6C -fn_80274570 = .text:0x80274570; // type:function size:0xA0 -fn_80274610 = .text:0x80274610; // type:function size:0xA4 -fn_802746C0 = .text:0x802746C0; // type:function size:0x1B0 -fn_80274870 = .text:0x80274870; // type:function size:0x10 -fn_80274880 = .text:0x80274880; // type:function size:0x8 -fn_80274890 = .text:0x80274890; // type:function size:0x30 -fn_802748C0 = .text:0x802748C0; // type:function size:0x10 -fn_802748D0 = .text:0x802748D0; // type:function size:0x8 -fn_802748E0 = .text:0x802748E0; // type:function size:0x70 -fn_80274950 = .text:0x80274950; // type:function size:0x70 -fn_802749C0 = .text:0x802749C0; // type:function size:0x164 -fn_80274B30 = .text:0x80274B30; // type:function size:0x64 -fn_80274BA0 = .text:0x80274BA0; // type:function size:0x48 -fn_80274BF0 = .text:0x80274BF0; // type:function size:0x120 -fn_80274D10 = .text:0x80274D10; // type:function size:0x4 -fn_80274D20 = .text:0x80274D20; // type:function size:0xC -fn_80274D30 = .text:0x80274D30; // type:function size:0x54 -fn_80274D90 = .text:0x80274D90; // type:function size:0x4 -fn_80274DA0 = .text:0x80274DA0; // type:function size:0x94 -fn_80274E40 = .text:0x80274E40; // type:function size:0x74 -fn_80274EC0 = .text:0x80274EC0; // type:function size:0x4 -fn_80274ED0 = .text:0x80274ED0; // type:function size:0xC -fn_80274EE0 = .text:0x80274EE0; // type:function size:0x104 -fn_80274FF0 = .text:0x80274FF0; // type:function size:0x4 -fn_80275000 = .text:0x80275000; // type:function size:0xD4 -fn_802750E0 = .text:0x802750E0; // type:function size:0x10 -fn_802750F0 = .text:0x802750F0; // type:function size:0x60 -fn_80275150 = .text:0x80275150; // type:function size:0xC -fn_80275160 = .text:0x80275160; // type:function size:0x1C -fn_80275180 = .text:0x80275180; // type:function size:0x1C -fn_802751A0 = .text:0x802751A0; // type:function size:0x1C -fn_802751C0 = .text:0x802751C0; // type:function size:0x10 -fn_802751D0 = .text:0x802751D0; // type:function size:0x10 -fn_802751E0 = .text:0x802751E0; // type:function size:0x10 -fn_802751F0 = .text:0x802751F0; // type:function size:0x10 -fn_80275200 = .text:0x80275200; // type:function size:0x10 -fn_80275210 = .text:0x80275210; // type:function size:0x10 -fn_80275220 = .text:0x80275220; // type:function size:0x30 -fn_80275250 = .text:0x80275250; // type:function size:0x30 -fn_80275280 = .text:0x80275280; // type:function size:0x30 -fn_802752B0 = .text:0x802752B0; // type:function size:0x338 -fn_802755F0 = .text:0x802755F0; // type:function size:0x58 -fn_80275650 = .text:0x80275650; // type:function size:0x88 +dTgSw_c_classInit__Fv = .text:0x802743E0; // type:function size:0xBC +__dt__19sFState_c<7dTgSw_c>Fv = .text:0x802744A0; // type:function size:0x58 +__dt__22sFStateFct_c<7dTgSw_c>Fv = .text:0x80274500; // type:function size:0x6C +__dt__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80274570; // type:function size:0xA0 +__dt__45sFStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c>Fv = .text:0x80274610; // type:function size:0xA4 +create__7dTgSw_cFv = .text:0x802746C0; // type:function size:0x1B0 +changeState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x80274870; // type:function size:0x10 +doDelete__7dTgSw_cFv = .text:0x80274880; // type:function size:0x8 +actorExecute__7dTgSw_cFv = .text:0x80274890; // type:function size:0x30 +executeState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802748C0; // type:function size:0x10 +draw__7dTgSw_cFv = .text:0x802748D0; // type:function size:0x8 +resetAllSwitches__7dTgSw_cFv = .text:0x802748E0; // type:function size:0x70 +resetSwitchesAfterCurrent__7dTgSw_cFv = .text:0x80274950; // type:function size:0x70 +isPuzzleSolved__7dTgSw_cFv = .text:0x802749C0; // type:function size:0x164 +isLmfBossKeyPuzzle__7dTgSw_cFv = .text:0x80274B30; // type:function size:0x64 +initializeState_OnWait__7dTgSw_cFv = .text:0x80274BA0; // type:function size:0x48 +executeState_OnWait__7dTgSw_cFv = .text:0x80274BF0; // type:function size:0x120 +finalizeState_OnWait__7dTgSw_cFv = .text:0x80274D10; // type:function size:0x4 +initializeState_On__7dTgSw_cFv = .text:0x80274D20; // type:function size:0xC +executeState_On__7dTgSw_cFv = .text:0x80274D30; // type:function size:0x54 +finalizeState_On__7dTgSw_cFv = .text:0x80274D90; // type:function size:0x4 +initializeState_OffWait__7dTgSw_cFv = .text:0x80274DA0; // type:function size:0x94 +executeState_OffWait__7dTgSw_cFv = .text:0x80274E40; // type:function size:0x74 +finalizeState_OffWait__7dTgSw_cFv = .text:0x80274EC0; // type:function size:0x4 +initializeState_Off__7dTgSw_cFv = .text:0x80274ED0; // type:function size:0xC +executeState_Off__7dTgSw_cFv = .text:0x80274EE0; // type:function size:0x104 +finalizeState_Off__7dTgSw_cFv = .text:0x80274FF0; // type:function size:0x4 +__dt__7dTgSw_cFv = .text:0x80275000; // type:function size:0xD4 +getStateID__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802750E0; // type:function size:0x10 +build__22sFStateFct_c<7dTgSw_c>FRC12sStateIDIf_c = .text:0x802750F0; // type:function size:0x60 +dispose__22sFStateFct_c<7dTgSw_c>FRP10sStateIf_c = .text:0x80275150; // type:function size:0xC +initialize__19sFState_c<7dTgSw_c>Fv = .text:0x80275160; // type:function size:0x1C +execute__19sFState_c<7dTgSw_c>Fv = .text:0x80275180; // type:function size:0x1C +finalize__19sFState_c<7dTgSw_c>Fv = .text:0x802751A0; // type:function size:0x1C +initializeState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802751C0; // type:function size:0x10 +finalizeState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802751D0; // type:function size:0x10 +refreshState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802751E0; // type:function size:0x10 +getState__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802751F0; // type:function size:0x10 +getNewStateID__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80275200; // type:function size:0x10 +getOldStateID__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80275210; // type:function size:0x10 +finalizeState__21sFStateID_c<7dTgSw_c>CFR7dTgSw_c = .text:0x80275220; // type:function size:0x30 +executeState__21sFStateID_c<7dTgSw_c>CFR7dTgSw_c = .text:0x80275250; // type:function size:0x30 +initializeState__21sFStateID_c<7dTgSw_c>CFR7dTgSw_c = .text:0x80275280; // type:function size:0x30 +__sinit_\d_t_switch_cpp = .text:0x802752B0; // type:function size:0x338 scope:local +__dt__21sFStateID_c<7dTgSw_c>Fv = .text:0x802755F0; // type:function size:0x58 +isSameName__21sFStateID_c<7dTgSw_c>CFPCc = .text:0x80275650; // type:function size:0x88 fn_802756E0 = .text:0x802756E0; // type:function size:0x4C fn_80275730 = .text:0x80275730; // type:function size:0x124 fn_80275860 = .text:0x80275860; // type:function size:0x8 @@ -17630,10 +17630,10 @@ setAnm__Q23m3d5mdl_cFRQ23m3d6banm_c = .text:0x802EBA80; // type:function size:0x play__Q23m3d5mdl_cFv = .text:0x802EBA90; // type:function size:0x34 setAnm__Q23m3d5mdl_cFRQ23m3d6banm_cf = .text:0x802EBAD0; // type:function size:0x74 setCallback__Q23m3d5mdl_cFPQ23m3d10callback_c = .text:0x802EBB50; // type:function size:0xC -fn_802EBB60 = .text:0x802EBB60; // type:function size:0x40 -fn_802EBBA0 = .text:0x802EBBA0; // type:function size:0x4 -fn_802EBBB0 = .text:0x802EBBB0; // type:function size:0x4 -fn_802EBBC0 = .text:0x802EBBC0; // type:function size:0x4 +__dt__Q23m3d10callback_cFv = .text:0x802EBB60; // type:function size:0x40 +timingA__Q23m3d10callback_cFUlPQ34nw4r3g3d12ChrAnmResultQ34nw4r3g3d6ResMdl = .text:0x802EBBA0; // type:function size:0x4 +timingB__Q23m3d10callback_cFUlPQ34nw4r3g3d13WorldMtxManipQ34nw4r3g3d6ResMdl = .text:0x802EBBB0; // type:function size:0x4 +timingC__Q23m3d10callback_cFPQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdl = .text:0x802EBBC0; // type:function size:0x4 __ct__Q23m3d9scnLeaf_cFv = .text:0x802EBBD0; // type:function size:0x4C __dt__Q23m3d9scnLeaf_cFv = .text:0x802EBC20; // type:function size:0x74 remove__Q23m3d9scnLeaf_cFv = .text:0x802EBCA0; // type:function size:0x44 @@ -19113,13 +19113,13 @@ fn_8033AA40 = .text:0x8033AA40; // type:function size:0x80 fn_8033AAC0 = .text:0x8033AAC0; // type:function size:0x44 fn_8033AB10 = .text:0x8033AB10; // type:function size:0x2C fn_8033AB40 = .text:0x8033AB40; // type:function size:0x10 -fn_8033AB50 = .text:0x8033AB50; // type:function size:0x8 +get__21CollisionCheckContextFv = .text:0x8033AB50; // type:function size:0x8 fn_8033AB60 = .text:0x8033AB60; // type:function size:0x84 fn_8033ABF0 = .text:0x8033ABF0; // type:function size:0x60 fn_8033AC50 = .text:0x8033AC50; // type:function size:0x270 fn_8033AEC0 = .text:0x8033AEC0; // type:function size:0xEC fn_8033AFB0 = .text:0x8033AFB0; // type:function size:0x80 -fn_8033B030 = .text:0x8033B030; // type:function size:0xBC +registerActorBgCollision__21CollisionCheckContextFR14ActorCollisionP12dAcObjBase_c = .text:0x8033B030; // type:function size:0xBC fn_8033B0F0 = .text:0x8033B0F0; // type:function size:0x13C fn_8033B230 = .text:0x8033B230; // type:function size:0xE4 fn_8033B320 = .text:0x8033B320; // type:function size:0x9C @@ -19423,7 +19423,7 @@ fn_80344390 = .text:0x80344390; // type:function size:0x128 fn_803444C0 = .text:0x803444C0; // type:function size:0x128 fn_803445F0 = .text:0x803445F0; // type:function size:0x144 fn_80344740 = .text:0x80344740; // type:function size:0x4C -fn_80344790 = .text:0x80344790; // type:function size:0x27C +create__14ActorCollisionFPvPvbRC6mMtx_cRC7mVec3_c = .text:0x80344790; // type:function size:0x27C fn_80344A10 = .text:0x80344A10; // type:function size:0x4 fn_80344A20 = .text:0x80344A20; // type:function size:0x4 fn_80344A30 = .text:0x80344A30; // type:function size:0x4 @@ -19485,9 +19485,9 @@ fn_80346560 = .text:0x80346560; // type:function size:0x34 fn_803465A0 = .text:0x803465A0; // type:function size:0x10 fn_803465B0 = .text:0x803465B0; // type:function size:0xC fn_803465C0 = .text:0x803465C0; // type:function size:0xC -fn_803465D0 = .text:0x803465D0; // type:function size:0x54 -fn_80346630 = .text:0x80346630; // type:function size:0x58 -fn_80346690 = .text:0x80346690; // type:function size:0x10 +__ct__14ActorCollisionFv = .text:0x803465D0; // type:function size:0x54 +__dt__14ActorCollisionFv = .text:0x80346630; // type:function size:0x58 +execute__14ActorCollisionFv = .text:0x80346690; // type:function size:0x10 fn_803466A0 = .text:0x803466A0; // type:function size:0x50 fn_803466F0 = .text:0x803466F0; // type:function size:0xA6C fn_80347160 = .text:0x80347160; // type:function size:0x178 @@ -33878,7 +33878,8 @@ lbl_8052C688 = .data:0x8052C688; // type:object size:0x2C lbl_8052C6B4 = .data:0x8052C6B4; // type:object size:0x2C lbl_8052C6E0 = .data:0x8052C6E0; // type:object size:0x2C lbl_8052C70C = .data:0x8052C70C; // type:object size:0x2C -lbl_8052C738 = .data:0x8052C738; // type:object size:0xA0 +lbl_8052C738 = .data:0x8052C738; // type:object size:0x2C +__vt__5dTg_c = .data:0x8052C764; // type:object size:0x74 lbl_8052C7D8 = .data:0x8052C7D8; // type:object size:0x4C lbl_8052C824 = .data:0x8052C824; // type:object size:0x34 lbl_8052C858 = .data:0x8052C858; // type:object size:0xC @@ -34435,12 +34436,12 @@ lbl_80534E78 = .data:0x80534E78; // type:object size:0x68 lbl_80534EE0 = .data:0x80534EE0; // type:object size:0x30 lbl_80534F10 = .data:0x80534F10; // type:object size:0xC lbl_80534F1C = .data:0x80534F1C; // type:object size:0x2C -lbl_80534F48 = .data:0x80534F48; // type:object size:0x80 +__vt__13dAcObjFairy_c = .data:0x80534F48; // type:object size:0x80 lbl_80534FC8 = .data:0x80534FC8; // type:object size:0x30 lbl_80534FF8 = .data:0x80534FF8; // type:object size:0x30 lbl_80535028 = .data:0x80535028; // type:object size:0x18 lbl_80535040 = .data:0x80535040; // type:object size:0x1F8 -lbl_80535238 = .data:0x80535238; // type:object size:0x38 +__vt__28sFStateID_c<13dAcObjFairy_c> = .data:0x80535238; // type:object size:0x38 lbl_80535270 = .data:0x80535270; // type:object size:0x10 lbl_80535280 = .data:0x80535280; // type:object size:0xC data:string lbl_8053528C = .data:0x8053528C; // type:object size:0xC @@ -34480,31 +34481,32 @@ lbl_80535B68 = .data:0x80535B68; // type:object size:0x30 lbl_80535B98 = .data:0x80535B98; // type:object size:0x18 lbl_80535BB0 = .data:0x80535BB0; // type:object size:0xF0 lbl_80535CA0 = .data:0x80535CA0; // type:object size:0x38 -lbl_80535CD8 = .data:0x80535CD8; // type:object size:0x10 +g_profile_OBJ_SW = .data:0x80535CD8; // type:object size:0x10 lbl_80535CE8 = .data:0x80535CE8; // type:object size:0xC data:string lbl_80535CF4 = .data:0x80535CF4; // type:object size:0xC data:string -lbl_80535D00 = .data:0x80535D00; // type:object size:0xC -lbl_80535D0C = .data:0x80535D0C; // type:object size:0x1C -lbl_80535D28 = .data:0x80535D28; // type:object size:0x80 -lbl_80535DA8 = .data:0x80535DA8; // type:object size:0x30 -lbl_80535DD8 = .data:0x80535DD8; // type:object size:0x30 -lbl_80535E08 = .data:0x80535E08; // type:object size:0x18 -lbl_80535E20 = .data:0x80535E20; // type:object size:0x18 -lbl_80535E38 = .data:0x80535E38; // type:object size:0x14C +SWITCH_TYPES = .data:0x80535D00; // type:object size:0xC scope:local +lbl_80535D0C = .data:0x80535D0C; // type:object size:0x16 data:string +__vt__8dAcOsw_c = .data:0x80535D28; // type:object size:0x80 +__vt__46sFStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c> = .data:0x80535DA8; // type:object size:0x30 +__vt__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x80535DD8; // type:object size:0x30 +__vt__23sFStateFct_c<8dAcOsw_c> = .data:0x80535E08; // type:object size:0x14 +__vt__20sFState_c<8dAcOsw_c> = .data:0x80535E20; // type:object size:0x18 +__vt__19dAcOswMdlCallback_c = .data:0x80535E38; // type:object size:0x18 lbl_80535F84 = .data:0x80535F84; // type:object size:0x34 lbl_80535FB8 = .data:0x80535FB8; // type:object size:0x88 lbl_80536040 = .data:0x80536040; // type:object size:0x50 lbl_80536090 = .data:0x80536090; // type:object size:0x20 lbl_805360B0 = .data:0x805360B0; // type:object size:0x88 lbl_80536138 = .data:0x80536138; // type:object size:0x78 -lbl_805361B0 = .data:0x805361B0; // type:object size:0x10 -lbl_805361C0 = .data:0x805361C0; // type:object size:0x10 -lbl_805361D0 = .data:0x805361D0; // type:object size:0x78 -lbl_80536248 = .data:0x80536248; // type:object size:0x30 -lbl_80536278 = .data:0x80536278; // type:object size:0x30 -lbl_805362A8 = .data:0x805362A8; // type:object size:0x18 -lbl_805362C0 = .data:0x805362C0; // type:object size:0x180 -lbl_80536440 = .data:0x80536440; // type:object size:0x48 +g_profile_SW_TAG = .data:0x805361B0; // type:object size:0x10 +lbl_805361C0 = .data:0x805361C0; // type:object size:0xD data:string +__vt__7dTgSw_c = .data:0x805361D0; // type:object size:0x74 +__vt__45sFStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c> = .data:0x80536248; // type:object size:0x30 +__vt__75sStateMgr_c<7dTgSw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x80536278; // type:object size:0x30 +__vt__22sFStateFct_c<7dTgSw_c> = .data:0x805362A8; // type:object size:0x14 +__vt__19sFState_c<7dTgSw_c> = .data:0x805362C0; // type:object size:0x18 +__vt__21sFStateID_c<7dTgSw_c> = .data:0x80536440; // type:object size:0x34 +lbl_80536478 = .data:0x80536478; // type:object size:0x10 lbl_80536488 = .data:0x80536488; // type:object size:0xC lbl_80536494 = .data:0x80536494; // type:object size:0xC lbl_805364A0 = .data:0x805364A0; // type:object size:0x10 @@ -38846,10 +38848,10 @@ lbl_80573A48 = .sdata:0x80573A48; // type:object size:0x8 lbl_80573A50 = .sdata:0x80573A50; // type:object size:0x4 lbl_80573A54 = .sdata:0x80573A54; // type:object size:0x4 lbl_80573A58 = .sdata:0x80573A58; // type:object size:0x8 -lbl_80573A60 = .sdata:0x80573A60; // type:object size:0x8 -lbl_80573A68 = .sdata:0x80573A68; // type:object size:0x8 -lbl_80573A70 = .sdata:0x80573A70; // type:object size:0x8 -lbl_80573A78 = .sdata:0x80573A78; // type:object size:0x8 +lbl_80573A60 = .sdata:0x80573A60; // type:object size:0x5 data:string +lbl_80573A68 = .sdata:0x80573A68; // type:object size:0x7 data:string +lbl_80573A70 = .sdata:0x80573A70; // type:object size:0x5 data:string +lbl_80573A78 = .sdata:0x80573A78; // type:object size:0x7 data:string lbl_80573A80 = .sdata:0x80573A80; // type:object size:0x8 lbl_80573A88 = .sdata:0x80573A88; // type:object size:0x8 lbl_80573A90 = .sdata:0x80573A90; // type:object size:0x8 @@ -40072,7 +40074,7 @@ lbl_80575785 = .sbss:0x80575785; // type:object size:0x1 lbl_80575786 = .sbss:0x80575786; // type:object size:0x1 data:byte lbl_80575787 = .sbss:0x80575787; // type:object size:0x1 data:byte lbl_80575788 = .sbss:0x80575788; // type:object size:0x4 data:4byte -LINK__7dPlayer = .sbss:0x8057578C; // type:object size:0x4 data:4byte +LINK__7dAcPy_c = .sbss:0x8057578C; // type:object size:0x4 data:4byte lbl_80575790 = .sbss:0x80575790; // type:object size:0x4 data:4byte lbl_80575794 = .sbss:0x80575794; // type:object size:0x4 data:4byte lbl_80575798 = .sbss:0x80575798; // type:object size:0x4 data:4byte @@ -40190,7 +40192,7 @@ lbl_805758F0 = .sbss:0x805758F0; // type:object size:0x2 data:2byte lbl_805758F4 = .sbss:0x805758F4; // type:object size:0x1 data:byte lbl_805758F8 = .sbss:0x805758F8; // type:object size:0x8 data:byte lbl_80575900 = .sbss:0x80575900; // type:object size:0x8 data:byte -lbl_80575908 = .sbss:0x80575908; // type:object size:0x8 data:byte +@GUARD@draw__13dAcObjFairy_cFv@rot = .sbss:0x80575908; // type:object size:0x8 data:byte lbl_80575910 = .sbss:0x80575910; // type:object size:0x8 data:4byte lbl_80575918 = .sbss:0x80575918; // type:object size:0x4 data:4byte lbl_8057591C = .sbss:0x8057591C; // type:object size:0x1 data:byte @@ -45390,7 +45392,7 @@ lbl_8057C4C8 = .sdata2:0x8057C4C8; // type:object size:0x4 data:float lbl_8057C4CC = .sdata2:0x8057C4CC; // type:object size:0x4 data:float lbl_8057C4D0 = .sdata2:0x8057C4D0; // type:object size:0x4 data:float lbl_8057C4D4 = .sdata2:0x8057C4D4; // type:object size:0x4 data:float -lbl_8057C4D8 = .sdata2:0x8057C4D8; // type:object size:0x8 data:float +lbl_8057C4D8 = .sdata2:0x8057C4D8; // type:object size:0x4 data:float lbl_8057C4E0 = .sdata2:0x8057C4E0; // type:object size:0x8 lbl_8057C4E8 = .sdata2:0x8057C4E8; // type:object size:0x8 data:double lbl_8057C4F0 = .sdata2:0x8057C4F0; // type:object size:0x4 data:float @@ -45401,7 +45403,7 @@ lbl_8057C500 = .sdata2:0x8057C500; // type:object size:0x8 data:float lbl_8057C508 = .sdata2:0x8057C508; // type:object size:0x4 data:float lbl_8057C50C = .sdata2:0x8057C50C; // type:object size:0x4 data:float lbl_8057C510 = .sdata2:0x8057C510; // type:object size:0x8 data:float -lbl_8057C518 = .sdata2:0x8057C518; // type:object size:0x8 data:byte +lbl_8057C518 = .sdata2:0x8057C518; // type:object size:0x4 data:byte lbl_8057C520 = .sdata2:0x8057C520; // type:object size:0x4 data:float lbl_8057C524 = .sdata2:0x8057C524; // type:object size:0x4 data:float lbl_8057C528 = .sdata2:0x8057C528; // type:object size:0x4 data:float @@ -48889,8 +48891,8 @@ lbl_805B4E68 = .bss:0x805B4E68; // type:object size:0x40 data:4byte lbl_805B4EA8 = .bss:0x805B4EA8; // type:object size:0x40 data:4byte lbl_805B4EE8 = .bss:0x805B4EE8; // type:object size:0x40 data:4byte lbl_805B4F28 = .bss:0x805B4F28; // type:object size:0x40 data:4byte -lbl_805B4F68 = .bss:0x805B4F68; // type:object size:0x30 data:4byte -lbl_805B4F98 = .bss:0x805B4F98; // type:object size:0x10 data:4byte +StateID_CatchDemo__13dAcObjFairy_c = .bss:0x805B4F68; // type:object size:0x30 data:4byte +@LOCAL@draw__13dAcObjFairy_cFv@rot = .bss:0x805B4F98; // type:object size:0x10 data:4byte lbl_805B4FA8 = .bss:0x805B4FA8; // type:object size:0x30 data:float lbl_805B4FD8 = .bss:0x805B4FD8; // type:object size:0xC data:float lbl_805B4FE4 = .bss:0x805B4FE4; // type:object size:0xC data:float @@ -48908,16 +48910,18 @@ lbl_805B5468 = .bss:0x805B5468; // type:object size:0x40 data:4byte lbl_805B54A8 = .bss:0x805B54A8; // type:object size:0x40 data:4byte lbl_805B54E8 = .bss:0x805B54E8; // type:object size:0x30 data:4byte lbl_805B5518 = .bss:0x805B5518; // type:object size:0x10 data:4byte -lbl_805B5528 = .bss:0x805B5528; // type:object size:0x10 -lbl_805B5538 = .bss:0x805B5538; // type:object size:0x40 data:4byte -lbl_805B5578 = .bss:0x805B5578; // type:object size:0x40 data:4byte -lbl_805B55B8 = .bss:0x805B55B8; // type:object size:0x40 data:4byte -lbl_805B55F8 = .bss:0x805B55F8; // type:object size:0x70 data:4byte +lbl_805B5528 = .bss:0x805B5528; // type:object size:0xC +StateID_OnWait__8dAcOsw_c = .bss:0x805B5538; // type:object size:0x30 data:4byte +StateID_On__8dAcOsw_c = .bss:0x805B5578; // type:object size:0x30 data:4byte +StateID_OffWait__8dAcOsw_c = .bss:0x805B55B8; // type:object size:0x30 data:4byte +StateID_Off__8dAcOsw_c = .bss:0x805B55F8; // type:object size:0x30 data:4byte +StateID_None__8dAcOsw_c = .bss:0x805B5638; // type:object size:0x30 data:4byte lbl_805B5668 = .bss:0x805B5668; // type:object size:0x40 -lbl_805B56A8 = .bss:0x805B56A8; // type:object size:0x10 -lbl_805B56B8 = .bss:0x805B56B8; // type:object size:0x80 data:4byte -lbl_805B5738 = .bss:0x805B5738; // type:object size:0x40 data:4byte -lbl_805B5778 = .bss:0x805B5778; // type:object size:0x30 data:4byte +lbl_805B56A8 = .bss:0x805B56A8; // type:object size:0xC +StateID_OnWait__7dTgSw_c = .bss:0x805B56B8; // type:object size:0x30 data:4byte +StateID_On__7dTgSw_c = .bss:0x805B56F8; // type:object size:0x30 data:4byte +StateID_OffWait__7dTgSw_c = .bss:0x805B5738; // type:object size:0x30 data:4byte +StateID_Off__7dTgSw_c = .bss:0x805B5778; // type:object size:0x30 data:4byte lbl_805B57A8 = .bss:0x805B57A8; // type:object size:0x18 data:4byte lbl_805B57C0 = .bss:0x805B57C0; // type:object size:0x10 lbl_805B57D0 = .bss:0x805B57D0; // type:object size:0x30 data:4byte diff --git a/configure.py b/configure.py index 3e5aa99d..1b98f6cc 100644 --- a/configure.py +++ b/configure.py @@ -321,6 +321,15 @@ def nw4rLib(lib_name, objects, extra_cflags=[]): Object(NonMatching, "toBeSorted/sound_info.cpp"), Object(NonMatching, "d/a/d_a_base.cpp"), Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_item.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_bomb.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_arrow.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_boomerang.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_fairy.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_tbox.cpp"), + Object(NonMatching, "d/a/obj/d_a_obj_time_area.cpp"), + Object(Matching, "d/a/obj/d_a_obj_switch.cpp"), + Object(Matching, "d/tg/d_t_switch.cpp"), Object(Matching, "toBeSorted/arc_managers/current_stage_arc_manager.cpp"), Object(Matching, "toBeSorted/arc_managers/oarc_manager.cpp"), Object(Matching, "toBeSorted/arc_managers/layout_arc_manager.cpp"), diff --git a/include/c/c_math.h b/include/c/c_math.h index 78e47876..7489332a 100644 --- a/include/c/c_math.h +++ b/include/c/c_math.h @@ -10,6 +10,16 @@ f32 rnd(); int rndInt(int max); f32 rndF(f32 max); f32 rndFX(f32 amp); + + +template +T calcTimer(T* value) { + if (*(T*)value != 0) { + *value = *value - 1; + } + return *value; +} + } // namespace cM #endif diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index 659a3d59..10ba7e2d 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -186,7 +186,7 @@ class dAcBase_c : public dBase_c { // Start of SoundSource stuff /* 8002d590 */ void FUN_8002d590(); /* 8002d5b0 */ void FUN_8002d5b0(); - /* 8002d5d0 */ void playSound(); + /* 8002d5d0 */ void playSound(u16 effect); /* 8002d600 */ void FUN_8002d600(); /* 8002d630 */ void FUN_8002d630(); /* 8002d6d0 */ void FUN_8002d6d0(); diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h new file mode 100644 index 00000000..65fda5ce --- /dev/null +++ b/include/d/a/d_a_player.h @@ -0,0 +1,186 @@ +#include + +class dAcPy_c : public dAcObjBase_c { +public: + dAcPy_c(); + virtual ~dAcPy_c(); + + /* vt 0x080 */ virtual void IfCurrentActionToActor(); + /* vt 0x084 */ virtual void vt_0x084(); + /* vt 0x088 */ virtual void set0x439F(); + /* vt 0x08C */ virtual void set0x43DE(); + /* vt 0x090 */ virtual void vt_0x090(); + /* vt 0x094 */ virtual void relatedToUsingItem0x11(); + /* vt 0x098 */ virtual void setPosRot(); + /* vt 0x09C */ virtual void isLiftingObject(); + /* vt 0x0A0 */ virtual void isThrowingOrRollingItem(); + /* vt 0x0A4 */ virtual void canThrowObject(); + /* vt 0x0A8 */ virtual void canRollObject(); + /* vt 0x0AC */ virtual void vt_0x0AC(); + /* vt 0x0B0 */ virtual void isCarryingBomb(); + /* vt 0x0B4 */ virtual void isPullingOutBomb(); + /* vt 0x0B8 */ virtual void isUsingHarp(); + /* vt 0x0BC */ virtual void isFinishedPlayingHarp(); + /* vt 0x0C0 */ virtual void isUsingWhip(); + /* vt 0x0C4 */ virtual void anotherThingWithWhip(); + /* vt 0x0C8 */ virtual void somethingWithWHip(); + /* vt 0x0CC */ virtual void isWhipOnObject(); + /* vt 0x0D0 */ virtual void tryGrabItemWithWhip(); + /* vt 0x0D4 */ virtual void someFloatWithWhip(); + /* vt 0x0D8 */ virtual void getItemFromClawshotsMaybe(); + /* vt 0x0DC */ virtual void vt_0x0DC(); + /* vt 0x0E0 */ virtual void isUsingBomb(); + /* vt 0x0E4 */ virtual void vt_0x0E4(); + /* vt 0x0E8 */ virtual void vt_0x0E8(); + /* vt 0x0EC */ virtual void vt_0x0EC(); + /* vt 0x0F0 */ virtual void vt_0x0F0(); + /* vt 0x0F4 */ virtual void vt_0x0F4(); + /* vt 0x0F8 */ virtual void vt_0x0F8(); + /* vt 0x0FC */ virtual void vt_0x0FC(); + /* vt 0x100 */ virtual void isCrawling(); + /* vt 0x104 */ virtual void isUsingSword(); + /* vt 0x108 */ virtual void isUsingMitts(); + /* vt 0x10C */ virtual void isUsingShield(); + /* vt 0x110 */ virtual void getTargetedActor1(); + /* vt 0x114 */ virtual void somethingWithCarriedActorFlags(); + /* vt 0x118 */ virtual dAcObjBase_c *getCurrentCarriedActor(); + /* vt 0x11C */ virtual void checkBeetleActorReferences(); + /* vt 0x120 */ virtual void getBeetleActorReferencesSize(); + /* vt 0x124 */ virtual void vt_0x124(); + /* vt 0x128 */ virtual void vt_0x128(); + /* vt 0x12C */ virtual void vt_0x12C(); + /* vt 0x130 */ virtual void isBurning(); + /* vt 0x134 */ virtual void isShocked(); + /* vt 0x138 */ virtual void isCursed(); + /* vt 0x13C */ virtual void isSmelly(); + /* vt 0x140 */ virtual void store2Floats0x4500(); + /* vt 0x144 */ virtual void setActorLinkToSomething(); + /* vt 0x148 */ virtual void applyDamageWithIFrames(); + /* vt 0x14C */ virtual void vt_0x14C(); + /* vt 0x150 */ virtual void hasLessThanQuarterHealth(); + /* vt 0x154 */ virtual void vt_0x154(); + /* vt 0x158 */ virtual void vt_0x158(); + /* vt 0x15C */ virtual void vt_0x15C(); + /* vt 0x160 */ virtual void vt_0x160(); + /* vt 0x164 */ virtual void vt_0x164(); + /* vt 0x168 */ virtual void getCurrentAnimFrame(); + /* vt 0x16C */ virtual void getFloatIfStruggling(); + /* vt 0x170 */ virtual void isSwimming(); + /* vt 0x174 */ virtual void isGustBellowsBeingBlown(); + /* vt 0x178 */ virtual void getPointedAngle(); + /* vt 0x17C */ virtual void getBellowsPosOrOtherVec3F(); + /* vt 0x180 */ virtual void setWindMillPos(); + /* vt 0x184 */ virtual void isOffeset0x435eEqual0x20(); + /* vt 0x188 */ virtual void getVec3F_Z(); + /* vt 0x18C */ virtual void somethingWithMainBodyModel(); + /* vt 0x190 */ virtual void getSheathModelMatrix(); + /* vt 0x194 */ virtual void getSwordModelMatrix(); + /* vt 0x198 */ virtual void vt_0x198(); + /* vt 0x19C */ virtual void vt_0x19C(); + /* vt 0x1A0 */ virtual void vt_0x1A0(); + /* vt 0x1A4 */ virtual void vt_0x1A4(); + /* vt 0x1A8 */ virtual void vt_0x1A8(); + /* vt 0x1AC */ virtual void vt_0x1AC(); + /* vt 0x1B0 */ virtual void isItemFairyFromBugnet(); + /* vt 0x1B4 */ virtual void isByte0x434eEqual7(); + /* vt 0x1B8 */ virtual void canHandleGameOver(); + /* vt 0x1BC */ virtual void vt_0x1BC(); + /* vt 0x1C0 */ virtual void vt_0x1C0(); + /* vt 0x1C4 */ virtual void getActorInActorRef1(); + /* vt 0x1C8 */ virtual void doesActorRef1Exist(); + /* vt 0x1CC */ virtual void unlinkActorRef1(); + /* vt 0x1D0 */ virtual void ifHasHealthAndSomethingElse(); + /* vt 0x1D4 */ virtual void isChargingWeapon(); + /* vt 0x1D8 */ virtual void isWeaponChargedFully(); + /* vt 0x1DC */ virtual void didShootBow(); + /* vt 0x1E0 */ virtual void vt_0x1E0(); + /* vt 0x1E4 */ virtual void checkRefArrayAtIndex(); + /* vt 0x1E8 */ virtual void sizeOfActorRefs_16(); + /* vt 0x1EC */ virtual void vt_0x1EC(); + /* vt 0x1F0 */ virtual void vt_0x1F0(); + /* vt 0x1F4 */ virtual void didDiveSky_and_other(); + /* vt 0x1F8 */ virtual void didDiveSky_andNotOther(); + /* vt 0x1FC */ virtual void isLandingFromSailcloth(); + /* vt 0x200 */ virtual void isBeingPulledFromRightClawshot(); + /* vt 0x204 */ virtual void isBeingPulledByLeftClawshot(); + /* vt 0x208 */ virtual void isDashing(); + /* vt 0x20C */ virtual void isSliding(); + /* vt 0x210 */ virtual void isSlding2(); + /* vt 0x214 */ virtual void vt_0x214(); + /* vt 0x218 */ virtual void isinMpPosePower(); + /* vt 0x21C */ virtual void isPushingBlock(); + /* vt 0x220 */ virtual void getRidingActor(); + /* vt 0x224 */ virtual void isRidingBall(); + /* vt 0x228 */ virtual void getRidingMinecartActor(); + /* vt 0x22C */ virtual void getTurnableSwitch(); + /* vt 0x230 */ virtual void vt_0x230(); + /* vt 0x234 */ virtual void vt_0x234(); + /* vt 0x238 */ virtual void setVecIfInFreeFall(); + /* vt 0x23C */ virtual void setActorRef10(); + /* vt 0x240 */ virtual void vt_0x240(); + /* vt 0x244 */ virtual void vt_0x244(); + /* vt 0x248 */ virtual void vt_0x248(); + /* vt 0x24C */ virtual void vt_0x24C(); + /* vt 0x250 */ virtual void vt_0x250(); + /* vt 0x254 */ virtual void isAttackingUnderground(); + /* vt 0x258 */ virtual void vt_0x258(); + /* vt 0x25C */ virtual void vt_0x25C(); + /* vt 0x260 */ virtual void vt_0x260(); + /* vt 0x264 */ virtual void getGroosenatorIfIn(); + /* vt 0x268 */ virtual void setActorRef11(); + /* vt 0x26C */ virtual void doesGameOver(); + /* vt 0x270 */ virtual void triggerExitRelated(); + /* vt 0x274 */ virtual void vt_0x274(); + /* vt 0x278 */ virtual void vt_0x278(); + /* vt 0x27C */ virtual void getSwordPos(); + /* vt 0x280 */ virtual void vt_0x280(); + /* vt 0x284 */ virtual bool isUsingBugnet() const; + /* vt 0x288 */ virtual const mVec3_c &getBugNetPos() const; + /* vt 0x28C */ virtual void isUsingBugnet1(); + /* vt 0x290 */ virtual void bugNetCollectTreasure(); + /* vt 0x294 */ virtual void somethingSwitchDials(); + /* vt 0x298 */ virtual void vt_0x298(); + /* vt 0x29C */ virtual void getDieLargeDamageDir(); + /* vt 0x2A0 */ virtual void doGameOver(); + /* vt 0x2A4 */ virtual void isRunningUpWall(); + /* vt 0x2A8 */ virtual void lookTowardItem(); + /* vt 0x2AC */ virtual void vt_0x2AC(); + /* vt 0x2B0 */ virtual void vt_0x2B0(); + /* vt 0x2B4 */ virtual void triggerMoveEventMaybe(); + /* vt 0x2B8 */ virtual void setActorRef9(); + /* vt 0x2BC */ virtual void unlinkActorRef9(); + /* vt 0x2C0 */ virtual void vt_0x2C0(); + /* vt 0x2C4 */ virtual void vt_0x2C4(); + /* vt 0x2C8 */ virtual void isRecovering(); + /* vt 0x2CC */ virtual void isDrinkingPotion(); + /* vt 0x2D0 */ virtual void isHealingShield(); + /* vt 0x2D4 */ virtual void isBottleOut(); + /* vt 0x2D8 */ virtual void isUsingBottle(); + /* vt 0x2DC */ virtual void getShieldRegenProgressMaybe(); + /* vt 0x2E0 */ virtual void vt_0x2E0(); + /* vt 0x2E4 */ virtual void someDivingHrabbingStuff(); + /* vt 0x2E8 */ virtual void vt_0x2E8(); + /* vt 0x2EC */ virtual void isOnClawTargetMaybe(); + /* vt 0x2F0 */ virtual void isMPPose(); + /* vt 0x2F4 */ virtual void isOnTightRope(); + /* vt 0x2F8 */ virtual void isOnVines(); + /* vt 0x2FC */ virtual void alwaysRet0(); + /* vt 0x300 */ virtual void canBlockAttack(); + /* vt 0x304 */ virtual void vt_0x304(); + /* vt 0x308 */ virtual void vt_0x308(); + /* vt 0x30C */ virtual void vt_0x30C(); + /* vt 0x310 */ virtual void vt_0x310(); + /* vt 0x314 */ virtual void vt_0x314(); + /* vt 0x318 */ virtual void vt_0x318(); + + /* 0x330 */ u8 unk_0x330[0x340 - 0x330]; + /* 0x340 */ u32 someFlags_0x340; + /* 0x344 */ u8 unk_0x344[0x350 - 0x344]; + /* 0x350 */ u32 someFlags_0x350; + u8 UNK_0x354[0x35C - 0x354]; + /* 0x35C */ u32 mForceOrPreventActionFlags; + /* 0x360 */ UNKWORD field_0x360; + /* 0x364 */ u32 mActionFlags; + + static dAcPy_c *LINK; +}; diff --git a/include/d/a/d_a_t_wood_area.h b/include/d/a/d_a_t_wood_area.h index 0729b9f8..baad4400 100644 --- a/include/d/a/d_a_t_wood_area.h +++ b/include/d/a/d_a_t_wood_area.h @@ -2,7 +2,6 @@ #define D_A_T_WOOD_AREA_H #include -#include #include #include #include diff --git a/include/d/a/e/d_a_e_hb_leaf.h b/include/d/a/e/d_a_e_hb_leaf.h index 5ac98cd0..ba0c3877 100644 --- a/include/d/a/e/d_a_e_hb_leaf.h +++ b/include/d/a/e/d_a_e_hb_leaf.h @@ -5,12 +5,11 @@ #include #include #include - -extern "C" bool fn_800B9D80(f32, f32, f32 *, int, const mVec3_c &, u32); +#include class dAcEhb_leaf_c : public dAcObjBase_c { public: - dAcEhb_leaf_c() : someFloat(unkFloat0), field_0x3CC(0), field_0x3DE(0) {} + dAcEhb_leaf_c() : mTimeAreaStruct(unkFloat0), field_0x3DE(0) {} virtual ~dAcEhb_leaf_c() {} virtual bool createHeap() override; virtual int create() override; @@ -27,24 +26,18 @@ class dAcEhb_leaf_c : public dAcObjBase_c { m3d::mdlAnmChr mModel; // 0x330 m3d::anmTexPat_c mAnm; // 0x398 - f32 someFloat; // 0x3C4 - UNKWORD field_0x3C8; // 0x3C8 - u8 field_0x3CC; // 0x3CC + TimeAreaStruct mTimeAreaStruct; // 0x3C4 mVec3_c mStartingPos; // 0x3D0 u16 someRot; // 0x3DC u8 field_0x3DE; // 0x3DE u8 mType; // 0x3DF - bool isNearZero() { - return fabsf(someFloat) <= FLT_EPSILON; - } - bool isHidden() { - return mType != 0 && isNearZero() ? true : false; + return mType != 0 && mTimeAreaStruct.isNearZero() ? true : false; } void doCheck() { - fn_800B9D80(10.0f, 0.2f, &someFloat, roomid, mStartingPos, 0); + mTimeAreaStruct.check(roomid, mStartingPos, 0, 10.0f, 0.2f); } int getParam1() { diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index e4ec0f2b..a5a8666c 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -24,6 +24,10 @@ struct ActorCarryStruct { /* 0x9C */ void *dtor; // ??? /* 0xA0 */ u32 field_0xA0; /* 0xA4 */ u32 field_0xA4; + + bool testCarryFlag(u32 flag) { + return (carryFlags & flag) != 0; + } }; // Ghidra: ActorObjectBase @@ -49,8 +53,11 @@ class dAcObjBase_c : public dAcBase_c { mVec3_c velocity; /* 0x15C */ mMtx_c worldMatrix; nw4r::math::AABB boundingBox; + /* 0x1A4 */ f32 mCullingDistance; + /* 0x1A8 */ f32 field_0x1A8; + /* 0x1AC */ u32 mObjectActorFlags; - u8 unk_0x1A4[0x1E8 - 0x1A4]; + u8 unk_0x1B0[0x1E8 - 0x1B0]; /* 0x1E8 */ mVec3_c posIncrements; @@ -67,8 +74,8 @@ class dAcObjBase_c : public dAcBase_c { /* 8002de80 */ static void *getOarcResFile(const char *oarcName); /* 8002de90 */ static void *getOarcModelFile(const char *oarcName); /* 8002dea0 */ static void *getOarcZev(const char *oarcName); - /* 8002deb0 */ static void *getOarcDZB(const char *dzbName); - /* 8002ded0 */ static void *getOarcPLC(const char *plcName); + /* 8002deb0 */ static void *getOarcDZB(const char *dzbName, const char *dzbName2); + /* 8002ded0 */ static void *getOarcPLC(const char *plcName, const char *plcName2); public: /* 8002def0 */ dAcObjBase_c(); @@ -105,7 +112,7 @@ class dAcObjBase_c : public dAcBase_c { /* 8002ecd0 */ void drawModel2(); /* 8002ed20 */ void fn_8002ed20(); /* 8002edb0 */ void fn_8002edb0(m3d::mShadowCircle_c& shadow, m3d::smdl_c& smdl, const mQuat_c *rot, s32, s32, f32); - /* 8002ee40 */ void drawShadow(); + /* 8002ee40 */ void drawShadow(m3d::mShadowCircle_c& shadow, void*, const mMtx_c &mtx, const mQuat_c *rot, s32, s32, s32, s32, s32, f32); /* 8002ef40 */ void createChildAttached(fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, u32 roomId); /* 8002ef40 */ void createChildNonAttached(fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, diff --git a/include/d/a/obj/d_a_obj_fairy.h b/include/d/a/obj/d_a_obj_fairy.h new file mode 100644 index 00000000..df30e8a5 --- /dev/null +++ b/include/d/a/obj/d_a_obj_fairy.h @@ -0,0 +1,50 @@ +#ifndef D_A_OBJ_FAIRY_H +#define D_A_OBJ_FAIRY_H + +#include +#include +#include +#include +#include + +class dAcObjFairy_c : public dAcObjBase_c { +public: + dAcObjFairy_c() : mStateMgr(*this, sStateID::null) {} + virtual ~dAcObjFairy_c() {} + + virtual bool createHeap() override; + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + + + STATE_FUNC_DECLARE(dAcObjFairy_c, Wait); + STATE_FUNC_DECLARE(dAcObjFairy_c, Avoid); + STATE_FUNC_DECLARE(dAcObjFairy_c, PlayerAvoid); + STATE_FUNC_DECLARE(dAcObjFairy_c, CureStart); + STATE_FUNC_DECLARE(dAcObjFairy_c, Cure); + STATE_FUNC_DECLARE(dAcObjFairy_c, CureEnd); + STATE_FUNC_DECLARE(dAcObjFairy_c, CatchDemo); + + +private: + + bool shouldAvoidLink() const; + bool isCuring() const; + bool canTargetWithBugNet() const; + + /* 0x330 */ UNKWORD field_0x330; + /* 0x334 */ m3d::mdlAnmChr mModel; + /* 0x39C */ m3d::mShadowCircle_c mShadow; + /* 0x3A4 */ u8 field_0x3A4[0x4B0 - 0x3A4]; + /* 0x4B0 */ f32 field_0x4B0; + /* 0x4B4 */ u8 field_0x4B4[0xA50 - 0x4B4]; + /* 0xA50 */ STATE_MGR_DECLARE(dAcObjFairy_c); + /* 0xA8C */ u8 field_0xA8C[0xB89 - 0xA8C]; + /* 0xB89 */ u8 field_0xB89; + + // TODO collision, effects +}; + +#endif diff --git a/include/d/a/obj/d_a_obj_switch.h b/include/d/a/obj/d_a_obj_switch.h new file mode 100644 index 00000000..335517ec --- /dev/null +++ b/include/d/a/obj/d_a_obj_switch.h @@ -0,0 +1,89 @@ +#ifndef D_A_OBJ_SWITCH_H +#define D_A_OBJ_SWITCH_H + +#include +#include +#include +#include +#include +#include + + +// OBJ_VSD? +class dAcOScatterSand_tmp : public dAcObjBase_c { +public: + /* 0x330 */ u8 field_0x330[0x6DC - 0x330]; + /* 0x6DC */ u16 field_0x6DC; + /* 0x6DE */ u8 field_0x6DE[0x6E4 - 0x6DE]; + /* 0x6E4 */ bool field_0x6E4; + + inline f32 getSomeScale() { + return scale.y * 41.65f / 100.0f; + } +}; + +/** + * A callback implementation that controls the button node in the switch model. + */ +class dAcOswMdlCallback_c : public m3d::callback_c { +public: + dAcOswMdlCallback_c() {} + virtual ~dAcOswMdlCallback_c() {} + virtual void timingB(u32, nw4r::g3d::WorldMtxManip *, nw4r::g3d::ResMdl) override; + + /* 0x04 */ f32 mElevation; + /* 0x08 */ u32 mNodeId; + + void init(u32 nodeId) { + mNodeId = nodeId; + mElevation = 0.0f; + } +}; + +class dAcOsw_c : public dAcObjBase_c { +public: + dAcOsw_c() : mStateMgr(*this, sStateID::null), field_0x5A0(0.0f) {} + virtual ~dAcOsw_c() {} + + virtual int actorCreate() override; + virtual int actorPostCreate() override; + + virtual bool createHeap() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int actorExecuteInEvent() override; + virtual int draw() override; + + bool someInteractCheck(bool); + + STATE_FUNC_DECLARE(dAcOsw_c, OnWait); + STATE_FUNC_DECLARE(dAcOsw_c, On); + STATE_FUNC_DECLARE(dAcOsw_c, OffWait); + STATE_FUNC_DECLARE(dAcOsw_c, Off); + STATE_FUNC_DECLARE(dAcOsw_c, None); + + static void interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor); + +private: + /* 0x330 */ m3d::mdl_c mModel; + /* 0x354 */ ActorCollision mCollision; + /* 0x564 */ STATE_MGR_DECLARE(dAcOsw_c); + /* 0x5A0 */ TimeAreaStruct field_0x5A0; + /* 0x5AC */ dAcRef_c mObjRef; + /* 0x5B8 */ mMtx_c field_0x5B8; + /* 0x5E8 */ f32 field_0x5E8; + /* 0x5EC */ u16 field_0x5EC; + /* 0x5EE */ u8 mOffSceneFlag; + /* 0x5EF */ u8 mOnSceneFlag; + /* 0x5F0 */ u8 mSwitchType; + /* 0x5F1 */ u8 field_0x5F1; + /* 0x5F2 */ u8 field_0x5F2; + /* 0x5F3 */ u8 field_0x5F3; + /* 0x5F4 */ u8 mActivatedByPlayer; + /* 0x5F5 */ bool mCanBeSeen; + /* 0x5F6 */ bool mShown; + /* 0x5F7 */ bool mHidden; + /* 0x5F8 */ dAcOswMdlCallback_c mButtonCtrl; +}; + +#endif diff --git a/include/d/d_player.h b/include/d/d_player.h index 7477b0a9..0c03362b 100644 --- a/include/d/d_player.h +++ b/include/d/d_player.h @@ -2,16 +2,5 @@ #define D_PLAYER_H #include -#include "d/a/obj/d_a_obj_base.h" - -class dPlayer: public dAcObjBase_c { -public: - /* 0x330 */ u8 unk_0x330[0x350 - 0x330]; - /* 0x350 */ u32 someFlags_0x350; - u8 UNK_0x354[0x35C - 0x354]; - /* 0x35C */ u32 mForceOrPreventActionFlags; - - static dPlayer *LINK; -}; #endif diff --git a/include/d/tg/d_t_switch.h b/include/d/tg/d_t_switch.h new file mode 100644 index 00000000..0e241f25 --- /dev/null +++ b/include/d/tg/d_t_switch.h @@ -0,0 +1,45 @@ +#ifndef D_T_SWITCH_H +#define D_T_SWITCH_H + +#include +#include +#include +#include + +class dTgSw_c : public dTg_c { +public: + dTgSw_c() : mStateMgr(*this, sStateID::null), mActorEvent(*this, nullptr) {} + virtual ~dTgSw_c() {} + + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + + STATE_FUNC_DECLARE(dTgSw_c, OnWait); + STATE_FUNC_DECLARE(dTgSw_c, On); + STATE_FUNC_DECLARE(dTgSw_c, OffWait); + STATE_FUNC_DECLARE(dTgSw_c, Off); + +private: + bool isLmfBossKeyPuzzle(); + void resetAllSwitches(); + void resetSwitchesAfterCurrent(); + bool isPuzzleSolved(); + + /* 0x0FC */ STATE_MGR_DECLARE(dTgSw_c); + /* 0x138 */ ActorEventRelated mActorEvent; + /* 0x188 */ u8 mSetSceneFlagId; + /* 0x189 */ u8 mTrigSceneFlagIdBegin; + /* 0x18A */ u8 mFirst2; + /* 0x18B */ u8 mSecond2; + /* 0x18C */ u8 mThird2; + /* 0x18D */ u8 mNumSwitchesToWin; + /* 0x18E */ u8 mTrigSceneFlagIdEnd; + /* 0x18F */ u8 mTimer; + /* 0x190 */ u8 mCurrentFlagPosition; + /* 0x191 */ bool mIsFsBossKeyPuzzle; + /* 0x192 */ u8 field_0x192; +}; + +#endif diff --git a/include/d/tg/d_t_timer.h b/include/d/tg/d_t_timer.h index 8bf7b15c..e8caf0fc 100644 --- a/include/d/tg/d_t_timer.h +++ b/include/d/tg/d_t_timer.h @@ -2,14 +2,9 @@ #define D_T_TIMER_H #include +#include -class dTgTimerBase_c : public dAcBase_c { -public: - virtual ~dTgTimerBase_c() {} -}; - - -class dTgTimer_c : public dTgTimerBase_c { +class dTgTimer_c : public dTg_c { public: dTgTimer_c() {} virtual ~dTgTimer_c() {} diff --git a/include/m/m3d/m_mdl.h b/include/m/m3d/m_mdl.h index 82b475e8..817e607e 100644 --- a/include/m/m3d/m_mdl.h +++ b/include/m/m3d/m_mdl.h @@ -12,10 +12,10 @@ namespace m3d { class callback_c { public: - virtual ~callback_c() {} - virtual void timingA(u32, nw4r::g3d::ChrAnmResult *, nw4r::g3d::ResMdl) {} - virtual void timingB(u32, nw4r::g3d::WorldMtxManip *, nw4r::g3d::ResMdl) {} - virtual void timingC(nw4r::math::MTX34 *, nw4r::g3d::ResMdl) {} + virtual ~callback_c(); + virtual void timingA(u32, nw4r::g3d::ChrAnmResult *, nw4r::g3d::ResMdl); + virtual void timingB(u32, nw4r::g3d::WorldMtxManip *, nw4r::g3d::ResMdl); + virtual void timingC(nw4r::math::MTX34 *, nw4r::g3d::ResMdl); }; class mdl_c : public smdl_c { diff --git a/include/m/m_mtx.h b/include/m/m_mtx.h index 788201f2..006e419d 100644 --- a/include/m/m_mtx.h +++ b/include/m/m_mtx.h @@ -22,20 +22,11 @@ class mMtx_c { // not sure if this breaks anything but we need a matrix type // with an inline copy assignment operator void set(const mMtx_c &r) { - xx = r.xx; - xy = r.xy; - xz = r.xz; - xw = r.xw; - - yx = r.yx; - yy = r.yy; - yz = r.yz; - yw = r.yw; - - zx = r.zx; - zy = r.zy; - zz = r.zz; - zw = r.zw; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 4; j++) { + m[i][j] = r.m[i][j]; + } + } } inline operator MtxRef() { diff --git a/include/nw4r/g3d/g3d_calcworld.h b/include/nw4r/g3d/g3d_calcworld.h index 7c9ef69d..b3d2973e 100644 --- a/include/nw4r/g3d/g3d_calcworld.h +++ b/include/nw4r/g3d/g3d_calcworld.h @@ -21,7 +21,27 @@ struct FuncObjCalcWorld { } }; -class WorldMtxManip {}; +class WorldMtxManip { +public: + void GetMtx(nw4r::math::MTX34 *out) { + if (out != nullptr) { + PSMTXCopy(*mpM, *out); + } + } + + void SetMtx(const nw4r::math::MTX34 *arg) { + if (arg != nullptr) { + PSMTXCopy(*arg, *mpM); + } else { + PSMTXIdentity(*mpM); + } + } + +private: + nw4r::math::MTX34 *mpM; + nw4r::math::VEC3 *mpS; + u32 *mpWMAttr; +}; // Name from ketteiban class ICalcWorldCallback { diff --git a/include/nw4r/g3d/g3d_resnode.h b/include/nw4r/g3d/g3d_resnode.h index 67506985..124edac7 100644 --- a/include/nw4r/g3d/g3d_resnode.h +++ b/include/nw4r/g3d/g3d_resnode.h @@ -24,7 +24,10 @@ struct ResNodeData { f32 FLOAT_0x38; f32 FLOAT_0x3C; f32 FLOAT_0x40; - // . . . + f32 FLOAT_0x44; + f32 FLOAT_0x48; + f32 FLOAT_0x4C; + f32 FLOAT_0x50; }; struct ResNode { diff --git a/include/s/s_StateMgr.hpp b/include/s/s_StateMgr.hpp index 09f5f217..6c486927 100644 --- a/include/s/s_StateMgr.hpp +++ b/include/s/s_StateMgr.hpp @@ -36,7 +36,7 @@ class sStateMgr_c : sStateMgrIf_c { virtual const sStateIDIf_c *getOldStateID() const { return mMethod.getOldStateID(); } // SS addition - bool isState(const sStateIDIf_c& other) { + bool isState(const sStateIDIf_c& other) const { return *getStateID() == other; } diff --git a/include/toBeSorted/actor_collision.h b/include/toBeSorted/actor_collision.h new file mode 100644 index 00000000..471f5bdf --- /dev/null +++ b/include/toBeSorted/actor_collision.h @@ -0,0 +1,36 @@ +#ifndef ACTOR_COLLISION_H +#define ACTOR_COLLISION_H + +#include +#include +#include + +class ActorCollision { +public: + ActorCollision(); + ~ActorCollision(); + + void* create(void *dzbData, void *plcData, bool b, const mMtx_c &mtx, const mVec3_c &vec); + void* create(void *dzbData, void *plcData, bool b, const mMtx_c &mtx, const mVec3_c &vec, void *callback) { + void* result = create(dzbData, plcData, b, mtx, vec); + multMatrix = callback; + return result; + } + void execute(); + + u8 field_0x00[0x1FC - 0x000]; + /* 0x1FC */ void *multMatrix; + /* 0x200 */ void *interactFunc; + /* 0x204 */ u8 field_0x204[0x210 - 0x204]; + + +}; + +class CollisionCheckContext { +public: + + static CollisionCheckContext* get(); + void registerActorBgCollision(ActorCollision&, dAcObjBase_c*); +}; + +#endif diff --git a/include/toBeSorted/actor_event.h b/include/toBeSorted/actor_event.h new file mode 100644 index 00000000..d9cdcec1 --- /dev/null +++ b/include/toBeSorted/actor_event.h @@ -0,0 +1,20 @@ +#ifndef ACTOR_EVENT_H +#define ACTOR_EVENT_H + +#include +#include +#include + +class ActorEventRelated { +public: + ActorEventRelated(dAcBase_c &owner, void *); + ~ActorEventRelated(); + + bool isThisActorInEvent(); + void scheduleEvent(Event &, u32); + +private: + u8 field_0x00[0x50 - 0x00]; +}; + +#endif diff --git a/include/toBeSorted/sceneflag_manager.h b/include/toBeSorted/sceneflag_manager.h index a8fe5112..9eb1161d 100644 --- a/include/toBeSorted/sceneflag_manager.h +++ b/include/toBeSorted/sceneflag_manager.h @@ -48,7 +48,7 @@ class SceneflagManager { u16 checkFlag(u16 roomId, u16 flag); bool checkSceneflagGlobal(u16 sceneIdx, u16 flag); bool checkTempOrSceneflag(u16 flag); - bool checkUncommittedFlag(u16 roomId, u16 flag); + u16 checkUncommittedFlag(u16 roomId, u16 flag); void setZoneflag(u16 roomId, u16 flag); void setFlag(u16 roomId, u16 flag); void setSceneflagGlobal(u16 sceneIdx, u16 flag); diff --git a/include/toBeSorted/time_area_mgr.h b/include/toBeSorted/time_area_mgr.h index ab160006..d8c0f679 100644 --- a/include/toBeSorted/time_area_mgr.h +++ b/include/toBeSorted/time_area_mgr.h @@ -30,6 +30,19 @@ class dTimeAreaMgrProcB_c : public m3d::proc_c { /* 0x1B */ u8 field_0x1B; }; +struct TimeAreaStruct { + TimeAreaStruct(f32 arg): field_0x00(arg), field_0x08(0) {} + /* 0x00 */ f32 field_0x00; + /* 0x04 */ UNKWORD field_0x04; + /* 0x08 */ u8 field_0x08; + + bool isNearZero() { + return fabsf(field_0x00) <= FLT_EPSILON; + } + + bool check(int, const mVec3_c &, u32, f32, f32); +}; + class dTimeAreaMgr_c { public: dTimeAreaMgr_c(); diff --git a/src/REL/d/a/d_a_t_wood_area.cpp b/src/REL/d/a/d_a_t_wood_area.cpp index 894fb97c..4168143a 100644 --- a/src/REL/d/a/d_a_t_wood_area.cpp +++ b/src/REL/d/a/d_a_t_wood_area.cpp @@ -1,4 +1,5 @@ #include +#include const f32 dAcTWoodArea_c::scaleX = 100.0f; const f32 dAcTWoodArea_c::scaleY = 100.0f; @@ -56,9 +57,9 @@ extern u16 PARTICLE_RESOURCE_ID_MAPPING[]; void dAcTWoodArea_c::initializeState_Wait() {} void dAcTWoodArea_c::executeState_Wait() { - if (dPlayer::LINK != nullptr && (dPlayer::LINK->someFlags_0x350 & 0x2000)) { + if (dAcPy_c::LINK != nullptr && (dAcPy_c::LINK->someFlags_0x350 & 0x2000)) { // This is a bit messed up - mVec3_c dist = position - dPlayer::LINK->position; + mVec3_c dist = position - dAcPy_c::LINK->position; f32 attachRadius = getAttachRadius(); attachRadius = attachRadius * attachRadius; if (dist.x * dist.x + dist.z * dist.z < attachRadius) { diff --git a/src/REL/d/a/e/d_a_e_hb_leaf.cpp b/src/REL/d/a/e/d_a_e_hb_leaf.cpp index 07404f43..d5099ed4 100644 --- a/src/REL/d/a/e/d_a_e_hb_leaf.cpp +++ b/src/REL/d/a/e/d_a_e_hb_leaf.cpp @@ -56,8 +56,8 @@ int dAcEhb_leaf_c::create() { } if (mType == 2) { - field_0x3CC = 1; - someFloat = 1.0f; + mTimeAreaStruct.field_0x08 = 1; + mTimeAreaStruct.field_0x00 = 1.0f; } if (mType != 0) { @@ -76,7 +76,7 @@ int dAcEhb_leaf_c::doDelete() { int dAcEhb_leaf_c::actorExecute() { if (mType != 0) { doCheck(); - if (isNearZero()) { + if (mTimeAreaStruct.isNearZero()) { return SUCCEEDED; } } @@ -84,7 +84,7 @@ int dAcEhb_leaf_c::actorExecute() { updateMatrix(); if (mType != 0) { Mtx m; - PSMTXScale(m, someFloat, someFloat, someFloat); + PSMTXScale(m, mTimeAreaStruct.field_0x00, mTimeAreaStruct.field_0x00, mTimeAreaStruct.field_0x00); PSMTXConcat(worldMatrix.m, m, worldMatrix.m); } mModel.getModel().setLocalMtx(worldMatrix); diff --git a/src/REL/d/a/obj/d_a_obj_ring.cpp b/src/REL/d/a/obj/d_a_obj_ring.cpp index e2a1372d..6d153ac3 100644 --- a/src/REL/d/a/obj/d_a_obj_ring.cpp +++ b/src/REL/d/a/obj/d_a_obj_ring.cpp @@ -1,5 +1,5 @@ #include -#include +#include SPECIAL_ACTOR_PROFILE(OBJ_RING, dAcOring_c, fProfile::OBJ_RING, 0x00f2, 0, 0x103); @@ -24,7 +24,7 @@ int dAcOring_c::create() { mModel.setLocalMtx(worldMatrix); forwardAccel = -5.0f; forwardMaxSpeed = -40.0f; - field_0x38C = dPlayer::LINK->position.y; + field_0x38C = dAcPy_c::LINK->position.y; mStateMgr.changeState(StateID_Move); return SUCCEEDED; } diff --git a/src/REL/d/t/d_t_holy_water.cpp b/src/REL/d/t/d_t_holy_water.cpp index 677281b4..8387ee5f 100644 --- a/src/REL/d/t/d_t_holy_water.cpp +++ b/src/REL/d/t/d_t_holy_water.cpp @@ -1,4 +1,4 @@ -#include +#include #include SPECIAL_ACTOR_PROFILE(TAG_HOLY_WATER, dTgHolyWater_c, fProfile::TAG_HOLY_WATER, 0x0224, 0, 4); @@ -19,7 +19,7 @@ int dTgHolyWater_c::actorExecute() { mDowsingTarget.doUnregister(); } if (isLinkNearby()) { - dPlayer::LINK->mForceOrPreventActionFlags |= 0x10000000; + dAcPy_c::LINK->mForceOrPreventActionFlags |= 0x10000000; } return SUCCEEDED; } @@ -29,7 +29,7 @@ int dTgHolyWater_c::draw() { } bool dTgHolyWater_c::isLinkNearby() { - mVec3_c diff = dPlayer::LINK->position - (position + mVec3_c::Ey * scale.y * 0.5f); + mVec3_c diff = dAcPy_c::LINK->position - (position + mVec3_c::Ey * scale.y * 0.5f); diff.x /= scale.x; diff.y /= scale.y; diff.z /= scale.z; diff --git a/src/REL/d/t/d_t_sound_area.cpp b/src/REL/d/t/d_t_sound_area.cpp index 490d6a3c..ccdba2c2 100644 --- a/src/REL/d/t/d_t_sound_area.cpp +++ b/src/REL/d/t/d_t_sound_area.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ struct Unk { extern Unk *lbl_80575D58; int dTgSndAr_c::actorExecute() { - dAcBase_c *link = dPlayer::LINK; + dAcBase_c *link = dAcPy_c::LINK; if (link != nullptr && checkPosInArea(link->position)) { link->setBit_field_0xE8(params & 0xFF); } diff --git a/src/REL/d/t/d_t_sound_area_mgr.cpp b/src/REL/d/t/d_t_sound_area_mgr.cpp index b209581a..033fb497 100644 --- a/src/REL/d/t/d_t_sound_area_mgr.cpp +++ b/src/REL/d/t/d_t_sound_area_mgr.cpp @@ -1,5 +1,5 @@ #include -#include +#include SPECIAL_ACTOR_PROFILE(SOUND_AREA_MGR, dTgSndMg_c, fProfile::SOUND_AREA_MGR, 0x0145, 0, 0); @@ -15,8 +15,8 @@ int dTgSndMg_c::doDelete() { } int dTgSndMg_c::actorExecute() { - if (dPlayer::LINK != nullptr) { - dPlayer::LINK->field_0xe8 = 0; + if (dAcPy_c::LINK != nullptr) { + dAcPy_c::LINK->field_0xe8 = 0; } mBgmFlags = 0; return SUCCEEDED; diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index c0a0e99c..3c4c247d 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -1,5 +1,6 @@ #include "d/a/d_a_base.h" -#include "d/d_player.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/a/d_a_player.h" #include "f/f_list_nd.h" #include "m/m_vec.h" #include "toBeSorted/event.h" @@ -327,7 +328,7 @@ void dAcBase_c::forEveryActor(void *func(dAcBase_c *, dAcBase_c *), dAcBase_c *p // 8002d190 mAng dAcBase_c::getXZAngleToPlayer() { - return targetAngleY(&this->position, &dPlayer::LINK->position); + return targetAngleY(&this->position, &dAcPy_c::LINK->position); } // 8002d1d0 @@ -392,24 +393,24 @@ bool dAcBase_c::getDistanceAndAngleToActor(dAcBase_c *actor, f32 distThresh, s16 // 8002d3e0 bool dAcBase_c::isWithinPlayerRadius(f32 radius) const { - f32 dist_diff = getSquareDistanceTo(dPlayer::LINK->position); + f32 dist_diff = getSquareDistanceTo(dAcPy_c::LINK->position); return dist_diff < radius * radius; } // 8002d440 bool dAcBase_c::getDistanceAndAngleToPlayer(f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX) { - return getDistanceAndAngleToActor(dPlayer::LINK, distThresh, yAngle, xAngle, outDist, outDiffAngleY, outDiffAngleX); + return getDistanceAndAngleToActor(dAcPy_c::LINK, distThresh, yAngle, xAngle, outDist, outDiffAngleY, outDiffAngleX); } // 8002d470 f32 dAcBase_c::getDistToPlayer() { - return EGG::Math::sqrt(PSVECSquareDistance(position, dPlayer::LINK->position)); + return EGG::Math::sqrt(PSVECSquareDistance(position, dAcPy_c::LINK->position)); } // 8002d4a0 f32 dAcBase_c::getSquareDistToPlayer() { - return PSVECSquareDistance(position, dPlayer::LINK->position); + return PSVECSquareDistance(position, dAcPy_c::LINK->position); } // Some weirdness with the float registers being used @@ -435,7 +436,7 @@ bool dAcBase_c::isRoomFlags_0x6_Set() { // Start of SoundSource stuff void dAcBase_c::FUN_8002d590() {} void dAcBase_c::FUN_8002d5b0() {} -void dAcBase_c::playSound() {} +void dAcBase_c::playSound(u16) {} void dAcBase_c::FUN_8002d600() {} void dAcBase_c::FUN_8002d630() {} void dAcBase_c::FUN_8002d6d0() {} diff --git a/src/d/a/d_a_player.cpp b/src/d/a/d_a_player.cpp new file mode 100644 index 00000000..f08c6dc7 --- /dev/null +++ b/src/d/a/d_a_player.cpp @@ -0,0 +1,3 @@ +#include + +dAcPy_c *dAcPy_c::LINK; diff --git a/src/d/a/obj/d_a_obj_fairy.cpp b/src/d/a/obj/d_a_obj_fairy.cpp new file mode 100644 index 00000000..6df649bd --- /dev/null +++ b/src/d/a/obj/d_a_obj_fairy.cpp @@ -0,0 +1,128 @@ +#include +#include + + +SPECIAL_ACTOR_PROFILE(OBJ_FAIRY, dAcObjFairy_c, fProfile::OBJ_FAIRY, 0x166, 0, 2); + +STATE_DEFINE(dAcObjFairy_c, Wait); +STATE_DEFINE(dAcObjFairy_c, Avoid); +STATE_DEFINE(dAcObjFairy_c, PlayerAvoid); +STATE_DEFINE(dAcObjFairy_c, CureStart); +STATE_DEFINE(dAcObjFairy_c, Cure); +STATE_DEFINE(dAcObjFairy_c, CureEnd); +STATE_DEFINE(dAcObjFairy_c, CatchDemo); + +bool dAcObjFairy_c::createHeap() { + void *file = getOarcResFile("PutFairy"); + TRY_CREATE(mModel.create(file, "PutFairy", "PutFairy_fly", &heap_allocator, 0x120)); + + return true; +} + +int dAcObjFairy_c::create() { + CREATE_ALLOCATOR(dAcObjFairy_c); + + // TODO + + mStateMgr.changeState(StateID_CureStart); + mStateMgr.changeState(StateID_Wait); + mModel.getModel().setPriorityDraw(0x7F, 0x7F); + setBoundingBox(mVec3_c(-20.0f, -200.0f, -20.0f), mVec3_c(20.0f, 20.0f, 20.0f)); + + return SUCCEEDED; +} + +int dAcObjFairy_c::doDelete() { + // TODO + + return SUCCEEDED; +} + +int dAcObjFairy_c::actorExecute() { + mStateMgr.executeState(); + + // TODO + + return SUCCEEDED; +} + +int dAcObjFairy_c::draw() { + if (!mStateMgr.isState(StateID_CatchDemo)) { + drawModelType1(&mModel.getModel()); + + if (!isCuring()) { + static mQuat_c rot(0.0f, 0.0f, 0.0f, 10.0f); + drawShadow(mShadow, nullptr, worldMatrix, &rot, -1, -1, -1, -1, -1, position.y - field_0x4B0); + } + } + + return SUCCEEDED; +} + +void dAcObjFairy_c::initializeState_Wait() {} +void dAcObjFairy_c::executeState_Wait() {} +void dAcObjFairy_c::finalizeState_Wait() {} + +void dAcObjFairy_c::initializeState_Avoid() {} +void dAcObjFairy_c::executeState_Avoid() {} +void dAcObjFairy_c::finalizeState_Avoid() { + actor_properties |= 1; +} + +void dAcObjFairy_c::initializeState_PlayerAvoid() {} +void dAcObjFairy_c::executeState_PlayerAvoid() {} +void dAcObjFairy_c::finalizeState_PlayerAvoid() { + actor_properties |= 1; +} + +void dAcObjFairy_c::initializeState_CureStart() {} +void dAcObjFairy_c::executeState_CureStart() {} +void dAcObjFairy_c::finalizeState_CureStart() {} + +void dAcObjFairy_c::initializeState_Cure() {} +void dAcObjFairy_c::executeState_Cure() {} +void dAcObjFairy_c::finalizeState_Cure() {} + +void dAcObjFairy_c::initializeState_CureEnd() {} +void dAcObjFairy_c::executeState_CureEnd() {} +void dAcObjFairy_c::finalizeState_CureEnd() {} + +void dAcObjFairy_c::initializeState_CatchDemo() {} +void dAcObjFairy_c::executeState_CatchDemo() { + if (!field_0xB89) { + mStateMgr.changeState(StateID_Wait); + } +} +void dAcObjFairy_c::finalizeState_CatchDemo() { + field_0xB89 = 0; + // TODO collision +} + +bool dAcObjFairy_c::shouldAvoidLink() const { + // TODO shuffles + if (dAcPy_c::LINK->isUsingBugnet()) { + const mVec3_c &bugNetPos = dAcPy_c::LINK->getBugNetPos(); + const mVec3_c dist = bugNetPos - position; + bool isClose = false; + if (dist.mag() < 100.0f && velocity.dot(dist) > 0.0f) { + isClose = true; + } + + return isClose; + } + + return false; +} + +bool dAcObjFairy_c::isCuring() const { + return mStateMgr.isState(StateID_CureStart) || mStateMgr.isState(StateID_Cure) || + mStateMgr.isState(StateID_CureEnd); +} + +bool dAcObjFairy_c::canTargetWithBugNet() const { + bool canTarget = false; + if (dAcPy_c::LINK != nullptr && dAcPy_c::LINK->isUsingBugnet() && !isCuring()) { + canTarget = true; + } + return canTarget; +} diff --git a/src/d/a/obj/d_a_obj_switch.cpp b/src/d/a/obj/d_a_obj_switch.cpp new file mode 100644 index 00000000..9bbce3d6 --- /dev/null +++ b/src/d/a/obj/d_a_obj_switch.cpp @@ -0,0 +1,289 @@ +#include +#include +#include +#include +#include + +SPECIAL_ACTOR_PROFILE(OBJ_SW, dAcOsw_c, fProfile::OBJ_SW, 0x12B, 0, 0x1002); + +static const char *SWITCH_TYPES[] = {"SwitchStepA", "SwitchStepB", "SwitchStepB"}; + +STATE_DEFINE(dAcOsw_c, OnWait); +STATE_DEFINE(dAcOsw_c, On); +STATE_DEFINE(dAcOsw_c, OffWait); +STATE_DEFINE(dAcOsw_c, Off); +STATE_DEFINE(dAcOsw_c, None); + +void dAcOswMdlCallback_c::timingB(u32 nodeId, nw4r::g3d::WorldMtxManip *manip, nw4r::g3d::ResMdl mdl) { + if (nodeId == mNodeId) { + mMtx_c mtx1; + mMtx_c mtx2; + manip->GetMtx(mtx1); + PSMTXTrans(mtx2, mElevation, 0.0f, 0.0f); + PSMTXConcat(mtx1, mtx2, mtx1); + manip->SetMtx(mtx1); + } +} + +static bool isPushableBlock(dAcBase_c *actor) { + return dBase_c::isActorPlayer(*actor) || actor->profile_name == fProfile::OBJ_PUSH_BLOCK || + actor->profile_name == fProfile::OBJ_KIBAKO; +} + +void dAcOsw_c::interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor) { + if (!isPushableBlock(interactor)) { + return; + } + dAcPy_c *link = dBase_c::isActorPlayer(*interactor) ? static_cast(interactor) : nullptr; + dAcOsw_c *sw = static_cast(actor); + + // halp + if (!(link == nullptr || + ((link->mActionFlags & 0x40000) == 0 && + (((link->someFlags_0x340 & 0x800000) == 0 || + ((link->getCurrentCarriedActor() != nullptr && + link->getCurrentCarriedActor()->mActorCarryInfo.testCarryFlag(0x04)))))))) { + return; + } + if (interactor->mActorCarryInfo.isCarried != 1) { + if (link == nullptr || (link->mActionFlags & 0xC70852) == 0) { + if (!sw->someInteractCheck(link != nullptr)) { + bool needsOnFlag = sw->mOnSceneFlag < 0xFF && + !SceneflagManager::sInstance->checkBoolFlag(sw->roomid, sw->mOnSceneFlag); + if (!needsOnFlag && sw->mObjRef.get() == nullptr && link != nullptr && sw->field_0x5F1 == 0 && + sw->mStateMgr.isState(StateID_On)) { + link->field_0x360 |= 0x8000; + } + } + } + interactor->mObjectActorFlags |= 0x40; + } +} + +extern "C" void fn_8033CE10(); + +bool dAcOsw_c::createHeap() { + nw4r::g3d::ResFile resFile = getOarcResFile(SWITCH_TYPES[mSwitchType]); + nw4r::g3d::ResMdl resMdl = resFile.GetResMdl(SWITCH_TYPES[mSwitchType]); + TRY_CREATE(mModel.create(resMdl, &heap_allocator, 0x20, 1, nullptr)); + + field_0x5E8 = scale.x * + (resMdl.GetResNode("base").mNode.ref().FLOAT_0x50 - resMdl.GetResNode("base").mNode.ref().FLOAT_0x44); + void *dbzData = getOarcDZB(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); + void *plcData = getOarcPLC(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); + scale.set(1.0f, 0.8f, 1.0f); + updateMatrix(); + field_0x5B8.set(worldMatrix); + mModel.setLocalMtx(worldMatrix); + return !mCollision.create(dbzData, plcData, true, field_0x5B8, scale, fn_8033CE10); +} + +int dAcOsw_c::actorCreate() { + mSwitchType = params & 0xF; + mOnSceneFlag = (params >> 0xE); + CREATE_ALLOCATOR(dAcOsw_c); + mCollision.interactFunc = interactCallback; + mModel.setCallback(&mButtonCtrl); + CollisionCheckContext::get()->registerActorBgCollision(mCollision, this); + mOffSceneFlag = (params >> 0x4); + mCanBeSeen = ((params >> 0xC) & 3) == 0; + nw4r::g3d::ResMdl resMdl = mModel.getResMdl(); + nw4r::g3d::ResNode node = resMdl.GetResNode("button"); + mButtonCtrl.init(node.GetID()); + if (mOffSceneFlag >= 0xFF) { + mStateMgr.changeState(StateID_None); + } else if (SceneflagManager::sInstance->checkBoolFlag(roomid, mOffSceneFlag)) { + mStateMgr.changeState(StateID_OffWait); + } else { + mStateMgr.changeState(StateID_OnWait); + } + setBoundingBox(mVec3_c(-90.0f, -10.0f, -90.0f), mVec3_c(90.0f, 70.0f, 90.0f)); + + return SUCCEEDED; +} + +int dAcOsw_c::actorPostCreate() { + if (mCanBeSeen) { + field_0x5A0.check(roomid, position, 0, 30.0f, 0.1f); + if (field_0x5A0.field_0x00 <= 0.0f) { + mHidden = true; + scale.set(0.0f, 0.0f, 0.0f); + } else { + mShown = true; + scale.set(1.0f, 1.0f, 1.0f); + } + } + + dAcBase_c *parent = nullptr; + do { + parent = static_cast(fManager_c::searchBaseByProfName(fProfile::OBJ_VSD, parent)); + if (parent != nullptr && nw4r::math::FAbs(parent->position.y - position.y) < 30.0f) { + if (getSquareDistanceTo(parent->position) < 900.0f) { + mObjRef.link(static_cast(parent)); + break; + } + } + } while (parent != nullptr); + mModel.setScale(scale); + return SUCCEEDED; +} + +int dAcOsw_c::doDelete() { + dAcPy_c *link = dAcPy_c::LINK; + if (mSwitchType != 1 && field_0x5F2 == 0) { + if ((link == nullptr || (link->someFlags_0x340 & 0x200) != 0) && (link == nullptr || link->roomid == roomid)) { + if (mOffSceneFlag < 0xFF && SceneflagManager::sInstance->checkBoolFlag(roomid, mOffSceneFlag)) { + SceneflagManager::sInstance->unsetFlag(roomid, mOffSceneFlag); + } + } + } + return SUCCEEDED; +} + +extern "C" u16 lbl_8057A994; +extern "C" void fn_800298B0(u16, mVec3_c *, mAng3_c *, u32, u32, u32, u32, u32); + +int dAcOsw_c::actorExecute() { + mStateMgr.executeState(); + if (mCanBeSeen) { + field_0x5A0.check(roomid, position, 0, 30.0f, 0.1f); + if (field_0x5A0.field_0x00 <= 0.0f) { + if (scale.x >= 1.0f) { + if (!mHidden) { + fn_800298B0(lbl_8057A994, &position, &rotation, 0, 0, 0, 0, 0); + playSound(0xC0B); + mHidden = true; + } + } else { + mHidden = false; + } + sLib::chase(&scale.x, 0.0f, 0.07f); + scale.y = scale.x; + scale.z = scale.x; + } else { + if (scale.x <= 0.0f) { + if (!mShown) { + fn_800298B0(lbl_8057A994, &position, &rotation, 0, 0, 0, 0, 0); + playSound(0xC0A); + mShown = true; + } + } else { + mShown = false; + } + sLib::chase(&scale.x, 1.0f, 0.07f); + scale.z = scale.x; + } + } + + updateMatrix(); + field_0x5B8.set(worldMatrix); + mMtx_c tmp; + PSMTXTrans(tmp, 0.0f, mButtonCtrl.mElevation, 0.0f); + PSMTXConcat(field_0x5B8, tmp, field_0x5B8); + mModel.setScale(scale); + mModel.setLocalMtx(worldMatrix); + mModel.calc(false); + mCollision.execute(); + field_0x5F3 = 0; + mActivatedByPlayer = 0; + field_0x5F2 = field_0x5F1; + return SUCCEEDED; +} + +int dAcOsw_c::actorExecuteInEvent() { + return SUCCEEDED; +} + +int dAcOsw_c::draw() { + drawModelType1(&mModel); + + return SUCCEEDED; +} + +bool dAcOsw_c::someInteractCheck(bool activatedByPlayer) { + mActivatedByPlayer = activatedByPlayer; + field_0x5F3 = 1; + return SceneflagManager::sInstance->checkBoolFlag(roomid, mOffSceneFlag); +} + +void dAcOsw_c::initializeState_OnWait() { + if (mOffSceneFlag < 0xFF && SceneflagManager::sInstance->checkBoolFlag(roomid, mOffSceneFlag)) { + SceneflagManager::sInstance->unsetFlag(roomid, mOffSceneFlag); + } +} +void dAcOsw_c::executeState_OnWait() { + sLib::chase(&scale.y, 0.8f, 0.12f); + if (field_0x5F1 != 0) { + field_0x5F3 = 1; + } + + dAcOScatterSand_tmp *ac = mObjRef.get(); + + if (ac != nullptr) { + if (ac != nullptr && (ac->getSomeScale() * 100.0f) <= 40.0f && !ac->field_0x6E4) { + ac->field_0x6E4 = true; + ac->field_0x6DC = 10; + } + } else { + if (field_0x5F3 != 0) { + bool doIt = false; + if ((mOnSceneFlag < 0xFF && !SceneflagManager::sInstance->checkBoolFlag(roomid, mOnSceneFlag))) { + doIt = true; + } + if (!doIt) { + mStateMgr.changeState(StateID_On); + } + } + } +} +void dAcOsw_c::finalizeState_OnWait() {} + +void dAcOsw_c::initializeState_On() { + playSound(0xA19); +} +void dAcOsw_c::executeState_On() { + if (sLib::chase(&mButtonCtrl.mElevation, -20.0f, 2.0f)) { + mStateMgr.changeState(StateID_OffWait); + } +} + +extern char lbl_805A0790[]; +extern "C" void fn_80066B00(void *, bool); +void dAcOsw_c::finalizeState_On() { + playSound(0xA18); + fn_80066B00(lbl_805A0790, true); +} + +void dAcOsw_c::initializeState_OffWait() { + if (mOffSceneFlag < 0xFF && !SceneflagManager::sInstance->checkBoolFlag(roomid, mOffSceneFlag)) { + SceneflagManager::sInstance->setFlag(roomid, mOffSceneFlag); + } + field_0x5EC = 30; + mButtonCtrl.mElevation = -20.0f; +} +void dAcOsw_c::executeState_OffWait() { + if (field_0x5F1 != 0) { + field_0x5F3 = 1; + } + if (mSwitchType != 1 && cM::calcTimer(&field_0x5EC) == 0 && field_0x5F3 == 0) { + mStateMgr.changeState(StateID_Off); + } +} +void dAcOsw_c::finalizeState_OffWait() {} + +void dAcOsw_c::initializeState_Off() { + playSound(0xA19); +} +void dAcOsw_c::executeState_Off() { + if (sLib::chase(&mButtonCtrl.mElevation, 0.0f, 2.0f)) { + mStateMgr.changeState(StateID_OnWait); + } +} +void dAcOsw_c::finalizeState_Off() {} + +void dAcOsw_c::initializeState_None() { + scale.y = 0.8f; + mButtonCtrl.mElevation = -20.0f; +} +void dAcOsw_c::executeState_None() {} +void dAcOsw_c::finalizeState_None() {} diff --git a/src/d/d_player.cpp b/src/d/d_player.cpp index a2aebf0c..1e0ef775 100644 --- a/src/d/d_player.cpp +++ b/src/d/d_player.cpp @@ -1,3 +1 @@ -#include "d/d_player.h"; - -dPlayer* dPlayer::LINK; +#include "d/d_player.h" diff --git a/src/d/tg/d_t_switch.cpp b/src/d/tg/d_t_switch.cpp new file mode 100644 index 00000000..d219443b --- /dev/null +++ b/src/d/tg/d_t_switch.cpp @@ -0,0 +1,187 @@ +#include +#include +#include +#include +#include + +SPECIAL_ACTOR_PROFILE(SW_TAG, dTgSw_c, fProfile::SW_TAG, 0x24, 0, 0); + +STATE_DEFINE(dTgSw_c, OnWait); +STATE_DEFINE(dTgSw_c, On); +STATE_DEFINE(dTgSw_c, OffWait); +STATE_DEFINE(dTgSw_c, Off); + +static const u8 D201_BossKeyPuzzleFlags[] = {0x25, 0x2E, 0x49, 0x4B}; + +int dTgSw_c::create() { + mFirst2 = params & 0b11; + if (mFirst2 >= 2) { + mFirst2 = 0; + } + mSecond2 = (params >> 2) & 0b11; + if (mSecond2 >= 3) { + mSecond2 = 0; + } + mThird2 = (params >> 4) & 0b11; + if (mThird2 >= 3) { + mThird2 = 0; + } + mSetSceneFlagId = (params >> 6) & 0xFF; + mTrigSceneFlagIdBegin = (params >> 14) & 0xFF; + mNumSwitchesToWin = (params >> 22) & 0x3F; + mTrigSceneFlagIdEnd = mNumSwitchesToWin; + if ((int)(params >> 0x1C) < 0xF) { + mTrigSceneFlagIdEnd += (params >> 0x1C); + } + + if (ScGame::isCurrentStage("D201")) { + if (roomid == 4) { + if (!SceneflagManager::sInstance->checkBoolFlag(roomid, 0x2F)) { + SceneflagManager::sInstance->unsetFlag(roomid, mSetSceneFlagId); + resetAllSwitches(); + const u8 *flag = D201_BossKeyPuzzleFlags; + for (u32 i = 0; i < 4; i++) { + SceneflagManager::sInstance->unsetFlag(roomid, *flag); + flag++; + } + } + mIsFsBossKeyPuzzle = true; + } + } + + bool b = SceneflagManager::sInstance->checkUncommittedFlag(roomid, mSetSceneFlagId); + mStateMgr.changeState(!b ? StateID_OnWait : StateID_OffWait); + return SUCCEEDED; +} + +int dTgSw_c::doDelete() { + return SUCCEEDED; +} + +int dTgSw_c::actorExecute() { + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dTgSw_c::draw() { + return SUCCEEDED; +} + +void dTgSw_c::resetAllSwitches() { + for (int i = mTrigSceneFlagIdBegin; i < mTrigSceneFlagIdBegin + mTrigSceneFlagIdEnd; i++) { + SceneflagManager::sInstance->unsetFlag(roomid, i); + } + mCurrentFlagPosition = 0; +} + +void dTgSw_c::resetSwitchesAfterCurrent() { + for (int i = mTrigSceneFlagIdBegin + mCurrentFlagPosition; i < mTrigSceneFlagIdBegin + mTrigSceneFlagIdEnd; i++) { + SceneflagManager::sInstance->unsetFlag(roomid, i); + } +} + +bool dTgSw_c::isPuzzleSolved() { + for (int i = 0; i < mCurrentFlagPosition; i++) { + if (!SceneflagManager::sInstance->checkBoolFlag(roomid, mTrigSceneFlagIdBegin + i)) { + mCurrentFlagPosition = i; + field_0x192 = 1; + } + } + + if (field_0x192 == 0 && + SceneflagManager::sInstance->checkBoolFlag(roomid, mTrigSceneFlagIdBegin + mCurrentFlagPosition)) { + mCurrentFlagPosition++; + } + + s32 numCorrectFlags = mCurrentFlagPosition; + for (int i = mCurrentFlagPosition; i < mTrigSceneFlagIdEnd; i++) { + int t = i < mNumSwitchesToWin ? i : mNumSwitchesToWin; + if (SceneflagManager::sInstance->checkBoolFlag(roomid, mTrigSceneFlagIdBegin + t)) { + field_0x192 = 1; + numCorrectFlags++; + } + } + + return numCorrectFlags >= mNumSwitchesToWin; +} + +bool dTgSw_c::isLmfBossKeyPuzzle() { + return ScGame::isCurrentStage("D300_1") && roomid == 8 && mSetSceneFlagId == 0x1C; +} + +void dTgSw_c::initializeState_OnWait() { + SceneflagManager::sInstance->unsetFlag(roomid, mSetSceneFlagId); + field_0x192 = 0; +} +void dTgSw_c::executeState_OnWait() { + bool state = isPuzzleSolved(); + if (mSecond2 == 0) { + field_0x192 = 0; + if (state) { + mStateMgr.changeState(StateID_On); + } + } else if (mSecond2 == 1) { + if (field_0x192) { + mStateMgr.changeState(StateID_Off); + } else { + if (state) { + mStateMgr.changeState(mIsFsBossKeyPuzzle ? StateID_OffWait : StateID_On); + } + } + } else if (state) { + if (field_0x192) { + mStateMgr.changeState(StateID_Off); + } else { + mStateMgr.changeState(StateID_On); + } + } +} +void dTgSw_c::finalizeState_OnWait() {} + +void dTgSw_c::initializeState_On() { + mTimer = 4; +} +void dTgSw_c::executeState_On() { + if (cM::calcTimer(&mTimer) == 0) { + mStateMgr.changeState(StateID_OffWait); + } +} +void dTgSw_c::finalizeState_On() {} + +void dTgSw_c::initializeState_OffWait() { + if (!SceneflagManager::sInstance->checkBoolFlag(roomid, mSetSceneFlagId) && isLmfBossKeyPuzzle()) { + SceneflagManager::sInstance->setFlag(roomid, 0xC0); + } + SceneflagManager::sInstance->setFlag(roomid, mSetSceneFlagId); +} +void dTgSw_c::executeState_OffWait() { + if (mFirst2 == 1 && !isPuzzleSolved()) { + SceneflagManager::sInstance->unsetFlag(roomid, mSetSceneFlagId); + mStateMgr.changeState(StateID_Off); + } +} +void dTgSw_c::finalizeState_OffWait() {} + +void dTgSw_c::initializeState_Off() { + mTimer = 4; +} +void dTgSw_c::executeState_Off() { + if (mIsFsBossKeyPuzzle && !mActorEvent.isThisActorInEvent()) { + Event event = Event("FireCandleOn", 100, 0x100001, nullptr, nullptr); + mActorEvent.scheduleEvent(event, 0); + return; + } + if (cM::calcTimer(&mTimer) == 0) { + if (mThird2 == 1) { + resetAllSwitches(); + } else if (mThird2 != 2) { + resetSwitchesAfterCurrent(); + } + + if (isLmfBossKeyPuzzle()) { + SceneflagManager::sInstance->setFlag(roomid, 0xC1); + } + mStateMgr.changeState(StateID_OnWait); + } +} +void dTgSw_c::finalizeState_Off() {} diff --git a/src/m/m3d/m_mdl.cpp b/src/m/m3d/m_mdl.cpp index a6879840..be48ea6d 100644 --- a/src/m/m3d/m_mdl.cpp +++ b/src/m/m3d/m_mdl.cpp @@ -236,4 +236,9 @@ void mdl_c::setCallback(callback_c *cb) { mpCallback->setBaseCallback(cb); } +callback_c::~callback_c() {} +void callback_c::timingA(u32, nw4r::g3d::ChrAnmResult *, nw4r::g3d::ResMdl) {} +void callback_c::timingB(u32, nw4r::g3d::WorldMtxManip *, nw4r::g3d::ResMdl) {} +void callback_c::timingC(nw4r::math::MTX34 *, nw4r::g3d::ResMdl) {} + } // namespace m3d diff --git a/src/toBeSorted/sceneflag_manager.cpp b/src/toBeSorted/sceneflag_manager.cpp index 36ab7087..a446027c 100644 --- a/src/toBeSorted/sceneflag_manager.cpp +++ b/src/toBeSorted/sceneflag_manager.cpp @@ -165,7 +165,7 @@ bool SceneflagManager::checkTempOrSceneflag(u16 flag) { return checkSceneflagGlobal(mSceneIdx, flag); } } -bool SceneflagManager::checkUncommittedFlag(u16 roomId, u16 flag) { +u16 SceneflagManager::checkUncommittedFlag(u16 roomId, u16 flag) { if (isZoneFlag(flag)) { return checkUncommittedZoneflag(roomId, flag); } else { diff --git a/src/toBeSorted/special_item_drop_mgr.cpp b/src/toBeSorted/special_item_drop_mgr.cpp index 9396bbdc..dad1148f 100644 --- a/src/toBeSorted/special_item_drop_mgr.cpp +++ b/src/toBeSorted/special_item_drop_mgr.cpp @@ -1,6 +1,6 @@ #include "m/m_vec.h" #include "m/m_Angle.h" -#include "d/d_player.h" +#include "d/a/d_a_player.h" #include "toBeSorted/special_item_drop_mgr.h" SpecialItemDropMgr* SpecialItemDropMgr::sInstance = nullptr; @@ -66,7 +66,7 @@ bool spawnSpecialDropItem(SpecialItemDropMgr *mgr, int specialItemId, int roomid currentRot = *rot; tempOther = -0xe39; } else { - currentRot = targetAngleY(&(dPlayer::LINK->position), pos); + currentRot = targetAngleY(&(dAcPy_c::LINK->position), pos); tempOther = -0x8000; currentRot += 0x4000; }