source: buchla-68k/ram/etavgr.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.7 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 "ram.h"
11
12/*
13 =============================================================================
14 et_avgr() -- load the edit buffer
15 =============================================================================
16*/
17
18int16_t et_avgr(int16_t nn)
19{
20 register int16_t grp;
21 int8_t buf[4];
22
23 grp = 0x00FF & (nn >> 8);
24
25 sprintf(ebuf, "%s", numblk(buf, vce2grp[grp]));
26 ebflag = TRUE;
27
28#if DEBUGIT
29 if (debugsw)
30 printf("et_avgr($%04.4X): ebuf=[%s]\n", nn, ebuf);
31#endif
32
33 return(SUCCESS);
34}
35
36/*
37
38*/
39
40/*
41 =============================================================================
42 ef_avgr() -- parse (unload) the edit buffer
43 =============================================================================
44*/
45
46int16_t ef_avgr(int16_t nn)
47{
48 register int16_t tmpval, vce, i;
49
50 vce = 0x00FF & (nn >> 8);
51
52 ebuf[2] = '\0'; /* terminate the string in ebuf */
53 ebflag = FALSE;
54 tmpval = 0;
55
56#if DEBUGIT
57 if (debugsw)
58 printf("ef_avgr($%04.4X): ebuf=[%s]\n", nn, ebuf);
59#endif
60
61 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
62
63 tmpval = -1;
64
65 } else {
66
67 for (i = 0; i < 2; i++) {
68
69 if (ebuf[i] EQ ' ')
70 ebuf[i] = '0';
71
72 tmpval = (tmpval * 10) + (ebuf[i] - '0');
73 }
74
75 if ((tmpval EQ 0) OR (tmpval GT 12))
76 return(FAILURE);
77 }
78
79 vce2grp[vce] = tmpval;
80
81 if (tmpval > 0)
82 execins(vce, (ins2grp[tmpval - 1] & 0x00FF), 1);
83
84 modasg();
85 return(SUCCESS);
86}
87
88/*
89
90*/
91
92/*
93 =============================================================================
94 rd_avgr() -- (re)display the field
95 =============================================================================
96*/
97
98int16_t rd_avgr(int16_t nn)
99{
100 register int16_t n, grp;
101 int8_t buf[4];
102
103 n = 0x00FF & nn;
104 grp = 0x00FF & (nn >> 8);
105
106 vbank(0);
107 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
108 cfetp->frow, cfetp->flcol, numblk(buf, vce2grp[grp]), 14);
109
110 return(SUCCESS);
111}
112
113/*
114
115*/
116
117/*
118 =============================================================================
119 nd_avgr() -- handle new data entry
120 =============================================================================
121*/
122
123int16_t nd_avgr(int16_t nn, int16_t k)
124{
125 register int16_t n, col;
126
127 n = nn & 0xFF;
128 col = stccol - cfetp->flcol;
129
130 ebuf[col] = k + '0';
131 ebuf[2] = '\0';
132
133#if DEBUGIT
134 if (debugsw)
135 printf("nd_avgr($%04.4X, %d): cfetp=$%08.8lX, col=%d, ebuf=[%s]\n",
136 nn, k, cfetp, col, ebuf);
137#endif
138
139 dspbuf[0] = k + '0';
140 dspbuf[1] = '\0';
141
142 vbank(0);
143 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
144
145 advacur();
146 return(SUCCESS);
147}
148
149
Note: See TracBrowser for help on using the repository browser.