source: buchla-68k/ram/etagpt.c@ 6aa430b

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.2 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 "ram.h"
9
10/*
11 =============================================================================
12 et_agpt() -- load the edit buffer
13 =============================================================================
14*/
15
16int16_t et_agpt(int16_t n)
17{
18 register int16_t grp;
19
20 grp = 0x00FF & (n >> 8);
21
22 ebuf[0] = grp2prt[grp][0];
23 ebuf[1] = '\0';
24
25 ebflag = TRUE;
26
27 return(SUCCESS);
28}
29
30/*
31 =============================================================================
32 ef_agpt() -- parse (unload) the edit buffer
33 =============================================================================
34*/
35
36int16_t ef_agpt(int16_t n)
37{
38 register int16_t tmpval, grp, i;
39
40 grp = 0x00FF & (n >> 8);
41
42 ebuf[1] = '\0'; /* terminate the string in ebuf */
43 ebflag = FALSE;
44
45 grp2prt[grp][0] = ebuf[0];
46
47 if (grp2prt[grp][0] NE 1)
48 for (i = 0; i < 88; i++)
49 key2grp[i] &= ~(0x0001 << grp);
50
51 drawk2g(grp);
52
53 modasg();
54 return(SUCCESS);
55}
56
57/*
58
59*/
60
61/*
62 =============================================================================
63 rd_agpt() -- (re)display the field
64 =============================================================================
65*/
66
67int16_t rd_agpt(int16_t nn)
68{
69 register int16_t n, grp;
70
71 n = 0x00FF & nn;
72 grp = 0x00FF & (nn >> 8);
73
74 vbank(0);
75 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
76 cfetp->frow, cfetp->flcol, gprep[grp2prt[grp][0]], 14);
77
78 return(SUCCESS);
79}
80
81/*
82 =============================================================================
83 nd_agpt() -- handle new data entry
84 =============================================================================
85*/
86
87int16_t nd_agpt(int16_t nn, int16_t k)
88{
89 register int16_t n;
90
91 n = nn & 0x00FF;
92
93 if (k EQ 8) { /* '-' */
94
95 if (--ebuf[0] LT 0)
96 ebuf[0] = 3;
97
98 } else if (k EQ 9) { /* '+' */
99
100 if (++ebuf[0] GT 3)
101 ebuf[0] = 0;
102
103 } else {
104
105 return(FAILURE);
106 }
107
108 dspbuf[0] = *gprep[ebuf[0]];
109 dspbuf[1] = '\0';
110
111 vbank(0);
112 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
113
114 return(SUCCESS);
115}
116
117
Note: See TracBrowser for help on using the repository browser.