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