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

58 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2019-07-14 16:57:04 +00:00
;license:MIT
2021-12-14 05:19:32 +00:00
;(c) 2017-2021 by qkumba/4am/John Brooks
2019-07-14 16:57:04 +00:00
!cpu 6502
!to "build/GR.FIZZLE",plain
*=$6000
2019-07-14 16:57:04 +00:00
2021-12-17 23:29:35 +00:00
!source "src/fx/macros.a"
+OVERCOPY_TO_0 start, end
;$FF clobbered
2021-12-17 23:29:35 +00:00
;X=0
;Y=0
2021-12-14 05:19:32 +00:00
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
2019-07-14 16:57:04 +00:00
bcc +
2021-12-14 05:19:32 +00:00
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
2019-07-14 16:57:04 +00:00
txa
2021-12-14 05:19:32 +00:00
lsr
tax
tya
ror
tay
bcc loop2
bne loop
2024-05-29 01:17:10 +00:00
bit KBD
2021-12-14 05:19:32 +00:00
bmi exit
txa
bne loop1
2021-12-14 19:20:16 +00:00
lda (src+1), y ; last lousy byte
2021-12-14 05:19:32 +00:00
sta (dst+1), y
exit rts
}
end