Day Night system mosaic transition bg color fix

This commit is contained in:
scawful
2024-11-28 15:38:57 -05:00
parent 8a76b19e07
commit 425ec1d1e1
2 changed files with 153 additions and 158 deletions

View File

@@ -1765,23 +1765,20 @@ CheckForChangeGraphicsTransitionLoad:
; area.
LDA.b $A0 : CMP.w #$0181 : BNE .notBridge
LDA.w Pool_BGColorTable_Bridge
BRA .storeColor
.notBridge
LDA.b $8A : ASL : TAX ; Get area code and times it by 2.
LDA.w Pool_BGColorTable, X ; Where ZS saves the array of palettes.
.storeColor
; Set transparent color. only set the buffer so it fades in right
; during mosaic transition.
STA $7EE018
JSL Oracle_MosaicFix
NOP #4
;STA.l $7EC300
;STA.l $7EC340
;STA.l $7EC300 : STA.l $7EC340
LDX.w #$4020 : STX.b $9C
LDX.w #$8040 : STX.b $9D
@@ -2152,36 +2149,51 @@ Overworld_LoadBGColorAndSubscreenOverlay:
assert pc() <= $0BFFA8 ; $05FFA8
pullpc
print "ReplaceBGColor: ", pc
print pc
ReplaceBGColor:
{
PHB : PHK : PLB
; TODO: This may need to check if we are in a warp and then if so load the
; custom color. If not, then chceck if its enabled or not.
;SEP #$20 ; Set A in 8bit mode.
;LDA.w Pool_EnableBGColor : BNE .custom
;REP #$20 ; Set A in 16bit mode.
;PLB
;RTL
;.custom
;REP #$20 ; Set A in 16bit mode.
SEP #$20 ; Set A in 8bit mode.
LDA.w Pool_EnableBGColor : BNE .custom
REP #$20 ; Set A in 16bit mode.
PLB
RTL
.custom
REP #$20 ; Set A in 16bit mode.
PHY
LDA.b $8A : ASL : TAX ; Get area code and times it by 2.
LDA.w Pool_BGColorTable, X ; Get the color.
; ORACLE TIME SYSTEM
STA $7EE018
JSL Oracle_BackgroundFix ; $3482DD ; Background Fix
;STA.l $7EC300 : STA.l $7EC340 ; Set the BG color.
STA.l $7EC500 : STA.l $7EC540
TAY ; Save the color.
SEP #$20 ; Set A in 8bit mode.
; TODO: Check if this is needed. I think it is. If not, it should always
; set the buffer too. If not the warp fades into the wrong color for a
; second.
; Only set the buffer color during warps.
LDA.b $11 : CMP.b #$23 : BNE .notWarp
REP #$20 ; Set A in 16bit mode.
TYA
; Set the BG color buffer.
STA.l $7EE018
JSL Oracle_BackgroundFix
; STA.l $7EC300
STA.l $7EC340
.notWarp
REP #$20 ; Set A in 16bit mode.
PLY
PLB
RTL
@@ -2246,8 +2258,10 @@ InitColorLoad2:
LDA.w Pool_BGColorTable, X ; Get the color.
.storeColor
STA.l $7EE018
JSL Oracle_BackgroundFix
STA.l $7EC300 : STA.l $7EC340 ; Set transparent color.
; STA.l $7EC300
STA.l $7EC340 ; Set transparent color.
;STA.l $7EC500 : STA.l $7EC540
INC.b $15

View File

@@ -451,6 +451,7 @@ ColorBgFix:
LDA.b $10 : CMP.b #$17 : BEQ .vanilla
REP #$30
PLA
STA.l !pal_color
JSL ColorSubEffect
STA.l PaletteCgram_HUD
STA.l PaletteCgram_BG
@@ -540,7 +541,6 @@ FixDungeonMapColors:
; Set the time to 8:00am while map is open
LDA #$08 : STA $7EE000
LDA #$00 : STA $7EE001
PLA
STA $7EC229
RTL
@@ -588,25 +588,6 @@ org $02AE92
; =========================================================
; org $0BFEB6 VANILLA DAY/NIGHT HOOK
; ZS OW - ReplaceBGColor
if ZS_CUSTOM_OW_V2 == 0
org $2886B4
STA !pal_color
JSL BackgroundFix
; NOP #8
endif
; ZS OW - CheckForChangeGraphicsTransitionLoad
if ZS_CUSTOM_OW_V2 == 1
org $289447
JSL SubAreasFix
else
org $2885F9
JSL SubAreasFix
endif
; Subareas background color fix (under the bridge; zora...)
; $0E/D601 8F 00 C3 7E STA $7EC300[$7E:C300]
; $0E/D605 8F 40 C3 7E STA $7EC340[$7E:C340]