source: buchla-68k/orig/RAM/ETWSLT.C@ 0170798

Last change on this file since 0170798 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

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