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

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

Removed form-feed comments.

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