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

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[f40a309]1/*
2 =============================================================================
3 eticnf.c -- instrument editor - configuration number field handlers
4 Version 16 -- 1988-08-23 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[b28a12e]8#include "ram.h"
[e225e77]9
[f40a309]10#define CFG_OFF 10 /* display offset into configuration field */
11
12/*
13 =============================================================================
14 et_icnf() -- load the edit buffer
15 =============================================================================
16*/
17
[7258c6a]18int16_t et_icnf(int16_t n)
[f40a309]19{
[7ecfb7b]20 (void)n;
21
[f40a309]22 sprintf(ebuf, "%02d", vbufs[curvce].idhcfg);
23 ebflag = TRUE;
24
25 return(SUCCESS);
26}
27
28/*
29 =============================================================================
30 ef_icnf() -- parse (unload) the edit buffer
31 =============================================================================
32*/
33
[7258c6a]34int16_t ef_icnf(int16_t n)
[f40a309]35{
[7258c6a]36 register int16_t i, tmpval;
[f40a309]37
[7ecfb7b]38 (void)n;
39
[f40a309]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 rd_icnf() -- (re)display the field
61 =============================================================================
62*/
63
[7258c6a]64int16_t rd_icnf(int16_t n)
[f40a309]65{
66 sprintf(dspbuf, "%02d", vbufs[curvce].idhcfg); /* convert */
67
68 if (v_regs[5] & 0x0180)
69 vbank(0);
70
71 vcputsv(instob, 64, idbox[n][4], idbox[n][5], /* display */
72 idbox[n][6], idbox[n][7] + CFG_OFF, dspbuf, 14);
73
74 return(SUCCESS);
75}
76
77/*
78 =============================================================================
79 nd_icnf() -- handle new data entry
80 =============================================================================
81*/
82
[7258c6a]83int16_t nd_icnf(int16_t n, int16_t k)
[f40a309]84{
[7ecfb7b]85 register int16_t ec;
[f40a309]86
87 ec = stccol - cfetp->flcol; /* setup edit buffer column */
88 ebuf[ec] = k + '0'; /* enter new data in buffer */
89 ebuf[2] = '\0'; /* make sure string is terminated */
90
91 dspbuf[0] = k + '0'; /* setup for display */
92 dspbuf[1] = '\0';
93
94 if (v_regs[5] & 0x0180)
95 vbank(0);
96
97 /* display the new data */
98
99 vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
100 idbox[n][6], stccol, dspbuf, 14);
101
102 advicur(); /* advance cursor */
103
104 return(SUCCESS);
105}
106
[6262b5c]107
Note: See TracBrowser for help on using the repository browser.