[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etwvce.c -- waveshape editor - voice field handlers
|
---|
| 4 | Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_wvce() -- load the edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_wvce(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
| 18 | sprintf(ebuf, "%02d", curvce + 1);
|
---|
| 19 | ebflag = TRUE;
|
---|
| 20 |
|
---|
| 21 | return(SUCCESS);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | =============================================================================
|
---|
| 26 | ef_wvce() -- parse (unload) the edit buffer
|
---|
| 27 | =============================================================================
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[7258c6a] | 30 | int16_t ef_wvce(int16_t n)
|
---|
[f40a309] | 31 | {
|
---|
[7258c6a] | 32 | register int16_t i, tmpval;
|
---|
[f40a309] | 33 |
|
---|
| 34 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 35 | ebflag = FALSE;
|
---|
| 36 | tmpval = 0;
|
---|
| 37 |
|
---|
| 38 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 39 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 40 |
|
---|
| 41 | if ((tmpval EQ 0) OR (tmpval GT 12))
|
---|
| 42 | return(FAILURE);
|
---|
| 43 |
|
---|
| 44 | newvce(tmpval - 1);
|
---|
| 45 | wwins();
|
---|
| 46 | return(SUCCESS);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | /*
|
---|
| 50 | =============================================================================
|
---|
| 51 | rd_wvce() -- (re)display the field
|
---|
| 52 | =============================================================================
|
---|
| 53 | */
|
---|
| 54 |
|
---|
[7258c6a] | 55 | int16_t rd_wvce(int16_t nn)
|
---|
[f40a309] | 56 | {
|
---|
[7258c6a] | 57 | register int16_t n;
|
---|
[f40a309] | 58 |
|
---|
| 59 | n = nn & 0xFF;
|
---|
| 60 | sprintf(dspbuf, "%02d", curvce + 1);
|
---|
| 61 |
|
---|
| 62 | vbank(0);
|
---|
| 63 | vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
|
---|
| 64 | wdbox[n][6], wdbox[n][7] + WVCE_OFF, dspbuf, 14);
|
---|
| 65 |
|
---|
| 66 | return(SUCCESS);
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | /*
|
---|
| 70 | =============================================================================
|
---|
| 71 | nd_wvce() -- handle new data entry
|
---|
| 72 | =============================================================================
|
---|
| 73 | */
|
---|
| 74 |
|
---|
[7258c6a] | 75 | int16_t nd_wvce(int16_t nn, int16_t k)
|
---|
[f40a309] | 76 | {
|
---|
[7258c6a] | 77 | register int16_t ec, n;
|
---|
[f40a309] | 78 |
|
---|
| 79 | n = nn & 0xFF;
|
---|
| 80 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 81 | ebuf[ec] = k + '0';
|
---|
| 82 | ebuf[2] = '\0';
|
---|
| 83 |
|
---|
| 84 | dspbuf[0] = k + '0';
|
---|
| 85 | dspbuf[1] = '\0';
|
---|
| 86 |
|
---|
| 87 | vbank(0);
|
---|
| 88 | vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
|
---|
| 89 | stcrow, stccol, dspbuf, 14);
|
---|
| 90 |
|
---|
| 91 | advwcur();
|
---|
| 92 | return(SUCCESS);
|
---|
| 93 | }
|
---|
[6262b5c] | 94 |
|
---|