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 "all.h"
|
---|
9 |
|
---|
10 | extern int8_t *numblk(int8_t *buf, int16_t n);
|
---|
11 |
|
---|
12 | extern void advacur(void);
|
---|
13 | extern void modasg(void);
|
---|
14 |
|
---|
15 | extern uint16_t *asgob;
|
---|
16 |
|
---|
17 | extern int16_t stcrow, stccol;
|
---|
18 |
|
---|
19 | extern int16_t adbox[][8];
|
---|
20 |
|
---|
21 | extern int8_t dspbuf[];
|
---|
22 |
|
---|
23 | extern int16_t mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
|
---|
24 |
|
---|
25 | /* |
---|
26 |
|
---|
27 | */
|
---|
28 |
|
---|
29 | /*
|
---|
30 | =============================================================================
|
---|
31 | et_accn() -- load the edit buffer
|
---|
32 | =============================================================================
|
---|
33 | */
|
---|
34 |
|
---|
35 | int16_t et_accn(int16_t n)
|
---|
36 | {
|
---|
37 | register int16_t ctl;
|
---|
38 |
|
---|
39 | int8_t buf[4];
|
---|
40 |
|
---|
41 | ctl = 0x00FF & (n >> 8);
|
---|
42 |
|
---|
43 | numblk(ebuf, (mctlnum[ctl] & 0x00FF));
|
---|
44 | ebflag = TRUE;
|
---|
45 |
|
---|
46 | return(SUCCESS);
|
---|
47 | }
|
---|
48 |
|
---|
49 | /*
|
---|
50 | =============================================================================
|
---|
51 | ef_accn() -- parse (unload) the edit buffer
|
---|
52 | =============================================================================
|
---|
53 | */
|
---|
54 |
|
---|
55 | int16_t ef_accn(int16_t n)
|
---|
56 | {
|
---|
57 | register int16_t tmpval, ctl, i;
|
---|
58 |
|
---|
59 | ctl = 0x00FF & (n >> 8);
|
---|
60 |
|
---|
61 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
62 | ebflag = FALSE;
|
---|
63 | tmpval = 0;
|
---|
64 |
|
---|
65 | if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
|
---|
66 |
|
---|
67 | tmpval = -1;
|
---|
68 |
|
---|
69 | } else {
|
---|
70 |
|
---|
71 | for (i = 0; i < 2; i++) {
|
---|
72 |
|
---|
73 | if (ebuf[i] EQ ' ')
|
---|
74 | ebuf[i] = '0';
|
---|
75 |
|
---|
76 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
77 | }
|
---|
78 | }
|
---|
79 |
|
---|
80 | if (mctlnum[ctl] EQ -1)
|
---|
81 | mctlnum[ctl] = tmpval;
|
---|
82 | else
|
---|
83 | mctlnum[ctl] = (mctlnum[ctl] & 0xFF00) | tmpval;
|
---|
84 |
|
---|
85 | modasg();
|
---|
86 | return(SUCCESS);
|
---|
87 | }
|
---|
88 |
|
---|
89 | /* |
---|
90 |
|
---|
91 | */
|
---|
92 |
|
---|
93 | /*
|
---|
94 | =============================================================================
|
---|
95 | rd_accn() -- (re)display the field
|
---|
96 | =============================================================================
|
---|
97 | */
|
---|
98 |
|
---|
99 | int16_t rd_accn(int16_t nn)
|
---|
100 | {
|
---|
101 | register int16_t n, ctl;
|
---|
102 | int8_t buf[4];
|
---|
103 |
|
---|
104 | n = 0x00FF & nn;
|
---|
105 | ctl = 0x00FF & (nn >> 8);
|
---|
106 |
|
---|
107 | vbank(0);
|
---|
108 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
109 | cfetp->frow, cfetp->flcol,
|
---|
110 | numblk(buf, (mctlnum[ctl] & 0x00FF)), 14);
|
---|
111 |
|
---|
112 | return(SUCCESS);
|
---|
113 | }
|
---|
114 |
|
---|
115 | /* |
---|
116 |
|
---|
117 | */
|
---|
118 |
|
---|
119 | /*
|
---|
120 | =============================================================================
|
---|
121 | nd_accn() -- handle new data entry
|
---|
122 | =============================================================================
|
---|
123 | */
|
---|
124 |
|
---|
125 | int16_t nd_accn(int16_t nn, int16_t k)
|
---|
126 | {
|
---|
127 | register int16_t n;
|
---|
128 |
|
---|
129 | n = nn & 0xFF;
|
---|
130 | ebuf[stccol - cfetp->flcol] = k + '0';
|
---|
131 | ebuf[2] = '\0';
|
---|
132 |
|
---|
133 | dspbuf[0] = k + '0';
|
---|
134 | dspbuf[1] = '\0';
|
---|
135 |
|
---|
136 | vbank(0);
|
---|
137 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
138 | stcrow, stccol, dspbuf, 14);
|
---|
139 |
|
---|
140 | advacur();
|
---|
141 | return(SUCCESS);
|
---|
142 | }
|
---|
143 |
|
---|
144 |
|
---|