Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/RSBE01_02/rels/ft_purin/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions config/RSBE01_02/rels/ft_purin/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions config/RSBE01_02/rels/sora_melee/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions config/RSBE01_02/rels/sora_melee/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"),
],
},
Expand Down
2 changes: 1 addition & 1 deletion include/lib/BrawlHeaders
Submodule BrawlHeaders updated 59 files
+3 −3 Brawl/Include/em/arman/em_arman_param_accesser.h
+3 −3 Brawl/Include/em/aroaros/em_aroaros_param_accesser.h
+3 −3 Brawl/Include/em/bitan/em_bitan_param_accesser.h
+3 −3 Brawl/Include/em/bombhead/em_bombhead_param_accesser.h
+3 −3 Brawl/Include/em/boobas/em_boobas_param_accesser.h
+3 −3 Brawl/Include/em/bosspackun/em_bosspackun_param_accesser.h
+3 −3 Brawl/Include/em/botron/em_botron_param_accesser.h
+3 −3 Brawl/Include/em/bucyulus/em_bucyulus_param_accesser.h
+3 −3 Brawl/Include/em/cataguard/em_cataguard_param_accesser.h
+3 −3 Brawl/Include/em/crazyhand/em_crazyhand_param_accesser.h
+3 −3 Brawl/Include/em/cymal/em_cymal_param_accesser.h
+3 −3 Brawl/Include/em/deathpod/em_deathpod_param_accesser.h
+3 −3 Brawl/Include/em/dekakuribo/em_dekakuribo_param_accesser.h
+3 −3 Brawl/Include/em/duon/em_duon_param_accesser.h
+3 −3 Brawl/Include/em/em_extend_param_accesser.h
+3 −3 Brawl/Include/em/falconflyer/em_falconflyer_param_accesser.h
+3 −3 Brawl/Include/em/faulong/em_faulong_param_accesser.h
+3 −3 Brawl/Include/em/flows/em_flows_param_accesser.h
+3 −3 Brawl/Include/em/galfire/em_galfire_param_accesser.h
+3 −3 Brawl/Include/em/galleom/em_galleom_param_accesser.h
+3 −3 Brawl/Include/em/ghamgha/em_ghamgha_param_accesser.h
+3 −3 Brawl/Include/em/ghamghabase/em_ghamghabase_param_accesser.h
+3 −3 Brawl/Include/em/gyraan/em_gyraan_param_accesser.h
+3 −3 Brawl/Include/em/hammerbros/em_hammerbros_param_accesser.h
+3 −3 Brawl/Include/em/jdus/em_jdus_param_accesser.h
+3 −3 Brawl/Include/em/jyakeel/em_jyakeel_param_accesser.h
+3 −3 Brawl/Include/em/killer/em_killer_param_accesser.h
+3 −3 Brawl/Include/em/kokkon/em_kokkon_param_accesser.h
+3 −3 Brawl/Include/em/kuribo/em_kuribo_param_accesser.h
+3 −3 Brawl/Include/em/masterhand/em_masterhand_param_accesser.h
+3 −3 Brawl/Include/em/metaridley/em_metaridley_param_accesser.h
+3 −3 Brawl/Include/em/mite/em_mite_param_accesser.h
+3 −3 Brawl/Include/em/ngagog/em_ngagog_param_accesser.h
+3 −3 Brawl/Include/em/pacci/em_pacci_param_accesser.h
+3 −3 Brawl/Include/em/patapata/em_patapata_param_accesser.h
+3 −3 Brawl/Include/em/popperam/em_popperam_param_accesser.h
+3 −3 Brawl/Include/em/porky/em_porky_param_accesser.h
+3 −3 Brawl/Include/em/prim/em_prim_param_accesser.h
+3 −3 Brawl/Include/em/rayquaza/em_rayquaza_param_accesser.h
+3 −3 Brawl/Include/em/ridley/em_ridley_param_accesser.h
+3 −3 Brawl/Include/em/roada/em_roada_param_accesser.h
+3 −3 Brawl/Include/em/robobeam/em_robobeam_param_accesser.h
+3 −3 Brawl/Include/em/robodistance/em_robodistance_param_accesser.h
+3 −3 Brawl/Include/em/robohoming/em_robohoming_param_accesser.h
+3 −3 Brawl/Include/em/robopunch/em_robopunch_param_accesser.h
+3 −3 Brawl/Include/em/shelly/em_shelly_param_accesser.h
+3 −3 Brawl/Include/em/siralamos/em_siralamos_param_accesser.h
+3 −3 Brawl/Include/em/spar/em_spar_param_accesser.h
+3 −3 Brawl/Include/em/taboo/em_taboo_param_accesser.h
+3 −3 Brawl/Include/em/tautau/em_tautau_param_accesser.h
+3 −3 Brawl/Include/em/teckin/em_teckin_param_accesser.h
+4 −1 Brawl/Include/ft/fighter.h
+3 −3 Brawl/Include/ft/ft_class_info.h
+1 −0 Brawl/Include/ft/ft_entry.h
+24 −21 Brawl/Include/ft/ft_extend_param_accesser.h
+167 −0 Brawl/Include/ft/purin/ft_purin_extend_param_accesser.h
+0 −10 Brawl/Include/gm/gm_lib.h
+3 −3 Brawl/Include/so/so_value_accesser.h
+2 −2 Brawl/Include/so/stageobject.h
77 changes: 77 additions & 0 deletions src/mo_fighter/ft_purin/ft_purin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#include <ft/ft_entry.h>
#include <ft/ft_extend_param_accesser.h>
#include <ft/purin/ft_purin_extend_param_accesser.h>
#include <so/so_array.h>
#include <so/so_module_accesser.h>
#include <sr/sr_common.h>
#include <StaticAssert.h>
#include <ft/fighter.h>
#include <types.h>

ftPurinExtendParamAccesser g_ftPurinExtendParamAccesser;

template<typename BuildConfig>
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<u32 C1, u32 C2, u32 C3, u32 C4, u32 C5,
u32 C6, u32 C7, u32 C8, u32 C9, u32 C10,
u32 C11, u32 C12, u32 C13, u32 C14, u32 C15,
u32 C16, u32 C17, u32 C18>
class soInsideEventManageModuleBuildConfig {

};
// size is 0x9A48

// e.g. soEventUnitWithWorkArea<soStatusEventObserver,32>
// TODO: more template params?
template<typename Cfg>
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<ftPurinBuildConfig> {
soInsideEventManageModuleBuilder<ftPurinInsideEventManageModuleBuildConfig> 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<const soStatusData> 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<ftPurinBuildConfig>(entryId, Fighter_Jigglypuff, p2, &unkB64) {
// TODO
}
10 changes: 5 additions & 5 deletions src/mo_melee/sora_melee/ft/ft_class_info.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#include <ft/ft_class_info.h>
#include <gm/gm_lib.h>
#include <ft/ft_entry.h>
#include <so/so_null.h>
#include <types.h>

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;
}

Expand Down
10 changes: 5 additions & 5 deletions src/mo_melee/sora_melee/ft/ft_extend_param_accesser.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <cstring>
#include <ft/ft_extend_param_accesser.h>
#include <gm/gm_lib.h>
#include <ft/ft_entry.h>
#include <revolution/OS/OSError.h>
#include <types.h>

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;
Expand All @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions src/mo_melee/sora_melee/ft/ft_fighter_build_data.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <StaticAssert.h>
#include <ft/ft_entry.h>
#include <so/so_module_accesser.h>
#include <sr/sr_common.h>
#include <types.h>

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);
};
Loading