1 | /*
|
---|
2 | =============================================================================
|
---|
3 | sqfield.c -- MIDAS-VII sequence display field functions
|
---|
4 | Version 9 -- 1989-11-16 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #define DEBUGIT 0
|
---|
9 |
|
---|
10 | #include "stddefs.h"
|
---|
11 | #include "hwdefs.h"
|
---|
12 | #include "graphdef.h"
|
---|
13 | #include "vsdd.h"
|
---|
14 | #include "fields.h"
|
---|
15 | #include "curpak.h"
|
---|
16 | #include "patch.h"
|
---|
17 | #include "macros.h"
|
---|
18 |
|
---|
19 | #include "midas.h"
|
---|
20 | #include "ptdisp.h"
|
---|
21 |
|
---|
22 | #include "memory.h"
|
---|
23 |
|
---|
24 | #if DEBUGIT
|
---|
25 | extern short debugsw;
|
---|
26 |
|
---|
27 | short debugqf = 1;
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | extern void (*xy_up)(void);
|
---|
31 | extern void (*xy_dn)(void);
|
---|
32 | extern void (*premove)(void);
|
---|
33 | extern void (*pstmove)(void);
|
---|
34 | extern int16_t (*curtype)(void);
|
---|
35 |
|
---|
36 | extern void select(void);
|
---|
37 | extern void nokey(void);
|
---|
38 | extern int16_t nonf(int16_t k);
|
---|
39 | extern int16_t stdctp5(void);
|
---|
40 | extern void cxkstd(void);
|
---|
41 | extern void cykstd(void);
|
---|
42 | extern void stdmkey(void);
|
---|
43 | extern void stddkey(int16_t k);
|
---|
44 | extern void stopsm(void);
|
---|
45 | extern void smxupd(void);
|
---|
46 | extern void sqyupd(void);
|
---|
47 | extern void postcm(void);
|
---|
48 |
|
---|
49 | extern int16_t astat;
|
---|
50 | extern int16_t cmfirst;
|
---|
51 | extern int16_t cmtype;
|
---|
52 | extern int16_t curhold;
|
---|
53 | extern int16_t curslin;
|
---|
54 | extern int16_t cvtime;
|
---|
55 | extern int16_t cvwait;
|
---|
56 | extern int16_t ncvwait;
|
---|
57 | extern int16_t sqdeflg;
|
---|
58 | extern int16_t stccol;
|
---|
59 | extern int16_t ss_ptsw;
|
---|
60 | extern int16_t ss_sqsw;
|
---|
61 | extern int16_t syrate;
|
---|
62 | extern int16_t tvcwval;
|
---|
63 | extern int16_t vcwval;
|
---|
64 |
|
---|
65 | extern int16_t crate1[];
|
---|
66 |
|
---|
67 | extern struct selbox *csbp;
|
---|
68 | extern struct selbox sqboxes[];
|
---|
69 |
|
---|
70 | extern struct seqent seqbuf;
|
---|
71 |
|
---|
72 | extern int8_t sqdebuf[];
|
---|
73 |
|
---|
74 | void sqxkey(void);
|
---|
75 | void sqekey(void);
|
---|
76 | void sqmkey(void);
|
---|
77 | void sqdkey(int16_t k);
|
---|
78 |
|
---|
79 | extern void curset(struct curpak *s);
|
---|
80 | extern void dcursq(void);
|
---|
81 | extern void dsqlin(int8_t *buf, int16_t slin);
|
---|
82 |
|
---|
83 | /* |
---|
84 |
|
---|
85 | */
|
---|
86 |
|
---|
87 | struct curpak sq_flds = {
|
---|
88 |
|
---|
89 | stdctp5, /* curtype */
|
---|
90 | nokey, /* premove */
|
---|
91 | postcm, /* pstmove */
|
---|
92 | cxkstd, /* cx_key */
|
---|
93 | cykstd, /* cy_key */
|
---|
94 | smxupd, /* cx_upd */
|
---|
95 | sqyupd, /* cy_upd */
|
---|
96 | stopsm, /* xy_up */
|
---|
97 | nokey, /* xy_dn */
|
---|
98 | sqxkey, /* x_key */
|
---|
99 | sqekey, /* e_key */
|
---|
100 | sqmkey, /* m_key */
|
---|
101 | sqdkey, /* d_key */
|
---|
102 | nonf, /* not_fld */
|
---|
103 | (struct fet *)NULL, /* curfet */
|
---|
104 | sqboxes, /* csbp */
|
---|
105 | crate1, /* cratex */
|
---|
106 | crate1, /* cratey */
|
---|
107 | CT_SMTH, /* cmtype */
|
---|
108 | CTOX(2), /* cxval */
|
---|
109 | RTOY(DATAROW) /* cyval */
|
---|
110 | };
|
---|
111 |
|
---|
112 | /* |
---|
113 |
|
---|
114 | */
|
---|
115 |
|
---|
116 | /*
|
---|
117 | =============================================================================
|
---|
118 | sqmkey() -- M key processing for the sequence display
|
---|
119 | =============================================================================
|
---|
120 | */
|
---|
121 |
|
---|
122 | void sqmkey(void)
|
---|
123 | {
|
---|
124 | register int16_t nc;
|
---|
125 |
|
---|
126 | if (astat) {
|
---|
127 |
|
---|
128 | if (stccol EQ 48) {
|
---|
129 |
|
---|
130 | if (ss_ptsw EQ 0) {
|
---|
131 |
|
---|
132 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
133 |
|
---|
134 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
135 |
|
---|
136 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
137 |
|
---|
138 | cvtime = syrate;
|
---|
139 | ncvwait = curhold;
|
---|
140 |
|
---|
141 | ss_sqsw = -1;
|
---|
142 | cmtype = nc;
|
---|
143 | cvwait = 1;
|
---|
144 | }
|
---|
145 |
|
---|
146 | } else
|
---|
147 | stdmkey();
|
---|
148 |
|
---|
149 | } else {
|
---|
150 |
|
---|
151 | if (stccol EQ 48) {
|
---|
152 |
|
---|
153 | ss_sqsw = 0;
|
---|
154 | cvwait = 1;
|
---|
155 | ncvwait = cvtime;
|
---|
156 | cmfirst = TRUE;
|
---|
157 |
|
---|
158 | if (ss_ptsw EQ 0)
|
---|
159 | (*xy_up)();
|
---|
160 |
|
---|
161 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
162 |
|
---|
163 | } else
|
---|
164 | stdmkey();
|
---|
165 | }
|
---|
166 | }
|
---|
167 |
|
---|
168 | /* |
---|
169 |
|
---|
170 | */
|
---|
171 |
|
---|
172 | /*
|
---|
173 | =============================================================================
|
---|
174 | sqekey() -- E key processing for the sequence display
|
---|
175 | =============================================================================
|
---|
176 | */
|
---|
177 |
|
---|
178 | void sqekey(void)
|
---|
179 | {
|
---|
180 | register int16_t nc;
|
---|
181 |
|
---|
182 | if (astat) {
|
---|
183 |
|
---|
184 | if (stccol EQ 48) {
|
---|
185 |
|
---|
186 | if (ss_ptsw EQ 0) {
|
---|
187 |
|
---|
188 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
189 |
|
---|
190 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
191 |
|
---|
192 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
193 |
|
---|
194 | cvtime = syrate;
|
---|
195 | ncvwait = curhold;
|
---|
196 |
|
---|
197 | ss_sqsw = 1;
|
---|
198 | cmtype = nc;
|
---|
199 | cvwait = 1;
|
---|
200 | }
|
---|
201 |
|
---|
202 | } else
|
---|
203 | select();
|
---|
204 |
|
---|
205 | } else {
|
---|
206 |
|
---|
207 | if (stccol EQ 48) {
|
---|
208 |
|
---|
209 | ss_sqsw = 0;
|
---|
210 | cvwait = 1;
|
---|
211 | ncvwait = cvtime;
|
---|
212 | cmfirst = TRUE;
|
---|
213 |
|
---|
214 | if (ss_ptsw EQ 0)
|
---|
215 | (*xy_up)();
|
---|
216 |
|
---|
217 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
218 |
|
---|
219 | } else
|
---|
220 | select();
|
---|
221 | }
|
---|
222 | }
|
---|
223 |
|
---|
224 | /* |
---|
225 |
|
---|
226 | */
|
---|
227 |
|
---|
228 | /*
|
---|
229 | =============================================================================
|
---|
230 | sqxkey() -- delete key handler
|
---|
231 | =============================================================================
|
---|
232 | */
|
---|
233 |
|
---|
234 | void sqxkey(void)
|
---|
235 | {
|
---|
236 | if (NOT astat)
|
---|
237 | return;
|
---|
238 |
|
---|
239 | if (inrange(stccol, 2, 4)) {
|
---|
240 |
|
---|
241 | memsetw(&seqbuf, 0, NSEQW);
|
---|
242 | memsetw(&seqtab[curslin], 0, NSEQW);
|
---|
243 | dsqlin(sqdebuf, curslin);
|
---|
244 | sqdeflg = TRUE;
|
---|
245 | dcursq();
|
---|
246 |
|
---|
247 | } else if (inrange(stccol, 12, 22)) {
|
---|
248 |
|
---|
249 | seqtab[curslin].seqact1 = 0;
|
---|
250 | seqtab[curslin].seqdat1 = 0;
|
---|
251 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
252 | dsqlin(sqdebuf, curslin);
|
---|
253 | sqdeflg = TRUE;
|
---|
254 | dcursq();
|
---|
255 |
|
---|
256 | } else if (inrange(stccol, 24, 34)) {
|
---|
257 |
|
---|
258 | seqtab[curslin].seqact2 = 0;
|
---|
259 | seqtab[curslin].seqdat2 = 0;
|
---|
260 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
261 | dsqlin(sqdebuf, curslin);
|
---|
262 | sqdeflg = TRUE;
|
---|
263 | dcursq();
|
---|
264 |
|
---|
265 | } else if (inrange(stccol, 36, 46)) {
|
---|
266 |
|
---|
267 | seqtab[curslin].seqact3 = 0;
|
---|
268 | seqtab[curslin].seqdat3 = 0;
|
---|
269 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
270 | dsqlin(sqdebuf, curslin);
|
---|
271 | sqdeflg = TRUE;
|
---|
272 | dcursq();
|
---|
273 | }
|
---|
274 | }
|
---|
275 |
|
---|
276 | /* |
---|
277 |
|
---|
278 | */
|
---|
279 |
|
---|
280 | /*
|
---|
281 | =============================================================================
|
---|
282 | sqfield() -- setup field routines for the sequence editor
|
---|
283 | =============================================================================
|
---|
284 | */
|
---|
285 |
|
---|
286 | void sqfield(void)
|
---|
287 | {
|
---|
288 |
|
---|
289 | #if DEBUGIT
|
---|
290 | if (debugsw AND debugqf)
|
---|
291 | printf("sqfield(): ENTRY\n");
|
---|
292 | #endif
|
---|
293 |
|
---|
294 | curset(&sq_flds);
|
---|
295 |
|
---|
296 | #if DEBUGIT
|
---|
297 | if (debugsw AND debugqf)
|
---|
298 | printf("sqfield(): EXIT\n");
|
---|
299 | #endif
|
---|
300 |
|
---|
301 | }
|
---|