source: buchla-68k/ram/sqfield.c@ cbe2c15

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

Code compiles, doesn't link.

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