[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etstrn.c -- section edit group transposition field handlers
|
---|
| 4 | Version 3 -- 1989-11-14 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_strn() -- load edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_strn(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
| 18 | sprintf(ebuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
| 19 |
|
---|
| 20 | ebflag = TRUE;
|
---|
| 21 |
|
---|
| 22 | return(SUCCESS);
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | /* |
---|
| 26 |
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /*
|
---|
| 30 | =============================================================================
|
---|
| 31 | ef_strn() -- parse edit buffer
|
---|
| 32 | =============================================================================
|
---|
| 33 | */
|
---|
[7258c6a] | 34 |
|
---|
[f40a309] | 35 | int16_t ef_strn(int16_t n)
|
---|
[7258c6a] | 36 | {
|
---|
[f40a309] | 37 | register int16_t ival;
|
---|
| 38 |
|
---|
| 39 | ebuf[3] = '\0';
|
---|
| 40 | ival = ((ebuf[1] - '0') * 10) + (ebuf[2] - '0');
|
---|
| 41 |
|
---|
| 42 | ebflag = FALSE;
|
---|
| 43 |
|
---|
| 44 | if ((ival NE 0) AND (ebuf[0] EQ '-'))
|
---|
| 45 | ival = -ival;
|
---|
| 46 |
|
---|
| 47 | grptran = ival;
|
---|
| 48 |
|
---|
| 49 | return(SUCCESS);
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | /*
|
---|
| 53 | =============================================================================
|
---|
| 54 | rd_strn() -- redisplay field
|
---|
| 55 | =============================================================================
|
---|
| 56 | */
|
---|
[7258c6a] | 57 |
|
---|
[f40a309] | 58 | int16_t rd_strn(int16_t n)
|
---|
| 59 | {
|
---|
| 60 | sprintf(dspbuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
| 61 |
|
---|
| 62 | if (v_regs[5] & 0x0180)
|
---|
| 63 | vbank(0);
|
---|
| 64 |
|
---|
| 65 | vputs(obj8, 7, 22, dspbuf, SDMENUBG);
|
---|
| 66 |
|
---|
| 67 | return(SUCCESS);
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 | /* |
---|
[9519422] | 71 |
|
---|
[f40a309] | 72 | */
|
---|
| 73 |
|
---|
| 74 | /*
|
---|
| 75 | =============================================================================
|
---|
| 76 | nd_strn() -- data entry
|
---|
| 77 | =============================================================================
|
---|
[7258c6a] | 78 | */
|
---|
[f40a309] | 79 |
|
---|
[7258c6a] | 80 | int16_t nd_strn(int16_t n, int16_t k)
|
---|
[f40a309] | 81 | {
|
---|
| 82 | register int16_t ec;
|
---|
| 83 |
|
---|
| 84 | if (sdmctl NE 4)
|
---|
| 85 | return(FAILURE);
|
---|
| 86 |
|
---|
| 87 | if ((vtccol GE 22) AND (vtccol LE 24))
|
---|
| 88 | ec = vtccol - 22;
|
---|
| 89 | else
|
---|
| 90 | return(FAILURE);
|
---|
| 91 |
|
---|
| 92 | if (ec EQ 0) {
|
---|
| 93 |
|
---|
| 94 | if (k EQ 8)
|
---|
| 95 | k = '-';
|
---|
| 96 | else if (k EQ 9)
|
---|
| 97 | k = '+';
|
---|
| 98 | else
|
---|
| 99 | return(FAILURE);
|
---|
| 100 | } else
|
---|
| 101 | k += '0';
|
---|
| 102 |
|
---|
| 103 | ebuf[ec] = k;
|
---|
| 104 |
|
---|
| 105 | if (v_regs[5] & 0x0180)
|
---|
| 106 | vbank(0);
|
---|
| 107 |
|
---|
| 108 | vputc(obj8, 7, vtccol, k, (SDBGMM | (SD_ENTR << 4)));
|
---|
| 109 |
|
---|
| 110 | if (vtccol < 24) {
|
---|
| 111 |
|
---|
| 112 | ++vtccol;
|
---|
| 113 | vtxval = CTOX(vtccol);
|
---|
| 114 | ttcpos(vtcrow, vtccol);
|
---|
| 115 | }
|
---|
| 116 |
|
---|
[6262b5c] | 117 | return(SUCCESS);
|
---|
| 118 | }
|
---|
| 119 |
|
---|