2019-10-16 01:51:51 +00:00
|
|
|
;license:MIT
|
2020-09-04 16:22:43 +00:00
|
|
|
;(c) 2017-2020 by qkumba/4am/John Brooks
|
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
|
2020-09-04 18:01:52 +00:00
|
|
|
ora #$80
|
2020-09-04 14:21:59 +00:00
|
|
|
- sta copymasks, x
|
|
|
|
inx
|
|
|
|
dey
|
|
|
|
bne -
|
|
|
|
asl
|
|
|
|
bne --
|
|
|
|
clc
|
|
|
|
-- ldy #$20
|
|
|
|
tya
|
|
|
|
- sta addrs, x
|
2020-09-04 16:22:43 +00:00
|
|
|
adc #1
|
2020-09-04 14:21:59 +00:00
|
|
|
inx
|
|
|
|
dey
|
|
|
|
bne -
|
|
|
|
txa
|
|
|
|
bne --
|
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 16:22:43 +00:00
|
|
|
; in: X,Y=0
|
|
|
|
loop txa
|
|
|
|
loop1 eor #$B4
|
|
|
|
tax
|
|
|
|
loop2 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 16:22:43 +00:00
|
|
|
txa
|
|
|
|
lsr
|
|
|
|
tax
|
|
|
|
tya
|
|
|
|
ror
|
|
|
|
tay
|
|
|
|
bcc loop2
|
2020-09-04 04:20:56 +00:00
|
|
|
bne loop
|
2020-09-04 16:22:43 +00:00
|
|
|
bit $C000
|
2020-09-04 04:20:56 +00:00
|
|
|
bmi exit
|
2020-09-04 16:22:43 +00:00
|
|
|
txa
|
|
|
|
bne loop1
|
|
|
|
exit lda $4000
|
|
|
|
sta $2000
|
|
|
|
rts
|
2020-09-04 04:20:56 +00:00
|
|
|
}
|
2020-09-04 14:21:59 +00:00
|
|
|
end
|