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

61 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-01-13 23:55:40 +00:00
;license:MIT
2020-09-04 21:27:04 +00:00
;(c) 2019-2020 by qkumba/4am/John Brooks
2019-01-13 23:55:40 +00:00
!cpu 6502
!to "build/SHR.FIZZLE",plain
2020-09-04 21:27:04 +00:00
*=$A000
2019-01-13 23:55:40 +00:00
2020-11-14 07:02:12 +00:00
addrs=$80 ; [128 bytes]
2020-09-03 22:42:38 +00:00
2021-09-26 04:54:53 +00:00
ldx #(end-start) ; copy LFSR code to zero page
- lda start-1, x
sta $FF, x
dex
bne -
2020-11-14 07:02:12 +00:00
lda #$A0 ; create address lookup table
tax
tay
- dey
sty addrs-$21, x
dex
bne -
sta $C005
- lda $9D00, y ; pre-copy SHR SCB and palette
2020-09-04 21:27:04 +00:00
sta $9D00, y
lda $9E00, y
sta $9E00, y
lda $9F00, y
sta $9F00, y
iny
bne -
2021-09-26 04:54:53 +00:00
jmp loop
start
!pseudopc 0 {
2020-09-04 21:27:04 +00:00
loop txa
loop1 eor #$60 ; LFSR form 0x6000 with period 32767
tax
loop2 lda addrs, x
2021-09-26 04:54:53 +00:00
sta <src+1
src=*+1
lda $FD00, y ; SMC high byte
sta (<src), y
2019-01-13 23:55:40 +00:00
txa
2020-09-04 21:27:04 +00:00
lsr
tax
tya
ror
tay
bcc loop2
bne loop
bit $C000
bmi exit
txa
bne loop1
exit lda $2000 ; last lousy byte (because LFSR never hits 0)
sta $2000
sta $C004
rts
2021-09-26 04:54:53 +00:00
}
end