Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;-------------------------------------------
- Pal_AddSub_Val = $0D
- Pal_WaitFrames = $0E ;Store vblank frames
- Pal_DirType = $0F ;add/sub 10-30 to colors
- ;restore palette from black to original
- Restore_Palette
- lda #$30
- ldx #$F0
- bne .Store_Direction
- ;fade palette to black
- Fadeout_Palette
- lda #$10
- tax
- .Store_Direction
- stx Pal_AddSub_Val
- ;main palette fade processing here
- .Proc_PalFade
- sta Pal_DirType
- ldy #$04 ;update once per 4 frames
- sty Pal_WaitFrames
- ldy #$1F ;full sprite/bg pals
- .loop_UpdatePal
- lda $620,y ;get old/prev pal state
- sec
- sbc Pal_DirType
- bpl .Store_PalCol
- lda #$0F ;black color
- .Store_PalCol
- sta $600,y ;store current pal state
- dey
- bpl .loop_UpdatePal
- sty ColorTrig
- .loop_PalDelay
- jsr WaitVblank
- dec Pal_WaitFrames
- bne .loop_PalDelay
- ;next pal fade cycle
- lda Pal_DirType
- clc
- adc Pal_AddSub_Val
- bmi .PalFade_RTS
- cmp #$50
- bne .Proc_PalFade
- .PalFade_RTS
- rts ;exit routine
- ;-------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement