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