source: buchla-68k/ram/etwvce.c@ 0c834c5

Last change on this file since 0c834c5 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Point of no return.

  • Property mode set to 100644
File size: 2.4 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 void advwcur(void);
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 et_wvce(short n)
38{
39 sprintf(ebuf, "%02d", curvce + 1);
40 ebflag = TRUE;
41
42 return(SUCCESS);
43}
44
45/*
46 =============================================================================
47 ef_wvce() -- parse (unload) the edit buffer
48 =============================================================================
49*/
50
51short ef_wvce(short n)
52{
53 register short i, tmpval;
54
55 ebuf[2] = '\0'; /* terminate the string in ebuf */
56 ebflag = FALSE;
57 tmpval = 0;
58
59 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
60 tmpval = (tmpval * 10) + (ebuf[i] - '0');
61
62 if ((tmpval EQ 0) OR (tmpval GT 12))
63 return(FAILURE);
64
65 newvce(tmpval - 1);
66 wwins();
67 return(SUCCESS);
68}
69
70/*
71
72*/
73
74/*
75 =============================================================================
76 rd_wvce() -- (re)display the field
77 =============================================================================
78*/
79
80short rd_wvce(short nn)
81{
82 register short n;
83
84 n = nn & 0xFF;
85 sprintf(dspbuf, "%02d", curvce + 1);
86
87 vbank(0);
88 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
89 wdbox[n][6], wdbox[n][7] + WVCE_OFF, dspbuf, 14);
90
91 return(SUCCESS);
92}
93
94/*
95 =============================================================================
96 nd_wvce() -- handle new data entry
97 =============================================================================
98*/
99
100short nd_wvce(short nn, short k)
101{
102 register short ec, n;
103
104 n = nn & 0xFF;
105 ec = stccol - cfetp->flcol; /* setup edit buffer column */
106 ebuf[ec] = k + '0';
107 ebuf[2] = '\0';
108
109 dspbuf[0] = k + '0';
110 dspbuf[1] = '\0';
111
112 vbank(0);
113 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
114 stcrow, stccol, dspbuf, 14);
115
116 advwcur();
117 return(SUCCESS);
118}
Note: See TracBrowser for help on using the repository browser.