Reduce overlay dependencies on global.h (7) (#2472)

* z64env_flags, z64quest_hint_commands

* z64cutscene_spline, z64save.h moved from z64.h

* bss

* pr suggestion

* bss

* suggestions
This commit is contained in:
mzxrules
2025-02-16 15:33:55 -05:00
committed by GitHub
parent 137e178790
commit 652478c338
294 changed files with 688 additions and 197 deletions
-9
View File
@@ -47,13 +47,6 @@ void Debug_DrawText(GraphicsContext* gfxCtx);
void* MemCpy(void* dest, const void* src, s32 len);
u16 QuestHint_GetSariaTextId(PlayState* play);
u16 QuestHint_GetNaviTextId(PlayState* play);
void CutsceneFlags_UnsetAll(PlayState* play);
void CutsceneFlags_Set(PlayState* play, s16 flag);
void CutsceneFlags_Unset(PlayState* play, s16 flag);
s32 CutsceneFlags_Get(PlayState* play, s16 flag);
s32 Kanji_OffsetFromShiftJIS(s32 character);
#if PLATFORM_IQUE
void Font_LoadCharCHN(Font* font, u16 character, u16 codePointIndex);
@@ -160,8 +153,6 @@ void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr);
void DebugCamera_Enable(DebugCam* debugCam, Camera* cam);
void DebugCamera_Update(DebugCam* debugCam, Camera* cam);
void DebugCamera_Reset(Camera* cam, DebugCam* debugCam);
void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRender* this);
+2
View File
@@ -54,6 +54,8 @@ typedef struct GraphicsContext {
/* 0x02FC */ char unk_2FC[0x04];
} GraphicsContext; // size = 0x300
extern Gfx gEmptyDL[];
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
+1
View File
@@ -1,6 +1,7 @@
#ifndef REGS_H
#define REGS_H
#include "ultra64.h"
#include "versions.h"
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
+1 -1
View File
@@ -1,8 +1,8 @@
#ifndef SEGMENT_SYMBOLS_H
#define SEGMENT_SYMBOLS_H
#include "ultra64/ultratypes.h"
#include "versions.h"
#include "z64.h"
#define DECLARE_SEGMENT(name) \
extern u8 _##name##SegmentStart[]; \
-12
View File
@@ -5,8 +5,6 @@
#include "libc64/os_malloc.h"
#include "segment_symbols.h"
extern Mtx D_01000000;
extern void* osRomBase;
extern s32 osTvType;
extern u32 osRomType;
@@ -77,8 +75,6 @@ extern MapData gMapDataTable;
extern s16 gSpoilingItems[3];
extern s16 gSpoilingItemReverts[3];
extern Gfx gEmptyDL[];
extern u16 gSramSlotOffsets[];
// 4 16-colors palettes
extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut"
@@ -153,14 +149,6 @@ extern u8 gSequenceFontTable[];
extern u8 gSequenceTable[];
extern AudioTable gSampleBankTable;
extern u8 gUseCutsceneCam;
extern u16 D_8015FCCC;
extern char D_8015FCD0[20];
extern u8 D_8015FCE4;
extern u16 gCamAtSplinePointsAppliedFrame;
extern u16 gCamEyePointAppliedFrame;
extern u16 gCamAtPointAppliedFrame;
extern LightningStrike gLightningStrike;
// TODO: These variables are here for BSS ordering but ideally they should not
// be extern. This could be fixed by putting more stuff (e.g. struct definitions)
-36
View File
@@ -7,55 +7,28 @@
#include "audiomgr.h"
#include "controller.h"
#include "versions.h"
#include "z64save.h"
#include "z64light.h"
#include "z64bgcheck.h"
#include "z64actor.h"
#include "z64player.h"
#include "z64audio.h"
#include "z64object.h"
#include "z64ocarina.h"
#include "z64camera.h"
#include "z64environment.h"
#include "z64cutscene.h"
#include "z64collision_check.h"
#include "z64curve.h"
#include "z64scene.h"
#include "z64effect.h"
#include "z64game_over.h"
#include "z64inventory.h"
#include "z64item.h"
#include "z64animation.h"
#include "z64animation_legacy.h"
#include "z64dma.h"
#include "letterbox.h"
#include "z64math.h"
#include "z64map_mark.h"
#include "z64message.h"
#include "one_point_cutscene.h"
#include "z64pause.h"
#include "z64play.h"
#include "z64skin.h"
#include "z64skin_matrix.h"
#include "z64game.h"
#include "z64transition.h"
#include "z64transition_instances.h"
#include "z64interface.h"
#include "z64sfx_source.h"
#include "z64skybox.h"
#include "z64sram.h"
#include "z64view.h"
#include "z64vis.h"
#include "zelda_arena.h"
#include "alignment.h"
#include "audiothread_cmd.h"
#include "seqcmd.h"
#include "sequence.h"
#include "sfx.h"
#include "color.h"
#include "libu64/gfxprint.h"
#include "z_lib.h"
#include "ichain.h"
#include "regs.h"
#include "irqmgr.h"
#include "padmgr.h"
@@ -69,10 +42,8 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "gfxalloc.h"
#include "jpeg.h"
#include "prerender.h"
#include "rand.h"
#include "libc64/qrand.h"
#include "sys_math.h"
#include "sys_math3d.h"
#include "libc64/math64.h"
@@ -148,13 +119,6 @@ typedef struct SampleState {
/* 0x00A8 */ View view;
} SampleState; // size = 0x1D0
typedef struct QuestHintCmd {
/* 0x00 */ u8 byte0;
/* 0x01 */ u8 byte1;
/* 0x02 */ u8 byte2;
/* 0x03 */ u8 byte3;
} QuestHintCmd; // size = 0x4
typedef enum PauseBgPreRenderState {
/* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing.
/* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background.
-1
View File
@@ -4,7 +4,6 @@
#include "ultra64.h"
#include "z64cutscene.h"
#include "z64math.h"
#include "z64save.h"
struct CollisionContext;
struct View;
+8
View File
@@ -515,6 +515,14 @@ typedef struct CutsceneContext {
/* 0x28 */ CsCmdActorCue* actorCues[10]; // "npcdemopnt"
} CutsceneContext; // size = 0x50
extern u8 gUseCutsceneCam;
extern u16 D_8015FCCC;
extern char D_8015FCD0[20];
extern u8 D_8015FCE4;
extern u16 gCamAtSplinePointsAppliedFrame;
extern u16 gCamEyePointAppliedFrame;
extern u16 gCamAtPointAppliedFrame;
void Cutscene_InitContext(struct PlayState* play, CutsceneContext* csCtx);
void Cutscene_StartManual(struct PlayState* play, CutsceneContext* csCtx);
void Cutscene_StopManual(struct PlayState* play, CutsceneContext* csCtx);
+13
View File
@@ -0,0 +1,13 @@
#ifndef Z64CUTSCENE_FLAGS_H
#define Z64CUTSCENE_FLAGS_H
#include "ultra64.h"
struct PlayState;
void CutsceneFlags_UnsetAll(struct PlayState* play);
void CutsceneFlags_Set(struct PlayState* play, s16 flag);
void CutsceneFlags_Unset(struct PlayState* play, s16 flag);
s32 CutsceneFlags_Get(struct PlayState* play, s16 flag);
#endif
+12
View File
@@ -0,0 +1,12 @@
#ifndef Z64CUTSCENE_SPLINE_H
#define Z64CUTSCENE_SPLINE_H
#include "ultra64.h"
#include "z64math.h"
union CutsceneCameraPoint;
void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, union CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
#endif
+3 -1
View File
@@ -4,7 +4,6 @@
#include "ultra64.h"
#include "prerender.h"
#include "z64actor.h"
#include "z64bgcheck.h"
#include "z64camera.h"
@@ -26,6 +25,7 @@
#include "z64view.h"
union Color_RGBA8_u32;
struct Path;
struct Player;
struct QuestHintCmd;
struct VisMono;
@@ -115,6 +115,8 @@ typedef struct PlayState {
/* 0x12430 */ char unk_12430[0xE8];
} PlayState; // size = 0x12518
extern Mtx D_01000000; // billboardMtx
#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId])
#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].head)
+11
View File
@@ -0,0 +1,11 @@
#ifndef Z64QUEST_HINT_H
#define Z64QUEST_HINT_H
#include "ultra64.h"
struct PlayState;
u16 QuestHint_GetSariaTextId(struct PlayState* play);
u16 QuestHint_GetNaviTextId(struct PlayState* play);
#endif
+7
View File
@@ -3,6 +3,13 @@
#include "ultra64.h"
typedef struct QuestHintCmd {
/* 0x00 */ u8 byte0;
/* 0x01 */ u8 byte1;
/* 0x02 */ u8 byte2;
/* 0x03 */ u8 byte3;
} QuestHintCmd; // size = 0x4
/*
* Hint Command Types
*/