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