| 1 | /*
 | 
|---|
| 2 |    =============================================================================
 | 
|---|
| 3 |         etdyn.c -- dynamics field handlers
 | 
|---|
| 4 |         Version 8 -- 1988-06-08 -- 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 | 
 | 
|---|
| 21 | extern  unsigned        *obj8;
 | 
|---|
| 22 | 
 | 
|---|
| 23 | extern  short   ctrsw, recsw, stccol;
 | 
|---|
| 24 | 
 | 
|---|
| 25 | extern  short   grpdyn[], grpmode[], grpstat[];
 | 
|---|
| 26 | 
 | 
|---|
| 27 | extern  struct  gdsel   *gdstbc[];
 | 
|---|
| 28 | 
 | 
|---|
| 29 | /*
 | 
|---|
| 30 |    =============================================================================
 | 
|---|
| 31 |         et_dyn() -- load edit buffer
 | 
|---|
| 32 |    =============================================================================
 | 
|---|
| 33 | */
 | 
|---|
| 34 | 
 | 
|---|
| 35 | short et_dyn(short n)
 | 
|---|
| 36 | {
 | 
|---|
| 37 |         ebuf[0] =grpdyn[n] + '0';
 | 
|---|
| 38 |         ebuf[1] = '\0';
 | 
|---|
| 39 |         ebflag = TRUE;
 | 
|---|
| 40 |         return(SUCCESS);
 | 
|---|
| 41 | }
 | 
|---|
| 42 | 
 | 
|---|
| 43 | /*  | 
|---|
| 44 | 
 | 
|---|
| 45 | */
 | 
|---|
| 46 | 
 | 
|---|
| 47 | /*
 | 
|---|
| 48 |    =============================================================================
 | 
|---|
| 49 |         ef_dyn() -- parse edit buffer
 | 
|---|
| 50 |    =============================================================================
 | 
|---|
| 51 | */
 | 
|---|
| 52 | 
 | 
|---|
| 53 | short ef_dyn(short n)
 | 
|---|
| 54 | {
 | 
|---|
| 55 |         register short ival;
 | 
|---|
| 56 |         register struct s_entry *ep;
 | 
|---|
| 57 | 
 | 
|---|
| 58 |         ebuf[1] = '\0';
 | 
|---|
| 59 |         ival = ebuf[0] - '0';
 | 
|---|
| 60 |         ebflag = FALSE;
 | 
|---|
| 61 | 
 | 
|---|
| 62 |         setdyn(n, ival);
 | 
|---|
| 63 | 
 | 
|---|
| 64 |         if (recsw AND grpmode[n] AND (2 EQ grpmode[n])) {
 | 
|---|
| 65 | 
 | 
|---|
| 66 |                 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_DYN, n, -1))) {
 | 
|---|
| 67 | 
 | 
|---|
| 68 |                         ep->e_data2 = ival;
 | 
|---|
| 69 | 
 | 
|---|
| 70 |                 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
 | 
|---|
| 71 | 
 | 
|---|
| 72 |                         ep->e_type  = EV_DYN;
 | 
|---|
| 73 |                         ep->e_data1 = n;
 | 
|---|
| 74 |                         ep->e_data2 = ival;
 | 
|---|
| 75 |                         ep->e_time  = t_cur;
 | 
|---|
| 76 |                         p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 | 
|---|
| 77 |                         eh_ins(ep, EH_DYN);
 | 
|---|
| 78 |                         ctrsw = TRUE;
 | 
|---|
| 79 |                         se_disp(ep, D_FWD, gdstbc, 1);
 | 
|---|
| 80 |                         scupd();
 | 
|---|
| 81 |                 }
 | 
|---|
| 82 |         }
 | 
|---|
| 83 | 
 | 
|---|
| 84 |         return(SUCCESS);
 | 
|---|
| 85 | }
 | 
|---|
| 86 | 
 | 
|---|
| 87 | /*  | 
|---|
| 88 | 
 | 
|---|
| 89 | */
 | 
|---|
| 90 | 
 | 
|---|
| 91 | /*
 | 
|---|
| 92 |    =============================================================================
 | 
|---|
| 93 |         rd_dyn() -- (re)display the field
 | 
|---|
| 94 |    =============================================================================
 | 
|---|
| 95 | */
 | 
|---|
| 96 | 
 | 
|---|
| 97 | short rd_dyn(short n)
 | 
|---|
| 98 | {
 | 
|---|
| 99 |         if (v_regs[5] & 0x0180)
 | 
|---|
| 100 |                 vbank(0);
 | 
|---|
| 101 | 
 | 
|---|
| 102 |         vputc(obj8, 4, 6+(n*5), (grpdyn[n] + '0'), SDW11ATR);
 | 
|---|
| 103 | 
 | 
|---|
| 104 |         return(SUCCESS);
 | 
|---|
| 105 | }
 | 
|---|
| 106 | 
 | 
|---|
| 107 | /*
 | 
|---|
| 108 |    =============================================================================
 | 
|---|
| 109 |         ds_dyn() -- display all dynamics to group assignments
 | 
|---|
| 110 |    =============================================================================
 | 
|---|
| 111 | */
 | 
|---|
| 112 | 
 | 
|---|
| 113 | void ds_dyn(void)
 | 
|---|
| 114 | {
 | 
|---|
| 115 |         register short i;
 | 
|---|
| 116 | 
 | 
|---|
| 117 |         for (i = 0; i < 12; i++)
 | 
|---|
| 118 |                 rd_dyn(i);
 | 
|---|
| 119 | }
 | 
|---|
| 120 | 
 | 
|---|
| 121 | /*  | 
|---|
| 122 | 
 | 
|---|
| 123 | */
 | 
|---|
| 124 | 
 | 
|---|
| 125 | /*
 | 
|---|
| 126 |    =============================================================================
 | 
|---|
| 127 |         nd_dyn() -- data entry function
 | 
|---|
| 128 |    =============================================================================
 | 
|---|
| 129 | */
 | 
|---|
| 130 | 
 | 
|---|
| 131 | short nd_dyn(short n, short k)
 | 
|---|
| 132 | {
 | 
|---|
| 133 |         ebuf[0]  = k + '0';
 | 
|---|
| 134 | 
 | 
|---|
| 135 |         if (v_regs[5] & 0x0180)
 | 
|---|
| 136 |                 vbank(0);
 | 
|---|
| 137 | 
 | 
|---|
| 138 |         vputc(obj8, 4, stccol, k + '0', SDW11DEA);
 | 
|---|
| 139 |         advscur();
 | 
|---|
| 140 | 
 | 
|---|
| 141 |         return(SUCCESS);
 | 
|---|
| 142 | }
 | 
|---|