1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-15 06:06:04 +00:00

[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
This commit is contained in:
Dragorn421 2024-08-15 04:05:41 +02:00 committed by GitHub
parent d3b9ba17da
commit fda0e6ad4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 82 additions and 21 deletions

12
include/n64dd.h Normal file
View file

@ -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

View file

@ -144,14 +144,34 @@ typedef struct InterfaceContext {
} InterfaceContext; // size = 0x270 } InterfaceContext; // size = 0x270
/** /**
* Button HUD Positions (Upper Left) * Button HUD positions and colors
*/ */
#define A_BUTTON_X 186 #define A_BUTTON_X 186
#define A_BUTTON_Y 9 #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_X 160
#define B_BUTTON_Y 17 #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_X 227
#define C_LEFT_BUTTON_Y 18 #define C_LEFT_BUTTON_Y 18

4
spec
View file

@ -480,6 +480,10 @@ beginseg
include "$(BUILD_DIR)/src/code/sys_rumble.o" include "$(BUILD_DIR)/src/code/sys_rumble.o"
include "$(BUILD_DIR)/src/code/code_800D31A0.o" include "$(BUILD_DIR)/src/code/code_800D31A0.o"
include "$(BUILD_DIR)/src/code/irqmgr.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 #if OOT_DEBUG
include "$(BUILD_DIR)/src/code/debug_malloc.o" include "$(BUILD_DIR)/src/code/debug_malloc.o"
#endif #endif

View file

@ -1 +1,3 @@
#include "n64dd.h"
n64ddStruct_80121AF0* B_80121AF0;

View file

@ -3685,8 +3685,6 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 8120); OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 8120);
if (0) {} // Necessary to match
POLY_OPA_DISP = Gfx_SetupDL(POLY_OPA_DISP, SETUPDL_44); POLY_OPA_DISP = Gfx_SetupDL(POLY_OPA_DISP, SETUPDL_44);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, alpha); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, alpha);

View file

@ -177,16 +177,20 @@ void Interface_Init(PlayState* play) {
interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0; interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0;
R_ITEM_BTN_X(0) = B_BUTTON_X; R_ITEM_BTN_X(0) = B_BUTTON_X;
R_B_BTN_COLOR(0) = 255;
R_B_BTN_COLOR(1) = 30; R_B_BTN_COLOR(0) = B_BUTTON_R;
R_B_BTN_COLOR(2) = 30; 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_ICON_X(0) = B_BUTTON_X;
R_ITEM_AMMO_X(0) = B_BUTTON_X + 2; R_ITEM_AMMO_X(0) = B_BUTTON_X + 2;
R_A_BTN_X = A_BUTTON_X; R_A_BTN_X = A_BUTTON_X;
R_A_ICON_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(0) = A_BUTTON_R;
R_A_BTN_COLOR(2) = 50; R_A_BTN_COLOR(1) = A_BUTTON_G;
R_A_BTN_COLOR(2) = A_BUTTON_B;
} }
#define TEXTBOX_SEGMENT_SIZE \ #define TEXTBOX_SEGMENT_SIZE \

View file

@ -519,14 +519,14 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) {
} }
void GetItem_DrawEggOrMedallion(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); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772);
Gfx_SetupDL_26Opa(play->state.gfxCtx); 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); 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++, entry->dlists[0]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, entry->dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 783); 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) { void GetItem_DrawXlu01(PlayState* play, s16 drawId) {
s32 pad; DrawItemTableEntry* entry = &sDrawItemTable[drawId];
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); 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); 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++, entry->dlists[0]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, entry->dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1008); 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) { void GetItem_DrawBulletBag(PlayState* play, s16 drawId) {
s32 pad; DrawItemTableEntry* entry = &sDrawItemTable[drawId];
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188);
Gfx_SetupDL_25Opa(play->state.gfxCtx); 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); 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++, entry->dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, entry->dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); 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); 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++, entry->dlists[2]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, entry->dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(POLY_XLU_DISP++, entry->dlists[4]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207);
} }

View file

@ -1,4 +1,7 @@
#include "global.h" #include "global.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
/* /*
* The following three arrays are effectively unused. * The following three arrays are effectively unused.
@ -57,6 +60,9 @@ f32 sKaleidoSetupRightPageEyeZ[] = {
void KaleidoSetup_Update(PlayState* play) { void KaleidoSetup_Update(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx; PauseContext* pauseCtx = &play->pauseCtx;
Input* input = &play->state.input[0]; Input* input = &play->state.input[0];
#if PLATFORM_N64
s32 pad;
#endif
if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE && if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF && play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF &&
@ -169,7 +175,22 @@ void KaleidoSetup_Init(PlayState* play) {
pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorSpecialPos = 0;
View_Init(&pauseCtx->view, play->state.gfxCtx); 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) { void KaleidoSetup_Destroy(PlayState* play) {
#if PLATFORM_N64
if (B_80121AF0 != NULL) {
if (B_80121AF0->unk_40 != NULL) {
B_80121AF0->unk_40();
}
}
#endif
} }