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