From 004925d41c1249be49b0aec0b2b4fbaa62d53162 Mon Sep 17 00:00:00 2001 From: kabiskac Date: Fri, 2 Aug 2024 01:56:43 +0200 Subject: [PATCH] Made struct defs more local in present dll --- include/REL/present.h | 127 +------------------------------------- src/REL/option/state.c | 10 +-- src/REL/present/camera.c | 28 +++++++++ src/REL/present/common.c | 22 +++++++ src/REL/present/init.c | 13 ++++ src/REL/present/main.c | 13 +++- src/REL/present/present.c | 50 +++++++++++++++ 7 files changed, 131 insertions(+), 132 deletions(-) diff --git a/include/REL/present.h b/include/REL/present.h index 12706b86..a47db699 100644 --- a/include/REL/present.h +++ b/include/REL/present.h @@ -2,7 +2,6 @@ #define PRESENT_H #include "game/object.h" -// #include "REL/option.h" // this causes problems because of the extern bsses typedef struct UnkWindowDataStruct { /* 0x00 */ Process *process; @@ -15,131 +14,7 @@ typedef struct UnkWindowDataStruct { /* 0x18 */ u32 unk18; /* 0x1C */ s32 choice; /* 0x20 */ s32 unk_20; -} UnkWindowDataStruct; // this already exists in option.h - -typedef struct UnkPresentStruct { - /* 0x00 */ UnkWindowDataStruct *unk_00; - /* 0x04 */ s32 unk_04; -} UnkPresentStruct; - -typedef struct UnkPresentStruct2 { - /* 0x00 */ s32 unk_00; - /* 0x04 */ s32 unk_04; - /* 0x08 */ s32 unk_08; - /* 0x0C */ s32 unk_0C; - /* 0x10 */ omObjData *unk_10[134]; - /* 0x228 */ UnkWindowDataStruct *unk_228; - /* 0x22C */ UnkWindowDataStruct *unk_22C; - /* 0x230 */ s16 sprite; - /* 0x234 */ s32 unk_234; - /* 0x238 */ s32 unk_238; - /* 0x23C */ float unk_23C; - /* 0x240 */ float unk_240; - /* 0x244 */ float unk_244; - /* 0x248 */ float unk_248; - /* 0x24C */ float unk_24C; - /* 0x250 */ float unk_250; - /* 0x254 */ float unk_254; - /* 0x258 */ float unk_258; - /* 0x25C */ float unk_25C; - /* 0x260 */ float unk_260; - /* 0x264 */ float unk_264; - /* 0x268 */ float unk_268; - /* 0x26C */ float unk_26C; - /* 0x270 */ s32 unk_270[60]; -} UnkPresentStruct2; - -typedef struct UnkPresentStruct3 { - /* 0x00 */ Vec unk_00; - /* 0x0C */ Vec unk_0C; - /* 0x18 */ GXColor unk_18; -} UnkPresentStruct3; - -typedef struct UnkPresentStruct4 { - /* 0x00 */ Vec unk_00; - /* 0x0C */ Vec unk_0C; - /* 0x18 */ Vec unk_18; -} UnkPresentStruct4; - -typedef struct UnkPresentStruct5 { - /* 0x00 */ s32 unk_00; - /* 0x04 */ s16 unk_04; - /* 0x08 */ float x; - /* 0x0C */ float y; - /* 0x10 */ float z; - /* 0x14 */ float unk_14; - /* 0x18 */ s32 unk18[2]; - /* 0x20 */ float unk_20; - /* 0x24 */ float unk_24; - /* 0x28 */ float unk_28; - /* 0x2C */ float unk_2C; - /* 0x30 */ float unk_30; - /* 0x34 */ float unk_34; - /* 0x38 */ float unk_38; - /* 0x3C */ s32 unk3C[3]; - /* 0x48 */ float unk_48; - /* 0x4C */ float unk_4C; - /* 0x50 */ s32 unk_50; - /* 0x54 */ s32 unk_54; -} UnkPresentStruct5; - -typedef struct UnkPresentStruct6 { - /* 0x00 */ s16 unk_00; - /* 0x04 */ float unk_04; - /* 0x08 */ float unk_08; -} UnkPresentStruct6; // looks like a struct in option/scene.c - -typedef struct UnkPresentStruct6Weird { - /* 0x00 */ s16 unk_00; - /* 0x04 */ float unk_04; - /* 0x08 */ float unk_08; - /* 0x0C */ float unk_0C; -} UnkPresentStruct6Weird; // looks like a struct in option/scene.c - -typedef struct UnkPresentCameraStruct { - /* 0x00 */ Vec pos; - /* 0x0C */ Vec target; - /* 0x18 */ Vec up; - /* 0x24 */ float unk_24; - /* 0x28 */ float unk_28; - /* 0x2C */ Vec unk_2C; - /* 0x38 */ Vec unk_38; - /* 0x44 */ float unk44; - /* 0x48 */ float unk48; - /* 0x4C */ float unk4C; - /* 0x50 */ float unk_50; - /* 0x54 */ float unk_54; - /* 0x58 */ Vec unk_58; - /* 0x64 */ Vec unk_64; - /* 0x70 */ float unk70; - /* 0x74 */ float unk74; - /* 0x78 */ float unk78; - /* 0x7C */ float unk_7C; - /* 0x80 */ float unk_80; - /* 0x84 */ float unk_84; - /* 0x88 */ float unk_88; - /* 0x8C */ float unk_8C; - /* 0x90 */ float unk_90; - /* 0x94 */ float unk_94; - /* 0x98 */ float unk_98; -} UnkPresentCameraStruct; - -typedef struct UnkPresentNestedInnerStruct { - /* 0x00 */ s32 unk_00; - /* 0x04 */ s32 unk_04; - /* 0x08 */ s32 unk08; - /* 0x0C */ s32 unk_0C; -} UnkPresentNestedInnerStruct; - -typedef struct UnkPresentNestedOuterStruct { - /* 0x00 */ s32 unk00; - /* 0x04 */ UnkPresentNestedInnerStruct unk_04[11]; -} UnkPresentNestedOuterStruct; - -typedef struct UnkPresentStruct7 { - /* 0x00 */ s32 unk_00; - /* 0x04 */ float unk_04; -} UnkPresentStruct7; +} UnkWindowDataStruct; /* size 0x24 */ // this already exists in option.h extern omObjData *lbl_1_bss_10; extern omObjData *lbl_1_bss_8; diff --git a/src/REL/option/state.c b/src/REL/option/state.c index a2fc6f37..1ed1cb12 100755 --- a/src/REL/option/state.c +++ b/src/REL/option/state.c @@ -10,13 +10,13 @@ typedef struct { /* 0x00 */ OptionWindow *window; /* 0x04 */ s32 quitTimer; /* 0x08 */ s16 light; -} StateWork; // Size 0xC +} StateWork; /* size = 0x0C */ typedef struct { - Vec src; - Vec dest; - GXColor color; -} UnkLightDataStruct; // Size 0x1C TODO same as m446Dll::unkStruct10 and present::UnkPresentStruct3 + /* 0x00 */ Vec src; + /* 0x0C */ Vec dest; + /* 0x18 */ GXColor color; +} UnkLightDataStruct; /* size = 0x1C */ // TODO same as m446Dll::unkStruct10 and present::UnkPresentStruct3 static void ExecState(omObjData *object); diff --git a/src/REL/present/camera.c b/src/REL/present/camera.c index f6b2e29f..4da4721b 100644 --- a/src/REL/present/camera.c +++ b/src/REL/present/camera.c @@ -5,6 +5,34 @@ #include "REL/present.h" +typedef struct UnkPresentCameraStruct { + /* 0x00 */ Vec pos; + /* 0x0C */ Vec target; + /* 0x18 */ Vec up; + /* 0x24 */ float unk_24; + /* 0x28 */ float unk_28; + /* 0x2C */ Vec unk_2C; + /* 0x38 */ Vec unk_38; + /* 0x44 */ float unk44; + /* 0x48 */ float unk48; + /* 0x4C */ float unk4C; + /* 0x50 */ float unk_50; + /* 0x54 */ float unk_54; + /* 0x58 */ Vec unk_58; + /* 0x64 */ Vec unk_64; + /* 0x70 */ float unk70; + /* 0x74 */ float unk74; + /* 0x78 */ float unk78; + /* 0x7C */ float unk_7C; + /* 0x80 */ float unk_80; + /* 0x84 */ float unk_84; + /* 0x88 */ float unk_88; + /* 0x8C */ float unk_8C; + /* 0x90 */ float unk_90; + /* 0x94 */ float unk_94; + /* 0x98 */ float unk_98; +} UnkPresentCameraStruct; /* size = 0x9C */ + void fn_1_C20(omObjData *object); omObjData *fn_1_6B4(void) diff --git a/src/REL/present/common.c b/src/REL/present/common.c index 02e984fa..4ffe63e6 100644 --- a/src/REL/present/common.c +++ b/src/REL/present/common.c @@ -6,6 +6,28 @@ #include "REL/present.h" +typedef struct UnkPresentStruct5 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x08 */ float x; + /* 0x0C */ float y; + /* 0x10 */ float z; + /* 0x14 */ float unk_14; + /* 0x18 */ s32 unk18[2]; + /* 0x20 */ float unk_20; + /* 0x24 */ float unk_24; + /* 0x28 */ float unk_28; + /* 0x2C */ float unk_2C; + /* 0x30 */ float unk_30; + /* 0x34 */ float unk_34; + /* 0x38 */ float unk_38; + /* 0x3C */ s32 unk3C[3]; + /* 0x48 */ float unk_48; + /* 0x4C */ float unk_4C; + /* 0x50 */ s32 unk_50; + /* 0x54 */ s32 unk_54; +} UnkPresentStruct5; /* size = 0x58 */ + void fn_1_4620(omObjData *object); void fn_1_4880(omObjData *object); diff --git a/src/REL/present/init.c b/src/REL/present/init.c index 5b8a3164..c572694e 100644 --- a/src/REL/present/init.c +++ b/src/REL/present/init.c @@ -8,6 +8,19 @@ #include "REL/present.h" +typedef struct UnkPresentStruct6 { + /* 0x00 */ s16 unk_00; + /* 0x04 */ float unk_04; + /* 0x08 */ float unk_08; +} UnkPresentStruct6; /* size 0x0C */ // looks like a struct in option/scene.c + +typedef struct UnkPresentStruct6Weird { + /* 0x00 */ s16 unk_00; + /* 0x04 */ float unk_04; + /* 0x08 */ float unk_08; + /* 0x0C */ float unk_0C; +} UnkPresentStruct6Weird; /* size = 0x10 */ // looks like a struct in option/scene.c + omObjData *lbl_1_bss_18; omObjData *lbl_1_bss_14; omObjData *lbl_1_bss_10; diff --git a/src/REL/present/main.c b/src/REL/present/main.c index 0e4cbfa7..2876b242 100644 --- a/src/REL/present/main.c +++ b/src/REL/present/main.c @@ -7,6 +7,17 @@ #include "REL/present.h" +typedef struct UnkPresentStruct { + /* 0x00 */ UnkWindowDataStruct *unk_00; + /* 0x04 */ s32 unk_04; +} UnkPresentStruct; /* size = 0x08 */ + +typedef struct UnkPresentStruct4 { + /* 0x00 */ Vec unk_00; + /* 0x0C */ Vec unk_0C; + /* 0x18 */ Vec unk_18; +} UnkPresentStruct4; /* size = 0x1C */ + omObjData *lbl_1_bss_20; UnkPresentStruct4 lbl_1_data_F0 = { { 0.0f, 3000.0f, 1.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }; @@ -269,7 +280,7 @@ void fn_1_41BC(UnkWindowDataStruct *windowData, s32 arg1) void fn_1_41E0(void) { UnkWindowDataStruct *windowData = HuPrcCurrentGet()->user_data; - + while (TRUE) { switch (windowData->unk_20) { case 1: diff --git a/src/REL/present/present.c b/src/REL/present/present.c index 1aa725eb..7daf7f57 100644 --- a/src/REL/present/present.c +++ b/src/REL/present/present.c @@ -8,6 +8,56 @@ #include "REL/present.h" +typedef struct UnkPresentStruct2 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ s32 unk_04; + /* 0x08 */ s32 unk_08; + /* 0x0C */ s32 unk_0C; + /* 0x10 */ omObjData *unk_10[134]; + /* 0x228 */ UnkWindowDataStruct *unk_228; + /* 0x22C */ UnkWindowDataStruct *unk_22C; + /* 0x230 */ s16 sprite; + /* 0x234 */ s32 unk_234; + /* 0x238 */ s32 unk_238; + /* 0x23C */ float unk_23C; + /* 0x240 */ float unk_240; + /* 0x244 */ float unk_244; + /* 0x248 */ float unk_248; + /* 0x24C */ float unk_24C; + /* 0x250 */ float unk_250; + /* 0x254 */ float unk_254; + /* 0x258 */ float unk_258; + /* 0x25C */ float unk_25C; + /* 0x260 */ float unk_260; + /* 0x264 */ float unk_264; + /* 0x268 */ float unk_268; + /* 0x26C */ float unk_26C; + /* 0x270 */ s32 unk_270[60]; +} UnkPresentStruct2; /* size = 0x3F0 */ + +typedef struct UnkPresentStruct3 { + /* 0x00 */ Vec unk_00; + /* 0x0C */ Vec unk_0C; + /* 0x18 */ GXColor unk_18; +} UnkPresentStruct3; /* size = 0x1C */ // same as option::state::UnkLightDataStruct + +typedef struct UnkPresentNestedInnerStruct { + /* 0x00 */ s32 unk_00; + /* 0x04 */ s32 unk_04; + /* 0x08 */ s32 unk08; + /* 0x0C */ s32 unk_0C; +} UnkPresentNestedInnerStruct; /* size = 0x10 */ + +typedef struct UnkPresentNestedOuterStruct { + /* 0x00 */ s32 unk00; + /* 0x04 */ UnkPresentNestedInnerStruct unk_04[11]; +} UnkPresentNestedOuterStruct; /* size = 0x08 */ + +typedef struct UnkPresentStruct7 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ float unk_04; +} UnkPresentStruct7; /* size = 0x08 */ + void fn_1_180C(omObjData *object, s32 arg1); void fn_1_1928(omObjData *arg0); void fn_1_1FA8(omObjData *object, s32 arg1);