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

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

Added include files for global functions and variables.

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