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

View File

@@ -451,6 +451,7 @@ ColorBgFix:
LDA.b $10 : CMP.b #$17 : BEQ .vanilla LDA.b $10 : CMP.b #$17 : BEQ .vanilla
REP #$30 REP #$30
PLA PLA
STA.l !pal_color
JSL ColorSubEffect JSL ColorSubEffect
STA.l PaletteCgram_HUD STA.l PaletteCgram_HUD
STA.l PaletteCgram_BG STA.l PaletteCgram_BG
@@ -540,7 +541,6 @@ FixDungeonMapColors:
; Set the time to 8:00am while map is open ; Set the time to 8:00am while map is open
LDA #$08 : STA $7EE000 LDA #$08 : STA $7EE000
LDA #$00 : STA $7EE001 LDA #$00 : STA $7EE001
PLA PLA
STA $7EC229 STA $7EC229
RTL 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...) ; Subareas background color fix (under the bridge; zora...)
; $0E/D601 8F 00 C3 7E STA $7EC300[$7E:C300] ; $0E/D601 8F 00 C3 7E STA $7EC300[$7E:C300]
; $0E/D605 8F 40 C3 7E STA $7EC340[$7E:C340] ; $0E/D605 8F 40 C3 7E STA $7EC340[$7E:C340]