Monster action to fade the screen 4.5.9 (solved)

Logana

Well-known member
really wanna use this for level transition like I would have a monster wait on a screen for a bit then fade out the warp to next level, but for the warp i could just have a simple warp out code
 

9Panzer

Well-known member
I think I read somewhere that the fade transitions got annihilated with the 4.5 update. There was a post where someone was using the palette 3 to fade out - but it never worked for me :(
 

Jonny

Well-known member
I used Dales code as follows (updated by AllDarnDavey)...

Code:
;;; BACKGROUND PAL ;;;

    LDX #$00
doFadeCurrentBckPal:
    LDA bckPal,x
    CMP #$10
    BCC +
    SEC
    SBC #$10
    STA bckPal,x
    JMP goNextBckPal
+
    LDA #$0F
    STA bckPal,x
goNextBckPal:
    INX   
    CPX #4
    BEQ goNextBckPal
    CPX #8
    BEQ goNextBckPal
    CPX #12
    BEQ goNextBckPal
    CPX #16
    BCC doFadeCurrentBckPal
    LDA #$01
    STA updateScreenData
    
;;; SPRITE PAL ;;;
    
    LDX #$00
doFadeCurrentSpritePal:
    LDA sprPal,x
    CMP #$10
    BCC +
    SEC
    SBC #$10
    STA sprPal,x
    JMP goNextSpritePal
+
    LDA #$0F
    STA sprPal,x
goNextSpritePal:
    INX   
    CPX #4
    BEQ goNextSpritePal
    CPX #8
    BEQ goNextSpritePal
    CPX #12
    BEQ goNextSpritePal
    CPX #16
    BCC doFadeCurrentSpritePal
    LDA #$01
    STA updateScreenData   

RTS

Action setup as follows...

actionsettings.gif

Also, make sure your warpToScreen (however you are doing that) doesn't happen before the fade. I know that sounds obvious but was something I missed.
 

pierski

New member
I updated your code so that I could get it to fade out the background to white.

Code:
;;; BACKGROUND PAL ;;;

    LDX #$00
doFadeCurrentBckPal:
    LDA bckPal,x
    CMP #$30
    BCS +
    SEC
    ADC #$10
    STA bckPal,x
    JMP goNextBckPal
+
    LDA #$30
    STA bckPal,x
goNextBckPal:
    INX   
    CPX #4
    BEQ goNextBckPal
    CPX #8
    BEQ goNextBckPal
    CPX #12
    BEQ goNextBckPal
    CPX #16
    BCC doFadeCurrentBckPal
    LDA #$01
    STA updateScreenData

RTS

If you get the fade in from black code working, please do not hesitate to share.
 
Top Bottom