source: buchla-68k/orig/RAM/ETWVCE.C@ 66b48e7

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

Imported original source code.

  • Property mode set to 100755
File size: 2.5 KB
Line 
1/*
2 =============================================================================
3 etwvce.c -- waveshape editor - voice field handlers
4 Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "vsddsw.h"
12#include "graphdef.h"
13
14#include "midas.h"
15#include "wsdsp.h"
16
17extern short advwcur();
18
19extern unsigned *waveob;
20
21extern short stcrow, stccol, curvce;
22
23extern short wdbox[][8];
24
25extern char dspbuf[];
26
27/*
28
29*/
30
31/*
32 =============================================================================
33 et_wvce() -- load the edit buffer
34 =============================================================================
35*/
36
37short
38et_wvce(n)
39short n;
40{
41 sprintf(ebuf, "%02d", curvce + 1);
42 ebflag = TRUE;
43
44 return(SUCCESS);
45}
46
47/*
48 =============================================================================
49 ef_wvce() -- parse (unload) the edit buffer
50 =============================================================================
51*/
52
53short
54ef_wvce(n)
55short n;
56{
57 register short i, tmpval;
58
59 ebuf[2] = '\0'; /* terminate the string in ebuf */
60 ebflag = FALSE;
61 tmpval = 0;
62
63 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
64 tmpval = (tmpval * 10) + (ebuf[i] - '0');
65
66 if ((tmpval EQ 0) OR (tmpval GT 12))
67 return(FAILURE);
68
69 newvce(tmpval - 1);
70 wwins();
71 return(SUCCESS);
72}
73
74/*
75
76*/
77
78/*
79 =============================================================================
80 rd_wvce() -- (re)display the field
81 =============================================================================
82*/
83
84short
85rd_wvce(nn)
86short nn;
87{
88 register short n;
89
90 n = nn & 0xFF;
91 sprintf(dspbuf, "%02d", curvce + 1);
92
93 vbank(0);
94 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
95 wdbox[n][6], wdbox[n][7] + WVCE_OFF, dspbuf, 14);
96
97 return(SUCCESS);
98}
99
100/*
101 =============================================================================
102 nd_wvce() -- handle new data entry
103 =============================================================================
104*/
105
106short
107nd_wvce(nn, k)
108short nn;
109register short k;
110{
111 register short ec, n;
112
113 n = nn & 0xFF;
114 ec = stccol - cfetp->flcol; /* setup edit buffer column */
115 ebuf[ec] = k + '0';
116 ebuf[2] = '\0';
117
118 dspbuf[0] = k + '0';
119 dspbuf[1] = '\0';
120
121 vbank(0);
122 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
123 stcrow, stccol, dspbuf, 14);
124
125 advwcur();
126 return(SUCCESS);
127}
Note: See TracBrowser for help on using the repository browser.