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