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

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.5 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 "ram.h"
9
10#define CFG_OFF 10 /* display offset into configuration field */
11
12/*
13 =============================================================================
14 et_icnf() -- load the edit buffer
15 =============================================================================
16*/
17
18int16_t et_icnf(int16_t n)
19{
20 sprintf(ebuf, "%02d", vbufs[curvce].idhcfg);
21 ebflag = TRUE;
22
23 return(SUCCESS);
24}
25
26/*
27
28*/
29
30/*
31 =============================================================================
32 ef_icnf() -- parse (unload) the edit buffer
33 =============================================================================
34*/
35
36int16_t ef_icnf(int16_t n)
37{
38 register int16_t i, tmpval;
39
40 ebuf[2] = '\0'; /* terminate the string in ebuf */
41 ebflag = FALSE;
42
43 tmpval = 0;
44
45 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
46 tmpval = (tmpval * 10) + (ebuf[i] - '0');
47
48 if (tmpval GE NUMCFG) /* check against limit */
49 return(FAILURE);
50
51 vbufs[curvce].idhcfg = tmpval;
52 dosync(curvce);
53 showcfg(tmpval);
54 modinst();
55 return(SUCCESS);
56}
57
58/*
59
60*/
61
62/*
63 =============================================================================
64 rd_icnf() -- (re)display the field
65 =============================================================================
66*/
67
68int16_t rd_icnf(int16_t n)
69{
70 sprintf(dspbuf, "%02d", vbufs[curvce].idhcfg); /* convert */
71
72 if (v_regs[5] & 0x0180)
73 vbank(0);
74
75 vcputsv(instob, 64, idbox[n][4], idbox[n][5], /* display */
76 idbox[n][6], idbox[n][7] + CFG_OFF, dspbuf, 14);
77
78 return(SUCCESS);
79}
80
81/*
82
83*/
84
85/*
86 =============================================================================
87 nd_icnf() -- handle new data entry
88 =============================================================================
89*/
90
91int16_t nd_icnf(int16_t n, int16_t k)
92{
93 register int16_t ec, c;
94
95 ec = stccol - cfetp->flcol; /* setup edit buffer column */
96 ebuf[ec] = k + '0'; /* enter new data in buffer */
97 ebuf[2] = '\0'; /* make sure string is terminated */
98
99 dspbuf[0] = k + '0'; /* setup for display */
100 dspbuf[1] = '\0';
101
102 if (v_regs[5] & 0x0180)
103 vbank(0);
104
105 /* display the new data */
106
107 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
108 idbox[n][6], stccol, dspbuf, 14);
109
110 advicur(); /* advance cursor */
111
112 return(SUCCESS);
113}
114
115
Note: See TracBrowser for help on using the repository browser.