Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match mo_melee.cpp #5

Merged
merged 1 commit into from
Dec 27, 2024
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
126 changes: 126 additions & 0 deletions config/RSBE01_02/config.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions config/RSBE01_02/rels/sora_melee/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ Sections:
.data type:data align:32
.bss type:bss align:8

mo_melee/mo_melee.cpp:
.text start:0x003CBCBC end:0x003CBE40
.ctors start:0x00000514 end:0x00000518
.data start:0x000A3D58 end:0x000A3DA8
.bss start:0x00008CC0 end:0x00008CE8

home_button_icon.cpp:
.data start:0x000A3DC0 end:0x000A5680
36 changes: 20 additions & 16 deletions config/RSBE01_02/rels/sora_melee/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6516,7 +6516,7 @@ fn_27_AECC8 = .text:0x000AECC8; // type:function size:0x8
fn_27_AECD0 = .text:0x000AECD0; // type:function size:0x8
fn_27_AECD8 = .text:0x000AECD8; // type:function size:0x8
fn_27_AECE0 = .text:0x000AECE0; // type:function size:0x8
fn_27_AECE8 = .text:0x000AECE8; // type:function size:0x324
create__24soDisposeInstanceManagerFv = .text:0x000AECE8; // type:function size:0x324
fn_27_AF00C = .text:0x000AF00C; // type:function size:0x40
fn_27_AF04C = .text:0x000AF04C; // type:function size:0x40
fn_27_AF08C = .text:0x000AF08C; // type:function size:0x10
Expand Down Expand Up @@ -20251,7 +20251,7 @@ fn_27_232664 = .text:0x00232664; // type:function size:0x18C
fn_27_2327F0 = .text:0x002327F0; // type:function size:0x124
fn_27_232914 = .text:0x00232914; // type:function size:0x1FC
fn_27_232B10 = .text:0x00232B10; // type:function size:0xC8
fn_27_232BD8 = .text:0x00232BD8; // type:function size:0x40
__dt__10gfCallBackFv = .text:0x00232BD8; // type:function size:0x40 scope:weak
fn_27_232C18 = .text:0x00232C18; // type:function size:0xB8
fn_27_232CD0 = .text:0x00232CD0; // type:function size:0x7C
setTriggerFlag__12stTriggerMngFP13stTriggerData = .text:0x00232D4C; // type:function size:0x1DC
Expand Down Expand Up @@ -26655,12 +26655,12 @@ fn_27_3CBC9C = .text:0x003CBC9C; // type:function size:0x8
fn_27_3CBCA4 = .text:0x003CBCA4; // type:function size:0x8
fn_27_3CBCAC = .text:0x003CBCAC; // type:function size:0x8
fn_27_3CBCB4 = .text:0x003CBCB4; // type:function size:0x8
fn_27_3CBCBC = .text:0x003CBCBC; // type:function size:0x18
userProc__23moMeleeDrawDownCallbackFv = .text:0x003CBCBC; // type:function size:0x18
_prolog = .text:0x003CBCD4; // type:function size:0x64 scope:global
_epilog = .text:0x003CBD38; // type:function size:0x60 scope:global
_unresolved = .text:0x003CBD98; // type:function size:0xC scope:global
fn_27_3CBDA4 = .text:0x003CBDA4; // type:function size:0x40
fn_27_3CBDE4 = .text:0x003CBDE4; // type:function size:0x5C
__dt__23moMeleeDrawDownCallbackFv = .text:0x003CBDA4; // type:function size:0x40 scope:weak
__sinit_\mo_melee_cpp = .text:0x003CBDE4; // type:function size:0x5C
_ctors = .ctors:0x00000000; // type:label scope:global data:4byte
_dtors = .dtors:0x00000000; // type:label scope:global data:4byte
__destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global
Expand Down Expand Up @@ -34749,8 +34749,9 @@ lbl_27_data_4BEF8 = .data:0x0004BEF8; // type:object size:0x64
lbl_27_data_4BF5C = .data:0x0004BF5C; // type:object size:0x10
lbl_27_data_4BF6C = .data:0x0004BF6C; // type:object size:0xC
lbl_27_data_4BF78 = .data:0x0004BF78; // type:object size:0x30
lbl_27_data_4BFA8 = .data:0x0004BFA8; // type:object size:0x10
lbl_27_data_4BFB8 = .data:0x0004BFB8; // type:object size:0x260
lbl_27_data_4BFA8 = .data:0x0004BFA8; // type:object size:0xB data:string
__RTTI__10gfCallBack = .data:0x0004BFB8; // type:object size:0x8 scope:weak align:8
lbl_27_data_4BFC0 = .data:0x0004BFC0; // type:object size:0x258
lbl_27_data_4C218 = .data:0x0004C218; // type:object size:0x1C
lbl_27_data_4C234 = .data:0x0004C234; // type:object size:0x1C
lbl_27_data_4C250 = .data:0x0004C250; // type:object size:0x20 data:string
Expand All @@ -34777,7 +34778,7 @@ lbl_27_data_4C458 = .data:0x0004C458; // type:object size:0x8
lbl_27_data_4C460 = .data:0x0004C460; // type:object size:0x10
lbl_27_data_4C470 = .data:0x0004C470; // type:object size:0x10
lbl_27_data_4C480 = .data:0x0004C480; // type:object size:0x8
lbl_27_data_4C488 = .data:0x0004C488; // type:object size:0x10
__vt__10gfCallBack = .data:0x0004C488; // type:object size:0x10 scope:weak
lbl_27_data_4C498 = .data:0x0004C498; // type:object size:0x20
lbl_27_data_4C4B8 = .data:0x0004C4B8; // type:object size:0x18 data:string
lbl_27_data_4C4D0 = .data:0x0004C4D0; // type:object size:0x18
Expand Down Expand Up @@ -38683,11 +38684,11 @@ lbl_27_data_A3CC8 = .data:0x000A3CC8; // type:object size:0x44
lbl_27_data_A3D0C = .data:0x000A3D0C; // type:object size:0x14
lbl_27_data_A3D20 = .data:0x000A3D20; // type:object size:0x8
lbl_27_data_A3D28 = .data:0x000A3D28; // type:object size:0x30
lbl_27_data_A3D58 = .data:0x000A3D58; // type:object size:0x10
lbl_27_data_A3D68 = .data:0x000A3D68; // type:object size:0x10
lbl_27_data_A3D78 = .data:0x000A3D78; // type:object size:0x18 data:string
lbl_27_data_A3D90 = .data:0x000A3D90; // type:object size:0x10
lbl_27_data_A3DA0 = .data:0x000A3DA0; // type:object size:0x20
@99 = .data:0x000A3D58; // type:object size:0xD scope:local data:string
__vt__23moMeleeDrawDownCallback = .data:0x000A3D68; // type:object size:0x10 scope:weak align:8
@64 = .data:0x000A3D78; // type:object size:0x18 scope:local data:string
@65 = .data:0x000A3D90; // type:object size:0xC scope:local
__RTTI__23moMeleeDrawDownCallback = .data:0x000A3DA0; // type:object size:0x8 scope:weak align:8
HomeBtnIcon = .data:0x000A3DC0; // type:object size:0x18C0 scope:global align:32
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_27_bss_8 = .bss:0x00000008; // type:object size:0x8 data:4byte
Expand Down Expand Up @@ -39089,7 +39090,8 @@ lbl_27_bss_1B7C = .bss:0x00001B7C; // type:object size:0x24 data:4byte
lbl_27_bss_1BA0 = .bss:0x00001BA0; // type:object size:0xFD0 data:byte
lbl_27_bss_2B70 = .bss:0x00002B70; // type:object size:0x8 data:4byte
lbl_27_bss_2B78 = .bss:0x00002B78; // type:object size:0x8 data:4byte
lbl_27_bss_2B80 = .bss:0x00002B80; // type:object size:0x8 data:4byte
g_soDisposeInstanceManager = .bss:0x00002B80; // type:object size:0x4 data:4byte
lbl_27_bss_2B84 = .bss:0x00002B84; // type:object size:0x4 data:4byte
lbl_27_bss_2B88 = .bss:0x00002B88; // type:object size:0x8 data:4byte
lbl_27_bss_2B90 = .bss:0x00002B90; // type:object size:0x8 data:4byte
lbl_27_bss_2B98 = .bss:0x00002B98; // type:object size:0xC
Expand Down Expand Up @@ -40155,5 +40157,7 @@ lbl_27_bss_8C88 = .bss:0x00008C88; // type:object size:0x10 data:4byte
lbl_27_bss_8C98 = .bss:0x00008C98; // type:object size:0xC
lbl_27_bss_8CA4 = .bss:0x00008CA4; // type:object size:0xC
lbl_27_bss_8CB0 = .bss:0x00008CB0; // type:object size:0x10 data:4byte
lbl_27_bss_8CC0 = .bss:0x00008CC0; // type:object size:0x20 data:4byte
lbl_27_bss_8CE0 = .bss:0x00008CE0; // type:object size:0x8 data:4byte
bss_loc_8cc0__22@unnamed@mo_melee_cpp@ = .bss:0x00008CC0; // type:object size:0x8 data:4byte
bss_loc_8cc8__22@unnamed@mo_melee_cpp@ = .bss:0x00008CC8; // type:object size:0x8 data:4byte
@42 = .bss:0x00008CD0; // type:object size:0xC scope:local data:4byte
bss_loc_8ce0 = .bss:0x00008CE0; // type:object size:0x8 align:16 data:4byte
4 changes: 2 additions & 2 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2299,8 +2299,8 @@ fn_80019FEC = .text:0x80019FEC; // type:function size:0x11C
fn_8001A108 = .text:0x8001A108; // type:function size:0x8C
fn_8001A194 = .text:0x8001A194; // type:function size:0x210
fn_8001A3A4 = .text:0x8001A3A4; // type:function size:0x8
fn_8001A3AC = .text:0x8001A3AC; // type:function size:0x30
fn_8001A3DC = .text:0x8001A3DC; // type:function size:0x64
add__14gfCallBackListFP10gfCallBack = .text:0x8001A3AC; // type:function size:0x30
remove__14gfCallBackListFP10gfCallBack = .text:0x8001A3DC; // type:function size:0x64
fn_8001A440 = .text:0x8001A440; // type:function size:0x4C
fn_8001A48C = .text:0x8001A48C; // type:function size:0x134
gfDrawSetVtxPosColorPrimEnvironment__Fv = .text:0x8001A5C0; // type:function size:0x1EC
Expand Down
6 changes: 4 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
]

# REL flags
config.rel_strip_partial = False
config.rel_strip_partial = True
cflags_rel = [
*cflags_common,
"-sdata 0",
Expand Down Expand Up @@ -642,7 +642,9 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": cflags_rel,
"host": False,
"objects": [],
"objects": [
Object(Matching, "mo_melee/mo_melee.cpp")
],
},
{
"lib": "sora_menu_boot",
Expand Down
72 changes: 72 additions & 0 deletions src/mo_melee/mo_melee.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#include <StaticAssert.h>
#include <gf/gf_application.h>
#include <gf/gf_callback.h>
#include <so/so_dispose_instance_manager.h>
#include <st/module.h>
#include <types.h>

struct bss_loc_8cc0_t {
u32 unk0;
s32 unk4;
public:
bss_loc_8cc0_t(s32 p2) {
unk0 = 0xFF;
unk4 = p2;
}
bss_loc_8cc0_t() { }
};

namespace {
const bss_loc_8cc0_t bss_loc_8cc0(0);
const bss_loc_8cc0_t bss_loc_8cc8(1);
}

class moMeleeDrawDownCallback : public gfCallBack {
public:
moMeleeDrawDownCallback() : gfCallBack() { }
virtual void userProc();
virtual ~moMeleeDrawDownCallback() { }
};
static_assert(sizeof(moMeleeDrawDownCallback) == 0x8, "Class is wrong size!");

void moMeleeDrawDownCallback::userProc() {
g_soDisposeInstanceManager->notifyDrawDone();
}

moMeleeDrawDownCallback bss_loc_8ce0;

extern "C" {
typedef void (*PFN_voidfunc)();
__declspec(section ".init") extern PFN_voidfunc _ctors[];
__declspec(section ".init") extern PFN_voidfunc _dtors[];

void _prolog();
void _epilog();
void _unresolved();
}

void _prolog() {
// Run global constructors
PFN_voidfunc* ctor;
for (ctor = _ctors; *ctor; ctor++)
{
(*ctor)();
}
soDisposeInstanceManager::create();
g_gfGameApplication->m_114.add(&bss_loc_8ce0);
}

void _epilog() {
g_gfGameApplication->m_114.remove(&bss_loc_8ce0);

// Run global destructors
PFN_voidfunc* dtor;
for (dtor = _dtors; *dtor; dtor++)
{
(*dtor)();
}
}

void _unresolved() {
moUnResolvedMessage("mo_melee.cpp");
}
Loading