diff --git a/include/n64dd.h b/include/n64dd.h new file mode 100644 index 0000000000..d35311a123 --- /dev/null +++ b/include/n64dd.h @@ -0,0 +1,12 @@ +#ifndef N64DD_H +#define N64DD_H + +typedef struct n64ddStruct_80121AF0 { + char unk_00[0x3C]; + void (*unk_3C)(void); + void (*unk_40)(void); +} n64ddStruct_80121AF0; // size = ? + +extern n64ddStruct_80121AF0* B_80121AF0; + +#endif diff --git a/include/z64interface.h b/include/z64interface.h index e3b533970f..ba8630ab3f 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -144,14 +144,34 @@ typedef struct InterfaceContext { } InterfaceContext; // size = 0x270 /** - * Button HUD Positions (Upper Left) + * Button HUD positions and colors */ #define A_BUTTON_X 186 #define A_BUTTON_Y 9 +#if PLATFORM_N64 +#define A_BUTTON_R 90 +#define A_BUTTON_G 90 +#define A_BUTTON_B 255 +#else +#define A_BUTTON_R 0 +#define A_BUTTON_G 200 +#define A_BUTTON_B 50 +#endif + #define B_BUTTON_X 160 #define B_BUTTON_Y 17 +#if PLATFORM_N64 +#define B_BUTTON_R 0 +#define B_BUTTON_G 150 +#define B_BUTTON_B 0 +#else +#define B_BUTTON_R 255 +#define B_BUTTON_G 30 +#define B_BUTTON_B 30 +#endif + #define C_LEFT_BUTTON_X 227 #define C_LEFT_BUTTON_Y 18 diff --git a/spec b/spec index 83eefc5c6f..c821e8b298 100644 --- a/spec +++ b/spec @@ -480,6 +480,10 @@ beginseg include "$(BUILD_DIR)/src/code/sys_rumble.o" include "$(BUILD_DIR)/src/code/code_800D31A0.o" include "$(BUILD_DIR)/src/code/irqmgr.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/code/code_n64dd_800AD410.o" + include "$(BUILD_DIR)/src/code/code_n64dd_800AD4C0.o" +#endif #if OOT_DEBUG include "$(BUILD_DIR)/src/code/debug_malloc.o" #endif diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c index 8b13789179..f75d79f5ef 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 cde373de56..89dd9400c7 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 f9bfa5efdc..a7bd1a6583 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 d6d9886768..b4ecd2ffaf 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 3148d6fb58..1f4f2d2cda 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 }