dos33fsprogs/games/lemm/hgr_vlin.s

85 lines
1.2 KiB
ArmAsm
Raw Normal View History

2022-03-14 20:43:58 +00:00
;=================================
; Simple Vertical LINE
;=================================
; line from (x,a) to (x,a+y)
; todo: use Carry to say if X>255
hgr_vlin:
; don't handle run of 0
cpy #0
beq done_hgr_vlin
; get initial ROW into (GBASL)
sta current_row_smc+1 ; save current A
; sty vlin_row_count
2022-03-15 02:57:33 +00:00
lda div7_table,X ; X is X1
2022-03-14 20:43:58 +00:00
sta x1_save_smc+1
2022-03-15 02:57:33 +00:00
txa ; save X ; X is still X1
pha
ldx HGR_COLOR
lda hgr_colortbl,X
sta HGR_BITS
2022-03-14 20:43:58 +00:00
and #$1 ; only shift if in odd column?
beq vlin_no_shift_colors
jsr shift_colors
vlin_no_shift_colors:
2022-03-15 02:57:33 +00:00
pla
tax ; restore X is X1
2022-03-14 20:43:58 +00:00
lda mod7_table,X
tax
2022-03-15 02:57:33 +00:00
lda vlin_masks,X ; get mask
2022-03-14 20:43:58 +00:00
sta vlin_mask_smc+1
tya
2022-03-15 02:57:33 +00:00
tax ; put line count into X
2022-03-14 20:43:58 +00:00
hgr_vlin_loop:
current_row_smc:
ldy #$dd ; get row info for Y1 into GBASL/GBASH
lda hposn_high,Y
2022-03-15 03:22:32 +00:00
hgr_vlin_page_smc:
eor #$00
2022-03-14 20:43:58 +00:00
sta GBASH
lda hposn_low,Y
sta GBASL
x1_save_smc:
2022-03-15 02:57:33 +00:00
ldy #$dd ; X1/7
2022-03-14 20:43:58 +00:00
lda (GBASL),Y
eor HGR_BITS
vlin_mask_smc:
and #$dd
eor (GBASL),Y
sta (GBASL),Y
inc current_row_smc+1
; dec vlin_row_count
dex
bne hgr_vlin_loop
done_hgr_vlin:
rts
;vlin_row_count: .byte $00
vlin_masks:
.byte $81,$82,$84,$88,$90,$A0,$C0
2022-03-15 03:22:32 +00:00
hgr_vlin_page_toggle:
lda hgr_vlin_page_smc+1
eor #$60
sta hgr_vlin_page_smc+1
rts