1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etadep.c -- MIDAS assignment editor - phase shifter depth field
|
---|
4 | Version 4 -- 1987-12-19 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "stddefs.h"
|
---|
9 | #include "fields.h"
|
---|
10 | #include "vsdd.h"
|
---|
11 | #include "vsddsw.h"
|
---|
12 | #include "graphdef.h"
|
---|
13 |
|
---|
14 | #include "midas.h"
|
---|
15 | #include "asgdsp.h"
|
---|
16 |
|
---|
17 | #include "stdio.h"
|
---|
18 |
|
---|
19 | extern void advacur(void);
|
---|
20 | extern void modasg(void);
|
---|
21 | extern void sendval(int16_t voice, int16_t par, int16_t ival);
|
---|
22 |
|
---|
23 | extern uint16_t *asgob;
|
---|
24 |
|
---|
25 | extern int16_t stcrow, stccol;
|
---|
26 | extern int16_t ps_dpth;
|
---|
27 |
|
---|
28 | extern int16_t adbox[][8];
|
---|
29 |
|
---|
30 | extern int8_t dspbuf[];
|
---|
31 |
|
---|
32 | /* |
---|
33 |
|
---|
34 | */
|
---|
35 |
|
---|
36 | /*
|
---|
37 | =============================================================================
|
---|
38 | et_adep() -- load the edit buffer
|
---|
39 | =============================================================================
|
---|
40 | */
|
---|
41 |
|
---|
42 | int16_t et_adep(int16_t n)
|
---|
43 | {
|
---|
44 | sprintf(ebuf, "%02d", ps_dpth);
|
---|
45 | ebflag = TRUE;
|
---|
46 |
|
---|
47 | return(SUCCESS);
|
---|
48 | }
|
---|
49 |
|
---|
50 | /*
|
---|
51 | =============================================================================
|
---|
52 | ef_adep() -- parse (unload) the edit buffer
|
---|
53 | =============================================================================
|
---|
54 | */
|
---|
55 |
|
---|
56 | int16_t ef_adep(int16_t n)
|
---|
57 | {
|
---|
58 | register int16_t i, tmpval;
|
---|
59 |
|
---|
60 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
61 | ebflag = FALSE;
|
---|
62 | tmpval = 0;
|
---|
63 |
|
---|
64 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
65 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
66 |
|
---|
67 | ps_dpth = tmpval;
|
---|
68 | sendval(3, 0, ((ps_dpth * 10) << 5));
|
---|
69 | modasg();
|
---|
70 | return(SUCCESS);
|
---|
71 | }
|
---|
72 |
|
---|
73 | /* |
---|
74 |
|
---|
75 | */
|
---|
76 |
|
---|
77 | /*
|
---|
78 | =============================================================================
|
---|
79 | rd_adep() -- (re)display the field
|
---|
80 | =============================================================================
|
---|
81 | */
|
---|
82 |
|
---|
83 | int16_t rd_adep(int16_t nn)
|
---|
84 | {
|
---|
85 | register int16_t n;
|
---|
86 |
|
---|
87 | n = nn & 0xFF;
|
---|
88 | sprintf(dspbuf, "%02.2d", ps_dpth);
|
---|
89 |
|
---|
90 | vbank(0);
|
---|
91 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
92 | adbox[n][6] + 3, adbox[n][7] + 8, dspbuf, 14);
|
---|
93 |
|
---|
94 | return(SUCCESS);
|
---|
95 | }
|
---|
96 |
|
---|
97 | /*
|
---|
98 | =============================================================================
|
---|
99 | nd_adep() -- handle new data entry
|
---|
100 | =============================================================================
|
---|
101 | */
|
---|
102 |
|
---|
103 | int16_t nd_adep(int16_t nn, int16_t k)
|
---|
104 | {
|
---|
105 | register int16_t ec, n;
|
---|
106 |
|
---|
107 | n = nn & 0xFF;
|
---|
108 |
|
---|
109 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
110 |
|
---|
111 | ebuf[ec] = k + '0';
|
---|
112 | ebuf[2] = '\0';
|
---|
113 |
|
---|
114 | dspbuf[0] = k + '0';
|
---|
115 | dspbuf[1] = '\0';
|
---|
116 |
|
---|
117 | vbank(0);
|
---|
118 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
119 |
|
---|
120 | advacur();
|
---|
121 | return(SUCCESS);
|
---|
122 | }
|
---|
123 |
|
---|