Skip to content

Commit

Permalink
Fix color text array and function (#689)
Browse files Browse the repository at this point in the history
* Fix color text array and function

* seg2 header
  • Loading branch information
AloXado320 authored Sep 26, 2024
1 parent eb90cd7 commit 1381235
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 208 deletions.
24 changes: 11 additions & 13 deletions src/code_80091750.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,12 @@ s32 D_800E84A0[] = {
};

Vtx* D_800E84C0[] = {
&D_02007BB8[0],
&D_02007BB8[18],
&D_02007BB8[36],
D_02007BB8,
D_02007CD8,
D_02007DF8,
};

#ifndef AVOID_UB
Gfx* D_800E84CC[] = {
D_02007838, D_02007858, D_02007878, D_02007898, D_020078B8, D_020078D8, D_020078F8, D_02007918,
};
Expand All @@ -950,6 +951,7 @@ Gfx* D_800E84EC[] = {
Gfx* D_800E850C[] = {
D_02007A38, D_02007A58, D_02007A78, D_02007A98, D_02007AB8, D_02007AD8, D_02007AF8, D_02007B18,
};
#endif

s8 D_800E852C = 1;

Expand Down Expand Up @@ -2513,13 +2515,9 @@ Gfx* func_800959F8(Gfx* displayListHead, Vtx* arg1) {
index = ((gTextColor * 2) + ((s32) gGlobalTimer % 2)) - 4;
}
#ifdef AVOID_UB
if (arg1 == D_02007BB8) {
gSPDisplayList(displayListHead++, D_800E84CC[index]);
} else if (arg1 == &D_02007BB8[18]) {
gSPDisplayList(displayListHead++, D_800E84EC[index]);
} else if (arg1 == &D_02007BB8[36]) {
gSPDisplayList(displayListHead++, D_800E850C[index]);
}
gSPVertex(displayListHead++, arg1, 2, 0);
gSPVertex(displayListHead++, &arg1[(index + 1) * 2], 2, 2);
gSPDisplayList(displayListHead++, common_rectangle_display);
#else
if (arg1 == D_02007BB8) {
gSPDisplayList(displayListHead++, D_800E84CC[index]);
Expand Down Expand Up @@ -2633,16 +2631,16 @@ Gfx* func_80095BD0(Gfx* displayListHead, u8* arg1, f32 arg2, f32 arg3, u32 arg4,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
switch (arg4) {
default:
var_a1 = &D_02007BB8[18];
var_a1 = D_02007CD8;
break;
case 16:
var_a1 = &D_02007BB8[18];
var_a1 = D_02007CD8;
break;
case 26:
var_a1 = D_02007BB8;
break;
case 30:
var_a1 = &D_02007BB8[36];
var_a1 = D_02007DF8;
break;
}

Expand Down
Loading

0 comments on commit 1381235

Please sign in to comment.