[f40a309] | 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 |
|
---|
[0580615] | 18 | extern void adpoint(short x, short y, short pen);
|
---|
[f40a309] | 19 |
|
---|
[0c834c5] | 20 | extern void (*point)(short x, short y, short pen);
|
---|
[f40a309] | 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 | */
|
---|
[0580615] | 42 |
|
---|
[f40a309] | 43 | short et_atab(short n)
|
---|
| 44 | {
|
---|
| 45 | sprintf(ebuf, "%02d", curasg);
|
---|
| 46 | ebflag = TRUE;
|
---|
| 47 |
|
---|
| 48 | return(SUCCESS);
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | /*
|
---|
| 52 | =============================================================================
|
---|
| 53 | ef_atab() -- parse (unload) the edit buffer
|
---|
| 54 | =============================================================================
|
---|
| 55 | */
|
---|
[0580615] | 56 |
|
---|
[f40a309] | 57 | short ef_atab(short n)
|
---|
| 58 | {
|
---|
| 59 | register short i, tmpval;
|
---|
| 60 |
|
---|
| 61 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 62 | ebflag = FALSE;
|
---|
| 63 | tmpval = 0;
|
---|
| 64 |
|
---|
| 65 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 66 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 67 |
|
---|
| 68 | if (tmpval GE NASGS)
|
---|
| 69 | return(FAILURE);
|
---|
| 70 |
|
---|
| 71 | curasg = tmpval;
|
---|
| 72 | asgmod = TRUE;
|
---|
| 73 | adswin(0);
|
---|
| 74 |
|
---|
| 75 | settc(2, 6);
|
---|
| 76 |
|
---|
| 77 | return(SUCCESS);
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | /* |
---|
| 81 |
|
---|
| 82 | */
|
---|
| 83 |
|
---|
| 84 | /*
|
---|
| 85 | =============================================================================
|
---|
| 86 | rd_atab() -- (re)display the field
|
---|
| 87 | =============================================================================
|
---|
[0580615] | 88 | */
|
---|
[f40a309] | 89 |
|
---|
| 90 | short rd_atab(short nn)
|
---|
| 91 | {
|
---|
| 92 | register short n;
|
---|
| 93 |
|
---|
| 94 | n = nn & 0xFF;
|
---|
| 95 | sprintf(dspbuf, "%02.2d", curasg);
|
---|
| 96 |
|
---|
| 97 | point = adpoint;
|
---|
| 98 |
|
---|
| 99 | if (v_regs[5] & 0x0180)
|
---|
| 100 | vbank(0);
|
---|
| 101 |
|
---|
| 102 | vcputsv(asgob, 64, (asgmod ? exp_c(AK_MODC) : adbox[n][4]), adbox[n][5],
|
---|
| 103 | cfetp->frow, cfetp->flcol, dspbuf, 14);
|
---|
| 104 |
|
---|
| 105 | lseg(0, 0, 128, 0, AK_BORD);
|
---|
| 106 |
|
---|
| 107 | return(SUCCESS);
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | /*
|
---|
| 111 | =============================================================================
|
---|
| 112 | nd_atab() -- handle new data entry
|
---|
| 113 | =============================================================================
|
---|
[0580615] | 114 | */
|
---|
[f40a309] | 115 |
|
---|
| 116 | short nd_atab(short nn, short k)
|
---|
| 117 | {
|
---|
| 118 | register short ec, n;
|
---|
| 119 |
|
---|
| 120 | n = nn & 0xFF;
|
---|
| 121 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 122 |
|
---|
| 123 | ebuf[ec] = k + '0';
|
---|
| 124 | ebuf[2] = '\0';
|
---|
| 125 |
|
---|
| 126 | dspbuf[0] = k + '0';
|
---|
| 127 | dspbuf[1] = '\0';
|
---|
| 128 |
|
---|
| 129 | point = adpoint;
|
---|
| 130 |
|
---|
| 131 | if (v_regs[5] & 0x0180)
|
---|
| 132 | vbank(0);
|
---|
| 133 |
|
---|
| 134 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
| 135 | stcrow, stccol, dspbuf, 14);
|
---|
| 136 |
|
---|
| 137 | lseg(0, 0, 128, 0, AK_BORD);
|
---|
| 138 |
|
---|
| 139 | advacur();
|
---|
| 140 | return(SUCCESS);
|
---|
| 141 | }
|
---|
| 142 |
|
---|