From 77635b51e38eaf2df0a4582e14f79f3879d1ea8b Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Tue, 1 Apr 2025 06:27:29 +0200 Subject: [PATCH] Fix some headers and missing prototypes --- include/REL/m407dll.h | 49 ++++++++++++++++++++++++++++++++++++- include/game/data.h | 6 ++--- include/game/hsfanim.h | 4 +-- include/game/hsfman.h | 5 ++-- include/game/minigame_seq.h | 4 +-- src/REL/m407dll/effect.c | 1 + src/REL/m407dll/main.c | 13 +++------- src/REL/m407dll/map.c | 2 +- src/REL/m407dll/player.c | 5 ++-- src/REL/m407dll/score.c | 6 ++--- src/REL/m407dll/whomp.c | 4 +-- 11 files changed, 69 insertions(+), 30 deletions(-) diff --git a/include/REL/m407dll.h b/include/REL/m407dll.h index a5dbf0fb..fe2aead2 100644 --- a/include/REL/m407dll.h +++ b/include/REL/m407dll.h @@ -5,6 +5,53 @@ #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) -typedef void (*ObjFuncs)(omObjData*); +typedef void (*VoidFuncs)(void); +typedef void (*ObjFuncs)(omObjData *); + +void fn_1_F4(Process *arg0); +void fn_1_194(void); +void fn_1_1E4(void); +void fn_1_238(void); +void fn_1_28C(void); +void fn_1_2E0(void); +void fn_1_334(void); +void fn_1_388(u8, s32); +void fn_1_3C4(u8); +void fn_1_404(void); +s32 fn_1_508(u8); +s32 fn_1_53C(u8); +void fn_1_568(s16, s16, s16); + +void fn_1_14F0(Process *arg0, s32 arg1); +void fn_1_15D8(void); + +void fn_1_1B1C(Process *arg0); +void fn_1_1CA8(void); +void fn_1_1CAC(f32, f32, f32); +void fn_1_1CD4(f32* arg0, f32* arg1, f32* arg2); +s32 fn_1_1D88(void); +void fn_1_1DB0(Point3d *arg0, Point3d *arg1, f32 *arg2, s32 arg3, s32 arg4); + +void fn_1_2354(Process *arg0); +void fn_1_2564(void); +void fn_1_25C0(void); +s32 fn_1_2880(void); +#ifndef __MWERKS__ +s16 fn_1_28B8(u8 arg0); +s16 fn_1_28D4(void); +#endif + +void fn_1_3AC8(Process *arg0); +void fn_1_3B68(void); + +void fn_1_41CC(Process *arg0); +void fn_1_44F4(void); + +void fn_1_4980(Process* arg0); +void fn_1_4C6C(omObjData *obj); + +void fn_1_5C5C(Process *arg0, s16 arg1); +void fn_1_5ECC(void); +void fn_1_5F40(s32 arg0); #endif diff --git a/include/game/data.h b/include/game/data.h index 288e5577..9c01b09b 100644 --- a/include/game/data.h +++ b/include/game/data.h @@ -17,7 +17,7 @@ #include "dolphin/types.h" -typedef struct data_read_stat { +struct data_read_stat { s32 dir_id; void *dir; void *file; @@ -27,7 +27,7 @@ typedef struct data_read_stat { s32 num; u32 status; DVDFileInfo file_info; -} DataReadStat; +}; void HuDataInit(void); s32 HuDataReadChk(s32 data_num); @@ -56,4 +56,4 @@ void HuDecodeData(void *src, void *dst, u32 size, s32 decode_type); extern u32 DirDataSize; -#endif \ No newline at end of file +#endif diff --git a/include/game/hsfanim.h b/include/game/hsfanim.h index 32c9c4cc..9cf16673 100644 --- a/include/game/hsfanim.h +++ b/include/game/hsfanim.h @@ -26,7 +26,7 @@ typedef struct { /* 0x40 */ GXColor unk40; } HsfanimStruct01; // Size 0x44 -typedef struct particle_data { +struct particle_data { /* 0x00 */ s16 unk_00; /* 0x02 */ s16 unk_02; /* 0x04 */ Vec unk_04; @@ -50,7 +50,7 @@ typedef struct particle_data { /* 0x4C */ Vec *unk_4C; /* 0x50 */ void *unk_50; /* 0x54 */ ParticleHook unk_54; -} ParticleData; // Size 0x58 +}; // Size 0x58 typedef struct { /* 0x00 */ s16 unk00; diff --git a/include/game/hsfman.h b/include/game/hsfman.h index 87299d79..44c0480d 100644 --- a/include/game/hsfman.h +++ b/include/game/hsfman.h @@ -79,11 +79,12 @@ #define Hu3DModelCreateFile(data_id) (Hu3DModelCreate(HuDataSelHeapReadNum((data_id), MEMORY_DEFAULT_NUM, HEAP_DATA))) +typedef struct model_data ModelData; typedef struct particle_data ParticleData; typedef void (*ModelHookFunc)(struct model_data *, Mtx); -typedef struct model_data { +struct model_data { u8 unk_00; u8 unk_01; u8 unk_02; @@ -136,7 +137,7 @@ typedef struct model_data { Vec scale; Mtx unk_F0; void *unk_120; -} ModelData; // sizeof 0x124 +}; // sizeof 0x124 typedef struct camera_data { f32 fov; f32 near; diff --git a/include/game/minigame_seq.h b/include/game/minigame_seq.h index a345b0fe..6f20a101 100644 --- a/include/game/minigame_seq.h +++ b/include/game/minigame_seq.h @@ -48,7 +48,7 @@ typedef struct seq_work SeqWork; typedef s32 (*SeqUpdateFunc)(SeqWork *work); typedef s32 (*SeqInitFunc)(SeqWork *work, va_list params); -typedef struct seq_work { +struct seq_work { SeqUpdateFunc update; char *data; float x; @@ -73,7 +73,7 @@ typedef struct seq_work { u8 stat; u8 unk_7C; u8 unk_7D; -} SeqWork; +}; void MGSeqInit(void); void MGSeqMain(void); diff --git a/src/REL/m407dll/effect.c b/src/REL/m407dll/effect.c index 52df4f5a..4e5287ba 100644 --- a/src/REL/m407dll/effect.c +++ b/src/REL/m407dll/effect.c @@ -2,6 +2,7 @@ #include "game/hsfmotion.h" #include "game/object.h" #include "game/process.h" +#include "math.h" #include "REL/m407dll.h" diff --git a/src/REL/m407dll/main.c b/src/REL/m407dll/main.c index a3b4c1d7..83406eca 100644 --- a/src/REL/m407dll/main.c +++ b/src/REL/m407dll/main.c @@ -1,13 +1,12 @@ #include "game/object.h" #include "game/gamework_data.h" +#include "game/gamework.h" #include "game/minigame_seq.h" #include "game/wipe.h" #include "game/audio.h" #include "game/hsfman.h" -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) - -typedef void (*ObjFuncs)(void); +#include "REL/m407dll.h" typedef struct unkDominationData5 { /* 0x00 */ u32 unk_00; @@ -27,12 +26,6 @@ typedef struct unkDominationData5 { } unkDominationData5; //sizeof 0x48 //function signatures -void fn_1_388(u8, s32); -void fn_1_3C4(u8); -s32 fn_1_4C0(s32); -s32 fn_1_508(u8); -s32 fn_1_53C(u8); -void fn_1_568(s16, s16, s16); void fn_1_4B7C(void); void fn_1_4C3C(s32); void fn_1_4C6C(omObjData*); @@ -56,7 +49,7 @@ omObjData* lbl_1_bss_397C; s16 lbl_1_bss_3978; //data -ObjFuncs lbl_1_data_2A8[] = { +VoidFuncs lbl_1_data_2A8[] = { fn_1_4D0C, fn_1_4D54, fn_1_4E8C, diff --git a/src/REL/m407dll/map.c b/src/REL/m407dll/map.c index 3586f39a..1f5cc5e0 100644 --- a/src/REL/m407dll/map.c +++ b/src/REL/m407dll/map.c @@ -3,7 +3,7 @@ #include "game/object.h" #include "game/process.h" -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) +#include "REL/m407dll.h" // function signatures void fn_1_162C(omObjData *); diff --git a/src/REL/m407dll/player.c b/src/REL/m407dll/player.c index 725f71bd..0557ca80 100644 --- a/src/REL/m407dll/player.c +++ b/src/REL/m407dll/player.c @@ -1,15 +1,16 @@ +#include "game/audio.h" #include "game/chrman.h" #include "game/frand.h" #include "game/gamework_data.h" #include "game/hsfman.h" +#include "game/hsfmotion.h" #include "game/object.h" #include "game/objsub.h" #include "game/pad.h" #include "game/process.h" #include "math.h" -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) -typedef void (*ObjFuncs)(omObjData *); +#include "REL/m407dll.h" typedef struct unkDominationData { u8 unk_00; diff --git a/src/REL/m407dll/score.c b/src/REL/m407dll/score.c index e5cd5fed..4895ebd8 100644 --- a/src/REL/m407dll/score.c +++ b/src/REL/m407dll/score.c @@ -3,9 +3,7 @@ #include "game/process.h" #include "game/sprite.h" -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) - -typedef void (*ObjFuncs)(void); +#include "REL/m407dll.h" typedef struct unkDominationData6 { /* 0x00 */ s32 unk_00; @@ -30,7 +28,7 @@ Process *lbl_1_bss_398C; omObjData *lbl_1_bss_3988; // data -ObjFuncs lbl_1_data_360[] = { fn_1_61A0, fn_1_6218, fn_1_62A0 }; +VoidFuncs lbl_1_data_360[] = { fn_1_61A0, fn_1_6218, fn_1_62A0 }; void fn_1_5C5C(Process *arg0, s16 arg1) { diff --git a/src/REL/m407dll/whomp.c b/src/REL/m407dll/whomp.c index 08605efb..43275f60 100644 --- a/src/REL/m407dll/whomp.c +++ b/src/REL/m407dll/whomp.c @@ -5,14 +5,12 @@ #include "game/object.h" #include "game/process.h" -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) +#include "REL/m407dll.h" #define MAX_WHOMPS_PLAYER 160 #define MAX_WHOMPS_ALL_PLAYERS MAX_WHOMPS_PLAYER *ARRAY_COUNT(GWPlayer) #define MAX_WHOMPS (MAX_WHOMPS_PLAYER + 1) * ARRAY_COUNT(GWPlayer) -typedef void (*ObjFuncs)(omObjData *); - typedef struct unkDominationData7 { /* 0x00 */ u32 unk_00; /* 0x04 */ s32 unk_04;