From 25b2fa4bca1f1d2d155db2610191af1075e813b3 Mon Sep 17 00:00:00 2001 From: fig02 Date: Fri, 25 Apr 2025 21:12:35 -0400 Subject: [PATCH 1/4] macros.h 3/5: Split various macros (#2512) * split out various macros * fix * fix2 * fix dw * libc path * fix macro * does this fix bss * fix bss --- include/avoid_ub.h | 13 ++++ include/color.h | 2 + include/fault.h | 11 ++- include/gfx.h | 38 +++++++++ include/language_array.h | 12 +++ include/macros.h | 77 ------------------- include/sys_matrix.h | 3 + include/z64.h | 1 + include/z64animation.h | 1 + include/z64math.h | 28 ++++++- include/z64scene.h | 1 + include/z64view.h | 1 + src/code/fault_gc.c | 5 +- src/code/fault_gc_drawer.c | 2 + src/code/fault_n64.c | 3 +- src/code/main.c | 2 +- src/code/sys_cfb.c | 1 + src/code/z_camera.c | 3 +- src/code/z_fbdemo_circle.c | 1 + src/code/z_jpeg.c | 7 +- src/code/z_lights.c | 1 + src/code/z_message.c | 1 + src/code/z_parameter.c | 1 + src/code/z_play.c | 1 + src/code/z_scene.c | 1 + src/code/z_skelanime.c | 1 + src/code/z_view.c | 1 + src/code/z_vimode.c | 1 + src/n64dd/z_n64dd.c | 3 +- src/overlays/actors/ovl_En_Mag/z_en_mag.c | 1 + .../actors/ovl_player_actor/z_player.c | 1 + .../ovl_file_choose/z_file_choose.c | 1 + .../ovl_file_choose/z_file_nameset.c | 1 + .../misc/ovl_kaleido_scope/z_kaleido_map.c | 1 + .../misc/ovl_kaleido_scope/z_kaleido_scope.c | 1 + 35 files changed, 137 insertions(+), 92 deletions(-) create mode 100644 include/avoid_ub.h create mode 100644 include/language_array.h diff --git a/include/avoid_ub.h b/include/avoid_ub.h new file mode 100644 index 000000000..4706f50ec --- /dev/null +++ b/include/avoid_ub.h @@ -0,0 +1,13 @@ +#ifndef AVOID_UB_H +#define AVOID_UB_H + +/** + * This macro is used when the return type of a function is incorrect + */ +#ifndef AVOID_UB +#define BAD_RETURN(type) type +#else +#define BAD_RETURN(type) void +#endif + +#endif diff --git a/include/color.h b/include/color.h index 816d38349..73fa5d63a 100644 --- a/include/color.h +++ b/include/color.h @@ -33,4 +33,6 @@ typedef union Color_RGBA16 { u16 rgba; } Color_RGBA16; +#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) + #endif diff --git a/include/fault.h b/include/fault.h index 7418246f4..af895927d 100644 --- a/include/fault.h +++ b/include/fault.h @@ -1,9 +1,10 @@ #ifndef FAULT_H #define FAULT_H -#include "ultra64.h" -#include "attributes.h" +#include "libu64/debug.h" #include "libu64/pad.h" +#include "attributes.h" +#include "ultra64.h" #if !PLATFORM_N64 // These are the same as the 3-bit ansi color codes @@ -50,6 +51,12 @@ void Fault_Init(void); NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2); NORETURN void Fault_AddHungupAndCrash(const char* file, int line); +#if PLATFORM_N64 || DEBUG_FEATURES +#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line) +#else +#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line) +#endif + // Client Registration void Fault_AddClient(FaultClient* client, void* callback, void* arg0, void* arg1); diff --git a/include/gfx.h b/include/gfx.h index 290b63054..e53465596 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -7,6 +7,9 @@ #include "thga.h" #include "versions.h" +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 240 + // Texture memory size, 4 KiB #define TMEM_SIZE 0x1000 @@ -124,4 +127,39 @@ void Graph_ThreadEntry(void*); extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" +/** + * `x` vertex x + * `y` vertex y + * `z` vertex z + * `s` texture s coordinate + * `t` texture t coordinate + * `crnx` red component of color vertex, or x component of normal vertex + * `cgny` green component of color vertex, or y component of normal vertex + * `cbnz` blue component of color vertex, or z component of normal vertex + * `a` alpha + */ +#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } } + +#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } } + +#define gDPSetTileCustom(pkt, fmt, siz, uls, ult, lrs, lrt, pal, \ + cms, cmt, masks, maskt, shifts, shiftt) \ +_DW({ \ + gDPPipeSync(pkt); \ + gDPTileSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPTileSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls) << G_TEXTURE_IMAGE_FRAC, \ + (ult) << G_TEXTURE_IMAGE_FRAC, \ + (lrs) << G_TEXTURE_IMAGE_FRAC, \ + (lrt) << G_TEXTURE_IMAGE_FRAC); \ +}) + #endif diff --git a/include/language_array.h b/include/language_array.h new file mode 100644 index 000000000..b93dbd4e0 --- /dev/null +++ b/include/language_array.h @@ -0,0 +1,12 @@ +#ifndef LANGUAGE_ARRAY_H +#define LANGUAGE_ARRAY_H + +#include "versions.h" + +#if OOT_NTSC +#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng } +#else +#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { eng, ger, fra } +#endif + +#endif diff --git a/include/macros.h b/include/macros.h index d4fc7d9a9..7c964150e 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,87 +1,10 @@ #ifndef MACROS_H #define MACROS_H -#include "versions.h" - -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 240 - -#ifndef AVOID_UB -#define BAD_RETURN(type) type -#else -#define BAD_RETURN(type) void -#endif - #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) -#define ABS(x) ((x) >= 0 ? (x) : -(x)) -#define DECR(x) ((x) == 0 ? 0 : --(x)) -#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) -#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) -#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) - -#define SWAP(type, a, b) \ - { \ - type _temp = (a); \ - (a) = (b); \ - (b) = _temp; \ - } \ - (void)0 - -#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) - #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) -#if PLATFORM_N64 || DEBUG_FEATURES -#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line) -#else -#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line) -#endif - -#define MATRIX_FINALIZE_AND_LOAD(pkt, gfxCtx, file, line) \ - gSPMatrix(pkt, MATRIX_FINALIZE(gfxCtx, file, line), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW) - -#if OOT_NTSC -#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng } -#else -#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { eng, ger, fra } -#endif - -/** - * `x` vertex x - * `y` vertex y - * `z` vertex z - * `s` texture s coordinate - * `t` texture t coordinate - * `crnx` red component of color vertex, or x component of normal vertex - * `cgny` green component of color vertex, or y component of normal vertex - * `cbnz` blue component of color vertex, or z component of normal vertex - * `a` alpha - */ -#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } } - -#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } } - -#define gDPSetTileCustom(pkt, fmt, siz, uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ -_DW({ \ - gDPPipeSync(pkt); \ - gDPTileSync(pkt); \ - gDPSetTile(pkt, fmt, siz, \ - (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \ - G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, \ - shifts); \ - gDPTileSync(pkt); \ - gDPSetTile(pkt, fmt, siz, \ - (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, \ - G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \ - gDPSetTileSize(pkt, G_TX_RENDERTILE, \ - (uls) << G_TEXTURE_IMAGE_FRAC, \ - (ult) << G_TEXTURE_IMAGE_FRAC, \ - (lrs) << G_TEXTURE_IMAGE_FRAC, \ - (lrt) << G_TEXTURE_IMAGE_FRAC); \ -}) - #endif diff --git a/include/sys_matrix.h b/include/sys_matrix.h index 11d494c8c..2708af81e 100644 --- a/include/sys_matrix.h +++ b/include/sys_matrix.h @@ -64,6 +64,9 @@ Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx); #endif +#define MATRIX_FINALIZE_AND_LOAD(pkt, gfxCtx, file, line) \ + gSPMatrix(pkt, MATRIX_FINALIZE(gfxCtx, file, line), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW) + /* Vector operations */ void Matrix_MultVec3f(Vec3f* src, Vec3f* dest); diff --git a/include/z64.h b/include/z64.h index 2560c745d..8a259e70f 100644 --- a/include/z64.h +++ b/include/z64.h @@ -4,6 +4,7 @@ // TODO: This file still exists ONLY to provide neccesary headers to extracted assets. // After assets are modified to include the headers they need directly, delete this file. +#include "gfx.h" #include "sequence.h" #include "sys_matrix.h" #include "ultra64.h" diff --git a/include/z64animation.h b/include/z64animation.h index 17b42e1a0..9db7b260d 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -1,6 +1,7 @@ #ifndef Z64_ANIMATION_H #define Z64_ANIMATION_H +#include "avoid_ub.h" #include "ultra64.h" #include "z64dma.h" #include "z64math.h" diff --git a/include/z64math.h b/include/z64math.h index 95a494a69..187d95b25 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -1,11 +1,8 @@ #ifndef Z64MATH_H #define Z64MATH_H -#include "ultra64.h" #include "math.h" - -#define SQ(x) ((x)*(x)) -#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z) +#include "ultra64.h" typedef union FloatInt { f32 f; @@ -95,6 +92,27 @@ typedef VecSphGeo VecSph; // Pitch is 0 along the xz-plane (horizon) typedef VecSphGeo VecGeo; +/** + * Macros + */ + +// General number macros +#define SQ(x) ((x)*(x)) +#define ABS(x) ((x) >= 0 ? (x) : -(x)) +#define DECR(x) ((x) == 0 ? 0 : --(x)) +#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) +#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) +#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) + +#define SWAP(type, a, b) \ + { \ + type _temp = (a); \ + (a) = (b); \ + (b) = _temp; \ + } \ + (void)0 + +// LERP macros #define LERP(x, y, scale) (((y) - (x)) * (scale) + (x)) #define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x)) #define LERP16(x, y, scale) ((s16)(((y) - (x)) * (scale)) + (x)) @@ -110,6 +128,7 @@ typedef VecSphGeo VecGeo; (dst)->z = (v0)->z + (((v1)->z - (v0)->z) * t); \ } +// Floating point macros #define IS_ZERO(f) (fabsf(f) < 0.008f) // Casting a float to an integer, when the float value is larger than what the integer type can hold, @@ -145,6 +164,7 @@ typedef VecSphGeo VecGeo; #define CAM_BINANG_TO_DEG(binang) ((f32)(binang) * (360.0001525f / 65535.0f)) // Vector macros +#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z) #define SQXZ(vec) ((vec).x * (vec).x + (vec).z * (vec).z) #define DOTXZ(vec1, vec2) ((vec1).x * (vec2).x + (vec1).z * (vec2).z) #define SQXYZ(vec) ((vec).x * (vec).x + (vec).y * (vec).y + (vec).z * (vec).z) diff --git a/include/z64scene.h b/include/z64scene.h index eacd62ed8..7453f48ba 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -1,6 +1,7 @@ #ifndef Z64SCENE_H #define Z64SCENE_H +#include "avoid_ub.h" #include "macros.h" #include "ultra64.h" #include "z64bgcheck.h" diff --git a/include/z64view.h b/include/z64view.h index 3832eb5f6..b007129f9 100644 --- a/include/z64view.h +++ b/include/z64view.h @@ -1,6 +1,7 @@ #ifndef Z64VIEW_H #define Z64VIEW_H +#include "avoid_ub.h" #include "macros.h" #include "ultra64.h" #include "z64math.h" diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 815570a96..9965a6ec0 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -41,13 +41,14 @@ * DPad-Down disables sending fault pages over osSyncPrintf. */ -#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-eu-mq-dbg:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192" \ - "gc-us-mq:192 ique-cn:192" +#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160" \ + "gc-us-mq:160 ique-cn:160" #include "libc64/sleep.h" #include "libc64/sprintf.h" #include "alloca.h" #include "controller.h" +#include "gfx.h" #include "padmgr.h" #include "fault.h" #include "stack.h" diff --git a/src/code/fault_gc_drawer.c b/src/code/fault_gc_drawer.c index ab95a433a..a0e409df7 100644 --- a/src/code/fault_gc_drawer.c +++ b/src/code/fault_gc_drawer.c @@ -6,6 +6,8 @@ */ #include "fault.h" + +#include "gfx.h" #include "terminal.h" #include "global.h" diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index d83814b9b..c6c579676 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -3,6 +3,7 @@ #include "libc64/sprintf.h" #include "controller.h" #include "fault.h" +#include "gfx.h" #include "padmgr.h" #include "segmented_address.h" #include "stack.h" @@ -13,7 +14,7 @@ #include "global.h" -#pragma increment_block_number "ntsc-1.0:176 ntsc-1.1:176 ntsc-1.2:176 pal-1.0:176 pal-1.1:176" +#pragma increment_block_number "ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144" typedef struct FaultMgr { OSThread thread; diff --git a/src/code/main.c b/src/code/main.c index 43556b52b..6a5dae80e 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -45,7 +45,7 @@ extern struct IrqMgr gIrqMgr; #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:0 ntsc-1.0:35 ntsc-1.1:35 ntsc-1.2:35 pal-1.0:33 pal-1.1:33" + "ique-cn:0 ntsc-1.0:34 ntsc-1.1:34 ntsc-1.2:34 pal-1.0:32 pal-1.1:32" extern u8 _buffersSegmentEnd[]; diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 2e075daf3..8877c92ce 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -2,6 +2,7 @@ #include "libu64/debug.h" #include "attributes.h" +#include "gfx.h" #include "line_numbers.h" #include "printf.h" #include "translation.h" diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 3bd468d49..388093116 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -5,6 +5,7 @@ #include "attributes.h" #include "controller.h" #include "db_camera.h" +#include "gfx.h" #include "letterbox.h" #include "one_point_cutscene.h" #include "quake.h" @@ -3660,7 +3661,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:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + "ique-cn:128 ntsc-1.0:86 ntsc-1.1:86 ntsc-1.2:86 pal-1.0:86 pal-1.1:86" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 2ba1864fe..699526ce7 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,5 +1,6 @@ #include "transition_circle.h" +#include "color.h" #include "gfx.h" #include "sfx.h" diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 575cb282e..29a5404ed 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -1,11 +1,12 @@ -#include "global.h" -#include "ultra64.h" -#include "attributes.h" #include "jpeg.h" + +#include "attributes.h" +#include "gfx.h" #include "printf.h" #include "sys_ucode.h" #include "terminal.h" #include "translation.h" +#include "ultra64.h" #include "macros.h" diff --git a/src/code/z_lights.c b/src/code/z_lights.c index e9f533850..d0b003f77 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -1,3 +1,4 @@ +#include "avoid_ub.h" #include "buffers.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/code/z_message.c b/src/code/z_message.c index ab333a875..d4de077ed 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "gfxalloc.h" +#include "language_array.h" #include "memory_utils.h" #include "message_data_static.h" #if PLATFORM_N64 diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 5d0166b49..944612348 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -3,6 +3,7 @@ #include "flag_set.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "language_array.h" #include "main.h" #include "map.h" #include "printf.h" diff --git a/src/code/z_play.c b/src/code/z_play.c index 0ca29c698..60a20e0ed 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -2,6 +2,7 @@ #include "libc64/qrand.h" #include "libu64/debug.h" #include "buffers.h" +#include "color.h" #include "controller.h" #include "fault.h" #include "file_select_state.h" diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 2d5414793..da2ddf648 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,3 +1,4 @@ +#include "avoid_ub.h" #include "printf.h" #include "regs.h" #include "romfile.h" diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index c48983550..9e79abcbf 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,4 +1,5 @@ #include "libu64/debug.h" +#include "avoid_ub.h" #include "gfx.h" #include "printf.h" #include "regs.h" diff --git a/src/code/z_view.c b/src/code/z_view.c index 9c6be44ab..6fe82aaeb 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -2,6 +2,7 @@ #include "libc64/malloc.h" #include "libu64/debug.h" +#include "avoid_ub.h" #include "gfx.h" #include "letterbox.h" #include "main.h" diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index e28e9c4ae..877a789c6 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -3,6 +3,7 @@ #include "libu64/debug.h" #include "ultra64/viint.h" #include "controller.h" +#include "gfx.h" #include "main.h" #include "printf.h" #include "regs.h" diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c index 9d6e54ea7..f05e1b135 100644 --- a/src/n64dd/z_n64dd.c +++ b/src/n64dd/z_n64dd.c @@ -2,6 +2,7 @@ // threads and provides functions to submit commands to them. #include "libc64/sleep.h" #include "fault.h" +#include "gfx.h" #include "irqmgr.h" #include "line_numbers.h" #include "n64dd.h" @@ -12,7 +13,7 @@ #include "z64audio.h" #include "z64thread.h" -#pragma increment_block_number "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" +#pragma increment_block_number "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" typedef struct struct_801D9C30 { /* 0x000 */ s32 unk_000; // disk start diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 2873f70fb..35c2d35ca 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -6,6 +6,7 @@ #include "z_en_mag.h" +#include "avoid_ub.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index cc92a6b50..673855f56 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -18,6 +18,7 @@ #include "libc64/qrand.h" #include "libu64/debug.h" +#include "avoid_ub.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 95ea7c7b2..63b1e2401 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -5,6 +5,7 @@ #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "language_array.h" #include "letterbox.h" #include "macros.h" #include "main.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index cbc5810fd..c5eedab9c 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -4,6 +4,7 @@ #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "language_array.h" #include "printf.h" #include "regs.h" #include "rumble.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index ac366ffd4..d6a8af68f 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -2,6 +2,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "language_array.h" #include "map.h" #include "printf.h" #include "regs.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index d9d558f0c..34c3b46a4 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "gfxalloc.h" +#include "language_array.h" #include "map.h" #if PLATFORM_N64 #include "n64dd.h" From bed76a3bf3cd89456e3331b2c2b50dbc5f79fe48 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sat, 26 Apr 2025 18:17:02 -0400 Subject: [PATCH 2/4] add array_count.h (#2514) --- include/array_count.h | 8 ++++++++ include/macros.h | 4 ---- include/z64.h | 1 + src/audio/data.c | 4 ++-- src/audio/general.c | 3 ++- src/audio/lib/load.c | 1 + src/audio/lib/seqplayer.c | 1 + src/audio/lib/thread.c | 1 + src/audio/sequence.c | 7 +++---- src/audio/session_init.c | 1 + src/audio/sfx.c | 1 + src/boot/idle.c | 1 + src/boot/z_std_dma.c | 1 + src/code/audio_stop_all_sfx.c | 3 ++- src/code/audio_thread_manager.c | 1 + src/code/db_camera.c | 1 + src/code/fault_gc.c | 1 + src/code/fault_gc_drawer.c | 1 + src/code/fault_n64.c | 1 + src/code/game.c | 1 + src/code/graph.c | 2 +- src/code/irqmgr.c | 1 + src/code/main.c | 1 + src/code/object_table.c | 1 + src/code/padmgr.c | 4 +++- src/code/sched.c | 1 + src/code/speed_meter.c | 1 + src/code/sys_math_atan.c | 2 ++ src/code/ucode_disas.c | 7 ++++--- src/code/z_actor.c | 1 + src/code/z_bgcheck.c | 1 + src/code/z_camera.c | 4 ++-- src/code/z_camera_data.inc.c | 2 ++ src/code/z_collision_btltbls.c | 1 + src/code/z_debug.c | 1 + src/code/z_demo.c | 5 ++++- src/code/z_eff_shield_particle.c | 1 + src/code/z_eff_spark.c | 1 + src/code/z_effect_soft_sprite.c | 1 + src/code/z_effect_soft_sprite_old_init.c | 1 + src/code/z_env_flags.c | 1 + src/code/z_game_over.c | 1 + src/code/z_horse.c | 1 + src/code/z_jpeg.c | 2 ++ src/code/z_kaleido_manager.c | 1 + src/code/z_kankyo.c | 1 + src/code/z_message.c | 1 + src/code/z_onepointdemo.c | 4 +++- src/code/z_parameter.c | 1 + src/code/z_play.c | 1 + src/code/z_quake.c | 1 + src/code/z_room.c | 1 + src/code/z_scene.c | 1 + src/code/z_sfx_source.c | 1 + src/code/z_skin_awb.c | 4 +++- src/code/z_sram.c | 1 + src/code/z_vr_box.c | 1 + src/libleo/leo/leofunc.c | 4 +++- src/libleo/leo/leoutil.c | 3 ++- src/libultra/io/contpfs.c | 2 ++ src/libultra/io/contreaddata.c | 2 ++ src/libultra/io/controller.c | 2 ++ src/libultra/io/piacs.c | 2 ++ src/libultra/io/siacs.c | 2 ++ src/libultra/io/vimgr.c | 6 ++++-- src/n64dd/n64dd_801C8000.c | 3 +++ src/n64dd/n64dd_801CA0B0.c | 2 ++ src/n64dd/z_n64dd.c | 5 ++++- src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 1 + .../actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 1 + src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 1 + .../actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 1 + .../actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c | 1 + .../actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c | 1 + src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c | 1 + .../actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c | 1 + src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 1 + .../actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c | 1 + src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 1 + .../actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 1 + .../actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c | 1 + .../ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c | 1 + src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c | 1 + .../actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c | 1 + .../actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 1 + .../ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c | 1 + .../actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 1 + src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 1 + src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 1 + src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 1 + src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c | 1 + src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 1 + src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c | 1 + src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c | 1 + src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 1 + src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 1 + src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 1 + src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c | 1 + src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 1 + src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 1 + src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c | 1 + src/overlays/actors/ovl_En_Anubice/z_en_anubice.c | 1 + src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c | 1 + src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 1 + src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c | 1 + src/overlays/actors/ovl_En_Door/z_en_door.c | 1 + src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 1 + src/overlays/actors/ovl_En_Fr/z_en_fr.c | 1 + src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c | 1 + src/overlays/actors/ovl_En_Gb/z_en_gb.c | 1 + src/overlays/actors/ovl_En_Go2/z_en_go2.c | 1 + src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c | 1 + src/overlays/actors/ovl_En_Horse/z_en_horse.c | 1 + .../ovl_En_Horse_Link_Child/z_en_horse_link_child.c | 1 + .../actors/ovl_En_Horse_Normal/z_en_horse_normal.c | 1 + src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c | 1 + src/overlays/actors/ovl_En_Ik/z_en_ik.c | 1 + src/overlays/actors/ovl_En_In/z_en_in.c | 1 + src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 1 + src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c | 1 + src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c | 1 + src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c | 1 + src/overlays/actors/ovl_En_Kanban/z_en_kanban.c | 1 + src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 1 + src/overlays/actors/ovl_En_Mag/z_en_mag.c | 1 + src/overlays/actors/ovl_En_Nb/z_en_nb.c | 1 + src/overlays/actors/ovl_En_Niw/z_en_niw.c | 1 + src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c | 1 + src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 1 + src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 1 + src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 1 + src/overlays/actors/ovl_En_St/z_en_st.c | 1 + src/overlays/actors/ovl_En_Ta/z_en_ta.c | 1 + src/overlays/actors/ovl_En_Tk/z_en_tk.c | 1 + src/overlays/actors/ovl_En_Viewer/z_en_viewer.c | 1 + src/overlays/actors/ovl_En_Wf/z_en_wf.c | 1 + src/overlays/actors/ovl_En_Xc/z_en_xc.c | 1 + src/overlays/actors/ovl_En_Zf/z_en_zf.c | 1 + src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 1 + src/overlays/actors/ovl_En_Zo/z_en_zo.c | 1 + src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c | 1 + src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c | 1 + src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 1 + src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 1 + src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 1 + src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 1 + src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c | 1 + src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c | 1 + src/overlays/actors/ovl_player_actor/z_player.c | 1 + src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c | 1 + src/overlays/gamestates/ovl_file_choose/z_file_nameset.c | 1 + src/overlays/gamestates/ovl_select/z_select.c | 3 ++- src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c | 1 + src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c | 2 ++ 154 files changed, 200 insertions(+), 28 deletions(-) create mode 100644 include/array_count.h diff --git a/include/array_count.h b/include/array_count.h new file mode 100644 index 000000000..9e5f6ed4c --- /dev/null +++ b/include/array_count.h @@ -0,0 +1,8 @@ +#ifndef ARRAY_COUNT_H +#define ARRAY_COUNT_H + +#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) +#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) +#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) + +#endif diff --git a/include/macros.h b/include/macros.h index 7c964150e..98efe590c 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,10 +1,6 @@ #ifndef MACROS_H #define MACROS_H -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) -#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) -#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) - #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) #endif diff --git a/include/z64.h b/include/z64.h index 8a259e70f..bb2518e6e 100644 --- a/include/z64.h +++ b/include/z64.h @@ -4,6 +4,7 @@ // TODO: This file still exists ONLY to provide neccesary headers to extracted assets. // After assets are modified to include the headers they need directly, delete this file. +#include "array_count.h" #include "gfx.h" #include "sequence.h" #include "sys_matrix.h" diff --git a/src/audio/data.c b/src/audio/data.c index bd072257b..6c5528f34 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -1,7 +1,7 @@ +#include "array_count.h" +#include "sfx.h" #include "ultra64.h" #include "z64audio.h" -#include "macros.h" -#include "sfx.h" // sSfxRequests ring buffer endpoints. read index <= write index, wrapping around mod 256. u8 gSfxRequestWriteIndex = 0; diff --git a/src/audio/general.c b/src/audio/general.c index c3286554e..abdbcade0 100644 --- a/src/audio/general.c +++ b/src/audio/general.c @@ -1,5 +1,5 @@ #include "libu64/gfxprint.h" -#include "ultra64.h" +#include "array_count.h" #include "attributes.h" #include "audiothread_cmd.h" #include "controller.h" @@ -8,6 +8,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "ultra64.h" #include "versions.h" #include "z64audio.h" #include "z64ocarina.h" diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index 4a447ddc0..f05850c69 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "attributes.h" #include "buffers.h" #include "segment_symbols.h" diff --git a/src/audio/lib/seqplayer.c b/src/audio/lib/seqplayer.c index e238418a6..c906e6728 100644 --- a/src/audio/lib/seqplayer.c +++ b/src/audio/lib/seqplayer.c @@ -14,6 +14,7 @@ * Otherwise, each set of instructions has its own command interpreter */ #include "audio/aseq.h" +#include "array_count.h" #include "assert.h" #include "attributes.h" #include "macros.h" diff --git a/src/audio/lib/thread.c b/src/audio/lib/thread.c index b79c1d97d..43cb6d498 100644 --- a/src/audio/lib/thread.c +++ b/src/audio/lib/thread.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "audiothread_cmd.h" #include "macros.h" #include "ultra64.h" diff --git a/src/audio/sequence.c b/src/audio/sequence.c index f3b815a28..a311e4e73 100644 --- a/src/audio/sequence.c +++ b/src/audio/sequence.c @@ -17,15 +17,14 @@ * Nor are these commands to be confused with the internal audio commands used to transfer requests from * the graph thread to the audio thread. */ +#include "array_count.h" #include "audiothread_cmd.h" -#include "ultra64.h" -#include "ultra64/abi.h" #include "seqcmd.h" #include "sfx.h" +#include "ultra64.h" +#include "ultra64/abi.h" #include "z64audio.h" -#include "macros.h" - // Direct audio command (skips the queueing system) #define SEQCMD_SET_SEQPLAYER_VOLUME_NOW(seqPlayerIndex, duration, volume) \ Audio_ProcessSeqCmd((SEQCMD_OP_SET_SEQPLAYER_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | \ diff --git a/src/audio/session_init.c b/src/audio/session_init.c index d04a955bc..e7248907e 100644 --- a/src/audio/session_init.c +++ b/src/audio/session_init.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "buffers.h" #include "z64audio.h" diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 3d837676d..9c6d7c6eb 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "audiothread_cmd.h" #include "macros.h" #include "printf.h" diff --git a/src/boot/idle.c b/src/boot/idle.c index 6a4de30df..2acfe2ddb 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "buffers.h" #include "build.h" #include "idle.h" diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 0dc1d9c3b..ac91d0d82 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -21,6 +21,7 @@ #include "libc64/sleep.h" #include "libc64/sprintf.h" #include "libu64/debug.h" +#include "array_count.h" #include "attributes.h" #include "carthandle.h" #include "fault.h" diff --git a/src/code/audio_stop_all_sfx.c b/src/code/audio_stop_all_sfx.c index 5ae65705c..2702f8a57 100644 --- a/src/code/audio_stop_all_sfx.c +++ b/src/code/audio_stop_all_sfx.c @@ -1,6 +1,7 @@ +#include "array_count.h" #include "sfx.h" - #include "ultra64.h" + #include "macros.h" u8 sSfxBankIds[] = { diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index 5c7ff901e..5e0cbfc28 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -5,6 +5,7 @@ * and sending the audio rsp tasks generated by the driver to the task scheduler. */ +#include "array_count.h" #include "audiomgr.h" #include "printf.h" #include "regs.h" diff --git a/src/code/db_camera.c b/src/code/db_camera.c index 727600849..a275cae52 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -1,4 +1,5 @@ #include "libu64/gfxprint.h" +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "db_camera.h" diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 9965a6ec0..75104362d 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -47,6 +47,7 @@ #include "libc64/sleep.h" #include "libc64/sprintf.h" #include "alloca.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "padmgr.h" diff --git a/src/code/fault_gc_drawer.c b/src/code/fault_gc_drawer.c index a0e409df7..044b9561b 100644 --- a/src/code/fault_gc_drawer.c +++ b/src/code/fault_gc_drawer.c @@ -5,6 +5,7 @@ * the crash screen implemented by fault.c */ +#include "array_count.h" #include "fault.h" #include "gfx.h" diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index c6c579676..5e071d87b 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -1,6 +1,7 @@ #include "libc64/os_malloc.h" #include "libc64/sleep.h" #include "libc64/sprintf.h" +#include "array_count.h" #include "controller.h" #include "fault.h" #include "gfx.h" diff --git a/src/code/game.c b/src/code/game.c index e3ffb5381..536013aa9 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -2,6 +2,7 @@ #include "libc64/os_malloc.h" #include "libu64/debug.h" #include "libu64/gfxprint.h" +#include "array_count.h" #include "audiomgr.h" #include "buffers.h" #include "controller.h" diff --git a/src/code/graph.c b/src/code/graph.c index 62453359a..8fbb1b02f 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,7 +1,7 @@ #include "libc64/malloc.h" #include "libc64/sprintf.h" #include "libu64/debug.h" - +#include "array_count.h" #include "buffers.h" #include "console_logo_state.h" #include "controller.h" diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index 2915e1c83..fe6b3a12f 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -33,6 +33,7 @@ * @see sched.c */ #include "libu64/debug.h" +#include "array_count.h" #include "irqmgr.h" #include "printf.h" #include "stackcheck.h" diff --git a/src/code/main.c b/src/code/main.c index 6a5dae80e..584e098e6 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -19,6 +19,7 @@ extern struct IrqMgr gIrqMgr; #include "libc64/malloc.h" #include "libu64/rcp_utils.h" #include "libu64/runtime.h" +#include "array_count.h" #include "audiomgr.h" #include "debug_arena.h" #include "fault.h" diff --git a/src/code/object_table.c b/src/code/object_table.c index 904683596..0de131824 100644 --- a/src/code/object_table.c +++ b/src/code/object_table.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "segment_symbols.h" #include "romfile.h" #include "ultra64.h" diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 6d88b34c1..ddea9b254 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -30,7 +30,7 @@ */ #include "libu64/debug.h" #include "libu64/padsetup.h" -#include "macros.h" +#include "array_count.h" #include "padmgr.h" #include "printf.h" #include "fault.h" @@ -38,6 +38,8 @@ #include "translation.h" #include "line_numbers.h" +#include "macros.h" + #define PADMGR_LOG(controllerNum, msg) \ if (DEBUG_FEATURES) { \ PRINTF_COLOR_YELLOW(); \ diff --git a/src/code/sched.c b/src/code/sched.c index d8fea59fa..b009dff35 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -41,6 +41,7 @@ */ #include "libu64/debug.h" #include "libu64/rcp_utils.h" +#include "array_count.h" #include "fault.h" #include "irqmgr.h" #include "main.h" diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index bf8a247ac..bb3624fa8 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -2,6 +2,7 @@ "pal-1.0:0 pal-1.1:0" #include "libc64/malloc.h" #include "libu64/debug.h" +#include "array_count.h" #include "gfx.h" #include "printf.h" #include "regs.h" diff --git a/src/code/sys_math_atan.c b/src/code/sys_math_atan.c index 8dabed7d7..e2b70a361 100644 --- a/src/code/sys_math_atan.c +++ b/src/code/sys_math_atan.c @@ -1,5 +1,7 @@ +#include "array_count.h" #include "sys_math.h" #include "z64math.h" + #include "macros.h" static u16 sAtan2Tbl[] = { diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index eadb32188..7626ed620 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -1,10 +1,11 @@ -#include "ucode_disas.h" -#include "ultra64.h" -#include "ultra64/gs2dex.h" #include "libu64/mtxuty-cvt.h" +#include "ultra64/gs2dex.h" +#include "array_count.h" #include "printf.h" #include "segmented_address.h" #include "translation.h" +#include "ucode_disas.h" +#include "ultra64.h" #include "macros.h" diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 7ea5bb355..8ea0eb113 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,5 +1,6 @@ #include "libc64/math64.h" #include "libu64/overlay.h" +#include "array_count.h" #include "fault.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 51d7e8ad1..945051552 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,4 +1,5 @@ #include "libu64/debug.h" +#include "array_count.h" #include "attributes.h" #include "line_numbers.h" #include "printf.h" diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 388093116..cf18c3634 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1,7 +1,6 @@ #include "libc64/math64.h" #include "libc64/qrand.h" -#include "ultra64.h" - +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "db_camera.h" @@ -15,6 +14,7 @@ #include "sys_math3d.h" #include "terminal.h" #include "translation.h" +#include "ultra64.h" #include "z_lib.h" #include "zelda_arena.h" #include "z64audio.h" diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 07a527afe..18b071b1d 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "global.h" typedef struct CameraModeValue { diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index 34e25b2ff..a49a71d05 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "printf.h" #include "translation.h" #include "z64collision_check.h" diff --git a/src/code/z_debug.c b/src/code/z_debug.c index a43c76cfb..65f8eb60a 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,6 +1,7 @@ #include "libc64/malloc.h" #include "libu64/gfxprint.h" #include "libu64/pad.h" +#include "array_count.h" #include "color.h" #include "controller.h" #include "gfx.h" diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 68f2fbc2f..f45fd1933 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,7 +1,8 @@ #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:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" -#include "global.h" + #include "libu64/gfxprint.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfxalloc.h" @@ -29,6 +30,8 @@ #include "z64player.h" #include "z64save.h" +#include "global.h" + #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" #include "assets/scenes/overworld/ganon_tou/ganon_tou_scene.h" diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index 351676791..bc71d8c4f 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -1,4 +1,5 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index 429635956..dc3ebf9d1 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -1,4 +1,5 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 696a18504..061b6d70d 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -1,4 +1,5 @@ #include "libu64/overlay.h" +#include "array_count.h" #include "printf.h" #include "sfx.h" #include "terminal.h" diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 967640f28..1654ab3d0 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -1,4 +1,5 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" diff --git a/src/code/z_env_flags.c b/src/code/z_env_flags.c index 9ad7e7a02..164ff1dde 100644 --- a/src/code/z_env_flags.c +++ b/src/code/z_env_flags.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "ultra64.h" #include "z64cutscene_flags.h" #include "z64play.h" diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index 20814a4c7..e05bcff26 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "letterbox.h" #include "regs.h" #include "rumble.h" diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 9d185d1e3..d61af32e7 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "terminal.h" #include "z_lib.h" #include "printf.h" diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 29a5404ed..86c896e62 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -1,5 +1,6 @@ #include "jpeg.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "printf.h" @@ -8,6 +9,7 @@ #include "translation.h" #include "ultra64.h" +#include "global.h" #include "macros.h" #define MARKER_ESCAPE 0x00 diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 87a7c0fa1..efecef646 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -1,5 +1,6 @@ #include "libu64/debug.h" #include "libu64/overlay.h" +#include "array_count.h" #include "kaleido_manager.h" #include "printf.h" #include "segment_symbols.h" diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index d87f908be..88dcd5e59 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -3,6 +3,7 @@ #include "libc64/qrand.h" #include "libu64/gfxprint.h" +#include "array_count.h" #include "buffers.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/code/z_message.c b/src/code/z_message.c index d4de077ed..38153dff0 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1,4 +1,5 @@ #include "libu64/gfxprint.h" +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "gfx.h" diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 700353cb8..94c3bc9e1 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,6 +1,8 @@ +#include "one_point_cutscene.h" + #include "libc64/math64.h" #include "libc64/qrand.h" -#include "one_point_cutscene.h" +#include "array_count.h" #include "printf.h" #include "quake.h" #include "sfx.h" diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 944612348..078567510 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "flag_set.h" diff --git a/src/code/z_play.c b/src/code/z_play.c index 60a20e0ed..31dbc765c 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,6 +1,7 @@ #include "libc64/malloc.h" #include "libc64/qrand.h" #include "libu64/debug.h" +#include "array_count.h" #include "buffers.h" #include "color.h" #include "controller.h" diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 690dbc81d..cacb5a213 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,4 +1,5 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "macros.h" #include "printf.h" #include "quake.h" diff --git a/src/code/z_room.c b/src/code/z_room.c index a8e9c5b23..7bc9e4801 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,5 +1,6 @@ #include "libu64/debug.h" #include "ultra64/gs2dex.h" +#include "array_count.h" #include "buffers.h" #include "fault.h" #include "gfx.h" diff --git a/src/code/z_scene.c b/src/code/z_scene.c index da2ddf648..feef5ffc6 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,3 +1,4 @@ +#include "array_count.h" #include "avoid_ub.h" #include "printf.h" #include "regs.h" diff --git a/src/code/z_sfx_source.c b/src/code/z_sfx_source.c index 3d793c617..9dda34ce3 100644 --- a/src/code/z_sfx_source.c +++ b/src/code/z_sfx_source.c @@ -1,5 +1,6 @@ #include "z64sfx_source.h" +#include "array_count.h" #include "sfx.h" #include "z64play.h" #include "z64skin_matrix.h" diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index 8a175ed15..196ce9aae 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -1,4 +1,4 @@ -#include "overlays/actors/ovl_En_fHG/z_en_fhg.h" +#include "array_count.h" #include "segmented_address.h" #include "zelda_arena.h" #include "z64actor.h" @@ -6,6 +6,8 @@ #include "z64skin.h" #include "z64skin_matrix.h" +#include "overlays/actors/ovl_En_fHG/z_en_fhg.h" + /** * Initialises the Vtx buffers used for limb at index `limbIndex` */ diff --git a/src/code/z_sram.c b/src/code/z_sram.c index d25362704..456e7a822 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,5 +1,6 @@ #include "z64sram.h" +#include "array_count.h" #include "file_select_state.h" #include "controller.h" #include "memory_utils.h" diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index ab39d3ca6..f0ef9b008 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -1,5 +1,6 @@ #include "z64skybox.h" +#include "array_count.h" #include "printf.h" #include "segment_symbols.h" #include "terminal.h" diff --git a/src/libleo/leo/leofunc.c b/src/libleo/leo/leofunc.c index d6f7dddcc..8aaf794fd 100644 --- a/src/libleo/leo/leofunc.c +++ b/src/libleo/leo/leofunc.c @@ -1,7 +1,9 @@ -#include "ultra64.h" #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "array_count.h" +#include "ultra64.h" + #include "macros.h" static s32 __leoResetCalled = false; diff --git a/src/libleo/leo/leoutil.c b/src/libleo/leo/leoutil.c index 0a52e820e..44240b055 100644 --- a/src/libleo/leo/leoutil.c +++ b/src/libleo/leo/leoutil.c @@ -1,7 +1,8 @@ -#include "ultra64.h" #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "array_count.h" +#include "ultra64.h" #include "macros.h" diff --git a/src/libultra/io/contpfs.c b/src/libultra/io/contpfs.c index d92bc3eae..c99c31682 100644 --- a/src/libultra/io/contpfs.c +++ b/src/libultra/io/contpfs.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "macros.h" s32 __osPfsInodeCacheChannel = -1; diff --git a/src/libultra/io/contreaddata.c b/src/libultra/io/contreaddata.c index a0b289812..56ebf0a09 100644 --- a/src/libultra/io/contreaddata.c +++ b/src/libultra/io/contreaddata.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "macros.h" s32 osContStartReadData(OSMesgQueue* mq) { diff --git a/src/libultra/io/controller.c b/src/libultra/io/controller.c index 1ea5ecacd..97a33dc00 100644 --- a/src/libultra/io/controller.c +++ b/src/libultra/io/controller.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "macros.h" OSPifRam __osContPifRam; diff --git a/src/libultra/io/piacs.c b/src/libultra/io/piacs.c index 23fe34314..3b9af6d40 100644 --- a/src/libultra/io/piacs.c +++ b/src/libultra/io/piacs.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "macros.h" u32 __osPiAccessQueueEnabled = false; diff --git a/src/libultra/io/siacs.c b/src/libultra/io/siacs.c index dd5418083..480efd31a 100644 --- a/src/libultra/io/siacs.c +++ b/src/libultra/io/siacs.c @@ -1,4 +1,6 @@ +#include "array_count.h" #include "ultra64.h" + #include "macros.h" static OSMesg siAccessBuf[1]; diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index b8eb522e9..1caf997d4 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -1,6 +1,8 @@ -#include "ultra64.h" -#include "stack.h" #include "ultra64/internal.h" +#include "array_count.h" +#include "stack.h" +#include "ultra64.h" + #include "macros.h" static OSThread viThread; diff --git a/src/n64dd/n64dd_801C8000.c b/src/n64dd/n64dd_801C8000.c index 8c6c91a9c..2212fe43f 100644 --- a/src/n64dd/n64dd_801C8000.c +++ b/src/n64dd/n64dd_801C8000.c @@ -1,5 +1,8 @@ // Does some command processing + #include "n64dd.h" + +#include "array_count.h" #include "versions.h" #include "z_locale.h" diff --git a/src/n64dd/n64dd_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c index d564d46ca..a98634622 100644 --- a/src/n64dd/n64dd_801CA0B0.c +++ b/src/n64dd/n64dd_801CA0B0.c @@ -1,6 +1,8 @@ #include "n64dd.h" + #include "libc64/aprintf.h" #include "attributes.h" +#include "array_count.h" #include "global.h" diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c index f05e1b135..a8ce0674c 100644 --- a/src/n64dd/z_n64dd.c +++ b/src/n64dd/z_n64dd.c @@ -1,11 +1,14 @@ // Main interface for the 64DD from the rest of the game. Starts background // threads and provides functions to submit commands to them. + +#include "n64dd.h" + #include "libc64/sleep.h" +#include "array_count.h" #include "fault.h" #include "gfx.h" #include "irqmgr.h" #include "line_numbers.h" -#include "n64dd.h" #include "stack.h" #include "stackcheck.h" #include "sys_freeze.h" diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 15adb7bf9..6ef8c9250 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -7,6 +7,7 @@ #include "z_bg_dodoago.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index eebb7536c..1df0e5b73 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -7,6 +7,7 @@ #include "z_bg_ganon_otyuka.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index ac28324e5..90aeee4b8 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -7,6 +7,7 @@ #include "z_bg_heavy_block.h" #include "libu64/debug.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 62120c933..d20bccdb7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -6,6 +6,7 @@ #include "z_bg_hidan_hamstep.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index 715ecc5fb..0b64a4ff6 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -6,6 +6,7 @@ #include "z_bg_hidan_rsekizou.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 1c86d7d85..452c88f5f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -6,6 +6,7 @@ #include "z_bg_hidan_sekizou.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 20b371708..f166f9f4d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -6,6 +6,7 @@ #include "z_bg_hidan_sima.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index f19f5f9ba..b9350da30 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "sfx.h" #include "z_lib.h" diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 4e9d88d7c..a72f245e2 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index e4620934a..e9cfd701a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -6,6 +6,7 @@ #include "z_bg_jya_zurerukabe.h" +#include "array_count.h" #include "ichain.h" #include "printf.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index d4b512c76..7dc55fbe0 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 8708b601a..6bd947c3a 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -6,6 +6,7 @@ #include "z_bg_mori_hashigo.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 56af066d9..dccddcf49 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -6,6 +6,7 @@ #include "z_bg_mori_rakkatenjo.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index b54226cec..aa8d28b96 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "sfx.h" #include "z_lib.h" diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 60686aaa1..57b76c414 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -6,6 +6,7 @@ #include "z_bg_spot09_obj.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index 1af76df47..574c2533d 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index a1404fdd2..eb89d5f06 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -6,6 +6,7 @@ #include "z_bg_spot15_rrbox.h" +#include "array_count.h" #include "ichain.h" #include "printf.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 213631847..759d2184e 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -3,6 +3,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 1e88e7c4e..66d8e2d50 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -1,6 +1,7 @@ #include "z_bg_spot18_basket.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "one_point_cutscene.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 94ef74bb7..d44a14de5 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -7,6 +7,7 @@ #include "z_bg_spot18_obj.h" +#include "array_count.h" #include "ichain.h" #include "printf.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index a38078e49..c66883ddd 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,6 +12,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 703eec89c..856f9e34e 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Boss_Fd/z_boss_fd.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 50d3ab595..0ca8e3c84 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -6,6 +6,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 53bfa09e5..e2742e3be 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 86466f1cd..848707f00 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -13,6 +13,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 55934e67b..bfd115b53 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -11,6 +11,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 2a9995ddc..1113a3926 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -9,6 +9,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "gfx.h" diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 48a203c4d..e2d6eeb3a 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -3,6 +3,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "controller.h" #include "gfx.h" diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 920846e74..aec25c7cf 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 0d4692d9b..7528a2a6a 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -6,6 +6,7 @@ #include "z_demo_ec.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 237ba6883..6bc60ac27 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 257657520..af3ddeb00 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -1,5 +1,6 @@ #include "z_demo_ik.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index e2f360966..05eec20ff 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -7,6 +7,7 @@ #include "z_door_shutter.h" #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index b624e0edd..5c03ab963 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index a321a43a0..4243bbdf7 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,5 +1,6 @@ #include "z_en_bigokuta.h" +#include "array_count.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 3af6e87ec..7ce476d4e 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index ab7b8e428..df9b566f8 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1,6 +1,7 @@ #include "z_en_dekubaba.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index b3f71481d..9f5bd8723 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -7,6 +7,7 @@ #include "z_en_door.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 815d8c654..b124094a2 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -1,5 +1,6 @@ #include "z_en_fd_fire.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 64d5c4f52..15ce25734 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1,5 +1,6 @@ #include "z_en_fr.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index ca06391dc..d40a9a446 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -6,6 +6,7 @@ #include "z_en_ganon_mant.h" +#include "array_count.h" #include "gfx.h" #include "rand.h" #include "segmented_address.h" diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 0bc9d51d9..9565ceba9 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -7,6 +7,7 @@ #include "z_en_gb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 9c15e9e7a..61c3d5f6e 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 98185e4b0..073689689 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -7,6 +7,7 @@ #include "z_en_heishi1.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 08f58dbce..dded51656 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -9,6 +9,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 7a3307bc0..161014713 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -6,6 +6,7 @@ #include "z_en_horse_link_child.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 1ddc46944..300711ff3 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 059f88c3a..fb59c5b84 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -7,6 +7,7 @@ #include "z_en_horse_zelda.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index e180d5257..9b49e35f7 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -7,6 +7,7 @@ #include "z_en_ik.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index c97c84221..521b8dcbf 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "letterbox.h" diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 191c2142d..bcf59dfbe 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -9,6 +9,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index 2d0ed48af..13ebc48f3 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -7,6 +7,7 @@ #include "z_en_jsjutan.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index d0cd24539..d2d807cd2 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -6,6 +6,7 @@ #include "z_en_kakasi.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index dd1e33696..8f4d21e36 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -6,6 +6,7 @@ #include "z_en_kakasi3.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" 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 2afea4fcb..844a7ee2a 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index f0d8d6748..aa955365d 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -9,6 +9,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "printf.h" #include "rand.h" diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 35c2d35ca..5c1e68f77 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -6,6 +6,7 @@ #include "z_en_mag.h" +#include "array_count.h" #include "avoid_ub.h" #include "controller.h" #include "gfx.h" diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index d44f76c23..e0d2edddf 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 0480b266a..6be5e39db 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -9,6 +9,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 0f24ad4d0..ba165bd3a 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -6,6 +6,7 @@ #include "z_en_po_sisters.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 0cc263345..85ef77847 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index ee3499a57..db44d32ed 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -7,6 +7,7 @@ #include "z_en_ru2.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 46c4d7559..43a59dce4 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,5 +1,6 @@ #include "z_en_ssh.h" +#include "array_count.h" #include "gfx.h" #include "segmented_address.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 3b36545db..7f8bf6497 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -7,6 +7,7 @@ #include "z_en_st.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index eee6976ee..68335d64b 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index c6b1b0906..4f697c29b 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 3290bb3e8..165065d71 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 493b07fc8..4014597de 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 7607fe615..764791e0d 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 843669b4e..b49481e88 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -7,6 +7,7 @@ #include "z_en_zf.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 3fbe1b5fb..28cf2833b 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 5332ab678..95a9f6e07 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -7,6 +7,7 @@ #include "z_en_zo.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 0dfabfee4..d2912c7ea 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -6,6 +6,7 @@ #include "z_magic_dark.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index b64077a0a..57761244b 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -7,6 +7,7 @@ #include "z_magic_wind.h" #include "libu64/debug.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 9563d5d2b..c6d7b1da3 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "rand.h" #include "sfx.h" diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index f7ec91ca0..39d6de7d6 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -7,6 +7,7 @@ #include "z_obj_hamishi.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index d4624e211..0a5866d1d 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "array_count.h" #include "ichain.h" #include "printf.h" #include "quake.h" diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 036045087..8c62e888f 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -7,6 +7,7 @@ #include "z_obj_oshihiki.h" #include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index ac688638d..b21c99e2e 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -6,6 +6,7 @@ #include "z_obj_switch.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index bdf1ff693..c17027975 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -7,6 +7,7 @@ #include "z_object_kankyo.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 673855f56..258e237e0 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -18,6 +18,7 @@ #include "libc64/qrand.h" #include "libu64/debug.h" +#include "array_count.h" #include "avoid_ub.h" #include "controller.h" #include "gfx.h" diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c index a6f909b56..2ab88a16b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c @@ -7,6 +7,7 @@ #include "z_eff_ss_bomb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index c5eedab9c..77de467bf 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -1,6 +1,7 @@ #include "file_select.h" #include "file_select_state.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index dfef3133f..79f76c861 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -6,8 +6,8 @@ #include "libc64/qrand.h" #include "libu64/gfxprint.h" -#include "ultra64.h" #include "alloca.h" +#include "array_count.h" #include "console_logo_state.h" #include "controller.h" #include "gfx.h" @@ -24,6 +24,7 @@ #include "sfx.h" #include "terminal.h" #include "translation.h" +#include "ultra64.h" #include "z64play.h" #include "z64save.h" #include "z64sram.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index e67dd05e8..2729bf54e 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -1,5 +1,6 @@ #include "z_kaleido_scope.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "printf.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 34c3b46a4..d07720d12 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1,5 +1,7 @@ #include "z_kaleido_scope.h" + #include "libc64/sleep.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" From ea22c2ac38bb8cbb459210ce868398c5e7bdcda4 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sat, 26 Apr 2025 19:07:52 -0400 Subject: [PATCH 3/4] create ACTOR_FLAGS_CHECK_ALL (#2515) --- include/macros.h | 2 -- include/z64actor.h | 2 ++ include/z64save.h | 11 ++++------- src/code/z_actor.c | 6 +++--- src/code/z_bg_collect.c | 2 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 4 ++-- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 2 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 2 +- .../ovl_Bg_Haka_Megane/z_bg_haka_megane.c | 2 +- .../z_bg_menkuri_nisekabe.c | 2 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 10 +++++----- src/overlays/actors/ovl_En_Box/z_en_box.c | 2 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 4 ++-- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- src/overlays/actors/ovl_En_Fw/z_en_fw.c | 2 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 4 ++-- src/overlays/actors/ovl_En_Si/z_en_si.c | 4 ++-- src/overlays/actors/ovl_En_Test/z_en_test.c | 2 +- .../actors/ovl_player_actor/z_player.c | 18 +++++++++--------- 19 files changed, 40 insertions(+), 43 deletions(-) diff --git a/include/macros.h b/include/macros.h index 98efe590c..9cb702f0b 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,6 +1,4 @@ #ifndef MACROS_H #define MACROS_H -#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) - #endif diff --git a/include/z64actor.h b/include/z64actor.h index 2709356b9..1a8b50329 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -160,6 +160,8 @@ typedef struct ActorShape { // Flag controlling the use of `Actor.sfx`. Do not use directly. See Actor_PlaySfx_FlaggedTimer #define ACTOR_FLAG_SFX_TIMER (1 << 28) +#define ACTOR_FLAGS_CHECK_ALL(thisx, mask) (((thisx)->flags & (mask)) == (mask)) + #define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5) #define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF) diff --git a/include/z64save.h b/include/z64save.h index af03e8ca6..71b141405 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -592,14 +592,11 @@ typedef enum LinkAge { (EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_0_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_1_RESCUED) | \ EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_2_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_3_RESCUED)) -#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED() \ - CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED], \ - EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) +#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED() \ + ((gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) == (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK)) -#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2() \ - CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & \ - (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK | 0xF0), \ - EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) +#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2() \ + ((gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK | 0xF0) & EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) == (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK)) #define ENDAIKU_CARPENTER_RESCUED_MASK(carpenterType) (1 << (carpenterType)) diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 8ea0eb113..202b2e232 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -596,7 +596,7 @@ void Attention_Update(Attention* attention, Player* player, Actor* playerFocusAc attention->reticleFadeAlphaControl = 0; } - lockOnSfxId = CHECK_FLAG_ALL(playerFocusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) + lockOnSfxId = ACTOR_FLAGS_CHECK_ALL(playerFocusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN; Sfx_PlaySfxCentered(lockOnSfxId); @@ -3468,9 +3468,9 @@ void Attention_FindActorInCategory(PlayState* play, ActorContext* actorCtx, Play while (actor != NULL) { if ((actor->update != NULL) && ((Player*)actor != player) && - CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED)) { + ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED)) { if ((actorCategory == ACTORCAT_ENEMY) && - CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) && + ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) && (actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sBgmEnemyDistSq)) { actorCtx->attention.bgmEnemy = actor; sBgmEnemyDistSq = actor->xyzDistToPlayerSq; diff --git a/src/code/z_bg_collect.c b/src/code/z_bg_collect.c index f4d63087b..68966b74f 100644 --- a/src/code/z_bg_collect.c +++ b/src/code/z_bg_collect.c @@ -82,7 +82,7 @@ void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId) { if (dynaActor != NULL) { DynaPolyActor_SetActorOnTop(dynaActor); - if (CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_CAN_PRESS_SWITCHES)) { + if (ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_CAN_PRESS_SWITCHES)) { DynaPolyActor_SetSwitchPressed(dynaActor); } } diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index f9c6f71d2..9ca642d4e 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -176,7 +176,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if (this->collider.elem.atHitElem->acElemFlags & ACELEM_HOOKABLE) { ArmsHook_AttachToActor(this, touchedActor); - if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)) { + if (ACTOR_FLAGS_CHECK_ALL(touchedActor, ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)) { ArmsHook_PullPlayer(this); } } @@ -202,7 +202,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if (attachedActor != NULL) { if ((attachedActor->update == NULL) || - !CHECK_FLAG_ALL(attachedActor->flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + !ACTOR_FLAGS_CHECK_ALL(attachedActor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { attachedActor = NULL; this->attachedActor = NULL; } else if (this->actor.child != NULL) { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index ab2b0ce91..98824a94e 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -58,7 +58,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) { BgGndNisekabe* this = (BgGndNisekabe*)thisx; u32 index = PARAMS_GET_U(this->actor.params, 0, 8); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, dLists[index]); } else { Gfx_DrawDListOpa(play, dLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 9ef689694..a20963794 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -355,7 +355,7 @@ void BgHakaGate_Draw(Actor* thisx, PlayState* play) { BgHakaGate* this = (BgHakaGate*)thisx; MtxF currentMtxF; - if (CHECK_FLAG_ALL(thisx->flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(thisx, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, object_haka_objects_DL_00F1B0); } else { Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 3d67136b7..a09195d6f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -133,7 +133,7 @@ void BgHakaMegane_Update(Actor* thisx, PlayState* play) { void BgHakaMegane_Draw(Actor* thisx, PlayState* play) { BgHakaMegane* this = (BgHakaMegane*)thisx; - if (CHECK_FLAG_ALL(thisx->flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(thisx, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, sDLists[thisx->params]); } else { Gfx_DrawDListOpa(play, sDLists[thisx->params]); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index 0bc064906..ff1345455 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -54,7 +54,7 @@ void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) { BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx; u32 index = PARAMS_GET_U(this->actor.params, 0, 8); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, sDLists[index]); } else { Gfx_DrawDListOpa(play, sDLists[index]); diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 75b72adde..89ba5fab3 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -917,7 +917,7 @@ void BossSst_HeadVulnerable(BossSst* this, PlayState* play) { Math_StepToF(&sHandOffsets[RIGHT].z, 600.0f, 20.0f); Math_StepToF(&sHandOffsets[LEFT].x, 200.0f, 20.0f); Math_StepToF(&sHandOffsets[RIGHT].x, -200.0f, 20.0f); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { this->timer += 2; this->timer = CLAMP_MAX(this->timer, 50); } else { @@ -2713,7 +2713,7 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play2) { } BossSst_MoveAround(this); - if ((!this->vVanish || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) && + if ((!this->vVanish || ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) && ((this->actionFunc == BossSst_HeadReadyCharge) || (this->actionFunc == BossSst_HeadCharge) || (this->actionFunc == BossSst_HeadFrozenHand) || (this->actionFunc == BossSst_HeadStunned) || (this->actionFunc == BossSst_HeadVulnerable) || (this->actionFunc == BossSst_HeadDamage))) { @@ -2818,7 +2818,7 @@ s32 BossSst_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* Gfx** gfx) { BossSst* this = (BossSst*)thisx; - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) { *dList = NULL; } else if (this->actionFunc == BossSst_HeadThrash) { // Animation modifications for death cutscene s32 shakeAmp = (this->timer / 10) + 1; @@ -2897,7 +2897,7 @@ void BossSst_DrawHead(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_boss_sst.c", 6810); - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0x80, sBodyColor.r, sBodyColor.g, sBodyColor.b, 255); if (!sBodyStatic) { @@ -2924,7 +2924,7 @@ void BossSst_DrawHead(Actor* thisx, PlayState* play) { Matrix_RotateY(-randYaw, MTXMODE_APPLY); } - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { POLY_OPA_DISP = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, BossSst_OverrideHeadDraw, BossSst_PostHeadDraw, this, POLY_OPA_DISP); diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index d45fd2731..c4ef15919 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -640,7 +640,7 @@ void EnBox_Draw(Actor* thisx, PlayState* play) { and cleared by Open */ if ((this->alpha == 255 && !(this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6)) || - (!CHECK_FLAG_ALL(this->dyna.actor.flags, ACTOR_FLAG_REACT_TO_LENS) && + (!ACTOR_FLAGS_CHECK_ALL(&this->dyna.actor, ACTOR_FLAG_REACT_TO_LENS) && (this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6))) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 26848dd95..475c476bb 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -244,7 +244,7 @@ s32 EnFd_SpawnCore(EnFd* this, PlayState* play) { this->actor.child->colChkInfo.health = 8; } - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { Actor_SwapHookshotAttachment(play, &this->actor, this->actor.child); } @@ -684,7 +684,7 @@ void EnFd_Update(Actor* thisx, PlayState* play) { EnFd_SpawnDot(this, play); } - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { if (EnFd_SpawnCore(this, play)) { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->invincibilityTimer = 30; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index d365822f5..a9d9036e9 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -293,7 +293,7 @@ void EnFloormas_SetupLand(EnFloormas* this) { void EnFloormas_SetupSplit(EnFloormas* this) { Actor_SetScale(&this->actor, 0.004f); this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED; - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { this->actor.draw = EnFloormas_DrawHighlighted; } else { this->actor.draw = EnFloormas_Draw; diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index b9a678d69..ba002aefb 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -376,7 +376,7 @@ void EnFw_Update(Actor* thisx, PlayState* play) { EnFw* this = (EnFw*)thisx; SkelAnime_Update(&this->skelAnime); - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 57ef9a85b..282d6249f 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -226,7 +226,7 @@ s32 EnPoDesert_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec mtxScale = this->actionTimer / 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); } - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { *dList = NULL; } return false; @@ -246,7 +246,7 @@ void EnPoDesert_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* color.r = (s16)(rand * 30.0f) + 225; color.g = (s16)(rand * 100.0f) + 155; color.b = (s16)(rand * 160.0f) + 95; - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { gDPPipeSync((*gfxP)++); gDPSetEnvColor((*gfxP)++, color.r, color.g, color.b, 255); MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_desert.c", 523); diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index d1597d082..b5bf27be1 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -88,7 +88,7 @@ s32 func_80AFB748(EnSi* this, PlayState* play) { void func_80AFB768(EnSi* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { this->actionFunc = func_80AFB89C; } else { Math_SmoothStepToF(&this->actor.scale.x, 0.25f, 0.4f, 1.0f, 0.0f); @@ -121,7 +121,7 @@ void func_80AFB89C(EnSi* this, PlayState* play) { Actor_SetScale(&this->actor, this->actor.scale.x); this->actor.shape.rot.y += 0x400; - if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { + if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { Item_Give(play, ITEM_SKULL_TOKEN); player->actor.freezeTimer = 10; Message_StartTextbox(play, 0xB4, NULL); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 0f9a9aa22..61628f342 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1853,7 +1853,7 @@ s32 EnTest_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3f* } if ((this->actor.params == STALFOS_TYPE_INVISIBLE) && - !CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { + !ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) { *dList = NULL; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 258e237e0..5f93be110 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1739,7 +1739,7 @@ BAD_RETURN(s32) func_80832224(Player* this) { s32 Player_IsTalking(PlayState* play) { Player* this = GET_PLAYER(play); - return CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK); + return ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK); } void Player_AnimPlayOnce(PlayState* play, Player* this, LinkAnimationHeader* anim) { @@ -2558,7 +2558,7 @@ s32 Player_FriendlyLockOnOrParallel(Player* this) { */ s32 Player_UpdateHostileLockOn(Player* this) { if ((this->focusActor != NULL) && - CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { this->stateFlags1 |= PLAYER_STATE1_HOSTILE_LOCK_ON; return true; @@ -4003,7 +4003,7 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) { // is hostile. This is a special case to allow Player to have more freedom of movement and be able // to throw a carried actor at the lock-on actor, even if it is hostile. if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || - !CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + !ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { this->stateFlags1 |= PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS; } } else { @@ -6177,7 +6177,7 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) { canTalkToLockOnWithCUp = (lockOnActor != NULL) && - (CHECK_FLAG_ALL(lockOnActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || + (ACTOR_FLAGS_CHECK_ALL(lockOnActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || (lockOnActor->naviEnemyId != NAVI_ENEMY_NONE)); if (canTalkToLockOnWithCUp || (this->naviTextId != 0)) { @@ -6292,7 +6292,7 @@ s32 Player_ActionHandler_0(Player* this, PlayState* play) { } if ((this->focusActor != NULL) && - (CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || + (ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || (this->focusActor->naviEnemyId != NAVI_ENEMY_NONE))) { this->stateFlags2 |= PLAYER_STATE2_21; } else if ((this->naviTextId == 0) && !Player_CheckHostileLockOn(this) && @@ -11378,7 +11378,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { } else if (this->stateFlags2 & PLAYER_STATE2_8) { camMode = CAM_MODE_PUSH_PULL; } else if ((focusActor = this->focusActor) != NULL) { - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK)) { camMode = CAM_MODE_TALK; } else if (this->stateFlags1 & PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS) { if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) { @@ -12000,7 +12000,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Player_UpdateShapeYaw(this, play); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) { + if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK)) { this->talkActorDistance = 0.0f; } else { this->talkActor = NULL; @@ -12564,7 +12564,7 @@ void Player_Action_Talk(Player* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->actor.flags &= ~ACTOR_FLAG_TALK; - if (!CHECK_FLAG_ALL(this->talkActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + if (!ACTOR_FLAGS_CHECK_ALL(this->talkActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { this->stateFlags2 &= ~PLAYER_STATE2_LOCK_ON_WITH_SWITCH; } @@ -16155,7 +16155,7 @@ void Player_StartTalking(PlayState* play, Actor* actor) { s32 pad; if ((this->talkActor != NULL) || (actor == this->naviActor) || - CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) { + ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) { actor->flags |= ACTOR_FLAG_TALK; } From f7a270655bd974242a286856bd56b490a998ac44 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sun, 27 Apr 2025 12:48:11 -0400 Subject: [PATCH 4/4] Delete macros.h; Delete global.h (#2516) --- include/buffers.h | 1 - include/global.h | 6 ------ include/macros.h | 4 ---- include/z64animation.h | 1 - include/z64scene.h | 1 - include/z64view.h | 1 - src/audio/general.c | 2 -- src/audio/lib/load.c | 2 -- src/audio/lib/playback.c | 1 - src/audio/lib/seqplayer.c | 1 - src/audio/lib/thread.c | 1 - src/audio/session_init.c | 2 -- src/audio/sfx.c | 1 - src/boot/boot_main.c | 2 -- src/boot/cic6105.c | 2 -- src/boot/idle.c | 2 -- src/boot/viconfig.c | 2 -- src/boot/z_locale.c | 3 --- src/boot/z_std_dma.c | 2 -- src/buffers/zbuffer.c | 1 - src/code/PreRender.c | 3 --- src/code/audio_stop_all_sfx.c | 2 -- src/code/audio_thread_manager.c | 2 -- src/code/debug_malloc.c | 2 -- src/code/fault_gc.c | 2 -- src/code/fault_gc_drawer.c | 3 --- src/code/fault_n64.c | 2 -- src/code/game.c | 3 --- src/code/gamealloc.c | 2 -- src/code/graph.c | 3 --- src/code/irqmgr.c | 2 -- src/code/main.c | 2 -- src/code/mempak.c | 2 -- src/code/object_table.c | 2 -- src/code/padmgr.c | 2 -- src/code/sched.c | 3 --- src/code/shrink_window.c | 2 -- src/code/sys_cfb.c | 2 -- src/code/sys_freeze.c | 2 -- src/code/sys_math3d.c | 2 -- src/code/sys_math_atan.c | 2 -- src/code/sys_matrix.c | 1 - src/code/title_setup.c | 2 -- src/code/ucode_disas.c | 2 -- src/code/z_DLF.c | 2 -- src/code/z_actor.c | 2 -- src/code/z_actor_dlftbls.c | 2 -- src/code/z_camera_data.inc.c | 2 -- src/code/z_collision_btltbls.c | 2 -- src/code/z_collision_check.c | 1 - src/code/z_cutscene_spline.c | 1 - src/code/z_debug.c | 2 -- src/code/z_demo.c | 2 -- src/code/z_eff_blure.c | 3 --- src/code/z_eff_shield_particle.c | 3 --- src/code/z_eff_spark.c | 3 --- src/code/z_fbdemo.c | 2 -- src/code/z_fbdemo_circle.c | 2 -- src/code/z_fbdemo_fade.c | 2 -- src/code/z_fbdemo_triforce.c | 1 - src/code/z_fcurve_data.c | 1 - src/code/z_frame_advance.c | 1 - src/code/z_game_over.c | 3 --- src/code/z_jpeg.c | 3 --- src/code/z_kaleido_manager.c | 2 -- src/code/z_kaleido_scope_call.c | 2 -- src/code/z_kanfont.c | 2 -- src/code/z_lib.c | 1 - src/code/z_malloc.c | 2 -- src/code/z_map_exp.c | 2 -- src/code/z_map_mark.c | 2 -- src/code/z_message.c | 2 -- src/code/z_moji.c | 3 --- src/code/z_parameter.c | 2 -- src/code/z_play.c | 2 -- src/code/z_prenmi.c | 3 --- src/code/z_prenmi_buff.c | 1 - src/code/z_quake.c | 1 - src/code/z_sfx_source.c | 2 -- src/code/z_skelanime.c | 2 -- src/code/z_skin_matrix.c | 2 -- src/code/z_sram.c | 2 -- src/code/z_ss_sram.c | 3 --- src/code/z_vimode.c | 3 --- src/code/z_viscvg.c | 2 -- src/code/z_vismono.c | 2 -- src/code/z_viszbuf.c | 2 -- src/code/z_vr_box.c | 2 -- src/libc64/__osMalloc_gc.c | 2 -- src/libc64/__osMalloc_n64.c | 2 -- src/libc64/malloc.c | 2 -- src/libc64/math64.c | 1 - src/libleo/leo/leofunc.c | 2 -- src/libleo/leo/leoutil.c | 2 -- src/libu64/debug.c | 2 -- src/libu64/gfxprint.c | 2 -- src/libu64/load_gc.c | 2 -- src/libu64/loadfragment2_gc.c | 2 -- src/libu64/loadfragment2_n64.c | 2 -- src/libu64/rcp_utils.c | 2 -- src/libu64/relocation_gc.c | 2 -- src/libu64/stackcheck.c | 2 -- src/libultra/io/contpfs.c | 2 -- src/libultra/io/contreaddata.c | 2 -- src/libultra/io/controller.c | 2 -- src/libultra/io/piacs.c | 2 -- src/libultra/io/siacs.c | 2 -- src/libultra/io/vimgr.c | 2 -- src/n64dd/n64dd_801C8940.c | 2 -- src/n64dd/n64dd_801C9440.c | 1 - src/n64dd/n64dd_801CA0B0.c | 2 -- src/n64dd/n64dd_data_buffer.c | 1 - src/n64dd/n64dd_error_bodies.c | 1 - src/n64dd/n64dd_error_headers.c | 1 - src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 1 - src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 -- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 2 -- src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 4 ---- src/overlays/gamestates/ovl_file_choose/z_file_choose.c | 3 --- src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c | 2 -- src/overlays/gamestates/ovl_file_choose/z_file_nameset.c | 3 --- src/overlays/gamestates/ovl_select/z_select.c | 2 -- src/overlays/gamestates/ovl_title/z_title.c | 2 -- src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c | 2 -- src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c | 2 -- src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c | 2 -- src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c | 2 -- tools/ZAPD/ZAPD/ZFile.cpp | 1 - 128 files changed, 256 deletions(-) delete mode 100644 include/global.h delete mode 100644 include/macros.h diff --git a/include/buffers.h b/include/buffers.h index e74719c44..2a690d273 100644 --- a/include/buffers.h +++ b/include/buffers.h @@ -2,7 +2,6 @@ #define BUFFERS_H #include "gfx.h" -#include "macros.h" #include "ultra64.h" extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes diff --git a/include/global.h b/include/global.h deleted file mode 100644 index 0b9114f96..000000000 --- a/include/global.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GLOBAL_H -#define GLOBAL_H - -#include "macros.h" - -#endif diff --git a/include/macros.h b/include/macros.h deleted file mode 100644 index 9cb702f0b..000000000 --- a/include/macros.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MACROS_H -#define MACROS_H - -#endif diff --git a/include/z64animation.h b/include/z64animation.h index 9db7b260d..a085da5dd 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -5,7 +5,6 @@ #include "ultra64.h" #include "z64dma.h" #include "z64math.h" -#include "macros.h" struct PlayState; struct Actor; diff --git a/include/z64scene.h b/include/z64scene.h index 7453f48ba..09b342c04 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -2,7 +2,6 @@ #define Z64SCENE_H #include "avoid_ub.h" -#include "macros.h" #include "ultra64.h" #include "z64bgcheck.h" #include "z64environment.h" diff --git a/include/z64view.h b/include/z64view.h index b007129f9..83bdf0fe8 100644 --- a/include/z64view.h +++ b/include/z64view.h @@ -2,7 +2,6 @@ #define Z64VIEW_H #include "avoid_ub.h" -#include "macros.h" #include "ultra64.h" #include "z64math.h" diff --git a/src/audio/general.c b/src/audio/general.c index abdbcade0..f04f203a1 100644 --- a/src/audio/general.c +++ b/src/audio/general.c @@ -13,8 +13,6 @@ #include "z64audio.h" #include "z64ocarina.h" -#include "global.h" - #define ABS_ALT(x) ((x) < 0 ? -(x) : (x)) #if !PLATFORM_N64 diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index f05850c69..ebd968ae9 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -6,8 +6,6 @@ #include "versions.h" #include "z64audio.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)) diff --git a/src/audio/lib/playback.c b/src/audio/lib/playback.c index 03e749437..327e271d0 100644 --- a/src/audio/lib/playback.c +++ b/src/audio/lib/playback.c @@ -1,5 +1,4 @@ #include "ultra64.h" -#include "macros.h" #include "z64audio.h" void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) { diff --git a/src/audio/lib/seqplayer.c b/src/audio/lib/seqplayer.c index c906e6728..c43ae4848 100644 --- a/src/audio/lib/seqplayer.c +++ b/src/audio/lib/seqplayer.c @@ -17,7 +17,6 @@ #include "array_count.h" #include "assert.h" #include "attributes.h" -#include "macros.h" #include "ultra64.h" #include "z64audio.h" diff --git a/src/audio/lib/thread.c b/src/audio/lib/thread.c index 43cb6d498..b47efa326 100644 --- a/src/audio/lib/thread.c +++ b/src/audio/lib/thread.c @@ -1,6 +1,5 @@ #include "array_count.h" #include "audiothread_cmd.h" -#include "macros.h" #include "ultra64.h" #include "versions.h" #include "z64audio.h" diff --git a/src/audio/session_init.c b/src/audio/session_init.c index e7248907e..3c3d9c4ae 100644 --- a/src/audio/session_init.c +++ b/src/audio/session_init.c @@ -2,8 +2,6 @@ #include "buffers.h" #include "z64audio.h" -#include "global.h" - #include "assets/audio/sequence_sizes.h" #include "assets/audio/soundfont_sizes.h" diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 9c6d7c6eb..65309942a 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -1,6 +1,5 @@ #include "array_count.h" #include "audiothread_cmd.h" -#include "macros.h" #include "printf.h" #include "sfx.h" #include "terminal.h" diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 811c75d35..2f948b9d6 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -12,8 +12,6 @@ #include "z_locale.h" #include "z64thread.h" -#include "global.h" - #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 ntsc-1.2:128" StackEntry sBootThreadInfo; diff --git a/src/boot/cic6105.c b/src/boot/cic6105.c index 81c0af99c..fadae3a18 100644 --- a/src/boot/cic6105.c +++ b/src/boot/cic6105.c @@ -7,8 +7,6 @@ #include "regs.h" #include "sched.h" -#include "global.h" - s32 func_80001714(void); OSTask D_800067C0_unknown = { diff --git a/src/boot/idle.c b/src/boot/idle.c index 2acfe2ddb..743219d94 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -14,8 +14,6 @@ #include "z64thread.h" #include "z64dma.h" -#include "global.h" - #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" \ "ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192" diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c index 1340e850b..0381f57f3 100644 --- a/src/boot/viconfig.c +++ b/src/boot/viconfig.c @@ -2,8 +2,6 @@ #include "terminal.h" #include "idle.h" -#include "global.h" - s8 D_80009430 = 1; vu8 gViConfigBlack = true; u8 gViConfigAdditionalScanLines = 0; diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index 0e3df93e4..a517f561c 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -11,9 +11,6 @@ #include "vi_mode.h" #include "z_locale.h" -#include "macros.h" -#include "global.h" - s32 gCurrentRegion = 0; typedef struct LocaleCartInfo { diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index ac91d0d82..de2a19e57 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -45,8 +45,6 @@ #include "z64dma.h" #include "z64thread.h" -#include "global.h" - #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 ntsc-1.2:66" \ "pal-1.0:64 pal-1.1:64" diff --git a/src/buffers/zbuffer.c b/src/buffers/zbuffer.c index 0eda88921..69c445b63 100644 --- a/src/buffers/zbuffer.c +++ b/src/buffers/zbuffer.c @@ -1,6 +1,5 @@ #include "alignment.h" #include "buffers.h" -#include "macros.h" #include "ultra64/ultratypes.h" ALIGNED(64) u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; diff --git a/src/code/PreRender.c b/src/code/PreRender.c index c6cf72c59..ddf6b473e 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -13,9 +13,6 @@ #include "printf.h" #include "regs.h" -#include "macros.h" -#include "global.h" - void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) { this->widthSave = width; this->heightSave = height; diff --git a/src/code/audio_stop_all_sfx.c b/src/code/audio_stop_all_sfx.c index 2702f8a57..b1b526e8e 100644 --- a/src/code/audio_stop_all_sfx.c +++ b/src/code/audio_stop_all_sfx.c @@ -2,8 +2,6 @@ #include "sfx.h" #include "ultra64.h" -#include "macros.h" - u8 sSfxBankIds[] = { BANK_PLAYER, BANK_ITEM, BANK_ENV, BANK_ENEMY, BANK_SYSTEM, BANK_OCARINA, BANK_VOICE, }; diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index 5e0cbfc28..57f530a4b 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -13,8 +13,6 @@ #include "translation.h" #include "z64dma.h" -#include "macros.h" - void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) { AudioTask* task = audioMgr->rspTask; diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 6204e674f..ad7c786f3 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -3,8 +3,6 @@ #include "printf.h" #include "translation.h" -#include "macros.h" - #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 #define LOG_SEVERITY_VERBOSE 3 diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 75104362d..b2bb9d13d 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -58,8 +58,6 @@ #include "translation.h" #include "z64thread.h" -#include "global.h" - void Fault_Init(void); void Fault_SetOsSyncPrintfEnabled(u32 enabled); void Fault_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color); diff --git a/src/code/fault_gc_drawer.c b/src/code/fault_gc_drawer.c index 044b9561b..9c2470b9b 100644 --- a/src/code/fault_gc_drawer.c +++ b/src/code/fault_gc_drawer.c @@ -7,12 +7,9 @@ #include "array_count.h" #include "fault.h" - #include "gfx.h" #include "terminal.h" -#include "global.h" - #pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" typedef struct FaultDrawer { diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index 5e071d87b..75fc704b9 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -13,8 +13,6 @@ #include "z64thread.h" #include "translation.h" -#include "global.h" - #pragma increment_block_number "ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144" typedef struct FaultMgr { diff --git a/src/code/game.c b/src/code/game.c index 536013aa9..7f63d4d64 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -32,9 +32,6 @@ #include "z64play.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" SpeedMeter D_801664D0; diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index 33ad848a1..506ef7721 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -3,8 +3,6 @@ #include "gamealloc.h" #include "printf.h" -#include "macros.h" - void GameAlloc_Log(GameAlloc* this) { GameAllocEntry* iter; diff --git a/src/code/graph.c b/src/code/graph.c index 8fbb1b02f..86543cc50 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -30,9 +30,6 @@ #include "z64save.h" #include "z64play.h" -#include "macros.h" -#include "global.h" - #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index fe6b3a12f..ced883f7a 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -42,8 +42,6 @@ #include "versions.h" #include "z64thread.h" -#include "macros.h" - vu32 gIrqMgrResetStatus = IRQ_RESET_STATUS_IDLE; volatile OSTime sIrqMgrResetTime = 0; volatile OSTime gIrqMgrRetraceTime = 0; diff --git a/src/code/main.c b/src/code/main.c index 584e098e6..cb936b217 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -43,8 +43,6 @@ extern struct IrqMgr gIrqMgr; #include "z64debug.h" #include "z64thread.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" \ "ique-cn:0 ntsc-1.0:34 ntsc-1.1:34 ntsc-1.2:34 pal-1.0:32 pal-1.1:32" diff --git a/src/code/mempak.c b/src/code/mempak.c index 19c11b31d..850c478b9 100644 --- a/src/code/mempak.c +++ b/src/code/mempak.c @@ -11,8 +11,6 @@ #include "padmgr.h" #include "printf.h" -#include "macros.h" - #define MEMPAK_MAX_FILES 11 OSPfs sMempakPfsHandle; diff --git a/src/code/object_table.c b/src/code/object_table.c index 0de131824..9ed6a1f44 100644 --- a/src/code/object_table.c +++ b/src/code/object_table.c @@ -4,8 +4,6 @@ #include "ultra64.h" #include "z64object.h" -#include "macros.h" - s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD }; u32 gObjectTableSize = ARRAY_COUNT(gObjectTable); diff --git a/src/code/padmgr.c b/src/code/padmgr.c index ddea9b254..01a952c87 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -38,8 +38,6 @@ #include "translation.h" #include "line_numbers.h" -#include "macros.h" - #define PADMGR_LOG(controllerNum, msg) \ if (DEBUG_FEATURES) { \ PRINTF_COLOR_YELLOW(); \ diff --git a/src/code/sched.c b/src/code/sched.c index b009dff35..c573bf97f 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -54,9 +54,6 @@ #include "vi_mode.h" #include "z64thread.h" -#include "macros.h" -#include "global.h" - #define RSP_DONE_MSG 667 #define RDP_DONE_MSG 668 #define NOTIFY_MSG 670 // original name: ENTRY_MSG diff --git a/src/code/shrink_window.c b/src/code/shrink_window.c index a485d8168..3c92ede0e 100644 --- a/src/code/shrink_window.c +++ b/src/code/shrink_window.c @@ -2,8 +2,6 @@ #include "printf.h" #include "regs.h" -#include "macros.h" - typedef enum LetterboxState { /* 0 */ LETTERBOX_STATE_IDLE, /* 1 */ LETTERBOX_STATE_GROWING, diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 8877c92ce..38fc9c65d 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -7,8 +7,6 @@ #include "printf.h" #include "translation.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" \ "pal-1.1:128" diff --git a/src/code/sys_freeze.c b/src/code/sys_freeze.c index 427fca389..295715555 100644 --- a/src/code/sys_freeze.c +++ b/src/code/sys_freeze.c @@ -4,8 +4,6 @@ #include "sys_freeze.h" #include "terminal.h" -#include "macros.h" - NORETURN void func_800D31A0(void) { PRINTF(VT_FGCOL(RED) "\n**** Freeze!! ****\n" VT_RST); for (;;) { diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 35f15bdaf..1ce651e9c 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -7,8 +7,6 @@ #include "z_lib.h" #include "z64math.h" -#include "macros.h" - #pragma increment_block_number "gc-eu:77 gc-eu-mq:77 gc-jp:77 gc-jp-ce:77 gc-jp-mq:77 gc-us:77 gc-us-mq:77 ique-cn:67" \ "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" diff --git a/src/code/sys_math_atan.c b/src/code/sys_math_atan.c index e2b70a361..0c99eaced 100644 --- a/src/code/sys_math_atan.c +++ b/src/code/sys_math_atan.c @@ -2,8 +2,6 @@ #include "sys_math.h" #include "z64math.h" -#include "macros.h" - static u16 sAtan2Tbl[] = { 0x0000, 0x000A, 0x0014, 0x001F, 0x0029, 0x0033, 0x003D, 0x0047, 0x0051, 0x005C, 0x0066, 0x0070, 0x007A, 0x0084, 0x008F, 0x0099, 0x00A3, 0x00AD, 0x00B7, 0x00C2, 0x00CC, 0x00D6, 0x00E0, 0x00EA, 0x00F4, 0x00FF, 0x0109, 0x0113, diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index 3dc86d25d..2ca488260 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -3,7 +3,6 @@ #if DEBUG_FEATURES #include "fault.h" #endif -#include "macros.h" #include "printf.h" #include "sys_matrix.h" #include "ultra64.h" diff --git a/src/code/title_setup.c b/src/code/title_setup.c index 64e30ecaa..027202247 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -4,8 +4,6 @@ #include "translation.h" #include "z64save.h" -#include "global.h" - void Setup_InitImpl(SetupState* this) { PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n")); SaveContext_Init(); diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index 7626ed620..8d1ff6cd7 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -7,8 +7,6 @@ #include "ucode_disas.h" #include "ultra64.h" -#include "macros.h" - #if DEBUG_FEATURES typedef struct F3dzexConst { diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index 2dbcb115b..ad2cdff11 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -6,8 +6,6 @@ #include "ultra64.h" #include "z_game_dlftbls.h" -#include "macros.h" - void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { if (overlayEntry->loadedRamAddr != NULL) { PRINTF(T("既にリンクされています\n", "Already linked\n")); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 202b2e232..721087332 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -28,8 +28,6 @@ #include "z64save.h" #include "z64skin_matrix.h" -#include "global.h" - #include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index f489e614c..1e3c6c96b 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -3,8 +3,6 @@ #include "segment_symbols.h" #include "z_actor_dlftbls.h" -#include "macros.h" - // Linker symbol declarations (used in the table below) #define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name) #define DEFINE_ACTOR_INTERNAL(_0, _1, _2, _3) diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 18b071b1d..9a9795f45 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "global.h" - typedef struct CameraModeValue { s16 val; s16 dataType; diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index a49a71d05..5c2a210bc 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -3,8 +3,6 @@ #include "translation.h" #include "z64collision_check.h" -#include "macros.h" - static DamageTable sDamageTablePresets[] = { { { // 0 diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 2c77d9441..dcf07766e 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,5 +1,4 @@ #include "gfx.h" -#include "macros.h" #include "printf.h" #include "regs.h" #include "sfx.h" diff --git a/src/code/z_cutscene_spline.c b/src/code/z_cutscene_spline.c index d95b2ca7f..137f9f544 100644 --- a/src/code/z_cutscene_spline.c +++ b/src/code/z_cutscene_spline.c @@ -2,7 +2,6 @@ #include "z64math.h" #include "z64camera.h" #include "z64cutscene_spline.h" -#include "macros.h" // The code in this file is very similar to a spline system used in Super Mario 64 for cutscene camera movement diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 65f8eb60a..d5804cd7e 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -11,8 +11,6 @@ #include "ultra64.h" #include "z64debug.h" -#include "macros.h" - typedef struct DebugCamTextBufferEntry { /* 0x0 */ u8 x; /* 0x1 */ u8 y; diff --git a/src/code/z_demo.c b/src/code/z_demo.c index f45fd1933..d5135b99d 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -30,8 +30,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" #include "assets/scenes/overworld/ganon_tou/ganon_tou_scene.h" diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index a956d3468..614cfa5b5 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -9,9 +9,6 @@ #include "z64effect.h" #include "z64skin_matrix.h" -#include "macros.h" -#include "global.h" - #include "z64.h" // required for gameplay keep, the header doesnt include any external dependencies #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index bc71d8c4f..865bd8ec9 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -10,9 +10,6 @@ #include "z64play.h" #include "z64skin_matrix.h" -#include "macros.h" -#include "global.h" - #include "assets/objects/gameplay_keep/gameplay_keep.h" static Vtx sVertices[5] = { diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index dc3ebf9d1..57ce3d9ba 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -9,9 +9,6 @@ #include "z64play.h" #include "z64skin_matrix.h" -#include "macros.h" -#include "global.h" - #include "assets/objects/gameplay_keep/gameplay_keep.h" // original name: "spark" diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index 482fa99d6..2621f1c12 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -19,8 +19,6 @@ #include "z64math.h" #include "z64transition_instances.h" -#include "macros.h" - // color framebuffer extern u16 D_0F000000[]; diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 699526ce7..499867d57 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -4,8 +4,6 @@ #include "gfx.h" #include "sfx.h" -#include "global.h" - typedef enum TransitionCircleDirection { /* 0 */ TRANS_CIRCLE_DIR_IN, /* 1 */ TRANS_CIRCLE_DIR_OUT diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index c789cfd6c..1be97d5f5 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -9,8 +9,6 @@ #include "z64save.h" #include "z64transition_instances.h" -#include "macros.h" - typedef enum TransitionFadeDirection { /* 0 */ TRANS_FADE_DIR_IN, /* 1 */ TRANS_FADE_DIR_OUT diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c index c12029035..d844644a2 100644 --- a/src/code/z_fbdemo_triforce.c +++ b/src/code/z_fbdemo_triforce.c @@ -1,6 +1,5 @@ #include "transition_triforce.h" -#include "global.h" #include "printf.h" #include "assets/code/fbdemo_triforce/z_fbdemo_triforce.c" diff --git a/src/code/z_fcurve_data.c b/src/code/z_fcurve_data.c index a1c03a927..a1950a568 100644 --- a/src/code/z_fcurve_data.c +++ b/src/code/z_fcurve_data.c @@ -2,7 +2,6 @@ * File: z_fcurve_data.c * Description: Interpolation functions for use with Curve SkelAnime */ -#include "global.h" #include "z64curve.h" #define FCURVE_INTERP_CUBIC 0 // Interpolate using a Hermite cubic spline diff --git a/src/code/z_frame_advance.c b/src/code/z_frame_advance.c index 5c8f685f2..6ca410a75 100644 --- a/src/code/z_frame_advance.c +++ b/src/code/z_frame_advance.c @@ -4,7 +4,6 @@ #include "controller.h" #include "libu64/pad.h" -#include "macros.h" void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) { frameAdvCtx->timer = 0; diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index e05bcff26..f73616116 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -8,9 +8,6 @@ #include "z64play.h" #include "z64save.h" -#include "macros.h" -#include "global.h" - void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; } diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 86c896e62..4413e8ae6 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -9,9 +9,6 @@ #include "translation.h" #include "ultra64.h" -#include "global.h" -#include "macros.h" - #define MARKER_ESCAPE 0x00 #define MARKER_SOI 0xD8 #define MARKER_SOF 0xC0 diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index efecef646..d9bca732e 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -8,8 +8,6 @@ #include "translation.h" #include "z64play.h" -#include "macros.h" - #define KALEIDO_OVERLAY(name, nameString) \ { NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, } diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index b50cc0f86..2707db826 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -10,8 +10,6 @@ #include "translation.h" #include "z64play.h" -#include "global.h" - void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); f32 gBossMarkScale; diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 0996a1a6e..89f5bbd3b 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -8,8 +8,6 @@ #include "z64font.h" #include "z64message.h" -#include "macros.h" - /** * Loads a texture from kanji for the requested `character` into the character texture buffer * at `codePointIndex`. The value of `character` is the SHIFT-JIS encoding of the character. diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 741c982e0..e4d56b8da 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -3,7 +3,6 @@ #include "ichain.h" #include "printf.h" #include "regs.h" -#include "macros.h" #include "sys_math.h" #include "rand.h" #include "sfx.h" diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index 6751bcbee..513a61b31 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -2,8 +2,6 @@ #include "printf.h" #include "translation.h" -#include "global.h" - #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 #define LOG_SEVERITY_VERBOSE 3 diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index ee93a9a29..e46c70bd1 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -17,8 +17,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/textures/parameter_static/parameter_static.h" diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 1bccd2921..402d942d6 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -16,8 +16,6 @@ #include "assets/textures/parameter_static/parameter_static.h" -#include "global.h" - typedef struct MapMarkInfo { /* 0x00 */ void* texture; /* 0x04 */ u32 imageFormat; diff --git a/src/code/z_message.c b/src/code/z_message.c index 38153dff0..046d3ff88 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -24,8 +24,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/parameter_static/parameter_static.h" #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 ntsc-1.0:32" \ diff --git a/src/code/z_moji.c b/src/code/z_moji.c index 2114996cb..e26ce68e7 100644 --- a/src/code/z_moji.c +++ b/src/code/z_moji.c @@ -3,10 +3,7 @@ */ #include "gfx.h" - -#include "macros.h" #include "printf.h" -#include "global.h" // how big to draw the characters on screen #define DISP_CHAR_WIDTH 8 diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 078567510..1498db0fb 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -25,8 +25,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/do_action_static/do_action_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" diff --git a/src/code/z_play.c b/src/code/z_play.c index 31dbc765c..d4d28422c 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -47,8 +47,6 @@ #include "z64save.h" #include "z64vis.h" -#include "global.h" - #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:224" \ "ntsc-1.0:240 ntsc-1.1:240 ntsc-1.2:240 pal-1.0:240 pal-1.1:240" diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index 6d50f4106..6bf73b057 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -7,9 +7,6 @@ #include "versions.h" #include "vi_mode.h" -#include "macros.h" -#include "global.h" - void func_80092320(PreNMIState* this) { this->state.running = false; this->state.init = NULL; diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c index 17ef0b78c..3c45d7e54 100644 --- a/src/code/z_prenmi_buff.c +++ b/src/code/z_prenmi_buff.c @@ -1,5 +1,4 @@ #include "prenmi_buff.h" -#include "global.h" #define COLD_RESET 0 #define NMI 1 diff --git a/src/code/z_quake.c b/src/code/z_quake.c index cacb5a213..d3ba17810 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,6 +1,5 @@ #include "libc64/qrand.h" #include "array_count.h" -#include "macros.h" #include "printf.h" #include "quake.h" #include "terminal.h" diff --git a/src/code/z_sfx_source.c b/src/code/z_sfx_source.c index 9dda34ce3..785afcde3 100644 --- a/src/code/z_sfx_source.c +++ b/src/code/z_sfx_source.c @@ -5,8 +5,6 @@ #include "z64play.h" #include "z64skin_matrix.h" -#include "global.h" - void SfxSource_InitAll(PlayState* play) { SfxSource* sources = &play->sfxSources[0]; s32 i; diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 9e79abcbf..4e4fd97e9 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -14,8 +14,6 @@ #include "z64animation_legacy.h" #include "z64play.h" -#include "macros.h" - #define ANIM_INTERP 1 s32 LinkAnimation_Loop(PlayState* play, SkelAnime* skelAnime); diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 5e9edf45e..36d7a0279 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -6,8 +6,6 @@ #include "translation.h" #include "z_lib.h" -#include "macros.h" - // clang-format off MtxF sMtxFClear = { 1.0f, 0.0f, 0.0f, 0.0f, diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 456e7a822..2eef6db03 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -17,8 +17,6 @@ #include "z64scene.h" #include "z64ss_sram.h" -#include "global.h" - #define SLOT_SIZE (sizeof(SaveContext) + 0x28) #define CHECKSUM_SIZE (sizeof(Save) / 2) diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c index 809786245..94e97639a 100644 --- a/src/code/z_ss_sram.c +++ b/src/code/z_ss_sram.c @@ -2,9 +2,6 @@ #include "printf.h" #include "z64ss_sram.h" -#include "macros.h" -#include "global.h" - typedef struct SsSramContext { /* 0x00 */ OSPiHandle piHandle; /* 0x74 */ OSIoMesg ioMesg; diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index 877a789c6..6eceeaa7e 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -9,9 +9,6 @@ #include "regs.h" #include "versions.h" -#include "global.h" -#include "macros.h" - void ViMode_LogPrint(OSViMode* osViMode) { LOG_ADDRESS("osvimodep", osViMode, "../z_vimode.c", 87); LOG_HEX32("osvimodep->comRegs.ctrl", osViMode->comRegs.ctrl, "../z_vimode.c", 88); diff --git a/src/code/z_viscvg.c b/src/code/z_viscvg.c index 5fff1a460..51fc6f8e5 100644 --- a/src/code/z_viscvg.c +++ b/src/code/z_viscvg.c @@ -23,8 +23,6 @@ #include "gfx.h" #include "z64vis.h" -#include "macros.h" - /** * Draws only coverage: does not retain any of the original pixel RGB, primColor is used as background color. */ diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index e3cecda5c..517f2ada6 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -15,8 +15,6 @@ #include "gfxalloc.h" #include "z64vis.h" -#include "macros.h" - // Height of the fragments the color frame buffer (CFB) is split into. // It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into // the half of TMEM dedicated to color-indexed data. diff --git a/src/code/z_viszbuf.c b/src/code/z_viszbuf.c index 8f8265bfd..431d7f6d9 100644 --- a/src/code/z_viszbuf.c +++ b/src/code/z_viszbuf.c @@ -35,8 +35,6 @@ #include "gfx.h" #include "z64vis.h" -#include "macros.h" - // Height of the fragments the z-buffer is split into. // It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into TMEM. #define VISZBUF_ZBUFFRAG_HEIGHT (TMEM_SIZE / (SCREEN_WIDTH * G_IM_SIZ_16b_BYTES)) diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index f0ef9b008..2fa2122ac 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -10,8 +10,6 @@ #include "z64play.h" #include "z64save.h" -#include "global.h" - typedef struct SkyboxFaceParams { /* 0x000 */ s32 xStart; /* 0x004 */ s32 yStart; diff --git a/src/libc64/__osMalloc_gc.c b/src/libc64/__osMalloc_gc.c index a14894cfe..d6e4e17d1 100644 --- a/src/libc64/__osMalloc_gc.c +++ b/src/libc64/__osMalloc_gc.c @@ -6,8 +6,6 @@ #include "terminal.h" #include "translation.h" -#include "global.h" - #define FILL_ALLOC_BLOCK_FLAG (1 << 0) #define FILL_FREE_BLOCK_FLAG (1 << 1) #define CHECK_FREE_BLOCK_FLAG (1 << 2) diff --git a/src/libc64/__osMalloc_n64.c b/src/libc64/__osMalloc_n64.c index bb7945a5a..6b8121296 100644 --- a/src/libc64/__osMalloc_n64.c +++ b/src/libc64/__osMalloc_n64.c @@ -4,8 +4,6 @@ #include "fault.h" #include "translation.h" -#include "global.h" - #define NODE_MAGIC 0x7373 #define NODE_IS_VALID(node) ((node)->magic == NODE_MAGIC) diff --git a/src/libc64/malloc.c b/src/libc64/malloc.c index 545c86a62..8b9c9b670 100644 --- a/src/libc64/malloc.c +++ b/src/libc64/malloc.c @@ -5,8 +5,6 @@ #include "translation.h" #include "ultra64.h" -#include "macros.h" - #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 #define LOG_SEVERITY_VERBOSE 3 diff --git a/src/libc64/math64.c b/src/libc64/math64.c index f2a6edba9..b51eb333e 100644 --- a/src/libc64/math64.c +++ b/src/libc64/math64.c @@ -1,6 +1,5 @@ #include "libc64/math64.h" #include "z64math.h" -#include "macros.h" #if !PLATFORM_N64 s32 gUseAtanContFrac; diff --git a/src/libleo/leo/leofunc.c b/src/libleo/leo/leofunc.c index 8aaf794fd..35ba14005 100644 --- a/src/libleo/leo/leofunc.c +++ b/src/libleo/leo/leofunc.c @@ -4,8 +4,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - static s32 __leoResetCalled = false; static s32 __leoQueuesCreated = false; diff --git a/src/libleo/leo/leoutil.c b/src/libleo/leo/leoutil.c index 44240b055..e90ea1f67 100644 --- a/src/libleo/leo/leoutil.c +++ b/src/libleo/leo/leoutil.c @@ -4,8 +4,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - u16 leoLba_to_phys(u32 lba) { u16 vzone_num; u16 zone_slba; diff --git a/src/libu64/debug.c b/src/libu64/debug.c index 127820696..e1ed15fe4 100644 --- a/src/libu64/debug.c +++ b/src/libu64/debug.c @@ -3,8 +3,6 @@ #include "terminal.h" #include "translation.h" -#include "global.h" - #if PLATFORM_N64 || DEBUG_FEATURES f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min, const char* maxName, f32 max) { diff --git a/src/libu64/gfxprint.c b/src/libu64/gfxprint.c index 579e011f7..c47d52a3a 100644 --- a/src/libu64/gfxprint.c +++ b/src/libu64/gfxprint.c @@ -3,8 +3,6 @@ #include "attributes.h" #include "translation.h" -#include "macros.h" - u16 sGfxPrintFontTLUT[64] = { 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, diff --git a/src/libu64/load_gc.c b/src/libu64/load_gc.c index b39593d78..340780a13 100644 --- a/src/libu64/load_gc.c +++ b/src/libu64/load_gc.c @@ -4,8 +4,6 @@ #include "translation.h" #include "z64dma.h" -#include "macros.h" - size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) { s32 pad[3]; uintptr_t end; diff --git a/src/libu64/loadfragment2_gc.c b/src/libu64/loadfragment2_gc.c index e20fcefff..5ad556e50 100644 --- a/src/libu64/loadfragment2_gc.c +++ b/src/libu64/loadfragment2_gc.c @@ -2,8 +2,6 @@ #include "libu64/overlay.h" #include "printf.h" -#include "macros.h" - void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) { void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31); diff --git a/src/libu64/loadfragment2_n64.c b/src/libu64/loadfragment2_n64.c index 76ca03046..be0e5295d 100644 --- a/src/libu64/loadfragment2_n64.c +++ b/src/libu64/loadfragment2_n64.c @@ -11,8 +11,6 @@ #include "translation.h" #include "z64dma.h" -#include "macros.h" - s32 gOverlayLogSeverity = 2; // Extract MIPS register rs from an instruction word diff --git a/src/libu64/rcp_utils.c b/src/libu64/rcp_utils.c index f3a6ae32c..27e929f7d 100644 --- a/src/libu64/rcp_utils.c +++ b/src/libu64/rcp_utils.c @@ -2,8 +2,6 @@ #include "ultra64.h" #include "printf.h" -#include "global.h" - #if PLATFORM_N64 || DEBUG_FEATURES #define RCP_UTILS_PRINTF osSyncPrintf #elif IDO_PRINTF_WORKAROUND diff --git a/src/libu64/relocation_gc.c b/src/libu64/relocation_gc.c index 049c961fd..91d7eaf79 100644 --- a/src/libu64/relocation_gc.c +++ b/src/libu64/relocation_gc.c @@ -11,8 +11,6 @@ #include "printf.h" #include "ultra64.h" -#include "macros.h" - // Extract MIPS register rs from an instruction word #define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F) diff --git a/src/libu64/stackcheck.c b/src/libu64/stackcheck.c index 8c65d87d1..69fe224ee 100644 --- a/src/libu64/stackcheck.c +++ b/src/libu64/stackcheck.c @@ -5,8 +5,6 @@ #include "terminal.h" #include "translation.h" -#include "macros.h" - StackEntry* sStackInfoListStart = NULL; StackEntry* sStackInfoListEnd = NULL; diff --git a/src/libultra/io/contpfs.c b/src/libultra/io/contpfs.c index c99c31682..0506ca5d5 100644 --- a/src/libultra/io/contpfs.c +++ b/src/libultra/io/contpfs.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - s32 __osPfsInodeCacheChannel = -1; u8 __osPfsInodeCacheBank = 250; diff --git a/src/libultra/io/contreaddata.c b/src/libultra/io/contreaddata.c index 56ebf0a09..bafb2ad40 100644 --- a/src/libultra/io/contreaddata.c +++ b/src/libultra/io/contreaddata.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - s32 osContStartReadData(OSMesgQueue* mq) { s32 ret; diff --git a/src/libultra/io/controller.c b/src/libultra/io/controller.c index 97a33dc00..588e2ae9a 100644 --- a/src/libultra/io/controller.c +++ b/src/libultra/io/controller.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - OSPifRam __osContPifRam; u8 __osContLastCmd; u8 __osMaxControllers; // always 4 diff --git a/src/libultra/io/piacs.c b/src/libultra/io/piacs.c index 3b9af6d40..84cc4246b 100644 --- a/src/libultra/io/piacs.c +++ b/src/libultra/io/piacs.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - u32 __osPiAccessQueueEnabled = false; static OSMesg piAccessBuf[1]; OSMesgQueue __osPiAccessQueue; diff --git a/src/libultra/io/siacs.c b/src/libultra/io/siacs.c index 480efd31a..8359c1bdd 100644 --- a/src/libultra/io/siacs.c +++ b/src/libultra/io/siacs.c @@ -1,8 +1,6 @@ #include "array_count.h" #include "ultra64.h" -#include "macros.h" - static OSMesg siAccessBuf[1]; OSMesgQueue __osSiAccessQueue; u32 __osSiAccessQueueEnabled = false; diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index 1caf997d4..b4857c334 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -3,8 +3,6 @@ #include "stack.h" #include "ultra64.h" -#include "macros.h" - static OSThread viThread; static STACK(viThreadStack, 0x1000); static OSMesgQueue viEventQueue; diff --git a/src/n64dd/n64dd_801C8940.c b/src/n64dd/n64dd_801C8940.c index a0f975c23..132222b68 100644 --- a/src/n64dd/n64dd_801C8940.c +++ b/src/n64dd/n64dd_801C8940.c @@ -4,8 +4,6 @@ #include "libc64/sleep.h" #include "attributes.h" -#include "global.h" - s32 D_801D2EA0 = 0; u8* D_801D2EA4 = NULL; s32 D_801D2EA8 = 0; diff --git a/src/n64dd/n64dd_801C9440.c b/src/n64dd/n64dd_801C9440.c index 2d0b1b5c0..ecab855d4 100644 --- a/src/n64dd/n64dd_801C9440.c +++ b/src/n64dd/n64dd_801C9440.c @@ -1,5 +1,4 @@ // Some text-handling functions -#include "global.h" #include "n64dd.h" #include "versions.h" diff --git a/src/n64dd/n64dd_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c index a98634622..e3ba1be18 100644 --- a/src/n64dd/n64dd_801CA0B0.c +++ b/src/n64dd/n64dd_801CA0B0.c @@ -4,8 +4,6 @@ #include "attributes.h" #include "array_count.h" -#include "global.h" - // Draws text to framebuffer typedef struct struct_801CA704 { /* 0x00 */ PrintCallback callback; diff --git a/src/n64dd/n64dd_data_buffer.c b/src/n64dd/n64dd_data_buffer.c index 6aacae2d5..d4dfeb336 100644 --- a/src/n64dd/n64dd_data_buffer.c +++ b/src/n64dd/n64dd_data_buffer.c @@ -1,4 +1,3 @@ -#include "global.h" #include "n64dd.h" // Buffer used for reading from the disk? diff --git a/src/n64dd/n64dd_error_bodies.c b/src/n64dd/n64dd_error_bodies.c index 757e1afb6..9c990d76b 100644 --- a/src/n64dd/n64dd_error_bodies.c +++ b/src/n64dd/n64dd_error_bodies.c @@ -1,4 +1,3 @@ -#include "global.h" #include "n64dd.h" const char* D_801D2EE0[2][8][4] = { diff --git a/src/n64dd/n64dd_error_headers.c b/src/n64dd/n64dd_error_headers.c index b14d80fba..ee7d611c2 100644 --- a/src/n64dd/n64dd_error_headers.c +++ b/src/n64dd/n64dd_error_headers.c @@ -1,4 +1,3 @@ -#include "global.h" #include "n64dd.h" // Padding in .rodata suggests that these are in a separate file diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 6ef8c9250..3764381c1 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -11,7 +11,6 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" -#include "macros.h" #include "one_point_cutscene.h" #include "rand.h" #include "rumble.h" diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 1113a3926..c8e6e1545 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -34,8 +34,6 @@ #include "z64save.h" #include "z64skin_matrix.h" -#include "global.h" - #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_mo/object_mo.h" diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 15ce25734..2d741172b 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -23,8 +23,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" #include "assets/objects/object_fr/object_fr.h" diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index cb120b20c..0d03f7230 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -23,10 +23,6 @@ #include "z64player.h" #include "z64save.h" -#if PLATFORM_N64 -#include "global.h" -#endif - #include "assets/objects/object_zl2/object_zl2.h" #include "assets/objects/object_zl2_anime1/object_zl2_anime1.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 63b1e2401..c3d9302ee 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -7,7 +7,6 @@ #include "gfx_setupdl.h" #include "language_array.h" #include "letterbox.h" -#include "macros.h" #include "main.h" #include "map_select_state.h" #include "memory_utils.h" @@ -34,8 +33,6 @@ #include "z64ss_sram.h" #include "z64view.h" -#include "global.h" - #if OOT_PAL_N64 #include "assets/objects/object_mag/object_mag.h" #endif diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index dc3987acd..03fb5d0f1 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -9,8 +9,6 @@ #include "z64save.h" #include "z64sram.h" -#include "macros.h" - // In iQue versions, this file contains many workarounds for EGCS internal // compiler errors (see docs/compilers.md) diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index 77de467bf..bc7ae7edc 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -16,9 +16,6 @@ #include "z64audio.h" #include "z64save.h" -#include "macros.h" -#include "global.h" - #include "assets/textures/title_static/title_static.h" #include "assets/overlays/ovl_file_choose/ovl_file_choose.h" diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index 79f76c861..84b1cb69a 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -29,8 +29,6 @@ #include "z64save.h" #include "z64sram.h" -#include "macros.h" - void MapSelect_LoadTitle(MapSelectState* this) { this->state.running = false; SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, ConsoleLogoState); diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index bf5029cb2..588588b24 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -29,8 +29,6 @@ #include "z64environment.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h" #if DEBUG_FEATURES diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 2729bf54e..2f086413b 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -10,8 +10,6 @@ #include "z64play.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index d6a8af68f..c090b77fb 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -12,8 +12,6 @@ #include "z64play.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/icon_item_24_static/icon_item_24_static.h" #if OOT_NTSC #include "assets/textures/icon_item_jpn_static/icon_item_jpn_static.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index d07720d12..2e4bda50c 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -27,8 +27,6 @@ #include "z64player.h" #include "z64save.h" -#include "global.h" - #include "assets/textures/icon_item_static/icon_item_static.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" #if OOT_NTSC diff --git a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 126ceca4f..ec2c566ec 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -7,8 +7,6 @@ #include "z_lib.h" #include "z64play.h" -#include "global.h" - #include "assets/textures/parameter_static/parameter_static.h" typedef struct PauseMapMarkInfo { diff --git a/tools/ZAPD/ZAPD/ZFile.cpp b/tools/ZAPD/ZAPD/ZFile.cpp index e59c50e67..281e6132f 100644 --- a/tools/ZAPD/ZAPD/ZFile.cpp +++ b/tools/ZAPD/ZAPD/ZFile.cpp @@ -810,7 +810,6 @@ void ZFile::GenerateSourceFiles() sourceOutput += "#include \"ultra64.h\"\n"; sourceOutput += "#include \"z64.h\"\n"; - sourceOutput += "#include \"macros.h\"\n"; sourceOutput += GetHeaderInclude(); bool hasZRoom = false;