[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etinst.c -- instrument field handlers
|
---|
| 4 | Version 23 -- 1988-07-11 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "stddefs.h"
|
---|
| 9 | #include "fields.h"
|
---|
| 10 | #include "hwdefs.h"
|
---|
| 11 | #include "graphdef.h"
|
---|
| 12 | #include "vsdd.h"
|
---|
| 13 | #include "vsddsw.h"
|
---|
| 14 | #include "score.h"
|
---|
| 15 | #include "scfns.h"
|
---|
| 16 |
|
---|
| 17 | #include "midas.h"
|
---|
| 18 | #include "scdsp.h"
|
---|
| 19 | #include "instdsp.h"
|
---|
| 20 |
|
---|
[e225e77] | 21 | #include "stdio.h"
|
---|
| 22 |
|
---|
| 23 | extern void advscur(void);
|
---|
| 24 | extern void scupd(void);
|
---|
| 25 | extern void se_disp(struct s_entry *ep, int16_t sd, struct gdsel *gdstb[], int16_t cf);
|
---|
| 26 | extern void setinst(void);
|
---|
| 27 | extern void setv2gi(int16_t group);
|
---|
| 28 |
|
---|
[7258c6a] | 29 | extern uint16_t *obj8;
|
---|
[f40a309] | 30 |
|
---|
[7258c6a] | 31 | extern int16_t ctrsw;
|
---|
| 32 | extern int16_t recsw;
|
---|
| 33 | extern int16_t stccol;
|
---|
[f40a309] | 34 |
|
---|
[7258c6a] | 35 | extern int16_t grpmode[];
|
---|
| 36 | extern int16_t grpstat[];
|
---|
| 37 | extern int16_t ins2grp[];
|
---|
[f40a309] | 38 |
|
---|
| 39 | extern struct gdsel *gdstbc[];
|
---|
| 40 |
|
---|
| 41 | /*
|
---|
| 42 | =============================================================================
|
---|
| 43 | et_inst() -- load edit buffer
|
---|
| 44 | =============================================================================
|
---|
| 45 | */
|
---|
| 46 |
|
---|
[7258c6a] | 47 | int16_t et_inst(int16_t n)
|
---|
[f40a309] | 48 | {
|
---|
| 49 | sprintf(ebuf, "%02.2d", ins2grp[n] & 0x00FF);
|
---|
| 50 | ebflag = TRUE;
|
---|
| 51 |
|
---|
| 52 | return(SUCCESS);
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | /* |
---|
| 56 |
|
---|
| 57 | */
|
---|
| 58 |
|
---|
| 59 | /*
|
---|
| 60 | =============================================================================
|
---|
| 61 | ef_inst() -- parse edit buffer
|
---|
| 62 | =============================================================================
|
---|
| 63 | */
|
---|
[7258c6a] | 64 |
|
---|
[f40a309] | 65 | int16_t ef_inst(int16_t n)
|
---|
[7258c6a] | 66 | {
|
---|
[f40a309] | 67 | register int16_t ival;
|
---|
| 68 | register struct s_entry *ep;
|
---|
| 69 |
|
---|
| 70 | ebuf[2] = '\0';
|
---|
| 71 | ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
|
---|
| 72 | ebflag = FALSE;
|
---|
| 73 |
|
---|
| 74 | if (ival GE NINST)
|
---|
| 75 | return(FAILURE);
|
---|
| 76 |
|
---|
| 77 | ins2grp[n] = ival | (ins2grp[n] & 0xFF00);
|
---|
| 78 | setv2gi(n);
|
---|
| 79 | setinst();
|
---|
| 80 |
|
---|
| 81 | if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
|
---|
| 82 |
|
---|
| 83 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INST, n, -1))) {
|
---|
| 84 |
|
---|
| 85 | ep->e_data2 = ival;
|
---|
| 86 |
|
---|
| 87 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
| 88 |
|
---|
| 89 | ep->e_type = EV_INST;
|
---|
| 90 | ep->e_data1 = n;
|
---|
| 91 | ep->e_data2 = ival;
|
---|
| 92 | ep->e_time = t_cur;
|
---|
| 93 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
| 94 | eh_ins(ep, EH_INST);
|
---|
| 95 | ctrsw = TRUE;
|
---|
| 96 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
| 97 | scupd();
|
---|
| 98 | }
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | return(SUCCESS);
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | /* |
---|
| 105 |
|
---|
| 106 | */
|
---|
| 107 |
|
---|
| 108 | /*
|
---|
| 109 | =============================================================================
|
---|
| 110 | rd_inst() -- (re)display the field
|
---|
| 111 | =============================================================================
|
---|
[7258c6a] | 112 | */
|
---|
[f40a309] | 113 |
|
---|
[7258c6a] | 114 | int16_t rd_inst(int16_t n)
|
---|
[f40a309] | 115 | {
|
---|
| 116 | int8_t buf[4];
|
---|
| 117 |
|
---|
| 118 | sprintf(buf, "%02.2d", ins2grp[n] & 0x00FF);
|
---|
| 119 |
|
---|
| 120 | if (v_regs[5] & 0x0180)
|
---|
| 121 | vbank(0);
|
---|
| 122 |
|
---|
| 123 | vputs(obj8, 2, 7+(n*5), buf, SDW11ATR);
|
---|
| 124 |
|
---|
| 125 | return(SUCCESS);
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | /*
|
---|
| 129 | =============================================================================
|
---|
| 130 | ds_inst() -- display all instrument to group assignments
|
---|
| 131 | =============================================================================
|
---|
[0580615] | 132 | */
|
---|
[f40a309] | 133 |
|
---|
[7258c6a] | 134 | void ds_inst(void)
|
---|
[f40a309] | 135 | {
|
---|
| 136 | register int16_t i;
|
---|
| 137 |
|
---|
| 138 | for (i = 0; i < 12; i++)
|
---|
| 139 | rd_inst(i);
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 | /* |
---|
| 143 |
|
---|
| 144 | */
|
---|
| 145 |
|
---|
| 146 | /*
|
---|
| 147 | =============================================================================
|
---|
| 148 | nd_inst() -- data entry function
|
---|
[7258c6a] | 149 | =============================================================================
|
---|
[f40a309] | 150 | */
|
---|
[7258c6a] | 151 |
|
---|
[f40a309] | 152 | int16_t nd_inst(int16_t n, int16_t k)
|
---|
| 153 | {
|
---|
| 154 | register int16_t ec;
|
---|
| 155 |
|
---|
| 156 | ec = stccol - cfetp->flcol;
|
---|
| 157 | ebuf[ec] = k + '0';
|
---|
| 158 |
|
---|
| 159 | if (v_regs[5] & 0x0180)
|
---|
| 160 | vbank(0);
|
---|
| 161 |
|
---|
| 162 | vputc(obj8, 2, stccol, k + '0', SDW11DEA);
|
---|
| 163 | advscur();
|
---|
| 164 |
|
---|
| 165 | return(SUCCESS);
|
---|
| 166 | }
|
---|