summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2024-06-23 17:51:44 +0100
committerGitHub <noreply@github.com>2024-06-23 12:51:44 -0400
commit3682a13ec55f84eecf8b16aa7e32bda7bcf9bdfc (patch)
tree45b87f464a1b6adffe36dd25711c611ac8c046ca /src
parent4c201ff47f65571d8d1d719229431d46995d8a7e (diff)
Format gbi.h, move ucode defines to makefile (#1650)
* Format gbi.h, move ucode defines to makefile, correct usage of gDPSetDither * UCODE_DEFS -> GBI_DEFINES, add GBI_DOWHILE toggle * Define GBI_DOWHILE for bss calculations * Makefile thing
Diffstat (limited to 'src')
-rw-r--r--src/code/sys_math3d.c21
-rw-r--r--src/code/z_bgcheck.c1
-rw-r--r--src/code/z_lights.c2
-rw-r--r--src/code/z_map_disp.c1
-rw-r--r--src/code/z_message.c1
-rw-r--r--src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c2
-rw-r--r--src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c2
-rw-r--r--src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c2
-rw-r--r--src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c2
-rw-r--r--src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c1
-rw-r--r--src/overlays/actors/ovl_En_Osk/z_en_osk.c2
-rw-r--r--src/overlays/actors/ovl_En_Ot/z_en_ot.c2
-rw-r--r--src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c1
14 files changed, 30 insertions, 12 deletions
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index ad617e50f..b5048e523 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -1,6 +1,6 @@
-#include "prevent_bss_reordering.h"
+#include "prevent_bss_reordering2.h" // bumps the bss index by 65
// clang-format off
-// Partial structs taken from "prevent_bss_reordering.h"
+// Partial structs taken from "prevent_bss_reordering.h", bumps the bss index by 56
struct Dummy200 { int x; };
struct Dummy201 { int x; };
struct Dummy202 { int x; };
@@ -14,12 +14,29 @@ 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; };
+struct Dummy218 { int x; };
+struct Dummy219 { int x; };
+struct Dummy220 { int x; };
+struct Dummy221 { int x; };
+struct Dummy222 { int x; };
+struct Dummy223 { int x; };
+struct Dummy224 { int x; };
+struct Dummy225 { int x; };
+struct Dummy226 { int x; };
+struct Dummy227 { int x; };
// clang-format on
+// Headers are currently valued at 63 mod 256 (./tools/calc_bss.sh <headers>)
#include "z64math.h"
#include "libc/stdbool.h"
#include "PR/gu.h"
+// The bss index at this point should be 184
Vec3f gZeroVec3f = { 0.0f, 0.0f, 0.0f };
Vec3s gZeroVec3s = { 0, 0, 0 };
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index a73878099..060954255 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "z64bgcheck.h"
#include "libc64/fixed_point.h"
diff --git a/src/code/z_lights.c b/src/code/z_lights.c
index c04a08593..81b4e47f3 100644
--- a/src/code/z_lights.c
+++ b/src/code/z_lights.c
@@ -428,7 +428,7 @@ void Lights_DrawGlow(PlayState* play) {
gfx = Gfx_SetupDL65_NoCD(POLY_XLU_DISP);
- gDPSetDither(gfx++, G_CD_NOISE);
+ gDPSetDither(gfx++, G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
diff --git a/src/code/z_map_disp.c b/src/code/z_map_disp.c
index 6ab61fcf7..7fbae707d 100644
--- a/src/code/z_map_disp.c
+++ b/src/code/z_map_disp.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
#include "gfx.h"
#include "sys_cmpdma.h"
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 8cb55ef1f..b4bda662a 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "z64message.h"
#include "global.h"
diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
index 2e071f823..4705107fe 100644
--- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
+++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
@@ -1083,7 +1083,7 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) {
gDPSetEnvColor(POLY_XLU_DISP++, (u8)(s8)this->unk_250.r, (u8)(s8)this->unk_250.g, (u8)(s8)this->unk_250.b,
(u8)(s8)((f32)phi_a0 * 1));
- gDPSetDither(POLY_XLU_DISP++, G_CD_BAYER);
+ gDPSetDither(POLY_XLU_DISP++, G_AD_PATTERN | G_CD_BAYER);
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
DmChar00_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
index 484592584..1acce5161 100644
--- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
+++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
@@ -156,7 +156,7 @@ void DmChar04_Draw(Actor* thisx, PlayState* play) {
gSPEndDisplayList(gfx);
gDPSetEnvColor(POLY_XLU_DISP++, (u8)(s8)this->envColors.r, (u8)(s8)this->envColors.g, (u8)(s8)this->envColors.b,
(u8)(s8)((f32)alpha * 1));
- gDPSetDither(POLY_XLU_DISP++, G_CD_BAYER);
+ gDPSetDither(POLY_XLU_DISP++, G_AD_PATTERN | G_CD_BAYER);
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
DmChar04_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
index 38cde30b7..67e7b35c6 100644
--- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
+++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
@@ -5267,7 +5267,7 @@ void EnInvadepoh_Alien_Draw(Actor* thisx, PlayState* play2) {
gfx = POLY_XLU_DISP;
gfx = Gfx_SetupDL20_NoCD(gfx);
- gDPSetDither(gfx++, G_CD_NOISE);
+ gDPSetDither(gfx++, G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
index 828bd28d1..7cff76a48 100644
--- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
+++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
@@ -671,7 +671,7 @@ void EnInvadepohDemo_Alien_Draw(EnInvadepohDemo* this, PlayState* play) {
gfx = POLY_XLU_DISP;
gfx = Gfx_SetupDL20_NoCD(gfx);
- gDPSetDither(gfx++, G_CD_NOISE);
+ gDPSetDither(gfx++, G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
Matrix_Mult(&play->billboardMtxF, MTXMODE_NEW);
diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
index 2188ef36a..16e60b118 100644
--- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
+++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
@@ -4,7 +4,6 @@
* Description: Keaton grass
*/
-#include "prevent_bss_reordering.h"
#include "z_en_kusa2.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/gameplay_keep/gameplay_keep.h"
diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.c b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
index 082470c88..460823a66 100644
--- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c
+++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
@@ -630,7 +630,7 @@ void EnOsk_Draw(Actor* thisx, PlayState* play) {
gfx = POLY_XLU_DISP;
gfx = Gfx_SetupDL20_NoCD(gfx);
- gDPSetDither(gfx++, G_CD_NOISE);
+ gDPSetDither(gfx++, G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
gSPDisplayList(gfx++, gameplay_keep_DL_029CB0);
gDPSetPrimColor(gfx++, 0, 0, 130, 0, 255, 100);
diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
index f1e76a1db..89d32e6e2 100644
--- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c
+++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
@@ -1086,7 +1086,7 @@ void EnOt_Draw(Actor* thisx, PlayState* play) {
gfx = Gfx_SetupDL65_NoCD(POLY_XLU_DISP);
- gDPSetDither(&gfx[0], G_CD_NOISE);
+ gDPSetDither(&gfx[0], G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(&gfx[1], 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
gSPDisplayList(&gfx[2], gameplay_keep_DL_029CB0);
diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
index 7b0224159..ca502b27f 100644
--- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
+++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
@@ -701,7 +701,7 @@ void func_80B32F04(Actor* thisx, PlayState* play) {
gfx = POLY_XLU_DISP;
gfx = Gfx_SetupDL20_NoCD(gfx);
- gDPSetDither(gfx++, G_CD_NOISE);
+ gDPSetDither(gfx++, G_AD_PATTERN | G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
gSPDisplayList(gfx++, gameplay_keep_DL_029CB0);
diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
index 396fa6844..a794c8cd0 100644
--- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
+++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
@@ -3,7 +3,6 @@
* Overlay: ovl_Obj_Flowerpot
* Description: Breakable Pot With Grass
*/
-#include "prevent_bss_reordering.h"
#include "z_obj_flowerpot.h"
#include "objects/object_flowerpot/object_flowerpot.h"