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