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

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

Added include files for global functions and variables.

  • 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 "all.h"
11
12#if DEBUGIT
13extern short debugsw;
14
15short debugqf = 1;
16#endif
17
18extern void (*xy_up)(void);
19extern void (*xy_dn)(void);
20extern void (*premove)(void);
21extern void (*pstmove)(void);
22extern int16_t (*curtype)(void);
23
24extern void select(void);
25extern void nokey(void);
26extern int16_t nonf(int16_t k);
27extern int16_t stdctp5(void);
28extern void cxkstd(void);
29extern void cykstd(void);
30extern void stdmkey(void);
31extern void stddkey(int16_t k);
32extern void stopsm(void);
33extern void smxupd(void);
34extern void sqyupd(void);
35extern void postcm(void);
36
37extern int16_t astat;
38extern int16_t cmfirst;
39extern int16_t cmtype;
40extern int16_t curhold;
41extern int16_t curslin;
42extern int16_t cvtime;
43extern int16_t cvwait;
44extern int16_t ncvwait;
45extern int16_t sqdeflg;
46extern int16_t stccol;
47extern int16_t ss_ptsw;
48extern int16_t ss_sqsw;
49extern int16_t syrate;
50extern int16_t tvcwval;
51extern int16_t vcwval;
52
53extern int16_t crate1[];
54
55extern struct selbox *csbp;
56extern struct selbox sqboxes[];
57
58extern struct seqent seqbuf;
59
60extern int8_t sqdebuf[];
61
62void sqxkey(void);
63void sqekey(void);
64void sqmkey(void);
65void sqdkey(int16_t k);
66
67extern void curset(struct curpak *s);
68extern void dcursq(void);
69extern void dsqlin(int8_t *buf, int16_t slin);
70
71/*
72
73*/
74
75struct curpak sq_flds = {
76
77 stdctp5, /* curtype */
78 nokey, /* premove */
79 postcm, /* pstmove */
80 cxkstd, /* cx_key */
81 cykstd, /* cy_key */
82 smxupd, /* cx_upd */
83 sqyupd, /* cy_upd */
84 stopsm, /* xy_up */
85 nokey, /* xy_dn */
86 sqxkey, /* x_key */
87 sqekey, /* e_key */
88 sqmkey, /* m_key */
89 sqdkey, /* d_key */
90 nonf, /* not_fld */
91 (struct fet *)NULL, /* curfet */
92 sqboxes, /* csbp */
93 crate1, /* cratex */
94 crate1, /* cratey */
95 CT_SMTH, /* cmtype */
96 CTOX(2), /* cxval */
97 RTOY(DATAROW) /* cyval */
98};
99
100/*
101
102*/
103
104/*
105 =============================================================================
106 sqmkey() -- M key processing for the sequence display
107 =============================================================================
108*/
109
110void sqmkey(void)
111{
112 register int16_t nc;
113
114 if (astat) {
115
116 if (stccol EQ 48) {
117
118 if (ss_ptsw EQ 0) {
119
120 (*xy_dn)(); /* handle KEY_DOWN functions */
121
122 (*premove)(); /* handle PRE-MOVE functions */
123
124 nc = (*curtype)(); /* get new CURSOR TYPE wanted */
125
126 cvtime = syrate;
127 ncvwait = curhold;
128
129 ss_sqsw = -1;
130 cmtype = nc;
131 cvwait = 1;
132 }
133
134 } else
135 stdmkey();
136
137 } else {
138
139 if (stccol EQ 48) {
140
141 ss_sqsw = 0;
142 cvwait = 1;
143 ncvwait = cvtime;
144 cmfirst = TRUE;
145
146 if (ss_ptsw EQ 0)
147 (*xy_up)();
148
149 (*pstmove)(); /* handle POST-MOVE functions */
150
151 } else
152 stdmkey();
153 }
154}
155
156/*
157
158*/
159
160/*
161 =============================================================================
162 sqekey() -- E key processing for the sequence display
163 =============================================================================
164*/
165
166void sqekey(void)
167{
168 register int16_t nc;
169
170 if (astat) {
171
172 if (stccol EQ 48) {
173
174 if (ss_ptsw EQ 0) {
175
176 (*xy_dn)(); /* handle KEY_DOWN functions */
177
178 (*premove)(); /* handle PRE-MOVE functions */
179
180 nc = (*curtype)(); /* get new CURSOR TYPE wanted */
181
182 cvtime = syrate;
183 ncvwait = curhold;
184
185 ss_sqsw = 1;
186 cmtype = nc;
187 cvwait = 1;
188 }
189
190 } else
191 select();
192
193 } else {
194
195 if (stccol EQ 48) {
196
197 ss_sqsw = 0;
198 cvwait = 1;
199 ncvwait = cvtime;
200 cmfirst = TRUE;
201
202 if (ss_ptsw EQ 0)
203 (*xy_up)();
204
205 (*pstmove)(); /* handle POST-MOVE functions */
206
207 } else
208 select();
209 }
210}
211
212/*
213
214*/
215
216/*
217 =============================================================================
218 sqxkey() -- delete key handler
219 =============================================================================
220*/
221
222void sqxkey(void)
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
274void sqfield(void)
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}
290
Note: See TracBrowser for help on using the repository browser.