[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etttab.c -- MIDAS tuning editor - tuning table number field handlers
|
---|
| 4 | Version 3 -- 1988-08-22 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
[e225e77] | 9 |
|
---|
| 10 | extern void modtun(void);
|
---|
| 11 | extern void settc(int16_t rv, int16_t cv);
|
---|
| 12 |
|
---|
[7258c6a] | 13 | extern uint16_t *tunob;
|
---|
[f40a309] | 14 |
|
---|
[7258c6a] | 15 | extern int16_t stcrow, stccol;
|
---|
| 16 | extern int16_t curtun, tunmod;
|
---|
[f40a309] | 17 |
|
---|
[7258c6a] | 18 | extern int16_t tdbox[][8];
|
---|
[f40a309] | 19 |
|
---|
[7258c6a] | 20 | extern int8_t dspbuf[];
|
---|
[f40a309] | 21 |
|
---|
| 22 | /* |
---|
| 23 |
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 | /*
|
---|
| 27 | =============================================================================
|
---|
| 28 | et_ttab() -- load the edit buffer
|
---|
| 29 | =============================================================================
|
---|
| 30 | */
|
---|
[7258c6a] | 31 |
|
---|
[f40a309] | 32 | int16_t et_ttab(int16_t n)
|
---|
| 33 | {
|
---|
| 34 | sprintf(ebuf, "%d", curtun);
|
---|
| 35 | ebflag = TRUE;
|
---|
| 36 |
|
---|
| 37 | return(SUCCESS);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | /*
|
---|
| 41 | =============================================================================
|
---|
| 42 | ef_ttab() -- parse (unload) the edit buffer
|
---|
| 43 | =============================================================================
|
---|
| 44 | */
|
---|
[7258c6a] | 45 |
|
---|
[f40a309] | 46 | int16_t ef_ttab(int16_t n)
|
---|
[7258c6a] | 47 | {
|
---|
[f40a309] | 48 | register int16_t i, tmpval;
|
---|
| 49 |
|
---|
| 50 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
| 51 | ebflag = FALSE;
|
---|
| 52 |
|
---|
| 53 | curtun = ebuf[0] - '0';
|
---|
| 54 | modtun();
|
---|
| 55 | settc(22, 54);
|
---|
| 56 | return(SUCCESS);
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | /* |
---|
| 60 |
|
---|
| 61 | */
|
---|
| 62 |
|
---|
| 63 | /*
|
---|
| 64 | =============================================================================
|
---|
| 65 | rd_ttab() -- (re)display the field
|
---|
| 66 | =============================================================================
|
---|
[7258c6a] | 67 | */
|
---|
[f40a309] | 68 |
|
---|
[7258c6a] | 69 | int16_t rd_ttab(int16_t nn)
|
---|
[f40a309] | 70 | {
|
---|
| 71 | register int16_t n;
|
---|
| 72 |
|
---|
| 73 | n = nn & 0xFF;
|
---|
| 74 | sprintf(dspbuf, "%d", curtun);
|
---|
| 75 |
|
---|
| 76 | vbank(0);
|
---|
| 77 | vcputsv(tunob, 64, (tunmod ? TDCHGD : tdbox[n][4]), tdbox[n][5],
|
---|
| 78 | 24, 61, dspbuf, 14);
|
---|
| 79 |
|
---|
| 80 | return(SUCCESS);
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | /*
|
---|
| 84 | =============================================================================
|
---|
| 85 | nd_ttab() -- handle new data entry
|
---|
| 86 | =============================================================================
|
---|
[7258c6a] | 87 | */
|
---|
[f40a309] | 88 |
|
---|
[7258c6a] | 89 | int16_t nd_ttab(int16_t nn, int16_t k)
|
---|
[f40a309] | 90 | {
|
---|
| 91 | register int16_t n;
|
---|
| 92 |
|
---|
| 93 | n = nn & 0xFF;
|
---|
| 94 |
|
---|
| 95 | ebuf[0] = k + '0';
|
---|
| 96 | ebuf[1] = '\0';
|
---|
| 97 |
|
---|
| 98 | dspbuf[0] = k + '0';
|
---|
| 99 | dspbuf[1] = '\0';
|
---|
| 100 |
|
---|
| 101 | vbank(0);
|
---|
| 102 | vcputsv(tunob, 64, TDENTRY, tdbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 103 |
|
---|
[6262b5c] | 104 | return(SUCCESS);
|
---|
| 105 | }
|
---|
| 106 |
|
---|