source: buchla-68k/ram/ucslice.c@ b28a12e

Last change on this file since b28a12e was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Zero redundant declarations.

  • Property mode set to 100644
File size: 4.3 KB
Line 
1/*
2 =============================================================================
3 ucslice.c -- update score display center slice
4 Version 7 -- 1988-09-28 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#undef DEBUGGER
9
10#include "ram.h"
11
12/*
13 =============================================================================
14 ucslice()
15
16 Updates the center slice.
17
18 Note transitions are based on the value of global variable 'sd',
19 which is zero for forward, and non-zero for backward scrolling.
20
21 Note colors come from 'gtctab[]'.
22
23 This code must be very fast or the display bogs down the system.
24 =============================================================================
25*/
26
27void ucslice(void)
28{
29 register uint16_t *pxptr, *slptr;
30 register struct gdsel *gdsep;
31 register int32_t lc;
32 register uint16_t i, ncolor, mask1, mask2;
33 uint16_t *ncptr, *nctabp;
34 struct gdsel **gdstp, *gdprv, *gdnxt;
35 int16_t *lintab;
36
37 DB_ENTR("ucslice()");
38
39 lc = 128L;
40 mask1 = nbmasks[soffset];
41 mask2 = ~mask1;
42
43 /* initialize note color, note control, and group control pointers */
44
45 gdstp = gdstbc; /* group control table */
46 nctabp = sd ? nttab2 : nttab1; /* note transition table */
47 ncptr = gtctab; /* group to color table */
48
49 lintab = (ac_code EQ N_SHARP) ? lintab1 : lintab2; /* line table */
50
51/*
52
53*/
54
55 for (i = 0; i < 12; i++) { /* scan the group control table ... */
56
57 ncolor = mask1 & *ncptr++; /* get note color mask */
58 gdprv = (struct gdsel *)gdstp; /* setup previous pointer */
59 gdsep = *gdstp++; /* setup current pointer */
60
61 if (gdsep) { /* ... process each active group ... */
62
63 do { /* ... for each note played by the group ... */
64
65 if (ndisp EQ 2) { /* ... if display is up */
66
67 /* setup slice and pixel pointers */
68
69 slptr = saddr + 64L +
70 ((int32_t)lintab[gdsep->note] << 7);
71
72 pxptr = &pxtbl[gdsep->code][0];
73
74 /* update the slice */
75
76 *slptr = (*slptr & mask2) | (*pxptr++ & ncolor);
77 slptr += lc;
78
79 *slptr = (*slptr & mask2) | (*pxptr++ & ncolor);
80 slptr += lc;
81
82 *slptr = (*slptr & mask2) | (*pxptr++ & ncolor);
83
84 }
85
86 gdnxt = gdsep->next; /* set 'next element' pointer */
87
88 /* update and check element code */
89
90 if (0 EQ (gdsep->code = nctabp[gdsep->code])) {
91
92 /* if it's zero, delete the element */
93
94 gdprv->next = gdnxt;
95 gdsep->next = gdfsep;
96 gdfsep = gdsep;
97
98 } else
99 gdprv = gdsep;
100
101 gdsep = gdnxt; /* set pointer for next pass */
102
103 } while (gdsep);
104 }
105 }
106
107/*
108
109*/
110 for (; i < NGDSEL; i++) {
111
112 gdprv = (struct gdsel *)gdstp; /* setup previous pointer */
113 gdsep = *gdstp++; /* setup current pointer */
114
115 if (gdsep) { /* ... process each active event priority ... */
116
117 do { /* ... for each event of this priority ... */
118
119 if (ndisp EQ 2) { /* ... if display is up */
120
121 /* setup slice and pixel pointers */
122
123 slptr = saddr + 27200L;
124 pxptr = &epxtbl[gdsep->code][0];
125
126 /* get event color */
127
128 ncolor = mask1 & gdsep->note;
129
130 /* update the slice */
131
132 if (*pxptr++) /* 212 */
133 *slptr = (*slptr & mask2) | ncolor;
134
135 slptr += lc;
136
137 if (*pxptr++) /* 213 */
138 *slptr = (*slptr & mask2) | ncolor;
139
140 slptr += lc;
141
142 if (*pxptr++) /* 214 */
143 *slptr = (*slptr & mask2) | ncolor;
144
145 slptr += lc;
146
147 if (*pxptr++) /* 215 */
148 *slptr = (*slptr & mask2) | ncolor;
149
150 slptr += lc;
151
152 if (*pxptr++) /* 216 */
153 *slptr = (*slptr & mask2) | ncolor;
154
155 slptr += lc;
156
157 if (*pxptr++) /* 217 */
158 *slptr = (*slptr & mask2) | ncolor;
159
160 slptr += lc;
161/*
162
163*/
164 if (*pxptr++) /* 218 */
165 *slptr = (*slptr & mask2) | ncolor;
166
167 slptr += lc;
168
169 if (*pxptr++) /* 219 */
170 *slptr = (*slptr & mask2) | ncolor;
171
172 slptr += lc;
173
174 if (*pxptr++) /* 220 */
175 *slptr = (*slptr & mask2) | ncolor;
176
177 slptr += lc;
178
179 if (*pxptr++) /* 221 */
180 *slptr = (*slptr & mask2) | ncolor;
181
182 slptr += lc;
183
184 if (*pxptr++) /* 222 */
185 *slptr = (*slptr & mask2) | ncolor;
186
187 slptr += lc;
188
189 if (*pxptr) /* 223 */
190 *slptr = (*slptr & mask2) | ncolor;
191 }
192
193 gdnxt = gdsep->next; /* set next pointer */
194 gdprv->next = gdnxt; /* delete the element */
195 gdsep->next = gdfsep;
196 gdfsep = gdsep;
197 gdsep = gdnxt; /* set pointer for next pass */
198
199 } while (gdsep);
200 }
201 }
202
203 DB_EXIT("ucslice");
204}
205
Note: See TracBrowser for help on using the repository browser.