From a5a8694340fd315fe3dc824e6bf7857110ad500f Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 18 Jun 2021 15:56:51 -0400 Subject: [PATCH] hgr: vgi: line support --- graphics/hgr/vgi/Makefile | 2 +- graphics/hgr/vgi/vgi.s | 5 +++-- graphics/hgr/vgi/vgi_lines.s | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 graphics/hgr/vgi/vgi_lines.s diff --git a/graphics/hgr/vgi/Makefile b/graphics/hgr/vgi/Makefile index 97ed40da..8c6727ea 100644 --- a/graphics/hgr/vgi/Makefile +++ b/graphics/hgr/vgi/Makefile @@ -25,7 +25,7 @@ VGI: vgi.o ld65 -o VGI vgi.o -C $(LINKERSCRIPTS)/apple2_c00.inc vgi.o: clock.data \ - vgi.s vgi_clearscreen.s vgi_rectangle.s vgi_circles.s + vgi.s vgi_clearscreen.s vgi_rectangle.s vgi_circles.s vgi_lines.s ca65 -o vgi.o vgi.s -l vgi.lst diff --git a/graphics/hgr/vgi/vgi.s b/graphics/hgr/vgi/vgi.s index 24db7160..f31c653c 100644 --- a/graphics/hgr/vgi/vgi.s +++ b/graphics/hgr/vgi/vgi.s @@ -55,8 +55,8 @@ vgi_rts_table: .word vgi_simple_rectangle-1 ; 1 = simple rectangle .word vgi_circle-1 ; 2 = plain circle .word vgi_filled_circle-1 ; 3 = filled circle - .word all_done-1 ; 4 = dot - .word all_done-1 ; 5 = line to + .word vgi_point-1 ; 4 = dot + .word vgi_lineto-1 ; 5 = line to .word all_done-1 .word all_done-1 .word all_done-1 @@ -75,5 +75,6 @@ all_done: .include "vgi_clearscreen.s" .include "vgi_rectangle.s" .include "vgi_circles.s" +.include "vgi_lines.s" .include "clock.data" diff --git a/graphics/hgr/vgi/vgi_lines.s b/graphics/hgr/vgi/vgi_lines.s new file mode 100644 index 00000000..ffae4521 --- /dev/null +++ b/graphics/hgr/vgi/vgi_lines.s @@ -0,0 +1,40 @@ +; VGI Lines + + ;======================== + ; VGI point + ;======================== + + VGI_PCOLOR = P0 + VGI_PX = P1 + VGI_PY = P2 + +vgi_point: + ldx VGI_PCOLOR + lda COLORTBL,X + sta HGR_COLOR + + ldy #0 + ldx VGI_PX + lda VGI_PY + + jsr HPLOT0 ; plot at (Y,X), (A) + + jmp vgi_loop + + + + + ;======================== + ; VGI line to + ;======================== + VGI_LX = P0 + VGI_LY = P1 + +vgi_lineto: + ldx #0 + ldy VGI_LY + lda VGI_LX + + jsr HGLIN ; line to (X,A),(Y) + + jmp vgi_loop