source: buchla-68k/ram/etinst.c@ b28a12e

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

Zero redundant declarations.

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