;license:MIT ;(c) 2017-2020 by qkumba/4am/John Brooks !cpu 6502 !to "build/FX.INDEXED/BIT2.FIZZLE",plain *=$6000 addrs = $6100 ; [256 bytes, page-aligned] copymasks = $80 ; [128 bytes, should not cross page boundary] !source "src/fx/macros.a" +COPY_TO_0 start, end ;X=0 -- ldy #$20 ; create copymask table ora #%10000000 - sta copymasks, x inx dey bne - asl asl bne -- pha pha tax 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 %00000011 loop txa loop1 eor #$60 ; LFSR form 0x6000 with period 32767 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