source: buchla-68k/ram/etires.c@ 0c834c5

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

Point of no return.

  • Property mode set to 100644
File size: 2.8 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 et_ires(short n)
57{
58 if (curfunc NE 4)
59 return(FAILURE);
60
61 ebuf[0] = '0' + vbufs[curvce].idhfnc[4].idfprm;
62 ebuf[1] = '\0';
63 ebflag = TRUE;
64 return(SUCCESS);
65}
66
67/*
68 =============================================================================
69 ef_ires() -- parse (unload) the edit buffer
70 =============================================================================
71*/
72
73short ef_ires(short n)
74{
75 register short tmpval;
76
77 if (curfunc NE 4)
78 return(FAILURE);
79
80 ebuf[1] = '\0';
81 ebflag = FALSE;
82 tmpval = ebuf[0] - '0';
83 vbufs[curvce].idhfnc[4].idfprm = tmpval;
84 sendval(curvce, 6, rsntab[tmpval]);
85 modinst();
86 return(SUCCESS);
87}
88
89/*
90
91*/
92
93/*
94 =============================================================================
95 rd_ires() -- (re)display the point number
96 =============================================================================
97*/
98
99short rd_ires(short n)
100{
101 register struct idfnhdr *fp;
102
103 fp = &vbufs[curvce].idhfnc[4];
104
105 if (curfunc NE 4)
106 return(FAILURE);
107
108 dspbuf[0] = '0' + fp->idfprm;
109 dspbuf[1] = '\0';
110
111 if (v_regs[5] & 0x0180)
112 vbank(0);
113
114 vcputsv(instob, 64, ((fp->idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
115 idbox[n][5], idbox[n][6] + 1, idbox[n][7] + 8, dspbuf, 14);
116
117 return(SUCCESS);
118}
119
120/*
121
122*/
123
124/*
125 =============================================================================
126 nd_ires() -- handle new data entry
127 =============================================================================
128*/
129
130short nd_ires(short n, short k)
131{
132 if (curfunc NE 4)
133 return(FAILURE);
134
135 dspbuf[0] = ebuf[0] = k + '0';
136 dspbuf[1] = ebuf[1] = '\0';
137
138 if (v_regs[5] & 0x0180)
139 vbank(0);
140
141 vcputsv(instob, 64, ID_ENTRY, idbox[n][5], stcrow, stccol, dspbuf, 14);
142 return(SUCCESS);
143}
Note: See TracBrowser for help on using the repository browser.