Skip to content

Commit

Permalink
Match so_common_data_accesser.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mparisi20 authored and mparisi20 committed Jan 3, 2025
1 parent 9603441 commit eb28b3b
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 8 deletions.
5 changes: 5 additions & 0 deletions config/RSBE01_02/rels/sora_melee/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ mo_melee/sora_melee/so/so_resource_module_impl.cpp:
mo_melee/sora_melee/so/so_photo_call_back.cpp:
.text start:0x000C7024 end:0x000C7124

mo_melee/sora_melee/so/so_common_data_accesser.cpp:
.text start:0x000C7124 end:0x000C7438
.ctors start:0x0000004C end:0x00000050
.bss start:0x00002CD0 end:0x00002E58

mo_melee/mo_melee.cpp:
.text start:0x003CBCBC end:0x003CBE40
.ctors start:0x00000514 end:0x00000518
Expand Down
14 changes: 7 additions & 7 deletions config/RSBE01_02/rels/sora_melee/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7329,12 +7329,12 @@ fn_27_C701C = .text:0x000C701C; // type:function size:0x8
addCallback__15soPhotoCallBackFv = .text:0x000C7024; // type:function size:0x58
removeCallBack__15soPhotoCallBackFv = .text:0x000C707C; // type:function size:0x58
setFreezeMode__17soPhotoControllerFv = .text:0x000C70D4; // type:function size:0x50
fn_27_C7124 = .text:0x000C7124; // type:function size:0x25C
fn_27_C7380 = .text:0x000C7380; // type:function size:0x18
fn_27_C7398 = .text:0x000C7398; // type:function size:0x1C
fn_27_C73B4 = .text:0x000C73B4; // type:function size:0x1C
fn_27_C73D0 = .text:0x000C73D0; // type:function size:0x28
fn_27_C73F8 = .text:0x000C73F8; // type:function size:0x40
setupCommonParam__20soCommonDataAccesserFPP13soCommonParam = .text:0x000C7124; // type:function size:0x25C
getParamCommonFloat__20soCommonDataAccesserFUlUl = .text:0x000C7380; // type:function size:0x18
getParamCommonInt__20soCommonDataAccesserFUlUl = .text:0x000C7398; // type:function size:0x1C
getParamCommonIndefinite__20soCommonDataAccesserFUlUl = .text:0x000C73B4; // type:function size:0x1C
__sinit_\so_common_data_accesser_cpp = .text:0x000C73D0; // type:function size:0x28
__dt__20soCommonDataAccesserFv = .text:0x000C73F8; // type:function size:0x40
fn_27_C7438 = .text:0x000C7438; // type:function size:0x38
fn_27_C7470 = .text:0x000C7470; // type:function size:0x2C
fn_27_C749C = .text:0x000C749C; // type:function size:0x20
Expand Down Expand Up @@ -39114,7 +39114,7 @@ lbl_27_bss_2CB0 = .bss:0x00002CB0; // type:object size:0xC
lbl_27_bss_2CBC = .bss:0x00002CBC; // type:object size:0xC data:4byte
lbl_27_bss_2CC8 = .bss:0x00002CC8; // type:object size:0x8 data:4byte
lbl_27_bss_2CD0 = .bss:0x00002CD0; // type:object size:0xC
lbl_27_bss_2CDC = .bss:0x00002CDC; // type:object size:0x17C data:4byte
g_soCommonDataAccesser = .bss:0x00002CDC; // type:object size:0x17C data:4byte
lbl_27_bss_2E58 = .bss:0x00002E58; // type:object size:0x8 data:4byte
lbl_27_bss_2E60 = .bss:0x00002E60; // type:object size:0x8 data:4byte
g_ftManager = .bss:0x00002E68; // type:object size:0x8 data:4byte
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ def MatchingFor(*versions):
"objects": [
Object(Matching, "mo_melee/sora_melee/so/so_resource_module_impl.cpp"),
Object(Matching, "mo_melee/sora_melee/so/so_photo_call_back.cpp"),
Object(Matching, "mo_melee/sora_melee/so/so_common_data_accesser.cpp"),
Object(Matching, "mo_melee/mo_melee.cpp"),
],
},
Expand Down
2 changes: 1 addition & 1 deletion include/lib/BrawlHeaders
75 changes: 75 additions & 0 deletions src/mo_melee/sora_melee/so/so_common_data_accesser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include <so/so_common_data_accesser.h>
#include <types.h>

void soCommonDataAccesser::setupCommonParam(soCommonParam** p1) {
for (u32 i = 0; i < 2; i++) {
u32 j = 0;
u32 k = 0;
paramFloats[i].m_0[j++] = p1[i]->m_0;
paramFloats[i].m_0[j++] = p1[i]->m_4;
paramFloats[i].m_0[j++] = p1[i]->m_8;
paramFloats[i].m_0[j++] = p1[i]->m_C;
paramFloats[i].m_0[j++] = p1[i]->m_18;
paramFloats[i].m_0[j++] = p1[i]->m_1C;
paramFloats[i].m_0[j++] = p1[i]->m_20;
paramFloats[i].m_0[j++] = p1[i]->m_24;
paramFloats[i].m_0[j++] = p1[i]->m_28;
paramFloats[i].m_0[j++] = p1[i]->m_2C;
paramFloats[i].m_0[j++] = p1[i]->m_30;
paramFloats[i].m_0[j++] = p1[i]->m_34;
paramFloats[i].m_0[j++] = p1[i]->m_38;
paramFloats[i].m_0[j++] = p1[i]->m_3C;
paramFloats[i].m_0[j++] = p1[i]->m_40;
paramFloats[i].m_0[j++] = p1[i]->m_48;
paramFloats[i].m_0[j++] = p1[i]->m_4C;
paramFloats[i].m_0[j++] = p1[i]->m_50;
paramFloats[i].m_0[j++] = p1[i]->m_54;
paramFloats[i].m_0[j++] = p1[i]->m_5C;
paramFloats[i].m_0[j++] = p1[i]->m_60;
paramFloats[i].m_0[j++] = p1[i]->m_6C;
paramFloats[i].m_0[j++] = p1[i]->m_70;
paramFloats[i].m_0[j++] = p1[i]->m_74;
paramFloats[i].m_0[j++] = p1[i]->m_78;
paramFloats[i].m_0[j++] = p1[i]->m_7C;
paramFloats[i].m_0[j++] = p1[i]->m_80;
paramFloats[i].m_0[j++] = p1[i]->m_84;
paramFloats[i].m_0[j++] = p1[i]->m_88;
paramFloats[i].m_0[j++] = p1[i]->m_8C;
paramFloats[i].m_0[j++] = p1[i]->m_90;
paramFloats[i].m_0[j++] = p1[i]->m_94;
paramFloats[i].m_0[j++] = p1[i]->m_98;
paramFloats[i].m_0[j++] = p1[i]->m_9C;
paramFloats[i].m_0[j++] = p1[i]->m_A0;
paramFloats[i].m_0[j++] = p1[i]->m_A4;
paramFloats[i].m_0[j++] = p1[i]->m_A8;
paramFloats[i].m_0[j++] = p1[i]->m_AC;
paramFloats[i].m_0[j++] = p1[i]->m_B0;
paramFloats[i].m_0[j++] = p1[i]->m_B4;

paramInts[i].m_0[k++] = p1[i]->m_10;
paramInts[i].m_0[k++] = p1[i]->m_14;
paramInts[i].m_0[k++] = p1[i]->m_44;
paramInts[i].m_0[k++] = p1[i]->m_58;
paramInts[i].m_0[k++] = p1[i]->m_B8;

paramIndefinites[i].m_0 = &p1[i]->m_64;
}
commonData = p1;
}

// TODO: UBFIX match without casting

float soCommonDataAccesser::getParamCommonFloat(u32 p1, u32 p2) {
return ((soCommonDataAccesser*)(((u8*)(this)) - 0x1F48))
->paramFloats[p1].m_0[p2];
}

s32 soCommonDataAccesser::getParamCommonInt(u32 p1, u32 p2) {
return ((soCommonDataAccesser*)(((u8*)(this)) - 0x157C4))
->paramInts[p1].m_0[p2];
}

s32* soCommonDataAccesser::getParamCommonIndefinite(u32 p1, u32 p2) {
return ((soCommonDataAccesser*)(((u8*)(this)) - 0x29044 + p1*4 + p2*4))
->paramIndefinites[0].m_0;
}

0 comments on commit eb28b3b

Please sign in to comment.