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