source: buchla-68k/orig/RAM/TDFIELD.C@ d21fc6f

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

Imported original source code.

  • Property mode set to 100755
File size: 11.3 KB
RevLine 
[3ae31e9]1/*
2 =============================================================================
3 tdfield.c -- MIDAS-VII tuning display field processing and cursor motion
4 Version 18 -- 1989-11-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "graphdef.h"
12#include "charset.h"
13#include "hwdefs.h"
14#include "curpak.h"
15
16#include "midas.h"
17#include "tundsp.h"
18
19extern short select(), whatbox(), nokey(), stdctp0();
20extern short cxkstd(), cykstd(), stdmkey(), stddkey();
21
22extern short et_null(), ef_null(), rd_null(), nd_null();
23extern short et_ttab(), ef_ttab(), rd_ttab(), nd_ttab();
24extern short et_tval(), ef_tval(), rd_tval(), nd_tval();
25extern short et_tpch(), ef_tpch(), rd_tpch(), nd_tpch();
26
27extern char *memset();
28
29extern short cxval, cyval, cxrate, cyrate;
30extern short stcrow, stccol, submenu, vtcrow, vtccol, vtwrow, vtwcol;
31extern short vtxval, vtyval;
32
33extern short crate1[];
34
35extern struct selbox *csbp;
36extern struct selbox tdboxes[];
37
38extern short tunmod, tdnamsw;
39
40/* forward references */
41
42short tdcxupd(), tdcyupd();
43
44/*
45
46*/
47
48struct fet td_fet1[] = { /* field definitions */
49
50 { 0, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
51 { 1, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
52 { 2, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
53 { 3, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
54 { 4, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
55 { 5, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
56 { 6, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
57 { 7, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
58 { 8, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
59 { 9, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
60 {10, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
61 {11, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
62 {12, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
63 {13, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
64 {14, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
65 {15, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
66 {16, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
67 {17, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
68 {18, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
69 {19, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
70 {20, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
71 {21, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
72 {22, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
73 {23, 6, 10, 0, et_tpch, ef_tpch, rd_tpch, nd_tpch},
74
75 { 0, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
76 { 1, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
77 { 2, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
78 { 3, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
79 { 4, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
80 { 5, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
81 { 6, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
82 { 7, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
83 { 8, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
84 { 9, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
85 {10, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
86 {11, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
87 {12, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
88 {13, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
89 {14, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
90 {15, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
91 {16, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
92 {17, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
93 {18, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
94 {19, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
95 {20, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
96 {21, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
97 {22, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
98 {23, 16, 20, 1, et_tpch, ef_tpch, rd_tpch, nd_tpch},
99/*
100
101*/
102 { 0, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
103 { 1, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
104 { 2, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
105 { 3, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
106 { 4, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
107 { 5, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
108 { 6, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
109 { 7, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
110 { 8, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
111 { 9, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
112 {10, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
113 {11, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
114 {12, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
115 {13, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
116 {14, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
117 {15, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
118 {16, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
119 {17, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
120 {18, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
121 {19, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
122 {20, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
123 {21, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
124 {22, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
125 {23, 26, 30, 2, et_tpch, ef_tpch, rd_tpch, nd_tpch},
126
127 { 0, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
128 { 1, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
129 { 2, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
130 { 3, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
131 { 4, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
132 { 5, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
133 { 6, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
134 { 7, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
135 { 8, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
136 { 9, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
137 {10, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
138 {11, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
139 {12, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
140 {13, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
141 {14, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
142 {15, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
143 {16, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
144 {17, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
145 {18, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
146 {19, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
147 {20, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
148 {21, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
149 {22, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
150 {23, 36, 40, 3, et_tpch, ef_tpch, rd_tpch, nd_tpch},
151/*
152
153*/
154 { 0, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
155 { 1, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
156 { 2, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
157 { 3, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
158 { 4, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
159 { 5, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
160 { 6, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
161 { 7, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
162 { 8, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
163 { 9, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
164 {10, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
165 {11, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
166 {12, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
167 {13, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
168 {14, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
169 {15, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
170 {16, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
171 {17, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
172 {18, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
173 {19, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
174 {20, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
175 {21, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
176 {22, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
177 {23, 47, 51, 4, et_tpch, ef_tpch, rd_tpch, nd_tpch},
178
179 { 0, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
180 { 1, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
181 { 2, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
182 { 3, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
183 { 4, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
184 { 5, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
185 { 6, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
186 { 7, 58, 62, 5, et_tpch, ef_tpch, rd_tpch, nd_tpch},
187
188 {18, 58, 62, 6, et_tval, ef_tval, rd_tval, nd_tval},
189
190 {24, 7, 38, 7, et_null, ef_null, rd_null, nd_null},
191 {24, 61, 61, 6, et_ttab, ef_ttab, rd_ttab, nd_ttab},
192
193 { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
194};
195
196/*
197
198*/
199
200short tdbox[][8] = { /* display box parameters */
201
202 { 0, 0, 95, 335, TCFBX00, TCBBX00, 0, 1}, /* 0 */
203 { 96, 0, 175, 335, TCFBX01, TCBBX01, 0, 13}, /* 1 */
204 {176, 0, 255, 335, TCFBX02, TCBBX02, 0, 23}, /* 2 */
205 {256, 0, 335, 335, TCFBX03, TCBBX03, 0, 33}, /* 3 */
206 {336, 0, 423, 335, TCFBX04, TCBBX04, 0, 43}, /* 4 */
207 {424, 0, 511, 118, TCFBX05, TCBBX05, 0, 54}, /* 5 */
208 {424, 119, 511, 349, TCFBX06, TCBBX06, 9, 54}, /* 6 */
209 { 0, 336, 423, 349, TCFBX07, TCBBX07, 24, 1} /* 7 */
210};
211
212char *tdbxlb[] = { /* display box labels */
213
214 "", /* 0 */
215 "", /* 1 */
216 "", /* 2 */
217 "", /* 3 */
218 "", /* 4 */
219 "", /* 5 */
220 "", /* 6 */
221 "Name:" /* 7 */
222};
223
224/*
225
226*/
227
228struct curpak td_flds = {
229
230 stdctp0, /* curtype */
231 nokey, /* premove */
232 nokey, /* pstmove */
233 cxkstd, /* cx_key */
234 cykstd, /* cy_key */
235 tdcxupd, /* cx_upd */
236 tdcyupd, /* cy_upd */
237 nokey, /* xy_up */
238 nokey, /* xy_dn */
239 nokey, /* x_key */
240 select, /* e_key */
241 stdmkey, /* m_key */
242 stddkey, /* d_key */
243 nokey, /* not_fld */
244 td_fet1, /* curfet */
245 tdboxes, /* csbp */
246 crate1, /* cratex */
247 crate1, /* cratey */
248 CT_TEXT, /* cmtype */
249 TDCURX, /* cxval */
250 TDCURY /* cyval */
251};
252
253/*
254
255*/
256
257/*
258 =============================================================================
259 tdcyupd() -- update cursor y location
260 =============================================================================
261*/
262
263tdcyupd()
264{
265 register short pval, vh, vl;
266
267 if (tdnamsw) { /* see if we're in the menu area */
268
269 vtcrow = YTOR(vtyval += cyrate);
270
271 if (vtcrow > (vtwrow + 2))
272 vtyval = RTOY(vtcrow = vtwrow + 2);
273 else if (vtcrow < vtwrow)
274 vtyval = RTOY(vtcrow = vtwrow);
275
276 } else { /* just moving the cursor */
277
278 cyval += cyrate;
279
280 if (cyval GT (CYMAX - 1))
281 cyval = CYMAX - 1;
282 else if (cyval LT 1)
283 cyval = 1;
284 }
285}
286
287/*
288
289*/
290
291/*
292 =============================================================================
293 tdcxupd() -- update cursor x location
294 =============================================================================
295*/
296
297tdcxupd()
298{
299
300 if (tdnamsw) { /* see if we're in the menu area */
301
302 vtccol = XTOC(vtxval += cxrate);
303
304 if (vtccol > (vtwcol + 29))
305 vtxval = CTOX(vtccol = vtwcol + 29);
306 else if (vtccol < vtwcol)
307 vtxval = CTOX(vtccol = vtwcol);
308
309 } else { /* just moving the cursor */
310
311 cxval += cxrate;
312
313 if (cxval GT (CXMAX- 1))
314 cxval = CXMAX - 1;
315 else if (cxval LT 1)
316 cxval = 1;
317 }
318}
319
320/*
321
322*/
323
324/*
325 =============================================================================
326 tdfield() -- setup field routines for the tuning editor
327 =============================================================================
328*/
329
330tdfield()
331{
332 tdnamsw = FALSE;
333 submenu = FALSE;
334
335 curset(&td_flds);
336}
Note: See TracBrowser for help on using the repository browser.