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 |
|
---|
8 | #include "all.h"
|
---|
9 |
|
---|
10 | extern void modtun(void);
|
---|
11 | extern void settc(int16_t rv, int16_t cv);
|
---|
12 |
|
---|
13 | extern uint16_t *tunob;
|
---|
14 |
|
---|
15 | extern int16_t stcrow, stccol;
|
---|
16 | extern int16_t curtun, tunmod;
|
---|
17 |
|
---|
18 | extern int16_t tdbox[][8];
|
---|
19 |
|
---|
20 | extern int8_t dspbuf[];
|
---|
21 |
|
---|
22 | /* |
---|
23 |
|
---|
24 | */
|
---|
25 |
|
---|
26 | /*
|
---|
27 | =============================================================================
|
---|
28 | et_ttab() -- load the edit buffer
|
---|
29 | =============================================================================
|
---|
30 | */
|
---|
31 |
|
---|
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 | */
|
---|
45 |
|
---|
46 | int16_t ef_ttab(int16_t n)
|
---|
47 | {
|
---|
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 | =============================================================================
|
---|
67 | */
|
---|
68 |
|
---|
69 | int16_t rd_ttab(int16_t nn)
|
---|
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 | =============================================================================
|
---|
87 | */
|
---|
88 |
|
---|
89 | int16_t nd_ttab(int16_t nn, int16_t k)
|
---|
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 |
|
---|
104 | return(SUCCESS);
|
---|
105 | }
|
---|
106 |
|
---|