source: buchla-68k/ram/etivce.c@ b28a12e

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 =============================================================================
3 etivce.c -- instrument editor - voice number field handlers
4 Version 12 -- 1987-12-09 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10#define VCE_OFF 6
11
12/*
13 =============================================================================
14 et_ivce() -- load the edit buffer
15 =============================================================================
16*/
17
18int16_t et_ivce(int16_t n)
19{
20 sprintf(ebuf, "%02d", curvce + 1);
21 ebflag = TRUE;
22
23 return(SUCCESS);
24}
25
26/*
27
28*/
29
30/*
31 =============================================================================
32 ef_ivce() -- parse (unload) the edit buffer
33 =============================================================================
34*/
35
36int16_t ef_ivce(int16_t n)
37{
38 register int16_t i, tmpval;
39
40 ebuf[2] = '\0'; /* terminate the string in ebuf */
41 ebflag = FALSE;
42
43 tmpval = 0;
44
45 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
46 tmpval = (tmpval * 10) + (ebuf[i] - '0');
47
48 if ((tmpval EQ 0) OR (tmpval GT 12))
49 return(FAILURE);
50
51 newvce(tmpval - 1);
52 allwins();
53 return(SUCCESS);
54}
55
56/*
57
58*/
59
60/*
61 =============================================================================
62 rd_ivce() -- (re)display the field
63 =============================================================================
64*/
65
66int16_t rd_ivce(int16_t n)
67{
68 /* convert to ASCII */
69
70 sprintf(dspbuf, "%02d", curvce + 1);
71
72 vbank(0); /* display the value */
73
74 vcputsv(instob, 64, idbox[n][4], idbox[n][5],
75 idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
76
77 return(SUCCESS);
78}
79
80/*
81
82*/
83
84/*
85 =============================================================================
86 nd_ivce() -- handle new data entry
87 =============================================================================
88*/
89
90int16_t nd_ivce(int16_t n, int16_t k)
91{
92 register int16_t ec;
93
94 ec = stccol - cfetp->flcol; /* setup edit buffer column */
95 ebuf[ec] = k + '0';
96 ebuf[2] = '\0';
97
98 dspbuf[0] = k + '0';
99 dspbuf[1] = '\0';
100
101 vbank(0);
102
103 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
104 idbox[n][6], stccol, dspbuf, 14);
105
106 advicur();
107
108 return(SUCCESS);
109}
110
111
Note: See TracBrowser for help on using the repository browser.