[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 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
[f40a309] | 9 |
|
---|
[7258c6a] | 10 | extern int8_t *numblk(int8_t *buf, int16_t n);
|
---|
[f40a309] | 11 |
|
---|
[e225e77] | 12 | extern void advacur(void);
|
---|
| 13 | extern void modasg(void);
|
---|
| 14 |
|
---|
[7258c6a] | 15 | extern uint16_t *asgob;
|
---|
[f40a309] | 16 |
|
---|
[7258c6a] | 17 | extern int16_t stcrow, stccol;
|
---|
[f40a309] | 18 |
|
---|
[7258c6a] | 19 | extern int16_t adbox[][8];
|
---|
[f40a309] | 20 |
|
---|
[7258c6a] | 21 | extern int8_t dspbuf[];
|
---|
[f40a309] | 22 |
|
---|
[7258c6a] | 23 | extern int16_t mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
|
---|
[f40a309] | 24 |
|
---|
| 25 | /* |
---|
| 26 |
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /*
|
---|
| 30 | =============================================================================
|
---|
| 31 | et_accn() -- load the edit buffer
|
---|
| 32 | =============================================================================
|
---|
| 33 | */
|
---|
[7258c6a] | 34 |
|
---|
[f40a309] | 35 | int16_t et_accn(int16_t n)
|
---|
[7258c6a] | 36 | {
|
---|
[f40a309] | 37 | register int16_t ctl;
|
---|
[7258c6a] | 38 |
|
---|
[f40a309] | 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 | */
|
---|
[7258c6a] | 54 |
|
---|
[f40a309] | 55 | int16_t ef_accn(int16_t n)
|
---|
[7258c6a] | 56 | {
|
---|
[f40a309] | 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 | =============================================================================
|
---|
[7258c6a] | 97 | */
|
---|
[f40a309] | 98 |
|
---|
[7258c6a] | 99 | int16_t rd_accn(int16_t nn)
|
---|
| 100 | {
|
---|
[f40a309] | 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
|
---|
[7258c6a] | 122 | =============================================================================
|
---|
[f40a309] | 123 | */
|
---|
[7258c6a] | 124 |
|
---|
[f40a309] | 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();
|
---|
[6262b5c] | 141 | return(SUCCESS);
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 |
|
---|