diff --git a/config/SOUE01/rels/d_a_obj_soilNP/symbols.txt b/config/SOUE01/rels/d_a_obj_soilNP/symbols.txt index 1b2a4655..b710b3f7 100644 --- a/config/SOUE01/rels/d_a_obj_soilNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_soilNP/symbols.txt @@ -81,9 +81,9 @@ lbl_255_data_1C8 = .data:0x000001C8; // type:object size:0xD8 lbl_255_data_2A0 = .data:0x000002A0; // type:object size:0x34 __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global lbl_255_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte -AcOSoil__StateID_Soil = .bss:0x00000018; // type:object size:0x40 data:4byte -AcOSoil__StateID_Hole = .bss:0x00000058; // type:object size:0x40 data:4byte -AcOSoil__StateID_Ready = .bss:0x00000098; // type:object size:0x30 data:4byte +StateID_Soil__10dAcOsoil_c = .bss:0x00000018; // type:object size:0x40 data:4byte +StateID_Hole__10dAcOsoil_c = .bss:0x00000058; // type:object size:0x40 data:4byte +StateID_Ready__10dAcOsoil_c = .bss:0x00000098; // type:object size:0x30 data:4byte lbl_255_bss_C8 = .bss:0x000000C8; // type:object size:0x1 data:byte lbl_255_bss_CC = .bss:0x000000CC; // type:object size:0xC align:4 data:float lbl_255_bss_D8 = .bss:0x000000D8; // type:object size:0x1 data:byte diff --git a/config/SOUE01/rels/d_t_insectNP/symbols.txt b/config/SOUE01/rels/d_t_insectNP/symbols.txt index 3cde2287..72b3b42e 100644 --- a/config/SOUE01/rels/d_t_insectNP/symbols.txt +++ b/config/SOUE01/rels/d_t_insectNP/symbols.txt @@ -4,7 +4,7 @@ _unresolved = .text:0x00000060; // type:function size:0x4 scope:global __register_global_object = .text:0x00000070; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global dTgInsect_c_classInit__Fv = .text:0x000000F0; // type:function size:0xE0 -__dt__20dTgInsectSupertype_cFv = .text:0x000001D0; // type:function size:0x58 +__dt__5dTg_cFv = .text:0x000001D0; // type:function size:0x58 __dt__24sFState_c<11dTgInsect_c>Fv = .text:0x00000230; // type:function size:0x58 __dt__27sFStateFct_c<11dTgInsect_c>Fv = .text:0x00000290; // type:function size:0x6C __dt__80sStateMgr_c<11dTgInsect_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000300; // type:function size:0xA0 @@ -14,10 +14,10 @@ __dt__20dAcRef_c<9dAcBase_c>Fv = .text:0x00000470; // type:function size:0x58 actorCreate__11dTgInsect_cFv = .text:0x000004D0; // type:function size:0x140 actorPostCreate__11dTgInsect_cFv = .text:0x00000610; // type:function size:0x5B8 changeState__80sStateMgr_c<11dTgInsect_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000BD0; // type:function size:0x10 -fn_450_BE0 = .text:0x00000BE0; // type:function size:0x8 -fn_450_BF0 = .text:0x00000BF0; // type:function size:0x30 +doDelete__11dTgInsect_cFv = .text:0x00000BE0; // type:function size:0x8 +actorExecute__11dTgInsect_cFv = .text:0x00000BF0; // type:function size:0x30 executeState__80sStateMgr_c<11dTgInsect_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000C20; // type:function size:0x10 -fn_450_C30 = .text:0x00000C30; // type:function size:0x8 +draw__11dTgInsect_cFv = .text:0x00000C30; // type:function size:0x8 initializeState_Wait__11dTgInsect_cFv = .text:0x00000C40; // type:function size:0x4 executeState_Wait__11dTgInsect_cFv = .text:0x00000C50; // type:function size:0x168 finalizeState_Wait__11dTgInsect_cFv = .text:0x00000DC0; // type:function size:0x4 @@ -56,25 +56,41 @@ isSameName__26sFStateID_c<11dTgInsect_c>CFPCc = .text:0x00002200; // type:functi _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_450_rodata_0 = .rodata:0x00000000; // type:object size:0x20 data:float -lbl_450_rodata_20 = .rodata:0x00000020; // type:object size:0x4 align:4 data:float -lbl_450_rodata_24 = .rodata:0x00000024; // type:object size:0xC -lbl_450_rodata_30 = .rodata:0x00000030; // type:object size:0x4 align:4 data:float -lbl_450_rodata_34 = .rodata:0x00000034; // type:object size:0x4 align:4 data:float -lbl_450_rodata_38 = .rodata:0x00000038; // type:object size:0x14 align:4 data:float -lbl_450_rodata_4C = .rodata:0x0000004C; // type:object size:0x20 align:4 data:float -lbl_450_rodata_6C = .rodata:0x0000006C; // type:object size:0x4 align:4 data:float -lbl_450_rodata_70 = .rodata:0x00000070; // type:object size:0x8 align:4 data:float +unused = .rodata:0x00000000; // type:object size:0x20 scope:local data:float +SCALE_X__11dTgInsect_c = .rodata:0x00000020; // type:object size:0x4 scope:global align:4 data:float +SCALE_Y__11dTgInsect_c = .rodata:0x00000024; // type:object size:0x4 scope:global align:4 data:float +unused2 = .rodata:0x00000028; // type:object size:0x8 scope:local data:float +lbl_450_rodata_30 = .rodata:0x00000030; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_34 = .rodata:0x00000034; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_38 = .rodata:0x00000038; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_3C = .rodata:0x0000003C; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_40 = .rodata:0x00000040; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_44 = .rodata:0x00000044; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_48 = .rodata:0x00000048; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 scope:local align:4 data:float +FLOAT_ARRAY = .rodata:0x00000050; // type:object size:0x14 scope:local align:4 data:float +lbl_450_rodata_64 = .rodata:0x00000064; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_68 = .rodata:0x00000068; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_6C = .rodata:0x0000006C; // type:object size:0x4 scope:local align:4 data:float +lbl_450_rodata_70 = .rodata:0x00000070; // type:object size:0x4 scope:local align:4 data:4byte +lbl_450_rodata_74 = .rodata:0x00000074; // type:object size:0x4 scope:local align:4 data:4byte g_profile_TAG_INSECT = .data:0x00000000; // type:object size:0x10 data:4byte jumptable_450_data_10 = .data:0x00000010; // type:object size:0x2C scope:local jumptable_450_data_3C = .data:0x0000003C; // type:object size:0x2C scope:local -__vt__11dTgInsect_c = .data:0x00000068; // type:object size:0x78 -lbl_450_data_E0 = .data:0x000000E0; // type:object size:0x30 -lbl_450_data_110 = .data:0x00000110; // type:object size:0x30 -lbl_450_data_140 = .data:0x00000140; // type:object size:0x18 -lbl_450_data_158 = .data:0x00000158; // type:object size:0x19C -lbl_450_data_2F4 = .data:0x000002F4; // type:object size:0x34 +__vt__11dTgInsect_c = .data:0x00000068; // type:object size:0x74 +__vt__50sFStateMgr_c<11dTgInsect_c,20sStateMethodUsr_FI_c> = .data:0x000000E0; // type:object size:0x30 +__vt__80sStateMgr_c<11dTgInsect_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000110; // type:object size:0x30 +__vt__27sFStateFct_c<11dTgInsect_c> = .data:0x00000140; // type:object size:0x14 +lbl_450_data_158 = .data:0x00000158; // type:object size:0x18 scope:local +__vt__5dTg_c = .data:0x00000170; // type:object size:0x74 +lbl_450_data_1E4 = .data:0x000001E4; // type:object size:0x110 +lbl_450_data_2F4 = .data:0x000002F4; // type:object size:0x34 scope:local __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_450_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte -lbl_450_bss_18 = .bss:0x00000018; // type:object size:0xC0 data:4byte -lbl_450_bss_D8 = .bss:0x000000D8; // type:object size:0x30 data:4byte +lbl_450_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local data:4byte +StateID_Wait__11dTgInsect_c = .bss:0x00000018; // type:object size:0x30 data:4byte +lbl_250_bss_48 = .bss:0x00000048; // type:object size:0x10 scope:local data:4byte +StateID_WaitCreate__11dTgInsect_c = .bss:0x00000058; // type:object size:0x30 data:4byte +lbl_250_bss_88 = .bss:0x00000088; // type:object size:0x10 scope:local data:4byte +StateID_WaitForceEscape__11dTgInsect_c = .bss:0x00000098; // type:object size:0x30 data:4byte +lbl_250_bss_C8 = .bss:0x000000C8; // type:object size:0x10 scope:local data:4byte +StateID_End__11dTgInsect_c = .bss:0x000000D8; // type:object size:0x30 data:4byte diff --git a/configure.py b/configure.py index cca0a7dc..03e61e06 100644 --- a/configure.py +++ b/configure.py @@ -2903,7 +2903,7 @@ config.libs = [ Rel(NonMatching, "d_t_harp", "REL/d/t/d_t_harp.cpp"), Rel(Matching, "d_t_heat_resist", "REL/d/t/d_t_heat_resist.cpp"), Rel(Matching, "d_t_holy_water", "REL/d/t/d_t_holy_water.cpp"), - Rel(NonMatching, "d_t_insect", "REL/d/t/d_t_insect.cpp", extra_cflags=["-opt nostrength"]), + Rel(Matching, "d_t_insect", "REL/d/t/d_t_insect.cpp"), Rel(NonMatching, "d_t_ks", "REL/d/t/d_t_ks.cpp"), Rel(NonMatching, "d_t_kytag", "REL/d/t/d_t_kytag.cpp"), Rel(NonMatching, "d_t_lb_thunder", "REL/d/t/d_t_lb_thunder.cpp"), diff --git a/include/d/t/d_t_insect.h b/include/d/t/d_t_insect.h index 560ed957..c4fae81f 100644 --- a/include/d/t/d_t_insect.h +++ b/include/d/t/d_t_insect.h @@ -2,15 +2,14 @@ #define D_T_INSECT_H #include "d/a/d_a_base.h" +#include "d/t/d_tg.h" #include "m/m_vec.h" #include "s/s_State.hpp" #include "s/s_StateMgr.hpp" -class dTgInsectSupertype_c : public dAcBase_c {}; - extern "C" bool fn_801BB750(nw4r::math::AABB *aabb, f32 f); -class dTgInsect_c : public dTgInsectSupertype_c { +class dTgInsect_c : public dTg_c { public: enum Subtype { SUBTYPE_VOLCANIC_LADYBUG = 3, @@ -40,6 +39,9 @@ public: mKillSignal = 1; } + static const f32 SCALE_X; + static const f32 SCALE_Y; + STATE_FUNC_DECLARE(dTgInsect_c, Wait); STATE_FUNC_DECLARE(dTgInsect_c, WaitCreate); STATE_FUNC_DECLARE(dTgInsect_c, WaitForceEscape); @@ -104,8 +106,11 @@ private: inline s32 getTries() { return 5; } + int doDelete() override; + int draw() override; int actorCreate() override; int actorPostCreate() override; + int actorExecute() override; }; #endif diff --git a/src/REL/d/t/d_t_insect.cpp b/src/REL/d/t/d_t_insect.cpp index 2a9f2343..17c5ebd5 100644 --- a/src/REL/d/t/d_t_insect.cpp +++ b/src/REL/d/t/d_t_insect.cpp @@ -36,8 +36,8 @@ STATE_DEFINE(dTgInsect_c, End); static const s32 unused[] = { 0x001E0100, 0, 0, 0, 0, 0, 0, 0, }; -static const f32 SCALE_X = 100; -static const f32 SCALE_Y = 100; +const f32 dTgInsect_c::SCALE_X = 100; +const f32 dTgInsect_c::SCALE_Y = 100; static const f32 unused2[] = {150, 0.5f}; @@ -156,8 +156,22 @@ int dTgInsect_c::actorPostCreate() { return SUCCEEDED; } +int dTgInsect_c::doDelete() { + return SUCCEEDED; +} + +int dTgInsect_c::actorExecute() { + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dTgInsect_c::draw() { + return SUCCEEDED; +} + void dTgInsect_c::initializeState_Wait() {} +#pragma opt_strength_reduction off void dTgInsect_c::executeState_Wait() { if (isSpawnSubtype(SPAWN_BUG_MINIGAME)) { s32 i = 0; @@ -183,6 +197,7 @@ void dTgInsect_c::executeState_Wait() { } } } +#pragma opt_strength_reduction on void dTgInsect_c::finalizeState_Wait() {} void dTgInsect_c::initializeState_WaitCreate() { if (!isSpawnSubtype(SPAWN_BUG_MINIGAME)) { @@ -192,7 +207,6 @@ void dTgInsect_c::initializeState_WaitCreate() { } } } -#pragma opt_strength_reduction on void dTgInsect_c::executeState_WaitCreate() { if (mActorNode.isLinked()) { if (mActorNode.get()->mProfileName == fProfile::OBJ_VSD || @@ -443,7 +457,7 @@ bool dTgInsect_c::shouldSpawn() { } bool dTgInsect_c::someGroundCheck(const mVec3_c &pos, s32 updateRotation) { - mVec3_c tmp = mVec3_c::Ez * (mScale.x * 100); + mVec3_c tmp = mVec3_c::Ez * (SCALE_X * mScale.x); tmp.rotY(mRotation.y); tmp += pos; dBgS_LinChk linChk; @@ -455,7 +469,7 @@ bool dTgInsect_c::someGroundCheck(const mVec3_c &pos, s32 updateRotation) { if (updateRotation != 0) { mRotation.y = yRot; } - tmp = mVec3_c::Ez * (mScale.x * 100); + tmp = mVec3_c::Ez * (SCALE_X * mScale.x); tmp.rotY(yRot); tmp += pos; linChk.Set(&pos, &tmp, nullptr); @@ -465,3 +479,7 @@ bool dTgInsect_c::someGroundCheck(const mVec3_c &pos, s32 updateRotation) { } return true; } + +void moreUnused() { + static const s32 a = 0x3a; +}