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