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

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

Removed form-feed comments.

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