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