1 | /*
|
---|
2 | =============================================================================
|
---|
3 | vspray4.c -- spray a pattern onto a graphics screen using tsplot4()
|
---|
4 | Version 5 -- 1987-10-09 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "ram.h"
|
---|
9 |
|
---|
10 | static int8_t cl[81];
|
---|
11 |
|
---|
12 | /*
|
---|
13 | =============================================================================
|
---|
14 | vspray4(vobj, vwid, fg, ml, vb, pitch) -- spray a pattern on the screen
|
---|
15 |
|
---|
16 | Uses 'vobj' of width 'vwid' as the screen, 'fg' as the color, 'vb' as
|
---|
17 | the bank, 'pitch' as the vertical pitch, and 'ml' as the pattern.
|
---|
18 |
|
---|
19 | If 'vb' EQ -1, the bank is not set. The color in 'fg' will be taken
|
---|
20 | from the lower 4 bits.
|
---|
21 |
|
---|
22 | The list 'ml' points at pairs of counts and characters. The last count
|
---|
23 | is -1, and the list terminates with a null pointer.
|
---|
24 | =============================================================================
|
---|
25 | */
|
---|
26 |
|
---|
27 | void vspray4(uint16_t *vobj, int16_t vwid, int16_t fg, int8_t *ml[], int16_t vb, int16_t pitch)
|
---|
28 | {
|
---|
29 | register int8_t *cp, *lp, c;
|
---|
30 | register int16_t j, k, row;
|
---|
31 |
|
---|
32 | row = 0;
|
---|
33 |
|
---|
34 | fg &= 0x000F;
|
---|
35 | fg |= fg << 4;
|
---|
36 | fg |= fg << 8;
|
---|
37 |
|
---|
38 | if (-1 NE vb)
|
---|
39 | vbank(vb);
|
---|
40 |
|
---|
41 | while (NULL NE (cp = *ml++)) {
|
---|
42 |
|
---|
43 | lp = cl;
|
---|
44 |
|
---|
45 | while (-1 NE (j = *cp++)) {
|
---|
46 |
|
---|
47 | j &= 0x00FF;
|
---|
48 | c = *cp++;
|
---|
49 |
|
---|
50 | for (k = 0; k < j; k++)
|
---|
51 | *lp++ = c;
|
---|
52 | }
|
---|
53 |
|
---|
54 | *lp = '\0';
|
---|
55 |
|
---|
56 | tsplot4(vobj, vwid, fg, row++, 0, cl, pitch);
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|