1 | /*
|
---|
2 | =============================================================================
|
---|
3 | vputs.c -- video display string put functions
|
---|
4 | Version 2 -- 1987-03-30 -- D.N. Lynx Crowe
|
---|
5 | (c) Copyright 1987 -- D.N. Lynx Crowe
|
---|
6 |
|
---|
7 | These functions drive the video character write function vputc()
|
---|
8 | which puts characters into a 82716 video RAM character object.
|
---|
9 |
|
---|
10 | Full attribute format is assumed.
|
---|
11 | =============================================================================
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include <stddefs.h>
|
---|
15 |
|
---|
16 | typedef unsigned int uint;
|
---|
17 |
|
---|
18 | extern int vputc();
|
---|
19 |
|
---|
20 | /*
|
---|
21 | =============================================================================
|
---|
22 | vputs(sbase, row, col, str, attrib)
|
---|
23 |
|
---|
24 | Write string str to video RAM object pointed to by sbase
|
---|
25 | at (row,col) with attrib used for all characters.
|
---|
26 | =============================================================================
|
---|
27 | */
|
---|
28 |
|
---|
29 | vputs(sbase, row, col, str, attrib)
|
---|
30 | uint *sbase, row, col, attrib;
|
---|
31 | char *str;
|
---|
32 | {
|
---|
33 | uint c;
|
---|
34 |
|
---|
35 | while (c = *str++) {
|
---|
36 |
|
---|
37 | vputc(sbase, row, col, c, attrib);
|
---|
38 |
|
---|
39 | if (++col GE 64) {
|
---|
40 |
|
---|
41 | col = 0;
|
---|
42 |
|
---|
43 | if (++row GE 25)
|
---|
44 | row = 0;
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|
49 | /* |
---|
50 | */
|
---|
51 |
|
---|
52 | /*
|
---|
53 | =============================================================================
|
---|
54 | vputsa(sbase, row, col, str, attrib)
|
---|
55 |
|
---|
56 | Write string str in video RAM pointed to by sbase starting
|
---|
57 | at (row, col) using attributes from the words pointed to by attrib.
|
---|
58 | =============================================================================
|
---|
59 | */
|
---|
60 |
|
---|
61 | vputsa(sbase, row, col, str, attrib)
|
---|
62 | uint *sbase, row, col, *attrib;
|
---|
63 | char *str;
|
---|
64 | {
|
---|
65 | uint c;
|
---|
66 |
|
---|
67 | while (c = *str++) {
|
---|
68 |
|
---|
69 | vputc(sbase, row, col, c, *attrib++);
|
---|
70 |
|
---|
71 | if (++col GE 64) {
|
---|
72 |
|
---|
73 | col = 0;
|
---|
74 |
|
---|
75 | if (++row GE 25)
|
---|
76 | row = 0;
|
---|
77 | }
|
---|
78 | }
|
---|
79 | }
|
---|