[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] | 18 | int16_t et_icnf(int16_t n)
|
---|
[f40a309] | 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 | */
|
---|
[7258c6a] | 35 |
|
---|
[f40a309] | 36 | int16_t ef_icnf(int16_t n)
|
---|
[7258c6a] | 37 | {
|
---|
[f40a309] | 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 | =============================================================================
|
---|
[7258c6a] | 66 | */
|
---|
[f40a309] | 67 |
|
---|
| 68 | int16_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
|
---|
[7258c6a] | 88 | =============================================================================
|
---|
[f40a309] | 89 | */
|
---|
[7258c6a] | 90 |
|
---|
[f40a309] | 91 | int16_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 |
|
---|
[6262b5c] | 112 | return(SUCCESS);
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 |
|
---|