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