source: buchla-68k/ram/eticnf.c@ 0580615

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

Point of no return.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 =============================================================================
3 eticnf.c -- instrument editor - configuration number field handlers
4 Version 16 -- 1988-08-23 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "hwdefs.h"
11#include "fpu.h"
12#include "vsdd.h"
13#include "vsddsw.h"
14#include "graphdef.h"
15
16#include "midas.h"
17#include "instdsp.h"
18
19#define CFG_OFF 10 /* display offset into configuration field */
20
21extern unsigned *instob;
22
23extern short stccol, curvce;
24extern short idbox[][8];
25
26extern char dspbuf[];
27
28extern struct instdef vbufs[];
29
30/*
31
32*/
33
34/*
35 =============================================================================
36 et_icnf() -- load the edit buffer
37 =============================================================================
38*/
39
40short et_icnf(short n)
41{
42 sprintf(ebuf, "%02d", vbufs[curvce].idhcfg);
43 ebflag = TRUE;
44
45 return(SUCCESS);
46}
47
48/*
49
50*/
51
52/*
53 =============================================================================
54 ef_icnf() -- parse (unload) the edit buffer
55 =============================================================================
56*/
57
58short ef_icnf(short n)
59{
60 register short i, tmpval;
61
62 ebuf[2] = '\0'; /* terminate the string in ebuf */
63 ebflag = FALSE;
64
65 tmpval = 0;
66
67 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
68 tmpval = (tmpval * 10) + (ebuf[i] - '0');
69
70 if (tmpval GE NUMCFG) /* check against limit */
71 return(FAILURE);
72
73 vbufs[curvce].idhcfg = tmpval;
74 dosync(curvce);
75 showcfg(tmpval);
76 modinst();
77 return(SUCCESS);
78}
79
80/*
81
82*/
83
84/*
85 =============================================================================
86 rd_icnf() -- (re)display the field
87 =============================================================================
88*/
89
90short rd_icnf(short n)
91{
92 sprintf(dspbuf, "%02d", vbufs[curvce].idhcfg); /* convert */
93
94 if (v_regs[5] & 0x0180)
95 vbank(0);
96
97 vcputsv(instob, 64, idbox[n][4], idbox[n][5], /* display */
98 idbox[n][6], idbox[n][7] + CFG_OFF, dspbuf, 14);
99
100 return(SUCCESS);
101}
102
103/*
104
105*/
106
107/*
108 =============================================================================
109 nd_icnf() -- handle new data entry
110 =============================================================================
111*/
112
113short nd_icnf(short n, short k)
114{
115 register short ec, c;
116
117 ec = stccol - cfetp->flcol; /* setup edit buffer column */
118 ebuf[ec] = k + '0'; /* enter new data in buffer */
119 ebuf[2] = '\0'; /* make sure string is terminated */
120
121 dspbuf[0] = k + '0'; /* setup for display */
122 dspbuf[1] = '\0';
123
124 if (v_regs[5] & 0x0180)
125 vbank(0);
126
127 /* display the new data */
128
129 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
130 idbox[n][6], stccol, dspbuf, 14);
131
132 advicur(); /* advance cursor */
133
134 return(SUCCESS);
135}
136
Note: See TracBrowser for help on using the repository browser.