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