4cade/src/fx/fx.gr.fizzle.a

58 lines
1.1 KiB
Plaintext

;license:MIT
;(c) 2017-2021 by qkumba/4am/John Brooks
!cpu 6502
!to "build/GR.FIZZLE",plain
*=$6000
!source "src/fx/macros.a"
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
jmp loop
start
!pseudopc 0 {
;X=0
;Y=0
loop txa
loop1 eor #$05 ; LFSR form 0x0500 with period 2047
wait inx
bpl wait
tax
loop2 txa
and #$03
ora #$04
sta <dst+2
eor #$44
sta <src+2
lda #%00001111
cpx #$04
bcc +
lda #%11110000
+ 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
bit $C000
bmi exit
txa
bne loop1
lda (src+1), y ; last lousy byte
sta (dst+1), y
exit rts
}
end