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

170 lines
3.1 KiB
Plaintext

;license:MIT
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX.INDEXED/FOURSQUARE",plain
*=$6000
!source "src/fx/macros.a"
lda #23
sta $FD
lda #<Coordinates
sta $FE
lda #>Coordinates
sta $FF
ldy #0
sty $F7
ldx #11
stx $F8
txa
inx
stx $F9
ldx #19
stx $FA
inx
stx $FB
ldx #39
stx $FC
- lda $F7
ldx $F8
jsr @box2
lda $F9
ldx $FD
jsr @box2
lda #$FF
jsr stainc
jsr stainc
dec $F8
inc $F9
dec $FA
inc $FB
dec $FC
dec $FD
inc $F7
lda $F7
cmp #6
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
@box2 sta $F4
stx $F5
jsr @box1
ldx $F4
- inx
cpx $F5
bcs +
jsr txasta
lda $F7
jsr statxa
lda $FA
jsr statxa
lda $FB
jsr statxa
lda $FC
jsr stainc
bne - ; always branches
+ txa
; fall through
@box1 ldx $FA
stx $F6
ldx $F7
jsr +
ldx $FC
stx $F6
ldx $FB
+
- jsr stainc
pha
txa
jsr stainc
pla
cpx $F6
inx
bcc -
rts
statxa jsr stainc
txasta txa
stainc sta ($FE), y
iny
bne +
inc $FF
+ rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES
!byte $80,$80
!if * and 1 {
!byte 0
}
Coordinates