From c89039d4cffee352f339c46074450ae279ed1630 Mon Sep 17 00:00:00 2001 From: Max <34987259+mparisi20@users.noreply.github.com> Date: Thu, 14 May 2026 22:38:43 -0400 Subject: [PATCH] ft_purin progress - Update BrawlHeaders to match ftPurinExtendParamAccesser - Add WIP files ft_purin.cpp and ft_fighter_build_data.cpp --- config/RSBE01_02/rels/ft_purin/splits.txt | 7 ++ config/RSBE01_02/rels/ft_purin/symbols.txt | 26 +++---- config/RSBE01_02/rels/sora_melee/splits.txt | 7 ++ config/RSBE01_02/rels/sora_melee/symbols.txt | 10 +-- configure.py | 8 +- include/lib/BrawlHeaders | 2 +- src/mo_fighter/ft_purin/ft_purin.cpp | 77 +++++++++++++++++++ src/mo_melee/sora_melee/ft/ft_class_info.cpp | 10 +-- .../ft/ft_extend_param_accesser.cpp | 10 +-- .../sora_melee/ft/ft_fighter_build_data.cpp | 20 +++++ 10 files changed, 146 insertions(+), 31 deletions(-) create mode 100644 src/mo_fighter/ft_purin/ft_purin.cpp create mode 100644 src/mo_melee/sora_melee/ft/ft_fighter_build_data.cpp diff --git a/config/RSBE01_02/rels/ft_purin/splits.txt b/config/RSBE01_02/rels/ft_purin/splits.txt index 06f1993..d4daa2b 100644 --- a/config/RSBE01_02/rels/ft_purin/splits.txt +++ b/config/RSBE01_02/rels/ft_purin/splits.txt @@ -11,6 +11,13 @@ global_destructor_chain.c: .dtors start:0x00000000 end:0x00000008 .bss start:0x00000000 end:0x00000004 +mo_fighter/ft_purin/ft_purin.cpp: + .text start:0x00000070 end:0x0000B464 + .ctors start:0x00000000 end:0x00000004 + .rodata start:0x00000000 end:0x00000010 + .data start:0x00000000 end:0x00005B10 + .bss start:0x00000008 end:0x00000218 + mo_fighter/mo_fighter.cpp: .text start:0x0000C4A0 end:0x0000C53C .data start:0x00005D50 end:0x00005D5F diff --git a/config/RSBE01_02/rels/ft_purin/symbols.txt b/config/RSBE01_02/rels/ft_purin/symbols.txt index 69d4cec..7d8aaf9 100644 --- a/config/RSBE01_02/rels/ft_purin/symbols.txt +++ b/config/RSBE01_02/rels/ft_purin/symbols.txt @@ -188,11 +188,11 @@ fn_124_7AF4 = .text:0x00007AF4; // type:function size:0xCC fn_124_7BC0 = .text:0x00007BC0; // type:function size:0x94 fn_124_7C54 = .text:0x00007C54; // type:function size:0xF4 fn_124_7D48 = .text:0x00007D48; // type:function size:0x10 -fn_124_7D58 = .text:0x00007D58; // type:function size:0x8 -fn_124_7D60 = .text:0x00007D60; // type:function size:0x1DC -fn_124_7F3C = .text:0x00007F3C; // type:function size:0x4 -fn_124_7F40 = .text:0x00007F40; // type:function size:0x60 -fn_124_7FA0 = .text:0x00007FA0; // type:function size:0x5C +getParamIndefinite__21ftExtendParamAccesserFP16soModuleAccesserll = .text:0x00007D58; // type:function size:0x8 +setup__26ftPurinExtendParamAccesserFPCUc = .text:0x00007D60; // type:function size:0x1DC +setup__40ftExtendParamAccesserEx<3999,49,24999,4>FPCUc = .text:0x00007F3C; // type:function size:0x4 +__dt__26ftPurinExtendParamAccesserFv = .text:0x00007F40; // type:function size:0x60 +__dt__40ftExtendParamAccesserEx<3999,49,24999,4>Fv = .text:0x00007FA0; // type:function size:0x5C fn_124_7FFC = .text:0x00007FFC; // type:function size:0x1C fn_124_8018 = .text:0x00008018; // type:function size:0x74 fn_124_808C = .text:0x0000808C; // type:function size:0x14 @@ -298,9 +298,9 @@ fn_124_8690 = .text:0x00008690; // type:function size:0xB4 fn_124_8744 = .text:0x00008744; // type:function size:0x54 fn_124_8798 = .text:0x00008798; // type:function size:0x12C fn_124_88C4 = .text:0x000088C4; // type:function size:0x34 -fn_124_88F8 = .text:0x000088F8; // type:function size:0x58 -fn_124_8950 = .text:0x00008950; // type:function size:0xC -fn_124_895C = .text:0x0000895C; // type:function size:0x5C +getParamFloat__40ftExtendParamAccesserEx<3999,49,24999,4>FP16soModuleAccesserll = .text:0x000088F8; // type:function size:0x58 +getValueVariation__15soValueAccesserFv = .text:0x00008950; // type:function size:0xC +getParamInt__40ftExtendParamAccesserEx<3999,49,24999,4>FP16soModuleAccesserll = .text:0x0000895C; // type:function size:0x5C fn_124_89B8 = .text:0x000089B8; // type:function size:0x60 fn_124_8A18 = .text:0x00008A18; // type:function size:0x2AC fn_124_8CC4 = .text:0x00008CC4; // type:function size:0x1F0 @@ -411,7 +411,7 @@ fn_124_B078 = .text:0x0000B078; // type:function size:0x90 fn_124_B108 = .text:0x0000B108; // type:function size:0x8 fn_124_B110 = .text:0x0000B110; // type:function size:0xC fn_124_B11C = .text:0x0000B11C; // type:function size:0x64 -fn_124_B180 = .text:0x0000B180; // type:function size:0x48 +__ct__26ftPurinExtendParamAccesserFv = .text:0x0000B180; // type:function size:0x48 fn_124_B1C8 = .text:0x0000B1C8; // type:function size:0x58 fn_124_B220 = .text:0x0000B220; // type:function size:0x84 fn_124_B2A4 = .text:0x0000B2A4; // type:function size:0x68 @@ -519,16 +519,16 @@ lbl_124_data_4 = .data:0x00000004; // type:object size:0x4 lbl_124_data_8 = .data:0x00000008; // type:object size:0xC data:string lbl_124_data_14 = .data:0x00000014; // type:object size:0xC lbl_124_data_20 = .data:0x00000020; // type:object size:0x8 -lbl_124_data_28 = .data:0x00000028; // type:object size:0x28 +__vt__26ftPurinExtendParamAccesser = .data:0x00000028; // type:object size:0x28 lbl_124_data_50 = .data:0x00000050; // type:object size:0x1B data:string lbl_124_data_6C = .data:0x0000006C; // type:object size:0x24 -lbl_124_data_90 = .data:0x00000090; // type:object size:0x8 +__RTTI__26ftPurinExtendParamAccesser = .data:0x00000090; // type:object size:0x8 lbl_124_data_98 = .data:0x00000098; // type:object size:0x2C data:string lbl_124_data_C4 = .data:0x000000C4; // type:object size:0x1C -lbl_124_data_E0 = .data:0x000000E0; // type:object size:0x8 +__RTTI__40ftExtendParamAccesserEx<3999,49,24999,4> = .data:0x000000E0; // type:object size:0x8 lbl_124_data_E8 = .data:0x000000E8; // type:object size:0x16 data:string lbl_124_data_100 = .data:0x00000100; // type:object size:0x14 -lbl_124_data_114 = .data:0x00000114; // type:object size:0x8 +__RTTI__21ftExtendParamAccesser = .data:0x00000114; // type:object size:0x8 lbl_124_data_11C = .data:0x0000011C; // type:object size:0x3B0 lbl_124_data_4CC = .data:0x000004CC; // type:object size:0x8 data:string lbl_124_data_4D4 = .data:0x000004D4; // type:object size:0x124 diff --git a/config/RSBE01_02/rels/sora_melee/splits.txt b/config/RSBE01_02/rels/sora_melee/splits.txt index b61df96..45dfe61 100644 --- a/config/RSBE01_02/rels/sora_melee/splits.txt +++ b/config/RSBE01_02/rels/sora_melee/splits.txt @@ -81,6 +81,13 @@ mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp: .data start:0x0002BC00 end:0x0002BCA0 .bss start:0x00004568 end:0x00004648 +mo_melee/sora_melee/ft/ft_fighter_build_data.cpp: + .text start:0x00192D4C end:0x00193378 + .ctors start:0x00000258 end:0x0000025C + .rodata start:0x000026A8 end:0x000026B0 + .data start:0x00032A98 end:0x00032BF8 + .bss start:0x00005040 end:0x00005050 + mo_melee/mo_melee.cpp: .text start:0x003CBCBC end:0x003CBE40 .ctors start:0x00000514 end:0x00000518 diff --git a/config/RSBE01_02/rels/sora_melee/symbols.txt b/config/RSBE01_02/rels/sora_melee/symbols.txt index 353c34b..d74f8df 100644 --- a/config/RSBE01_02/rels/sora_melee/symbols.txt +++ b/config/RSBE01_02/rels/sora_melee/symbols.txt @@ -11926,8 +11926,8 @@ fn_27_1254C4 = .text:0x001254C4; // type:function size:0x8 fn_27_1254CC = .text:0x001254CC; // type:function size:0x8 __ct__11ftClassInfoFb = .text:0x001254D4; // type:function size:0x11C __dt__11ftClassInfoFv = .text:0x001255F0; // type:function size:0x40 -getClassInfo__11ftClassInfoFQ28Fighters13ftFighterKind = .text:0x00125630; // type:function size:0x14 -setClassInfo__11ftClassInfoFQ28Fighters13ftFighterKindP11ftClassInfo = .text:0x00125644; // type:function size:0x14 +getClassInfo__11ftClassInfoF6ftKind = .text:0x00125630; // type:function size:0x14 +setClassInfo__11ftClassInfoF6ftKindP11ftClassInfo = .text:0x00125644; // type:function size:0x14 create__15ftClassInfoNullCFv = .text:0x00125658; // type:function size:0x8 __dt__15ftClassInfoNullFv = .text:0x00125660; // type:function size:0x40 __sinit_\ft_class_info_cpp = .text:0x001256A0; // type:function size:0x14C scope:local @@ -12432,10 +12432,10 @@ fn_27_149B70 = .text:0x00149B70; // type:function size:0xC fn_27_149B7C = .text:0x00149B7C; // type:function size:0x1C fn_27_149B98 = .text:0x00149B98; // type:function size:0x40 fn_27_149BD8 = .text:0x00149BD8; // type:function size:0x98 -__ct__21ftExtendParamAccesserFQ28Fighters13ftFighterKind = .text:0x00149C70; // type:function size:0x9C +__ct__21ftExtendParamAccesserF6ftKind = .text:0x00149C70; // type:function size:0x9C __dt__21ftExtendParamAccesserFv = .text:0x00149D0C; // type:function size:0x58 -getAccesser__21ftExtendParamAccesserFQ28Fighters13ftFighterKind = .text:0x00149D64; // type:function size:0x14 -isExistAccesser__21ftExtendParamAccesserFQ28Fighters13ftFighterKind = .text:0x00149D78; // type:function size:0x9C +getAccesser__21ftExtendParamAccesserF6ftKind = .text:0x00149D64; // type:function size:0x14 +isExistAccesser__21ftExtendParamAccesserF6ftKind = .text:0x00149D78; // type:function size:0x9C getParamIndefinite__21ftExtendParamAccesserFP16soModuleAccesserll = .text:0x00149E14; // type:function size:0x8 fn_27_149E1C = .text:0x00149E1C; // type:function size:0x40 fn_27_149E5C = .text:0x00149E5C; // type:function size:0x34 diff --git a/configure.py b/configure.py index 176d760..5b04652 100755 --- a/configure.py +++ b/configure.py @@ -249,6 +249,7 @@ "-sdata2 0", ] +cflags_fighter = ["-O2,s" if flag == "-O4,p" else flag for flag in cflags_rel] cflags_sora_enemy = ["-O2,s" if flag == "-O4,p" else flag for flag in cflags_rel] cflags_st_starfox = [*cflags_rel, "-inline on,noauto"] @@ -555,9 +556,11 @@ def MatchingFor(*versions): { "lib": "ft_purin", "mw_version": config.linker_version, - "cflags": cflags_rel, + "cflags": cflags_fighter, "host": False, - "objects": [], + "objects": [ + Object(NonMatching, "mo_fighter/ft_purin/ft_purin.cpp"), + ], }, { "lib": "ft_robot", @@ -815,6 +818,7 @@ def MatchingFor(*versions): Object(Matching, "mo_melee/sora_melee/so/so_common_data_accesser.cpp"), Object(Matching, "mo_melee/sora_melee/ft/ft_class_info.cpp"), Object(Matching, "mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp"), + Object(NonMatching, "mo_melee/sora_melee/ft/ft_fighter_build_data.cpp"), Object(Matching, "mo_melee/mo_melee.cpp"), ], }, diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index 05aa986..f7d45e9 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit 05aa9863705298ba1cbe46fb273400cb6b3205b1 +Subproject commit f7d45e96dc4fca29e908f3e8240deac02d8ea2e7 diff --git a/src/mo_fighter/ft_purin/ft_purin.cpp b/src/mo_fighter/ft_purin/ft_purin.cpp new file mode 100644 index 0000000..301b742 --- /dev/null +++ b/src/mo_fighter/ft_purin/ft_purin.cpp @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ftPurinExtendParamAccesser g_ftPurinExtendParamAccesser; + +template +class ftFighterBuilder : public Fighter { +public: + ftFighterBuilder(s32 entryId, ftKind kind, s32 p3, soModuleAccesser* acc) : + Fighter(entryId, kind, p3, acc) { + // TODO create ftFighterBuildData + + } +}; + +// TODO: Are there more template params? +template +class soInsideEventManageModuleBuildConfig { + +}; +// size is 0x9A48 + +// e.g. soEventUnitWithWorkArea +// TODO: more template params? +template +class soInsideEventManageModuleBuilder { +public: + soInsideEventManageModuleBuilder(); +}; + +class ftPurinBuildConfig { + +}; + +// Note: The values passed here are the capacities of +// the soEventUnitWithWorkAreas managed by the builder +typedef soInsideEventManageModuleBuildConfig + <32, 40, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 1, 1, 2, 1> +ftPurinInsideEventManageModuleBuildConfig; + +class ftPurin : public ftFighterBuilder { + soInsideEventManageModuleBuilder unk194; + u8 unk198[0x9CC]; + soModuleAccesser unkB64; + u8 unkC44[0x8DF4]; + u32 unk9A38; // cameraRangeSet TODO type + u8 unk9A3C[0x4]; + u32 unk9A40; // cameraClipSphereSet TODO type + + // begin ftPurin fields + soArrayContractibleTable unk9A48; + void* unk9A58; // TODO type +public: + ftPurin(s32 entryId, + s32 p2, + Heaps::HeapType nwModelInstHeap, + Heaps::HeapType nwMotionInstHeap); +}; +// static_assert(sizeof(ftPurin) == 0x9A5C, "Class is the wrong size!"); + +ftPurin::ftPurin(s32 entryId, + s32 p2, + Heaps::HeapType nwModelInstHeap, + Heaps::HeapType nwMotionInstHeap) : + ftFighterBuilder(entryId, Fighter_Jigglypuff, p2, &unkB64) { + // TODO +} diff --git a/src/mo_melee/sora_melee/ft/ft_class_info.cpp b/src/mo_melee/sora_melee/ft/ft_class_info.cpp index 7c080b0..610dc1a 100644 --- a/src/mo_melee/sora_melee/ft/ft_class_info.cpp +++ b/src/mo_melee/sora_melee/ft/ft_class_info.cpp @@ -1,27 +1,27 @@ #include -#include +#include #include #include -static ftClassInfo* g_ftClassInfoTable[Fighters::Count]; +static ftClassInfo* g_ftClassInfoTable[Fighter_Count]; static bool g_ftClassInfoTableInit; ftClassInfoNull g_ftClassInfoNull; ftClassInfo::ftClassInfo(bool isNull) : soNullable(isNull) { if (!g_ftClassInfoTableInit) { g_ftClassInfoTableInit = true; - for (u32 i = 0; i < Fighters::Count; i++) + for (u32 i = 0; i < Fighter_Count; i++) g_ftClassInfoTable[i] = &g_ftClassInfoNull; } } ftClassInfo::~ftClassInfo() { } -ftClassInfo* ftClassInfo::getClassInfo(Fighters::ftFighterKind kind) { +ftClassInfo* ftClassInfo::getClassInfo(ftKind kind) { return g_ftClassInfoTable[kind]; } -void ftClassInfo::setClassInfo(Fighters::ftFighterKind kind, ftClassInfo* info) { +void ftClassInfo::setClassInfo(ftKind kind, ftClassInfo* info) { g_ftClassInfoTable[kind] = info; } diff --git a/src/mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp b/src/mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp index 1049096..fc1da4c 100644 --- a/src/mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp +++ b/src/mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp @@ -1,13 +1,13 @@ #include #include -#include +#include #include #include static bool g_ftExtendParamAccesserTableInit; -static ftExtendParamAccesser* g_ftExtendParamAccesserTable[Fighters::Count]; +static ftExtendParamAccesser* g_ftExtendParamAccesserTable[Fighter_Count]; -ftExtendParamAccesser::ftExtendParamAccesser(Fighters::ftFighterKind kind) { +ftExtendParamAccesser::ftExtendParamAccesser(ftKind kind) { if (!g_ftExtendParamAccesserTableInit) { std::memset(g_ftExtendParamAccesserTable, 0, sizeof(g_ftExtendParamAccesserTable)); g_ftExtendParamAccesserTableInit = true; @@ -20,11 +20,11 @@ ftExtendParamAccesser::~ftExtendParamAccesser() { g_ftExtendParamAccesserTable[m_kind] = 0; } -ftExtendParamAccesser* ftExtendParamAccesser::getAccesser(Fighters::ftFighterKind kind) { +ftExtendParamAccesser* ftExtendParamAccesser::getAccesser(ftKind kind) { return g_ftExtendParamAccesserTable[kind]; } -bool ftExtendParamAccesser::isExistAccesser(Fighters::ftFighterKind kind) { +bool ftExtendParamAccesser::isExistAccesser(ftKind kind) { if (!g_ftExtendParamAccesserTable[kind]) OSReport("_Accessers[ %d ] == NULL \n", kind); if (!g_ftExtendParamAccesserTableInit) diff --git a/src/mo_melee/sora_melee/ft/ft_fighter_build_data.cpp b/src/mo_melee/sora_melee/ft/ft_fighter_build_data.cpp new file mode 100644 index 0000000..a3f2bcd --- /dev/null +++ b/src/mo_melee/sora_melee/ft/ft_fighter_build_data.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +class soModuleAccesserBuildData { +public: + +}; + +class ftFighterBuildData : public soModuleAccesserBuildData { +public: + ftFighterBuildData(s32 entryId, ftKind kind, Heaps::HeapType instHeap, + Heaps::HeapType nwModelInstHeap, + Heaps::HeapType nwMotionInstHeap, + s8 resGroupNo, soModuleAccesser* acc, + s32 team, void* cameraRangeSet, + void* cameraClipSphereSet); +};