source: buchla-68k/ram/etavgr.c@ 6262b5c

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

Added include files for global functions and variables.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 =============================================================================
3 etavgr.c -- assignment editor - voice to group field handlers
4 Version 9 -- 1988-03-18 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define DEBUGIT 0
9
10#include "all.h"
11
12#if DEBUGIT
13extern short debugsw;
14#endif
15
16extern int8_t *numblk(int8_t *buf, int16_t n);
17
18extern void advacur(void);
19extern void execins(int16_t vce, int16_t ins, int16_t tag);
20extern void modasg(void);
21
22extern uint16_t *asgob;
23
24extern int16_t stcrow, stccol;
25
26extern int16_t adbox[][8];
27
28extern int8_t dspbuf[];
29
30extern int16_t vce2grp[12]; /* voice to group table */
31extern int16_t ins2grp[12];
32
33/*
34
35*/
36
37/*
38 =============================================================================
39 et_avgr() -- load the edit buffer
40 =============================================================================
41*/
42
43int16_t et_avgr(int16_t nn)
44{
45 register int16_t grp;
46 int8_t buf[4];
47
48 grp = 0x00FF & (nn >> 8);
49
50 sprintf(ebuf, "%s", numblk(buf, vce2grp[grp]));
51 ebflag = TRUE;
52
53#if DEBUGIT
54 if (debugsw)
55 printf("et_avgr($%04.4X): ebuf=[%s]\n", nn, ebuf);
56#endif
57
58 return(SUCCESS);
59}
60
61/*
62
63*/
64
65/*
66 =============================================================================
67 ef_avgr() -- parse (unload) the edit buffer
68 =============================================================================
69*/
70
71int16_t ef_avgr(int16_t nn)
72{
73 register int16_t tmpval, vce, i;
74
75 vce = 0x00FF & (nn >> 8);
76
77 ebuf[2] = '\0'; /* terminate the string in ebuf */
78 ebflag = FALSE;
79 tmpval = 0;
80
81#if DEBUGIT
82 if (debugsw)
83 printf("ef_avgr($%04.4X): ebuf=[%s]\n", nn, ebuf);
84#endif
85
86 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
87
88 tmpval = -1;
89
90 } else {
91
92 for (i = 0; i < 2; i++) {
93
94 if (ebuf[i] EQ ' ')
95 ebuf[i] = '0';
96
97 tmpval = (tmpval * 10) + (ebuf[i] - '0');
98 }
99
100 if ((tmpval EQ 0) OR (tmpval GT 12))
101 return(FAILURE);
102 }
103
104 vce2grp[vce] = tmpval;
105
106 if (tmpval > 0)
107 execins(vce, (ins2grp[tmpval - 1] & 0x00FF), 1);
108
109 modasg();
110 return(SUCCESS);
111}
112
113/*
114
115*/
116
117/*
118 =============================================================================
119 rd_avgr() -- (re)display the field
120 =============================================================================
121*/
122
123int16_t rd_avgr(int16_t nn)
124{
125 register int16_t n, grp;
126 int8_t buf[4];
127
128 n = 0x00FF & nn;
129 grp = 0x00FF & (nn >> 8);
130
131 vbank(0);
132 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
133 cfetp->frow, cfetp->flcol, numblk(buf, vce2grp[grp]), 14);
134
135 return(SUCCESS);
136}
137
138/*
139
140*/
141
142/*
143 =============================================================================
144 nd_avgr() -- handle new data entry
145 =============================================================================
146*/
147
148int16_t nd_avgr(int16_t nn, int16_t k)
149{
150 register int16_t n, col;
151
152 n = nn & 0xFF;
153 col = stccol - cfetp->flcol;
154
155 ebuf[col] = k + '0';
156 ebuf[2] = '\0';
157
158#if DEBUGIT
159 if (debugsw)
160 printf("nd_avgr($%04.4X, %d): cfetp=$%08.8lX, col=%d, ebuf=[%s]\n",
161 nn, k, cfetp, col, ebuf);
162#endif
163
164 dspbuf[0] = k + '0';
165 dspbuf[1] = '\0';
166
167 vbank(0);
168 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
169
170 advacur();
171 return(SUCCESS);
172}
173
174
Note: See TracBrowser for help on using the repository browser.