// int ax, bx, cx, dx, di;
// int ah, bh, ch, dh, al, bl, cl, dl;
- int cx;
+ // int cx;
+#if 0
+ int graphic, sync_frame;
+#endif
int bl;
if (fiBug != LowByte(PlayField16[si]))
return subAnimateBugs;
+#if 0
if (0 != (TimerVar & 3))
return subAnimateBugs;
+#endif
bl = SgnHighByte(PlayField16[si]); // get and increment sequence#
+
+#if 1
+ if ((TimerVar & 3) == 0)
+ {
+ bl = bl + 1;
+ if (bl >= 0xE)
+ {
+ bl = subGetRandomNumber(); // generate new random number
+ bl = -((bl & 0x3F) + 0x20);
+ }
+
+ MovHighByte(&PlayField16[si], bl); // save sequence#
+ }
+#else
bl = bl + 1;
if (bl >= 0xE)
{
}
MovHighByte(&PlayField16[si], bl); // save sequence#
+#endif
if (bl < 0) // bug sleeps / is inactive
return subAnimateBugs;
+#if 1
+ if ((TimerVar & 3) != 0)
+ goto markDisplay;
+#endif
+
// now the bug is active! Beware Murphy!
if ((ByteMask && PlayField16[si - FieldWidth - 1]) == fiMurphy)
goto markPlaySound;
markDisplay:
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#if 1
+
+#if 1
+
+#if 0
+ graphic = (bl == 0 ? aniBugActivating :
+ bl == 12 ? aniBugDeactivating :
+ bl == 13 ? aniBug : aniBugActive);
+ sync_frame = (bl >= 1 && bl <= 11 ? (bl - 1) * 4 : 0) + (TimerVar & 3);
+#endif
+
+ // printf("::: %d [%d]\n", sync_frame, gfx.anim_random_frame);
+
+#if 0
+ /* a general random frame treatment would be needed for _all_ animations */
+ /* (DONE) */
+ if (isRandomAnimation_SP(graphic) &&
+ !isNextAnimationFrame_SP(graphic, sync_frame))
+ return subAnimateBugs;
+#endif
+
+#if 1
+
+ GfxGraphic[GetX(si)][GetY(si)] = (bl == 0 ? aniBugActivating :
+ bl == 12 ? aniBugDeactivating :
+ bl == 13 ? aniBug : aniBugActive);
+
+#else
+ subCopyAnimToScreen(si, graphic, sync_frame);
+#endif
+
+#else
+ subCopyFieldToScreen(si, aniFramesBug[bl]);
+#endif
+
+#else
cx = aniFramesBug[bl];
StretchedSprites.BltEx(GetStretchX(si), GetStretchY(si), cx);
+#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
return subAnimateBugs;
GfxFrame[lx][ly] += getGraphicInfo_Delay(graphic);
#if 1
+
+#if 1
+
+ GfxGraphic[GetX(si)][GetY(si)] = (bl < 8 ? aniTerminal : aniTerminalActive);
+
+#else
subCopyAnimToScreen(si, graphic, GfxFrame[lx][ly]);
+#endif
+
#else
X = GetStretchX(si);
Y = GetStretchY(si);
int subGetRandomNumber;
long Tmp, RSeed;
+#if 0
+ long Tst;
+#endif
RSeed = (long)(0x7FFF & RandomSeed);
if (0x8000 == (RandomSeed & 0x8000))
#else
Tmp = 0xFFFF & (((0x5E5 * RandomSeed) & 0xFFFF) + 0x31);
#endif
+
+#if 0
+ Tst = 0xFFFF & (((0x5E5 * RSeed) & 0xFFFF) + 0x31);
+ printf("::: BugsTerminals.c: subGetRandomNumber(): %d [%ld] [%ld, %ld]\n",
+ RandomSeed, RSeed, Tmp, Tst);
+ if (Tmp != Tst)
+ printf("::: !!!!!!!!!!\n");
+#endif
+
RandomSeed = 0x7FFF & Tmp;
if ((Tmp & 0x8000) != 0)
RandomSeed = RandomSeed | 0x8000;
subGetRandomNumber);
#endif
+#if 0
+ printf("::: BugsTerminals.c: subGetRandomNumber(): %d [%ld, %d]\n",
+ subGetRandomNumber, Tmp, RandomSeed);
+#endif
+
return subGetRandomNumber;
} // subGetRandomNumber