source: buchla-68k/orig/RAM/ETINST.C@ 4f508e6

Last change on this file since 4f508e6 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 3.2 KB
Line 
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
21extern unsigned *obj8;
22
23extern short ctrsw;
24extern short recsw;
25extern short stccol;
26
27extern short grpmode[];
28extern short grpstat[];
29extern short ins2grp[];
30
31extern struct gdsel *gdstbc[];
32
33/*
34 =============================================================================
35 et_inst() -- load edit buffer
36 =============================================================================
37*/
38
39short
40et_inst(n)
41short n;
42{
43 sprintf(ebuf, "%02.2d", ins2grp[n] & 0x00FF);
44 ebflag = TRUE;
45
46 return(SUCCESS);
47}
48
49/*
50
51*/
52
53/*
54 =============================================================================
55 ef_inst() -- parse edit buffer
56 =============================================================================
57*/
58
59short
60ef_inst(n)
61short n;
62{
63 register short ival;
64 register struct s_entry *ep;
65
66 ebuf[2] = '\0';
67 ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
68 ebflag = FALSE;
69
70 if (ival GE NINST)
71 return(FAILURE);
72
73 ins2grp[n] = ival | (ins2grp[n] & 0xFF00);
74 setv2gi(n);
75 setinst();
76
77 if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
78
79 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INST, n, -1))) {
80
81 ep->e_data2 = ival;
82
83 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
84
85 ep->e_type = EV_INST;
86 ep->e_data1 = n;
87 ep->e_data2 = ival;
88 ep->e_time = t_cur;
89 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
90 eh_ins(ep, EH_INST);
91 ctrsw = TRUE;
92 se_disp(ep, D_FWD, gdstbc, 1);
93 scupd();
94 }
95 }
96
97 return(SUCCESS);
98}
99
100/*
101
102*/
103
104/*
105 =============================================================================
106 rd_inst() -- (re)display the field
107 =============================================================================
108*/
109
110short
111rd_inst(n)
112short n;
113{
114 char buf[4];
115
116 sprintf(buf, "%02.2d", ins2grp[n] & 0x00FF);
117
118 if (v_regs[5] & 0x0180)
119 vbank(0);
120
121 vputs(obj8, 2, 7+(n*5), buf, SDW11ATR);
122
123 return(SUCCESS);
124}
125
126/*
127 =============================================================================
128 ds_inst() -- display all instrument to group assignments
129 =============================================================================
130*/
131
132ds_inst()
133{
134 register short i;
135
136 for (i = 0; i < 12; i++)
137 rd_inst(i);
138}
139
140/*
141
142*/
143
144/*
145 =============================================================================
146 nd_inst() -- data entry function
147 =============================================================================
148*/
149
150short
151nd_inst(n, k)
152register short n, k;
153{
154 register short ec;
155
156 ec = stccol - cfetp->flcol;
157 ebuf[ec] = k + '0';
158
159 if (v_regs[5] & 0x0180)
160 vbank(0);
161
162 vputc(obj8, 2, stccol, k + '0', SDW11DEA);
163 advscur();
164
165 return(SUCCESS);
166}
Note: See TracBrowser for help on using the repository browser.