vgi: add test program

This commit is contained in:
Vince Weaver 2021-07-17 16:16:18 -04:00
parent 1262cde56f
commit ee82b57505
3 changed files with 205 additions and 2 deletions

View File

@ -8,13 +8,13 @@ MAKEVGI = ./make_vgi_asm
all: vgi_myst.dsk make_vgi_asm make_color_test
vgi_myst.dsk: HELLO VGI-MYST VGI-DOOM COLOR-TEST
vgi_myst.dsk: HELLO VGI-MYST VGI-DOOM COLOR-TEST VGI-TEST
cp $(EMPTYDISK) vgi_myst.dsk
$(DOS33) -y vgi_myst.dsk SAVE A HELLO
$(DOS33) -y vgi_myst.dsk BSAVE -a 0xC00 VGI-MYST
$(DOS33) -y vgi_myst.dsk BSAVE -a 0x4000 VGI-DOOM
$(DOS33) -y vgi_myst.dsk BSAVE -a 0x4000 COLOR-TEST
$(DOS33) -y vgi_myst.dsk BSAVE -a 0x4000 VGI-TEST
###
@ -34,6 +34,17 @@ myst_vgi.o: clock.data rocket.data rocket_door.data red_book.data fireplace.data
###
VGI-TEST: test_vgi.o
ld65 -o VGI-TEST test_vgi.o -C $(LINKERSCRIPTS)/apple2_4000.inc
test_vgi.o: new.data \
test_vgi.s vgi_clearscreen.s vgi_rectangle.s vgi_circles.s vgi_lines.s \
vgi_triangles.s
ca65 -o test_vgi.o test_vgi.s -l test_vgi.lst
###
VGI-DOOM: doom_vgi.o
ld65 -o VGI-DOOM doom_vgi.o -C $(LINKERSCRIPTS)/apple2_4000.inc
@ -87,6 +98,12 @@ rocket_door.data: make_vgi_asm rocket_door.vgi
###
new.data: make_vgi_asm new.vgi
echo "new_data:" > new.data
./make_vgi_asm < new.vgi >> new.data
###
red_book.data: make_vgi_asm red_book.vgi
echo "red_book_data:" > red_book.data
./make_vgi_asm < red_book.vgi >> red_book.data

139
graphics/hgr/vgi/new.vgi Normal file
View File

@ -0,0 +1,139 @@
: FIXME: oh, the steps
; Dock
CLS 255 ; white background
; big gear
RECT 2 2 98 29 108 33 ; left tooth
VTRI 2 109 12 104 113 18 ; next tooth
VTRI 2 107 25 103 113 18
LINE 0 110 12 114 18
RECT 2 2 117 6 124 15 ; center tooth
VTRI 0 124 6 125 161 34
HTRI 0 147 16 5 25 133 ; next tooth shadow
HTRI 2 140 10 5 19 133 ; next tooth r
HTRI 2 129 13 5 19 133 ; next tooth l
HTRI 2 135 25 18 29 146 ; nnext
;HTRI 2 145 28 25 34 135 ; nnext
HTRI 0 141 32 28 33 148 ; shadow
FCIRC 2 125 33 20 ; main gear
CIRC 0 122 35 14 ; line
CIRC 0 122 33 6 ; line
; marker switch
RECT 5 5 84 24 89 34
; railings
LINE 4 75 36 73 30
LINETO 91 23
LINETO 130 23
LINE 0 130 23 135 28
LINE 4 81 34 74 31
; grassy top
RECT 1 1 83 33 180 37 ; grass
; side gear
RECT 2 2 156 21 165 37
RECT 0 0 164 24 179 36
RECT 2 2 170 23 173 37
RECT 2 2 179 28 184 39
; left mountain
VTRI 5 0 8 0 50 101 ; l mountain
VTRI 5 15 27 30 59 98 ; left flank
LINE 4 22 97 28 90 ; m line
LINETO 31 91
LINETO 40 81
LINETO 48 80
; ocean
RECT 1 6 228 152 279 191 ; ocean
; main mountain
DRECT 0xA8 0xAA 58 37 181 111 ; main mountain
VTRI 5 58 44 41 58 100 ; left flank
RECT 7 7 58 37 63 44 ; missing notch
DRECT 0xA8 0xAA 227 97 279 159 ; right flank
VTRI 7 244 100 240 253 95 ; notch
;VTRI 7 259 100 240 253 95 ; notch (off edge)
;VTRI 7 279 115 270 279 98 ; notch
LINE 4 230 105 255 112 ; edge
LINETO 266 124
LINETO 278 138
DRECT 0xA8 0xAA 201 45 230 169 ;
VTRI 5 221 89 229 253 171 ; r edge
DRECT 0xA8 0xAA 181 42 207 169
; steps
RECT 4 4 0 97 175 191 ; black background
LINE 7 0 97 38 97 ; top step
LINETO 39 105
LINE 7 27 108 50 105 ; next step
LINETO 55 115
LINE 7 44 114 59 114
LINETO 65 116
LINETO 72 124
VTRI 7 123 163 40 129 176 ; bottom step
LINE 7 59 162 121 152
LINETO 124 163
LINE 7 124 163 121 153
LINETO 111 149
LINETO 106 136
LINETO 87 133
LINETO 80 134
LINETO 79 124
LINE 7 56 153 107 135
LINE 7 56 153 81 133
LINE 7 55 120 63 116
LINE 7 57 129 69 124
LINETO 78 125
LINE 7 93 158 111 148
LINETO 122 152
; next step
;HTRI 7 106 135 133 143 88
LINE 7 60 135 80 123
LINETO 80 133
LINE 7 54 163 109 144
LINE 7 60 134 79 123
;LINETO 123 163
;
LINE 7 38 97 122 131 ; right edge
LINETO 129 142
LINETO 128 176
LINE 7 56 120 59 183 ; step vert
;HTRI 7 128 142 98 137 38 ; grey bg
RECT 4 4 0 124 54 191 ; front wall
HTRI 7 56 118 100 124 0 ; handle
HTRI 4 56 123 106 124 0 ; handle2
RECT 7 7 56 166 58 191 ; handle
; higher stairs
RECT 7 7 54 66 77 108 ; lower
RECT 7 7 77 66 97 95
RECT 4 4 97 64 147 97
RECT 7 7 62 50 101 66 ; upper
HTRI 4 87 63 57 65 62 ; dark
LINE 4 83 50 84 64
HTRI 4 100 63 48 65 165
HTRI 4 181 67 47 80 162
HTRI 4 193 121 87 122 149
RECT 4 4 147 64 166 87
RECT 7 7 129 34 155 47 ; top of steps
HTRI 7 161 47 48 62 100
HTRI 4 138 45 46 55 128
; stair railings
LINE 5 41 83 134 114
LINE 5 40 85 129 119
LINE 5 45 97 45 86
LINE 5 77 109 77 98
LINE 5 113 125 113 113
; shore by marker
VTRI 4 209 146 148 247 191 ; edge
RECT 4 4 213 178 248 191 ; edge
LINE 7 211 176 234 184
LINETO 236 191
LINET 7 235 185 245 177 ; edge
; marker switch
DRECT 0x4c 0x33 170 179 210 192 ; base
VTRI 4 210 180 197 210 191 ; base triangle
VTRI 7 185 108 171 208 132 ; triangle
RECT 5 5 183 116 195 122 ; lever
LINE 4 185 117 185 122 ; lever crack l
LINE 4 193 117 193 122 ; lever crack r
LINE 4 185 122 190 129 ; shadow
LINE 4 194 120 198 128 ; shadow
RECT 4 4 189 127 201 130 ; shadow
RECT 6 6 185 119 197 123 ; handle
RECT 6 6 171 133 210 181 ; edges
VSTRP 0xA2 0xC4 177 140 203 174 ; woodgrain center
END

View File

@ -0,0 +1,47 @@
; VGI Tester
.include "zp.inc"
.include "hardware.inc"
vgi_test:
jsr SETGR
jsr HGR
bit FULLGR
jsr vgi_make_tables
; get pointer to image data
lda #<new_data
sta VGIL
lda #>new_data
sta VGIH
jsr play_vgi
jsr wait_until_keypress
done:
jmp done
.include "vgi_common.s"
.include "new.data"
;============================
; WAIT UNTIL KEYPRESS
;============================
wait_until_keypress:
lda KEYPRESS
bpl wait_until_keypress
bit KEYRESET
rts