From a039aeffb7ba72911da093ae77e6a583939e9afc Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sat, 7 Sep 2024 23:23:25 +0200 Subject: [PATCH] [headers 5] Misc small headers untangling (#2147) * Misc small headers untangling * mv gSaveContext to where it is in MM in the header * newline police * move rand functions back to functions.h --- include/color.h | 2 ++ include/functions.h | 11 ----------- include/seqcmd.h | 2 ++ include/sequence.h | 16 ++++++++++++++++ include/variables.h | 6 ------ include/z64environment.h | 5 +++++ include/z64play.h | 11 ++++++----- include/z64save.h | 1 + src/overlays/actors/ovl_En_Kanban/z_en_kanban.c | 1 + src/overlays/actors/ovl_En_Kanban/z_en_kanban.h | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 1 + 11 files changed, 35 insertions(+), 23 deletions(-) diff --git a/include/color.h b/include/color.h index 0d6eff3233..816d38349d 100644 --- a/include/color.h +++ b/include/color.h @@ -1,6 +1,8 @@ #ifndef COLOR_H #define COLOR_H +#include "ultra64/ultratypes.h" + typedef struct Color_RGB8 { u8 r, g, b; } Color_RGB8; diff --git a/include/functions.h b/include/functions.h index ee7a203a62..6608ce1814 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1405,17 +1405,6 @@ void Audio_InitSound(void); void func_800F7170(void); void func_800F71BC(s32 arg0); -void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration); -void Audio_StopSequence(u8 seqPlayerIndex, u16 fadeOutDuration); -void Audio_QueueSeqCmd(u32 cmd); -void Audio_ProcessSeqCmds(void); -u16 Audio_GetActiveSeqId(u8 seqPlayerIndex); -s32 Audio_IsSeqCmdNotQueued(u32 cmdVal, u32 cmdMask); -void Audio_SetVolumeScale(u8 seqPlayerIndex, u8 scaleIndex, u8 targetVol, u8 volFadeTimer); -void Audio_UpdateActiveSequences(void); -u8 func_800FAD34(void); -void Audio_ResetActiveSequences(void); -void Audio_ResetActiveSequencesAndVolume(void); void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a); void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y); void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y); diff --git a/include/seqcmd.h b/include/seqcmd.h index b351346fee..5acce7c493 100644 --- a/include/seqcmd.h +++ b/include/seqcmd.h @@ -1,6 +1,8 @@ #ifndef SEQCMD_H #define SEQCMD_H +#include "sequence.h" + // ==== Primary commands ==== #define SEQCMD_OP_MASK 0xF0000000 diff --git a/include/sequence.h b/include/sequence.h index 673242a800..e994ef3574 100644 --- a/include/sequence.h +++ b/include/sequence.h @@ -1,6 +1,8 @@ #ifndef SEQUENCE_H #define SEQUENCE_H +#include "ultra64.h" + typedef enum SeqId { /* 0x00 */ NA_BGM_GENERAL_SFX, // General Sound Effects /* 0x01 */ NA_BGM_NATURE_AMBIENCE, // Environmental nature background sounds @@ -323,4 +325,18 @@ typedef enum NatureAmimalId { #define NATURE_IO_ENTRIES_END 0xFF +// functions in sequence.c + +void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration); +void Audio_StopSequence(u8 seqPlayerIndex, u16 fadeOutDuration); +void Audio_QueueSeqCmd(u32 cmd); +void Audio_ProcessSeqCmds(void); +u16 Audio_GetActiveSeqId(u8 seqPlayerIndex); +s32 Audio_IsSeqCmdNotQueued(u32 cmdVal, u32 cmdMask); +void Audio_SetVolumeScale(u8 seqPlayerIndex, u8 scaleIndex, u8 targetVol, u8 volFadeTimer); +void Audio_UpdateActiveSequences(void); +u8 func_800FAD34(void); +void Audio_ResetActiveSequences(void); +void Audio_ResetActiveSequencesAndVolume(void); + #endif diff --git a/include/variables.h b/include/variables.h index c0bf4acb5b..a242ec05c2 100644 --- a/include/variables.h +++ b/include/variables.h @@ -60,10 +60,6 @@ extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_d extern s32 gMaxActorId; // original name: "MaxProfile" extern s32 gDebugCamEnabled; extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX]; -extern u8 gWeatherMode; -extern u8 gLightConfigAfterUnderwater; -extern u8 gInterruptSongOfStorms; -extern u16 gTimeSpeed; extern s32 gZeldaArenaLogSeverity; extern MapData gMapDataTable; extern s16 gSpoilingItems[3]; @@ -170,8 +166,6 @@ extern u8 gSequenceFontTable[]; extern u8 gSequenceTable[]; extern AudioTable gSampleBankTable; -extern SaveContext gSaveContext; - extern u8 gUseCutsceneCam; extern u16 D_8015FCCC; extern char D_8015FCD0[20]; diff --git a/include/z64environment.h b/include/z64environment.h index ad08ff5d0e..79d34bbff5 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -233,6 +233,11 @@ typedef struct EnvironmentContext { extern u8 gSkyboxIsChanging; extern TimeBasedSkyboxEntry gTimeBasedSkyboxConfigs[][9]; +extern u8 gWeatherMode; +extern u8 gLightConfigAfterUnderwater; +extern u8 gInterruptSongOfStorms; +extern u16 gTimeSpeed; + void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, struct SkyboxContext* skyboxCtx); void Environment_DrawSkyboxFilters(struct PlayState* play); diff --git a/include/z64play.h b/include/z64play.h index 432ecc2b19..562ad756d4 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -26,6 +26,7 @@ #include "z64view.h" union Color_RGBA8_u32; +struct Player; struct QuestHintCmd; struct VisMono; @@ -64,13 +65,13 @@ typedef struct PlayState { /* 0x117A4 */ ObjectContext objectCtx; /* 0x11CBC */ RoomContext roomCtx; /* 0x11D34 */ TransitionActorList transitionActors; - /* 0x11D3C */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); - /* 0x11D40 */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input); + /* 0x11D3C */ void (*playerInit)(struct Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); + /* 0x11D40 */ void (*playerUpdate)(struct Player* player, struct PlayState* play, Input* input); /* 0x11D44 */ int (*isPlayerDroppingFish)(struct PlayState* play); /* 0x11D48 */ s32 (*startPlayerFishing)(struct PlayState* play); - /* 0x11D4C */ s32 (*grabPlayer)(struct PlayState* play, Player* player); + /* 0x11D4C */ s32 (*grabPlayer)(struct PlayState* play, struct Player* player); /* 0x11D50 */ s32 (*tryPlayerCsAction)(struct PlayState* play, Actor* actor, s32 csAction); - /* 0x11D54 */ void (*func_11D54)(Player* player, struct PlayState* play); + /* 0x11D54 */ void (*func_11D54)(struct Player* player, struct PlayState* play); /* 0x11D58 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage); /* 0x11D5C */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); /* 0x11D60 */ MtxF viewProjectionMtxF; @@ -139,7 +140,7 @@ s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov); s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId); -s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s16 setting); +s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, struct Player* player, s16 setting); s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting); void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration); void Play_SaveSceneFlags(PlayState* this); diff --git a/include/z64save.h b/include/z64save.h index 12491072ce..33066fdd12 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -891,5 +891,6 @@ typedef enum EventInfHorsesState { #define EVENTINF_30 0x30 +extern SaveContext gSaveContext; #endif diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index f9d140c3ce..a767d19e89 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -5,6 +5,7 @@ */ #include "z_en_kanban.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_kanban/object_kanban.h" #include "terminal.h" diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 15e8781750..36efa211df 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -2,7 +2,7 @@ #define Z_EN_KANBAN_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct EnKanban; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index ecef2cf48d..f6e0f2875a 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -5,6 +5,7 @@ */ #include "z_fishing.h" +#include "global.h" #include "overlays/actors/ovl_En_Kanban/z_en_kanban.h" #include "assets/objects/object_fish/object_fish.h"