[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 | ef_strn() -- parse edit buffer
|
---|
| 28 | =============================================================================
|
---|
| 29 | */
|
---|
| 30 |
|
---|
[7258c6a] | 31 | int16_t ef_strn(int16_t n)
|
---|
[f40a309] | 32 | {
|
---|
[7258c6a] | 33 | register int16_t ival;
|
---|
[f40a309] | 34 |
|
---|
| 35 | ebuf[3] = '\0';
|
---|
| 36 | ival = ((ebuf[1] - '0') * 10) + (ebuf[2] - '0');
|
---|
| 37 |
|
---|
| 38 | ebflag = FALSE;
|
---|
| 39 |
|
---|
| 40 | if ((ival NE 0) AND (ebuf[0] EQ '-'))
|
---|
| 41 | ival = -ival;
|
---|
| 42 |
|
---|
| 43 | grptran = ival;
|
---|
| 44 |
|
---|
| 45 | return(SUCCESS);
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | /*
|
---|
| 49 | =============================================================================
|
---|
| 50 | rd_strn() -- redisplay field
|
---|
| 51 | =============================================================================
|
---|
| 52 | */
|
---|
| 53 |
|
---|
[7258c6a] | 54 | int16_t rd_strn(int16_t n)
|
---|
[f40a309] | 55 | {
|
---|
| 56 | sprintf(dspbuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
| 57 |
|
---|
| 58 | if (v_regs[5] & 0x0180)
|
---|
| 59 | vbank(0);
|
---|
| 60 |
|
---|
| 61 | vputs(obj8, 7, 22, dspbuf, SDMENUBG);
|
---|
| 62 |
|
---|
| 63 | return(SUCCESS);
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | /*
|
---|
| 67 | =============================================================================
|
---|
| 68 | nd_strn() -- data entry
|
---|
| 69 | =============================================================================
|
---|
| 70 | */
|
---|
| 71 |
|
---|
[7258c6a] | 72 | int16_t nd_strn(int16_t n, int16_t k)
|
---|
[f40a309] | 73 | {
|
---|
[7258c6a] | 74 | register int16_t ec;
|
---|
[f40a309] | 75 |
|
---|
| 76 | if (sdmctl NE 4)
|
---|
| 77 | return(FAILURE);
|
---|
| 78 |
|
---|
| 79 | if ((vtccol GE 22) AND (vtccol LE 24))
|
---|
| 80 | ec = vtccol - 22;
|
---|
| 81 | else
|
---|
| 82 | return(FAILURE);
|
---|
| 83 |
|
---|
| 84 | if (ec EQ 0) {
|
---|
| 85 |
|
---|
| 86 | if (k EQ 8)
|
---|
| 87 | k = '-';
|
---|
| 88 | else if (k EQ 9)
|
---|
| 89 | k = '+';
|
---|
| 90 | else
|
---|
| 91 | return(FAILURE);
|
---|
| 92 | } else
|
---|
| 93 | k += '0';
|
---|
| 94 |
|
---|
| 95 | ebuf[ec] = k;
|
---|
| 96 |
|
---|
| 97 | if (v_regs[5] & 0x0180)
|
---|
| 98 | vbank(0);
|
---|
| 99 |
|
---|
| 100 | vputc(obj8, 7, vtccol, k, (SDBGMM | (SD_ENTR << 4)));
|
---|
| 101 |
|
---|
| 102 | if (vtccol < 24) {
|
---|
| 103 |
|
---|
| 104 | ++vtccol;
|
---|
| 105 | vtxval = CTOX(vtccol);
|
---|
| 106 | ttcpos(vtcrow, vtccol);
|
---|
| 107 | }
|
---|
| 108 |
|
---|
| 109 | return(SUCCESS);
|
---|
| 110 | }
|
---|
[6262b5c] | 111 |
|
---|