mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-20 01:29:36 +00:00
vgi: update with book
also vertical lines
This commit is contained in:
parent
957d2f3575
commit
3262240cfc
|
@ -133,6 +133,18 @@ VGI Horizontal Triangle (8)
|
||||||
The side vertex is at (vx,vy)
|
The side vertex is at (vx,vy)
|
||||||
The opposite side goes from (xr,yt) to (xr,yb)
|
The opposite side goes from (xr,yt) to (xr,yb)
|
||||||
|
|
||||||
|
|
||||||
|
==================================
|
||||||
|
VGI Vertical Striped Rectangle (9)
|
||||||
|
|
||||||
|
VSTRP c1 c2 x1 y1 x2 y2
|
||||||
|
|
||||||
|
Draws a rectangle, but this time the two colors are raw bitmaps
|
||||||
|
for the output colors, but to use even/odd columns.
|
||||||
|
On apple II this allows repeating pattern, but since it's a multiple
|
||||||
|
of 7 you can't get true stripes (for that we'd need a 4-byte
|
||||||
|
repeating pattern)
|
||||||
|
|
||||||
============
|
============
|
||||||
VGI End (15)
|
VGI End (15)
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#define VGI_DITHER_RECTANGLE 6
|
#define VGI_DITHER_RECTANGLE 6
|
||||||
#define VGI_VERT_TRIANGLE 7
|
#define VGI_VERT_TRIANGLE 7
|
||||||
#define VGI_HORIZ_TRIANGLE 8
|
#define VGI_HORIZ_TRIANGLE 8
|
||||||
|
#define VGI_VSTRIPE_RECTANGLE 9
|
||||||
#define VGI_END 15
|
#define VGI_END 15
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
@ -58,6 +59,9 @@ int main(int argc, char **argv) {
|
||||||
if (!strncmp(buffer,"HTRI",4)) {
|
if (!strncmp(buffer,"HTRI",4)) {
|
||||||
type=VGI_HORIZ_TRIANGLE;
|
type=VGI_HORIZ_TRIANGLE;
|
||||||
}
|
}
|
||||||
|
if (!strncmp(buffer,"VSTRP",5)) {
|
||||||
|
type=VGI_VSTRIPE_RECTANGLE;
|
||||||
|
}
|
||||||
if (!strncmp(buffer,"END",3)) {
|
if (!strncmp(buffer,"END",3)) {
|
||||||
type=VGI_END;
|
type=VGI_END;
|
||||||
}
|
}
|
||||||
|
@ -177,6 +181,20 @@ int main(int argc, char **argv) {
|
||||||
size+=7;
|
size+=7;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VGI_VSTRIPE_RECTANGLE: /* vstriped rectangle */
|
||||||
|
sscanf(buffer,"%*s %i %i %i %i %i %i",
|
||||||
|
&color1,&color2,
|
||||||
|
&x1,&y1,&x2,&y2);
|
||||||
|
printf(".byte $%02X,",(type<<4)|7);
|
||||||
|
printf("$%02X,",color1);
|
||||||
|
printf("$%02X,",x1);
|
||||||
|
printf("$%02X,",y1);
|
||||||
|
printf("$%02X,",x2-x1);
|
||||||
|
printf("$%02X,",y2-y1);
|
||||||
|
printf("$%02X\n",color2);
|
||||||
|
size+=7;
|
||||||
|
break;
|
||||||
|
|
||||||
case VGI_END: /* end */
|
case VGI_END: /* end */
|
||||||
printf(".byte $FF\n");
|
printf(".byte $FF\n");
|
||||||
size+=1;
|
size+=1;
|
||||||
|
|
|
@ -1,146 +1,51 @@
|
||||||
; Rocket from Myst
|
; Red Book from Myst
|
||||||
CLS 255 ; white background
|
CLS 0x80 ; white background
|
||||||
RECT 1 6 0 122 140 191 ; ocean left
|
VSTRP 0xA2 0xC4 15 0 55 192 ; woodgrain left
|
||||||
RECT 1 6 140 122 279 191 ; ocean right
|
VSTRP 0xA2 0xC4 237 0 270 192 ; woodgrain right
|
||||||
; rock
|
RECT 5 4 56 53 233 60 ; top bar
|
||||||
RECT 1 5 239 171 279 191 ; green/orange rock
|
RECT 5 4 57 143 233 151 ; bottom bar
|
||||||
VTRI 4 228 162 226 245 171 ; black edge
|
VSTRP 0xA2 0xC4 58 152 231 191 ; bottom pannel
|
||||||
VTRI 4 228 162 224 244 185 ; black edge
|
RECT 5 5 69 83 221 134 ; bottom bar
|
||||||
VTRI 4 232 191 224 244 184 ; upside down
|
RECT 5 5 57 135 232 140 ; bottom lip
|
||||||
VTRI 4 255 165 245 255 171 ; black right edge
|
VTRI 5 69 84 61 69 135 ; left triangle
|
||||||
VTRI 4 255 178 245 255 171 ; black right edge
|
VTRI 5 219 84 219 228 135 ; right triangle
|
||||||
RECT 4 4 255 170 279 178 ; rock shade
|
POINT 4 67 94
|
||||||
RECT 4 4 255 163 270 178 ; rock shade
|
LINETO 223 94
|
||||||
; base
|
; upper
|
||||||
DRECT 0x8 0x22 86 124 193 191 ; green brick dock
|
VSTRP 0xA2 0xC4 68 1 231 54 ; toppannel
|
||||||
FCIRC 7 97 121 4 ; left platform
|
POINT 4 68 54 ; left lines
|
||||||
FCIRC 7 180 121 4 ; right platform
|
LINETO 70 32
|
||||||
RECT 7 7 99 119 175 127 ; platform
|
LINETO 79 12
|
||||||
RECT 4 4 103 114 178 121 ; shady platform
|
LINETO 87 0
|
||||||
HTRI 4 95 120 115 120 102 ; left shady plat
|
POINT 4 73 54
|
||||||
HTRI 4 185 120 115 120 175 ; right shady plat
|
LINETO 76 33
|
||||||
RECT 0 0 102 128 116 191 ; left shade
|
LINETO 82 16
|
||||||
RECT 0 0 156 126 169 191 ; center shade
|
LINETO 94 0
|
||||||
RECT 0 0 179 126 194 191 ; right shade
|
POINT 4 216 53
|
||||||
RECT 3 3 89 137 93 146 ; left light
|
LINETO 216 37
|
||||||
RECT 3 3 186 139 190 147 ; right light
|
LINETO 208 17
|
||||||
; spaceship
|
LINETO 196 0
|
||||||
POINT 5 4 94 ; nosepipe
|
POINT 4 222 54
|
||||||
LINETO 26 94 ;
|
LINETO 221 33
|
||||||
HTRI 4 25 94 84 105 43 ; noscone
|
LINETO 213 15
|
||||||
; draw deeper Z body
|
LINETO 204 0
|
||||||
HTRI 5 233 103 103 114 179 ; behind bottom fin
|
POINT 4 234 53
|
||||||
; draw tails
|
LINETO 230 34
|
||||||
FCIRC 4 217 87 32 ; tails
|
LINETO 222 12
|
||||||
FCIRC 7 247 87 25 ; tails cutout
|
LINETO 216 0
|
||||||
RECT 4 4 231 59 263 64 ; top fin
|
VTRI 4 69 32 69 84 0
|
||||||
HTRI 4 255 58 54 58 222
|
VTRI 4 230 32 216 230 0
|
||||||
RECT 4 4 230 108 249 120 ; bottom fin
|
; light
|
||||||
RECT 4 4 240 111 278 115 ; bottom fin
|
RECT 1 1 134 36 159 43 ; light
|
||||||
RECT 4 4 220 115 263 120 ; bottom fin
|
RECT 1 5 134 43 159 53 ; light
|
||||||
; draw body
|
POINT 4 134 50
|
||||||
RECT 5 5 44 84 234 101 ; body
|
LINETO 158 50
|
||||||
HTRI 5 44 84 77 84 69 ; left top
|
; page
|
||||||
HTRI 5 234 88 75 88 182 ; right top
|
RECT 2 2 175 89 201 135
|
||||||
RECT 5 5 75 76 190 84 ; center top
|
; book
|
||||||
HTRI 7 223 84 84 88 234 ; right cutout
|
RECT 4 4 124 132 164 136 ; pages
|
||||||
RECT 5 5 44 101 185 106 ; next strip down
|
RECT 2 3 126 77 166 132 ; book cover
|
||||||
HTRI 5 228 101 101 107 187 ; over bottom fin
|
RECT 4 4 127 76 133 132 ; left bar
|
||||||
HTRI 5 44 106 106 113 74 ; left under
|
HTRI 4 156 76 75 84 166 ; l triangle top
|
||||||
RECT 5 5 74 106 185 113 ; next layer
|
HTRI 4 158 131 123 132 166 ; l triangle bottom
|
||||||
HTRI 5 74 113 113 100 102 ; next left
|
|
||||||
HTRI 5 181 113 113 100 173 ; next right
|
|
||||||
RECT 5 4 99 113 173 117 ; next layer
|
|
||||||
; decorations
|
|
||||||
RECT 4 4 234 88 239 101 ; nozzle
|
|
||||||
HTRI 4 173 84 79 88 163 ; weird scoop
|
|
||||||
HTRI 4 219 88 83 87 210 ; another scoop
|
|
||||||
DRECT 0xcc 0xb3 67 80 74 110 ; left stripe
|
|
||||||
DRECT 0xcc 0xb3 70 76 75 80 ; left stripe
|
|
||||||
DRECT 0xcc 0xb3 70 106 75 114 ; left stripe
|
|
||||||
DRECT 0xcc 0xb3 183 76 190 112 ; right stripe
|
|
||||||
; door
|
|
||||||
POINT 4 150 80
|
|
||||||
LINETO 115 80
|
|
||||||
LINETO 115 108
|
|
||||||
LINETO 120 111
|
|
||||||
LINETO 137 111
|
|
||||||
POINT 7 138 81
|
|
||||||
LINETO 138 109
|
|
||||||
; door lines
|
|
||||||
POINT 4 139 96
|
|
||||||
LINETO 168 97
|
|
||||||
POINT 4 139 100
|
|
||||||
LINETO 165 100
|
|
||||||
; marker switch
|
|
||||||
RECT 6 6 148 116 158 124 ; base
|
|
||||||
RECT 7 7 147 101 158 117 ; border
|
|
||||||
RECT 5 1 150 103 155 113 ; woodgrain
|
|
||||||
VTRI 6 154 95 148 158 101 ; top
|
|
||||||
POINT 2 151 97 ; handle
|
|
||||||
LINETO 155 97
|
|
||||||
; walkway
|
|
||||||
VTRI 1 128 129 101 109 191 ; left path green
|
|
||||||
VTRI 3 129 129 109 129 191 ; left path white
|
|
||||||
RECT 3 3 129 129 151 191 ; center path
|
|
||||||
VTRI 1 153 129 170 179 191 ; right path green
|
|
||||||
VTRI 3 152 129 152 170 191 ; right path white
|
|
||||||
POINT 0 152 129 ; right gap
|
|
||||||
LINETO 170 191 ; right gap
|
|
||||||
POINT 0 129 129 ; left gap
|
|
||||||
LINETO 109 191 ; left gap
|
|
||||||
; left railing
|
|
||||||
POINT 0 127 115 ; far left pole
|
|
||||||
LINETO 128 133
|
|
||||||
POINT 3 127 115 ; far left rope
|
|
||||||
LINETO 122 129
|
|
||||||
POINT 2 123 126 ; center left pole
|
|
||||||
LINETO 123 147
|
|
||||||
POINT 3 120 128 ; center left rope
|
|
||||||
LINETO 116 144
|
|
||||||
LINETO 109 154
|
|
||||||
LINETO 99 158
|
|
||||||
RECT 2 2 97 164 100 191 ; near pole
|
|
||||||
FCIRC 2 98 161 4 ; near pole circle
|
|
||||||
; right railing
|
|
||||||
POINT 0 153 117 ; far right pole
|
|
||||||
LINETO 152 132
|
|
||||||
POINT 3 153 118 ; far right rope
|
|
||||||
LINETO 157 129
|
|
||||||
POINT 2 158 126 ; center right pole
|
|
||||||
LINETO 157 141
|
|
||||||
POINT 3 158 127 ; center right rope
|
|
||||||
LINETO 162 142
|
|
||||||
LINETO 168 154
|
|
||||||
LINETO 178 160
|
|
||||||
RECT 2 2 177 164 181 191 ; near pole
|
|
||||||
FCIRC 2 179 161 4 ; near pole circle
|
|
||||||
; wire pole
|
|
||||||
RECT 6 6 174 88 179 126 ; pole
|
|
||||||
RECT 6 6 174 73 179 80 ; insulator
|
|
||||||
POINT 6 177 90 ; thinner pole
|
|
||||||
LINETO 177 74 ; to top
|
|
||||||
; shadow
|
|
||||||
POINT 0 129 191
|
|
||||||
LINETO 144 187
|
|
||||||
POINT 0 139 188
|
|
||||||
LINETO 132 180
|
|
||||||
LINETO 130 170
|
|
||||||
LINETO 129 157
|
|
||||||
LINETO 134 149
|
|
||||||
LINETO 139 143
|
|
||||||
LINETO 135 138
|
|
||||||
LINETO 134 132
|
|
||||||
LINETO 138 126
|
|
||||||
LINETO 131 127
|
|
||||||
POINT 0 126 145
|
|
||||||
LINETO 143 142
|
|
||||||
; power wire
|
|
||||||
POINT 6 279 54 ; from off screen
|
|
||||||
LINETO 238 65
|
|
||||||
LINETO 177 74
|
|
||||||
LINETO 170 82
|
|
||||||
LINETO 173 85
|
|
||||||
LINETO 189 88
|
|
||||||
LINETO 209 86
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -14,9 +14,9 @@ vgi_test:
|
||||||
|
|
||||||
; get pointer to image data
|
; get pointer to image data
|
||||||
|
|
||||||
lda #<rocket_door_data
|
lda #<red_book_data
|
||||||
sta VGIL
|
sta VGIL
|
||||||
lda #>rocket_door_data
|
lda #>red_book_data
|
||||||
sta VGIH
|
sta VGIH
|
||||||
|
|
||||||
; lda #<clock_data
|
; lda #<clock_data
|
||||||
|
@ -144,7 +144,7 @@ vgi_rts_table:
|
||||||
.word vgi_dithered_rectangle-1 ; 6 = dithered rectangle
|
.word vgi_dithered_rectangle-1 ; 6 = dithered rectangle
|
||||||
.word vgi_vertical_triangle-1 ; 7 = vertical triangle
|
.word vgi_vertical_triangle-1 ; 7 = vertical triangle
|
||||||
.word vgi_horizontal_triangle-1 ; 8 = horizontal triangle
|
.word vgi_horizontal_triangle-1 ; 8 = horizontal triangle
|
||||||
.word all_done-1
|
.word vgi_vstripe_rectangle-1 ; 9 = vstripe rectangle
|
||||||
.word all_done-1
|
.word all_done-1
|
||||||
.word all_done-1
|
.word all_done-1
|
||||||
.word all_done-1
|
.word all_done-1
|
||||||
|
|
|
@ -7,7 +7,7 @@ HGR_BITS = $1C
|
||||||
GBASL = $26
|
GBASL = $26
|
||||||
GBASH = $27
|
GBASH = $27
|
||||||
|
|
||||||
USE_DITHERED = $72
|
COLOR_MODE = $72
|
||||||
OTHER_MASK = $73
|
OTHER_MASK = $73
|
||||||
XRUN = $74
|
XRUN = $74
|
||||||
;COUNT = $75
|
;COUNT = $75
|
||||||
|
@ -141,12 +141,15 @@ save_color:
|
||||||
|
|
||||||
vgi_simple_rectangle:
|
vgi_simple_rectangle:
|
||||||
lda #0
|
lda #0
|
||||||
sta USE_DITHERED
|
sta COLOR_MODE
|
||||||
|
|
||||||
simple_rectangle_loop:
|
simple_rectangle_loop:
|
||||||
|
|
||||||
lda USE_DITHERED
|
lda COLOR_MODE
|
||||||
bne handle_dither
|
beq simple_colors
|
||||||
|
bmi striped_colors
|
||||||
|
bpl handle_dither
|
||||||
|
|
||||||
|
|
||||||
simple_colors:
|
simple_colors:
|
||||||
|
|
||||||
|
@ -182,7 +185,10 @@ dsave_color:
|
||||||
sta HGR_COLOR
|
sta HGR_COLOR
|
||||||
|
|
||||||
inc COUNT
|
inc COUNT
|
||||||
|
jmp done_colors
|
||||||
|
striped_colors:
|
||||||
|
|
||||||
|
; don't need to do anything here?
|
||||||
|
|
||||||
done_colors:
|
done_colors:
|
||||||
|
|
||||||
|
@ -195,6 +201,14 @@ done_colors:
|
||||||
|
|
||||||
; Y is already the RX1/7
|
; Y is already the RX1/7
|
||||||
|
|
||||||
|
; adjust color if in striped mode
|
||||||
|
lda COLOR_MODE
|
||||||
|
bpl not_striped
|
||||||
|
|
||||||
|
jsr swap_colors
|
||||||
|
|
||||||
|
not_striped:
|
||||||
|
|
||||||
; copy the XRUN
|
; copy the XRUN
|
||||||
|
|
||||||
lda VGI_RXRUN
|
lda VGI_RXRUN
|
||||||
|
@ -203,23 +217,6 @@ done_colors:
|
||||||
inc XRUN ; needed because we compare with beq/bne
|
inc XRUN ; needed because we compare with beq/bne
|
||||||
|
|
||||||
|
|
||||||
; get position of first block (x/7) and put into Y
|
|
||||||
|
|
||||||
; draw leftmost
|
|
||||||
; ldy VGI_RX1
|
|
||||||
; lda div7_table,Y
|
|
||||||
; tay
|
|
||||||
|
|
||||||
; set up the color
|
|
||||||
|
|
||||||
; and #$1
|
|
||||||
; beq no_shift
|
|
||||||
|
|
||||||
; lda HGR_BITS
|
|
||||||
; jsr COLOR_SHIFT
|
|
||||||
|
|
||||||
;no_shift:
|
|
||||||
|
|
||||||
; check if narrow corner case where begin and end same block
|
; check if narrow corner case where begin and end same block
|
||||||
; if RX%7 + XRUN < 8
|
; if RX%7 + XRUN < 8
|
||||||
|
|
||||||
|
@ -274,9 +271,10 @@ not_corner:
|
||||||
adc XRUN
|
adc XRUN
|
||||||
sta XRUN
|
sta XRUN
|
||||||
|
|
||||||
lda HGR_BITS ; cycle colors for next
|
; lda HGR_BITS ; cycle colors for next
|
||||||
jsr COLOR_SHIFT
|
; jsr COLOR_SHIFT
|
||||||
|
|
||||||
|
jsr swap_colors
|
||||||
|
|
||||||
;no_shift:
|
;no_shift:
|
||||||
|
|
||||||
|
@ -288,10 +286,12 @@ draw_run:
|
||||||
|
|
||||||
lda HGR_BITS ; get color
|
lda HGR_BITS ; get color
|
||||||
sta (GBASL),Y ; store out
|
sta (GBASL),Y ; store out
|
||||||
jsr COLOR_SHIFT ; shift colors
|
; jsr COLOR_SHIFT ; shift colors
|
||||||
|
|
||||||
iny ; move to next block
|
iny ; move to next block
|
||||||
|
|
||||||
|
jsr swap_colors
|
||||||
|
|
||||||
lda XRUN ; take 7 off the run
|
lda XRUN ; take 7 off the run
|
||||||
sec
|
sec
|
||||||
sbc #7
|
sbc #7
|
||||||
|
@ -329,6 +329,43 @@ done_done:
|
||||||
jmp vgi_loop
|
jmp vgi_loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;==========================
|
||||||
|
; swap colors
|
||||||
|
;==========================
|
||||||
|
swap_colors:
|
||||||
|
|
||||||
|
lda COLOR_MODE
|
||||||
|
bmi swap_colors_striped
|
||||||
|
|
||||||
|
lda HGR_BITS ; get color
|
||||||
|
jsr COLOR_SHIFT ; shift colors
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
swap_colors_striped:
|
||||||
|
|
||||||
|
tya
|
||||||
|
and #1
|
||||||
|
bne swap_odd
|
||||||
|
|
||||||
|
lda VGI_RCOLOR
|
||||||
|
jmp swap_done
|
||||||
|
|
||||||
|
swap_odd:
|
||||||
|
lda VGI_RCOLOR2
|
||||||
|
swap_done:
|
||||||
|
sta HGR_BITS
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=================================
|
;=================================
|
||||||
; Dithered Rectangle
|
; Dithered Rectangle
|
||||||
;=================================
|
;=================================
|
||||||
|
@ -341,45 +378,33 @@ done_done:
|
||||||
|
|
||||||
vgi_dithered_rectangle:
|
vgi_dithered_rectangle:
|
||||||
lda #1
|
lda #1
|
||||||
sta USE_DITHERED
|
sta COLOR_MODE
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta COUNT
|
sta COUNT
|
||||||
|
|
||||||
jmp simple_rectangle_loop
|
jmp simple_rectangle_loop
|
||||||
.if 0
|
|
||||||
dithered_rectangle_loop:
|
|
||||||
lda COUNT
|
|
||||||
and #$1
|
|
||||||
beq even_color
|
|
||||||
odd_color:
|
|
||||||
lda VGI_RCOLOR
|
|
||||||
jmp save_color
|
|
||||||
even_color:
|
|
||||||
lda VGI_RCOLOR2
|
|
||||||
save_color:
|
|
||||||
sta HGR_COLOR
|
|
||||||
|
|
||||||
inc COUNT
|
|
||||||
|
|
||||||
ldx VGI_RX1 ; X1 into X
|
|
||||||
lda VGI_RY1 ; Y1 into A
|
|
||||||
ldy #0 ; always 0
|
|
||||||
jsr HPOSN ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
|
||||||
|
|
||||||
|
|
||||||
lda VGI_RXRUN ; XRUN into A
|
;=================================
|
||||||
ldx #0 ; always 0
|
; Vertical Striped Rectangle
|
||||||
ldy #0 ; relative Y is 0
|
;=================================
|
||||||
jsr HLINRL ; (X,A),(Y)
|
; VGI_RCOLOR = P0
|
||||||
|
; VGI_RX1 = P1
|
||||||
|
; VGI_RY1 = P2
|
||||||
|
; VGI_RXRUN = P3
|
||||||
|
; VGI_RYRUN = P4
|
||||||
|
; VGI_RCOLOR2 = P5
|
||||||
|
|
||||||
inc VGI_RY1
|
vgi_vstripe_rectangle:
|
||||||
dec VGI_RYRUN
|
lda #128
|
||||||
bne dithered_rectangle_loop
|
sta COLOR_MODE
|
||||||
|
|
||||||
jmp vgi_loop
|
lda #0
|
||||||
|
sta COUNT
|
||||||
|
|
||||||
|
jmp simple_rectangle_loop
|
||||||
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user