;license:MIT ;(c) 2017-2020 by qkumba/4am/John Brooks !cpu 6502 !to "build/FX.INDEXED/BIT.FIZZLE",plain *=$6000 addrs = $6100 ; [256 bytes, page-aligned] copymasks = $6200 ; [256 bytes, page-aligned] !source "src/fx/macros.a" +COPY_TO_0 start, end ;X=0 ;A=1 -- ldy #$20 ; create copymask table ora #%10000000 - sta copymasks, x inx dey bne - asl bne -- pha pha clc -- ldy #$20 ; create address lookup table tya - sta addrs, x adc #1 inx dey bne - txa bne -- rts ; exit via LFSR code on zero page start !pseudopc 0 { ; in: X,Y=0 !byte %00000001 loop txa loop1 eor #$B4 ; LFSR form 0xB400 with period 65535 tax ; X is LFSR high byte, Y is LFSR low byte loop2 lda addrs, x ; which means X is the index into the base address lookup table sta