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