source: buchla-68k/orig/RAM/ETADEP.C@ 0170798

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

Imported original source code.

  • Property mode set to 100755
File size: 2.5 KB
RevLine 
[3ae31e9]1/*
2 =============================================================================
3 etadep.c -- MIDAS assignment editor - phase shifter depth field
4 Version 4 -- 1987-12-19 -- 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 unsigned *asgob;
18
19extern short stcrow, stccol;
20extern short ps_dpth;
21
22extern short adbox[][8];
23
24extern char dspbuf[];
25
26/*
27
28*/
29
30/*
31 =============================================================================
32 et_adep() -- load the edit buffer
33 =============================================================================
34*/
35
36short
37et_adep(n)
38short n;
39{
40 sprintf(ebuf, "%02d", ps_dpth);
41 ebflag = TRUE;
42
43 return(SUCCESS);
44}
45
46/*
47 =============================================================================
48 ef_adep() -- parse (unload) the edit buffer
49 =============================================================================
50*/
51
52short
53ef_adep(n)
54short n;
55{
56 register short i, tmpval;
57
58 ebuf[2] = '\0'; /* terminate the string in ebuf */
59 ebflag = FALSE;
60 tmpval = 0;
61
62 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
63 tmpval = (tmpval * 10) + (ebuf[i] - '0');
64
65 ps_dpth = tmpval;
66 sendval(3, 0, ((ps_dpth * 10) << 5));
67 modasg();
68 return(SUCCESS);
69}
70
71/*
72
73*/
74
75/*
76 =============================================================================
77 rd_adep() -- (re)display the field
78 =============================================================================
79*/
80
81short
82rd_adep(nn)
83short nn;
84{
85 register short n;
86
87 n = nn & 0xFF;
88 sprintf(dspbuf, "%02.2d", ps_dpth);
89
90 vbank(0);
91 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
92 adbox[n][6] + 3, adbox[n][7] + 8, dspbuf, 14);
93
94 return(SUCCESS);
95}
96
97/*
98 =============================================================================
99 nd_adep() -- handle new data entry
100 =============================================================================
101*/
102
103short
104nd_adep(nn, k)
105short nn;
106register short k;
107{
108 register short ec, n;
109
110 n = nn & 0xFF;
111
112 ec = stccol - cfetp->flcol; /* setup edit buffer column */
113
114 ebuf[ec] = k + '0';
115 ebuf[2] = '\0';
116
117 dspbuf[0] = k + '0';
118 dspbuf[1] = '\0';
119
120 vbank(0);
121 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
122
123 advacur();
124 return(SUCCESS);
125}
126
Note: See TracBrowser for help on using the repository browser.