1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
8 // ==========================================================================
10 // Animate Infotrons (falling)
11 // ==========================================================================
13 void subAnimateInfotrons(int si)
20 tFld = PlayField16[si];
21 if ((tFld & 0xFF) != fiInfotron)
24 if (tFld == fiInfotron)
26 ax = PlayField16[si + FieldWidth]; // select case playfield16(si+60)
41 loc_g_11A6: // Case fiZonk, fiInfotron, fiRAM
42 ax = PlayField16[si + FieldWidth - 1];
43 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
47 ax = PlayField16[si + FieldWidth + 1];
48 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
53 loc_g_11D5: // Case fiSpace
54 MovHighByte(&PlayField16[si], 0x40);
57 loc_g_11DC: // roll left?
58 if (PlayField16[si - 1] == 0)
64 MovHighByte(&PlayField16[si], 0x50);
65 PlayField16[si - 1] = 0x8888;
68 loc_g_11F2: // roll right?
69 if (PlayField16[si + 1] == 0)
75 MovHighByte(&PlayField16[si], 0x60);
76 PlayField16[si + 1] = 0x8888;
77 } // tFld = fiInfotron
80 // from now on the infotron is definitely moving,
81 // maybe the sequence is in an advanced frame
82 // or just beeing initialized due to the code above
83 bl = HighByte(PlayField16[si]);
88 if (al == 0x10) // infotron comes falling from above
91 if (al == 0x20) // infotron comes rolling from right to left
94 if (al == 0x30) // infotron comes rolling from left to right
97 if (al == 0x40) // infotron falls straight down
100 if (al == 0x50) // infotron rolls left
103 if (al == 0x60) // infotron rolls right
106 if (al == 0x70) // intermediate state
111 loc_g_1242: // infotron comes falling from above
112 // To Do: draw infotron falling from above
113 // according to position in (bl And &H07)
114 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
116 Y = GetStretchY(si - FieldWidth);
118 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
119 DDSpriteBuffer_BltImg(X, Y + TwoPixels * (dx + 1), aniInfotron, dx);
120 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
122 bl = HighByte(PlayField16[si]) + 1;
125 MovHighByte(&PlayField16[si], bl);
126 subCleanUpForInfotronsAbove(si - FieldWidth);
133 MovHighByte(&PlayField16[si], bl);
138 MovHighByte(&PlayField16[si], 0); // infotron arrived at the field
140 // now check if the zonk may go on falling somehow
141 ax = PlayField16[si + FieldWidth];
142 if (ax == 0) // below is empty!-> go on falling
145 if (ax == 0x9999) // below is only temporarily used
148 if ((ax & 0xFF) == fiMurphy) // Murphy dies
151 if (ax == fiRedDisk) // red disk hit
154 if ((ax & 0xFF) == fiSnikSnak) // SnikSnak dies
158 if ((ax & 0xFF) == fiElectron) // Electron cracked!
161 if (ax == fiYellowDisk) // yellow disk hit
164 if (ax == fiOrangeDisk) // orange disk hit
167 // play the infotron sound, 'cause infotron hits something "hard"
168 subSoundFX(si, fiInfotron, actImpact);
170 if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
173 // infotron rolls somewhere
174 ax = PlayField16[si + FieldWidth - 1];
175 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll left
178 ax = PlayField16[si + FieldWidth + 1];
179 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
184 loc_g_132D: // go on falling down?
185 PlayField16[si] = 0x7004; // go into intermediate waitstate
186 PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
190 loc_g_133A: // test if infotron may roll left
191 // This if(if true) jumps up far above
192 // to the according rountine for fixed infotrons!
193 if (PlayField16[si - 1] != 0) // Remarkable!!! ' loc_g_0EF4:
196 MovHighByte(&PlayField16[si], 0x50); // infotron rolls left
197 PlayField16[si - 1] = 0x8888;
201 loc_g_1350: // test if infotron may roll right
202 if (PlayField16[si + 1] != 0)
205 MovHighByte(&PlayField16[si], 0x60); // infotron rolls right
206 PlayField16[si + 1] = 0x8888;
210 loc_g_1364: // Murphy dies, but not in any case
211 bl = HighByte(PlayField16[si + FieldWidth]);
212 if (bl == 0xE || bl == 0xF || bl == 0x28)
215 if (bl == 0x29 || bl == 0x25 || bl == 0x26)
218 loc_g_1386: // someone dies/explodes immediately
219 si = si + FieldWidth; // 1 field down
220 ExplodeFieldSP(si); // Explode
224 loc_g_138D: // infotron comes rolling from right to left
225 // To Do: draw infotron rolling from right
226 // according to position in (bl And &H07)
227 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
228 X = GetStretchX(si + 1);
231 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
232 DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
233 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
235 bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
237 PlayField16[si + 1] = 0xAAAA;
241 MovHighByte(&PlayField16[si], bl);
242 subCleanUpForInfotronsAbove(si + 1);
246 MovHighByte(&PlayField16[si], bl);
250 PlayField16[si] = 0x7004; // go into intermediate state
255 loc_g_13E9: // infotron comes rolling from left to right
256 // To Do: draw infotron rolling from left
257 // according to position in (bl And &H07)
258 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
259 X = GetStretchX(si - 1);
262 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
263 DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
264 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
266 bl = HighByte(PlayField16[si]) + 1;
268 PlayField16[si - 1] = 0xAAAA;
272 MovHighByte(&PlayField16[si], bl);
273 subCleanUpForInfotronsAbove(si - 1);
277 MovHighByte(&PlayField16[si], bl);
281 PlayField16[si] = 0x7004; // go into intermediate state
286 loc_g_1444: // infotron falls straight down
290 MovHighByte(&PlayField16[si], bl);
292 else if (PlayField16[si + FieldWidth] != 0)
294 bl = bl - 1; // stay waiting
295 MovHighByte(&PlayField16[si], bl);
299 PlayField16[si] = 0xFFFF;
300 si = si + FieldWidth; // 1 field down
301 PlayField16[si] = 0x1004; // go falling
306 loc_g_1472: // infotron rolls left
307 // To Do: draw infotron rolling to left
308 // according to position in (bl And &H0F)
309 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
313 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
314 DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
315 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
317 bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
320 MovHighByte(&PlayField16[si], bl);
325 if (PlayField16[si + FieldWidth - 1] != 0)
328 if (PlayField16[si - 1] != 0)
330 if (PlayField16[si - 1] != 0x8888)
334 PlayField16[si] = 0xFFFF;
335 si = si - 1; // 1 field left
336 PlayField16[si] = 0x2204;
337 PlayField16[si + FieldWidth] = 0x9999;
341 loc_g_14D9: // stay waiting
343 MovHighByte(&PlayField16[si], bl);
347 loc_g_14E0: // infotron rolls right
348 // To Do: draw infotron rolling to right
349 // according to position in (bl And &H07)
350 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
354 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
355 DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
356 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
358 bl = HighByte(PlayField16[si]) + 1;
361 MovHighByte(&PlayField16[si], bl);
366 if (PlayField16[si + FieldWidth + 1] != 0)
369 if (PlayField16[si + 1] != 0)
371 if (PlayField16[si + 1] != 0x8888)
375 PlayField16[si] = 0xFFFF;
377 PlayField16[si] = 0x3204;
378 PlayField16[si + FieldWidth] = 0x9999;
382 loc_g_1547: // stay waiting
384 MovHighByte(&PlayField16[si], bl);
388 loc_g_154E: // intermediate state
389 ax = PlayField16[si + FieldWidth];
390 if (ax == 0 || ax == 0x9999)
392 PlayField16[si] = 0xFFFF;
393 si = si + FieldWidth; // 1 field down
394 PlayField16[si] = 0x1004; // start falling down
399 void subCleanUpForInfotronsAbove(int si)
403 if (LowByte(PlayField16[si]) != fiExplosion)
406 if (PlayField16[si - FieldWidth] != 0)
408 if (PlayField16[si - FieldWidth] != 0x9999)
411 if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiZonk)
415 if (PlayField16[si - FieldWidth - 1] == fiInfotron)
419 if (PlayField16[si - FieldWidth + 1] == fiInfotron)
425 ax = PlayField16[si - 1];
426 if (ax == fiZonk || ax == fiInfotron || ax == fiRAM)
428 PlayField16[si - FieldWidth - 1] = 0x6004;
429 PlayField16[si - FieldWidth] = 0x8888;
437 ax = PlayField16[si + 1];
438 if (ax == fiZonk || ax == fiInfotron || ax == fiRAM)
440 PlayField16[si - FieldWidth + 1] = 0x5004;
441 PlayField16[si - FieldWidth] = 0x8888;