4cade/src/fx/fx.hgr.onesquare.white.a

152 lines
2.9 KiB
Plaintext

;license:MIT
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX.INDEXED/ONESQUARE",plain
*=$6000
!source "src/fx/macros.a"
ldy #0
sty $FA
ldx #40
stx $FB
dex
stx $FC
lda #23
sta $FD
lda #<Coordinates
sta $FE
lda #>Coordinates
sta $FF
-- ldx $FA
- lda $FA
sta ($FE), y
iny
txa
sta ($FE), y
iny
bne +
inc $FF
+ inx
cpx $FB
bne -
ldx $FA
- inx
cpx $FD
bcs +
txa
sta ($FE), y
iny
lda $FA
sta ($FE), y
iny
txa
sta ($FE), y
iny
lda $FC
sta ($FE), y
iny
bne -
inc $FF
bne - ; always branches
+ ldx $FA
- lda $FD
sta ($FE), y
iny
txa
sta ($FE), y
iny
bne +
inc $FF
+ inx
cpx $FB
bne -
lda #$FF
sta ($FE), y
iny
sta ($FE), y
iny
dec $FB
dec $FC
dec $FD
inc $FA
lda $FA
cmp #12
bne --
lda #$80
sta Coordinates+$798
lda #<Coordinates
sta $FE
lda #>Coordinates
sta $FF
ldy #$00
@loop1
lda ($FE),y
bpl @copy
lda #$18
jsr WaitForKeyWithTimeout
bmi @exit
bpl @next ; always branches
@copy
tax
iny
lda ($fe),y
tay
txa
jsr HGRBlockToWhite
@next
inc $FE
bne +
inc $FF
+ inc $FE
bne +
inc $FF
+ ldy #$00
lda ($FE),y
cmp #$80
bne @loop1
@loop2
dec $FE
lda $FE
cmp #$FF
bne +
dec $FF
+ dec $FE
lda $FE
cmp #$FF
bne +
dec $FF
+ ldy #$00
lda ($FE),y
cmp #$80
beq @exit
lda ($FE),y
bpl @copy2
lda #$18
jsr WaitForKeyWithTimeout
bmi @exit
bpl @loop2 ; always branches
@copy2
tax
iny
lda ($fe),y
tay
txa
jsr HGRBlockCopy
beq @loop2 ; always branches
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES
!byte $80,$80
!if * and 1 {
!byte 0
}
Coordinates