2019-10-20 15:05:00 +00:00
|
|
|
;license:MIT
|
2021-12-14 19:20:16 +00:00
|
|
|
;(c) 2017-2021 by qkumba/4am/John Brooks
|
2019-10-20 15:05:00 +00:00
|
|
|
|
|
|
|
!cpu 6502
|
2021-10-16 01:34:39 +00:00
|
|
|
!to "build/FX.INDEXED/PALETTE.FIZZLE",plain
|
2019-10-20 15:05:00 +00:00
|
|
|
*=$6000
|
|
|
|
|
2021-12-14 19:20:16 +00:00
|
|
|
!source "src/fx/macros.a" ; no code in here
|
2019-10-20 18:13:32 +00:00
|
|
|
|
2021-12-14 19:20:16 +00:00
|
|
|
ldx #(end-start+1) ; copy LFSR code to zero page
|
|
|
|
- ldy start-2, x
|
|
|
|
sty $FE, x
|
2019-10-20 15:05:00 +00:00
|
|
|
dex
|
2021-12-14 19:20:16 +00:00
|
|
|
bne -
|
|
|
|
bit <exit
|
|
|
|
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
|
2019-10-20 15:05:00 +00:00
|
|
|
ora #$20
|
2021-12-14 19:20:16 +00:00
|
|
|
sta <dst+2
|
2019-10-20 15:05:00 +00:00
|
|
|
eor #$60
|
2021-12-14 19:20:16 +00:00
|
|
|
sta <src+2
|
|
|
|
tya
|
2019-10-20 15:05:00 +00:00
|
|
|
ror
|
2021-12-14 19:20:16 +00:00
|
|
|
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
|