Fix Time System BG color tinting and overlay clearing bugs
- Fixed: BG color resetting to untinted value on screen transitions (InitColorLoad2). - Fixed: Addressing mode error in ColorSubEffect causing incorrect tinting. - Fixed: Active overlays being cleared when hour advances due to static table lookup and incomplete logic in Overworld_LoadBGColorAndSubscreenOverlay. - Updated handoff documentation with resolution details.
This commit is contained in:
@@ -3671,7 +3671,8 @@ Overworld_LoadBGColorAndSubscreenOverlay:
|
||||
|
||||
.notMire
|
||||
|
||||
JSL.l ReadOverlayArray
|
||||
LDA.b $8C ; Use current active overlay instead of reading from static table
|
||||
; JSL.l ReadOverlayArray
|
||||
|
||||
; Check for misery mire.
|
||||
CMP.w #$009F : BNE .notRain
|
||||
@@ -3693,6 +3694,11 @@ Overworld_LoadBGColorAndSubscreenOverlay:
|
||||
|
||||
; Check for DW Death mountain. (not turtle rock?).
|
||||
CMP.w #$009C : BEQ .setCustomFixedColor
|
||||
|
||||
; Safety check: If we have a valid overlay ID (not FF) that wasn't caught above
|
||||
; (e.g. Canopy $9E, Fog $97), preserve it with default fixed colors instead of disabling.
|
||||
CMP.w #$00FF : BNE .noCustomFixedColor
|
||||
|
||||
SEP #$30 ; Set A, X, and Y in 8bit mode.
|
||||
|
||||
; Don't set the subscreen during a warp to hide the transparent
|
||||
@@ -3723,7 +3729,7 @@ Overworld_LoadBGColorAndSubscreenOverlay:
|
||||
LDA.b $E2 : STA.b $E0
|
||||
|
||||
; Just because I need a bit more space.
|
||||
JSL.l ReadOverlayArray
|
||||
LDA.b $8C ; JSL.l ReadOverlayArray
|
||||
|
||||
; Are we at Hyrule Castle or Pyramid of Power?
|
||||
CMP.w #$0096 : BNE .subscreenOnAndReturn
|
||||
@@ -3734,7 +3740,8 @@ Overworld_LoadBGColorAndSubscreenOverlay:
|
||||
.BRANCH_11
|
||||
|
||||
; Check for the pyramid BG.
|
||||
JSL.l ReadOverlayArray : CMP.w #$0096 : BNE .subscreenOnAndReturn
|
||||
LDA.b $8C ; JSL.l ReadOverlayArray
|
||||
CMP.w #$0096 : BNE .subscreenOnAndReturn
|
||||
; Synchronize Y scrolls on BG0 and BG1. Same for X scrolls.
|
||||
LDA.b $E8 : STA.b $E6
|
||||
LDA.b $E2 : STA.b $E0
|
||||
@@ -3949,13 +3956,8 @@ InitColorLoad2:
|
||||
.storeColor
|
||||
|
||||
; Set transparent color.
|
||||
STA.l $7EC300
|
||||
STA.l $7EC340 ; Set transparent color.
|
||||
|
||||
; TODO: Based on the conditions as explained above, double check that this is
|
||||
; not needed for any of them.
|
||||
;STA.l $7EC500
|
||||
;STA.l $7EC540
|
||||
STA.l $7EE018 ; Set temp color for tinting
|
||||
JSL Oracle_BackgroundFix ; Apply tint and write to buffers
|
||||
|
||||
INC.b $15
|
||||
|
||||
|
||||
@@ -387,22 +387,22 @@ ColorSubEffect:
|
||||
AND #$00FF : TAX
|
||||
|
||||
; Subtract amount to blue field based on a table
|
||||
LDA.l !SubPalColor : AND #$7C00 : STA !BlueVal
|
||||
SEC : SBC.l .blue, X : STA !TempPalColor
|
||||
LDA.l !SubPalColor : AND #$7C00 : STA.l !BlueVal
|
||||
SEC : SBC.l .blue, X : STA.l !TempPalColor
|
||||
|
||||
; mask out everything except the blue bits
|
||||
AND #$7C00 : CMP !TempPalColor : BEQ .no_blue_sign_change ; overflow ?
|
||||
LDA !SmallestBlue
|
||||
AND #$7C00 : CMP.l !TempPalColor : BEQ .no_blue_sign_change ; overflow ?
|
||||
LDA.l !SmallestBlue
|
||||
.no_blue_sign_change
|
||||
STA.l !BlueVal
|
||||
|
||||
; Subtract amount to green field based on a table
|
||||
LDA !SubPalColor : AND #$03E0 : STA !GreenVal
|
||||
LDA.l !SubPalColor : AND #$03E0 : STA.l !GreenVal
|
||||
SEC : SBC.l .green, X : STA.l !TempPalColor
|
||||
|
||||
; Mask out everything except the green bits
|
||||
AND #$03E0 : CMP !TempPalColor : BEQ .no_green_sign_change ; overflow ?
|
||||
LDA !SmallestGreen
|
||||
AND #$03E0 : CMP.l !TempPalColor : BEQ .no_green_sign_change ; overflow ?
|
||||
LDA.l !SmallestGreen
|
||||
.no_green_sign_change
|
||||
STA.l !GreenVal
|
||||
|
||||
@@ -411,8 +411,8 @@ ColorSubEffect:
|
||||
SEC : SBC.l .red, X : STA.l !TempPalColor
|
||||
|
||||
; mask out everything except the red bits
|
||||
AND #$001F : CMP !TempPalColor : BEQ .no_red_sign_change ; overflow ?
|
||||
LDA !SmallestRed
|
||||
AND #$001F : CMP.l !TempPalColor : BEQ .no_red_sign_change ; overflow ?
|
||||
LDA.l !SmallestRed
|
||||
.no_red_sign_change
|
||||
STA.l !RedVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user