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 | /* |
---|
28 |
|
---|
29 | */
|
---|
30 |
|
---|
31 | void vspray4(uint16_t *vobj, int16_t vwid, int16_t fg, int16_t vb, int16_t pitch, int8_t *ml[])
|
---|
32 | {
|
---|
33 | register int8_t *cp, *lp, c;
|
---|
34 | register int16_t j, k, row;
|
---|
35 |
|
---|
36 | row = 0;
|
---|
37 |
|
---|
38 | fg &= 0x000F;
|
---|
39 | fg |= fg << 4;
|
---|
40 | fg |= fg << 8;
|
---|
41 |
|
---|
42 | if (-1 NE vb)
|
---|
43 | vbank(vb);
|
---|
44 |
|
---|
45 | while (NULL NE (cp = *ml++)) {
|
---|
46 |
|
---|
47 | lp = cl;
|
---|
48 |
|
---|
49 | while (-1 NE (j = *cp++)) {
|
---|
50 |
|
---|
51 | j &= 0x00FF;
|
---|
52 | c = *cp++;
|
---|
53 |
|
---|
54 | for (k = 0; k < j; k++)
|
---|
55 | *lp++ = c;
|
---|
56 | }
|
---|
57 |
|
---|
58 | *lp = '\0';
|
---|
59 |
|
---|
60 | tsplot4(vobj, vwid, fg, row++, 0, cl, pitch);
|
---|
61 | }
|
---|
62 | }
|
---|
63 |
|
---|