[3ae31e9] | 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 |
|
---|
| 20 | extern unsigned *instob;
|
---|
| 21 |
|
---|
| 22 | extern short stcrow, stccol, curvce, curfunc;
|
---|
| 23 |
|
---|
| 24 | extern short idbox[][8];
|
---|
| 25 |
|
---|
| 26 | extern char dspbuf[];
|
---|
| 27 |
|
---|
| 28 | extern struct instdef vbufs[];
|
---|
| 29 |
|
---|
| 30 | extern struct instpnt *pntptr;
|
---|
| 31 |
|
---|
| 32 | short 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 |
|
---|
| 56 | short
|
---|
| 57 | et_ires(n)
|
---|
| 58 | short 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 |
|
---|
| 75 | short
|
---|
| 76 | ef_ires(n)
|
---|
| 77 | short 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 |
|
---|
| 103 | short
|
---|
| 104 | rd_ires(n)
|
---|
| 105 | short 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 |
|
---|
| 136 | short
|
---|
| 137 | nd_ires(n, k)
|
---|
| 138 | short n;
|
---|
| 139 | register 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 | }
|
---|