source: buchla-68k/ram/etidin.c@ dade7a0

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*
2 =============================================================================
3 etidin.c -- MIDAS instrument editor - instrument number field handlers
4 Version 28 -- 1988-09-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10#define DIN_OFF 14
11
12/*
13 =============================================================================
14 et_idin() -- load the edit buffer
15 =============================================================================
16*/
17
18int16_t et_idin(int16_t n)
19{
20 (void)n;
21
22 sprintf(ebuf, "%02d", curinst);
23 ebflag = TRUE;
24
25 return(SUCCESS);
26}
27
28
29/*
30 =============================================================================
31 ef_idin() -- parse (unload) the edit buffer
32 =============================================================================
33*/
34
35int16_t ef_idin(int16_t n)
36{
37 register int16_t i, tmpval, j;
38
39 (void)n;
40
41 if (idcfsw) { /* 'E' with menu up */
42
43 if (vtcrow EQ 22) { /* fetch or escape */
44
45 if (vtccol LT 35) {
46
47 newinst(idintmp);
48 execins(curvce, curinst, 1);
49
50 if (NOT editsw) {
51
52 if ((i = vce2grp[curvce]) > 0) {
53
54 for (j =0; j < 12; j++)
55 if (vce2grp[j] EQ i)
56 execins(j, curinst, 1);
57 }
58 }
59 }
60
61 objclr(TTCPRI);
62 idvlblc();
63 idcfsw = FALSE;
64 submenu = FALSE;
65
66 if (vtccol LT 35) {
67
68 allwins();
69
70 } else {
71
72 dswin(22);
73 dswin(19);
74 }
75
76 } else if (vtcrow EQ 23) { /* copy to library */
77
78 if (idintmp) {
79
80 memcpyw(&idefs[idintmp], &vbufs[curvce],
81 (sizeof (struct instdef) / 2));
82
83 curinst = idintmp;
84 instmod[curvce] = FALSE;
85 }
86
87 objclr(TTCPRI);
88 idvlblc();
89 idcfsw = FALSE;
90 submenu = FALSE;
91 dswin(22);
92 dswin(19);
93
94 if (idintmp EQ 0)
95 return(FAILURE);
96
97 } else
98 return(FAILURE);
99
100 return(SUCCESS);
101
102 } else { /* 'E' with menu not up */
103
104 ebuf[2] = '\0'; /* terminate the string in ebuf */
105 ebflag = FALSE;
106
107 tmpval = 0;
108
109 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
110 tmpval = (tmpval * 10) + (ebuf[i] - '0');
111
112 if (tmpval GE NINST) /* check the range */
113 return(FAILURE);
114
115 idintmp = tmpval; /* save selected value */
116 idcpfch(); /* put up copy/fetch menu */
117 dswin(22);
118 SetPri(TTCURS, TTCPRI);
119 ttcpos(22, 17);
120 idcfsw = TRUE;
121 submenu = TRUE;
122 return(SUCCESS);
123 }
124}
125
126/*
127 =============================================================================
128 rd_idin() -- (re)display the field
129 =============================================================================
130*/
131
132int16_t rd_idin(int16_t n)
133{
134 if (idcfsw) /* don't display if copy/fetch is up */
135 return(FAILURE);
136
137 /* convert to ASCII */
138
139 sprintf(dspbuf, "%02d", curinst);
140
141 vbank(0); /* display the value */
142
143 vcputsv(instob, 64, (instmod[curvce] ? ID_CHGD : idbox[n][4]),
144 idbox[n][5], idbox[n][6], idbox[n][7] + DIN_OFF, dspbuf, 14);
145
146 return(SUCCESS);
147}
148
149/*
150 =============================================================================
151 nd_idin() -- handle new data entry
152 =============================================================================
153*/
154
155int16_t nd_idin(int16_t n, int16_t k)
156{
157 register int16_t ec;
158
159 ec = stccol - cfetp->flcol; /* setup edit buffer column */
160 ebuf[ec] = k + '0';
161 ebuf[2] = '\0';
162
163 dspbuf[0] = k + '0';
164 dspbuf[1] = '\0';
165
166 vbank(0);
167
168 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
169 idbox[n][6], stccol, dspbuf, 14);
170
171 advicur();
172
173 return(SUCCESS);
174}
175
176
Note: See TracBrowser for help on using the repository browser.