source: buchla-68k/orig/RAM/ETIRES.C@ c0cb375

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

Imported original source code.

  • Property mode set to 100755
File size: 3.0 KB
Line 
1/*
2 =============================================================================
3 etires.c -- instrument editor - resonance field handlers
4 Version 2 -- 1988-05-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define DEBUGIT 0
9
10#include "stddefs.h"
11#include "hwdefs.h"
12#include "fields.h"
13#include "vsdd.h"
14#include "vsddsw.h"
15#include "graphdef.h"
16
17#include "midas.h"
18#include "instdsp.h"
19
20extern unsigned *instob;
21
22extern short stcrow, stccol, curvce, curfunc;
23
24extern short idbox[][8];
25
26extern char dspbuf[];
27
28extern struct instdef vbufs[];
29
30extern struct instpnt *pntptr;
31
32short rsntab[] = { /* resonance table */
33
34 0, /* 0 = 0.00 */
35 (110 << 5), /* 1 = 1.10 */
36 (220 << 5), /* 2 = 2.20 */
37 (330 << 5), /* 3 = 3.30 */
38 (440 << 5), /* 4 = 4.40 */
39 (550 << 5), /* 5 = 5.50 */
40 (660 << 5), /* 6 = 6.60 */
41 (770 << 5), /* 7 = 7.70 */
42 (880 << 5), /* 8 = 8.80 */
43 (1000 << 5) /* 9 = 10.00 */
44};
45
46/*
47
48*/
49
50/*
51 =============================================================================
52 et_ires() -- load the edit buffer
53 =============================================================================
54*/
55
56short
57et_ires(n)
58short n;
59{
60 if (curfunc NE 4)
61 return(FAILURE);
62
63 ebuf[0] = '0' + vbufs[curvce].idhfnc[4].idfprm;
64 ebuf[1] = '\0';
65 ebflag = TRUE;
66 return(SUCCESS);
67}
68
69/*
70 =============================================================================
71 ef_ires() -- parse (unload) the edit buffer
72 =============================================================================
73*/
74
75short
76ef_ires(n)
77short n;
78{
79 register short tmpval;
80
81 if (curfunc NE 4)
82 return(FAILURE);
83
84 ebuf[1] = '\0';
85 ebflag = FALSE;
86 tmpval = ebuf[0] - '0';
87 vbufs[curvce].idhfnc[4].idfprm = tmpval;
88 sendval(curvce, 6, rsntab[tmpval]);
89 modinst();
90 return(SUCCESS);
91}
92
93/*
94
95*/
96
97/*
98 =============================================================================
99 rd_ires() -- (re)display the point number
100 =============================================================================
101*/
102
103short
104rd_ires(n)
105short n;
106{
107 register struct idfnhdr *fp;
108
109 fp = &vbufs[curvce].idhfnc[4];
110
111 if (curfunc NE 4)
112 return(FAILURE);
113
114 dspbuf[0] = '0' + fp->idfprm;
115 dspbuf[1] = '\0';
116
117 if (v_regs[5] & 0x0180)
118 vbank(0);
119
120 vcputsv(instob, 64, ((fp->idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
121 idbox[n][5], idbox[n][6] + 1, idbox[n][7] + 8, dspbuf, 14);
122
123 return(SUCCESS);
124}
125
126/*
127
128*/
129
130/*
131 =============================================================================
132 nd_ires() -- handle new data entry
133 =============================================================================
134*/
135
136short
137nd_ires(n, k)
138short n;
139register short k;
140{
141 if (curfunc NE 4)
142 return(FAILURE);
143
144 dspbuf[0] = ebuf[0] = k + '0';
145 dspbuf[1] = ebuf[1] = '\0';
146
147 if (v_regs[5] & 0x0180)
148 vbank(0);
149
150 vcputsv(instob, 64, ID_ENTRY, idbox[n][5], stcrow, stccol, dspbuf, 14);
151 return(SUCCESS);
152}
Note: See TracBrowser for help on using the repository browser.