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