From 66c95f259a00fcff66d77fb744f56b4ef0cda4d0 Mon Sep 17 00:00:00 2001 From: JaceCear <11230293+JaceCear@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:52:31 +0100 Subject: [PATCH 1/3] Use new palette macros in decomp_credits.c --- src/game/decomp_credits.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/decomp_credits.c b/src/game/decomp_credits.c index f36f4c0d3..1a4f30381 100644 --- a/src/game/decomp_credits.c +++ b/src/game/decomp_credits.c @@ -294,11 +294,11 @@ void customHBlank(void) { u16 vcount = REG_VCOUNT; if ((vcount >= DISPLAY_HEIGHT - 16 - 1) && (vcount < DISPLAY_HEIGHT - 1)) { - ((u16 *)BG_PLTT)[0] = RGB_WHITE; + SET_PALETTE_COLOR_BG(0, 0, RGB_WHITE); } else if ((vcount >= (DISPLAY_HEIGHT / 2) - 1) && (vcount < DISPLAY_HEIGHT - 1)) { - ((u16 *)BG_PLTT)[0] = ((u16 *)OBJ_PLTT)[3 * 16]; + SET_PALETTE_COLOR_BG(0, 0, GET_PALETTE_COLOR_OBJ(3, 0)); } else { - ((u16 *)BG_PLTT)[0] = ((u16 *)OBJ_PLTT)[2 * 16]; + SET_PALETTE_COLOR_BG(0, 0, GET_PALETTE_COLOR_OBJ(2, 0)); } } #endif From 1cbd85c86424586d3ccf05bac7178a054330c262 Mon Sep 17 00:00:00 2001 From: JaceCear <11230293+JaceCear@users.noreply.github.com> Date: Wed, 18 Feb 2026 15:15:56 +0100 Subject: [PATCH 2/3] Revert #236 and add comment explaining why we need to set the palette memory during HBlank directly. --- src/game/decomp_credits.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/game/decomp_credits.c b/src/game/decomp_credits.c index 1a4f30381..5a65b173d 100644 --- a/src/game/decomp_credits.c +++ b/src/game/decomp_credits.c @@ -289,16 +289,23 @@ void TaskDestructor_DecompCredits(struct Task *t) CreateTitleScreen(); } -// Colors the screen behind the "Press START ..." text white +// Changes background colors depending on the current horizontal line void customHBlank(void) { - u16 vcount = REG_VCOUNT; + // NOTE: + // We have to use direct accesses to palette memory here instead of + // SET_PALETTE_COLOR_BG() and GET_PALETTE_COLOR_OBJ() because those are only taken into account + // at the end of the frame, while this HBlank-code need to update colors while the frame gets drawn; + int_vcount vcount = REG_VCOUNT; if ((vcount >= DISPLAY_HEIGHT - 16 - 1) && (vcount < DISPLAY_HEIGHT - 1)) { - SET_PALETTE_COLOR_BG(0, 0, RGB_WHITE); + // "PRESS START to continue" + ((u16 *)BG_PLTT)[0] = RGB_WHITE; } else if ((vcount >= (DISPLAY_HEIGHT / 2) - 1) && (vcount < DISPLAY_HEIGHT - 1)) { - SET_PALETTE_COLOR_BG(0, 0, GET_PALETTE_COLOR_OBJ(3, 0)); + // Logo background (JaceCear) + ((u16 *)BG_PLTT)[0] = ((u16 *)OBJ_PLTT)[3 * PALETTE_LEN_4BPP]; } else { - SET_PALETTE_COLOR_BG(0, 0, GET_PALETTE_COLOR_OBJ(2, 0)); + // Logo background (freshollie) + ((u16 *)BG_PLTT)[0] = ((u16 *)OBJ_PLTT)[2 * PALETTE_LEN_4BPP]; } } #endif From 22c9e464f491d9c12eaf2365d24401f1901ccd43 Mon Sep 17 00:00:00 2001 From: JaceCear <11230293+JaceCear@users.noreply.github.com> Date: Wed, 18 Feb 2026 15:28:16 +0100 Subject: [PATCH 3/3] Fix equation in comment --- src/game/decomp_credits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/decomp_credits.c b/src/game/decomp_credits.c index 5a65b173d..81ea96f45 100644 --- a/src/game/decomp_credits.c +++ b/src/game/decomp_credits.c @@ -48,7 +48,7 @@ void Task_OllieLogoMoves(void); // 1 // ------- -// x^4 + 0.5 +// x^4 + 1 s32 logoOllieMove(s32 frameNum) { s32 qTime = (Q_DIV(Q(frameNum), Q(GBA_FRAMES_PER_SECOND)));