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