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

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

Removed form-feed comments.

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