4cade/src/fx/fx.hgr.r.by.pixel.a
2019-10-19 20:30:48 -04:00

71 lines
1.3 KiB
Plaintext

;license:MIT
;(c) 2019 by 4am
;
!cpu 6502
!to "build/FX/R.BY.PIXEL",plain
*=$6000
tmp = $fc
maskindex = $fd
row = $fe
col = $ff
lda #$00
sta col
@colloop
lda #$06
sta maskindex
jsr WaitForVBL
@maskloop
ldx maskindex
lda copymasks,x
sta @copymask
eor #$FF
sta @sourcemask
lda #$17
sta row
@rowloop
lda row
asl
asl
asl
jsr HGRCalc
clc
ldx #$08
ldy col
@blockloop
lda ($26),y
@sourcemask=*+1
and #$FD ; SMC
sta tmp
lda ($3c),y
@copymask=*+1
and #$FD ; SMC
ora tmp
sta ($26),y
lda $27
adc #4
sta $27
eor #$60
sta $3d
dex
bne @blockloop
dec row
bpl @rowloop
lda #8
jsr WaitForKeyWithTimeout
bmi @exit
dec maskindex
bpl @maskloop
inc col
lda col
cmp #40
bne @colloop
@exit rts
copymasks
!byte $FF,$BF,$9F,$8F,$87,$83,$81
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"
!source "src/fx/hw.vbl.a"