[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etaopt.c -- assignment editor - MIDI output port number field handlers
|
---|
| 4 | Version 4 -- 1987-12-11 -- 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 |
|
---|
[e225e77] | 17 | #include "stdio.h"
|
---|
| 18 |
|
---|
| 19 | extern void modasg(void);
|
---|
| 20 |
|
---|
[7258c6a] | 21 | extern uint16_t *asgob;
|
---|
[f40a309] | 22 |
|
---|
[7258c6a] | 23 | extern int16_t stcrow, stccol;
|
---|
| 24 | extern int16_t curmop;
|
---|
[f40a309] | 25 |
|
---|
[7258c6a] | 26 | extern int16_t adbox[][8];
|
---|
[f40a309] | 27 |
|
---|
[7258c6a] | 28 | extern int8_t dspbuf[];
|
---|
[f40a309] | 29 |
|
---|
[7258c6a] | 30 | extern int8_t *gprep[];
|
---|
[f40a309] | 31 |
|
---|
| 32 | /* |
---|
| 33 |
|
---|
| 34 | */
|
---|
| 35 |
|
---|
| 36 | /*
|
---|
| 37 | =============================================================================
|
---|
| 38 | et_aopt() -- load the edit buffer
|
---|
| 39 | =============================================================================
|
---|
| 40 | */
|
---|
[7258c6a] | 41 |
|
---|
[f40a309] | 42 | int16_t et_aopt(int16_t n)
|
---|
| 43 | {
|
---|
| 44 | sprintf(ebuf, "%01.1d", curmop);
|
---|
| 45 | ebflag = TRUE;
|
---|
| 46 |
|
---|
| 47 | return(SUCCESS);
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | /*
|
---|
| 51 | =============================================================================
|
---|
| 52 | ef_aopt() -- parse (unload) the edit buffer
|
---|
| 53 | =============================================================================
|
---|
| 54 | */
|
---|
[7258c6a] | 55 |
|
---|
[f40a309] | 56 | int16_t ef_aopt(int16_t n)
|
---|
[7258c6a] | 57 | {
|
---|
[f40a309] | 58 | register int16_t tmpval;
|
---|
| 59 |
|
---|
| 60 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
| 61 | ebflag = FALSE;
|
---|
| 62 |
|
---|
| 63 | tmpval = ebuf[0] - '0';
|
---|
| 64 |
|
---|
| 65 | if (tmpval GT 3)
|
---|
| 66 | return(FAILURE);
|
---|
| 67 |
|
---|
| 68 | curmop = tmpval;
|
---|
| 69 | modasg();
|
---|
| 70 | return(SUCCESS);
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | /* |
---|
| 74 |
|
---|
| 75 | */
|
---|
| 76 |
|
---|
| 77 | /*
|
---|
| 78 | =============================================================================
|
---|
| 79 | rd_aopt() -- (re)display the field
|
---|
| 80 | =============================================================================
|
---|
[7258c6a] | 81 | */
|
---|
[f40a309] | 82 |
|
---|
[7258c6a] | 83 | int16_t rd_aopt(int16_t nn)
|
---|
[f40a309] | 84 | {
|
---|
| 85 | register int16_t n;
|
---|
| 86 |
|
---|
| 87 | n = nn & 0xFF;
|
---|
| 88 |
|
---|
| 89 | vbank(0);
|
---|
| 90 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 91 | adbox[n][6], adbox[n][7] + 9, gprep[curmop], 14);
|
---|
| 92 |
|
---|
| 93 | return(SUCCESS);
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | /*
|
---|
| 97 | =============================================================================
|
---|
| 98 | nd_aopt() -- handle new data entry
|
---|
| 99 | =============================================================================
|
---|
[7258c6a] | 100 | */
|
---|
[f40a309] | 101 |
|
---|
[7258c6a] | 102 | int16_t nd_aopt(int16_t nn, int16_t k)
|
---|
[f40a309] | 103 | {
|
---|
| 104 | register int16_t n;
|
---|
| 105 |
|
---|
| 106 | if ((k < 1) OR (k > 2))
|
---|
| 107 | return(FAILURE);
|
---|
| 108 |
|
---|
| 109 | n = nn & 0xFF;
|
---|
| 110 | ebuf[0] = k + '0';
|
---|
| 111 | ebuf[1] = '\0';
|
---|
| 112 |
|
---|
| 113 | dspbuf[0] = k + '0';
|
---|
| 114 | dspbuf[1] = '\0';
|
---|
| 115 |
|
---|
| 116 | vbank(0);
|
---|
| 117 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 118 |
|
---|
| 119 | return(SUCCESS);
|
---|
| 120 | }
|
---|
| 121 |
|
---|