summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-06-14 21:47:24 -0700
committerGitHub <noreply@github.com>2024-06-14 21:47:24 -0700
commit3705eaedac1d21318ee708993d366b30cdc0e8ad (patch)
treecd56b6eaa2e9f1ce8ab7d1a945f25b74e4b4c766 /src
parent0b375cadb0af6f2d95844cc674f84be0b148ae10 (diff)
Small general cleanup (#1644)
* m2ctx.py * check warnings * vimode includes * bgcheck includes * padmgr includes * sprintf * z_std_dma * sys_ucode * z64voice * z64lib * z64effect_ss * segment_symbols.h * padutils * main * stdarg.h * fault * bzero * undefined_syms * z64rumble
Diffstat (limited to 'src')
-rw-r--r--src/boot/O2/padutils.c2
-rw-r--r--src/boot/libc64/sprintf.c3
-rw-r--r--src/boot/z_std_dma.c1
-rw-r--r--src/code/padmgr.c10
-rw-r--r--src/code/sys_ucode.c2
-rw-r--r--src/code/z_bgcheck.c2
-rw-r--r--src/code/z_camera.c1
-rw-r--r--src/code/z_demo.c22
-rw-r--r--src/code/z_vimode.c10
-rw-r--r--src/overlays/actors/ovl_Boss_01/z_boss_01.c1
10 files changed, 23 insertions, 31 deletions
diff --git a/src/boot/O2/padutils.c b/src/boot/O2/padutils.c
index 76bf91c0c..8460bc007 100644
--- a/src/boot/O2/padutils.c
+++ b/src/boot/O2/padutils.c
@@ -1,5 +1,7 @@
#include "padutils.h"
+#include "PR/os_libc.h"
+
void PadUtils_Init(Input* input) {
bzero(input, sizeof(Input));
}
diff --git a/src/boot/libc64/sprintf.c b/src/boot/libc64/sprintf.c
index 58f248414..a2cb2a7e1 100644
--- a/src/boot/libc64/sprintf.c
+++ b/src/boot/libc64/sprintf.c
@@ -1,5 +1,6 @@
#include "libc64/sprintf.h"
+#include "stdint.h"
#include "string.h"
void* proutPrintf(void* dst, const char* fmt, size_t size) {
@@ -20,7 +21,7 @@ int sprintf(char* dst, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
- ans = _Printf(&proutPrintf, dst, fmt, args);
+ ans = _Printf(proutPrintf, dst, fmt, args);
if (ans > -1) {
dst[ans] = 0;
}
diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c
index 71e64ad69..8e68eafff 100644
--- a/src/boot/z_std_dma.c
+++ b/src/boot/z_std_dma.c
@@ -18,6 +18,7 @@
* There are some additional provisions to ensure that audio DMA is particularly high-speed, the audio data is assumed
* to be uncompressed and the request queue and address translation is skipped.
*/
+#include "prevent_bss_reordering.h"
#include "z64dma.h"
#include "carthandle.h"
diff --git a/src/code/padmgr.c b/src/code/padmgr.c
index ec52c6fdd..f8da69762 100644
--- a/src/code/padmgr.c
+++ b/src/code/padmgr.c
@@ -31,11 +31,15 @@
* done while waiting for this operation to complete.
*/
-#include "global.h"
-#include "PR/controller.h"
-#include "PR/os_motor.h"
+#include "padmgr.h"
+
#include "libc64/sprintf.h"
+#include "PR/os_motor.h"
+
#include "fault.h"
+#include "macros.h"
+#include "main.h"
+#include "z64math.h"
#include "z64voice.h"
extern FaultMgr gFaultMgr;
diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c
index 068afb4cc..39ad9369d 100644
--- a/src/code/sys_ucode.c
+++ b/src/code/sys_ucode.c
@@ -5,6 +5,8 @@
#include "sys_ucode.h"
+#include "stdint.h"
+
u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index b27310b3f..7a4a86bcc 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -1,9 +1,9 @@
#include "z64bgcheck.h"
-#include "global.h"
#include "libc64/fixed_point.h"
#include "libc64/sprintf.h"
+#include "global.h"
#include "fault.h"
#include "vt.h"
#include "z64actor.h"
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index ad2170d5f..d27639858 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -43,7 +43,6 @@
*
*/
-#include "prevent_bss_reordering.h"
#include "global.h"
#include "string.h"
#include "z64malloc.h"
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index d7d0d1c33..7527cc3a1 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -14,28 +14,6 @@ static s16 sBssPad;
u8 gDisablePlayerCsActionStartPos;
s16 gDungeonBossWarpSceneId;
-// clang-format off
-// Partial structs taken from "prevent_bss_reordering.h"
-struct Dummy200 { int x; };
-struct Dummy201 { int x; };
-struct Dummy202 { int x; };
-struct Dummy203 { int x; };
-struct Dummy204 { int x; };
-struct Dummy205 { int x; };
-struct Dummy206 { int x; };
-struct Dummy207 { int x; };
-struct Dummy208 { int x; };
-struct Dummy209 { int x; };
-struct Dummy210 { int x; };
-struct Dummy211 { int x; };
-struct Dummy212 { int x; };
-struct Dummy213 { int x; };
-struct Dummy214 { int x; };
-struct Dummy215 { int x; };
-struct Dummy216 { int x; };
-struct Dummy217 { int x; };
-// clang-format on
-
#include "z64quake.h"
#include "z64rumble.h"
#include "z64shrink_window.h"
diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c
index 268d9756a..af272b686 100644
--- a/src/code/z_vimode.c
+++ b/src/code/z_vimode.c
@@ -1,8 +1,14 @@
-#include "global.h"
-#include "debug.h"
#include "z64vimode.h"
+
+#include "stdbool.h"
#include "PR/viint.h"
+#include "debug.h"
+#include "macros.h"
+#include "main.h"
+#include "padutils.h"
+#include "regs.h"
+
typedef struct {
/* 0x00 */ u32 burst;
/* 0x04 */ u32 vSync;
diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c
index d6de138da..b1d4245bb 100644
--- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c
+++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c
@@ -25,7 +25,6 @@
* to randomly select; these new wait actions are what allow him to summon a ring of fire, drop falling blocks, etc.
*/
-#include "prevent_bss_reordering.h"
#include "z_boss_01.h"
#include "z64rumble.h"
#include "z64shrink_window.h"