-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdg10.c
More file actions
200 lines (165 loc) · 3.17 KB
/
dg10.c
File metadata and controls
200 lines (165 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*
* The routines in this file provide support for the Data General Model 10
* Microcomputer.
*/
#define termdef 1 /* don't define "term" external */
#include <stdio.h>
#include "estruct.h"
#include "edef.h"
#if DG10
#define NROW 24 /* Screen size. */
#define NCOL 80 /* Edit if you want to. */
#define NPAUSE 100 /* # times thru update to pause */
#define MARGIN 8 /* size of minimim margin and */
#define SCRSIZ 64 /* scroll size for extended lines */
#define BEL 0x07 /* BEL character. */
#define ESC 30 /* DG10 ESC character. */
extern int dg10kopen(); /* Forward references. */
extern int dg10kclose();
extern VOID dg10move();
extern VOID dg10eeol();
extern VOID dg10eeop();
extern VOID dg10beep();
extern int dg10open();
extern VOID dg10rev();
extern int dg10close();
extern int dg10cres();
#if COLOR
extern VOID dg10fcol();
extern VOID dg10bcol();
int cfcolor = -1; /* current forground color */
int cbcolor = -1; /* current background color */
int ctrans[] = { /* emacs -> DG10 color translation table */
0, 4, 2, 6, 1, 5, 3, 7};
#endif
/*
* Standard terminal interface dispatch table. Most of the fields point into
* "termio" code.
*/
TERM term = {
NROW-1,
NROW-1,
NCOL,
NCOL,
MARGIN,
SCRSIZ,
NPAUSE,
dg10open,
dg10close,
dg10kopen,
dg10kclose,
ttgetc,
ttputc,
ttflush,
dg10move,
dg10eeol,
dg10eeop,
dg10beep,
dg10rev,
dg10cres
#if COLOR
, dg10fcol,
dg10bcol
#endif
};
#if COLOR
VOID dg10fcol(color) /* set the current output color */
int color; /* color to set */
{
if (color == cfcolor)
return;
ttputc(ESC);
ttputc(0101);
ttputc(ctrans[color]);
cfcolor = color;
}
VOID dg10bcol(color) /* set the current background color */
int color; /* color to set */
{
if (color == cbcolor)
return;
ttputc(ESC);
ttputc(0102);
ttputc(ctrans[color]);
cbcolor = color;
}
#endif
VOID dg10move(row, col)
{
ttputc(16);
ttputc(col);
ttputc(row);
}
VOID dg10eeol()
{
ttputc(11);
}
VOID dg10eeop()
{
#if COLOR
dg10fcol(gfcolor);
dg10bcol(gbcolor);
#endif
ttputc(ESC);
ttputc(0106);
ttputc(0106);
}
VOID dg10rev(state) /* change reverse video state */
int state; /* TRUE = reverse, FALSE = normal */
{
#if COLOR
if (state == TRUE) {
dg10fcol(0);
dg10bcol(7);
}
#else
ttputc(ESC);
ttputc(state ? 0104: 0105);
#endif
}
dg10cres() /* change screen resolution */
{
return(TRUE);
}
spal() /* change palette string */
{
/* Does nothing here */
}
VOID dg10beep()
{
ttputc(BEL);
ttflush();
}
dg10open()
{
strcpy(sres, "NORMAL");
revexist = TRUE;
ttopen();
}
dg10close()
{
#if COLOR
dg10fcol(7);
dg10bcol(0);
#endif
ttclose();
}
dg10kopen()
{
}
dg10kclose()
{
}
#if FLABEL
fnclabel(f, n) /* label a function key */
int f,n; /* default flag, numeric argument [unused] */
{
/* on machines with no function keys...don't bother */
return(TRUE);
}
#endif
#else
VOID dg10hello()
{
}
#endif