[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etwslt.c -- waveshape editor - waveshape slot field handlers
|
---|
| 4 | Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #define DEBUGIT 0
|
---|
| 9 |
|
---|
| 10 | #include "stddefs.h"
|
---|
| 11 | #include "fields.h"
|
---|
| 12 | #include "vsdd.h"
|
---|
| 13 | #include "vsddsw.h"
|
---|
| 14 | #include "graphdef.h"
|
---|
| 15 | #include "charset.h"
|
---|
| 16 |
|
---|
| 17 | #include "midas.h"
|
---|
| 18 | #include "instdsp.h"
|
---|
| 19 | #include "wsdsp.h"
|
---|
| 20 |
|
---|
[0580615] | 21 | extern void advwcur(void);
|
---|
| 22 | extern void wdswin(short n);
|
---|
| 23 | extern void newws(void);
|
---|
| 24 | extern void dsnewws(void);
|
---|
[f40a309] | 25 |
|
---|
| 26 | extern unsigned *waveob;
|
---|
| 27 |
|
---|
| 28 | extern short stcrow, stccol, curwslt;
|
---|
| 29 |
|
---|
| 30 | extern short wdbox[][8];
|
---|
| 31 |
|
---|
| 32 | extern char dspbuf[];
|
---|
| 33 |
|
---|
| 34 | /* |
---|
| 35 |
|
---|
| 36 | */
|
---|
| 37 |
|
---|
| 38 | /*
|
---|
| 39 | =============================================================================
|
---|
| 40 | et_wslt() -- load the edit buffer
|
---|
| 41 | =============================================================================
|
---|
| 42 | */
|
---|
[0580615] | 43 |
|
---|
[f40a309] | 44 | short et_wslt(short n)
|
---|
| 45 | {
|
---|
| 46 | sprintf(ebuf, "%c", curwslt + 'A');
|
---|
| 47 | ebflag = TRUE;
|
---|
| 48 |
|
---|
| 49 | return(SUCCESS);
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | /*
|
---|
| 53 | =============================================================================
|
---|
| 54 | ef_wslt() -- parse (unload) the edit buffer
|
---|
| 55 | =============================================================================
|
---|
| 56 | */
|
---|
[0580615] | 57 |
|
---|
[f40a309] | 58 | short ef_wslt(short n)
|
---|
| 59 | {
|
---|
| 60 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
| 61 | ebflag = FALSE;
|
---|
| 62 |
|
---|
| 63 | curwslt = ebuf[0] - 'A';
|
---|
| 64 |
|
---|
| 65 | #if DEBUGIT
|
---|
| 66 | printf("ef_wslt($%04X): ebuf[%s], curwslt=%d\r\n", n, ebuf, curwslt);
|
---|
| 67 | #endif
|
---|
| 68 |
|
---|
| 69 | newws();
|
---|
| 70 | dsnewws();
|
---|
| 71 | return(SUCCESS);
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | /* |
---|
| 75 |
|
---|
| 76 | */
|
---|
| 77 |
|
---|
| 78 | /*
|
---|
| 79 | =============================================================================
|
---|
| 80 | rd_wslt() -- (re)display the field
|
---|
| 81 | =============================================================================
|
---|
[0580615] | 82 | */
|
---|
[f40a309] | 83 |
|
---|
| 84 | short rd_wslt(short nn)
|
---|
| 85 | {
|
---|
| 86 | register short n;
|
---|
| 87 |
|
---|
| 88 | n = nn & 0xFF;
|
---|
| 89 | sprintf(dspbuf, "%c", curwslt + 'A');
|
---|
| 90 |
|
---|
| 91 | vbank(0);
|
---|
| 92 | vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
|
---|
| 93 | wdbox[n][6] + 1, wdbox[n][7] + WSLT_OFF, dspbuf, 14);
|
---|
| 94 |
|
---|
| 95 | return(SUCCESS);
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | /*
|
---|
| 99 | =============================================================================
|
---|
| 100 | nd_wslt() -- handle new data entry
|
---|
| 101 | =============================================================================
|
---|
[0580615] | 102 | */
|
---|
[f40a309] | 103 |
|
---|
| 104 | short nd_wslt(short nn, short k)
|
---|
| 105 | {
|
---|
| 106 | register short n;
|
---|
| 107 |
|
---|
| 108 | n = nn & 0xFF;
|
---|
| 109 |
|
---|
| 110 | #if DEBUGIT
|
---|
| 111 | printf("nd_wslt($%04X, %d)\r\n", nn, k);
|
---|
| 112 | #endif
|
---|
| 113 |
|
---|
| 114 | if (k GT 1)
|
---|
| 115 | return(FAILURE);
|
---|
| 116 |
|
---|
| 117 | ebuf[0] = k + 'A';
|
---|
| 118 | ebuf[1] = '\0';
|
---|
| 119 |
|
---|
| 120 | dspbuf[0] = k + 'A';
|
---|
| 121 | dspbuf[1] = '\0';
|
---|
| 122 |
|
---|
| 123 | #if DEBUGIT
|
---|
| 124 | printf("nd_wslt($%04X, %d): ebuf[%s]\r\n", nn, k, ebuf);
|
---|
| 125 | #endif
|
---|
| 126 |
|
---|
| 127 | vbank(0);
|
---|
| 128 | vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
|
---|
| 129 | stcrow, stccol, dspbuf, 14);
|
---|
| 130 |
|
---|
| 131 | advwcur();
|
---|
| 132 | return(SUCCESS);
|
---|
| 133 | }
|
---|