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

Last change on this file since fa38804 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 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 ef_ivce() -- parse (unload) the edit buffer
29 =============================================================================
30*/
31
32int16_t ef_ivce(int16_t n)
33{
34 register int16_t i, tmpval;
35
36 ebuf[2] = '\0'; /* terminate the string in ebuf */
37 ebflag = FALSE;
38
39 tmpval = 0;
40
41 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
42 tmpval = (tmpval * 10) + (ebuf[i] - '0');
43
44 if ((tmpval EQ 0) OR (tmpval GT 12))
45 return(FAILURE);
46
47 newvce(tmpval - 1);
48 allwins();
49 return(SUCCESS);
50}
51
52/*
53 =============================================================================
54 rd_ivce() -- (re)display the field
55 =============================================================================
56*/
57
58int16_t rd_ivce(int16_t n)
59{
60 /* convert to ASCII */
61
62 sprintf(dspbuf, "%02d", curvce + 1);
63
64 vbank(0); /* display the value */
65
66 vcputsv(instob, 64, idbox[n][4], idbox[n][5],
67 idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
68
69 return(SUCCESS);
70}
71
72/*
73 =============================================================================
74 nd_ivce() -- handle new data entry
75 =============================================================================
76*/
77
78int16_t nd_ivce(int16_t n, int16_t k)
79{
80 register int16_t ec;
81
82 ec = stccol - cfetp->flcol; /* setup edit buffer column */
83 ebuf[ec] = k + '0';
84 ebuf[2] = '\0';
85
86 dspbuf[0] = k + '0';
87 dspbuf[1] = '\0';
88
89 vbank(0);
90
91 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
92 idbox[n][6], stccol, dspbuf, 14);
93
94 advicur();
95
96 return(SUCCESS);
97}
98
99
Note: See TracBrowser for help on using the repository browser.