[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 | et_ires() -- load the edit buffer
|
---|
| 29 | =============================================================================
|
---|
| 30 | */
|
---|
| 31 |
|
---|
[7258c6a] | 32 | int16_t et_ires(int16_t n)
|
---|
[f40a309] | 33 | {
|
---|
| 34 | if (curfunc NE 4)
|
---|
| 35 | return(FAILURE);
|
---|
| 36 |
|
---|
| 37 | ebuf[0] = '0' + vbufs[curvce].idhfnc[4].idfprm;
|
---|
| 38 | ebuf[1] = '\0';
|
---|
| 39 | ebflag = TRUE;
|
---|
| 40 | return(SUCCESS);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | /*
|
---|
| 44 | =============================================================================
|
---|
| 45 | ef_ires() -- parse (unload) the edit buffer
|
---|
| 46 | =============================================================================
|
---|
| 47 | */
|
---|
| 48 |
|
---|
[7258c6a] | 49 | int16_t ef_ires(int16_t n)
|
---|
[f40a309] | 50 | {
|
---|
[7258c6a] | 51 | register int16_t tmpval;
|
---|
[f40a309] | 52 |
|
---|
| 53 | if (curfunc NE 4)
|
---|
| 54 | return(FAILURE);
|
---|
| 55 |
|
---|
| 56 | ebuf[1] = '\0';
|
---|
| 57 | ebflag = FALSE;
|
---|
| 58 | tmpval = ebuf[0] - '0';
|
---|
| 59 | vbufs[curvce].idhfnc[4].idfprm = tmpval;
|
---|
| 60 | sendval(curvce, 6, rsntab[tmpval]);
|
---|
| 61 | modinst();
|
---|
| 62 | return(SUCCESS);
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | /*
|
---|
| 66 | =============================================================================
|
---|
| 67 | rd_ires() -- (re)display the point number
|
---|
| 68 | =============================================================================
|
---|
| 69 | */
|
---|
| 70 |
|
---|
[7258c6a] | 71 | int16_t rd_ires(int16_t n)
|
---|
[f40a309] | 72 | {
|
---|
| 73 | register struct idfnhdr *fp;
|
---|
| 74 |
|
---|
| 75 | fp = &vbufs[curvce].idhfnc[4];
|
---|
| 76 |
|
---|
| 77 | if (curfunc NE 4)
|
---|
| 78 | return(FAILURE);
|
---|
| 79 |
|
---|
| 80 | dspbuf[0] = '0' + fp->idfprm;
|
---|
| 81 | dspbuf[1] = '\0';
|
---|
| 82 |
|
---|
| 83 | if (v_regs[5] & 0x0180)
|
---|
| 84 | vbank(0);
|
---|
| 85 |
|
---|
| 86 | vcputsv(instob, 64, ((fp->idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
|
---|
| 87 | idbox[n][5], idbox[n][6] + 1, idbox[n][7] + 8, dspbuf, 14);
|
---|
| 88 |
|
---|
| 89 | return(SUCCESS);
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | /*
|
---|
| 93 | =============================================================================
|
---|
| 94 | nd_ires() -- handle new data entry
|
---|
| 95 | =============================================================================
|
---|
| 96 | */
|
---|
| 97 |
|
---|
[7258c6a] | 98 | int16_t nd_ires(int16_t n, int16_t k)
|
---|
[f40a309] | 99 | {
|
---|
| 100 | if (curfunc NE 4)
|
---|
| 101 | return(FAILURE);
|
---|
| 102 |
|
---|
| 103 | dspbuf[0] = ebuf[0] = k + '0';
|
---|
| 104 | dspbuf[1] = ebuf[1] = '\0';
|
---|
| 105 |
|
---|
| 106 | if (v_regs[5] & 0x0180)
|
---|
| 107 | vbank(0);
|
---|
| 108 |
|
---|
| 109 | vcputsv(instob, 64, ID_ENTRY, idbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 110 | return(SUCCESS);
|
---|
| 111 | }
|
---|
[6262b5c] | 112 |
|
---|