2019-10-16 01:51:51 +00:00
|
|
|
;license:MIT
|
2020-09-03 22:42:38 +00:00
|
|
|
;(c) 2017-2020 by qkumba/4am
|
2019-10-16 01:51:51 +00:00
|
|
|
|
|
|
|
!cpu 6502
|
|
|
|
!to "build/FX/BIT.FIZZLE",plain
|
|
|
|
*=$6000
|
|
|
|
|
2020-09-04 14:21:59 +00:00
|
|
|
copymasks = $6100 ; [256 bytes]
|
|
|
|
addrs = $6200 ; [256 bytes]
|
2020-09-04 05:01:32 +00:00
|
|
|
|
2020-09-04 14:21:59 +00:00
|
|
|
jsr swapzp
|
|
|
|
ldx #0
|
|
|
|
lda #1
|
|
|
|
-- ldy #$20
|
|
|
|
- sta copymasks, x
|
|
|
|
inx
|
|
|
|
dey
|
|
|
|
bne -
|
|
|
|
asl
|
|
|
|
bne --
|
|
|
|
clc
|
|
|
|
-- ldy #$20
|
|
|
|
tya
|
|
|
|
- sta addrs, x
|
|
|
|
adc #$1
|
|
|
|
inx
|
|
|
|
dey
|
|
|
|
bne -
|
|
|
|
txa
|
|
|
|
bne --
|
|
|
|
sty <rnd2+1
|
|
|
|
iny
|
|
|
|
sty <rnd1+1
|
2020-09-04 04:20:56 +00:00
|
|
|
jsr $0
|
2020-09-04 14:21:59 +00:00
|
|
|
swapzp ldx #(end-start-1)
|
2020-09-04 04:20:56 +00:00
|
|
|
- lda $0, x
|
|
|
|
pha
|
2020-09-04 14:21:59 +00:00
|
|
|
lda start, x
|
2020-09-04 04:20:56 +00:00
|
|
|
sta $0, x
|
|
|
|
pla
|
2020-09-04 14:21:59 +00:00
|
|
|
sta start, x
|
2020-09-04 04:20:56 +00:00
|
|
|
dex
|
|
|
|
bpl -
|
|
|
|
rts
|
|
|
|
|
2020-09-04 14:21:59 +00:00
|
|
|
start
|
2020-09-04 04:20:56 +00:00
|
|
|
!pseudopc 0 {
|
2020-09-04 14:21:59 +00:00
|
|
|
loop lda <rnd1+1
|
2020-09-04 04:20:56 +00:00
|
|
|
loop2 eor #$ff
|
2020-09-04 05:01:32 +00:00
|
|
|
tay
|
2020-09-04 14:21:59 +00:00
|
|
|
lsr <rnd2+1
|
|
|
|
ror <rnd1+1
|
2019-10-16 01:51:51 +00:00
|
|
|
bcc +
|
2020-09-04 14:21:59 +00:00
|
|
|
lda <rnd2+1
|
2020-09-04 05:01:32 +00:00
|
|
|
eor #$B4
|
2020-09-04 14:21:59 +00:00
|
|
|
sta <rnd2+1
|
2020-09-04 04:20:56 +00:00
|
|
|
+ lda addrs, x
|
2020-09-04 14:21:59 +00:00
|
|
|
sta <dst+2
|
2019-10-16 01:51:51 +00:00
|
|
|
eor #$60
|
2020-09-04 14:21:59 +00:00
|
|
|
sta <src+2
|
|
|
|
lda (<dst+1), y
|
|
|
|
src eor $FD00, y
|
2020-09-04 04:20:56 +00:00
|
|
|
and copymasks, x
|
2020-09-04 14:21:59 +00:00
|
|
|
eor (<dst+1), y
|
|
|
|
dst sta $FD00, y
|
2020-09-04 04:20:56 +00:00
|
|
|
rnd2 ldx #$FD
|
|
|
|
bne loop
|
2020-09-03 23:38:38 +00:00
|
|
|
lda $c000
|
2020-09-04 04:20:56 +00:00
|
|
|
bmi exit
|
|
|
|
rnd1 lda #$FD
|
2020-09-03 23:38:38 +00:00
|
|
|
cmp #1
|
2020-09-04 04:20:56 +00:00
|
|
|
bne loop2
|
|
|
|
exit rts
|
|
|
|
}
|
2020-09-04 14:21:59 +00:00
|
|
|
end
|