source: buchla-68k/orig/RAM/ETATAB.C@ f7c91fc

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

Imported original source code.

  • Property mode set to 100755
File size: 2.8 KB
Line 
1/*
2 =============================================================================
3 etatab.c -- assignment editor - assignment table number field handlers
4 Version 9 -- 1988-08-22 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "hwdefs.h"
11#include "vsdd.h"
12#include "vsddsw.h"
13#include "graphdef.h"
14
15#include "midas.h"
16#include "asgdsp.h"
17
18extern short adpoint();
19
20extern short (*point)();
21
22extern unsigned *asgob;
23
24extern short asgmod;
25extern short curasg;
26extern short stccol;
27extern short stcrow;
28
29extern short adbox[][8];
30
31extern char dspbuf[];
32
33/*
34
35*/
36
37/*
38 =============================================================================
39 et_atab() -- load the edit buffer
40 =============================================================================
41*/
42
43short
44et_atab(n)
45short n;
46{
47 sprintf(ebuf, "%02d", curasg);
48 ebflag = TRUE;
49
50 return(SUCCESS);
51}
52
53/*
54 =============================================================================
55 ef_atab() -- parse (unload) the edit buffer
56 =============================================================================
57*/
58
59short
60ef_atab(n)
61short n;
62{
63 register short i, tmpval;
64
65 ebuf[2] = '\0'; /* terminate the string in ebuf */
66 ebflag = FALSE;
67 tmpval = 0;
68
69 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
70 tmpval = (tmpval * 10) + (ebuf[i] - '0');
71
72 if (tmpval GE NASGS)
73 return(FAILURE);
74
75 curasg = tmpval;
76 asgmod = TRUE;
77 adswin(0);
78
79 settc(2, 6);
80
81 return(SUCCESS);
82}
83
84/*
85
86*/
87
88/*
89 =============================================================================
90 rd_atab() -- (re)display the field
91 =============================================================================
92*/
93
94short
95rd_atab(nn)
96short nn;
97{
98 register short n;
99
100 n = nn & 0xFF;
101 sprintf(dspbuf, "%02.2d", curasg);
102
103 point = adpoint;
104
105 if (v_regs[5] & 0x0180)
106 vbank(0);
107
108 vcputsv(asgob, 64, (asgmod ? exp_c(AK_MODC) : adbox[n][4]), adbox[n][5],
109 cfetp->frow, cfetp->flcol, dspbuf, 14);
110
111 lseg(0, 0, 128, 0, AK_BORD);
112
113 return(SUCCESS);
114}
115
116/*
117 =============================================================================
118 nd_atab() -- handle new data entry
119 =============================================================================
120*/
121
122short
123nd_atab(nn, k)
124short nn;
125register short k;
126{
127 register short ec, n;
128
129 n = nn & 0xFF;
130 ec = stccol - cfetp->flcol; /* setup edit buffer column */
131
132 ebuf[ec] = k + '0';
133 ebuf[2] = '\0';
134
135 dspbuf[0] = k + '0';
136 dspbuf[1] = '\0';
137
138 point = adpoint;
139
140 if (v_regs[5] & 0x0180)
141 vbank(0);
142
143 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
144 stcrow, stccol, dspbuf, 14);
145
146 lseg(0, 0, 128, 0, AK_BORD);
147
148 advacur();
149 return(SUCCESS);
150}
151
Note: See TracBrowser for help on using the repository browser.