From d01a4b83a07915aca3e5bc1d63295b529922535b Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 6 Dec 2025 23:48:19 -0500 Subject: [PATCH] Fix ActivateSubScreen: prevent .turnOn from falling through to clear MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .turnOn path was setting $1D=1 then falling through to .normal which cleared $1D - immediately undoing the overlay enable. Fix: Add BRA .exit after setting $1D in .turnOn path. Also remove the unnecessary module $0E check - the real bug was the fall-through, not menu state interference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Overworld/ZSCustomOverworld.asm | 12 +++++------- oracle.org | 8 ++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Overworld/ZSCustomOverworld.asm b/Overworld/ZSCustomOverworld.asm index 48a8c7a..1012315 100644 --- a/Overworld/ZSCustomOverworld.asm +++ b/Overworld/ZSCustomOverworld.asm @@ -1570,18 +1570,16 @@ ActivateSubScreen: .turnOn SEP #$20 ; Set A in 8bit mode. - ; Turn on BG1. + ; Turn on BG1 and exit (don't fall through to clear!) LDA.b #$01 : STA.b $1D + BRA .exit .normal - + ; No overlay needed - clear $1D SEP #$20 ; Set A in 8bit mode. + STZ.b $1D - ; Only clear $1D if not in menu (module $0E) - LDA.b $10 : CMP.b #$0E : BEQ .skipClear - STZ.b $1D ; Only clear if no overlay needed AND not in menu - .skipClear - + .exit PLX PLB diff --git a/oracle.org b/oracle.org index fe2d086..2390342 100644 --- a/oracle.org +++ b/oracle.org @@ -84,6 +84,14 @@ This section tracks tasks focused on improving the existing codebase's structure - [X] Convert all logic blocks (`RunClock`, `DrawClockToHud`, `ColorSubEffect`) into proper `subroutine`s. - [X] Break down the large `RunClock` routine into smaller, single-purpose functions (e.g., `TimeSystem_CheckCanRun`, `TimeSystem_IncrementTime`, `TimeSystem_UpdatePalettes`). +*** TODO [#A] Fix Time System Custom BG Color Regression + :PROPERTIES: + :ID: bug-time-system-bg-color + :END: + - *Symptom:* Custom background color not working correctly after recent changes. + - *Likely Cause:* Regression introduced during system refactoring or ZSCustomOverworld changes. + - *Files to Investigate:* =Overworld/time_system.asm=, =Overworld/ZSCustomOverworld.asm= + ** Minecart System (=Sprites/Objects/minecart.asm=) *** TODO [#B] Refactor Minecart System [0/4] :PROPERTIES: