source: buchla-68k/ram/etagch.c@ 7258c6a

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

Use standard integer types.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 =============================================================================
3 etagch.c -- assignment editor - group to channel number field handlers
4 Version 6 -- 1987-12-10 -- 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 int8_t *numblk(int8_t *buf, int16_t n);
18
19extern uint16_t *asgob;
20
21extern int16_t stcrow, stccol;
22
23extern int16_t adbox[][8];
24
25extern int8_t dspbuf[];
26
27extern int16_t grp2prt[12][2]; /* group to port and channel table */
28 /* port [0] = 0..4, channel [1] = -1, 1..16 */
29
30/*
31
32*/
33
34/*
35 =============================================================================
36 et_agch() -- load the edit buffer
37 =============================================================================
38*/
39
40int16_t et_agch(int16_t n)
41{
42 register int16_t grp;
43
44 int8_t buf[4];
45
46 grp = 0x00FF & (n >> 8);
47
48 numblk(ebuf, grp2prt[grp][1]);
49 ebflag = TRUE;
50
51 return(SUCCESS);
52}
53
54/*
55 =============================================================================
56 ef_agch() -- parse (unload) the edit buffer
57 =============================================================================
58*/
59
60int16_t ef_agch(int16_t n)
61{
62 register int16_t tmpval, grp, i;
63
64 grp = 0x00FF & (n >> 8);
65
66 ebuf[2] = '\0'; /* terminate the string in ebuf */
67 ebflag = FALSE;
68 tmpval = 0;
69
70 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
71
72 tmpval = -1;
73
74 } else {
75
76 for (i = 0; i < 2; i++) {
77
78 if (ebuf[i] EQ ' ')
79 ebuf[i] = '0';
80
81 tmpval = (tmpval * 10) + (ebuf[i] - '0');
82 }
83
84 if ((tmpval EQ 0) OR (tmpval GT 16))
85 return(FAILURE);
86 }
87
88 grp2prt[grp][1] = tmpval;
89
90 modasg();
91 return(SUCCESS);
92}
93
94/*
95
96*/
97
98/*
99 =============================================================================
100 rd_agch() -- (re)display the field
101 =============================================================================
102*/
103
104int16_t rd_agch(int16_t nn)
105{
106 register int16_t n, grp;
107 int8_t buf[4];
108
109 n = 0x00FF & nn;
110 grp = 0x00FF & (nn >> 8);
111
112 vbank(0);
113 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
114 cfetp->frow, cfetp->flcol, numblk(buf, grp2prt[grp][1]), 14);
115
116 return(SUCCESS);
117}
118
119/*
120 =============================================================================
121 nd_agch() -- handle new data entry
122 =============================================================================
123*/
124
125int16_t nd_agch(int16_t nn, int16_t k)
126{
127 register int16_t n;
128
129 n = nn & 0xFF;
130 ebuf[stccol - cfetp->flcol] = k + '0';
131 ebuf[2] = '\0';
132
133 dspbuf[0] = k + '0';
134 dspbuf[1] = '\0';
135
136 vbank(0);
137 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
138 stcrow, stccol, dspbuf, 14);
139
140 advacur();
141 return(SUCCESS);
142}
143
Note: See TracBrowser for help on using the repository browser.