4cade/src/fx/fx.hgr.palette.fizzle.a

67 lines
1.5 KiB
Plaintext

;license:MIT
;(c) 2017-2021 by qkumba/4am/John Brooks
!cpu 6502
!to "build/FX.INDEXED/PALETTE.FIZZLE",plain
*=$6000
!source "src/fx/macros.a" ; no code in here
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
bit <exit
;V=1
jmp loop
start
!pseudopc 0 {
;X=0
;Y=0
loop txa
loop1 eor #$1B ; LFSR form 0x1B00 with period 8191
wait dex
bpl wait
tax
loop2 txa
ora #$20
sta <dst+2
eor #$60
sta <src+2
tya
ror
bcs odd
even lda #%11010101 ; SMC
bne + ; always branches
odd lda #%10101010 ; SMC
+ sta <mask+1
src and $FD00, y ; SMC high byte
eor (dst+1), y
mask and #$FD ; SMC
eor (dst+1), y
dst sta $FD00, y ; SMC high byte
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
lda $C000
bmi exit
txa
bne loop1
bvc llb
lda #%11111111
sta <even+1
sta <odd+1
clv
bvc loop ; always branches
llb lda (src+1), y ; last lousy byte
sta (dst+1), y
exit rts
}
end