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

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

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.5 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 "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 "instdsp.h"
16
17#include "stdio.h"
18
19#define VCE_OFF 6
20
21extern void advicur(void);
22extern void newvce(int16_t voice);
23
24extern void allwins(void);
25
26extern uint16_t *instob;
27
28extern int16_t stccol, curvce;
29
30extern int16_t idbox[][8];
31
32extern int8_t dspbuf[];
33
34/*
35
36*/
37
38/*
39 =============================================================================
40 et_ivce() -- load the edit buffer
41 =============================================================================
42*/
43
44int16_t et_ivce(int16_t n)
45{
46 sprintf(ebuf, "%02d", curvce + 1);
47 ebflag = TRUE;
48
49 return(SUCCESS);
50}
51
52/*
53
54*/
55
56/*
57 =============================================================================
58 ef_ivce() -- parse (unload) the edit buffer
59 =============================================================================
60*/
61
62int16_t ef_ivce(int16_t n)
63{
64 register int16_t i, tmpval;
65
66 ebuf[2] = '\0'; /* terminate the string in ebuf */
67 ebflag = FALSE;
68
69 tmpval = 0;
70
71 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
72 tmpval = (tmpval * 10) + (ebuf[i] - '0');
73
74 if ((tmpval EQ 0) OR (tmpval GT 12))
75 return(FAILURE);
76
77 newvce(tmpval - 1);
78 allwins();
79 return(SUCCESS);
80}
81
82/*
83
84*/
85
86/*
87 =============================================================================
88 rd_ivce() -- (re)display the field
89 =============================================================================
90*/
91
92int16_t rd_ivce(int16_t n)
93{
94 /* convert to ASCII */
95
96 sprintf(dspbuf, "%02d", curvce + 1);
97
98 vbank(0); /* display the value */
99
100 vcputsv(instob, 64, idbox[n][4], idbox[n][5],
101 idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
102
103 return(SUCCESS);
104}
105
106/*
107
108*/
109
110/*
111 =============================================================================
112 nd_ivce() -- handle new data entry
113 =============================================================================
114*/
115
116int16_t nd_ivce(int16_t n, int16_t k)
117{
118 register int16_t ec;
119
120 ec = stccol - cfetp->flcol; /* setup edit buffer column */
121 ebuf[ec] = k + '0';
122 ebuf[2] = '\0';
123
124 dspbuf[0] = k + '0';
125 dspbuf[1] = '\0';
126
127 vbank(0);
128
129 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
130 idbox[n][6], stccol, dspbuf, 14);
131
132 advicur();
133
134 return(SUCCESS);
135}
136
Note: See TracBrowser for help on using the repository browser.