[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etagpt.c -- assignment editor - group to input port field handlers
|
---|
| 4 | Version 5 -- 198-10-04 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_agpt() -- load the edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_agpt(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
[7258c6a] | 18 | register int16_t grp;
|
---|
[f40a309] | 19 |
|
---|
| 20 | grp = 0x00FF & (n >> 8);
|
---|
| 21 |
|
---|
| 22 | ebuf[0] = grp2prt[grp][0];
|
---|
| 23 | ebuf[1] = '\0';
|
---|
| 24 |
|
---|
| 25 | ebflag = TRUE;
|
---|
| 26 |
|
---|
| 27 | return(SUCCESS);
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | /*
|
---|
| 31 | =============================================================================
|
---|
| 32 | ef_agpt() -- parse (unload) the edit buffer
|
---|
| 33 | =============================================================================
|
---|
| 34 | */
|
---|
| 35 |
|
---|
[7258c6a] | 36 | int16_t ef_agpt(int16_t n)
|
---|
[f40a309] | 37 | {
|
---|
[7258c6a] | 38 | register int16_t tmpval, grp, i;
|
---|
[f40a309] | 39 |
|
---|
| 40 | grp = 0x00FF & (n >> 8);
|
---|
| 41 |
|
---|
| 42 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
| 43 | ebflag = FALSE;
|
---|
| 44 |
|
---|
| 45 | grp2prt[grp][0] = ebuf[0];
|
---|
| 46 |
|
---|
| 47 | if (grp2prt[grp][0] NE 1)
|
---|
| 48 | for (i = 0; i < 88; i++)
|
---|
| 49 | key2grp[i] &= ~(0x0001 << grp);
|
---|
| 50 |
|
---|
| 51 | drawk2g(grp);
|
---|
| 52 |
|
---|
| 53 | modasg();
|
---|
| 54 | return(SUCCESS);
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | /* |
---|
| 58 |
|
---|
| 59 | */
|
---|
| 60 |
|
---|
| 61 | /*
|
---|
| 62 | =============================================================================
|
---|
| 63 | rd_agpt() -- (re)display the field
|
---|
| 64 | =============================================================================
|
---|
| 65 | */
|
---|
[7258c6a] | 66 |
|
---|
[f40a309] | 67 | int16_t rd_agpt(int16_t nn)
|
---|
[7258c6a] | 68 | {
|
---|
[f40a309] | 69 | register int16_t n, grp;
|
---|
| 70 |
|
---|
| 71 | n = 0x00FF & nn;
|
---|
| 72 | grp = 0x00FF & (nn >> 8);
|
---|
| 73 |
|
---|
| 74 | vbank(0);
|
---|
| 75 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 76 | cfetp->frow, cfetp->flcol, gprep[grp2prt[grp][0]], 14);
|
---|
| 77 |
|
---|
| 78 | return(SUCCESS);
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | /*
|
---|
| 82 | =============================================================================
|
---|
| 83 | nd_agpt() -- handle new data entry
|
---|
| 84 | =============================================================================
|
---|
| 85 | */
|
---|
[7258c6a] | 86 |
|
---|
[f40a309] | 87 | int16_t nd_agpt(int16_t nn, int16_t k)
|
---|
[7258c6a] | 88 | {
|
---|
[f40a309] | 89 | register int16_t n;
|
---|
| 90 |
|
---|
| 91 | n = nn & 0x00FF;
|
---|
| 92 |
|
---|
| 93 | if (k EQ 8) { /* '-' */
|
---|
| 94 |
|
---|
| 95 | if (--ebuf[0] LT 0)
|
---|
| 96 | ebuf[0] = 3;
|
---|
| 97 |
|
---|
| 98 | } else if (k EQ 9) { /* '+' */
|
---|
| 99 |
|
---|
| 100 | if (++ebuf[0] GT 3)
|
---|
| 101 | ebuf[0] = 0;
|
---|
| 102 |
|
---|
| 103 | } else {
|
---|
| 104 |
|
---|
| 105 | return(FAILURE);
|
---|
| 106 | }
|
---|
| 107 |
|
---|
| 108 | dspbuf[0] = *gprep[ebuf[0]];
|
---|
| 109 | dspbuf[1] = '\0';
|
---|
| 110 |
|
---|
| 111 | vbank(0);
|
---|
| 112 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 113 |
|
---|
| 114 | return(SUCCESS);
|
---|
| 115 | }
|
---|
[6262b5c] | 116 |
|
---|
| 117 |
|
---|