From ef2caebcefe1a0d370a56340944931f71bcd39a8 Mon Sep 17 00:00:00 2001 From: enzofc708 <47937189+enzofc708@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:38:59 -0300 Subject: Decomp sbc.c (100%) (#144) * start sbc.cpp * add G3d_SBCRender_007 * match G3d_SBCRender_007 * match G3d_SBCRender_008 * match G3d_SBCRender_SKN * fix EUR relocs file * match G3d_SBCRender_00C * match G3d_SBCRender_00D * complete sbc.cpp * fix EUR delinks --- include/Actor/Navi/ActorNavi.hpp | 3 ++- include/DTCM/UnkStruct_027e037c.h | 42 ++++++++++++++++++++++++++++++++++++ include/DTCM/UnkStruct_027e037c.hpp | 43 ------------------------------------- include/Render/ModelRender.hpp | 43 ++++++------------------------------- 4 files changed, 51 insertions(+), 80 deletions(-) create mode 100644 include/DTCM/UnkStruct_027e037c.h delete mode 100644 include/DTCM/UnkStruct_027e037c.hpp (limited to 'include') diff --git a/include/Actor/Navi/ActorNavi.hpp b/include/Actor/Navi/ActorNavi.hpp index 841c91f1..c50ee23c 100644 --- a/include/Actor/Navi/ActorNavi.hpp +++ b/include/Actor/Navi/ActorNavi.hpp @@ -5,6 +5,7 @@ #include "Unknown/UnkStruct_02057200.hpp" #include "Unknown/UnkStruct_ov000_020beba8.hpp" #include "Unknown/UnkStruct_ov000_020c0c08.hpp" +#include "nds/g3d/sbc.h" class UnkStruct_ov000_020b8110 : public UnkStruct_ov000_020beba8 { public: @@ -45,7 +46,7 @@ public: /* 344 */ q20 mUnk_344; /* 348 */ unk32 mUnk_348; /* 34c */ ActorNaviBase_Unk1 mUnk_34c[4]; - /* 35c */ ModelRender_UnkBoneMatrixStruct unkBoneMatrixStruct; + /* 35c */ G3d_BoneMtxStruct unkBoneMatrixStruct; /* 3b4 */ EquipHammer *mHammer; /* 3b8 */ UnkStruct_02057200 mUnk_3b8; /* 3c0 */ u8 mUnk_3c0; diff --git a/include/DTCM/UnkStruct_027e037c.h b/include/DTCM/UnkStruct_027e037c.h new file mode 100644 index 00000000..81b20b1a --- /dev/null +++ b/include/DTCM/UnkStruct_027e037c.h @@ -0,0 +1,42 @@ +#pragma once + +#include "global.h" +#include "types.h" + +#include + +typedef struct UnkStruct_027e037c_ { + /* 000 */ unk32 mUnk_000; + /* 004 */ unk32 mUnk_004; + /* 008 */ Mat4p mUnk_008; + /* 048 */ unk32 mUnk_048; + /* 04c */ Mat4x3p mUnk_04c; + /* 07c */ unk32 mUnk_07c; + /* 080 */ unk32 mUnk_080; + /* 084 */ unk32 mUnk_084; + /* 088 */ unk32 mUnk_088; + /* 08c */ unk32 mUnk_08c; + /* 090 */ unk32 mUnk_090; + /* 094 */ unk32 mUnk_094; + /* 098 */ unk32 mUnk_098; + /* 09c */ unk32 mUnk_09c; + /* 0a0 */ unk32 mUnk_0a0; + /* 0a4 */ unk32 mUnk_0a4; + /* 0a8 */ unk32 mUnk_0a8; + /* 0ac */ unk32 mUnk_0ac; + /* 0b0 */ unk32 mUnk_0b0; + /* 0b4 */ unk32 mUnk_0b4; + /* 0b8 */ unk32 mUnk_0b8; + /* 0bc */ Mat3p rotation; + /* 0e0 */ Vec3p translation; + /* 0ec */ Vec3p scale; + /* 0f8 */ unk32 mUnk_0f8; + /* 0fc */ u32 flags; + /* 100 */ Mat4x3p mUnk_100; + /* 130 */ Mat4x3p mUnk_130; + /* 160 */ Mat4x3p mUnk_160; + /* 190 */ Mat4x3p mUnk_190; + /* 1c0 */ +} UnkStruct_027e037c; + +extern UnkStruct_027e037c data_027e037c; \ No newline at end of file diff --git a/include/DTCM/UnkStruct_027e037c.hpp b/include/DTCM/UnkStruct_027e037c.hpp deleted file mode 100644 index 96359f03..00000000 --- a/include/DTCM/UnkStruct_027e037c.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "global.h" -#include "types.h" - -#include - -struct UnkStruct_027e037c { -public: - /* 000 */ unk32 mUnk_000; - /* 004 */ unk32 mUnk_004; - /* 008 */ Mat4p mUnk_008; - /* 048 */ unk32 mUnk_048; - /* 04c */ Mat4x3p mUnk_04c; - /* 07c */ unk32 mUnk_07c; - /* 080 */ unk32 mUnk_080; - /* 084 */ unk32 mUnk_084; - /* 088 */ unk32 mUnk_088; - /* 08c */ unk32 mUnk_08c; - /* 090 */ unk32 mUnk_090; - /* 094 */ unk32 mUnk_094; - /* 098 */ unk32 mUnk_098; - /* 09c */ unk32 mUnk_09c; - /* 0a0 */ unk32 mUnk_0a0; - /* 0a4 */ unk32 mUnk_0a4; - /* 0a8 */ unk32 mUnk_0a8; - /* 0ac */ unk32 mUnk_0ac; - /* 0b0 */ unk32 mUnk_0b0; - /* 0b4 */ unk32 mUnk_0b4; - /* 0b8 */ unk32 mUnk_0b8; - /* 0bc */ Mat3p rotation; - /* 0e0 */ Vec3p translation; - /* 0ec */ Vec3p scale; - /* 0f8 */ unk32 mUnk_0f8; - /* 0fc */ u32 flags; - /* 100 */ Mat4x3p mUnk_100; - /* 130 */ Mat4x3p mUnk_130; - /* 160 */ Mat4x3p mUnk_160; - /* 190 */ Mat4x3p mUnk_190; - /* 1c0 */ -}; - -extern UnkStruct_027e037c data_027e037c; diff --git a/include/Render/ModelRender.hpp b/include/Render/ModelRender.hpp index d0fca92a..846ad1f0 100644 --- a/include/Render/ModelRender.hpp +++ b/include/Render/ModelRender.hpp @@ -3,6 +3,7 @@ #include "global.h" #include "types.h" +#include "nds/g3d/sbc.h" #include #include "System/SysNew.hpp" @@ -10,39 +11,9 @@ class ModelRender; -struct ModelRender_UnkBoneMatrixStruct { - /* 00 */ unk8 mUnk_00[0x28]; - /* 28 */ Mat3p mUnk_28; - /* 4c */ unk8 mUnk_4c[0xC]; - /* 58 */ -}; - -struct ModelRender_UnkStruct_4 { - /* 00 */ unk32 flags; - /* 04 */ void *mLcdcAddr; - /* 08 */ void *mUnk_08; // this attribute is related to UnkStruct_ov000_020c0c08 - /* 0c */ void *mUnkTransformFunc; - /* 10 */ void *mUnk_10; // also related to UnkStruct_ov000_020c0c08 - /* 14 */ void *mUnkMaterialFunc; - /* 18 */ void *mUnk_18; // also related to UnkStruct_ov000_020c0c08 - /* 1c */ void *mUnkVisibilityFunc; - /* 20 */ void *mUnkFunc_20; - /* 24 */ unk8 mUnk_24; - /* 25 */ unk8 mUnk_25; - /* 26 */ unk8 mUnk_26[2]; - /* 28 */ void *mUnk_28; - /* 2c */ ModelRender *mUnk_2c; // pointer to self? - /* 30 */ unk32 mUnk_30; - /* 34 */ ModelRender_UnkBoneMatrixStruct *unkBoneMatrixArray1; - /* 38 */ unk32 mUnk_38[3]; - /* 44 */ unk32 mUnk_44[2]; - /* 4c */ unk32 mUnk_4c[2]; - /* 54 */ -}; - struct ModelRenderCommandsData { /* 00 */ u8 command; - /* 04 */ ModelRender_UnkStruct_4 *unkStruct4; + /* 04 */ G3d_RenderObject *unkStruct4; /* 08 */ }; @@ -51,13 +22,13 @@ class ItemModel; class ModelRender : public SysObject { public: /* 00 (vtable) */ - /* 04 */ ModelRender_UnkStruct_4 mUnk_04; - /* 58 */ ModelRender_UnkBoneMatrixStruct *unkBoneMatrixArray2; + /* 04 */ G3d_RenderObject renderObj; + /* 58 */ G3d_BoneMtxStruct *unkBoneMatrixArray2; /* 5c */ /* 00 */ virtual ~ModelRender(); /* 08 */ virtual void *GetLcdcAddress(); - /* 0c */ virtual void Init_ModelRender_UnkStruct_4(ItemModel *model); + /* 0c */ virtual void Init_RenderObject(ItemModel *model); /* 10 */ virtual void SetTransform(Vec3p *scale, Mat3p *rotation, Vec3p *translation); /* 14 */ virtual void SetRotationTranslation(Mat3p *rotation, Vec3p *translation); /* 18 */ virtual void SetTranslation(Vec3p *translation); @@ -73,11 +44,11 @@ public: /* 40 */ ModelRender(ItemModel *itemModel); - ModelRender_UnkBoneMatrixStruct *UnkGetBoneMatrix(s32 index); + G3d_BoneMtxStruct *UnkGetBoneMatrix(s32 index); s32 GetObjectIndex(char *objectName); s32 GetMaterialIndex(char *materialName); void InitBoneMatrixArrays(u32 idLength); - void SetUnkBoneMatrixArray1(ModelRender_UnkBoneMatrixStruct *boneMatrix); + void SetUnkBoneMatrixArray1(G3d_BoneMtxStruct *boneMatrix); void UnkInit_Struct4_Params(u8 param1, u8 param2); void func_ov000_020b413c(unk16 param1, Vec3p *param2); }; -- cgit v1.2.3