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

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

Added missing includes and declarations.

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