Put hookshot reticle on TITLE_CARD_DISP

Rename to WORLD_OVERLAY_DISP

Remove no-ops
This commit is contained in:
Sirius902 2022-04-29 13:21:47 -07:00 committed by louist103
parent f5d983d06b
commit 2425ffe27b
5 changed files with 24 additions and 27 deletions

View File

@ -126,12 +126,12 @@
extern GraphicsContext* __gfxCtx;
#define WORK_DISP __gfxCtx->work.p
#define POLY_OPA_DISP __gfxCtx->polyOpa.p
#define POLY_XLU_DISP __gfxCtx->polyXlu.p
#define TITLE_CARD_DISP __gfxCtx->titlecard.p
#define POLY_KAL_DISP __gfxCtx->polyKal.p
#define OVERLAY_DISP __gfxCtx->overlay.p
#define WORK_DISP __gfxCtx->work.p
#define POLY_OPA_DISP __gfxCtx->polyOpa.p
#define POLY_XLU_DISP __gfxCtx->polyXlu.p
#define WORLD_OVERLAY_DISP __gfxCtx->worldOverlay.p
#define POLY_KAL_DISP __gfxCtx->polyKal.p
#define OVERLAY_DISP __gfxCtx->overlay.p
// __gfxCtx shouldn't be used directly.
// Use the DISP macros defined above when writing to display buffers.

View File

@ -83,7 +83,7 @@ typedef struct {
/* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC
/* 0x00008 */ Gfx polyOpaBuffer[0x2FC0];
/* 0x0BF08 */ Gfx polyXluBuffer[0x1000];
/* 0xXXXXX */ Gfx titlecardBuffer[0x1000];
/* 0xXXXXX */ Gfx worldOverlayBuffer[0x1000];
/* 0x0BF08 */ Gfx polyKalBuffer[0x1000];
/* 0x0FF08 */ Gfx overlayBuffer[0x800];
/* 0x11F08 */ Gfx workBuffer[0x100];
@ -131,7 +131,7 @@ typedef struct OSScTask {
typedef struct GraphicsContext {
/* 0x0000 */ Gfx* polyOpaBuffer; // Pointer to "Zelda 0"
/* 0x0004 */ Gfx* polyXluBuffer; // Pointer to "Zelda 1"
/* 0xXXX */ Gfx* titlecardBuffer; // Pointer to "Paris"
/* 0xXXX */ Gfx* worldOverlayBuffer; // Pointer to "Paris"
/* 0xXXX */ Gfx* polyKalBuffer; // Pointer to "Rome"
/* 0x0008 */ char unk_008[0x08]; // Unused, could this be pointers to "Zelda 2" / "Zelda 3"
/* 0x0010 */ Gfx* overlayBuffer; // Pointer to "Zelda 4"
@ -151,7 +151,7 @@ typedef struct GraphicsContext {
/* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
/* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"
/* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1"
/* 0x0XXX */ TwoHeadGfxArena titlecard; // When in Paris...
/* 0x0XXX */ TwoHeadGfxArena worldOverlay; // When in Paris...
/* 0x0XXX */ TwoHeadGfxArena polyKal; // When in Rome...
/* 0x02D8 */ u32 gfxPoolIdx;
/* 0x02DC */ u16* curFrameBuffer;

View File

@ -95,14 +95,14 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) {
pool->tailMagic = GFXPOOL_TAIL_MAGIC;
THGA_Ct(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer));
THGA_Ct(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer));
THGA_Ct(&gfxCtx->titlecard, pool->titlecardBuffer, sizeof(pool->titlecardBuffer));
THGA_Ct(&gfxCtx->worldOverlay, pool->worldOverlayBuffer, sizeof(pool->worldOverlayBuffer));
THGA_Ct(&gfxCtx->polyKal, pool->polyKalBuffer, sizeof(pool->polyKalBuffer));
THGA_Ct(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer));
THGA_Ct(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer));
gfxCtx->polyOpaBuffer = pool->polyOpaBuffer;
gfxCtx->polyXluBuffer = pool->polyXluBuffer;
gfxCtx->titlecardBuffer = pool->titlecardBuffer;
gfxCtx->worldOverlayBuffer = pool->worldOverlayBuffer;
gfxCtx->polyKalBuffer = pool->polyKalBuffer;
gfxCtx->overlayBuffer = pool->overlayBuffer;
gfxCtx->workBuffer = pool->workBuffer;
@ -276,7 +276,6 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0);
gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 開始", 0);
gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 開始", 0);
gDPNoOpString(TITLE_CARD_DISP++, "TITLE_CARD_DISP 開始", 0);//unsure if needed
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 開始", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 975);
@ -289,7 +288,6 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0);
gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 終了", 0);
gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 終了", 0);
gDPNoOpString(TITLE_CARD_DISP++, "TITLE_CARD_DISP 終了", 0);
gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 終了", 0);
CLOSE_DISPS(gfxCtx, "../graph.c", 996);
@ -298,8 +296,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gSPBranchList(WORK_DISP++, gfxCtx->polyOpaBuffer);
gSPBranchList(POLY_OPA_DISP++, gfxCtx->polyXluBuffer);
gSPBranchList(POLY_XLU_DISP++, gfxCtx->titlecardBuffer);
gSPBranchList(TITLE_CARD_DISP++, gfxCtx->polyKalBuffer);
gSPBranchList(POLY_XLU_DISP++, gfxCtx->worldOverlayBuffer);
gSPBranchList(WORLD_OVERLAY_DISP++, gfxCtx->polyKalBuffer);
gSPBranchList(POLY_KAL_DISP++, gfxCtx->overlayBuffer);
gDPPipeSync(OVERLAY_DISP++);
gDPFullSync(OVERLAY_DISP++);

View File

@ -1022,31 +1022,30 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
height = (width * height > 0x1000) ? 0x1000 / width : height;
titleSecondY = titleY + (height * 4);
//TITLE_CARD_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP
TITLE_CARD_DISP = func_80093808(TITLE_CARD_DISP);
// WORLD_OVERLAY_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP
WORLD_OVERLAY_DISP = func_80093808(WORLD_OVERLAY_DISP);
gDPSetPrimColor(TITLE_CARD_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
(u8)titleCtx->alpha);
gDPLoadTextureBlock(TITLE_CARD_DISP++, (uintptr_t)titleCtx->texture, G_IM_FMT_IA,
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture, G_IM_FMT_IA,
G_IM_SIZ_8b,
width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(TITLE_CARD_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1,
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
height = titleCtx->height - height;
// If texture is bigger than 0x1000, display the rest
if (height > 0) {
gDPLoadTextureBlock(TITLE_CARD_DISP++, (uintptr_t)titleCtx->texture + 0x1000,
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + 0x1000,
G_IM_FMT_IA,
G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(TITLE_CARD_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}

View File

@ -1215,7 +1215,7 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2
if (BgCheck_AnyLineTest3(&globalCtx->colCtx, &sp8C, &sp80, &sp74, &sp9C, 1, 1, 1, 1, &bgId)) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2572);
TITLE_CARD_DISP = Gfx_CallSetupDL(TITLE_CARD_DISP, 0x07);
WORLD_OVERLAY_DISP = Gfx_CallSetupDL(WORLD_OVERLAY_DISP, 0x07);
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp74, &sp68, &sp64);
@ -1224,10 +1224,10 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2
Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW);
Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY);
gSPMatrix(TITLE_CARD_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2587),
gSPMatrix(WORLD_OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2587),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(TITLE_CARD_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
gSPDisplayList(TITLE_CARD_DISP++, gLinkAdultHookshotReticleDL);
gSPSegment(WORLD_OVERLAY_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
gSPDisplayList(WORLD_OVERLAY_DISP++, gLinkAdultHookshotReticleDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2592);
}