source: buchla-68k/orig/IOLIB/VSPRAY4.C@ 6f49665

Last change on this file since 6f49665 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.5 KB
Line 
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
11static char cl[81];
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*/
31
32vspray4(vobj, vwid, fg, ml, vb, pitch)
33unsigned *vobj;
34short vwid, fg, vb, pitch;
35char *ml[];
36{
37 register char *cp, *lp, c;
38 register short j, k, row;
39
40 row = 0;
41
42 fg &= 0x000F;
43 fg |= fg << 4;
44 fg |= fg << 8;
45
46 if (-1 NE vb)
47 vbank(vb);
48
49 while (NULL NE (cp = *ml++)) {
50
51 lp = cl;
52
53 while (-1 NE (j = *cp++)) {
54
55 j &= 0x00FF;
56 c = *cp++;
57
58 for (k = 0; k < j; k++)
59 *lp++ = c;
60 }
61
62 *lp = '\0';
63
64 tsplot4(vobj, vwid, fg, row++, 0, cl, pitch);
65 }
66}
Note: See TracBrowser for help on using the repository browser.