From 1a2455757a6439018d929775ffc0cdeae3e8749d Mon Sep 17 00:00:00 2001 From: Orstedra Date: Sat, 24 May 2025 14:28:22 +0200 Subject: [PATCH 1/7] Initial commit, function defs --- .../rels/d_t_gate_to_groundNP/symbols.txt | 12 ++++++------ .../SOUE01/rels/d_t_heat_resistNP/symbols.txt | 4 ++-- include/d/t/d_t_gate_to_ground.h | 6 ++++++ src/REL/d/t/d_t_gate_to_ground.cpp | 17 +++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt index 81df6ac8..f368bd1d 100644 --- a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt +++ b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt @@ -2,15 +2,15 @@ _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 dTgGateToGround_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -TgGateToGround__init = .text:0x000000D0; // type:function size:0x7C -fn_205_150 = .text:0x00000150; // type:function size:0x8 -TgGateToGround__update = .text:0x00000160; // type:function size:0x138 -TgGateToGround__updateInEvent = .text:0x000002A0; // type:function size:0x44 -fn_205_2F0 = .text:0x000002F0; // type:function size:0x8 +create__17dTgGateToGround_cFv = .text:0x000000D0; // type:function size:0x7C +doDelete__17dTgGateToGround_cFv = .text:0x00000150; // type:function size:0x8 +actorExecute__17dTgGateToGround_cFv = .text:0x00000160; // type:function size:0x138 +actorExecuteInEvent__17dTgGateToGround_cFv = .text:0x000002A0; // type:function size:0x44 +draw__17dTgGateToGround_cFv = .text:0x000002F0; // type:function size:0x8 __dt__17dTgGateToGround_cFv = .text:0x00000300; // type:function size:0x70 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global lbl_205_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float g_profile_GATE2GND_TAG = .data:0x00000000; // type:object size:0x10 lbl_205_data_10 = .data:0x00000010; // type:object size:0xC -TgGateToGround__vtable = .data:0x0000001C; // type:object size:0x74 +__vt__17dTgGateToGround_c = .data:0x0000001C; // type:object size:0x74 diff --git a/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt b/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt index 7d232197..28561637 100644 --- a/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt +++ b/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt @@ -9,6 +9,6 @@ draw__15dTgHeatResist_cFv = .text:0x000001B0; // type:function size:0x8 __dt__15dTgHeatResist_cFv = .text:0x000001C0; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_444_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float +@19473 = .rodata:0x00000000; // type:object size:0x4 data:float g_profile_TAG_HEAT_RESIST = .data:0x00000000; // type:object size:0x10 -TgHeatResist__vtable = .data:0x00000010; // type:object size:0x74 +__vt__15dTgHeatResist_c = .data:0x00000010; // type:object size:0x74 diff --git a/include/d/t/d_t_gate_to_ground.h b/include/d/t/d_t_gate_to_ground.h index 5420b738..7bb9eecc 100644 --- a/include/d/t/d_t_gate_to_ground.h +++ b/include/d/t/d_t_gate_to_ground.h @@ -8,6 +8,12 @@ public: dTgGateToGround_c() {} virtual ~dTgGateToGround_c() {} + virtual int create() override; + virtual int doDelete() override; // fn_205_150 + virtual int actorExecute() override; + virtual int actorExecuteInEvent() override; + virtual int draw() override; // fn_205_2F0 + private: }; diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index 3be6d6da..4dd24d24 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -1,3 +1,20 @@ #include "d/t/d_t_gate_to_ground.h" +#include "f/f_base.h" + + SPECIAL_ACTOR_PROFILE(GATE2GND_TAG, dTgGateToGround_c, fProfile::GATE2GND_TAG, 0x22, 0, 0); + +int dTgGateToGround_c::create() {} + +int dTgGateToGround_c::doDelete() { + return SUCCEEDED; +} + +int dTgGateToGround_c::actorExecute() {} + +int dTgGateToGround_c::actorExecuteInEvent() {} + +int dTgGateToGround_c::draw() { + return SUCCEEDED; +} From ad013ab51aa9b0e4191b4339f0eb92708002e5ad Mon Sep 17 00:00:00 2001 From: Orstedra Date: Sun, 25 May 2025 01:00:35 +0200 Subject: [PATCH 2/7] actorExecute 21% --- .../rels/d_t_gate_to_groundNP/symbols.txt | 4 +- include/d/d_camera.h | 1 + include/d/t/d_t_gate_to_ground.h | 12 +++- src/REL/d/t/d_t_gate_to_ground.cpp | 64 +++++++++++++++++-- 4 files changed, 74 insertions(+), 7 deletions(-) diff --git a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt index f368bd1d..bf8e294f 100644 --- a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt +++ b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt @@ -10,7 +10,7 @@ draw__17dTgGateToGround_cFv = .text:0x000002F0; // type:function size:0x8 __dt__17dTgGateToGround_cFv = .text:0x00000300; // type:function size:0x70 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_205_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float +@20562 = .rodata:0x00000000; // type:object size:0x4 data:float g_profile_GATE2GND_TAG = .data:0x00000000; // type:object size:0x10 -lbl_205_data_10 = .data:0x00000010; // type:object size:0xC +@20583 = .data:0x00000010; // type:object size:0xC __vt__17dTgGateToGround_c = .data:0x0000001C; // type:object size:0x74 diff --git a/include/d/d_camera.h b/include/d/d_camera.h index ad114811..7464f339 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -6,6 +6,7 @@ extern "C" bool fn_80081FE0(void *, const char *); extern "C" bool fn_800918E0(void *, s32, s16); +extern "C" void fn_80080960(void *, int, int, int, int); class dCamera_c : public dBase_c { public: diff --git a/include/d/t/d_t_gate_to_ground.h b/include/d/t/d_t_gate_to_ground.h index 7bb9eecc..e0fa770c 100644 --- a/include/d/t/d_t_gate_to_ground.h +++ b/include/d/t/d_t_gate_to_ground.h @@ -1,11 +1,15 @@ #ifndef D_T_GATE_TO_GROUND_H #define D_T_GATE_TO_GROUND_H +#include "common.h" #include "d/a/d_a_base.h" +#include "m/m_mtx.h" +#include "toBeSorted/actor_event.h" +#include "toBeSorted/event.h" class dTgGateToGround_c : public dAcBase_c { public: - dTgGateToGround_c() {} + dTgGateToGround_c() : mEventRelated(*this, nullptr) {} virtual ~dTgGateToGround_c() {} virtual int create() override; @@ -15,6 +19,12 @@ public: virtual int draw() override; // fn_205_2F0 private: + ActorEventRelated mEventRelated; + /* 0x14c */ mMtx_c matrix; + int delayFrames; + /* 0x180 */ s16 params_FF_FF_00_00; + /* 0x182 */ u8 params_00_00_FF_00; + /* 0x183 */ u8 params_00_00_00_FF; }; #endif diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index 4dd24d24..d02610a7 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -1,19 +1,75 @@ #include "d/t/d_t_gate_to_ground.h" +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/d_camera.h" +#include "d/d_player_act.h" +#include "d/d_sc_game.h" +#include "d/flag/storyflag_manager.h" #include "f/f_base.h" - +#include "toBeSorted/actor_event.h" +#include "toBeSorted/area_math.h" +#include "toBeSorted/event.h" SPECIAL_ACTOR_PROFILE(GATE2GND_TAG, dTgGateToGround_c, fProfile::GATE2GND_TAG, 0x22, 0, 0); -int dTgGateToGround_c::create() {} +int dTgGateToGround_c::create() { + matrixCreateFromPosRotYScale(matrix, position, rotation.y, mScale, nullptr, 0.0f); + + delayFrames = 0; + + union { + u32 val; + struct { + u16 a; + u8 b; + u8 c; + }; + } v; + v.val = params; + params_FF_FF_00_00 = v.a; + params_00_00_FF_00 = v.b; + params_00_00_00_FF = v.c; + + return SUCCEEDED; +} int dTgGateToGround_c::doDelete() { return SUCCEEDED; } -int dTgGateToGround_c::actorExecute() {} +int dTgGateToGround_c::actorExecute() { + dAcPy_c *player; + dCamera_c *camera; -int dTgGateToGround_c::actorExecuteInEvent() {} + if (params_FF_FF_00_00 == -1 || StoryflagManager::sInstance->getCounterOrFlag(params_FF_FF_00_00) != 0) { + player = dAcPy_c::LINK; + if (checkIfVec3fInMatrix(matrix, player->position)) { + if (player->getRidingActorType() == dAcPy_c::RIDING_LOFTWING) { + if (params_00_00_00_FF != -1) { + camera = dScGame_c::getCamera(0); + fn_80080960(camera->getField_0xD98(), params_00_00_00_FF, 0, roomid, 0); + } + delayFrames = 0; + } else if (delayFrames < 16) { + ++delayFrames; + } else { + Event e = Event("CloudHole", 100, 0, 0, 0); + mEventRelated.scheduleEvent(e, 0); + } + } else { + delayFrames = 0; + } + } + return SUCCEEDED; +} + +int dTgGateToGround_c::actorExecuteInEvent() { + if (mEventRelated.isThisActorInEvent() != 0) { + mEventRelated.advanceNext(); + } + return SUCCEEDED; +} int dTgGateToGround_c::draw() { return SUCCEEDED; From 72a2360e0905b39f5b1bb4b9489e856c2afe3e94 Mon Sep 17 00:00:00 2001 From: Orstedra Date: Sun, 25 May 2025 18:45:46 +0200 Subject: [PATCH 3/7] 99 --- src/REL/d/t/d_t_gate_to_ground.cpp | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index d02610a7..01f816d7 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -3,7 +3,6 @@ #include "common.h" #include "d/a/d_a_player.h" #include "d/d_camera.h" -#include "d/d_player_act.h" #include "d/d_sc_game.h" #include "d/flag/storyflag_manager.h" #include "f/f_base.h" @@ -40,27 +39,33 @@ int dTgGateToGround_c::doDelete() { int dTgGateToGround_c::actorExecute() { dAcPy_c *player; - dCamera_c *camera; + dCamera_c *cam; - if (params_FF_FF_00_00 == -1 || StoryflagManager::sInstance->getCounterOrFlag(params_FF_FF_00_00) != 0) { - player = dAcPy_c::LINK; - if (checkIfVec3fInMatrix(matrix, player->position)) { - if (player->getRidingActorType() == dAcPy_c::RIDING_LOFTWING) { - if (params_00_00_00_FF != -1) { - camera = dScGame_c::getCamera(0); - fn_80080960(camera->getField_0xD98(), params_00_00_00_FF, 0, roomid, 0); - } - delayFrames = 0; - } else if (delayFrames < 16) { - ++delayFrames; - } else { - Event e = Event("CloudHole", 100, 0, 0, 0); + if (params_FF_FF_00_00 != -1 && StoryflagManager::sInstance->getCounterOrFlag(params_FF_FF_00_00) == 0) { + return SUCCEEDED; + } + + player = dAcPy_c::LINK; + + if (checkIfVec3fInMatrix(matrix, player->position)) { + if (player->getRidingActorType() != dAcPy_c::RIDING_LOFTWING) { + if (delayFrames > 15) { + Event e("CloudHole", 100, 0, nullptr, nullptr); mEventRelated.scheduleEvent(e, 0); + } else { + delayFrames++; } } else { + if ((s8)params_00_00_00_FF != -1) { + cam = dScGame_c::getCamera(0); + fn_80080960(cam->getField_0xD98(), (s8)params_00_00_00_FF, 0, (s8)roomid, 0); + } delayFrames = 0; } + } else { + delayFrames = 0; } + return SUCCEEDED; } From b8f2dabe0a6b36a1d03e39d6d08218fd54732f61 Mon Sep 17 00:00:00 2001 From: Orstedra Date: Sun, 25 May 2025 19:09:05 +0200 Subject: [PATCH 4/7] 100% --- include/d/d_camera.h | 2 +- include/d/t/d_t_gate_to_ground.h | 13 ++++++------- src/REL/d/t/d_t_gate_to_ground.cpp | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/d/d_camera.h b/include/d/d_camera.h index 7464f339..d641e098 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -6,7 +6,7 @@ extern "C" bool fn_80081FE0(void *, const char *); extern "C" bool fn_800918E0(void *, s32, s16); -extern "C" void fn_80080960(void *, int, int, int, int); +extern "C" void fn_80080960(void *, s32, s32, s8, s32); class dCamera_c : public dBase_c { public: diff --git a/include/d/t/d_t_gate_to_ground.h b/include/d/t/d_t_gate_to_ground.h index e0fa770c..05b95140 100644 --- a/include/d/t/d_t_gate_to_ground.h +++ b/include/d/t/d_t_gate_to_ground.h @@ -2,12 +2,11 @@ #define D_T_GATE_TO_GROUND_H #include "common.h" -#include "d/a/d_a_base.h" +#include "d/t/d_tg.h" #include "m/m_mtx.h" #include "toBeSorted/actor_event.h" -#include "toBeSorted/event.h" -class dTgGateToGround_c : public dAcBase_c { +class dTgGateToGround_c : public dTg_c { public: dTgGateToGround_c() : mEventRelated(*this, nullptr) {} virtual ~dTgGateToGround_c() {} @@ -19,12 +18,12 @@ public: virtual int draw() override; // fn_205_2F0 private: - ActorEventRelated mEventRelated; + /* 0xfc */ ActorEventRelated mEventRelated; /* 0x14c */ mMtx_c matrix; - int delayFrames; + /* 0x17c */ int delayFrames; /* 0x180 */ s16 params_FF_FF_00_00; - /* 0x182 */ u8 params_00_00_FF_00; - /* 0x183 */ u8 params_00_00_00_FF; + /* 0x182 */ s8 params_00_00_FF_00; + /* 0x183 */ s8 params_00_00_00_FF; }; #endif diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index 01f816d7..fb2dfa6a 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -56,9 +56,9 @@ int dTgGateToGround_c::actorExecute() { delayFrames++; } } else { - if ((s8)params_00_00_00_FF != -1) { + if (params_00_00_00_FF != -1) { cam = dScGame_c::getCamera(0); - fn_80080960(cam->getField_0xD98(), (s8)params_00_00_00_FF, 0, (s8)roomid, 0); + fn_80080960(cam->getField_0xD98(), params_00_00_00_FF, 0, roomid, 0); } delayFrames = 0; } From 472355524f5bc5bd6b6fdf1d207f1cc33ce37894 Mon Sep 17 00:00:00 2001 From: Orstedra Date: Sun, 25 May 2025 19:11:39 +0200 Subject: [PATCH 5/7] configure.py --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index e4a5ed71..6e91788a 100644 --- a/configure.py +++ b/configure.py @@ -2470,7 +2470,7 @@ config.libs = [ Rel(NonMatching, "d_t_effect_gen", "REL/d/t/d_t_effect_gen.cpp"), Rel(Matching, "d_t_fairytag", "REL/d/t/d_t_fairytag.cpp"), Rel(NonMatching, "d_t_fence_synchronizer", "REL/d/t/d_t_fence_synchronizer.cpp"), - Rel(NonMatching, "d_t_gate_to_ground", "REL/d/t/d_t_gate_to_ground.cpp"), + Rel(Matching, "d_t_gate_to_ground", "REL/d/t/d_t_gate_to_ground.cpp"), Rel(Matching, "d_t_gekotag", "REL/d/t/d_t_gekotag.cpp"), Rel(Matching, "d_t_genki_dws_tgt", "REL/d/t/d_t_genki_dws_tgt.cpp"), Rel(NonMatching, "d_t_group_summon", "REL/d/t/d_t_group_summon.cpp"), From 2309b88355d2ca49c1f7f21474481d413e8d6fae Mon Sep 17 00:00:00 2001 From: Orstedra <115906093+Orstedra@users.noreply.github.com> Date: Sun, 25 May 2025 20:57:43 +0200 Subject: [PATCH 6/7] Update symbols.txt Added scope:local to @ --- config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt index bf8e294f..00eb2edf 100644 --- a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt +++ b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt @@ -10,7 +10,7 @@ draw__17dTgGateToGround_cFv = .text:0x000002F0; // type:function size:0x8 __dt__17dTgGateToGround_cFv = .text:0x00000300; // type:function size:0x70 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -@20562 = .rodata:0x00000000; // type:object size:0x4 data:float +@20562 = .rodata:0x00000000; // type:object size:0x4 data:float scope:local g_profile_GATE2GND_TAG = .data:0x00000000; // type:object size:0x10 -@20583 = .data:0x00000010; // type:object size:0xC +@20583 = .data:0x00000010; // type:object size:0xC scope:local __vt__17dTgGateToGround_c = .data:0x0000001C; // type:object size:0x74 From 2c23e69524ba5330c9add666aee12e772876ca3f Mon Sep 17 00:00:00 2001 From: Orstedra <115906093+Orstedra@users.noreply.github.com> Date: Sun, 25 May 2025 21:32:14 +0200 Subject: [PATCH 7/7] Update include/d/t/d_t_gate_to_ground.h Co-authored-by: robojumper --- include/d/t/d_t_gate_to_ground.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/d/t/d_t_gate_to_ground.h b/include/d/t/d_t_gate_to_ground.h index 05b95140..880417ea 100644 --- a/include/d/t/d_t_gate_to_ground.h +++ b/include/d/t/d_t_gate_to_ground.h @@ -20,7 +20,7 @@ public: private: /* 0xfc */ ActorEventRelated mEventRelated; /* 0x14c */ mMtx_c matrix; - /* 0x17c */ int delayFrames; + /* 0x17c */ s32 delayFrames; /* 0x180 */ s16 params_FF_FF_00_00; /* 0x182 */ s8 params_00_00_FF_00; /* 0x183 */ s8 params_00_00_00_FF;