#include "Infotrons.h"
-// static char *VB_Name = "modInfotron";
-
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Animate Infotrons (falling)
// ==========================================================================
-int subAnimateInfotrons(int si)
+void subAnimateInfotrons(int si)
{
- int subAnimateInfotrons;
-
int tFld;
- // PseudoRegisters:
- // int ax, bx, cx, dx, di, X, Y;
- // int ah, bh, ch, dh, al, bl, cl, dl;
int ax, bx, dx, X, Y;
int al, bl;
tFld = PlayField16[si];
if ((tFld & 0xFF) != fiInfotron)
- return subAnimateInfotrons;
+ return;
if (tFld == fiInfotron)
{
if (ax == fiRAM)
goto loc_g_11A6;
- return subAnimateInfotrons;
+ return;
loc_g_11A6: // Case fiZonk, fiInfotron, fiRAM
ax = PlayField16[si + FieldWidth - 1];
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
goto loc_g_11F2;
- return subAnimateInfotrons;
+ return;
loc_g_11D5: // Case fiSpace
MovHighByte(&PlayField16[si], 0x40);
if (PlayField16[si + 1] == 0)
goto loc_g_11FA;
- return subAnimateInfotrons;
+ return;
loc_g_11FA:
MovHighByte(&PlayField16[si], 0x60);
bl = HighByte(PlayField16[si]);
bx = 0;
MovLowByte(&bx, bl);
+
al = bl & 0xF0;
if (al == 0x10) // infotron comes falling from above
goto loc_g_1242;
if (al == 0x70) // intermediate state
goto loc_g_154E;
- return subAnimateInfotrons;
+ return;
loc_g_1242: // infotron comes falling from above
// To Do: draw infotron falling from above
X = GetStretchX(si);
Y = GetStretchY(si - FieldWidth);
dx = bl & 0x7;
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y + TwoPixels * (dx + 1), fiInfotron);
+ DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
+ DDSpriteBuffer_BltImg(X, Y + TwoPixels * (dx + 1), aniInfotron, dx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x16)
{
MovHighByte(&PlayField16[si], bl);
subCleanUpForInfotronsAbove(si - FieldWidth);
- return subAnimateInfotrons;
+
+ return;
} // loc_g_1285:
if (bl < 0x18)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
} // loc_g_128F:
MovHighByte(&PlayField16[si], 0); // infotron arrived at the field
if (ax == fiOrangeDisk) // orange disk hit
goto loc_g_1386;
+#if 1
+
+#if 1
+ // play the infotron sound, 'cause infotron hits something "hard"
+ subSoundFX(si, fiInfotron, actImpact);
+#else
+ // play the zonk sound, 'cause zonk hits something "hard"
+ subSoundFX(si, fiZonk, actImpact);
+#endif
+
+#else
subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+#endif
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
- return subAnimateInfotrons;
+ return;
// infotron rolls somewhere
ax = PlayField16[si + FieldWidth - 1];
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
goto loc_g_1350;
- return subAnimateInfotrons;
+ return;
loc_g_132D: // go on falling down?
PlayField16[si] = 0x7004; // go into intermediate waitstate
PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
- return subAnimateInfotrons;
+
+ return;
loc_g_133A: // test if infotron may roll left
// This if(if true) jumps up far above
goto loc_g_11BD;
MovHighByte(&PlayField16[si], 0x50); // infotron rolls left
- Mov(&PlayField16[si - 1], 0x8888);
- return subAnimateInfotrons;
+ PlayField16[si - 1] = 0x8888;
+
+ return;
loc_g_1350: // test if infotron may roll right
if (PlayField16[si + 1] != 0)
- return subAnimateInfotrons;
+ return;
MovHighByte(&PlayField16[si], 0x60); // infotron rolls right
- Mov(&PlayField16[si + 1], 0x8888);
- return subAnimateInfotrons;
+ PlayField16[si + 1] = 0x8888;
+
+ return;
loc_g_1364: // Murphy dies, but not in any case
bl = HighByte(PlayField16[si + FieldWidth]);
if (bl == 0xE || bl == 0xF || bl == 0x28)
- return subAnimateInfotrons;
+ return;
if (bl == 0x29 || bl == 0x25 || bl == 0x26)
- return subAnimateInfotrons;
-
-
-
-
-
-
-
-
-
-
+ return;
loc_g_1386: // someone dies/explodes immediately
si = si + FieldWidth; // 1 field down
ExplodeFieldSP(si); // Explode
- return subAnimateInfotrons;
-
-
-
+ return;
loc_g_138D: // infotron comes rolling from right to left
// To Do: draw infotron rolling from right
X = GetStretchX(si + 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]);
+ DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
+ DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
if (bl == 0x24)
PlayField16[si + 1] = 0xAAAA;
PlayField16[si] = 0x7004; // go into intermediate state
}
- return subAnimateInfotrons;
+ return;
loc_g_13E9: // infotron comes rolling from left to right
// To Do: draw infotron rolling from left
X = GetStretchX(si - 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]);
+ DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
+ DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x34)
PlayField16[si - 1] = 0xAAAA;
PlayField16[si] = 0x7004; // go into intermediate state
}
- return subAnimateInfotrons;
+ return;
loc_g_1444: // infotron falls straight down
bl = bl + 1;
PlayField16[si] = 0x1004; // go falling
}
- return subAnimateInfotrons;
+ return;
loc_g_1472: // infotron rolls left
// To Do: draw infotron rolling to left
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0xF) + 1;
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]);
+ DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
+ DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
if (bl < 0x52)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
}
if (PlayField16[si + FieldWidth - 1] != 0)
si = si - 1; // 1 field left
PlayField16[si] = 0x2204;
PlayField16[si + FieldWidth] = 0x9999;
- return subAnimateInfotrons;
+
+ return;
loc_g_14D9: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
loc_g_14E0: // infotron rolls right
// To Do: draw infotron rolling to right
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]);
+ DDSpriteBuffer_BltImg(X, Y, aniSpace, 0);
+ DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl < 0x62)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
}
if (PlayField16[si + FieldWidth + 1] != 0)
si = si + 1;
PlayField16[si] = 0x3204;
PlayField16[si + FieldWidth] = 0x9999;
- return subAnimateInfotrons;
+
+ return;
loc_g_1547: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
loc_g_154E: // intermediate state
ax = PlayField16[si + FieldWidth];
PlayField16[si] = 0x1004; // start falling down
goto loc_g_1242;
}
+}
- return subAnimateInfotrons;
-} // subAnimateInfotrons
-
-int subCleanUpForInfotronsAbove(int si)
+void subCleanUpForInfotronsAbove(int si)
{
- int subCleanUpForInfotronsAbove;
-
int ax;
if (LowByte(PlayField16[si]) != fiExplosion)
if (PlayField16[si - FieldWidth] != 0)
{
if (PlayField16[si - FieldWidth] != 0x9999)
- return subCleanUpForInfotronsAbove;
+ return;
if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiZonk)
- return subCleanUpForInfotronsAbove;
+ return;
}
if (PlayField16[si - FieldWidth - 1] == fiInfotron)
if (PlayField16[si - FieldWidth + 1] == fiInfotron)
goto loc_g_1722;
- return subCleanUpForInfotronsAbove;
+ return;
loc_g_16FE:
ax = PlayField16[si - 1];
{
PlayField16[si - FieldWidth - 1] = 0x6004;
PlayField16[si - FieldWidth] = 0x8888;
- return subCleanUpForInfotronsAbove;
+
+ return;
}
goto loc_g_16F6;
PlayField16[si - FieldWidth + 1] = 0x5004;
PlayField16[si - FieldWidth] = 0x8888;
}
-
- return subCleanUpForInfotronsAbove;
-} // subCleanUpForInfotronsAbove
-
+}