source: buchla-68k/ram/etioas.c@ 7ecfb7b

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 9.6 KB
Line 
1/*
2 =============================================================================
3 etioas.c -- line 17 field handlers (I/O Assignment thru Interpolate)
4 Version 12 -- 1988-08-22 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10/*
11 =============================================================================
12 Assignment table field handlers
13 =============================================================================
14*/
15
16/*
17 =============================================================================
18 et_ioas() -- load edit buffer
19 =============================================================================
20*/
21
22int16_t et_ioas(int16_t n)
23{
24 (void)n;
25
26 sprintf(ebuf, "%02.2d", curasg);
27 ebflag = TRUE;
28
29 return(SUCCESS);
30}
31
32
33/*
34 =============================================================================
35 ef_ioas() -- parse edit buffer
36 =============================================================================
37*/
38
39int16_t ef_ioas(int16_t n)
40{
41 register int16_t ival;
42 register struct s_entry *ep;
43
44 (void)n;
45
46 ebuf[2] = '\0';
47 ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
48
49 ebflag = FALSE;
50
51 if (ival GE NASGS)
52 return(FAILURE);
53
54 getasg(curasg = ival);
55 mpcupd();
56
57 if (recsw) {
58
59 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_ASGN, -1, -1))) {
60
61 ep->e_data1 = ival;
62
63 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
64
65 ep->e_type = EV_ASGN;
66 ep->e_data1 = ival;
67 ep->e_time = t_cur;
68 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
69 eh_ins(ep, EH_ASGN);
70 ctrsw = TRUE;
71 se_disp(ep, D_FWD, gdstbc, 1);
72 scupd();
73 }
74 }
75
76 return(SUCCESS);
77}
78
79/*
80 =============================================================================
81 rd_ioas() -- (re)display the field
82 =============================================================================
83*/
84
85int16_t rd_ioas(int16_t n)
86{
87 (void)n;
88
89 sprintf(dspbuf, "%02.2d", curasg);
90
91 if (v_regs[5] & 0x0180)
92 vbank(0);
93
94 vputs(obj8, 1, 11, dspbuf, SDW04ATR);
95 return(SUCCESS);
96}
97
98/*
99 =============================================================================
100 nd_ioas() -- data entry function
101 =============================================================================
102*/
103
104int16_t nd_ioas(int16_t n, int16_t k)
105{
106 register int16_t ec;
107
108 (void)n;
109
110 ec = stccol - cfetp->flcol;
111 ebuf[ec] = k + '0';
112
113 if (v_regs[5] & 0x0180)
114 vbank(0);
115
116 vputc(obj8, 1, stccol, k + '0', SDW04DEA);
117 advscur();
118 return(SUCCESS);
119}
120
121/*
122 =============================================================================
123 Tuning field handlers
124 =============================================================================
125*/
126
127/*
128 =============================================================================
129 et_tune() -- load edit buffer
130 =============================================================================
131*/
132
133int16_t et_tune(int16_t n)
134{
135 (void)n;
136
137 ebuf[0] = '0' + curtun;
138 ebuf[1] = '\0';
139 ebflag = TRUE;
140 return(SUCCESS);
141}
142
143/*
144 =============================================================================
145 ef_tune() -- parse edit buffer
146 =============================================================================
147*/
148
149int16_t ef_tune(int16_t n)
150{
151 register int16_t ival;
152 register struct s_entry *ep;
153
154 (void)n;
155
156 ebuf[1] = '\0';
157 ival = ebuf[0] - '0';
158 ebflag = FALSE;
159 gettun(ival);
160
161 if (recsw) {
162
163 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_TUNE, -1, -1))) {
164
165 ep->e_data1 = ival;
166
167 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
168
169 ep->e_type = EV_TUNE;
170 ep->e_data1 = ival;
171 ep->e_time = t_cur;
172 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
173 eh_ins(ep, EH_TUNE);
174 ctrsw = TRUE;
175 se_disp(ep, D_FWD, gdstbc, 1);
176 scupd();
177 }
178 }
179
180 return(SUCCESS);
181}
182
183/*
184 =============================================================================
185 rd_tune() -- (re)display the field
186 =============================================================================
187*/
188
189int16_t rd_tune(int16_t n)
190{
191 (void)n;
192
193 if (v_regs[5] & 0x0180)
194 vbank(0);
195
196 vputc(obj8, 1, 19, curtun + '0', SDW05ATR);
197
198 return(SUCCESS);
199}
200
201/*
202 =============================================================================
203 nd_tune() -- data entry function
204 =============================================================================
205*/
206
207int16_t nd_tune(int16_t n, int16_t k)
208{
209 (void)n;
210
211 ebuf[0] = k + '0';
212
213 if (v_regs[5] & 0x0180)
214 vbank(0);
215
216 vputc(obj8, 1, stccol, k + '0', SDW05DEA);
217
218 return(SUCCESS);
219}
220
221/*
222 =============================================================================
223 Tempo field handlers
224 =============================================================================
225*/
226
227/*
228 =============================================================================
229 et_tmpo() -- load edit buffer
230 =============================================================================
231*/
232
233int16_t et_tmpo(int16_t n)
234{
235 (void)n;
236
237 sprintf(ebuf, "%03.3d", tmpoval);
238 ebflag = TRUE;
239
240 return(SUCCESS);
241}
242
243/*
244 =============================================================================
245 ef_tmpo() -- parse edit buffer
246 =============================================================================
247*/
248
249int16_t ef_tmpo(int16_t n)
250{
251 register int16_t ival;
252 register struct s_entry *ep;
253
254 (void)n;
255
256 ebuf[3] = '\0';
257 ival = ((ebuf[0] - '0') * 100) + ((ebuf[1] - '0') * 10)
258 + (ebuf[2] - '0');
259
260 ebflag = FALSE;
261
262 if ((ival GT 240) OR (ival LT 4))
263 return(FAILURE);
264
265 settmpo(ival);
266
267 if (recsw) {
268
269 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_TMPO, -1, -1))) {
270
271 ep->e_data1 = ival;
272
273 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
274
275 ep->e_type = EV_TMPO;
276 ep->e_data1 = ival;
277 ep->e_time = t_cur;
278 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
279 eh_ins(ep, EH_TMPO);
280 ctrsw = TRUE;
281 se_disp(ep, D_FWD, gdstbc, 1);
282 scupd();
283 }
284 }
285
286 return(SUCCESS);
287}
288
289/*
290 =============================================================================
291 rd_tmpo() -- (re)display the field
292 =============================================================================
293*/
294
295int16_t rd_tmpo(int16_t n)
296{
297 (void)n;
298
299 sprintf(dspbuf, "%03.3d", tmpoval);
300
301 if (v_regs[5] & 0x0180)
302 vbank(0);
303
304 vputs(obj8, 1, 27, dspbuf, SDW06ATR);
305
306 return(SUCCESS);
307}
308
309/*
310 =============================================================================
311 nd_tmpo() -- data entry function
312 =============================================================================
313*/
314
315int16_t nd_tmpo(int16_t n, int16_t k)
316{
317 register int16_t ec;
318
319 (void)n;
320
321 ec = stccol - cfetp->flcol;
322 ebuf[ec] = k + '0';
323
324 if (v_regs[5] & 0x0180)
325 vbank(0);
326
327 vputc(obj8, 1, stccol, k + '0', SDW06DEA);
328 advscur();
329
330 return(SUCCESS);
331}
332
333/*
334 =============================================================================
335 Interpolate field handlers
336 =============================================================================
337*/
338
339/*
340 =============================================================================
341 et_intp() -- load edit buffer
342 =============================================================================
343*/
344
345int16_t et_intp(int16_t n)
346{
347 register int16_t th, tl;
348 register int32_t tt, sc, sf;
349
350 (void)n;
351
352 sc = 1000L;
353 sf = 100L;
354 tt = fromfpu(curintp);
355 th = tt / sc;
356 tl = (tt - (th * sc)) / sf;
357
358 sprintf(ebuf, "%02d.%d", th, tl);
359 ebflag = TRUE;
360
361 return(SUCCESS);
362}
363
364/*
365 =============================================================================
366 ef_intp() -- parse edit buffer
367 =============================================================================
368*/
369
370int16_t ef_intp(int16_t n)
371{
372 register int16_t i;
373 register uint16_t tmpval;
374 register struct s_entry *ep;
375
376 (void)n;
377
378 ebuf[2] = '.'; /* add implied decimal point */
379 ebuf[4] = '\0'; /* terminate the string in ebuf */
380 ebflag = FALSE;
381 tmpval = 0;
382
383 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
384 tmpval = (tmpval * 10) + (ebuf[i] - '0');
385
386 tmpval = ((tmpval * 10) + (ebuf[3] - '0')) * 100;
387
388 if (tmpval > (uint16_t)64900)
389 return(FAILURE);
390
391 if (tmpval EQ 0)
392 tmpval = 1;
393
394 curintp = tofpu(tmpval);
395
396 if (recsw) {
397
398 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INTP, -1, -1))) {
399
400 ep->e_data1 = (curintp >> 8);
401 ep->e_data2 = 0x00FF & curintp;
402
403 } else if (E_NULL NE (ep = e_alc(E_SIZE3))) {
404
405 ep->e_type = EV_INTP;
406 ep->e_time = t_cur;
407 ep->e_data1 = (curintp >> 8);
408 ep->e_data2 = 0x00FF & curintp;
409 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
410 eh_ins(ep, EH_INTP);
411 ctrsw = TRUE;
412 se_disp(ep, D_FWD, gdstbc, 1);
413 scupd();
414 }
415 }
416
417 return(SUCCESS);
418}
419
420/*
421 =============================================================================
422 rd_intp() -- (re)display the field
423 =============================================================================
424*/
425
426int16_t rd_intp(int16_t n)
427{
428 register int16_t th, tl;
429 register int32_t tt, sc, sf;
430
431 (void)n;
432
433 sc = 1000L;
434 sf = 100L;
435 tt = fromfpu(curintp);
436 th = tt / sc;
437 tl = (tt - (th * sc)) / sf;
438
439 sprintf(dspbuf, "%02d.%d", th, tl); /* convert to ASCII */
440
441 vbank(0); /* display the value */
442
443 vputs(obj8, 1, 35, dspbuf, SDW07ATR);
444
445 return(SUCCESS);
446}
447
448/*
449 =============================================================================
450 nd_intp() -- data entry function
451 =============================================================================
452*/
453
454int16_t nd_intp(int16_t n, int16_t k)
455{
456 register int16_t ec;
457
458 (void)n;
459
460 ec = stccol - cfetp->flcol; /* setup edit buffer column */
461
462 if (ec EQ 2)
463 return(FAILURE);
464
465 if ((ec EQ 0) AND (k > 6))
466 return(FAILURE);
467
468 if ((ec EQ 1) AND (ebuf[0] EQ '6') AND (k > 4))
469 return(FAILURE);
470
471 ebuf[ec] = k + '0';
472 ebuf[2] = '.';
473 ebuf[4] = '\0';
474
475 dspbuf[0] = k + '0';
476 dspbuf[1] = '\0';
477
478 vbank(0);
479
480 vputs(obj8, 1, stccol, dspbuf, SDW07DEA);
481
482 advscur();
483
484 if (stccol EQ 37)
485 advscur();
486
487 return(SUCCESS);
488}
489
Note: See TracBrowser for help on using the repository browser.