[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 |
|
---|
| 8 | #include "fields.h"
|
---|
| 9 | #include "hwdefs.h"
|
---|
| 10 | #include "graphdef.h"
|
---|
| 11 | #include "vsdd.h"
|
---|
| 12 | #include "vsddsw.h"
|
---|
| 13 | #include "stddefs.h"
|
---|
| 14 | #include "score.h"
|
---|
| 15 | #include "macros.h"
|
---|
| 16 |
|
---|
| 17 | #include "midas.h"
|
---|
| 18 | #include "scdsp.h"
|
---|
| 19 |
|
---|
[e225e77] | 20 | #include "stdio.h"
|
---|
| 21 |
|
---|
| 22 | extern void ttcpos(int16_t row, int16_t col);
|
---|
| 23 |
|
---|
[7258c6a] | 24 | extern uint16_t *obj8;
|
---|
[f40a309] | 25 |
|
---|
[7258c6a] | 26 | extern int16_t grptran;
|
---|
| 27 | extern int16_t sdmctl;
|
---|
| 28 | extern int16_t vtccol;
|
---|
| 29 | extern int16_t vtcrow;
|
---|
| 30 | extern int16_t vtxval;
|
---|
| 31 | extern int16_t vtyval;
|
---|
[f40a309] | 32 |
|
---|
[7258c6a] | 33 | extern int8_t dspbuf[];
|
---|
[f40a309] | 34 |
|
---|
| 35 | /*
|
---|
| 36 | =============================================================================
|
---|
| 37 | et_strn() -- load edit buffer
|
---|
| 38 | =============================================================================
|
---|
| 39 | */
|
---|
| 40 |
|
---|
[7258c6a] | 41 | int16_t et_strn(int16_t n)
|
---|
[f40a309] | 42 | {
|
---|
| 43 | sprintf(ebuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
| 44 |
|
---|
| 45 | ebflag = TRUE;
|
---|
| 46 |
|
---|
| 47 | return(SUCCESS);
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | /* |
---|
| 51 |
|
---|
| 52 | */
|
---|
| 53 |
|
---|
| 54 | /*
|
---|
| 55 | =============================================================================
|
---|
| 56 | ef_strn() -- parse edit buffer
|
---|
| 57 | =============================================================================
|
---|
| 58 | */
|
---|
[7258c6a] | 59 |
|
---|
[f40a309] | 60 | int16_t ef_strn(int16_t n)
|
---|
[7258c6a] | 61 | {
|
---|
[f40a309] | 62 | register int16_t ival;
|
---|
| 63 |
|
---|
| 64 | ebuf[3] = '\0';
|
---|
| 65 | ival = ((ebuf[1] - '0') * 10) + (ebuf[2] - '0');
|
---|
| 66 |
|
---|
| 67 | ebflag = FALSE;
|
---|
| 68 |
|
---|
| 69 | if ((ival NE 0) AND (ebuf[0] EQ '-'))
|
---|
| 70 | ival = -ival;
|
---|
| 71 |
|
---|
| 72 | grptran = ival;
|
---|
| 73 |
|
---|
| 74 | return(SUCCESS);
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | /*
|
---|
| 78 | =============================================================================
|
---|
| 79 | rd_strn() -- redisplay field
|
---|
| 80 | =============================================================================
|
---|
| 81 | */
|
---|
[7258c6a] | 82 |
|
---|
[f40a309] | 83 | int16_t rd_strn(int16_t n)
|
---|
| 84 | {
|
---|
| 85 | sprintf(dspbuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
| 86 |
|
---|
| 87 | if (v_regs[5] & 0x0180)
|
---|
| 88 | vbank(0);
|
---|
| 89 |
|
---|
| 90 | vputs(obj8, 7, 22, dspbuf, SDMENUBG);
|
---|
| 91 |
|
---|
| 92 | return(SUCCESS);
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | /* |
---|
[9519422] | 96 |
|
---|
[f40a309] | 97 | */
|
---|
| 98 |
|
---|
| 99 | /*
|
---|
| 100 | =============================================================================
|
---|
| 101 | nd_strn() -- data entry
|
---|
| 102 | =============================================================================
|
---|
[7258c6a] | 103 | */
|
---|
[f40a309] | 104 |
|
---|
[7258c6a] | 105 | int16_t nd_strn(int16_t n, int16_t k)
|
---|
[f40a309] | 106 | {
|
---|
| 107 | register int16_t ec;
|
---|
| 108 |
|
---|
| 109 | if (sdmctl NE 4)
|
---|
| 110 | return(FAILURE);
|
---|
| 111 |
|
---|
| 112 | if ((vtccol GE 22) AND (vtccol LE 24))
|
---|
| 113 | ec = vtccol - 22;
|
---|
| 114 | else
|
---|
| 115 | return(FAILURE);
|
---|
| 116 |
|
---|
| 117 | if (ec EQ 0) {
|
---|
| 118 |
|
---|
| 119 | if (k EQ 8)
|
---|
| 120 | k = '-';
|
---|
| 121 | else if (k EQ 9)
|
---|
| 122 | k = '+';
|
---|
| 123 | else
|
---|
| 124 | return(FAILURE);
|
---|
| 125 | } else
|
---|
| 126 | k += '0';
|
---|
| 127 |
|
---|
| 128 | ebuf[ec] = k;
|
---|
| 129 |
|
---|
| 130 | if (v_regs[5] & 0x0180)
|
---|
| 131 | vbank(0);
|
---|
| 132 |
|
---|
| 133 | vputc(obj8, 7, vtccol, k, (SDBGMM | (SD_ENTR << 4)));
|
---|
| 134 |
|
---|
| 135 | if (vtccol < 24) {
|
---|
| 136 |
|
---|
| 137 | ++vtccol;
|
---|
| 138 | vtxval = CTOX(vtccol);
|
---|
| 139 | ttcpos(vtcrow, vtccol);
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 | return(SUCCESS);
|
---|
| 143 | }
|
---|