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