Introduce a bunch of small new headers (#1649)

* regs.h

* gfxalloc.h

* z64inventory.h

* gfx.h

* graph.h

* z64olib.h

* z64elf_message.h

* fix missing include

* Include z64inventory.h on z64save.h

* fix bss

* Move PosRot to z64math.h

* So dumb

* Update src/overlays/actors/ovl_En_Kusa/z_en_kusa.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* review

* Remove graph.h

* bss

---------

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
Anghelo Carvajal
2024-07-28 16:53:28 -04:00
committed by GitHub
parent 43cac34566
commit cd087d8511
43 changed files with 246 additions and 122 deletions
+1
View File
@@ -15,6 +15,7 @@
#include "color.h"
#include "macros.h"
#include "gfx.h"
#include "gfxalloc.h"
#include "slowly.h"
#include "stack.h"
#include "stackcheck.h"
+3
View File
@@ -1,6 +1,9 @@
#include "global.h"
#include "string.h"
#include "z64olib.h"
CutsceneCamera* sCurCsCamera;
typedef s16 (*CsCamInterpolateCallback)(Vec3f*, f32*, s16*, CsCmdCamPoint*, CsCmdCamMisc*, CutsceneCameraInterp*);
+2
View File
@@ -11,6 +11,8 @@
*/
#include "flg_set.h"
#include "gfxalloc.h"
#include "global.h"
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
+8 -1
View File
@@ -1,14 +1,21 @@
#include "z64game.h"
#include "global.h"
#include "audiomgr.h"
#include "debug.h"
#include "gfx.h"
#include "gfxalloc.h"
#include "idle.h"
#include "regs.h"
#include "sys_cfb.h"
#include "libc64/malloc.h"
#include "z64debug_text.h"
#include "z64pause_menu.h"
#include "z64rumble.h"
#include "z64speed_meter.h"
#include "z64vimode.h"
#include "z64vis.h"
#include "debug.h"
s32 gFramerateDivisor = 1;
f32 gFramerateDivisorF = 1.0f;
+3 -1
View File
@@ -1,4 +1,6 @@
#include "global.h"
#include "gfxalloc.h"
#include "alignment.h"
Gfx* Gfx_Open(Gfx* gfx) {
return &gfx[1];
+9 -6
View File
@@ -1,14 +1,17 @@
#include "z64.h"
#include "regs.h"
#include "fault.h"
#include "ultra64.h"
#include "scheduler.h"
// Variables are put before most headers as a hacky way to bypass bss reordering
FaultAddrConvClient sGraphFaultAddrConvClient;
FaultClient sGraphFaultClient;
GfxMasterList* gGfxMasterDL;
struct FaultAddrConvClient sGraphFaultAddrConvClient;
struct FaultClient sGraphFaultClient;
struct GfxMasterList* gGfxMasterDL;
CfbInfo sGraphCfbInfos[3];
OSTime sGraphPrevUpdateEndTime;
#include "regs.h"
#include "fault.h"
#include "macros.h"
#include "buffers.h"
#include "idle.h"
+6 -3
View File
@@ -1,6 +1,6 @@
#include "prevent_bss_reordering2.h" // bumps the bss index by 65
// clang-format off
// Partial structs taken from "prevent_bss_reordering.h", bumps the bss index by 56
// Partial structs taken from "prevent_bss_reordering.h", bumps the bss index by 59
struct Dummy200 { int x; };
struct Dummy201 { int x; };
struct Dummy202 { int x; };
@@ -29,12 +29,15 @@ struct Dummy224 { int x; };
struct Dummy225 { int x; };
struct Dummy226 { int x; };
struct Dummy227 { int x; };
struct Dummy228 { int x; };
typedef int Dummy229;
// clang-format on
// Headers are currently valued at 63 mod 256 (./tools/calc_bss.sh <headers>)
// Headers are currently valued at 60 mod 256 (./tools/calc_bss.sh <headers>)
#include "z64math.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "PR/gu.h"
// The bss index at this point should be 184
+5
View File
@@ -43,12 +43,17 @@
*
*/
#include "z64camera.h"
#include "global.h"
#include "string.h"
#include "z64malloc.h"
#include "z64olib.h"
#include "z64quake.h"
#include "z64shrink_window.h"
#include "z64view.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
void func_800DDFE0(Camera* camera);
+6 -1
View File
@@ -1,5 +1,10 @@
#include "z64debug_text.h"
#include "global.h"
#include "color.h"
#include "gfx.h"
#include "gfxalloc.h"
#include "gfxprint.h"
#include "macros.h"
typedef struct {
/* 0x0 */ u8 colorIndex;
+5
View File
@@ -7,7 +7,12 @@
* which hint to give based on a script.
* That system has been replaced with a single function that hardcodes the checks.
*/
#include "z64elf_message.h"
#include "global.h"
#include "z64save.h"
#include "z64scene.h"
/**
* Gets the relevant text ID for Tatl hints in first cycle.
+6 -2
View File
@@ -4,10 +4,14 @@
* Manages all cutscenes except for manual
*/
#include "global.h"
#include "z64shrink_window.h"
#include "z64cutscene.h"
#include "string.h"
#include "global.h"
#include "z64olib.h"
#include "z64shrink_window.h"
CutsceneEntry sGlobalCutsceneList[] = {
// CS_ID_GLOBAL_78
{ -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255,
+10
View File
@@ -1,4 +1,14 @@
#include "z64inventory.h"
#include "global.h"
#include "regs.h"
#include "z64item.h"
#include "z64interface.h"
#include "z64player.h"
#include "z64save.h"
#include "z64scene.h"
#include "interface/parameter_static/parameter_static.h"
#include "archives/icon_item_static/icon_item_static_yar.h"
#include "archives/icon_item_24_static/icon_item_24_static_yar.h"
+1
View File
@@ -61,6 +61,7 @@ Gfx* sSkyboxStarsDList;
#include "z64environment.h"
#include "gfxalloc.h"
#include "global.h"
#include "string.h"
#include "sys_cfb.h"
+2
View File
@@ -2,10 +2,12 @@
#include "z64message.h"
#include "global.h"
#include "gfxalloc.h"
#include "message_data_static.h"
#include "padmgr.h"
#include "sys_cmpdma.h"
#include "segment_symbols.h"
#include "z64actor.h"
#include "z64horse.h"
#include "z64shrink_window.h"
+4 -1
View File
@@ -1,4 +1,7 @@
#include "global.h"
#include "z64olib.h"
#include "macros.h"
#include "z64camera.h"
/**
* Calculates the distances between `a` and `b`
+1
View File
@@ -16,6 +16,7 @@ u8 sMotionBlurStatus;
#include "z64play.h"
#include "buffers.h"
#include "gfxalloc.h"
#include "idle.h"
#include "regs.h"
#include "sys_cfb.h"
+1
View File
@@ -3,6 +3,7 @@
#include "string.h"
#include "global.h"
#include "z64olib.h"
#include "z64view.h"
typedef struct {
+6
View File
@@ -1,6 +1,12 @@
#include "gfx.h"
#include "global.h"
#include "gfxalloc.h"
#include "regs.h"
#include "sys_cfb.h"
#include "z64pause_menu.h"
Gfx gSetupDLs[SETUPDL_MAX][6] = {
{
/* SETUPDL_0 */
+4 -1
View File
@@ -1,5 +1,8 @@
#include "global.h"
#include "z64snap.h"
#include "global.h"
#include "z64olib.h"
#include "overlays/actors/ovl_En_Kakasi/z_en_kakasi.h"
#define PICTO_SEEN_IN_SCENE 1
+3 -1
View File
@@ -10,8 +10,10 @@
* VisFbuf_Draw() for how to do this.
*/
#include "global.h"
#include "z64visfbuf.h"
#include "gfxalloc.h"
#include "global.h"
#include "sys_cfb.h"
#include "sys_ucode.h"
+3
View File
@@ -7,7 +7,10 @@
* color palette that converts each color into the desaturated equivalent. More precise details can be found in inline
* comments.
*/
#include "z64vis.h"
#include "gfxalloc.h"
#include "global.h"
#include "libc64/malloc.h"