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
170 // play the infotron sound, 'cause infotron hits something "hard"
171 subSoundFX(si, fiInfotron, actImpact);
173 // play the zonk sound, 'cause zonk hits something "hard"
174 subSoundFX(si, fiZonk, actImpact);
178 subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
181 if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
184 // infotron rolls somewhere
185 ax = PlayField16[si + FieldWidth - 1];
186 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll left
189 ax = PlayField16[si + FieldWidth + 1];
190 if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
195 loc_g_132D: // go on falling down?
196 PlayField16[si] = 0x7004; // go into intermediate waitstate
197 PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
201 loc_g_133A: // test if infotron may roll left
202 // This if(if true) jumps up far above
203 // to the according rountine for fixed infotrons!
204 if (PlayField16[si - 1] != 0) // Remarkable!!! ' loc_g_0EF4:
207 MovHighByte(&PlayField16[si], 0x50); // infotron rolls left
208 PlayField16[si - 1] = 0x8888;
212 loc_g_1350: // test if infotron may roll right
213 if (PlayField16[si + 1] != 0)
216 MovHighByte(&PlayField16[si], 0x60); // infotron rolls right
217 PlayField16[si + 1] = 0x8888;
221 loc_g_1364: // Murphy dies, but not in any case
222 bl = HighByte(PlayField16[si + FieldWidth]);
223 if (bl == 0xE || bl == 0xF || bl == 0x28)
226 if (bl == 0x29 || bl == 0x25 || bl == 0x26)
229 loc_g_1386: // someone dies/explodes immediately
230 si = si + FieldWidth; // 1 field down
231 ExplodeFieldSP(si); // Explode
235 loc_g_138D: // infotron comes rolling from right to left
236 // To Do: draw infotron rolling from right
237 // according to position in (bl And &H07)
238 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
239 X = GetStretchX(si + 1);
242 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
243 DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
244 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
246 bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
248 PlayField16[si + 1] = 0xAAAA;
252 MovHighByte(&PlayField16[si], bl);
253 subCleanUpForInfotronsAbove(si + 1);
257 MovHighByte(&PlayField16[si], bl);
261 PlayField16[si] = 0x7004; // go into intermediate state
266 loc_g_13E9: // infotron comes rolling from left to right
267 // To Do: draw infotron rolling from left
268 // according to position in (bl And &H07)
269 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
270 X = GetStretchX(si - 1);
273 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
274 DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
275 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
277 bl = HighByte(PlayField16[si]) + 1;
279 PlayField16[si - 1] = 0xAAAA;
283 MovHighByte(&PlayField16[si], bl);
284 subCleanUpForInfotronsAbove(si - 1);
288 MovHighByte(&PlayField16[si], bl);
292 PlayField16[si] = 0x7004; // go into intermediate state
297 loc_g_1444: // infotron falls straight down
301 MovHighByte(&PlayField16[si], bl);
303 else if (PlayField16[si + FieldWidth] != 0)
305 bl = bl - 1; // stay waiting
306 MovHighByte(&PlayField16[si], bl);
310 PlayField16[si] = 0xFFFF;
311 si = si + FieldWidth; // 1 field down
312 PlayField16[si] = 0x1004; // go falling
317 loc_g_1472: // infotron rolls left
318 // To Do: draw infotron rolling to left
319 // according to position in (bl And &H0F)
320 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
324 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
325 DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
326 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
328 bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
331 MovHighByte(&PlayField16[si], bl);
336 if (PlayField16[si + FieldWidth - 1] != 0)
339 if (PlayField16[si - 1] != 0)
341 if (PlayField16[si - 1] != 0x8888)
345 PlayField16[si] = 0xFFFF;
346 si = si - 1; // 1 field left
347 PlayField16[si] = 0x2204;
348 PlayField16[si + FieldWidth] = 0x9999;
352 loc_g_14D9: // stay waiting
354 MovHighByte(&PlayField16[si], bl);
358 loc_g_14E0: // infotron rolls right
359 // To Do: draw infotron rolling to right
360 // according to position in (bl And &H07)
361 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
365 DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
366 DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
367 // +++++++++++++++++++++++++++++++++++++++++++++++++++++
369 bl = HighByte(PlayField16[si]) + 1;
372 MovHighByte(&PlayField16[si], bl);
377 if (PlayField16[si + FieldWidth + 1] != 0)
380 if (PlayField16[si + 1] != 0)
382 if (PlayField16[si + 1] != 0x8888)
386 PlayField16[si] = 0xFFFF;
388 PlayField16[si] = 0x3204;
389 PlayField16[si + FieldWidth] = 0x9999;
393 loc_g_1547: // stay waiting
395 MovHighByte(&PlayField16[si], bl);
399 loc_g_154E: // intermediate state
400 ax = PlayField16[si + FieldWidth];
401 if (ax == 0 || ax == 0x9999)
403 PlayField16[si] = 0xFFFF;
404 si = si + FieldWidth; // 1 field down
405 PlayField16[si] = 0x1004; // start falling down
410 void subCleanUpForInfotronsAbove(int si)
414 if (LowByte(PlayField16[si]) != fiExplosion)
417 if (PlayField16[si - FieldWidth] != 0)
419 if (PlayField16[si - FieldWidth] != 0x9999)
422 if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiZonk)
426 if (PlayField16[si - FieldWidth - 1] == fiInfotron)
430 if (PlayField16[si - FieldWidth + 1] == fiInfotron)
436 ax = PlayField16[si - 1];
437 if (ax == fiZonk || ax == fiInfotron || ax == fiRAM)
439 PlayField16[si - FieldWidth - 1] = 0x6004;
440 PlayField16[si - FieldWidth] = 0x8888;
448 ax = PlayField16[si + 1];
449 if (ax == fiZonk || ax == fiInfotron || ax == fiRAM)
451 PlayField16[si - FieldWidth + 1] = 0x5004;
452 PlayField16[si - FieldWidth] = 0x8888;