1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etinst.c -- instrument field handlers
|
---|
4 | Version 23 -- 1988-07-11 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "stddefs.h"
|
---|
9 | #include "fields.h"
|
---|
10 | #include "hwdefs.h"
|
---|
11 | #include "graphdef.h"
|
---|
12 | #include "vsdd.h"
|
---|
13 | #include "vsddsw.h"
|
---|
14 | #include "score.h"
|
---|
15 | #include "scfns.h"
|
---|
16 |
|
---|
17 | #include "midas.h"
|
---|
18 | #include "scdsp.h"
|
---|
19 | #include "instdsp.h"
|
---|
20 |
|
---|
21 | extern unsigned *obj8;
|
---|
22 |
|
---|
23 | extern short ctrsw;
|
---|
24 | extern short recsw;
|
---|
25 | extern short stccol;
|
---|
26 |
|
---|
27 | extern short grpmode[];
|
---|
28 | extern short grpstat[];
|
---|
29 | extern short ins2grp[];
|
---|
30 |
|
---|
31 | extern struct gdsel *gdstbc[];
|
---|
32 |
|
---|
33 | /*
|
---|
34 | =============================================================================
|
---|
35 | et_inst() -- load edit buffer
|
---|
36 | =============================================================================
|
---|
37 | */
|
---|
38 |
|
---|
39 | short et_inst(short n)
|
---|
40 | {
|
---|
41 | sprintf(ebuf, "%02.2d", ins2grp[n] & 0x00FF);
|
---|
42 | ebflag = TRUE;
|
---|
43 |
|
---|
44 | return(SUCCESS);
|
---|
45 | }
|
---|
46 |
|
---|
47 | /* |
---|
48 |
|
---|
49 | */
|
---|
50 |
|
---|
51 | /*
|
---|
52 | =============================================================================
|
---|
53 | ef_inst() -- parse edit buffer
|
---|
54 | =============================================================================
|
---|
55 | */
|
---|
56 |
|
---|
57 | short ef_inst(short n)
|
---|
58 | {
|
---|
59 | register short ival;
|
---|
60 | register struct s_entry *ep;
|
---|
61 |
|
---|
62 | ebuf[2] = '\0';
|
---|
63 | ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
|
---|
64 | ebflag = FALSE;
|
---|
65 |
|
---|
66 | if (ival GE NINST)
|
---|
67 | return(FAILURE);
|
---|
68 |
|
---|
69 | ins2grp[n] = ival | (ins2grp[n] & 0xFF00);
|
---|
70 | setv2gi(n);
|
---|
71 | setinst();
|
---|
72 |
|
---|
73 | if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
|
---|
74 |
|
---|
75 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INST, n, -1))) {
|
---|
76 |
|
---|
77 | ep->e_data2 = ival;
|
---|
78 |
|
---|
79 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
80 |
|
---|
81 | ep->e_type = EV_INST;
|
---|
82 | ep->e_data1 = n;
|
---|
83 | ep->e_data2 = ival;
|
---|
84 | ep->e_time = t_cur;
|
---|
85 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
86 | eh_ins(ep, EH_INST);
|
---|
87 | ctrsw = TRUE;
|
---|
88 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
89 | scupd();
|
---|
90 | }
|
---|
91 | }
|
---|
92 |
|
---|
93 | return(SUCCESS);
|
---|
94 | }
|
---|
95 |
|
---|
96 | /* |
---|
97 |
|
---|
98 | */
|
---|
99 |
|
---|
100 | /*
|
---|
101 | =============================================================================
|
---|
102 | rd_inst() -- (re)display the field
|
---|
103 | =============================================================================
|
---|
104 | */
|
---|
105 |
|
---|
106 | short rd_inst(short n)
|
---|
107 | {
|
---|
108 | char buf[4];
|
---|
109 |
|
---|
110 | sprintf(buf, "%02.2d", ins2grp[n] & 0x00FF);
|
---|
111 |
|
---|
112 | if (v_regs[5] & 0x0180)
|
---|
113 | vbank(0);
|
---|
114 |
|
---|
115 | vputs(obj8, 2, 7+(n*5), buf, SDW11ATR);
|
---|
116 |
|
---|
117 | return(SUCCESS);
|
---|
118 | }
|
---|
119 |
|
---|
120 | /*
|
---|
121 | =============================================================================
|
---|
122 | ds_inst() -- display all instrument to group assignments
|
---|
123 | =============================================================================
|
---|
124 | */
|
---|
125 |
|
---|
126 | void ds_inst(void)
|
---|
127 | {
|
---|
128 | register short i;
|
---|
129 |
|
---|
130 | for (i = 0; i < 12; i++)
|
---|
131 | rd_inst(i);
|
---|
132 | }
|
---|
133 |
|
---|
134 | /* |
---|
135 |
|
---|
136 | */
|
---|
137 |
|
---|
138 | /*
|
---|
139 | =============================================================================
|
---|
140 | nd_inst() -- data entry function
|
---|
141 | =============================================================================
|
---|
142 | */
|
---|
143 |
|
---|
144 | short nd_inst(short n, short k)
|
---|
145 | {
|
---|
146 | register short ec;
|
---|
147 |
|
---|
148 | ec = stccol - cfetp->flcol;
|
---|
149 | ebuf[ec] = k + '0';
|
---|
150 |
|
---|
151 | if (v_regs[5] & 0x0180)
|
---|
152 | vbank(0);
|
---|
153 |
|
---|
154 | vputc(obj8, 2, stccol, k + '0', SDW11DEA);
|
---|
155 | advscur();
|
---|
156 |
|
---|
157 | return(SUCCESS);
|
---|
158 | }
|
---|