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