2019-10-19 15:49:05 +00:00
|
|
|
;license:MIT
|
|
|
|
;(c) 2019 by 4am
|
|
|
|
;
|
|
|
|
!cpu 6502
|
|
|
|
!to "build/FX/ARROW.WHITE",plain
|
|
|
|
*=$6000
|
|
|
|
|
|
|
|
y = $fc
|
|
|
|
row = $fd
|
|
|
|
col = $fe
|
|
|
|
counter = $ff
|
|
|
|
|
2019-10-20 00:30:48 +00:00
|
|
|
hgrlo = $8000
|
|
|
|
hgr1hi = $80C0
|
|
|
|
|
2019-10-19 15:49:05 +00:00
|
|
|
!source "src/fx/macros.a"
|
|
|
|
|
2019-10-21 20:00:38 +00:00
|
|
|
+BUILD_HGR_LOOKUP_TABLES hgrlo, hgr1hi
|
2019-10-19 15:49:05 +00:00
|
|
|
|
|
|
|
lda #(40+12+1)
|
|
|
|
sta counter
|
|
|
|
|
|
|
|
lda #39
|
|
|
|
sta col
|
|
|
|
ColLoop
|
|
|
|
lda #11
|
|
|
|
sta row
|
|
|
|
ldy col
|
|
|
|
sty y
|
2019-10-20 00:30:48 +00:00
|
|
|
jsr WaitForVBL
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-20 00:30:48 +00:00
|
|
|
RowLoop
|
|
|
|
; do top half of arrow
|
2019-10-19 15:49:05 +00:00
|
|
|
lda row
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
2019-10-20 00:30:48 +00:00
|
|
|
tax
|
|
|
|
lda hgrlo,x
|
|
|
|
sta $26
|
|
|
|
sta $3c
|
|
|
|
lda hgr1hi,x
|
|
|
|
sta $27
|
2019-10-21 20:00:38 +00:00
|
|
|
eor #$60
|
2019-10-20 00:30:48 +00:00
|
|
|
sta $3d
|
|
|
|
|
|
|
|
; check if this column is visible
|
|
|
|
ldy y
|
|
|
|
+IS_Y_OFFSCREEN
|
|
|
|
bcs TopSkip1
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-26 02:06:13 +00:00
|
|
|
clc
|
2019-10-19 15:49:05 +00:00
|
|
|
ldx #7
|
2019-10-26 02:06:13 +00:00
|
|
|
- lda #$FF
|
|
|
|
eor ($26),y
|
2019-10-19 15:49:05 +00:00
|
|
|
and copymasks1,x
|
2019-10-26 02:06:13 +00:00
|
|
|
eor ($26),y
|
2019-10-19 15:49:05 +00:00
|
|
|
sta ($26),y
|
|
|
|
+HGR_INC_WITHIN_BLOCK
|
|
|
|
dex
|
|
|
|
bpl -
|
2019-10-20 00:30:48 +00:00
|
|
|
+RESET_HGR_CALC
|
|
|
|
TopSkip1
|
|
|
|
iny
|
|
|
|
+IS_Y_OFFSCREEN
|
|
|
|
bcs TopSkip2
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-26 02:06:13 +00:00
|
|
|
clc
|
2019-10-19 15:49:05 +00:00
|
|
|
ldx #7
|
2019-10-20 00:30:48 +00:00
|
|
|
- lda #$FF
|
2019-10-26 02:06:13 +00:00
|
|
|
eor ($3c),y
|
|
|
|
and copymasks3,x
|
|
|
|
eor ($3c),y
|
2019-10-19 15:49:05 +00:00
|
|
|
sta ($26),y
|
|
|
|
+HGR_INC_WITHIN_BLOCK
|
|
|
|
dex
|
|
|
|
bpl -
|
2019-10-20 00:30:48 +00:00
|
|
|
+RESET_HGR_CALC
|
|
|
|
TopSkip2
|
2019-10-19 15:49:05 +00:00
|
|
|
iny
|
|
|
|
+IS_Y_OFFSCREEN
|
2019-10-20 00:30:48 +00:00
|
|
|
bcs BottomHalf
|
2019-10-19 15:49:05 +00:00
|
|
|
lda row
|
2019-10-20 00:30:48 +00:00
|
|
|
jsr HGRBlockCopyNoRecalc
|
|
|
|
|
|
|
|
BottomHalf
|
|
|
|
; do bottom half of arrow (opposing row, same col)
|
|
|
|
lda #23
|
|
|
|
sec
|
|
|
|
sbc row
|
2019-10-19 15:49:05 +00:00
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
2019-10-20 00:30:48 +00:00
|
|
|
tax
|
|
|
|
lda hgrlo,x
|
|
|
|
sta $26
|
|
|
|
sta $3c
|
|
|
|
lda hgr1hi,x
|
|
|
|
sta $27
|
2019-10-21 20:00:38 +00:00
|
|
|
eor #$60
|
2019-10-20 00:30:48 +00:00
|
|
|
sta $3d
|
|
|
|
|
|
|
|
ldy y
|
|
|
|
+IS_Y_OFFSCREEN
|
|
|
|
bcs BottomSkip1
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-26 02:06:13 +00:00
|
|
|
clc
|
2019-10-19 15:49:05 +00:00
|
|
|
ldx #7
|
2019-10-26 02:06:13 +00:00
|
|
|
- lda #$FF
|
|
|
|
eor ($26),y
|
2019-10-20 00:30:48 +00:00
|
|
|
and copymasks4,x
|
2019-10-26 02:06:13 +00:00
|
|
|
eor ($26),y
|
2019-10-19 15:49:05 +00:00
|
|
|
sta ($26),y
|
|
|
|
+HGR_INC_WITHIN_BLOCK
|
|
|
|
dex
|
|
|
|
bpl -
|
2019-10-20 00:30:48 +00:00
|
|
|
+RESET_HGR_CALC
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-20 00:30:48 +00:00
|
|
|
BottomSkip1
|
|
|
|
iny
|
|
|
|
+IS_Y_OFFSCREEN
|
|
|
|
bcs BottomSkip2
|
2019-10-19 15:49:05 +00:00
|
|
|
|
2019-10-26 02:06:13 +00:00
|
|
|
clc
|
2019-10-19 15:49:05 +00:00
|
|
|
ldx #7
|
|
|
|
- lda #$FF
|
2019-10-26 02:06:13 +00:00
|
|
|
eor ($3c),y
|
|
|
|
and copymasks2,x
|
|
|
|
eor ($3c),y
|
2019-10-19 15:49:05 +00:00
|
|
|
sta ($26),y
|
|
|
|
+HGR_INC_WITHIN_BLOCK
|
|
|
|
dex
|
|
|
|
bpl -
|
2019-10-20 00:30:48 +00:00
|
|
|
+RESET_HGR_CALC
|
|
|
|
BottomSkip2
|
2019-10-19 15:49:05 +00:00
|
|
|
iny
|
|
|
|
+IS_Y_OFFSCREEN
|
|
|
|
bcs NextRow
|
|
|
|
|
|
|
|
lda #23
|
|
|
|
sec
|
|
|
|
sbc row
|
2019-10-20 00:30:48 +00:00
|
|
|
jsr HGRBlockCopyNoRecalc
|
2019-10-19 15:49:05 +00:00
|
|
|
|
|
|
|
NextRow
|
2019-10-20 00:30:48 +00:00
|
|
|
ldy y
|
|
|
|
iny
|
|
|
|
sty y
|
2019-10-19 15:49:05 +00:00
|
|
|
dec row
|
|
|
|
+LBPL RowLoop
|
|
|
|
lda $c000
|
|
|
|
bmi @exit
|
|
|
|
dec col
|
|
|
|
dec counter
|
|
|
|
+LBNE ColLoop
|
|
|
|
@exit rts
|
|
|
|
|
|
|
|
copymasks1
|
|
|
|
!byte %11111111
|
|
|
|
!byte %11111110
|
|
|
|
!byte %11111100
|
|
|
|
!byte %11111000
|
|
|
|
!byte %11110000
|
|
|
|
!byte %11100000
|
|
|
|
!byte %11000000
|
|
|
|
!byte %10000000
|
2019-10-26 02:06:13 +00:00
|
|
|
copymasks2
|
|
|
|
!byte %11111111
|
|
|
|
!byte %10111111
|
|
|
|
!byte %10011111
|
|
|
|
!byte %10001111
|
|
|
|
!byte %10000111
|
|
|
|
!byte %10000011
|
|
|
|
!byte %10000001
|
|
|
|
!byte %10000000
|
|
|
|
copymasks3
|
|
|
|
!byte %10000000
|
|
|
|
!byte %10000001
|
|
|
|
!byte %10000011
|
|
|
|
!byte %10000111
|
|
|
|
!byte %10001111
|
|
|
|
!byte %10011111
|
|
|
|
!byte %10111111
|
|
|
|
!byte %11111111
|
2019-10-19 15:49:05 +00:00
|
|
|
copymasks4
|
|
|
|
!byte %10000000
|
|
|
|
!byte %11000000
|
|
|
|
!byte %11100000
|
|
|
|
!byte %11110000
|
|
|
|
!byte %11111000
|
|
|
|
!byte %11111100
|
|
|
|
!byte %11111110
|
|
|
|
!byte %11111111
|
|
|
|
|
|
|
|
!source "src/wait.a"
|
|
|
|
!source "src/fx/fx.hgr.common.a"
|
2019-10-20 00:30:48 +00:00
|
|
|
!source "src/fx/hw.vbl.a"
|