[3ae31e9] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etatab.c -- assignment editor - assignment table number field handlers
|
---|
| 4 | Version 9 -- 1988-08-22 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "stddefs.h"
|
---|
| 9 | #include "fields.h"
|
---|
| 10 | #include "hwdefs.h"
|
---|
| 11 | #include "vsdd.h"
|
---|
| 12 | #include "vsddsw.h"
|
---|
| 13 | #include "graphdef.h"
|
---|
| 14 |
|
---|
| 15 | #include "midas.h"
|
---|
| 16 | #include "asgdsp.h"
|
---|
| 17 |
|
---|
| 18 | extern short adpoint();
|
---|
| 19 |
|
---|
| 20 | extern short (*point)();
|
---|
| 21 |
|
---|
| 22 | extern unsigned *asgob;
|
---|
| 23 |
|
---|
| 24 | extern short asgmod;
|
---|
| 25 | extern short curasg;
|
---|
| 26 | extern short stccol;
|
---|
| 27 | extern short stcrow;
|
---|
| 28 |
|
---|
| 29 | extern short adbox[][8];
|
---|
| 30 |
|
---|
| 31 | extern char dspbuf[];
|
---|
| 32 |
|
---|
| 33 | /* |
---|
| 34 |
|
---|
| 35 | */
|
---|
| 36 |
|
---|
| 37 | /*
|
---|
| 38 | =============================================================================
|
---|
| 39 | et_atab() -- load the edit buffer
|
---|
| 40 | =============================================================================
|
---|
| 41 | */
|
---|
| 42 |
|
---|
| 43 | short
|
---|
| 44 | et_atab(n)
|
---|
| 45 | short n;
|
---|
| 46 | {
|
---|
| 47 | sprintf(ebuf, "%02d", curasg);
|
---|
| 48 | ebflag = TRUE;
|
---|
| 49 |
|
---|
| 50 | return(SUCCESS);
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | /*
|
---|
| 54 | =============================================================================
|
---|
| 55 | ef_atab() -- parse (unload) the edit buffer
|
---|
| 56 | =============================================================================
|
---|
| 57 | */
|
---|
| 58 |
|
---|
| 59 | short
|
---|
| 60 | ef_atab(n)
|
---|
| 61 | short n;
|
---|
| 62 | {
|
---|
| 63 | register short i, tmpval;
|
---|
| 64 |
|
---|
| 65 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 66 | ebflag = FALSE;
|
---|
| 67 | tmpval = 0;
|
---|
| 68 |
|
---|
| 69 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 70 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 71 |
|
---|
| 72 | if (tmpval GE NASGS)
|
---|
| 73 | return(FAILURE);
|
---|
| 74 |
|
---|
| 75 | curasg = tmpval;
|
---|
| 76 | asgmod = TRUE;
|
---|
| 77 | adswin(0);
|
---|
| 78 |
|
---|
| 79 | settc(2, 6);
|
---|
| 80 |
|
---|
| 81 | return(SUCCESS);
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | /* |
---|
| 85 |
|
---|
| 86 | */
|
---|
| 87 |
|
---|
| 88 | /*
|
---|
| 89 | =============================================================================
|
---|
| 90 | rd_atab() -- (re)display the field
|
---|
| 91 | =============================================================================
|
---|
| 92 | */
|
---|
| 93 |
|
---|
| 94 | short
|
---|
| 95 | rd_atab(nn)
|
---|
| 96 | short nn;
|
---|
| 97 | {
|
---|
| 98 | register short n;
|
---|
| 99 |
|
---|
| 100 | n = nn & 0xFF;
|
---|
| 101 | sprintf(dspbuf, "%02.2d", curasg);
|
---|
| 102 |
|
---|
| 103 | point = adpoint;
|
---|
| 104 |
|
---|
| 105 | if (v_regs[5] & 0x0180)
|
---|
| 106 | vbank(0);
|
---|
| 107 |
|
---|
| 108 | vcputsv(asgob, 64, (asgmod ? exp_c(AK_MODC) : adbox[n][4]), adbox[n][5],
|
---|
| 109 | cfetp->frow, cfetp->flcol, dspbuf, 14);
|
---|
| 110 |
|
---|
| 111 | lseg(0, 0, 128, 0, AK_BORD);
|
---|
| 112 |
|
---|
| 113 | return(SUCCESS);
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | /*
|
---|
| 117 | =============================================================================
|
---|
| 118 | nd_atab() -- handle new data entry
|
---|
| 119 | =============================================================================
|
---|
| 120 | */
|
---|
| 121 |
|
---|
| 122 | short
|
---|
| 123 | nd_atab(nn, k)
|
---|
| 124 | short nn;
|
---|
| 125 | register short k;
|
---|
| 126 | {
|
---|
| 127 | register short ec, n;
|
---|
| 128 |
|
---|
| 129 | n = nn & 0xFF;
|
---|
| 130 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 131 |
|
---|
| 132 | ebuf[ec] = k + '0';
|
---|
| 133 | ebuf[2] = '\0';
|
---|
| 134 |
|
---|
| 135 | dspbuf[0] = k + '0';
|
---|
| 136 | dspbuf[1] = '\0';
|
---|
| 137 |
|
---|
| 138 | point = adpoint;
|
---|
| 139 |
|
---|
| 140 | if (v_regs[5] & 0x0180)
|
---|
| 141 | vbank(0);
|
---|
| 142 |
|
---|
| 143 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
| 144 | stcrow, stccol, dspbuf, 14);
|
---|
| 145 |
|
---|
| 146 | lseg(0, 0, 128, 0, AK_BORD);
|
---|
| 147 |
|
---|
| 148 | advacur();
|
---|
| 149 | return(SUCCESS);
|
---|
| 150 | }
|
---|
| 151 |
|
---|