Reduce overlay dependencies on global.h (8) (#2478)

* move variables into z64environment.h

* z_room.h

* z64sram.h, z64ss_sram.h, z64font.h, kanread.h

* z64lifemeter.h, z64debug.h, debug_arena.h

* buffers.h

* remove z_bgcheck global

* gamealloc.h

* suggestions

* .bdd
This commit is contained in:
mzxrules
2025-02-19 05:54:39 -05:00
committed by GitHub
parent 3d61fb85ef
commit 981af4b6af
72 changed files with 578 additions and 392 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
#include "ultra64.h"
#include "global.h"
#include "buffers.h"
#include "versions.h"
#include "global.h"
#define MK_ASYNC_MSG(retData, tableType, id, loadStatus) \
(((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (loadStatus))
#define ASYNC_TBLTYPE(v) ((u8)(v >> 16))
+4
View File
@@ -1,4 +1,8 @@
#include "buffers.h"
#include "z64audio.h"
#include "global.h"
#include "assets/audio/sequence_sizes.h"
#include "assets/audio/soundfont_sizes.h"
+7 -2
View File
@@ -1,10 +1,15 @@
#include "global.h"
#include "buffers.h"
#include "segment_symbols.h"
#include "stack.h"
#include "stackcheck.h"
#include "terminal.h"
#include "versions.h"
#include "z64thread.h"
#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ntsc-1.2:64"
#include "global.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.0:138 ntsc-1.1:138 ntsc-1.2:138 pal-1.0:136 pal-1.1:136"
OSThread sMainThread;
#if OOT_VERSION < PAL_1_0
+3 -1
View File
@@ -1,3 +1,5 @@
#include "z64.h"
#include "ultra64/ultratypes.h"
#include "alignment.h"
#include "buffers.h"
ALIGNED(16) u8 gAudioHeap[0x38000];
+4 -1
View File
@@ -1,4 +1,7 @@
#include "z64.h"
#include "alignment.h"
#include "buffers.h"
#include "gfx.h"
#include "ultra64.h"
ALIGNED(16) u64 gGfxSPTaskOutputBuffer[0x3000];
+4 -1
View File
@@ -1,3 +1,6 @@
#include "z64.h"
#include "alignment.h"
#include "buffers.h"
#include "macros.h"
#include "ultra64/ultratypes.h"
ALIGNED(64) u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH];
+2 -1
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "libu64/gfxprint.h"
#include "attributes.h"
#include "controller.h"
#include "debug_arena.h"
#include "letterbox.h"
#include "mempak.h"
#include "regs.h"
@@ -10,6 +10,7 @@
#include "z64camera.h"
#include "z64cutscene.h"
#include "z64cutscene_spline.h"
#include "z64debug.h"
#include "z64debug_display.h"
#include "z64olib.h"
#include "z64play.h"
+3 -1
View File
@@ -1,5 +1,7 @@
#include "global.h"
#include "libc64/os_malloc.h"
#include "debug_arena.h"
#include "macros.h"
#define LOG_SEVERITY_NOLOG 0
#define LOG_SEVERITY_ERROR 2
+20 -3
View File
@@ -1,12 +1,29 @@
#include "global.h"
#include "libu64/debug.h"
#include "libu64/gfxprint.h"
#include "audiomgr.h"
#include "buffers.h"
#include "controller.h"
#include "debug_arena.h"
#include "gfx.h"
#include "gfxalloc.h"
#include "fault.h"
#include "libc64/os_malloc.h"
#include "terminal.h"
#include "versions.h"
#include "line_numbers.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
#include "padmgr.h"
#include "regs.h"
#include "rumble.h"
#include "speed_meter.h"
#include "terminal.h"
#include "versions.h"
#include "z64debug.h"
#include "z64game.h"
#include "z64vis.h"
#include "macros.h"
#include "global.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
+5 -1
View File
@@ -1,4 +1,8 @@
#include "global.h"
#include "libc64/malloc.h"
#include "libu64/debug.h"
#include "gamealloc.h"
#include "macros.h"
void GameAlloc_Log(GameAlloc* this) {
GameAllocEntry* iter;
+1
View File
@@ -1,6 +1,7 @@
#include "libc64/malloc.h"
#include "libc64/sprintf.h"
#include "libu64/debug.h"
#include "buffers.h"
#include "gfx.h"
#include "fault.h"
#include "line_numbers.h"
+5 -2
View File
@@ -12,7 +12,7 @@ extern struct Scheduler gScheduler;
extern struct PadMgr gPadMgr;
extern struct IrqMgr gIrqMgr;
#include "global.h"
#include "debug_arena.h"
#include "fault.h"
#include "segmented_address.h"
#include "stack.h"
@@ -22,10 +22,13 @@ extern struct IrqMgr gIrqMgr;
#include "cic6105.h"
#include "n64dd.h"
#endif
#include "z64debug.h"
#include "z64thread.h"
#include "global.h"
#pragma increment_block_number "gc-eu:96 gc-eu-mq:96 gc-jp:96 gc-jp-ce:96 gc-jp-mq:96 gc-us:96 gc-us-mq:96 ique-cn:96" \
"ntsc-1.0:78 ntsc-1.1:78 ntsc-1.2:78 pal-1.0:76 pal-1.1:76"
"ntsc-1.0:79 ntsc-1.1:79 ntsc-1.2:79 pal-1.0:77 pal-1.1:77"
extern u8 _buffersSegmentEnd[];
+6 -1
View File
@@ -39,11 +39,16 @@
*
* @see irqmgr.c
*/
#include "global.h"
#include "libu64/debug.h"
#include "fault.h"
#include "irqmgr.h"
#include "regs.h"
#include "sched.h"
#include "versions.h"
#include "z64thread.h"
#include "global.h"
#define RSP_DONE_MSG 667
#define RDP_DONE_MSG 668
#define NOTIFY_MSG 670 // original name: ENTRY_MSG
+2 -1
View File
@@ -1,4 +1,5 @@
#include "z64.h"
#include "sys_math3d.h"
#include "z64play.h"
void Math3D_DrawSphere(PlayState* play, Sphere16* sph) {
}
+12 -3
View File
@@ -1,8 +1,17 @@
#include "global.h"
#include "terminal.h"
#include "libu64/debug.h"
#include "attributes.h"
#include "line_numbers.h"
#include "regs.h"
#include "segmented_address.h"
#include "sys_math3d.h"
#include "terminal.h"
#include "z_lib.h"
#include "z64bgcheck.h"
#include "z64play.h"
#include "z64player.h"
#include "z64skin_matrix.h"
#pragma increment_block_number "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64"
#pragma increment_block_number "ntsc-1.0:184 ntsc-1.1:184 ntsc-1.2:184"
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
+2 -1
View File
@@ -2,6 +2,7 @@
#include "quake.h"
#include "terminal.h"
#include "z64cutscene_spline.h"
#include "z64debug.h"
#include "z64olib.h"
#include "z64save.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
@@ -3641,7 +3642,7 @@ s32 Camera_KeepOn3(Camera* camera) {
}
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:117 ntsc-1.1:117 ntsc-1.2:117 pal-1.0:115 pal-1.1:115"
"ique-cn:128 ntsc-1.0:118 ntsc-1.1:118 ntsc-1.2:118 pal-1.0:116 pal-1.1:116"
s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;
+1 -1
View File
@@ -15,7 +15,7 @@
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#include "z_lib.h"
#pragma increment_block_number "ique-cn:0 ntsc-1.0:248 ntsc-1.1:248 ntsc-1.2:248 pal-1.0:248 pal-1.1:248"
#pragma increment_block_number "ique-cn:0 ntsc-1.0:232 ntsc-1.1:232 ntsc-1.2:232 pal-1.0:232 pal-1.1:232"
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
+3 -1
View File
@@ -1,7 +1,9 @@
#include "global.h"
#include "map.h"
#include "regs.h"
#include "segment_symbols.h"
#include "versions.h"
#include "z64lifemeter.h"
#include "z64interface.h"
#include "z64ocarina.h"
#include "z64play.h"
#include "z64save.h"
+1
View File
@@ -8,6 +8,7 @@
#include "regs.h"
#include "rumble.h"
#include "ultra64.h"
#include "z64debug.h"
#include "macros.h"
+7 -1
View File
@@ -1,6 +1,12 @@
#include "global.h"
#include "kanread.h"
#include "message_data_static.h"
#include "segment_symbols.h"
#include "versions.h"
#include "z64dma.h"
#include "z64font.h"
#include "z64message.h"
#include "macros.h"
/**
* Loads a texture from kanji for the requested `character` into the character texture buffer
+21 -4
View File
@@ -1,15 +1,32 @@
#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
"ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:64 pal-1.1:64"
#include "global.h"
#include "libc64/qrand.h"
#include "libu64/gfxprint.h"
#include "buffers.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "gfxalloc.h"
#include "ultra64.h"
#include "regs.h"
#include "rumble.h"
#include "segment_symbols.h"
#include "segmented_address.h"
#include "seqcmd.h"
#include "sequence.h"
#include "sfx.h"
#include "sys_math.h"
#include "sys_math3d.h"
#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
#include "z_lib.h"
#include "z64audio.h"
#include "z64cutscene.h"
#include "z64frame_advance.h"
#include "z64environment.h"
#include "z64play.h"
#include "z64player.h"
#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
@@ -218,8 +235,8 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:192 pal-1.1:192"
LightNode* sNGameOverLightNode;
LightInfo sNGameOverLightInfo;
+1 -2
View File
@@ -3,12 +3,11 @@
#include "sfx.h"
#include "sys_matrix.h"
#include "z_lib.h"
#include "z64lifemeter.h"
#include "z64play.h"
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/textures/parameter_static/parameter_static.h"
static s16 sHeartsPrimColors[3][3] = {
+7 -1
View File
@@ -1,4 +1,10 @@
#include "global.h"
#include "buffers.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "sys_matrix.h"
#include "z64light.h"
#include "z64play.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define LIGHTS_BUFFER_SIZE 32
+1
View File
@@ -1,4 +1,5 @@
#include "libu64/debug.h"
#include "regs.h"
#include "romfile.h"
#include "segment_symbols.h"
#include "terminal.h"
+1
View File
@@ -13,6 +13,7 @@
#include "terminal.h"
#include "versions.h"
#include "z64audio.h"
#include "z64lifemeter.h"
#include "z64horse.h"
#include "z64ocarina.h"
#include "z64play.h"
+2 -1
View File
@@ -1,4 +1,5 @@
#include "libu64/debug.h"
#include "buffers.h"
#include "controller.h"
#include "fault.h"
#include "gfx.h"
@@ -33,7 +34,7 @@
#include "global.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:192 ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64"
"ique-cn:192 ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96"
TransitionTile gTransitionTile;
s32 gTransitionTileState;
+8
View File
@@ -1,3 +1,11 @@
#include "buffers.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "gfxalloc.h"
#include "letterbox.h"
#include "regs.h"
#include "z64play.h"
#include "global.h"
Gfx sSetupDL[SETUPDL_MAX][6] = {
+2 -2
View File
@@ -1,5 +1,6 @@
#include "libu64/debug.h"
#include "ultra64/gs2dex.h"
#include "buffers.h"
#include "fault.h"
#include "gfx.h"
#include "gfx_setupdl.h"
@@ -18,11 +19,10 @@
#include "z64audio.h"
#include "z64play.h"
#include "z64player.h"
#include "z64room.h"
#include "z64save.h"
#include "z64skin_matrix.h"
#include "global.h"
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
// unused
-2
View File
@@ -16,8 +16,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h"
#include "assets/scenes/indoors/souko/souko_scene.h"
+1
View File
@@ -2,6 +2,7 @@
#include "terminal.h"
#include "versions.h"
#include "z64save.h"
#include "z64ss_sram.h"
#define SLOT_SIZE (sizeof(SaveContext) + 0x28)
#define CHECKSUM_SIZE (sizeof(Save) / 2)
+2
View File
@@ -1,4 +1,6 @@
#include "ultra64.h"
#include "macros.h"
#include "global.h"
typedef struct SsSramContext {
-2
View File
@@ -2,8 +2,6 @@
#include "libu64/debug.h"
#include "libu64/mtxuty-cvt.h"
#include "macros.h"
void MtxConv_F2L(Mtx* m1, MtxF* m2) {
s32 i;
s32 j;
@@ -9,8 +9,6 @@
#include "ichain.h"
#include "z64play.h"
#include "z64.h"
#include "assets/objects/object_hakach_objects/object_hakach_objects.h"
#include "assets/objects/object_haka_objects/object_haka_objects.h"
@@ -25,8 +25,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h"
#include "assets/objects/object_ganon/object_ganon.h"
#include "assets/objects/object_ganon_anime1/object_ganon_anime1.h"
@@ -28,6 +28,9 @@
#include "assets/objects/object_geff/object_geff.h"
#include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -23,8 +23,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_gnd/object_gnd.h"
#include "assets/objects/object_goma/object_goma.h"
@@ -24,8 +24,6 @@
#include "z64play.h"
#include "z64player.h"
#include "global.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_fhg/object_fhg.h"
@@ -9,8 +9,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
/*
-2
View File
@@ -19,8 +19,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/objects/object_fa/object_fa.h"
#include "assets/objects/object_os_anime/object_os_anime.h"
#include "assets/objects/object_km1/object_km1.h"
+1 -2
View File
@@ -20,8 +20,7 @@
#include "z64cutscene_flags.h"
#include "z64play.h"
#include "z64save.h"
#include "global.h"
#include "z64ss_sram.h"
#include "assets/objects/object_mag/object_mag.h"
-2
View File
@@ -20,8 +20,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/objects/object_md/object_md.h"
#define FLAGS \
@@ -158,8 +158,8 @@ static EnPoFieldInfo sPoFieldInfo[2] = {
static Vec3f D_80AD714C = { 0.0f, 1400.0f, 0.0f };
#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.2:128 pal-1.0:128" \
"pal-1.1:128"
#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.0:128 ntsc-1.1:128" \
"ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static Vec3s sSpawnPositions[10];
static u8 sSpawnSwitchFlags[10];
@@ -24,8 +24,6 @@
#include "z64save.h"
#include "z64skin.h"
#include "global.h"
#include "assets/objects/object_zl4/object_zl4.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_horse_zelda/object_horse_zelda.h"
+1 -1
View File
@@ -37,7 +37,7 @@
#endif
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.0:121 ntsc-1.1:121 ntsc-1.2:121 pal-1.0:121 pal-1.1:121"
"ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -20,8 +20,6 @@
#include "z64player.h"
#include "z64save.h"
#include "global.h"
#include "assets/objects/object_demo_kekkai/object_demo_kekkai.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_spot02_objects/object_spot02_objects.h"
@@ -40,14 +40,14 @@
#include "z_lib.h"
#include "zelda_arena.h"
#include "z64audio.h"
#include "z64debug.h"
#include "z64effect.h"
#include "z64lifemeter.h"
#include "z64ocarina.h"
#include "z64play.h"
#include "z64save.h"
#include "z64skin_matrix.h"
#include "global.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_link_child/object_link_child.h"
@@ -359,14 +359,14 @@ void Player_Action_CsAction(Player* this, PlayState* play);
// .bss part 1
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
"ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
static s32 D_80858AA0;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
"ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
static s32 sSavedCurrentMask;
@@ -20,6 +20,7 @@
#include "z64save.h"
#include "z64skybox.h"
#include "z64sram.h"
#include "z64ss_sram.h"
#include "z64view.h"
#include "global.h"
@@ -6,6 +6,7 @@
#include "global.h"
#include "z64save.h"
#include "z64sram.h"
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
@@ -13,6 +13,7 @@
#include "sequence.h"
#include "terminal.h"
#include "z64save.h"
#include "z64sram.h"
#include "global.h"
@@ -1,6 +1,7 @@
#include "z_kaleido_scope.h"
#include "sys_ucode.h"
#include "versions.h"
#include "z64play.h"
#include "z64save.h"
#include "assets/textures/icon_item_24_static/icon_item_24_static.h"