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