summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-08-15 04:05:41 +0200
committerGitHub <noreply@github.com>2024-08-14 22:05:41 -0400
commitfda0e6ad4badc0eea701934b80354de4ab5cad98 (patch)
tree634adcb23f9c65f1bfeb005d7b842c2454aade1c /src/code
parentd3b9ba17da552430ffb5a5a766b8489bd4156f39 (diff)
[ntsc-1.2] Match z_construct.c, z_draw.c, z_kaleido_setup.c and partially z_actor.c (#2039)
* func_80033C30 * Interface_Init * z_draw.c * KaleidoSetup_Destroy , n64dd.h * z_kaleido_setup.c * add n64dd files to spec according to tools/disasm/ntsc-1.2/files_code.csv , they're between irqmgr.o and fault.o putting them before or after malloc_debug.o in the spec is an arbitrary choice
Diffstat (limited to 'src/code')
-rw-r--r--src/code/code_n64dd_800AD4C0.c2
-rw-r--r--src/code/z_actor.c2
-rw-r--r--src/code/z_construct.c16
-rw-r--r--src/code/z_draw.c24
-rw-r--r--src/code/z_kaleido_setup.c21
5 files changed, 45 insertions, 20 deletions
diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c
index 8b1378917..f75d79f5e 100644
--- a/src/code/code_n64dd_800AD4C0.c
+++ b/src/code/code_n64dd_800AD4C0.c
@@ -1 +1,3 @@
+#include "n64dd.h"
+n64ddStruct_80121AF0* B_80121AF0;
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index cde373de5..89dd9400c 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -3685,8 +3685,6 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 8120);
- if (0) {} // Necessary to match
-
POLY_OPA_DISP = Gfx_SetupDL(POLY_OPA_DISP, SETUPDL_44);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, alpha);
diff --git a/src/code/z_construct.c b/src/code/z_construct.c
index f9bfa5efd..a7bd1a658 100644
--- a/src/code/z_construct.c
+++ b/src/code/z_construct.c
@@ -177,16 +177,20 @@ void Interface_Init(PlayState* play) {
interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0;
R_ITEM_BTN_X(0) = B_BUTTON_X;
- R_B_BTN_COLOR(0) = 255;
- R_B_BTN_COLOR(1) = 30;
- R_B_BTN_COLOR(2) = 30;
+
+ R_B_BTN_COLOR(0) = B_BUTTON_R;
+ R_B_BTN_COLOR(1) = B_BUTTON_G;
+ R_B_BTN_COLOR(2) = B_BUTTON_B;
+
R_ITEM_ICON_X(0) = B_BUTTON_X;
R_ITEM_AMMO_X(0) = B_BUTTON_X + 2;
+
R_A_BTN_X = A_BUTTON_X;
R_A_ICON_X = A_BUTTON_X;
- R_A_BTN_COLOR(0) = 0;
- R_A_BTN_COLOR(1) = 200;
- R_A_BTN_COLOR(2) = 50;
+
+ R_A_BTN_COLOR(0) = A_BUTTON_R;
+ R_A_BTN_COLOR(1) = A_BUTTON_G;
+ R_A_BTN_COLOR(2) = A_BUTTON_B;
}
#define TEXTBOX_SEGMENT_SIZE \
diff --git a/src/code/z_draw.c b/src/code/z_draw.c
index d6d988676..b4ecd2ffa 100644
--- a/src/code/z_draw.c
+++ b/src/code/z_draw.c
@@ -519,14 +519,14 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) {
}
void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) {
- s32 pad;
+ DrawItemTableEntry* entry = &sDrawItemTable[drawId];
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772);
Gfx_SetupDL_26Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
- gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
+ gSPDisplayList(POLY_OPA_DISP++, entry->dlists[0]);
+ gSPDisplayList(POLY_OPA_DISP++, entry->dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 783);
}
@@ -664,14 +664,14 @@ void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) {
}
void GetItem_DrawXlu01(PlayState* play, s16 drawId) {
- s32 pad;
+ DrawItemTableEntry* entry = &sDrawItemTable[drawId];
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
- gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
+ gSPDisplayList(POLY_XLU_DISP++, entry->dlists[0]);
+ gSPDisplayList(POLY_XLU_DISP++, entry->dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1008);
}
@@ -801,20 +801,20 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) {
}
void GetItem_DrawBulletBag(PlayState* play, s16 drawId) {
- s32 pad;
+ DrawItemTableEntry* entry = &sDrawItemTable[drawId];
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
- gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
+ gSPDisplayList(POLY_OPA_DISP++, entry->dlists[1]);
+ gSPDisplayList(POLY_OPA_DISP++, entry->dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
- gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
- gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]);
+ gSPDisplayList(POLY_XLU_DISP++, entry->dlists[2]);
+ gSPDisplayList(POLY_XLU_DISP++, entry->dlists[3]);
+ gSPDisplayList(POLY_XLU_DISP++, entry->dlists[4]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207);
}
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c
index 3148d6fb5..1f4f2d2cd 100644
--- a/src/code/z_kaleido_setup.c
+++ b/src/code/z_kaleido_setup.c
@@ -1,4 +1,7 @@
#include "global.h"
+#if PLATFORM_N64
+#include "n64dd.h"
+#endif
/*
* The following three arrays are effectively unused.
@@ -57,6 +60,9 @@ f32 sKaleidoSetupRightPageEyeZ[] = {
void KaleidoSetup_Update(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
Input* input = &play->state.input[0];
+#if PLATFORM_N64
+ s32 pad;
+#endif
if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF &&
@@ -169,7 +175,22 @@ void KaleidoSetup_Init(PlayState* play) {
pauseCtx->cursorSpecialPos = 0;
View_Init(&pauseCtx->view, play->state.gfxCtx);
+
+#if PLATFORM_N64
+ if (B_80121AF0 != NULL) {
+ if (B_80121AF0->unk_3C != NULL) {
+ B_80121AF0->unk_3C();
+ }
+ }
+#endif
}
void KaleidoSetup_Destroy(PlayState* play) {
+#if PLATFORM_N64
+ if (B_80121AF0 != NULL) {
+ if (B_80121AF0->unk_40 != NULL) {
+ B_80121AF0->unk_40();
+ }
+ }
+#endif
}