From 69a3a8724effee36be3471fd71839db8a74bc87c Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 19 Jun 2021 12:58:11 -0400 Subject: [PATCH] hgr: boxes: fast: might have it working --- graphics/hgr/boxes/fast_test.s | 45 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/graphics/hgr/boxes/fast_test.s b/graphics/hgr/boxes/fast_test.s index f87f5ada..b7adef5c 100644 --- a/graphics/hgr/boxes/fast_test.s +++ b/graphics/hgr/boxes/fast_test.s @@ -5,10 +5,9 @@ HGR_BITS = $1C GBASL = $26 GBASH = $27 - -OTHER_MASK = $73 -XRUN = $74 -COUNT = $75 +OTHER_MASK = $73 +XRUN = $74 +COUNT = $75 HGR_COLOR = $E4 @@ -87,14 +86,14 @@ test: end: jmp end - + ;================================== + ; VGI Simple Rectangle + ;================================== vgi_simple_rectangle: simple_rectangle_loop: - - lda VGI_RCOLOR asl ; nibble swap by david galloway @@ -154,8 +153,6 @@ no_shift: cmp #8 bcs not_corner -; jmp not_corner - corner: ; want to use MASK of left_mask, MOD7 and 7-XRUN @@ -174,7 +171,7 @@ corner: eor (GBASL),Y sta (GBASL),Y - jmp done_row + jmp done_row ; that's all not_corner: @@ -183,6 +180,8 @@ not_corner: lda mod7_table,X beq draw_run + ; handle not full left border + tax lda (GBASL),Y eor HGR_BITS @@ -192,14 +191,17 @@ not_corner: iny ; move to next - txa ; adjust RUN length + ; adjust RUN length by 7- mod7 + txa ; load mod7 eor #$ff - clc - adc #1 + sec + adc #7 + eor #$ff + sec adc XRUN sta XRUN - lda HGR_BITS + lda HGR_BITS ; cycle colors for next jsr COLOR_SHIFT @@ -211,18 +213,17 @@ draw_run: cmp #7 bcc draw_right ; blt - lda HGR_BITS - sta (GBASL),Y - iny + lda HGR_BITS ; get color + sta (GBASL),Y ; store out + jsr COLOR_SHIFT ; shift colors - lda XRUN + iny ; move to next block + + lda XRUN ; take 7 off the run sec sbc #7 sta XRUN - lda HGR_BITS - jsr COLOR_SHIFT - jmp draw_run ; draw rightmost @@ -235,8 +236,8 @@ draw_right: ; see if not starting on boundary ldx XRUN - tax + lda (GBASL),Y eor HGR_BITS and right_masks,X