source: buchla-68k/ram/tdfield.c@ 6262b5c

Last change on this file since 6262b5c was 6262b5c, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added include files for global functions and variables.

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