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 "all.h"
|
---|
11 |
|
---|
12 | extern void advwcur(void);
|
---|
13 | extern void wdswin(int16_t n);
|
---|
14 | extern void newws(void);
|
---|
15 | extern void dsnewws(void);
|
---|
16 |
|
---|
17 | extern uint16_t *waveob;
|
---|
18 |
|
---|
19 | extern int16_t stcrow, stccol, curwslt;
|
---|
20 |
|
---|
21 | extern int16_t wdbox[][8];
|
---|
22 |
|
---|
23 | extern int8_t dspbuf[];
|
---|
24 |
|
---|
25 | /* |
---|
26 |
|
---|
27 | */
|
---|
28 |
|
---|
29 | /*
|
---|
30 | =============================================================================
|
---|
31 | et_wslt() -- load the edit buffer
|
---|
32 | =============================================================================
|
---|
33 | */
|
---|
34 |
|
---|
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 | */
|
---|
48 |
|
---|
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 | =============================================================================
|
---|
73 | */
|
---|
74 |
|
---|
75 | int16_t rd_wslt(int16_t nn)
|
---|
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 | =============================================================================
|
---|
93 | */
|
---|
94 |
|
---|
95 | int16_t nd_wslt(int16_t nn, int16_t k)
|
---|
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();
|
---|
123 | return(SUCCESS);
|
---|
124 | }
|
---|
125 |
|
---|