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