source: buchla-68k/orig/RAM/ETAINS.C@ 0acb7d0

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

Imported original source code.

  • Property mode set to 100755
File size: 3.0 KB
Line 
1/*
2 =============================================================================
3 etains.c -- MIDAS assignment editor -- instrument to groups
4 Version 10 -- 1988-07-11 -- 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 "asgdsp.h"
16
17extern char *numblk();
18
19extern unsigned *asgob;
20
21extern short asgmod;
22extern short stccol;
23extern short stcrow;
24
25extern char dspbuf[];
26
27extern short ins2grp[];
28
29extern short adbox[][8];
30
31/*
32
33*/
34
35/*
36 =============================================================================
37 modasg() -- indicate that the assignment table was modified
38 =============================================================================
39*/
40
41modasg()
42{
43 if (NOT asgmod) {
44
45 asgmod = TRUE;
46 adswin(0);
47 }
48}
49
50/*
51 =============================================================================
52 et_ains() -- load the edit buffer
53 =============================================================================
54*/
55
56short
57et_ains(n)
58short n;
59{
60 register short grp;
61
62 char buf[4];
63
64 grp = 0x00FF & (n >> 8);
65
66 sprintf(ebuf, "%02.2d", ins2grp[grp] & 0x00FF);
67 ebflag = TRUE;
68
69 return(SUCCESS);
70}
71
72/*
73 =============================================================================
74 ef_ains() -- parse (unload) the edit buffer
75 =============================================================================
76*/
77
78short
79ef_ains(n)
80short n;
81{
82 register short tmpval, grp, i;
83
84 grp = 0x00FF & (n >> 8);
85 ebuf[2] = '\0';
86 ebflag = FALSE;
87 tmpval = 0;
88
89 for (i = 0; i < 2; i++)
90 tmpval = (tmpval * 10) + (ebuf[i] - '0');
91
92 if (tmpval GE NINST )
93 return(FAILURE);
94
95 ins2grp[grp] = tmpval | (ins2grp[grp] & 0xFF00);
96 modasg();
97 setv2gi(grp);
98 setinst();
99 return(SUCCESS);
100}
101
102/*
103
104*/
105
106/*
107 =============================================================================
108 rd_ains() -- (re)display the field
109 =============================================================================
110*/
111
112short
113rd_ains(nn)
114short nn;
115{
116 register short n, grp;
117 char buf[4];
118
119 n = 0x00FF & nn;
120 grp = 0x00FF & (nn >> 8);
121
122 sprintf(dspbuf, "%02.2d", ins2grp[grp] & 0x00FF);
123
124 vbank(0);
125 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
126 cfetp->frow, cfetp->flcol, dspbuf, 14);
127
128 return(SUCCESS);
129}
130
131/*
132 =============================================================================
133 nd_ains() -- handle new data entry
134 =============================================================================
135*/
136
137short
138nd_ains(nn, k)
139short nn;
140register short k;
141{
142 register short n;
143
144 n = nn & 0xFF;
145 ebuf[stccol - cfetp->flcol] = k + '0';
146 ebuf[2] = '\0';
147
148 dspbuf[0] = k + '0';
149 dspbuf[1] = '\0';
150
151 vbank(0);
152 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
153 stcrow, stccol, dspbuf, 14);
154
155 advacur();
156 return(SUCCESS);
157}
158
Note: See TracBrowser for help on using the repository browser.