diff --git a/config/RSBE01_02/splits.txt b/config/RSBE01_02/splits.txt index 4a872ca..d7b4a0d 100644 --- a/config/RSBE01_02/splits.txt +++ b/config/RSBE01_02/splits.txt @@ -180,6 +180,12 @@ sora/if/if_adv_task.cpp: .data start:0x8045D070 end:0x8045D0F8 .sdata start:0x8059E5F0 end:0x8059E5F8 +sora/if/if_stgedit.cpp: + .text start:0x8010EFD4 end:0x8010F310 + .data start:0x8045D810 end:0x8045D840 + .sdata start:0x8059E690 end:0x8059E6A0 + .sdata2 start:0x805A28C8 end:0x805A28E8 + sora/gr/collision/gr_collision_data.cpp: .text start:0x80110720 end:0x80110748 diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index fee9bea..fda78b5 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -2560,8 +2560,8 @@ setLoopMatCol__16gfModelAnimationFd = .text:0x80028394; // type:function size:0x getFrameCount__16gfModelAnimationFd = .text:0x800283BC; // type:function size:0xDC setFrame__16gfModelAnimationFd = .text:0x80028498; // type:function size:0xF4 getFrame__16gfModelAnimationFd = .text:0x8002858C; // type:function size:0xC4 -setUpdateRate__16gfModelAnimationFd = .text:0x80028650; // type:function size:0xF4 -getUpdateRate__16gfModelAnimationFd = .text:0x80028744; // type:function size:0xC4 +setUpdateRate__16gfModelAnimationFf = .text:0x80028650; // type:function size:0xF4 +getUpdateRate__16gfModelAnimationFv = .text:0x80028744; // type:function size:0xC4 fn_80028808 = .text:0x80028808; // type:function size:0x10 fn_80028818 = .text:0x80028818; // type:function size:0x24 fn_8002883C = .text:0x8002883C; // type:function size:0x68 @@ -4449,7 +4449,7 @@ fn_800B20B0 = .text:0x800B20B0; // type:function size:0x114 fn_800B21C4 = .text:0x800B21C4; // type:function size:0xF4 fn_800B22B8 = .text:0x800B22B8; // type:function size:0x60 fn_800B2318 = .text:0x800B2318; // type:function size:0x7C -create__8MuObjectFPPQ34nw4r3g3d7ResFilePcciQ25Heaps8HeapType = .text:0x800B2394; // type:function size:0x70 +create__8MuObjectFPQ34nw4r3g3d7ResFilePCciPQ34nw4r3g3d7ResFileQ25Heaps8HeapType = .text:0x800B2394; // type:function size:0x70 create__8MuObjectFPPQ34nw4r3g3d7ResFileiciQ25Heaps8HeapType = .text:0x800B2404; // type:function size:0x70 fn_800B2474 = .text:0x800B2474; // type:function size:0x3BC fn_800B2830 = .text:0x800B2830; // type:function size:0x3BC @@ -4512,7 +4512,7 @@ fn_800B7224 = .text:0x800B7224; // type:function size:0x1F0 fn_800B7414 = .text:0x800B7414; // type:function size:0xB8 fn_800B74CC = .text:0x800B74CC; // type:function size:0x70 fn_800B753C = .text:0x800B753C; // type:function size:0x25C -fn_800B7798 = .text:0x800B7798; // type:function size:0xB4 +setFrameNode__8MuObjectFf = .text:0x800B7798; // type:function size:0xB4 setFrameVisible__8MuObjectFf = .text:0x800B784C; // type:function size:0xB4 setFrameTex__8MuObjectFf = .text:0x800B7900; // type:function size:0x8C fn_800B798C = .text:0x800B798C; // type:function size:0x8C @@ -5567,15 +5567,15 @@ fn_8010ED14 = .text:0x8010ED14; // type:function size:0x68 fn_8010ED7C = .text:0x8010ED7C; // type:function size:0x2C fn_8010EDA8 = .text:0x8010EDA8; // type:function size:0x224 fn_8010EFCC = .text:0x8010EFCC; // type:function size:0x8 -fn_8010EFD4 = .text:0x8010EFD4; // type:function size:0x24 -fn_8010EFF8 = .text:0x8010EFF8; // type:function size:0x90 -fn_8010F088 = .text:0x8010F088; // type:function size:0x14 -fn_8010F09C = .text:0x8010F09C; // type:function size:0xF4 -fn_8010F190 = .text:0x8010F190; // type:function size:0x8 -fn_8010F198 = .text:0x8010F198; // type:function size:0x70 -fn_8010F208 = .text:0x8010F208; // type:function size:0x7C -fn_8010F284 = .text:0x8010F284; // type:function size:0x70 -fn_8010F2F4 = .text:0x8010F2F4; // type:function size:0x1C +__ct__9IfStgeditFv = .text:0x8010EFD4; // type:function size:0x24 +__dt__9IfStgeditFv = .text:0x8010EFF8; // type:function size:0x90 +createModel__9IfStgeditFPQ34nw4r3g3d7ResFile = .text:0x8010F088; // type:function size:0x14 +createObjResFile__9IfStgeditFPCvlPQ34nw4r3g3d7ResFilel = .text:0x8010F09C; // type:function size:0xF4 +startMelee__9IfStgeditFPQ34nw4r3g3d8ScnGroup = .text:0x8010F190; // type:function size:0x8 +main__9IfStgeditFv = .text:0x8010F198; // type:function size:0x70 +setVisible__9IfStgeditFb = .text:0x8010F208; // type:function size:0x7C +setHelpControllerNo__9IfStgeditFUl = .text:0x8010F284; // type:function size:0x70 +setVisibleZoomHelp__9IfStgeditFb = .text:0x8010F2F4; // type:function size:0x1C fn_8010F310 = .text:0x8010F310; // type:function size:0x8C fn_8010F39C = .text:0x8010F39C; // type:function size:0x110 fn_8010F4AC = .text:0x8010F4AC; // type:function size:0x178 @@ -16229,7 +16229,7 @@ sscanf = .text:0x803FA108; // type:function size:0xC8 fn_803FA1D0 = .text:0x803FA1D0; // type:function size:0xB0 strcpy = .text:0x803FA280; // type:function size:0xC0 strncpy__6StringF6StringPCcUl = .text:0x803FA340; // type:function size:0x44 -strcat__FPcPc = .text:0x803FA384; // type:function size:0x2C +strcat = .text:0x803FA384; // type:function size:0x2C strncat = .text:0x803FA3B0; // type:function size:0x4C strcmp = .text:0x803FA3FC; // type:function size:0x11C strncmp = .text:0x803FA518; // type:function size:0x40 @@ -26038,7 +26038,7 @@ lbl_8045D428 = .data:0x8045D428; // type:object size:0xF data:string lbl_8045D438 = .data:0x8045D438; // type:object size:0x38 lbl_8045D470 = .data:0x8045D470; // type:object size:0x3A0 lbl_8045D810 = .data:0x8045D810; // type:object size:0x14 data:string -lbl_8045D824 = .data:0x8045D824; // type:object size:0xC +__vt__9IfStgedit = .data:0x8045D824; // type:object size:0xC lbl_8045D830 = .data:0x8045D830; // type:object size:0xA data:string lbl_8045D840 = .data:0x8045D840; // type:object size:0x60 lbl_8045D8A0 = .data:0x8045D8A0; // type:object size:0x68 data:byte @@ -29574,7 +29574,7 @@ lbl_8059E678 = .sdata:0x8059E678; // type:object size:0x6 data:string lbl_8059E680 = .sdata:0x8059E680; // type:object size:0x6 data:string lbl_8059E688 = .sdata:0x8059E688; // type:object size:0x6 data:string lbl_8059E690 = .sdata:0x8059E690; // type:object size:0x4 data:string -lbl_8059E698 = .sdata:0x8059E698; // type:object size:0x8 +__RTTI__9IfStgedit = .sdata:0x8059E698; // type:object size:0x8 lbl_8059E6A0 = .sdata:0x8059E6A0; // type:object size:0x8 lbl_8059E6A8 = .sdata:0x8059E6A8; // type:object size:0x8 data:string lbl_8059E6B0 = .sdata:0x8059E6B0; // type:object size:0x8 data:string @@ -32810,7 +32810,7 @@ lbl_805A28C0 = .sdata2:0x805A28C0; // type:object size:0x8 align:4 data:float lbl_805A28C8 = .sdata2:0x805A28C8; // type:object size:0x8 lbl_805A28D0 = .sdata2:0x805A28D0; // type:object size:0x4 align:4 data:float lbl_805A28D8 = .sdata2:0x805A28D8; // type:object size:0x8 align:8 data:double -lbl_805A28E0 = .sdata2:0x805A28E0; // type:object size:0x4 +lbl_805A28E0 = .sdata2:0x805A28E0; // type:object size:0x4 scope:local lbl_805A28E4 = .sdata2:0x805A28E4; // type:object size:0x4 align:4 data:float lbl_805A28E8 = .sdata2:0x805A28E8; // type:object size:0x4 align:4 data:float lbl_805A28EC = .sdata2:0x805A28EC; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index 4e111c0..1a6dd9e 100755 --- a/configure.py +++ b/configure.py @@ -326,6 +326,7 @@ def MatchingFor(*versions): Object(NonMatching, "sora/ty/ty_fig_listmng.cpp"), Object(Matching, "sora/if/if_wifipr_task.cpp"), Object(Matching, "sora/if/if_adv_task.cpp"), + Object(Matching, "sora/if/if_stgedit.cpp"), Object(Matching, "sora/gr/collision/gr_collision_data.cpp"), Object(Matching, "sora/gr/collision/gr_collision_handle.cpp"), Object(Matching, "sora/gr/gr_path.cpp"), diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index c5dd5a1..db488a5 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit c5dd5a1baae361294e5cd98e4a0662f4014474f9 +Subproject commit db488a5d48b30ea1075a6db37d6c40112de2ddbc diff --git a/src/sora/if/if_stgedit.cpp b/src/sora/if/if_stgedit.cpp new file mode 100644 index 0000000..1d5dcf7 --- /dev/null +++ b/src/sora/if/if_stgedit.cpp @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct UnkModelNodeInfo { + const char* m_name; + u8 unk4; + u8 unk5; + u8 unk6; +}; +static_assert(sizeof(UnkModelNodeInfo) == 0x8, "Class is the wrong size!"); + +static const UnkModelNodeInfo g_ModelNodeInfo = { "MenStgedit0100_TopN", 0, 0, 1 }; + +IfStgedit::IfStgedit() { + m_scnGroup = nullptr; + for (u32 i = 0; i < 1; i++) { + m_modelNodes[i] = nullptr; + } + m_visible = false; + m_helpPadNun = 0; +} + +IfStgedit::~IfStgedit() { + for (u32 i = 0; i < 1; i++) { + if (m_modelNodes[i]) { + delete m_modelNodes[i]; + m_modelNodes[i] = nullptr; + } + } +} + +void IfStgedit::createModel(nw4r::g3d::ResFile* mdlSrc) { + createObjResFile(&g_ModelNodeInfo, 1, mdlSrc, 0); +} + +void IfStgedit::createObjResFile(const void* nodeInfo, s32 nodeCount, + nw4r::g3d::ResFile* mdlSrc, s32 prio) { + s32 i; + s32 j; + const UnkModelNodeInfo* p = static_cast(nodeInfo); + char nameBuf[0x40]; + for (i = 0; i < nodeCount; i++, p++) { + s32 nCopies = (p->unk4 < p->unk5) ? p->unk5 - p->unk4 : 1; + for (j = 0; j < nCopies; j++) { + MuObject* obj = MuObject::create(mdlSrc, p->m_name, p->unk6 + prio + j, + 0, Heaps::InfoInstance); + m_modelNodes[p->unk4 + j] = obj; + strcpy(nameBuf, p->m_name); + strcat(nameBuf, "__0"); + obj->changeAnimN(nameBuf); + if (obj->m_modelAnim) { + obj->m_modelAnim->setUpdateRate(0); + } + } + } +} + +void IfStgedit::startMelee(nw4r::g3d::ScnGroup* grp) { + m_scnGroup = grp; +} + +void IfStgedit::main() { + gfPadStatus status; + g_gfPadSystem->getSysPadStatus(m_helpPadNun, &status); + if (status.m_error == gfPadError::NONE) { + m_modelNodes[0]->setFrameVisible(Frames[status.m_controllerType]); + } +} + +const u8 IfStgedit::Frames[] = { 0, 3, 2, 1 }; + +void IfStgedit::setVisible(bool vis) { + m_visible = vis; + m_scnGroup->Remove(m_modelNodes[0]->m_sceneModel); + if (vis) { + m_scnGroup->Insert(m_scnGroup->sceneItemsCount, m_modelNodes[0]->m_sceneModel); + } +} + +void IfStgedit::setHelpControllerNo(u32 num) { + m_helpPadNun = num; + main(); +} + +void IfStgedit::setVisibleZoomHelp(bool p1) { + float frame = p1 ? 0.0f : 1.0f; + m_modelNodes[0]->setFrameNode(frame); +}