1 |
2 |
lucas.vbal |
module Sprite_Processor(
|
2 |
|
|
R_in,
|
3 |
|
|
G_in,
|
4 |
|
|
B_in,
|
5 |
|
|
clk,
|
6 |
|
|
rst,
|
7 |
|
|
sprite_shape,
|
8 |
|
|
sprite_id,
|
9 |
|
|
sprite_x,
|
10 |
|
|
sprite_y,
|
11 |
|
|
sprite_color,
|
12 |
|
|
V_pos_in,
|
13 |
|
|
H_pos_in,
|
14 |
|
|
|
15 |
|
|
R_out,
|
16 |
|
|
G_out,
|
17 |
|
|
B_out
|
18 |
|
|
);
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
input clk;
|
22 |
|
|
input rst;
|
23 |
|
|
input [7:0] R_in;
|
24 |
|
|
input [7:0] G_in;
|
25 |
|
|
input [7:0] B_in;
|
26 |
|
|
input [9:0] H_pos_in;
|
27 |
|
|
input [9:0] V_pos_in;
|
28 |
|
|
|
29 |
|
|
input [383:0] sprite_id;
|
30 |
|
|
input [639:0] sprite_x;
|
31 |
|
|
input [639:0] sprite_y;
|
32 |
|
|
input [1023:0] sprite_color;
|
33 |
|
|
input [1023:0] sprite_shape;
|
34 |
|
|
|
35 |
|
|
output reg [7:0] R_out;
|
36 |
|
|
output reg [7:0] G_out;
|
37 |
|
|
output reg [7:0] B_out;
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
always @ (posedge clk)
|
42 |
|
|
begin
|
43 |
|
|
|
44 |
|
|
if (rst)
|
45 |
|
|
begin
|
46 |
|
|
|
47 |
|
|
end
|
48 |
|
|
|
49 |
|
|
else
|
50 |
|
|
begin
|
51 |
|
|
|
52 |
|
|
// SPRITE LEVEL 63 - START
|
53 |
|
|
if (
|
54 |
|
|
V_pos_in >= sprite_y[(63*10)+9 : 63*10] &&
|
55 |
|
|
V_pos_in <= sprite_y[(63*10)+9 : 63*10] + 15 &&
|
56 |
|
|
H_pos_in >= sprite_x[(63*10)+9 : 63*10] &&
|
57 |
|
|
H_pos_in <= sprite_x[(63*10)+9 : 63*10] + 15 &&
|
58 |
|
|
sprite_shape[ (63*16) + (H_pos_in - sprite_x[(63*10)+9 : 63*10]) ]
|
59 |
|
|
)
|
60 |
|
|
begin
|
61 |
|
|
R_out [2:0] <= 3'b000;
|
62 |
|
|
G_out [1:0] <= 2'b000;
|
63 |
|
|
B_out [2:0] <= 3'b000;
|
64 |
|
|
R_out [7:3] <= sprite_color[(63*16)+4 : (63*16)+0];
|
65 |
|
|
G_out [7:2] <= sprite_color[(63*16)+10 : (63*16)+5];
|
66 |
|
|
B_out [7:3] <= sprite_color[(63*16)+15 : (63*16)+11];
|
67 |
|
|
end
|
68 |
|
|
|
69 |
|
|
else
|
70 |
|
|
begin
|
71 |
|
|
|
72 |
|
|
// SPRITE LEVEL 62 - START
|
73 |
|
|
if (
|
74 |
|
|
V_pos_in >= sprite_y[(62*10)+9 : 62*10] &&
|
75 |
|
|
V_pos_in <= sprite_y[(62*10)+9 : 62*10] + 15 &&
|
76 |
|
|
H_pos_in >= sprite_x[(62*10)+9 : 62*10] &&
|
77 |
|
|
H_pos_in <= sprite_x[(62*10)+9 : 62*10] + 15 &&
|
78 |
|
|
sprite_shape[ (62*16) + (H_pos_in - sprite_x[(62*10)+9 : 62*10]) ]
|
79 |
|
|
)
|
80 |
|
|
begin
|
81 |
|
|
R_out [2:0] <= 3'b000;
|
82 |
|
|
G_out [1:0] <= 2'b000;
|
83 |
|
|
B_out [2:0] <= 3'b000;
|
84 |
|
|
R_out [7:3] <= sprite_color[(62*16)+4 : (62*16)+0];
|
85 |
|
|
G_out [7:2] <= sprite_color[(62*16)+10 : (62*16)+5];
|
86 |
|
|
B_out [7:3] <= sprite_color[(62*16)+15 : (62*16)+11];
|
87 |
|
|
end
|
88 |
|
|
|
89 |
|
|
else
|
90 |
|
|
begin
|
91 |
|
|
|
92 |
|
|
// SPRITE LEVEL 61 - START
|
93 |
|
|
if (
|
94 |
|
|
V_pos_in >= sprite_y[(61*10)+9 : 61*10] &&
|
95 |
|
|
V_pos_in <= sprite_y[(61*10)+9 : 61*10] + 15 &&
|
96 |
|
|
H_pos_in >= sprite_x[(61*10)+9 : 61*10] &&
|
97 |
|
|
H_pos_in <= sprite_x[(61*10)+9 : 61*10] + 15 &&
|
98 |
|
|
sprite_shape[ (61*16) + (H_pos_in - sprite_x[(61*10)+9 : 61*10]) ]
|
99 |
|
|
)
|
100 |
|
|
begin
|
101 |
|
|
R_out [2:0] <= 3'b000;
|
102 |
|
|
G_out [1:0] <= 2'b000;
|
103 |
|
|
B_out [2:0] <= 3'b000;
|
104 |
|
|
R_out [7:3] <= sprite_color[(61*16)+4 : (61*16)+0];
|
105 |
|
|
G_out [7:2] <= sprite_color[(61*16)+10 : (61*16)+5];
|
106 |
|
|
B_out [7:3] <= sprite_color[(61*16)+15 : (61*16)+11];
|
107 |
|
|
end
|
108 |
|
|
|
109 |
|
|
else
|
110 |
|
|
begin
|
111 |
|
|
|
112 |
|
|
// SPRITE LEVEL 60 - START
|
113 |
|
|
if (
|
114 |
|
|
V_pos_in >= sprite_y[(60*10)+9 : 60*10] &&
|
115 |
|
|
V_pos_in <= sprite_y[(60*10)+9 : 60*10] + 15 &&
|
116 |
|
|
H_pos_in >= sprite_x[(60*10)+9 : 60*10] &&
|
117 |
|
|
H_pos_in <= sprite_x[(60*10)+9 : 60*10] + 15 &&
|
118 |
|
|
sprite_shape[ (60*16) + (H_pos_in - sprite_x[(60*10)+9 : 60*10]) ]
|
119 |
|
|
)
|
120 |
|
|
begin
|
121 |
|
|
R_out [2:0] <= 3'b000;
|
122 |
|
|
G_out [1:0] <= 2'b000;
|
123 |
|
|
B_out [2:0] <= 3'b000;
|
124 |
|
|
R_out [7:3] <= sprite_color[(60*16)+4 : (60*16)+0];
|
125 |
|
|
G_out [7:2] <= sprite_color[(60*16)+10 : (60*16)+5];
|
126 |
|
|
B_out [7:3] <= sprite_color[(60*16)+15 : (60*16)+11];
|
127 |
|
|
end
|
128 |
|
|
|
129 |
|
|
else
|
130 |
|
|
begin
|
131 |
|
|
|
132 |
|
|
// SPRITE LEVEL 59 - START
|
133 |
|
|
if (
|
134 |
|
|
V_pos_in >= sprite_y[(59*10)+9 : 59*10] &&
|
135 |
|
|
V_pos_in <= sprite_y[(59*10)+9 : 59*10] + 15 &&
|
136 |
|
|
H_pos_in >= sprite_x[(59*10)+9 : 59*10] &&
|
137 |
|
|
H_pos_in <= sprite_x[(59*10)+9 : 59*10] + 15 &&
|
138 |
|
|
sprite_shape[ (59*16) + (H_pos_in - sprite_x[(59*10)+9 : 59*10]) ]
|
139 |
|
|
)
|
140 |
|
|
begin
|
141 |
|
|
R_out [2:0] <= 3'b000;
|
142 |
|
|
G_out [1:0] <= 2'b000;
|
143 |
|
|
B_out [2:0] <= 3'b000;
|
144 |
|
|
R_out [7:3] <= sprite_color[(59*16)+4 : (59*16)+0];
|
145 |
|
|
G_out [7:2] <= sprite_color[(59*16)+10 : (59*16)+5];
|
146 |
|
|
B_out [7:3] <= sprite_color[(59*16)+15 : (59*16)+11];
|
147 |
|
|
end
|
148 |
|
|
|
149 |
|
|
else
|
150 |
|
|
begin
|
151 |
|
|
|
152 |
|
|
// SPRITE LEVEL 58 - START
|
153 |
|
|
if (
|
154 |
|
|
V_pos_in >= sprite_y[(58*10)+9 : 58*10] &&
|
155 |
|
|
V_pos_in <= sprite_y[(58*10)+9 : 58*10] + 15 &&
|
156 |
|
|
H_pos_in >= sprite_x[(58*10)+9 : 58*10] &&
|
157 |
|
|
H_pos_in <= sprite_x[(58*10)+9 : 58*10] + 15 &&
|
158 |
|
|
sprite_shape[ (58*16) + (H_pos_in - sprite_x[(58*10)+9 : 58*10]) ]
|
159 |
|
|
)
|
160 |
|
|
begin
|
161 |
|
|
R_out [2:0] <= 3'b000;
|
162 |
|
|
G_out [1:0] <= 2'b000;
|
163 |
|
|
B_out [2:0] <= 3'b000;
|
164 |
|
|
R_out [7:3] <= sprite_color[(58*16)+4 : (58*16)+0];
|
165 |
|
|
G_out [7:2] <= sprite_color[(58*16)+10 : (58*16)+5];
|
166 |
|
|
B_out [7:3] <= sprite_color[(58*16)+15 : (58*16)+11];
|
167 |
|
|
end
|
168 |
|
|
|
169 |
|
|
else
|
170 |
|
|
begin
|
171 |
|
|
|
172 |
|
|
// SPRITE LEVEL 57 - START
|
173 |
|
|
if (
|
174 |
|
|
V_pos_in >= sprite_y[(57*10)+9 : 57*10] &&
|
175 |
|
|
V_pos_in <= sprite_y[(57*10)+9 : 57*10] + 15 &&
|
176 |
|
|
H_pos_in >= sprite_x[(57*10)+9 : 57*10] &&
|
177 |
|
|
H_pos_in <= sprite_x[(57*10)+9 : 57*10] + 15 &&
|
178 |
|
|
sprite_shape[ (57*16) + (H_pos_in - sprite_x[(57*10)+9 : 57*10]) ]
|
179 |
|
|
)
|
180 |
|
|
begin
|
181 |
|
|
R_out [2:0] <= 3'b000;
|
182 |
|
|
G_out [1:0] <= 2'b000;
|
183 |
|
|
B_out [2:0] <= 3'b000;
|
184 |
|
|
R_out [7:3] <= sprite_color[(57*16)+4 : (57*16)+0];
|
185 |
|
|
G_out [7:2] <= sprite_color[(57*16)+10 : (57*16)+5];
|
186 |
|
|
B_out [7:3] <= sprite_color[(57*16)+15 : (57*16)+11];
|
187 |
|
|
end
|
188 |
|
|
|
189 |
|
|
else
|
190 |
|
|
begin
|
191 |
|
|
|
192 |
|
|
// SPRITE LEVEL 56 - START
|
193 |
|
|
if (
|
194 |
|
|
V_pos_in >= sprite_y[(56*10)+9 : 56*10] &&
|
195 |
|
|
V_pos_in <= sprite_y[(56*10)+9 : 56*10] + 15 &&
|
196 |
|
|
H_pos_in >= sprite_x[(56*10)+9 : 56*10] &&
|
197 |
|
|
H_pos_in <= sprite_x[(56*10)+9 : 56*10] + 15 &&
|
198 |
|
|
sprite_shape[ (56*16) + (H_pos_in - sprite_x[(56*10)+9 : 56*10]) ]
|
199 |
|
|
)
|
200 |
|
|
begin
|
201 |
|
|
R_out [2:0] <= 3'b000;
|
202 |
|
|
G_out [1:0] <= 2'b000;
|
203 |
|
|
B_out [2:0] <= 3'b000;
|
204 |
|
|
R_out [7:3] <= sprite_color[(56*16)+4 : (56*16)+0];
|
205 |
|
|
G_out [7:2] <= sprite_color[(56*16)+10 : (56*16)+5];
|
206 |
|
|
B_out [7:3] <= sprite_color[(56*16)+15 : (56*16)+11];
|
207 |
|
|
end
|
208 |
|
|
|
209 |
|
|
else
|
210 |
|
|
begin
|
211 |
|
|
|
212 |
|
|
// SPRITE LEVEL 55 - START
|
213 |
|
|
if (
|
214 |
|
|
V_pos_in >= sprite_y[(55*10)+9 : 55*10] &&
|
215 |
|
|
V_pos_in <= sprite_y[(55*10)+9 : 55*10] + 15 &&
|
216 |
|
|
H_pos_in >= sprite_x[(55*10)+9 : 55*10] &&
|
217 |
|
|
H_pos_in <= sprite_x[(55*10)+9 : 55*10] + 15 &&
|
218 |
|
|
sprite_shape[ (55*16) + (H_pos_in - sprite_x[(55*10)+9 : 55*10]) ]
|
219 |
|
|
)
|
220 |
|
|
begin
|
221 |
|
|
R_out [2:0] <= 3'b000;
|
222 |
|
|
G_out [1:0] <= 2'b000;
|
223 |
|
|
B_out [2:0] <= 3'b000;
|
224 |
|
|
R_out [7:3] <= sprite_color[(55*16)+4 : (55*16)+0];
|
225 |
|
|
G_out [7:2] <= sprite_color[(55*16)+10 : (55*16)+5];
|
226 |
|
|
B_out [7:3] <= sprite_color[(55*16)+15 : (55*16)+11];
|
227 |
|
|
end
|
228 |
|
|
|
229 |
|
|
else
|
230 |
|
|
begin
|
231 |
|
|
|
232 |
|
|
// SPRITE LEVEL 54 - START
|
233 |
|
|
if (
|
234 |
|
|
V_pos_in >= sprite_y[(54*10)+9 : 54*10] &&
|
235 |
|
|
V_pos_in <= sprite_y[(54*10)+9 : 54*10] + 15 &&
|
236 |
|
|
H_pos_in >= sprite_x[(54*10)+9 : 54*10] &&
|
237 |
|
|
H_pos_in <= sprite_x[(54*10)+9 : 54*10] + 15 &&
|
238 |
|
|
sprite_shape[ (54*16) + (H_pos_in - sprite_x[(54*10)+9 : 54*10]) ]
|
239 |
|
|
)
|
240 |
|
|
begin
|
241 |
|
|
R_out [2:0] <= 3'b000;
|
242 |
|
|
G_out [1:0] <= 2'b000;
|
243 |
|
|
B_out [2:0] <= 3'b000;
|
244 |
|
|
R_out [7:3] <= sprite_color[(54*16)+4 : (54*16)+0];
|
245 |
|
|
G_out [7:2] <= sprite_color[(54*16)+10 : (54*16)+5];
|
246 |
|
|
B_out [7:3] <= sprite_color[(54*16)+15 : (54*16)+11];
|
247 |
|
|
end
|
248 |
|
|
|
249 |
|
|
else
|
250 |
|
|
begin
|
251 |
|
|
|
252 |
|
|
// SPRITE LEVEL 53 - START
|
253 |
|
|
if (
|
254 |
|
|
V_pos_in >= sprite_y[(53*10)+9 : 53*10] &&
|
255 |
|
|
V_pos_in <= sprite_y[(53*10)+9 : 53*10] + 15 &&
|
256 |
|
|
H_pos_in >= sprite_x[(53*10)+9 : 53*10] &&
|
257 |
|
|
H_pos_in <= sprite_x[(53*10)+9 : 53*10] + 15 &&
|
258 |
|
|
sprite_shape[ (53*16) + (H_pos_in - sprite_x[(53*10)+9 : 53*10]) ]
|
259 |
|
|
)
|
260 |
|
|
begin
|
261 |
|
|
R_out [2:0] <= 3'b000;
|
262 |
|
|
G_out [1:0] <= 2'b000;
|
263 |
|
|
B_out [2:0] <= 3'b000;
|
264 |
|
|
R_out [7:3] <= sprite_color[(53*16)+4 : (53*16)+0];
|
265 |
|
|
G_out [7:2] <= sprite_color[(53*16)+10 : (53*16)+5];
|
266 |
|
|
B_out [7:3] <= sprite_color[(53*16)+15 : (53*16)+11];
|
267 |
|
|
end
|
268 |
|
|
|
269 |
|
|
else
|
270 |
|
|
begin
|
271 |
|
|
|
272 |
|
|
// SPRITE LEVEL 52 - START
|
273 |
|
|
if (
|
274 |
|
|
V_pos_in >= sprite_y[(52*10)+9 : 52*10] &&
|
275 |
|
|
V_pos_in <= sprite_y[(52*10)+9 : 52*10] + 15 &&
|
276 |
|
|
H_pos_in >= sprite_x[(52*10)+9 : 52*10] &&
|
277 |
|
|
H_pos_in <= sprite_x[(52*10)+9 : 52*10] + 15 &&
|
278 |
|
|
sprite_shape[ (52*16) + (H_pos_in - sprite_x[(52*10)+9 : 52*10]) ]
|
279 |
|
|
)
|
280 |
|
|
begin
|
281 |
|
|
R_out [2:0] <= 3'b000;
|
282 |
|
|
G_out [1:0] <= 2'b000;
|
283 |
|
|
B_out [2:0] <= 3'b000;
|
284 |
|
|
R_out [7:3] <= sprite_color[(52*16)+4 : (52*16)+0];
|
285 |
|
|
G_out [7:2] <= sprite_color[(52*16)+10 : (52*16)+5];
|
286 |
|
|
B_out [7:3] <= sprite_color[(52*16)+15 : (52*16)+11];
|
287 |
|
|
end
|
288 |
|
|
|
289 |
|
|
else
|
290 |
|
|
begin
|
291 |
|
|
|
292 |
|
|
// SPRITE LEVEL 51 - START
|
293 |
|
|
if (
|
294 |
|
|
V_pos_in >= sprite_y[(51*10)+9 : 51*10] &&
|
295 |
|
|
V_pos_in <= sprite_y[(51*10)+9 : 51*10] + 15 &&
|
296 |
|
|
H_pos_in >= sprite_x[(51*10)+9 : 51*10] &&
|
297 |
|
|
H_pos_in <= sprite_x[(51*10)+9 : 51*10] + 15 &&
|
298 |
|
|
sprite_shape[ (51*16) + (H_pos_in - sprite_x[(51*10)+9 : 51*10]) ]
|
299 |
|
|
)
|
300 |
|
|
begin
|
301 |
|
|
R_out [2:0] <= 3'b000;
|
302 |
|
|
G_out [1:0] <= 2'b000;
|
303 |
|
|
B_out [2:0] <= 3'b000;
|
304 |
|
|
R_out [7:3] <= sprite_color[(51*16)+4 : (51*16)+0];
|
305 |
|
|
G_out [7:2] <= sprite_color[(51*16)+10 : (51*16)+5];
|
306 |
|
|
B_out [7:3] <= sprite_color[(51*16)+15 : (51*16)+11];
|
307 |
|
|
end
|
308 |
|
|
|
309 |
|
|
else
|
310 |
|
|
begin
|
311 |
|
|
|
312 |
|
|
// SPRITE LEVEL 50 - START
|
313 |
|
|
if (
|
314 |
|
|
V_pos_in >= sprite_y[(50*10)+9 : 50*10] &&
|
315 |
|
|
V_pos_in <= sprite_y[(50*10)+9 : 50*10] + 15 &&
|
316 |
|
|
H_pos_in >= sprite_x[(50*10)+9 : 50*10] &&
|
317 |
|
|
H_pos_in <= sprite_x[(50*10)+9 : 50*10] + 15 &&
|
318 |
|
|
sprite_shape[ (50*16) + (H_pos_in - sprite_x[(50*10)+9 : 50*10]) ]
|
319 |
|
|
)
|
320 |
|
|
begin
|
321 |
|
|
R_out [2:0] <= 3'b000;
|
322 |
|
|
G_out [1:0] <= 2'b000;
|
323 |
|
|
B_out [2:0] <= 3'b000;
|
324 |
|
|
R_out [7:3] <= sprite_color[(50*16)+4 : (50*16)+0];
|
325 |
|
|
G_out [7:2] <= sprite_color[(50*16)+10 : (50*16)+5];
|
326 |
|
|
B_out [7:3] <= sprite_color[(50*16)+15 : (50*16)+11];
|
327 |
|
|
end
|
328 |
|
|
|
329 |
|
|
else
|
330 |
|
|
begin
|
331 |
|
|
|
332 |
|
|
// SPRITE LEVEL 49 - START
|
333 |
|
|
if (
|
334 |
|
|
V_pos_in >= sprite_y[(49*10)+9 : 49*10] &&
|
335 |
|
|
V_pos_in <= sprite_y[(49*10)+9 : 49*10] + 15 &&
|
336 |
|
|
H_pos_in >= sprite_x[(49*10)+9 : 49*10] &&
|
337 |
|
|
H_pos_in <= sprite_x[(49*10)+9 : 49*10] + 15 &&
|
338 |
|
|
sprite_shape[ (49*16) + (H_pos_in - sprite_x[(49*10)+9 : 49*10]) ]
|
339 |
|
|
)
|
340 |
|
|
begin
|
341 |
|
|
R_out [2:0] <= 3'b000;
|
342 |
|
|
G_out [1:0] <= 2'b000;
|
343 |
|
|
B_out [2:0] <= 3'b000;
|
344 |
|
|
R_out [7:3] <= sprite_color[(49*16)+4 : (49*16)+0];
|
345 |
|
|
G_out [7:2] <= sprite_color[(49*16)+10 : (49*16)+5];
|
346 |
|
|
B_out [7:3] <= sprite_color[(49*16)+15 : (49*16)+11];
|
347 |
|
|
end
|
348 |
|
|
|
349 |
|
|
else
|
350 |
|
|
begin
|
351 |
|
|
|
352 |
|
|
// SPRITE LEVEL 48 - START
|
353 |
|
|
if (
|
354 |
|
|
V_pos_in >= sprite_y[(48*10)+9 : 48*10] &&
|
355 |
|
|
V_pos_in <= sprite_y[(48*10)+9 : 48*10] + 15 &&
|
356 |
|
|
H_pos_in >= sprite_x[(48*10)+9 : 48*10] &&
|
357 |
|
|
H_pos_in <= sprite_x[(48*10)+9 : 48*10] + 15 &&
|
358 |
|
|
sprite_shape[ (48*16) + (H_pos_in - sprite_x[(48*10)+9 : 48*10]) ]
|
359 |
|
|
)
|
360 |
|
|
begin
|
361 |
|
|
R_out [2:0] <= 3'b000;
|
362 |
|
|
G_out [1:0] <= 2'b000;
|
363 |
|
|
B_out [2:0] <= 3'b000;
|
364 |
|
|
R_out [7:3] <= sprite_color[(48*16)+4 : (48*16)+0];
|
365 |
|
|
G_out [7:2] <= sprite_color[(48*16)+10 : (48*16)+5];
|
366 |
|
|
B_out [7:3] <= sprite_color[(48*16)+15 : (48*16)+11];
|
367 |
|
|
end
|
368 |
|
|
|
369 |
|
|
else
|
370 |
|
|
begin
|
371 |
|
|
|
372 |
|
|
// SPRITE LEVEL 47 - START
|
373 |
|
|
if (
|
374 |
|
|
V_pos_in >= sprite_y[(47*10)+9 : 47*10] &&
|
375 |
|
|
V_pos_in <= sprite_y[(47*10)+9 : 47*10] + 15 &&
|
376 |
|
|
H_pos_in >= sprite_x[(47*10)+9 : 47*10] &&
|
377 |
|
|
H_pos_in <= sprite_x[(47*10)+9 : 47*10] + 15 &&
|
378 |
|
|
sprite_shape[ (47*16) + (H_pos_in - sprite_x[(47*10)+9 : 47*10]) ]
|
379 |
|
|
)
|
380 |
|
|
begin
|
381 |
|
|
R_out [2:0] <= 3'b000;
|
382 |
|
|
G_out [1:0] <= 2'b000;
|
383 |
|
|
B_out [2:0] <= 3'b000;
|
384 |
|
|
R_out [7:3] <= sprite_color[(47*16)+4 : (47*16)+0];
|
385 |
|
|
G_out [7:2] <= sprite_color[(47*16)+10 : (47*16)+5];
|
386 |
|
|
B_out [7:3] <= sprite_color[(47*16)+15 : (47*16)+11];
|
387 |
|
|
end
|
388 |
|
|
|
389 |
|
|
else
|
390 |
|
|
begin
|
391 |
|
|
|
392 |
|
|
// SPRITE LEVEL 46 - START
|
393 |
|
|
if (
|
394 |
|
|
V_pos_in >= sprite_y[(46*10)+9 : 46*10] &&
|
395 |
|
|
V_pos_in <= sprite_y[(46*10)+9 : 46*10] + 15 &&
|
396 |
|
|
H_pos_in >= sprite_x[(46*10)+9 : 46*10] &&
|
397 |
|
|
H_pos_in <= sprite_x[(46*10)+9 : 46*10] + 15 &&
|
398 |
|
|
sprite_shape[ (46*16) + (H_pos_in - sprite_x[(46*10)+9 : 46*10]) ]
|
399 |
|
|
)
|
400 |
|
|
begin
|
401 |
|
|
R_out [2:0] <= 3'b000;
|
402 |
|
|
G_out [1:0] <= 2'b000;
|
403 |
|
|
B_out [2:0] <= 3'b000;
|
404 |
|
|
R_out [7:3] <= sprite_color[(46*16)+4 : (46*16)+0];
|
405 |
|
|
G_out [7:2] <= sprite_color[(46*16)+10 : (46*16)+5];
|
406 |
|
|
B_out [7:3] <= sprite_color[(46*16)+15 : (46*16)+11];
|
407 |
|
|
end
|
408 |
|
|
|
409 |
|
|
else
|
410 |
|
|
begin
|
411 |
|
|
|
412 |
|
|
// SPRITE LEVEL 45 - START
|
413 |
|
|
if (
|
414 |
|
|
V_pos_in >= sprite_y[(45*10)+9 : 45*10] &&
|
415 |
|
|
V_pos_in <= sprite_y[(45*10)+9 : 45*10] + 15 &&
|
416 |
|
|
H_pos_in >= sprite_x[(45*10)+9 : 45*10] &&
|
417 |
|
|
H_pos_in <= sprite_x[(45*10)+9 : 45*10] + 15 &&
|
418 |
|
|
sprite_shape[ (45*16) + (H_pos_in - sprite_x[(45*10)+9 : 45*10]) ]
|
419 |
|
|
)
|
420 |
|
|
begin
|
421 |
|
|
R_out [2:0] <= 3'b000;
|
422 |
|
|
G_out [1:0] <= 2'b000;
|
423 |
|
|
B_out [2:0] <= 3'b000;
|
424 |
|
|
R_out [7:3] <= sprite_color[(45*16)+4 : (45*16)+0];
|
425 |
|
|
G_out [7:2] <= sprite_color[(45*16)+10 : (45*16)+5];
|
426 |
|
|
B_out [7:3] <= sprite_color[(45*16)+15 : (45*16)+11];
|
427 |
|
|
end
|
428 |
|
|
|
429 |
|
|
else
|
430 |
|
|
begin
|
431 |
|
|
|
432 |
|
|
// SPRITE LEVEL 44 - START
|
433 |
|
|
if (
|
434 |
|
|
V_pos_in >= sprite_y[(44*10)+9 : 44*10] &&
|
435 |
|
|
V_pos_in <= sprite_y[(44*10)+9 : 44*10] + 15 &&
|
436 |
|
|
H_pos_in >= sprite_x[(44*10)+9 : 44*10] &&
|
437 |
|
|
H_pos_in <= sprite_x[(44*10)+9 : 44*10] + 15 &&
|
438 |
|
|
sprite_shape[ (44*16) + (H_pos_in - sprite_x[(44*10)+9 : 44*10]) ]
|
439 |
|
|
)
|
440 |
|
|
begin
|
441 |
|
|
R_out [2:0] <= 3'b000;
|
442 |
|
|
G_out [1:0] <= 2'b000;
|
443 |
|
|
B_out [2:0] <= 3'b000;
|
444 |
|
|
R_out [7:3] <= sprite_color[(44*16)+4 : (44*16)+0];
|
445 |
|
|
G_out [7:2] <= sprite_color[(44*16)+10 : (44*16)+5];
|
446 |
|
|
B_out [7:3] <= sprite_color[(44*16)+15 : (44*16)+11];
|
447 |
|
|
end
|
448 |
|
|
|
449 |
|
|
else
|
450 |
|
|
begin
|
451 |
|
|
|
452 |
|
|
// SPRITE LEVEL 43 - START
|
453 |
|
|
if (
|
454 |
|
|
V_pos_in >= sprite_y[(43*10)+9 : 43*10] &&
|
455 |
|
|
V_pos_in <= sprite_y[(43*10)+9 : 43*10] + 15 &&
|
456 |
|
|
H_pos_in >= sprite_x[(43*10)+9 : 43*10] &&
|
457 |
|
|
H_pos_in <= sprite_x[(43*10)+9 : 43*10] + 15 &&
|
458 |
|
|
sprite_shape[ (43*16) + (H_pos_in - sprite_x[(43*10)+9 : 43*10]) ]
|
459 |
|
|
)
|
460 |
|
|
begin
|
461 |
|
|
R_out [2:0] <= 3'b000;
|
462 |
|
|
G_out [1:0] <= 2'b000;
|
463 |
|
|
B_out [2:0] <= 3'b000;
|
464 |
|
|
R_out [7:3] <= sprite_color[(43*16)+4 : (43*16)+0];
|
465 |
|
|
G_out [7:2] <= sprite_color[(43*16)+10 : (43*16)+5];
|
466 |
|
|
B_out [7:3] <= sprite_color[(43*16)+15 : (43*16)+11];
|
467 |
|
|
end
|
468 |
|
|
|
469 |
|
|
else
|
470 |
|
|
begin
|
471 |
|
|
|
472 |
|
|
// SPRITE LEVEL 42 - START
|
473 |
|
|
if (
|
474 |
|
|
V_pos_in >= sprite_y[(42*10)+9 : 42*10] &&
|
475 |
|
|
V_pos_in <= sprite_y[(42*10)+9 : 42*10] + 15 &&
|
476 |
|
|
H_pos_in >= sprite_x[(42*10)+9 : 42*10] &&
|
477 |
|
|
H_pos_in <= sprite_x[(42*10)+9 : 42*10] + 15 &&
|
478 |
|
|
sprite_shape[ (42*16) + (H_pos_in - sprite_x[(42*10)+9 : 42*10]) ]
|
479 |
|
|
)
|
480 |
|
|
begin
|
481 |
|
|
R_out [2:0] <= 3'b000;
|
482 |
|
|
G_out [1:0] <= 2'b000;
|
483 |
|
|
B_out [2:0] <= 3'b000;
|
484 |
|
|
R_out [7:3] <= sprite_color[(42*16)+4 : (42*16)+0];
|
485 |
|
|
G_out [7:2] <= sprite_color[(42*16)+10 : (42*16)+5];
|
486 |
|
|
B_out [7:3] <= sprite_color[(42*16)+15 : (42*16)+11];
|
487 |
|
|
end
|
488 |
|
|
|
489 |
|
|
else
|
490 |
|
|
begin
|
491 |
|
|
|
492 |
|
|
// SPRITE LEVEL 41 - START
|
493 |
|
|
if (
|
494 |
|
|
V_pos_in >= sprite_y[(41*10)+9 : 41*10] &&
|
495 |
|
|
V_pos_in <= sprite_y[(41*10)+9 : 41*10] + 15 &&
|
496 |
|
|
H_pos_in >= sprite_x[(41*10)+9 : 41*10] &&
|
497 |
|
|
H_pos_in <= sprite_x[(41*10)+9 : 41*10] + 15 &&
|
498 |
|
|
sprite_shape[ (41*16) + (H_pos_in - sprite_x[(41*10)+9 : 41*10]) ]
|
499 |
|
|
)
|
500 |
|
|
begin
|
501 |
|
|
R_out [2:0] <= 3'b000;
|
502 |
|
|
G_out [1:0] <= 2'b000;
|
503 |
|
|
B_out [2:0] <= 3'b000;
|
504 |
|
|
R_out [7:3] <= sprite_color[(41*16)+4 : (41*16)+0];
|
505 |
|
|
G_out [7:2] <= sprite_color[(41*16)+10 : (41*16)+5];
|
506 |
|
|
B_out [7:3] <= sprite_color[(41*16)+15 : (41*16)+11];
|
507 |
|
|
end
|
508 |
|
|
|
509 |
|
|
else
|
510 |
|
|
begin
|
511 |
|
|
|
512 |
|
|
// SPRITE LEVEL 40 - START
|
513 |
|
|
if (
|
514 |
|
|
V_pos_in >= sprite_y[(40*10)+9 : 40*10] &&
|
515 |
|
|
V_pos_in <= sprite_y[(40*10)+9 : 40*10] + 15 &&
|
516 |
|
|
H_pos_in >= sprite_x[(40*10)+9 : 40*10] &&
|
517 |
|
|
H_pos_in <= sprite_x[(40*10)+9 : 40*10] + 15 &&
|
518 |
|
|
sprite_shape[ (40*16) + (H_pos_in - sprite_x[(40*10)+9 : 40*10]) ]
|
519 |
|
|
)
|
520 |
|
|
begin
|
521 |
|
|
R_out [2:0] <= 3'b000;
|
522 |
|
|
G_out [1:0] <= 2'b000;
|
523 |
|
|
B_out [2:0] <= 3'b000;
|
524 |
|
|
R_out [7:3] <= sprite_color[(40*16)+4 : (40*16)+0];
|
525 |
|
|
G_out [7:2] <= sprite_color[(40*16)+10 : (40*16)+5];
|
526 |
|
|
B_out [7:3] <= sprite_color[(40*16)+15 : (40*16)+11];
|
527 |
|
|
end
|
528 |
|
|
|
529 |
|
|
else
|
530 |
|
|
begin
|
531 |
|
|
|
532 |
|
|
// SPRITE LEVEL 39 - START
|
533 |
|
|
if (
|
534 |
|
|
V_pos_in >= sprite_y[(39*10)+9 : 39*10] &&
|
535 |
|
|
V_pos_in <= sprite_y[(39*10)+9 : 39*10] + 15 &&
|
536 |
|
|
H_pos_in >= sprite_x[(39*10)+9 : 39*10] &&
|
537 |
|
|
H_pos_in <= sprite_x[(39*10)+9 : 39*10] + 15 &&
|
538 |
|
|
sprite_shape[ (39*16) + (H_pos_in - sprite_x[(39*10)+9 : 39*10]) ]
|
539 |
|
|
)
|
540 |
|
|
begin
|
541 |
|
|
R_out [2:0] <= 3'b000;
|
542 |
|
|
G_out [1:0] <= 2'b000;
|
543 |
|
|
B_out [2:0] <= 3'b000;
|
544 |
|
|
R_out [7:3] <= sprite_color[(39*16)+4 : (39*16)+0];
|
545 |
|
|
G_out [7:2] <= sprite_color[(39*16)+10 : (39*16)+5];
|
546 |
|
|
B_out [7:3] <= sprite_color[(39*16)+15 : (39*16)+11];
|
547 |
|
|
end
|
548 |
|
|
|
549 |
|
|
else
|
550 |
|
|
begin
|
551 |
|
|
|
552 |
|
|
// SPRITE LEVEL 38 - START
|
553 |
|
|
if (
|
554 |
|
|
V_pos_in >= sprite_y[(38*10)+9 : 38*10] &&
|
555 |
|
|
V_pos_in <= sprite_y[(38*10)+9 : 38*10] + 15 &&
|
556 |
|
|
H_pos_in >= sprite_x[(38*10)+9 : 38*10] &&
|
557 |
|
|
H_pos_in <= sprite_x[(38*10)+9 : 38*10] + 15 &&
|
558 |
|
|
sprite_shape[ (38*16) + (H_pos_in - sprite_x[(38*10)+9 : 38*10]) ]
|
559 |
|
|
)
|
560 |
|
|
begin
|
561 |
|
|
R_out [2:0] <= 3'b000;
|
562 |
|
|
G_out [1:0] <= 2'b000;
|
563 |
|
|
B_out [2:0] <= 3'b000;
|
564 |
|
|
R_out [7:3] <= sprite_color[(38*16)+4 : (38*16)+0];
|
565 |
|
|
G_out [7:2] <= sprite_color[(38*16)+10 : (38*16)+5];
|
566 |
|
|
B_out [7:3] <= sprite_color[(38*16)+15 : (38*16)+11];
|
567 |
|
|
end
|
568 |
|
|
|
569 |
|
|
else
|
570 |
|
|
begin
|
571 |
|
|
|
572 |
|
|
// SPRITE LEVEL 37 - START
|
573 |
|
|
if (
|
574 |
|
|
V_pos_in >= sprite_y[(37*10)+9 : 37*10] &&
|
575 |
|
|
V_pos_in <= sprite_y[(37*10)+9 : 37*10] + 15 &&
|
576 |
|
|
H_pos_in >= sprite_x[(37*10)+9 : 37*10] &&
|
577 |
|
|
H_pos_in <= sprite_x[(37*10)+9 : 37*10] + 15 &&
|
578 |
|
|
sprite_shape[ (37*16) + (H_pos_in - sprite_x[(37*10)+9 : 37*10]) ]
|
579 |
|
|
)
|
580 |
|
|
begin
|
581 |
|
|
R_out [2:0] <= 3'b000;
|
582 |
|
|
G_out [1:0] <= 2'b000;
|
583 |
|
|
B_out [2:0] <= 3'b000;
|
584 |
|
|
R_out [7:3] <= sprite_color[(37*16)+4 : (37*16)+0];
|
585 |
|
|
G_out [7:2] <= sprite_color[(37*16)+10 : (37*16)+5];
|
586 |
|
|
B_out [7:3] <= sprite_color[(37*16)+15 : (37*16)+11];
|
587 |
|
|
end
|
588 |
|
|
|
589 |
|
|
else
|
590 |
|
|
begin
|
591 |
|
|
|
592 |
|
|
// SPRITE LEVEL 36 - START
|
593 |
|
|
if (
|
594 |
|
|
V_pos_in >= sprite_y[(36*10)+9 : 36*10] &&
|
595 |
|
|
V_pos_in <= sprite_y[(36*10)+9 : 36*10] + 15 &&
|
596 |
|
|
H_pos_in >= sprite_x[(36*10)+9 : 36*10] &&
|
597 |
|
|
H_pos_in <= sprite_x[(36*10)+9 : 36*10] + 15 &&
|
598 |
|
|
sprite_shape[ (36*16) + (H_pos_in - sprite_x[(36*10)+9 : 36*10]) ]
|
599 |
|
|
)
|
600 |
|
|
begin
|
601 |
|
|
R_out [2:0] <= 3'b000;
|
602 |
|
|
G_out [1:0] <= 2'b000;
|
603 |
|
|
B_out [2:0] <= 3'b000;
|
604 |
|
|
R_out [7:3] <= sprite_color[(36*16)+4 : (36*16)+0];
|
605 |
|
|
G_out [7:2] <= sprite_color[(36*16)+10 : (36*16)+5];
|
606 |
|
|
B_out [7:3] <= sprite_color[(36*16)+15 : (36*16)+11];
|
607 |
|
|
end
|
608 |
|
|
|
609 |
|
|
else
|
610 |
|
|
begin
|
611 |
|
|
|
612 |
|
|
// SPRITE LEVEL 35 - START
|
613 |
|
|
if (
|
614 |
|
|
V_pos_in >= sprite_y[(35*10)+9 : 35*10] &&
|
615 |
|
|
V_pos_in <= sprite_y[(35*10)+9 : 35*10] + 15 &&
|
616 |
|
|
H_pos_in >= sprite_x[(35*10)+9 : 35*10] &&
|
617 |
|
|
H_pos_in <= sprite_x[(35*10)+9 : 35*10] + 15 &&
|
618 |
|
|
sprite_shape[ (35*16) + (H_pos_in - sprite_x[(35*10)+9 : 35*10]) ]
|
619 |
|
|
)
|
620 |
|
|
begin
|
621 |
|
|
R_out [2:0] <= 3'b000;
|
622 |
|
|
G_out [1:0] <= 2'b000;
|
623 |
|
|
B_out [2:0] <= 3'b000;
|
624 |
|
|
R_out [7:3] <= sprite_color[(35*16)+4 : (35*16)+0];
|
625 |
|
|
G_out [7:2] <= sprite_color[(35*16)+10 : (35*16)+5];
|
626 |
|
|
B_out [7:3] <= sprite_color[(35*16)+15 : (35*16)+11];
|
627 |
|
|
end
|
628 |
|
|
|
629 |
|
|
else
|
630 |
|
|
begin
|
631 |
|
|
|
632 |
|
|
// SPRITE LEVEL 34 - START
|
633 |
|
|
if (
|
634 |
|
|
V_pos_in >= sprite_y[(34*10)+9 : 34*10] &&
|
635 |
|
|
V_pos_in <= sprite_y[(34*10)+9 : 34*10] + 15 &&
|
636 |
|
|
H_pos_in >= sprite_x[(34*10)+9 : 34*10] &&
|
637 |
|
|
H_pos_in <= sprite_x[(34*10)+9 : 34*10] + 15 &&
|
638 |
|
|
sprite_shape[ (34*16) + (H_pos_in - sprite_x[(34*10)+9 : 34*10]) ]
|
639 |
|
|
)
|
640 |
|
|
begin
|
641 |
|
|
R_out [2:0] <= 3'b000;
|
642 |
|
|
G_out [1:0] <= 2'b000;
|
643 |
|
|
B_out [2:0] <= 3'b000;
|
644 |
|
|
R_out [7:3] <= sprite_color[(34*16)+4 : (34*16)+0];
|
645 |
|
|
G_out [7:2] <= sprite_color[(34*16)+10 : (34*16)+5];
|
646 |
|
|
B_out [7:3] <= sprite_color[(34*16)+15 : (34*16)+11];
|
647 |
|
|
end
|
648 |
|
|
|
649 |
|
|
else
|
650 |
|
|
begin
|
651 |
|
|
|
652 |
|
|
// SPRITE LEVEL 33 - START
|
653 |
|
|
if (
|
654 |
|
|
V_pos_in >= sprite_y[(33*10)+9 : 33*10] &&
|
655 |
|
|
V_pos_in <= sprite_y[(33*10)+9 : 33*10] + 15 &&
|
656 |
|
|
H_pos_in >= sprite_x[(33*10)+9 : 33*10] &&
|
657 |
|
|
H_pos_in <= sprite_x[(33*10)+9 : 33*10] + 15 &&
|
658 |
|
|
sprite_shape[ (33*16) + (H_pos_in - sprite_x[(33*10)+9 : 33*10]) ]
|
659 |
|
|
)
|
660 |
|
|
begin
|
661 |
|
|
R_out [2:0] <= 3'b000;
|
662 |
|
|
G_out [1:0] <= 2'b000;
|
663 |
|
|
B_out [2:0] <= 3'b000;
|
664 |
|
|
R_out [7:3] <= sprite_color[(33*16)+4 : (33*16)+0];
|
665 |
|
|
G_out [7:2] <= sprite_color[(33*16)+10 : (33*16)+5];
|
666 |
|
|
B_out [7:3] <= sprite_color[(33*16)+15 : (33*16)+11];
|
667 |
|
|
end
|
668 |
|
|
|
669 |
|
|
else
|
670 |
|
|
begin
|
671 |
|
|
|
672 |
|
|
// SPRITE LEVEL 32 - START
|
673 |
|
|
if (
|
674 |
|
|
V_pos_in >= sprite_y[(32*10)+9 : 32*10] &&
|
675 |
|
|
V_pos_in <= sprite_y[(32*10)+9 : 32*10] + 15 &&
|
676 |
|
|
H_pos_in >= sprite_x[(32*10)+9 : 32*10] &&
|
677 |
|
|
H_pos_in <= sprite_x[(32*10)+9 : 32*10] + 15 &&
|
678 |
|
|
sprite_shape[ (32*16) + (H_pos_in - sprite_x[(32*10)+9 : 32*10]) ]
|
679 |
|
|
)
|
680 |
|
|
begin
|
681 |
|
|
R_out [2:0] <= 3'b000;
|
682 |
|
|
G_out [1:0] <= 2'b000;
|
683 |
|
|
B_out [2:0] <= 3'b000;
|
684 |
|
|
R_out [7:3] <= sprite_color[(32*16)+4 : (32*16)+0];
|
685 |
|
|
G_out [7:2] <= sprite_color[(32*16)+10 : (32*16)+5];
|
686 |
|
|
B_out [7:3] <= sprite_color[(32*16)+15 : (32*16)+11];
|
687 |
|
|
end
|
688 |
|
|
|
689 |
|
|
else
|
690 |
|
|
begin
|
691 |
|
|
|
692 |
|
|
// SPRITE LEVEL 31 - START
|
693 |
|
|
if (
|
694 |
|
|
V_pos_in >= sprite_y[(31*10)+9 : 31*10] &&
|
695 |
|
|
V_pos_in <= sprite_y[(31*10)+9 : 31*10] + 15 &&
|
696 |
|
|
H_pos_in >= sprite_x[(31*10)+9 : 31*10] &&
|
697 |
|
|
H_pos_in <= sprite_x[(31*10)+9 : 31*10] + 15 &&
|
698 |
|
|
sprite_shape[ (31*16) + (H_pos_in - sprite_x[(31*10)+9 : 31*10]) ]
|
699 |
|
|
)
|
700 |
|
|
begin
|
701 |
|
|
R_out [2:0] <= 3'b000;
|
702 |
|
|
G_out [1:0] <= 2'b000;
|
703 |
|
|
B_out [2:0] <= 3'b000;
|
704 |
|
|
R_out [7:3] <= sprite_color[(31*16)+4 : (31*16)+0];
|
705 |
|
|
G_out [7:2] <= sprite_color[(31*16)+10 : (31*16)+5];
|
706 |
|
|
B_out [7:3] <= sprite_color[(31*16)+15 : (31*16)+11];
|
707 |
|
|
end
|
708 |
|
|
|
709 |
|
|
else
|
710 |
|
|
begin
|
711 |
|
|
|
712 |
|
|
// SPRITE LEVEL 30 - START
|
713 |
|
|
if (
|
714 |
|
|
V_pos_in >= sprite_y[(30*10)+9 : 30*10] &&
|
715 |
|
|
V_pos_in <= sprite_y[(30*10)+9 : 30*10] + 15 &&
|
716 |
|
|
H_pos_in >= sprite_x[(30*10)+9 : 30*10] &&
|
717 |
|
|
H_pos_in <= sprite_x[(30*10)+9 : 30*10] + 15 &&
|
718 |
|
|
sprite_shape[ (30*16) + (H_pos_in - sprite_x[(30*10)+9 : 30*10]) ]
|
719 |
|
|
)
|
720 |
|
|
begin
|
721 |
|
|
R_out [2:0] <= 3'b000;
|
722 |
|
|
G_out [1:0] <= 2'b000;
|
723 |
|
|
B_out [2:0] <= 3'b000;
|
724 |
|
|
R_out [7:3] <= sprite_color[(30*16)+4 : (30*16)+0];
|
725 |
|
|
G_out [7:2] <= sprite_color[(30*16)+10 : (30*16)+5];
|
726 |
|
|
B_out [7:3] <= sprite_color[(30*16)+15 : (30*16)+11];
|
727 |
|
|
end
|
728 |
|
|
|
729 |
|
|
else
|
730 |
|
|
begin
|
731 |
|
|
|
732 |
|
|
// SPRITE LEVEL 29 - START
|
733 |
|
|
if (
|
734 |
|
|
V_pos_in >= sprite_y[(29*10)+9 : 29*10] &&
|
735 |
|
|
V_pos_in <= sprite_y[(29*10)+9 : 29*10] + 15 &&
|
736 |
|
|
H_pos_in >= sprite_x[(29*10)+9 : 29*10] &&
|
737 |
|
|
H_pos_in <= sprite_x[(29*10)+9 : 29*10] + 15 &&
|
738 |
|
|
sprite_shape[ (29*16) + (H_pos_in - sprite_x[(29*10)+9 : 29*10]) ]
|
739 |
|
|
)
|
740 |
|
|
begin
|
741 |
|
|
R_out [2:0] <= 3'b000;
|
742 |
|
|
G_out [1:0] <= 2'b000;
|
743 |
|
|
B_out [2:0] <= 3'b000;
|
744 |
|
|
R_out [7:3] <= sprite_color[(29*16)+4 : (29*16)+0];
|
745 |
|
|
G_out [7:2] <= sprite_color[(29*16)+10 : (29*16)+5];
|
746 |
|
|
B_out [7:3] <= sprite_color[(29*16)+15 : (29*16)+11];
|
747 |
|
|
end
|
748 |
|
|
|
749 |
|
|
else
|
750 |
|
|
begin
|
751 |
|
|
|
752 |
|
|
// SPRITE LEVEL 28 - START
|
753 |
|
|
if (
|
754 |
|
|
V_pos_in >= sprite_y[(28*10)+9 : 28*10] &&
|
755 |
|
|
V_pos_in <= sprite_y[(28*10)+9 : 28*10] + 15 &&
|
756 |
|
|
H_pos_in >= sprite_x[(28*10)+9 : 28*10] &&
|
757 |
|
|
H_pos_in <= sprite_x[(28*10)+9 : 28*10] + 15 &&
|
758 |
|
|
sprite_shape[ (28*16) + (H_pos_in - sprite_x[(28*10)+9 : 28*10]) ]
|
759 |
|
|
)
|
760 |
|
|
begin
|
761 |
|
|
R_out [2:0] <= 3'b000;
|
762 |
|
|
G_out [1:0] <= 2'b000;
|
763 |
|
|
B_out [2:0] <= 3'b000;
|
764 |
|
|
R_out [7:3] <= sprite_color[(28*16)+4 : (28*16)+0];
|
765 |
|
|
G_out [7:2] <= sprite_color[(28*16)+10 : (28*16)+5];
|
766 |
|
|
B_out [7:3] <= sprite_color[(28*16)+15 : (28*16)+11];
|
767 |
|
|
end
|
768 |
|
|
|
769 |
|
|
else
|
770 |
|
|
begin
|
771 |
|
|
|
772 |
|
|
// SPRITE LEVEL 27 - START
|
773 |
|
|
if (
|
774 |
|
|
V_pos_in >= sprite_y[(27*10)+9 : 27*10] &&
|
775 |
|
|
V_pos_in <= sprite_y[(27*10)+9 : 27*10] + 15 &&
|
776 |
|
|
H_pos_in >= sprite_x[(27*10)+9 : 27*10] &&
|
777 |
|
|
H_pos_in <= sprite_x[(27*10)+9 : 27*10] + 15 &&
|
778 |
|
|
sprite_shape[ (27*16) + (H_pos_in - sprite_x[(27*10)+9 : 27*10]) ]
|
779 |
|
|
)
|
780 |
|
|
begin
|
781 |
|
|
R_out [2:0] <= 3'b000;
|
782 |
|
|
G_out [1:0] <= 2'b000;
|
783 |
|
|
B_out [2:0] <= 3'b000;
|
784 |
|
|
R_out [7:3] <= sprite_color[(27*16)+4 : (27*16)+0];
|
785 |
|
|
G_out [7:2] <= sprite_color[(27*16)+10 : (27*16)+5];
|
786 |
|
|
B_out [7:3] <= sprite_color[(27*16)+15 : (27*16)+11];
|
787 |
|
|
end
|
788 |
|
|
|
789 |
|
|
else
|
790 |
|
|
begin
|
791 |
|
|
|
792 |
|
|
// SPRITE LEVEL 26 - START
|
793 |
|
|
if (
|
794 |
|
|
V_pos_in >= sprite_y[(26*10)+9 : 26*10] &&
|
795 |
|
|
V_pos_in <= sprite_y[(26*10)+9 : 26*10] + 15 &&
|
796 |
|
|
H_pos_in >= sprite_x[(26*10)+9 : 26*10] &&
|
797 |
|
|
H_pos_in <= sprite_x[(26*10)+9 : 26*10] + 15 &&
|
798 |
|
|
sprite_shape[ (26*16) + (H_pos_in - sprite_x[(26*10)+9 : 26*10]) ]
|
799 |
|
|
)
|
800 |
|
|
begin
|
801 |
|
|
R_out [2:0] <= 3'b000;
|
802 |
|
|
G_out [1:0] <= 2'b000;
|
803 |
|
|
B_out [2:0] <= 3'b000;
|
804 |
|
|
R_out [7:3] <= sprite_color[(26*16)+4 : (26*16)+0];
|
805 |
|
|
G_out [7:2] <= sprite_color[(26*16)+10 : (26*16)+5];
|
806 |
|
|
B_out [7:3] <= sprite_color[(26*16)+15 : (26*16)+11];
|
807 |
|
|
end
|
808 |
|
|
|
809 |
|
|
else
|
810 |
|
|
begin
|
811 |
|
|
|
812 |
|
|
// SPRITE LEVEL 25 - START
|
813 |
|
|
if (
|
814 |
|
|
V_pos_in >= sprite_y[(25*10)+9 : 25*10] &&
|
815 |
|
|
V_pos_in <= sprite_y[(25*10)+9 : 25*10] + 15 &&
|
816 |
|
|
H_pos_in >= sprite_x[(25*10)+9 : 25*10] &&
|
817 |
|
|
H_pos_in <= sprite_x[(25*10)+9 : 25*10] + 15 &&
|
818 |
|
|
sprite_shape[ (25*16) + (H_pos_in - sprite_x[(25*10)+9 : 25*10]) ]
|
819 |
|
|
)
|
820 |
|
|
begin
|
821 |
|
|
R_out [2:0] <= 3'b000;
|
822 |
|
|
G_out [1:0] <= 2'b000;
|
823 |
|
|
B_out [2:0] <= 3'b000;
|
824 |
|
|
R_out [7:3] <= sprite_color[(25*16)+4 : (25*16)+0];
|
825 |
|
|
G_out [7:2] <= sprite_color[(25*16)+10 : (25*16)+5];
|
826 |
|
|
B_out [7:3] <= sprite_color[(25*16)+15 : (25*16)+11];
|
827 |
|
|
end
|
828 |
|
|
|
829 |
|
|
else
|
830 |
|
|
begin
|
831 |
|
|
|
832 |
|
|
// SPRITE LEVEL 24 - START
|
833 |
|
|
if (
|
834 |
|
|
V_pos_in >= sprite_y[(24*10)+9 : 24*10] &&
|
835 |
|
|
V_pos_in <= sprite_y[(24*10)+9 : 24*10] + 15 &&
|
836 |
|
|
H_pos_in >= sprite_x[(24*10)+9 : 24*10] &&
|
837 |
|
|
H_pos_in <= sprite_x[(24*10)+9 : 24*10] + 15 &&
|
838 |
|
|
sprite_shape[ (24*16) + (H_pos_in - sprite_x[(24*10)+9 : 24*10]) ]
|
839 |
|
|
)
|
840 |
|
|
begin
|
841 |
|
|
R_out [2:0] <= 3'b000;
|
842 |
|
|
G_out [1:0] <= 2'b000;
|
843 |
|
|
B_out [2:0] <= 3'b000;
|
844 |
|
|
R_out [7:3] <= sprite_color[(24*16)+4 : (24*16)+0];
|
845 |
|
|
G_out [7:2] <= sprite_color[(24*16)+10 : (24*16)+5];
|
846 |
|
|
B_out [7:3] <= sprite_color[(24*16)+15 : (24*16)+11];
|
847 |
|
|
end
|
848 |
|
|
|
849 |
|
|
else
|
850 |
|
|
begin
|
851 |
|
|
|
852 |
|
|
// SPRITE LEVEL 23 - START
|
853 |
|
|
if (
|
854 |
|
|
V_pos_in >= sprite_y[(23*10)+9 : 23*10] &&
|
855 |
|
|
V_pos_in <= sprite_y[(23*10)+9 : 23*10] + 15 &&
|
856 |
|
|
H_pos_in >= sprite_x[(23*10)+9 : 23*10] &&
|
857 |
|
|
H_pos_in <= sprite_x[(23*10)+9 : 23*10] + 15 &&
|
858 |
|
|
sprite_shape[ (23*16) + (H_pos_in - sprite_x[(23*10)+9 : 23*10]) ]
|
859 |
|
|
)
|
860 |
|
|
begin
|
861 |
|
|
R_out [2:0] <= 3'b000;
|
862 |
|
|
G_out [1:0] <= 2'b000;
|
863 |
|
|
B_out [2:0] <= 3'b000;
|
864 |
|
|
R_out [7:3] <= sprite_color[(23*16)+4 : (23*16)+0];
|
865 |
|
|
G_out [7:2] <= sprite_color[(23*16)+10 : (23*16)+5];
|
866 |
|
|
B_out [7:3] <= sprite_color[(23*16)+15 : (23*16)+11];
|
867 |
|
|
end
|
868 |
|
|
|
869 |
|
|
else
|
870 |
|
|
begin
|
871 |
|
|
|
872 |
|
|
// SPRITE LEVEL 22 - START
|
873 |
|
|
if (
|
874 |
|
|
V_pos_in >= sprite_y[(22*10)+9 : 22*10] &&
|
875 |
|
|
V_pos_in <= sprite_y[(22*10)+9 : 22*10] + 15 &&
|
876 |
|
|
H_pos_in >= sprite_x[(22*10)+9 : 22*10] &&
|
877 |
|
|
H_pos_in <= sprite_x[(22*10)+9 : 22*10] + 15 &&
|
878 |
|
|
sprite_shape[ (22*16) + (H_pos_in - sprite_x[(22*10)+9 : 22*10]) ]
|
879 |
|
|
)
|
880 |
|
|
begin
|
881 |
|
|
R_out [2:0] <= 3'b000;
|
882 |
|
|
G_out [1:0] <= 2'b000;
|
883 |
|
|
B_out [2:0] <= 3'b000;
|
884 |
|
|
R_out [7:3] <= sprite_color[(22*16)+4 : (22*16)+0];
|
885 |
|
|
G_out [7:2] <= sprite_color[(22*16)+10 : (22*16)+5];
|
886 |
|
|
B_out [7:3] <= sprite_color[(22*16)+15 : (22*16)+11];
|
887 |
|
|
end
|
888 |
|
|
|
889 |
|
|
else
|
890 |
|
|
begin
|
891 |
|
|
|
892 |
|
|
// SPRITE LEVEL 21 - START
|
893 |
|
|
if (
|
894 |
|
|
V_pos_in >= sprite_y[(21*10)+9 : 21*10] &&
|
895 |
|
|
V_pos_in <= sprite_y[(21*10)+9 : 21*10] + 15 &&
|
896 |
|
|
H_pos_in >= sprite_x[(21*10)+9 : 21*10] &&
|
897 |
|
|
H_pos_in <= sprite_x[(21*10)+9 : 21*10] + 15 &&
|
898 |
|
|
sprite_shape[ (21*16) + (H_pos_in - sprite_x[(21*10)+9 : 21*10]) ]
|
899 |
|
|
)
|
900 |
|
|
begin
|
901 |
|
|
R_out [2:0] <= 3'b000;
|
902 |
|
|
G_out [1:0] <= 2'b000;
|
903 |
|
|
B_out [2:0] <= 3'b000;
|
904 |
|
|
R_out [7:3] <= sprite_color[(21*16)+4 : (21*16)+0];
|
905 |
|
|
G_out [7:2] <= sprite_color[(21*16)+10 : (21*16)+5];
|
906 |
|
|
B_out [7:3] <= sprite_color[(21*16)+15 : (21*16)+11];
|
907 |
|
|
end
|
908 |
|
|
|
909 |
|
|
else
|
910 |
|
|
begin
|
911 |
|
|
|
912 |
|
|
// SPRITE LEVEL 20 - START
|
913 |
|
|
if (
|
914 |
|
|
V_pos_in >= sprite_y[(20*10)+9 : 20*10] &&
|
915 |
|
|
V_pos_in <= sprite_y[(20*10)+9 : 20*10] + 15 &&
|
916 |
|
|
H_pos_in >= sprite_x[(20*10)+9 : 20*10] &&
|
917 |
|
|
H_pos_in <= sprite_x[(20*10)+9 : 20*10] + 15 &&
|
918 |
|
|
sprite_shape[ (20*16) + (H_pos_in - sprite_x[(20*10)+9 : 20*10]) ]
|
919 |
|
|
)
|
920 |
|
|
begin
|
921 |
|
|
R_out [2:0] <= 3'b000;
|
922 |
|
|
G_out [1:0] <= 2'b000;
|
923 |
|
|
B_out [2:0] <= 3'b000;
|
924 |
|
|
R_out [7:3] <= sprite_color[(20*16)+4 : (20*16)+0];
|
925 |
|
|
G_out [7:2] <= sprite_color[(20*16)+10 : (20*16)+5];
|
926 |
|
|
B_out [7:3] <= sprite_color[(20*16)+15 : (20*16)+11];
|
927 |
|
|
end
|
928 |
|
|
|
929 |
|
|
else
|
930 |
|
|
begin
|
931 |
|
|
|
932 |
|
|
// SPRITE LEVEL 19 - START
|
933 |
|
|
if (
|
934 |
|
|
V_pos_in >= sprite_y[(19*10)+9 : 19*10] &&
|
935 |
|
|
V_pos_in <= sprite_y[(19*10)+9 : 19*10] + 15 &&
|
936 |
|
|
H_pos_in >= sprite_x[(19*10)+9 : 19*10] &&
|
937 |
|
|
H_pos_in <= sprite_x[(19*10)+9 : 19*10] + 15 &&
|
938 |
|
|
sprite_shape[ (19*16) + (H_pos_in - sprite_x[(19*10)+9 : 19*10]) ]
|
939 |
|
|
)
|
940 |
|
|
begin
|
941 |
|
|
R_out [2:0] <= 3'b000;
|
942 |
|
|
G_out [1:0] <= 2'b000;
|
943 |
|
|
B_out [2:0] <= 3'b000;
|
944 |
|
|
R_out [7:3] <= sprite_color[(19*16)+4 : (19*16)+0];
|
945 |
|
|
G_out [7:2] <= sprite_color[(19*16)+10 : (19*16)+5];
|
946 |
|
|
B_out [7:3] <= sprite_color[(19*16)+15 : (19*16)+11];
|
947 |
|
|
end
|
948 |
|
|
|
949 |
|
|
else
|
950 |
|
|
begin
|
951 |
|
|
|
952 |
|
|
// SPRITE LEVEL 18 - START
|
953 |
|
|
if (
|
954 |
|
|
V_pos_in >= sprite_y[(18*10)+9 : 18*10] &&
|
955 |
|
|
V_pos_in <= sprite_y[(18*10)+9 : 18*10] + 15 &&
|
956 |
|
|
H_pos_in >= sprite_x[(18*10)+9 : 18*10] &&
|
957 |
|
|
H_pos_in <= sprite_x[(18*10)+9 : 18*10] + 15 &&
|
958 |
|
|
sprite_shape[ (18*16) + (H_pos_in - sprite_x[(18*10)+9 : 18*10]) ]
|
959 |
|
|
)
|
960 |
|
|
begin
|
961 |
|
|
R_out [2:0] <= 3'b000;
|
962 |
|
|
G_out [1:0] <= 2'b000;
|
963 |
|
|
B_out [2:0] <= 3'b000;
|
964 |
|
|
R_out [7:3] <= sprite_color[(18*16)+4 : (18*16)+0];
|
965 |
|
|
G_out [7:2] <= sprite_color[(18*16)+10 : (18*16)+5];
|
966 |
|
|
B_out [7:3] <= sprite_color[(18*16)+15 : (18*16)+11];
|
967 |
|
|
end
|
968 |
|
|
|
969 |
|
|
else
|
970 |
|
|
begin
|
971 |
|
|
|
972 |
|
|
// SPRITE LEVEL 17 - START
|
973 |
|
|
if (
|
974 |
|
|
V_pos_in >= sprite_y[(17*10)+9 : 17*10] &&
|
975 |
|
|
V_pos_in <= sprite_y[(17*10)+9 : 17*10] + 15 &&
|
976 |
|
|
H_pos_in >= sprite_x[(17*10)+9 : 17*10] &&
|
977 |
|
|
H_pos_in <= sprite_x[(17*10)+9 : 17*10] + 15 &&
|
978 |
|
|
sprite_shape[ (17*16) + (H_pos_in - sprite_x[(17*10)+9 : 17*10]) ]
|
979 |
|
|
)
|
980 |
|
|
begin
|
981 |
|
|
R_out [2:0] <= 3'b000;
|
982 |
|
|
G_out [1:0] <= 2'b000;
|
983 |
|
|
B_out [2:0] <= 3'b000;
|
984 |
|
|
R_out [7:3] <= sprite_color[(17*16)+4 : (17*16)+0];
|
985 |
|
|
G_out [7:2] <= sprite_color[(17*16)+10 : (17*16)+5];
|
986 |
|
|
B_out [7:3] <= sprite_color[(17*16)+15 : (17*16)+11];
|
987 |
|
|
end
|
988 |
|
|
|
989 |
|
|
else
|
990 |
|
|
begin
|
991 |
|
|
|
992 |
|
|
// SPRITE LEVEL 16 - START
|
993 |
|
|
if (
|
994 |
|
|
V_pos_in >= sprite_y[(16*10)+9 : 16*10] &&
|
995 |
|
|
V_pos_in <= sprite_y[(16*10)+9 : 16*10] + 15 &&
|
996 |
|
|
H_pos_in >= sprite_x[(16*10)+9 : 16*10] &&
|
997 |
|
|
H_pos_in <= sprite_x[(16*10)+9 : 16*10] + 15 &&
|
998 |
|
|
sprite_shape[ (16*16) + (H_pos_in - sprite_x[(16*10)+9 : 16*10]) ]
|
999 |
|
|
)
|
1000 |
|
|
begin
|
1001 |
|
|
R_out [2:0] <= 3'b000;
|
1002 |
|
|
G_out [1:0] <= 2'b000;
|
1003 |
|
|
B_out [2:0] <= 3'b000;
|
1004 |
|
|
R_out [7:3] <= sprite_color[(16*16)+4 : (16*16)+0];
|
1005 |
|
|
G_out [7:2] <= sprite_color[(16*16)+10 : (16*16)+5];
|
1006 |
|
|
B_out [7:3] <= sprite_color[(16*16)+15 : (16*16)+11];
|
1007 |
|
|
end
|
1008 |
|
|
|
1009 |
|
|
else
|
1010 |
|
|
begin
|
1011 |
|
|
|
1012 |
|
|
// SPRITE LEVEL 15 - START
|
1013 |
|
|
if (
|
1014 |
|
|
V_pos_in >= sprite_y[(15*10)+9 : 15*10] &&
|
1015 |
|
|
V_pos_in <= sprite_y[(15*10)+9 : 15*10] + 15 &&
|
1016 |
|
|
H_pos_in >= sprite_x[(15*10)+9 : 15*10] &&
|
1017 |
|
|
H_pos_in <= sprite_x[(15*10)+9 : 15*10] + 15 &&
|
1018 |
|
|
sprite_shape[ (15*16) + (H_pos_in - sprite_x[(15*10)+9 : 15*10]) ]
|
1019 |
|
|
)
|
1020 |
|
|
begin
|
1021 |
|
|
R_out [2:0] <= 3'b000;
|
1022 |
|
|
G_out [1:0] <= 2'b000;
|
1023 |
|
|
B_out [2:0] <= 3'b000;
|
1024 |
|
|
R_out [7:3] <= sprite_color[(15*16)+4 : (15*16)+0];
|
1025 |
|
|
G_out [7:2] <= sprite_color[(15*16)+10 : (15*16)+5];
|
1026 |
|
|
B_out [7:3] <= sprite_color[(15*16)+15 : (15*16)+11];
|
1027 |
|
|
end
|
1028 |
|
|
|
1029 |
|
|
else
|
1030 |
|
|
begin
|
1031 |
|
|
|
1032 |
|
|
// SPRITE LEVEL 14 - START
|
1033 |
|
|
if (
|
1034 |
|
|
V_pos_in >= sprite_y[(14*10)+9 : 14*10] &&
|
1035 |
|
|
V_pos_in <= sprite_y[(14*10)+9 : 14*10] + 15 &&
|
1036 |
|
|
H_pos_in >= sprite_x[(14*10)+9 : 14*10] &&
|
1037 |
|
|
H_pos_in <= sprite_x[(14*10)+9 : 14*10] + 15 &&
|
1038 |
|
|
sprite_shape[ (14*16) + (H_pos_in - sprite_x[(14*10)+9 : 14*10]) ]
|
1039 |
|
|
)
|
1040 |
|
|
begin
|
1041 |
|
|
R_out [2:0] <= 3'b000;
|
1042 |
|
|
G_out [1:0] <= 2'b000;
|
1043 |
|
|
B_out [2:0] <= 3'b000;
|
1044 |
|
|
R_out [7:3] <= sprite_color[(14*16)+4 : (14*16)+0];
|
1045 |
|
|
G_out [7:2] <= sprite_color[(14*16)+10 : (14*16)+5];
|
1046 |
|
|
B_out [7:3] <= sprite_color[(14*16)+15 : (14*16)+11];
|
1047 |
|
|
end
|
1048 |
|
|
|
1049 |
|
|
else
|
1050 |
|
|
begin
|
1051 |
|
|
|
1052 |
|
|
// SPRITE LEVEL 13 - START
|
1053 |
|
|
if (
|
1054 |
|
|
V_pos_in >= sprite_y[(13*10)+9 : 13*10] &&
|
1055 |
|
|
V_pos_in <= sprite_y[(13*10)+9 : 13*10] + 15 &&
|
1056 |
|
|
H_pos_in >= sprite_x[(13*10)+9 : 13*10] &&
|
1057 |
|
|
H_pos_in <= sprite_x[(13*10)+9 : 13*10] + 15 &&
|
1058 |
|
|
sprite_shape[ (13*16) + (H_pos_in - sprite_x[(13*10)+9 : 13*10]) ]
|
1059 |
|
|
)
|
1060 |
|
|
begin
|
1061 |
|
|
R_out [2:0] <= 3'b000;
|
1062 |
|
|
G_out [1:0] <= 2'b000;
|
1063 |
|
|
B_out [2:0] <= 3'b000;
|
1064 |
|
|
R_out [7:3] <= sprite_color[(13*16)+4 : (13*16)+0];
|
1065 |
|
|
G_out [7:2] <= sprite_color[(13*16)+10 : (13*16)+5];
|
1066 |
|
|
B_out [7:3] <= sprite_color[(13*16)+15 : (13*16)+11];
|
1067 |
|
|
end
|
1068 |
|
|
|
1069 |
|
|
else
|
1070 |
|
|
begin
|
1071 |
|
|
|
1072 |
|
|
// SPRITE LEVEL 12 - START
|
1073 |
|
|
if (
|
1074 |
|
|
V_pos_in >= sprite_y[(12*10)+9 : 12*10] &&
|
1075 |
|
|
V_pos_in <= sprite_y[(12*10)+9 : 12*10] + 15 &&
|
1076 |
|
|
H_pos_in >= sprite_x[(12*10)+9 : 12*10] &&
|
1077 |
|
|
H_pos_in <= sprite_x[(12*10)+9 : 12*10] + 15 &&
|
1078 |
|
|
sprite_shape[ (12*16) + (H_pos_in - sprite_x[(12*10)+9 : 12*10]) ]
|
1079 |
|
|
)
|
1080 |
|
|
begin
|
1081 |
|
|
R_out [2:0] <= 3'b000;
|
1082 |
|
|
G_out [1:0] <= 2'b000;
|
1083 |
|
|
B_out [2:0] <= 3'b000;
|
1084 |
|
|
R_out [7:3] <= sprite_color[(12*16)+4 : (12*16)+0];
|
1085 |
|
|
G_out [7:2] <= sprite_color[(12*16)+10 : (12*16)+5];
|
1086 |
|
|
B_out [7:3] <= sprite_color[(12*16)+15 : (12*16)+11];
|
1087 |
|
|
end
|
1088 |
|
|
|
1089 |
|
|
else
|
1090 |
|
|
begin
|
1091 |
|
|
|
1092 |
|
|
// SPRITE LEVEL 11 - START
|
1093 |
|
|
if (
|
1094 |
|
|
V_pos_in >= sprite_y[(11*10)+9 : 11*10] &&
|
1095 |
|
|
V_pos_in <= sprite_y[(11*10)+9 : 11*10] + 15 &&
|
1096 |
|
|
H_pos_in >= sprite_x[(11*10)+9 : 11*10] &&
|
1097 |
|
|
H_pos_in <= sprite_x[(11*10)+9 : 11*10] + 15 &&
|
1098 |
|
|
sprite_shape[ (11*16) + (H_pos_in - sprite_x[(11*10)+9 : 11*10]) ]
|
1099 |
|
|
)
|
1100 |
|
|
begin
|
1101 |
|
|
R_out [2:0] <= 3'b000;
|
1102 |
|
|
G_out [1:0] <= 2'b000;
|
1103 |
|
|
B_out [2:0] <= 3'b000;
|
1104 |
|
|
R_out [7:3] <= sprite_color[(11*16)+4 : (11*16)+0];
|
1105 |
|
|
G_out [7:2] <= sprite_color[(11*16)+10 : (11*16)+5];
|
1106 |
|
|
B_out [7:3] <= sprite_color[(11*16)+15 : (11*16)+11];
|
1107 |
|
|
end
|
1108 |
|
|
|
1109 |
|
|
else
|
1110 |
|
|
begin
|
1111 |
|
|
|
1112 |
|
|
// SPRITE LEVEL 10 - START
|
1113 |
|
|
if (
|
1114 |
|
|
V_pos_in >= sprite_y[(10*10)+9 : 10*10] &&
|
1115 |
|
|
V_pos_in <= sprite_y[(10*10)+9 : 10*10] + 15 &&
|
1116 |
|
|
H_pos_in >= sprite_x[(10*10)+9 : 10*10] &&
|
1117 |
|
|
H_pos_in <= sprite_x[(10*10)+9 : 10*10] + 15 &&
|
1118 |
|
|
sprite_shape[ (10*16) + (H_pos_in - sprite_x[(10*10)+9 : 10*10]) ]
|
1119 |
|
|
)
|
1120 |
|
|
begin
|
1121 |
|
|
R_out [2:0] <= 3'b000;
|
1122 |
|
|
G_out [1:0] <= 2'b000;
|
1123 |
|
|
B_out [2:0] <= 3'b000;
|
1124 |
|
|
R_out [7:3] <= sprite_color[(10*16)+4 : (10*16)+0];
|
1125 |
|
|
G_out [7:2] <= sprite_color[(10*16)+10 : (10*16)+5];
|
1126 |
|
|
B_out [7:3] <= sprite_color[(10*16)+15 : (10*16)+11];
|
1127 |
|
|
end
|
1128 |
|
|
|
1129 |
|
|
else
|
1130 |
|
|
begin
|
1131 |
|
|
|
1132 |
|
|
// SPRITE LEVEL 9 - START
|
1133 |
|
|
if (
|
1134 |
|
|
V_pos_in >= sprite_y[(9*10)+9 : 9*10] &&
|
1135 |
|
|
V_pos_in <= sprite_y[(9*10)+9 : 9*10] + 15 &&
|
1136 |
|
|
H_pos_in >= sprite_x[(9*10)+9 : 9*10] &&
|
1137 |
|
|
H_pos_in <= sprite_x[(9*10)+9 : 9*10] + 15 &&
|
1138 |
|
|
sprite_shape[ (9*16) + (H_pos_in - sprite_x[(9*10)+9 : 9*10]) ]
|
1139 |
|
|
)
|
1140 |
|
|
begin
|
1141 |
|
|
R_out [2:0] <= 3'b000;
|
1142 |
|
|
G_out [1:0] <= 2'b000;
|
1143 |
|
|
B_out [2:0] <= 3'b000;
|
1144 |
|
|
R_out [7:3] <= sprite_color[(9*16)+4 : (9*16)+0];
|
1145 |
|
|
G_out [7:2] <= sprite_color[(9*16)+10 : (9*16)+5];
|
1146 |
|
|
B_out [7:3] <= sprite_color[(9*16)+15 : (9*16)+11];
|
1147 |
|
|
end
|
1148 |
|
|
|
1149 |
|
|
else
|
1150 |
|
|
begin
|
1151 |
|
|
|
1152 |
|
|
// SPRITE LEVEL 8 - START
|
1153 |
|
|
if (
|
1154 |
|
|
V_pos_in >= sprite_y[(8*10)+9 : 8*10] &&
|
1155 |
|
|
V_pos_in <= sprite_y[(8*10)+9 : 8*10] + 15 &&
|
1156 |
|
|
H_pos_in >= sprite_x[(8*10)+9 : 8*10] &&
|
1157 |
|
|
H_pos_in <= sprite_x[(8*10)+9 : 8*10] + 15 &&
|
1158 |
|
|
sprite_shape[ (8*16) + (H_pos_in - sprite_x[(8*10)+9 : 8*10]) ]
|
1159 |
|
|
)
|
1160 |
|
|
begin
|
1161 |
|
|
R_out [2:0] <= 3'b000;
|
1162 |
|
|
G_out [1:0] <= 2'b000;
|
1163 |
|
|
B_out [2:0] <= 3'b000;
|
1164 |
|
|
R_out [7:3] <= sprite_color[(8*16)+4 : (8*16)+0];
|
1165 |
|
|
G_out [7:2] <= sprite_color[(8*16)+10 : (8*16)+5];
|
1166 |
|
|
B_out [7:3] <= sprite_color[(8*16)+15 : (8*16)+11];
|
1167 |
|
|
end
|
1168 |
|
|
|
1169 |
|
|
else
|
1170 |
|
|
begin
|
1171 |
|
|
|
1172 |
|
|
// SPRITE LEVEL 7 - START
|
1173 |
|
|
if (
|
1174 |
|
|
V_pos_in >= sprite_y[(7*10)+9 : 7*10] &&
|
1175 |
|
|
V_pos_in <= sprite_y[(7*10)+9 : 7*10] + 15 &&
|
1176 |
|
|
H_pos_in >= sprite_x[(7*10)+9 : 7*10] &&
|
1177 |
|
|
H_pos_in <= sprite_x[(7*10)+9 : 7*10] + 15 &&
|
1178 |
|
|
sprite_shape[ (7*16) + (H_pos_in - sprite_x[(7*10)+9 : 7*10]) ]
|
1179 |
|
|
)
|
1180 |
|
|
begin
|
1181 |
|
|
R_out [2:0] <= 3'b000;
|
1182 |
|
|
G_out [1:0] <= 2'b000;
|
1183 |
|
|
B_out [2:0] <= 3'b000;
|
1184 |
|
|
R_out [7:3] <= sprite_color[(7*16)+4 : (7*16)+0];
|
1185 |
|
|
G_out [7:2] <= sprite_color[(7*16)+10 : (7*16)+5];
|
1186 |
|
|
B_out [7:3] <= sprite_color[(7*16)+15 : (7*16)+11];
|
1187 |
|
|
end
|
1188 |
|
|
|
1189 |
|
|
else
|
1190 |
|
|
begin
|
1191 |
|
|
|
1192 |
|
|
// SPRITE LEVEL 8 - START
|
1193 |
|
|
if (
|
1194 |
|
|
V_pos_in >= sprite_y[(6*10)+9 : 6*10] &&
|
1195 |
|
|
V_pos_in <= sprite_y[(6*10)+9 : 6*10] + 15 &&
|
1196 |
|
|
H_pos_in >= sprite_x[(6*10)+9 : 6*10] &&
|
1197 |
|
|
H_pos_in <= sprite_x[(6*10)+9 : 6*10] + 15 &&
|
1198 |
|
|
sprite_shape[ (6*16) + (H_pos_in - sprite_x[(6*10)+9 : 6*10]) ]
|
1199 |
|
|
)
|
1200 |
|
|
begin
|
1201 |
|
|
R_out [2:0] <= 3'b000;
|
1202 |
|
|
G_out [1:0] <= 2'b000;
|
1203 |
|
|
B_out [2:0] <= 3'b000;
|
1204 |
|
|
R_out [7:3] <= sprite_color[(6*16)+4 : (6*16)+0];
|
1205 |
|
|
G_out [7:2] <= sprite_color[(6*16)+10 : (6*16)+5];
|
1206 |
|
|
B_out [7:3] <= sprite_color[(6*16)+15 : (6*16)+11];
|
1207 |
|
|
end
|
1208 |
|
|
|
1209 |
|
|
else
|
1210 |
|
|
begin
|
1211 |
|
|
|
1212 |
|
|
// SPRITE LEVEL 5 - START
|
1213 |
|
|
if (
|
1214 |
|
|
V_pos_in >= sprite_y[(5*10)+9 : 5*10] &&
|
1215 |
|
|
V_pos_in <= sprite_y[(5*10)+9 : 5*10] + 15 &&
|
1216 |
|
|
H_pos_in >= sprite_x[(5*10)+9 : 5*10] &&
|
1217 |
|
|
H_pos_in <= sprite_x[(5*10)+9 : 5*10] + 15 &&
|
1218 |
|
|
sprite_shape[ (5*16) + (H_pos_in - sprite_x[(5*10)+9 : 5*10]) ]
|
1219 |
|
|
)
|
1220 |
|
|
begin
|
1221 |
|
|
R_out [2:0] <= 3'b000;
|
1222 |
|
|
G_out [1:0] <= 2'b000;
|
1223 |
|
|
B_out [2:0] <= 3'b000;
|
1224 |
|
|
R_out [7:3] <= sprite_color[(5*16)+4 : (5*16)+0];
|
1225 |
|
|
G_out [7:2] <= sprite_color[(5*16)+10 : (5*16)+5];
|
1226 |
|
|
B_out [7:3] <= sprite_color[(5*16)+15 : (5*16)+11];
|
1227 |
|
|
end
|
1228 |
|
|
|
1229 |
|
|
else
|
1230 |
|
|
begin
|
1231 |
|
|
|
1232 |
|
|
// SPRITE LEVEL 4 - START
|
1233 |
|
|
if (
|
1234 |
|
|
V_pos_in >= sprite_y[(4*10)+9 : 4*10] &&
|
1235 |
|
|
V_pos_in <= sprite_y[(4*10)+9 : 4*10] + 15 &&
|
1236 |
|
|
H_pos_in >= sprite_x[(4*10)+9 : 4*10] &&
|
1237 |
|
|
H_pos_in <= sprite_x[(4*10)+9 : 4*10] + 15 &&
|
1238 |
|
|
sprite_shape[ (4*16) + (H_pos_in - sprite_x[(4*10)+9 : 4*10]) ]
|
1239 |
|
|
)
|
1240 |
|
|
begin
|
1241 |
|
|
R_out [2:0] <= 3'b000;
|
1242 |
|
|
G_out [1:0] <= 2'b000;
|
1243 |
|
|
B_out [2:0] <= 3'b000;
|
1244 |
|
|
R_out [7:3] <= sprite_color[(4*16)+4 : (4*16)+0];
|
1245 |
|
|
G_out [7:2] <= sprite_color[(4*16)+10 : (4*16)+5];
|
1246 |
|
|
B_out [7:3] <= sprite_color[(4*16)+15 : (4*16)+11];
|
1247 |
|
|
end
|
1248 |
|
|
|
1249 |
|
|
else
|
1250 |
|
|
begin
|
1251 |
|
|
|
1252 |
|
|
// SPRITE LEVEL 3 - START
|
1253 |
|
|
if (
|
1254 |
|
|
V_pos_in >= sprite_y[(3*10)+9 : 3*10] &&
|
1255 |
|
|
V_pos_in <= sprite_y[(3*10)+9 : 3*10] + 15 &&
|
1256 |
|
|
H_pos_in >= sprite_x[(3*10)+9 : 3*10] &&
|
1257 |
|
|
H_pos_in <= sprite_x[(3*10)+9 : 3*10] + 15 &&
|
1258 |
|
|
sprite_shape[ (3*16) + (H_pos_in - sprite_x[(3*10)+9 : 3*10]) ]
|
1259 |
|
|
)
|
1260 |
|
|
begin
|
1261 |
|
|
R_out [2:0] <= 3'b000;
|
1262 |
|
|
G_out [1:0] <= 2'b000;
|
1263 |
|
|
B_out [2:0] <= 3'b000;
|
1264 |
|
|
R_out [7:3] <= sprite_color[(3*16)+4 : (3*16)+0];
|
1265 |
|
|
G_out [7:2] <= sprite_color[(3*16)+10 : (3*16)+5];
|
1266 |
|
|
B_out [7:3] <= sprite_color[(3*16)+15 : (3*16)+11];
|
1267 |
|
|
end
|
1268 |
|
|
|
1269 |
|
|
else
|
1270 |
|
|
begin
|
1271 |
|
|
|
1272 |
|
|
// SPRITE LEVEL 2 - START
|
1273 |
|
|
if (
|
1274 |
|
|
V_pos_in >= sprite_y[(2*10)+9 : 2*10] &&
|
1275 |
|
|
V_pos_in <= sprite_y[(2*10)+9 : 2*10] + 15 &&
|
1276 |
|
|
H_pos_in >= sprite_x[(2*10)+9 : 2*10] &&
|
1277 |
|
|
H_pos_in <= sprite_x[(2*10)+9 : 2*10] + 15 &&
|
1278 |
|
|
sprite_shape[ (2*16) + (H_pos_in - sprite_x[(2*10)+9 : 2*10]) ]
|
1279 |
|
|
)
|
1280 |
|
|
begin
|
1281 |
|
|
R_out [2:0] <= 3'b000;
|
1282 |
|
|
G_out [1:0] <= 2'b000;
|
1283 |
|
|
B_out [2:0] <= 3'b000;
|
1284 |
|
|
R_out [7:3] <= sprite_color[(2*16)+4 : (2*16)+0];
|
1285 |
|
|
G_out [7:2] <= sprite_color[(2*16)+10 : (2*16)+5];
|
1286 |
|
|
B_out [7:3] <= sprite_color[(2*16)+15 : (2*16)+11];
|
1287 |
|
|
end
|
1288 |
|
|
|
1289 |
|
|
else
|
1290 |
|
|
begin
|
1291 |
|
|
|
1292 |
|
|
// SPRITE LEVEL 1 - START
|
1293 |
|
|
if (
|
1294 |
|
|
V_pos_in >= sprite_y[(1*10)+9 : 1*10] &&
|
1295 |
|
|
V_pos_in <= sprite_y[(1*10)+9 : 1*10] + 15 &&
|
1296 |
|
|
H_pos_in >= sprite_x[(1*10)+9 : 1*10] &&
|
1297 |
|
|
H_pos_in <= sprite_x[(1*10)+9 : 1*10] + 15 &&
|
1298 |
|
|
sprite_shape[ (1*16) + (H_pos_in - sprite_x[(1*10)+9 : 1*10]) ]
|
1299 |
|
|
)
|
1300 |
|
|
begin
|
1301 |
|
|
R_out [2:0] <= 3'b000;
|
1302 |
|
|
G_out [1:0] <= 2'b000;
|
1303 |
|
|
B_out [2:0] <= 3'b000;
|
1304 |
|
|
R_out [7:3] <= sprite_color[(1*16)+4 : (1*16)+0];
|
1305 |
|
|
G_out [7:2] <= sprite_color[(1*16)+10 : (1*16)+5];
|
1306 |
|
|
B_out [7:3] <= sprite_color[(1*16)+15 : (1*16)+11];
|
1307 |
|
|
end
|
1308 |
|
|
|
1309 |
|
|
else
|
1310 |
|
|
begin
|
1311 |
|
|
|
1312 |
|
|
// SPRITE LEVEL 0 - START
|
1313 |
|
|
if (
|
1314 |
|
|
V_pos_in >= sprite_y[(0*10)+9 : 0*10] &&
|
1315 |
|
|
V_pos_in <= sprite_y[(0*10)+9 : 0*10] + 15 &&
|
1316 |
|
|
H_pos_in >= sprite_x[(0*10)+9 : 0*10] &&
|
1317 |
|
|
H_pos_in <= sprite_x[(0*10)+9 : 0*10] + 15 &&
|
1318 |
|
|
sprite_shape[ (0*16) + (H_pos_in - sprite_x[(0*10)+9 : 0*10]) ]
|
1319 |
|
|
)
|
1320 |
|
|
begin
|
1321 |
|
|
R_out [2:0] <= 3'b000;
|
1322 |
|
|
G_out [1:0] <= 2'b000;
|
1323 |
|
|
B_out [2:0] <= 3'b000;
|
1324 |
|
|
R_out [7:3] <= sprite_color[(0*16)+4 : (0*16)+0];
|
1325 |
|
|
G_out [7:2] <= sprite_color[(0*16)+10 : (0*16)+5];
|
1326 |
|
|
B_out [7:3] <= sprite_color[(0*16)+15 : (0*16)+11];
|
1327 |
|
|
end
|
1328 |
|
|
|
1329 |
|
|
else
|
1330 |
|
|
begin
|
1331 |
|
|
|
1332 |
|
|
R_out [2:0] <= 3'b000;
|
1333 |
|
|
G_out [1:0] <= 2'b000;
|
1334 |
|
|
B_out [2:0] <= 3'b000;
|
1335 |
|
|
R_out [7:3] <= R_in [7:3];
|
1336 |
|
|
G_out [7:2] <= G_in [7:2];
|
1337 |
|
|
B_out [7:3] <= B_in [7:3];
|
1338 |
|
|
end // SPRITE LEVEL 0 - ELSE END
|
1339 |
|
|
end // SPRITE LEVEL 1 - ELSE END
|
1340 |
|
|
end // SPRITE LEVEL 2 - ELSE END
|
1341 |
|
|
end // SPRITE LEVEL 3 - ELSE END
|
1342 |
|
|
end // SPRITE LEVEL 4 - ELSE END
|
1343 |
|
|
end // SPRITE LEVEL 5 - ELSE END
|
1344 |
|
|
end // SPRITE LEVEL 6 - ELSE END
|
1345 |
|
|
end // SPRITE LEVEL 7 - ELSE END
|
1346 |
|
|
end // SPRITE LEVEL 8 - ELSE END
|
1347 |
|
|
end // SPRITE LEVEL 9 - ELSE END
|
1348 |
|
|
end // SPRITE LEVEL 10 - ELSE END
|
1349 |
|
|
end // SPRITE LEVEL 11 - ELSE END
|
1350 |
|
|
end // SPRITE LEVEL 12 - ELSE END
|
1351 |
|
|
end // SPRITE LEVEL 13 - ELSE END
|
1352 |
|
|
end // SPRITE LEVEL 14 - ELSE END
|
1353 |
|
|
end // SPRITE LEVEL 15 - ELSE END
|
1354 |
|
|
end // SPRITE LEVEL 16 - ELSE END
|
1355 |
|
|
end // SPRITE LEVEL 17 - ELSE END
|
1356 |
|
|
end // SPRITE LEVEL 18 - ELSE END
|
1357 |
|
|
end // SPRITE LEVEL 19 - ELSE END
|
1358 |
|
|
end // SPRITE LEVEL 20 - ELSE END
|
1359 |
|
|
end // SPRITE LEVEL 21 - ELSE END
|
1360 |
|
|
end // SPRITE LEVEL 22 - ELSE END
|
1361 |
|
|
end // SPRITE LEVEL 23 - ELSE END
|
1362 |
|
|
end // SPRITE LEVEL 24 - ELSE END
|
1363 |
|
|
end // SPRITE LEVEL 25 - ELSE END
|
1364 |
|
|
end // SPRITE LEVEL 26 - ELSE END
|
1365 |
|
|
end // SPRITE LEVEL 27 - ELSE END
|
1366 |
|
|
end // SPRITE LEVEL 28 - ELSE END
|
1367 |
|
|
end // SPRITE LEVEL 29 - ELSE END
|
1368 |
|
|
end // SPRITE LEVEL 30 - ELSE END
|
1369 |
|
|
end // SPRITE LEVEL 31 - ELSE END
|
1370 |
|
|
end // SPRITE LEVEL 32 - ELSE END
|
1371 |
|
|
end // SPRITE LEVEL 33 - ELSE END
|
1372 |
|
|
end // SPRITE LEVEL 34 - ELSE END
|
1373 |
|
|
end // SPRITE LEVEL 35 - ELSE END
|
1374 |
|
|
end // SPRITE LEVEL 36 - ELSE END
|
1375 |
|
|
end // SPRITE LEVEL 37 - ELSE END
|
1376 |
|
|
end // SPRITE LEVEL 38 - ELSE END
|
1377 |
|
|
end // SPRITE LEVEL 39 - ELSE END
|
1378 |
|
|
end // SPRITE LEVEL 40 - ELSE END
|
1379 |
|
|
end // SPRITE LEVEL 41 - ELSE END
|
1380 |
|
|
end // SPRITE LEVEL 42 - ELSE END
|
1381 |
|
|
end // SPRITE LEVEL 43 - ELSE END
|
1382 |
|
|
end // SPRITE LEVEL 44 - ELSE END
|
1383 |
|
|
end // SPRITE LEVEL 45 - ELSE END
|
1384 |
|
|
end // SPRITE LEVEL 46 - ELSE END
|
1385 |
|
|
end // SPRITE LEVEL 47 - ELSE END
|
1386 |
|
|
end // SPRITE LEVEL 48 - ELSE END
|
1387 |
|
|
end // SPRITE LEVEL 49 - ELSE END
|
1388 |
|
|
end // SPRITE LEVEL 50 - ELSE END
|
1389 |
|
|
end // SPRITE LEVEL 51 - ELSE END
|
1390 |
|
|
end // SPRITE LEVEL 52 - ELSE END
|
1391 |
|
|
end // SPRITE LEVEL 53 - ELSE END
|
1392 |
|
|
end // SPRITE LEVEL 54 - ELSE END
|
1393 |
|
|
end // SPRITE LEVEL 55 - ELSE END
|
1394 |
|
|
end // SPRITE LEVEL 56 - ELSE END
|
1395 |
|
|
end // SPRITE LEVEL 57 - ELSE END
|
1396 |
|
|
end // SPRITE LEVEL 58 - ELSE END
|
1397 |
|
|
end // SPRITE LEVEL 59 - ELSE END
|
1398 |
|
|
end // SPRITE LEVEL 60 - ELSE END
|
1399 |
|
|
end // SPRITE LEVEL 61 - ELSE END
|
1400 |
|
|
end // SPRITE LEVEL 62 - ELSE END
|
1401 |
|
|
end // SPRITE LEVEL 63 - ELSE END
|
1402 |
|
|
|
1403 |
|
|
end // RST - ELSE END
|
1404 |
|
|
|
1405 |
|
|
end // ALWAYS END
|
1406 |
|
|
|
1407 |
|
|
|
1408 |
|
|
endmodule
|