4cade/src/fx/fx.hgr.1bit.fizzle.a

76 lines
1.4 KiB
Plaintext
Raw Normal View History

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
copymasks = $6100 ; [256 bytes]
addrs = $6200 ; [256 bytes]
2020-09-04 05:01:32 +00:00
jsr swapzp
ldx #0
lda #1
-- ldy #$20
ora #$80
- 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
inx
dey
bne -
txa
bne --
2020-09-04 04:20:56 +00:00
jsr $0
swapzp ldx #(end-start-1)
2020-09-04 04:20:56 +00:00
- lda $0, x
pha
lda start, x
2020-09-04 04:20:56 +00:00
sta $0, x
pla
sta start, x
2020-09-04 04:20:56 +00:00
dex
bpl -
rts
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
sta <dst+2
2019-10-16 01:51:51 +00:00
eor #$60
sta <src+2
lda (<dst+1), y
src eor $FD00, y
2020-09-04 04:20:56 +00:00
and copymasks, x
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
}
end