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

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

Use standard integer types.

  • Property mode set to 100644
File size: 3.0 KB
RevLine 
[f40a309]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
[7258c6a]21extern uint16_t *obj8;
[f40a309]22
[7258c6a]23extern int16_t ctrsw;
24extern int16_t recsw;
25extern int16_t stccol;
[f40a309]26
[7258c6a]27extern int16_t grpmode[];
28extern int16_t grpstat[];
29extern int16_t ins2grp[];
[f40a309]30
31extern struct gdsel *gdstbc[];
32
33/*
34 =============================================================================
35 et_inst() -- load edit buffer
36 =============================================================================
37*/
38
[7258c6a]39int16_t et_inst(int16_t n)
[f40a309]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*/
[7258c6a]56
[f40a309]57int16_t ef_inst(int16_t n)
[7258c6a]58{
[f40a309]59 register int16_t 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 =============================================================================
[7258c6a]104*/
[f40a309]105
[7258c6a]106int16_t rd_inst(int16_t n)
[f40a309]107{
108 int8_t 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 =============================================================================
[0580615]124*/
[f40a309]125
[7258c6a]126void ds_inst(void)
[f40a309]127{
128 register int16_t 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
[7258c6a]141 =============================================================================
[f40a309]142*/
[7258c6a]143
[f40a309]144int16_t nd_inst(int16_t n, int16_t k)
145{
146 register int16_t 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}
Note: See TracBrowser for help on using the repository browser.