From df526e388b39951947717c1e6d6fc081171c25a1 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 24 May 2024 10:33:21 +0200 Subject: [PATCH] 3 rels --- .../rels/d_t_light_shaft_effNP/splits.txt | 3 ++- .../rels/d_t_light_shaft_effNP/symbols.txt | 16 ++++++------- config/SOUE01/rels/d_t_map_instNP/splits.txt | 3 ++- config/SOUE01/rels/d_t_map_instNP/symbols.txt | 16 ++++++------- config/SOUE01/rels/d_t_tackleNP/splits.txt | 3 ++- config/SOUE01/rels/d_t_tackleNP/symbols.txt | 16 ++++++------- configure.py | 6 ++--- include/d/a/d_a_base.h | 15 +++++++++++- include/d/tg/d_tg.h | 23 +++++++++++++++++++ src/REL/d/t/d_t_light_shaft_eff.cpp | 13 +++++++++++ src/REL/d/t/d_t_map_inst.cpp | 23 +++++++++++++++++++ src/REL/d/t/d_t_tackle.cpp | 13 +++++++++++ src/d/a/d_a_base.cpp | 2 +- 13 files changed, 120 insertions(+), 32 deletions(-) create mode 100644 include/d/tg/d_tg.h diff --git a/config/SOUE01/rels/d_t_light_shaft_effNP/splits.txt b/config/SOUE01/rels/d_t_light_shaft_effNP/splits.txt index b8f78807..d6482ee9 100644 --- a/config/SOUE01/rels/d_t_light_shaft_effNP/splits.txt +++ b/config/SOUE01/rels/d_t_light_shaft_effNP/splits.txt @@ -2,7 +2,7 @@ Sections: .text type:code align:16 .ctors type:rodata align:4 .dtors type:rodata align:4 - .rodata type:rodata align:8 + .data type:data align:8 .bss type:bss align:8 REL/executor.c: @@ -10,3 +10,4 @@ REL/executor.c: REL/d/t/d_t_light_shaft_eff.cpp: .text start:0x00000070 end:0x0000015C + .data start:0x00000000 end:0x00000084 diff --git a/config/SOUE01/rels/d_t_light_shaft_effNP/symbols.txt b/config/SOUE01/rels/d_t_light_shaft_effNP/symbols.txt index 4e9e9ee6..cc0d5627 100644 --- a/config/SOUE01/rels/d_t_light_shaft_effNP/symbols.txt +++ b/config/SOUE01/rels/d_t_light_shaft_effNP/symbols.txt @@ -1,13 +1,13 @@ _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 -fn_593_70 = .text:0x00000070; // type:function size:0x4C -fn_593_C0 = .text:0x000000C0; // type:function size:0x8 -fn_593_D0 = .text:0x000000D0; // type:function size:0x8 -fn_593_E0 = .text:0x000000E0; // type:function size:0x8 -fn_593_F0 = .text:0x000000F0; // type:function size:0x8 -fn_593_100 = .text:0x00000100; // type:function size:0x5C +construct__18dTgLightShaftEff_cFv = .text:0x00000070; // type:function size:0x4C +create__5dTg_cFv = .text:0x000000C0; // type:function size:0x8 +doDelete__5dTg_cFv = .text:0x000000D0; // type:function size:0x8 +actorExecute__5dTg_cFv = .text:0x000000E0; // type:function size:0x8 +draw__5dTg_cFv = .text:0x000000F0; // type:function size:0x8 +__dt__18dTgLightShaftEff_cFv = .text:0x00000100; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_593_section4_0 = .rodata:0x00000000; // type:object size:0x10 -lbl_593_section4_10 = .rodata:0x00000010; // type:object size:0x74 +init_dTgLightShaftEff_c = .data:0x00000000; // type:object size:0x10 +__vt__18dTgLightShaftEff_c = .data:0x00000010; // type:object size:0x74 diff --git a/config/SOUE01/rels/d_t_map_instNP/splits.txt b/config/SOUE01/rels/d_t_map_instNP/splits.txt index edb06c47..7f72b8d4 100644 --- a/config/SOUE01/rels/d_t_map_instNP/splits.txt +++ b/config/SOUE01/rels/d_t_map_instNP/splits.txt @@ -2,7 +2,7 @@ Sections: .text type:code align:16 .ctors type:rodata align:4 .dtors type:rodata align:4 - .rodata type:rodata align:8 + .data type:data align:8 .bss type:bss align:8 REL/executor.c: @@ -10,3 +10,4 @@ REL/executor.c: REL/d/t/d_t_map_inst.cpp: .text start:0x00000070 end:0x0000015C + .data start:0x00000000 end:0x00000084 diff --git a/config/SOUE01/rels/d_t_map_instNP/symbols.txt b/config/SOUE01/rels/d_t_map_instNP/symbols.txt index 7ad95202..8db070b5 100644 --- a/config/SOUE01/rels/d_t_map_instNP/symbols.txt +++ b/config/SOUE01/rels/d_t_map_instNP/symbols.txt @@ -1,13 +1,13 @@ _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 -fn_437_70 = .text:0x00000070; // type:function size:0x4C -fn_437_C0 = .text:0x000000C0; // type:function size:0x10 -fn_437_D0 = .text:0x000000D0; // type:function size:0x8 -fn_437_E0 = .text:0x000000E0; // type:function size:0x8 -fn_437_F0 = .text:0x000000F0; // type:function size:0x8 -fn_437_100 = .text:0x00000100; // type:function size:0x5C +construct__12dTgMapInst_cFv = .text:0x00000070; // type:function size:0x4C +create__12dTgMapInst_cFv = .text:0x000000C0; // type:function size:0x10 +doDelete__5dTg_cFv = .text:0x000000D0; // type:function size:0x8 +actorExecute__5dTg_cFv = .text:0x000000E0; // type:function size:0x8 +draw__5dTg_cFv = .text:0x000000F0; // type:function size:0x8 +__dt__12dTgMapInst_cFv = .text:0x00000100; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_437_section4_0 = .rodata:0x00000000; // type:object size:0x10 -lbl_437_section4_10 = .rodata:0x00000010; // type:object size:0x74 +init_dTgMapInst_c = .data:0x00000000; // type:object size:0x10 +__vt__12dTgMapInst_c = .data:0x00000010; // type:object size:0x74 diff --git a/config/SOUE01/rels/d_t_tackleNP/splits.txt b/config/SOUE01/rels/d_t_tackleNP/splits.txt index 905a1f6a..1f85ea49 100644 --- a/config/SOUE01/rels/d_t_tackleNP/splits.txt +++ b/config/SOUE01/rels/d_t_tackleNP/splits.txt @@ -2,7 +2,7 @@ Sections: .text type:code align:16 .ctors type:rodata align:4 .dtors type:rodata align:4 - .rodata type:rodata align:8 + .data type:data align:8 .bss type:bss align:8 REL/executor.c: @@ -10,3 +10,4 @@ REL/executor.c: REL/d/t/d_t_tackle.cpp: .text start:0x00000070 end:0x0000015C + .data start:0x00000000 end:0x00000084 diff --git a/config/SOUE01/rels/d_t_tackleNP/symbols.txt b/config/SOUE01/rels/d_t_tackleNP/symbols.txt index de3909f0..cf1ba96e 100644 --- a/config/SOUE01/rels/d_t_tackleNP/symbols.txt +++ b/config/SOUE01/rels/d_t_tackleNP/symbols.txt @@ -1,13 +1,13 @@ _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 -fn_472_70 = .text:0x00000070; // type:function size:0x4C -fn_472_C0 = .text:0x000000C0; // type:function size:0x8 -fn_472_D0 = .text:0x000000D0; // type:function size:0x8 -fn_472_E0 = .text:0x000000E0; // type:function size:0x8 -fn_472_F0 = .text:0x000000F0; // type:function size:0x8 -fn_472_100 = .text:0x00000100; // type:function size:0x5C +construct__11dTgTackle_cFv = .text:0x00000070; // type:function size:0x4C +create__5dTg_cFv = .text:0x000000C0; // type:function size:0x8 +doDelete__5dTg_cFv = .text:0x000000D0; // type:function size:0x8 +actorExecute__5dTg_cFv = .text:0x000000E0; // type:function size:0x8 +draw__5dTg_cFv = .text:0x000000F0; // type:function size:0x8 +__dt__11dTgTackle_cFv = .text:0x00000100; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_472_section4_0 = .rodata:0x00000000; // type:object size:0x10 -lbl_472_section4_10 = .rodata:0x00000010; // type:object size:0x74 +init_dTgTackle_c = .data:0x00000000; // type:object size:0x10 +__vt__11dTgTackle_c = .data:0x00000010; // type:object size:0x74 diff --git a/configure.py b/configure.py index 62187b35..e8516119 100644 --- a/configure.py +++ b/configure.py @@ -1024,8 +1024,8 @@ config.libs = [ 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"), - Rel(NonMatching, "d_t_light_shaft_eff", "REL/d/t/d_t_light_shaft_eff.cpp"), - Rel(NonMatching, "d_t_map_inst", "REL/d/t/d_t_map_inst.cpp"), + Rel(Matching, "d_t_light_shaft_eff", "REL/d/t/d_t_light_shaft_eff.cpp"), + Rel(Matching, "d_t_map_inst", "REL/d/t/d_t_map_inst.cpp"), Rel(NonMatching, "d_t_map_mark", "REL/d/t/d_t_map_mark.cpp"), Rel(NonMatching, "d_t_megami_diving", "REL/d/t/d_t_megami_diving.cpp"), Rel(NonMatching, "d_t_miechan", "REL/d/t/d_t_miechan.cpp"), @@ -1063,7 +1063,7 @@ config.libs = [ Rel(NonMatching, "d_t_stream", "REL/d/t/d_t_stream.cpp"), Rel(NonMatching, "d_t_sword_battle_game", "REL/d/t/d_t_sword_battle_game.cpp"), Rel(NonMatching, "d_t_sw_area", "REL/d/t/d_t_sw_area.cpp"), - Rel(NonMatching, "d_t_tackle", "REL/d/t/d_t_tackle.cpp"), + Rel(Matching, "d_t_tackle", "REL/d/t/d_t_tackle.cpp"), Rel(NonMatching, "d_t_telop", "REL/d/t/d_t_telop.cpp"), Rel(NonMatching, "d_t_timer", "REL/d/t/d_t_timer.cpp"), Rel(NonMatching, "d_t_time_area_check", "REL/d/t/d_t_time_area_check.cpp"), diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index 5ae0efe0..7f4c7fce 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -12,6 +12,19 @@ #include "toBeSorted/room_manager.h" class dAcBase_c; + +/** + * Actors are always created through a lookup table + * of these objects. + */ +struct dActorInit { + dAcBase_c *(*create)(); + u16 executeOrder; + u16 drawOrder; + u32 baseProperties; + u32 defaultFlags; +}; + struct SoundInfo { dAcBase_c *actor; void *obj_sound; @@ -69,7 +82,7 @@ protected: /* 0x64 | 8002ceb0 */ virtual bool restorePosRotFromCopy(); /* 0x68 | 8002db80 */ virtual void *getCurrentEventActor(); /* 0x6C | 8002db90 */ virtual void unkVirtFunc_0x6C(); - /* 0x70 | 8002dba0 */ virtual void doInteraction(s32); + /* 0x70 | 8002dba0 */ virtual void doInteraction(int); public: /* 8002c3b0 */ dAcBase_c(); diff --git a/include/d/tg/d_tg.h b/include/d/tg/d_tg.h new file mode 100644 index 00000000..ceb14579 --- /dev/null +++ b/include/d/tg/d_tg.h @@ -0,0 +1,23 @@ +#ifndef D_TG_H +#define D_TG_H + +#include + +class dTg_c : public dAcBase_c { +public: + virtual ~dTg_c() {} + virtual int draw() override { + return 1; + } + virtual int actorExecute() override { + return 1; + } + virtual int doDelete() override { + return 1; + } + virtual int create() override { + return 1; + } +}; + +#endif diff --git a/src/REL/d/t/d_t_light_shaft_eff.cpp b/src/REL/d/t/d_t_light_shaft_eff.cpp index e69de29b..81c8e3ec 100644 --- a/src/REL/d/t/d_t_light_shaft_eff.cpp +++ b/src/REL/d/t/d_t_light_shaft_eff.cpp @@ -0,0 +1,13 @@ +#include + +class dTgLightShaftEff_c : public dTg_c { +public: + dTgLightShaftEff_c() {} + virtual ~dTgLightShaftEff_c() {} + + static dAcBase_c *construct() { + return new dTgLightShaftEff_c(); + } +}; + +dActorInit init_dTgLightShaftEff_c = { dTgLightShaftEff_c::construct, 0x00bd, 0x025e, 0, 0 }; diff --git a/src/REL/d/t/d_t_map_inst.cpp b/src/REL/d/t/d_t_map_inst.cpp index e69de29b..166b4604 100644 --- a/src/REL/d/t/d_t_map_inst.cpp +++ b/src/REL/d/t/d_t_map_inst.cpp @@ -0,0 +1,23 @@ +#include + +class dTgMapInst_c : public dTg_c { +public: + dTgMapInst_c() { } + virtual ~dTgMapInst_c() {} + + virtual int create() override; + static dAcBase_c *construct(); + + u8 field_0xfc; +}; + +dAcBase_c *dTgMapInst_c::construct() { + return new dTgMapInst_c(); +} + +int dTgMapInst_c::create() { + field_0xfc = params & 0xff; + return 1; +} + +dActorInit init_dTgMapInst_c = { dTgMapInst_c::construct, 0x025d, 0x021d, 0, 0 }; diff --git a/src/REL/d/t/d_t_tackle.cpp b/src/REL/d/t/d_t_tackle.cpp index e69de29b..883c9af4 100644 --- a/src/REL/d/t/d_t_tackle.cpp +++ b/src/REL/d/t/d_t_tackle.cpp @@ -0,0 +1,13 @@ +#include + +class dTgTackle_c : public dTg_c { +public: + dTgTackle_c() {} + virtual ~dTgTackle_c() {} + + static dAcBase_c *construct() { + return new dTgTackle_c(); + } +}; + +dActorInit init_dTgTackle_c = { dTgTackle_c::construct, 0x0210, 0x0241, 0, 0 }; diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 51705bd2..4f700c56 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -234,7 +234,7 @@ dAcBase_c dAcBase_c::createActorUnkGroup3(ProfileName actorId, u32 params1, Vec3 void *dAcBase_c::getCurrentEventActor() {} void dAcBase_c::unkVirtFunc_0x6C() {} -void dAcBase_c::doInteraction(s32) {} +void dAcBase_c::doInteraction(int) {} void dAcBase_c::FUN_8002dc20(s16 *, s16 *) {} void dAcBase_c::incrementKillCounter() {} void dAcBase_c::FUN_8002dcd0() {}