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

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

Removed form-feed comments.

  • Property mode set to 100644
File size: 2.2 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 "ram.h"
9
10/*
11 =============================================================================
12 et_wavs() -- load the edit buffer
13 =============================================================================
14*/
15
16int16_t et_wavs(int16_t n)
17{
18 sprintf(ebuf, "%02d", curwave + 1);
19 ebflag = TRUE;
20
21 return(SUCCESS);
22}
23
24/*
25 =============================================================================
26 ef_wavs() -- parse (unload) the edit buffer
27 =============================================================================
28*/
29
30int16_t ef_wavs(int16_t n)
31{
32 register int16_t i, tmpval;
33
34 ebuf[2] = '\0'; /* terminate the string in ebuf */
35 ebflag = FALSE;
36
37 tmpval = 0;
38
39 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
40 tmpval = (tmpval * 10) + (ebuf[i] - '0');
41
42 if ((tmpval GT NUMWAVS) OR (tmpval EQ 0))
43 return(FAILURE);
44
45 wsnmod[curvce][curwslt] = TRUE;
46 curwave = tmpval - 1;
47 return(SUCCESS);
48}
49
50/*
51 =============================================================================
52 rd_wavs() -- (re)display the field
53 =============================================================================
54*/
55
56int16_t rd_wavs(int16_t nn)
57{
58 register int16_t n;
59 register uint16_t cx;
60
61 cx = exp_c(wsnmod[curvce][curwslt] ? WS_CHGC : wdbox[n][4]);
62 n = nn & 0x00FF;
63
64 sprintf(dspbuf, "%02d", curwave + 1);
65
66 vbank(0);
67 vcputsv(waveob, 64, cx, wdbox[n][5],
68 wdbox[n][6], wdbox[n][7] + WAVE_OFF, dspbuf, 14);
69
70 return(SUCCESS);
71}
72
73/*
74 =============================================================================
75 nd_wavs() -- handle new data entry
76 =============================================================================
77*/
78
79int16_t nd_wavs(int16_t nn, int16_t k)
80{
81 register int16_t ec, n;
82
83 n = nn & 0xFF;
84 ec = stccol - cfetp->flcol; /* setup edit buffer column */
85 ebuf[ec] = k + '0';
86 ebuf[2] = '\0';
87
88 dspbuf[0] = k + '0';
89 dspbuf[1] = '\0';
90
91 vbank(0);
92 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
93 wdbox[n][6], stccol, dspbuf, 14);
94
95 advwcur();
96 return(SUCCESS);
97}
98
99
Note: See TracBrowser for help on using the repository browser.