source: buchla-68k/ram/etwavs.c@ 60288f5

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

Point of no return.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 =============================================================================
3 etwavs.c -- waveshape editor - waveshape number 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 stccol, curwave, curvce, curwslt;
22
23extern short wsnmod[12][2];
24
25extern short wdbox[][8];
26
27extern char dspbuf[];
28
29/*
30
31*/
32
33/*
34 =============================================================================
35 et_wavs() -- load the edit buffer
36 =============================================================================
37*/
38
39short et_wavs(short n)
40{
41 sprintf(ebuf, "%02d", curwave + 1);
42 ebflag = TRUE;
43
44 return(SUCCESS);
45}
46
47/*
48 =============================================================================
49 ef_wavs() -- parse (unload) the edit buffer
50 =============================================================================
51*/
52
53short ef_wavs(short n)
54{
55 register short i, tmpval;
56
57 ebuf[2] = '\0'; /* terminate the string in ebuf */
58 ebflag = FALSE;
59
60 tmpval = 0;
61
62 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
63 tmpval = (tmpval * 10) + (ebuf[i] - '0');
64
65 if ((tmpval GT NUMWAVS) OR (tmpval EQ 0))
66 return(FAILURE);
67
68 wsnmod[curvce][curwslt] = TRUE;
69 curwave = tmpval - 1;
70 return(SUCCESS);
71}
72
73/*
74
75*/
76
77/*
78 =============================================================================
79 rd_wavs() -- (re)display the field
80 =============================================================================
81*/
82
83short rd_wavs(short nn)
84{
85 register short n;
86 register unsigned cx;
87
88 cx = exp_c(wsnmod[curvce][curwslt] ? WS_CHGC : wdbox[n][4]);
89 n = nn & 0x00FF;
90
91 sprintf(dspbuf, "%02d", curwave + 1);
92
93 vbank(0);
94 vcputsv(waveob, 64, cx, wdbox[n][5],
95 wdbox[n][6], wdbox[n][7] + WAVE_OFF, dspbuf, 14);
96
97 return(SUCCESS);
98}
99
100/*
101 =============================================================================
102 nd_wavs() -- handle new data entry
103 =============================================================================
104*/
105
106short nd_wavs(short nn, short k)
107{
108 register short ec, n;
109
110 n = nn & 0xFF;
111 ec = stccol - cfetp->flcol; /* setup edit buffer column */
112 ebuf[ec] = k + '0';
113 ebuf[2] = '\0';
114
115 dspbuf[0] = k + '0';
116 dspbuf[1] = '\0';
117
118 vbank(0);
119 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
120 wdbox[n][6], stccol, dspbuf, 14);
121
122 advwcur();
123 return(SUCCESS);
124}
125
Note: See TracBrowser for help on using the repository browser.