// Move Murphy in any direction
// ==========================================================================
// Move Murphy in any direction
// ==========================================================================
// int ax, al, ah, bx, bl, i, X, Y;
// int tX, tY, tDeltaX, tDeltaY, tPos, Tmp;
#if 1
// int ax, al, ah, bx, bl, i, X, Y;
// int tX, tY, tDeltaX, tDeltaY, tPos, Tmp;
#if 1
// Variables that hold information about the animation sequence
static int *dx = 0; // an array of image positions in moving.mpx, finalized with -1
// Variables that hold information about the animation sequence
static int *dx = 0; // an array of image positions in moving.mpx, finalized with -1
static int dx2 = 0; // an additional image position of a second sprite, for instance: yellow disk if pushed
static int MurphyDX = 0, MurphyDY = 0; // murphys move steps
static int SeqPos = 0; // index into dx()
static int ClearPos = 0; // Position to clear before blitting sprites, none=-1
static int dxPos = 0; // field-position to draw dx(SeqPos)
static int dx2Step = 0; // position of dx2 relative to dx-position
static int dx2 = 0; // an additional image position of a second sprite, for instance: yellow disk if pushed
static int MurphyDX = 0, MurphyDY = 0; // murphys move steps
static int SeqPos = 0; // index into dx()
static int ClearPos = 0; // Position to clear before blitting sprites, none=-1
static int dxPos = 0; // field-position to draw dx(SeqPos)
static int dx2Step = 0; // position of dx2 relative to dx-position
if (YawnSleepCounter < 2000)
{
// normal grin
// (default: single graphic, no animation)
if (YawnSleepCounter < 2000)
{
// normal grin
// (default: single graphic, no animation)
}
if (YawnSleepCounter < 4000)
{
// yawn! and look depressed afterwards...
// (default: 12 animation frames with delay of 8)
}
if (YawnSleepCounter < 4000)
{
// yawn! and look depressed afterwards...
// (default: 12 animation frames with delay of 8)
}
// time2 = 6496 + 3 * 64; // (default: 6688 == 6496 + 3 * 64)
time2 = 6496 + 3 * 100;
if (YawnSleepCounter > time2) // Murphy already went to sleep
}
// time2 = 6496 + 3 * 64; // (default: 6688 == 6496 + 3 * 64)
time2 = 6496 + 3 * 100;
if (YawnSleepCounter > time2) // Murphy already went to sleep
// ------------------------------------------------------------------
// Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter:
// ------------------------------------------------------------------
// Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter:
if (YawnSleepCounter == 4)
{
subCopyFieldToScreen(*si, fiMurphy); // normal grin
if (YawnSleepCounter == 4)
{
subCopyFieldToScreen(*si, fiMurphy); // normal grin
if (YawnSleepCounter <= 522)
{
bx = (YawnSleepCounter - 500) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn! and look depressed afterwards...
if (YawnSleepCounter <= 522)
{
bx = (YawnSleepCounter - 500) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn! and look depressed afterwards...
if (YawnSleepCounter <= 1022)
{
bx = (YawnSleepCounter - 1000) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again!
if (YawnSleepCounter <= 1022)
{
bx = (YawnSleepCounter - 1000) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again!
if (YawnSleepCounter <= 1622)
{
bx = (YawnSleepCounter - 1600) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again! - third time
if (YawnSleepCounter <= 1622)
{
bx = (YawnSleepCounter - 1600) / 2;
subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again! - third time
}
else
{
bx = (YawnSleepCounter - 1622) / 16;
subCopyFieldToScreen(*si, aniMurphySleepRight + bx); // go to sleep
}
else
{
bx = (YawnSleepCounter - 1622) / 16;
subCopyFieldToScreen(*si, aniMurphySleepRight + bx); // go to sleep
}
} // loc_g_5F81:
bx = (YawnSleepCounter - 1622) / 16;
subCopyFieldToScreen(*si, aniMurphySleepLeft + bx); // go to sleep
}
} // loc_g_5F81:
bx = (YawnSleepCounter - 1622) / 16;
subCopyFieldToScreen(*si, aniMurphySleepLeft + bx); // go to sleep
// ==========================================================================
// moving right to left ...
// ==========================================================================
// moving right to left ...
// ==========================================================================
// moving left to right ...
// ==========================================================================
// moving left to right ...
// ==========================================================================
// touching down to up ...
// ==========================================================================
// touching down to up ...
// ==========================================================================
// touching right to left ...
// ==========================================================================
// touching right to left ...
// ==========================================================================
// touching up to down ...
// ==========================================================================
// touching up to down ...
// ==========================================================================
// touching left to right ...
// ==========================================================================
// touching left to right ...
// ==========================================================================
// Release Red disk: no move ...
// ==========================================================================
// Release Red disk: no move ...
MovHighByte(&PlayField16[*si], 0x2A);
MovingPictureSequencePhase = 0x40; // init picture move sequence
MovHighByte(&PlayField16[*si], 0x2A);
MovingPictureSequencePhase = 0x40; // init picture move sequence
MovLowByte(&RedDiskReleasePhase, 1);
Mov(&RedDiskReleaseMurphyPos, *si); // remember Murphy's location
goto loc_Split;
MovLowByte(&RedDiskReleasePhase, 1);
Mov(&RedDiskReleaseMurphyPos, *si); // remember Murphy's location
goto loc_Split;
dxPos = *si - FieldWidth;
MovHighByte(&PlayField16[*si], 0x10);
goto loc_StopNoSplit;
dxPos = *si - FieldWidth;
MovHighByte(&PlayField16[*si], 0x10);
goto loc_StopNoSplit;
dxPos = *si + FieldWidth;
MovHighByte(&PlayField16[*si], 0x12);
goto loc_StopNoSplit;
dxPos = *si + FieldWidth;
MovHighByte(&PlayField16[*si], 0x12);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x14);
MovHighByte(&PlayField16[*si - FieldWidth], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x14);
MovHighByte(&PlayField16[*si - FieldWidth], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x15);
MovHighByte(&PlayField16[*si - 1], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x15);
MovHighByte(&PlayField16[*si - 1], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x16);
MovHighByte(&PlayField16[*si + FieldWidth], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x16);
MovHighByte(&PlayField16[*si + FieldWidth], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x17);
MovHighByte(&PlayField16[*si + 1], 0xFF);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x17);
MovHighByte(&PlayField16[*si + 1], 0xFF);
goto loc_StopNoSplit;
- subCopyFieldToScreen(*si, aniPushRight); // draw pushing murphy
- dx = aniZonkRollRight;
+ subCopyImageToScreen(*si, aniPushRight); // draw pushing murphy
+ dx = aniFramesZonkRollRight;
+ dx1 = aniZonkRollRight;
TerminalState[*si + 1] = 8;
// ==========================================================================
// common TERMINAL stuff moving/touching from all directions
TerminalState[*si + 1] = 8;
// ==========================================================================
// common TERMINAL stuff moving/touching from all directions
// ==========================================================================
// PORT down to up, VERTICAL PORT, CROSS PORT all moving down to up
// ==========================================================================
// PORT down to up, VERTICAL PORT, CROSS PORT all moving down to up
PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start!
PlayField16[*si - 1] = 0x1D03;
*si = *si - 1;
PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start!
PlayField16[*si - 1] = 0x1D03;
*si = *si - 1;
- // dx = aniMurphyEatRightRedDisk 'this sequence is 9 steps long!
- dx = aniMurphyEatRight;
+ // dx = aniFramesMurphyEatRightRedDisk 'this sequence is 9 steps long!
+ dx = aniFramesMurphyEatRight;
+ dx1 = aniMurphyEatRight;
// --------------------------------------------------------------------------
// BugFix
// Table data_h_145A, pointed to by table data_h_105E, has a severe bug:
// --------------------------------------------------------------------------
// BugFix
// Table data_h_145A, pointed to by table data_h_105E, has a severe bug:
MovHighByte(&PlayField16[*si], 0x20);
MovHighByte(&PlayField16[*si - FieldWidth], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x20);
MovHighByte(&PlayField16[*si - FieldWidth], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x21);
MovHighByte(&PlayField16[*si - 1], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x21);
MovHighByte(&PlayField16[*si - 1], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x22);
MovHighByte(&PlayField16[*si + FieldWidth], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x22);
MovHighByte(&PlayField16[*si + FieldWidth], 3);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si], 0x23);
MovHighByte(&PlayField16[*si + 1], 3);
MovHighByte(&PlayField16[*si], 0x23);
MovHighByte(&PlayField16[*si + 1], 3);
// ==========================================================================
// Paint frame of MOVING.DAT sequence
// ==========================================================================
loc_g_6C8F:
// ==========================================================================
// Paint frame of MOVING.DAT sequence
// ==========================================================================
loc_g_6C8F:
#else
if (! ClearPos < 0) // clear field that murphy is leaving
subCopyFieldToScreen(ClearPos, 0);
#else
if (! ClearPos < 0) // clear field that murphy is leaving
subCopyFieldToScreen(ClearPos, 0);
X = GetStretchX(dxPos) + tDeltaX;
Y = GetStretchY(dxPos) + tDeltaY;
Tmp = (SeqPos < 0 ? 0 : SeqPos); // 9StepBugFix!(red disk move right)
X = GetStretchX(dxPos) + tDeltaX;
Y = GetStretchY(dxPos) + tDeltaY;
Tmp = (SeqPos < 0 ? 0 : SeqPos); // 9StepBugFix!(red disk move right)
+
+#if 1
+ if (isSnappingSequence(dx1) && SeqPos == dx1SequenceLength - 1)
+ dx1 = aniSpace;
+#endif
+
+#if 1
+ StretchedSprites.BltImg(X, Y, dx1, Tmp);
+ // printf("::: Tmp: %d\n", Tmp);
+#else
+#if 1
+ // (SeqPos iterates from 0 to 7 while pushing)
+ StretchedSprites.BltImg(X + tDeltaX, Y + tDeltaY, dx2, SeqPos);
+ // printf("::: SeqPos: %d\n", SeqPos);
+#else
MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX;
MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY;
#endif
MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX;
MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY;
#endif
tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1);
tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1);
X = GetStretchX(dxPos) + tDeltaX;
tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1);
tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1);
X = GetStretchX(dxPos) + tDeltaX;
loc_g_6EC8: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + FieldWidth);
loc_g_6EC8: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + FieldWidth);
loc_g_6EE6: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + 1);
loc_g_6EE6: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + 1);
// ==========================================================================
// infotron, moving right
// ==========================================================================
// infotron, moving right
loc_g_71C4: // space, base
subAdjustZonksInfotronsAboveMurphy(*si - 1);
PlayField16[*si] = fiMurphy;
loc_g_71C4: // space, base
subAdjustZonksInfotronsAboveMurphy(*si - 1);
PlayField16[*si] = fiMurphy;
// ==========================================================================
// infotron, touching left
// ==========================================================================
// infotron, touching left
// ==========================================================================
// infotron, touching down
// ==========================================================================
// infotron, touching down
// ==========================================================================
// infotron, touching right
// ==========================================================================
// infotron, touching right
// ==========================================================================
// Push Zonk from right to left
// ==========================================================================
// Push Zonk from right to left
PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
PlayField16[*si - 1] = fiZonk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
PlayField16[*si - 1] = fiZonk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
// ==========================================================================
// Push Zonk from left to right
// ==========================================================================
// Push Zonk from left to right
PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
PlayField16[*si + 1] = fiZonk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
PlayField16[*si + 1] = fiZonk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
// ==========================================================================
// Push orange disk from right to left
// ==========================================================================
// Push orange disk from right to left
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - 1] = fiOrangeDisk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - 1] = fiOrangeDisk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
// ==========================================================================
// Push orange disk from left to right
// ==========================================================================
// Push orange disk from left to right
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + 1] = fiOrangeDisk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + 1] = fiOrangeDisk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
// ==========================================================================
// Push yellow disk from down to up
// ==========================================================================
// Push yellow disk from down to up
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - FieldWidth] = fiYellowDisk;
if (LowByte(PlayField16[*si - 2 * FieldWidth]) != fiExplosion)
PlayField16[*si - 2 * FieldWidth] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - FieldWidth] = fiYellowDisk;
if (LowByte(PlayField16[*si - 2 * FieldWidth]) != fiExplosion)
PlayField16[*si - 2 * FieldWidth] = 0;
// ==========================================================================
// Push yellow disk from right to left
// ==========================================================================
// Push yellow disk from right to left
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - 1] = fiYellowDisk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si - 1] = fiYellowDisk;
if (LowByte(PlayField16[*si - 2]) != fiExplosion)
PlayField16[*si - 2] = 0;
// ==========================================================================
// Push yellow disk from up to down
// ==========================================================================
// Push yellow disk from up to down
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + FieldWidth] = fiYellowDisk;
if (LowByte(PlayField16[*si + 2 * FieldWidth]) != fiExplosion)
PlayField16[*si + 2 * FieldWidth] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + FieldWidth] = fiYellowDisk;
if (LowByte(PlayField16[*si + 2 * FieldWidth]) != fiExplosion)
PlayField16[*si + 2 * FieldWidth] = 0;
// ==========================================================================
// Push yellow disk from left to right
// ==========================================================================
// Push yellow disk from left to right
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + 1] = fiYellowDisk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
PlayField16[*si] = fiMurphy; // else restore - no more pushing!
PlayField16[*si + 1] = fiYellowDisk;
if (LowByte(PlayField16[*si + 2]) != fiExplosion)
PlayField16[*si + 2] = 0;
// ==========================================================================
// time red disk release (space)
// ==========================================================================
// time red disk release (space)
// ==========================================================================
// Special port down to up
// ==========================================================================
// Special port down to up
// ==========================================================================
// Special port right to left
// ==========================================================================
// Special port right to left
// ==========================================================================
// Special port up to down
// ==========================================================================
// Special port up to down
// ==========================================================================
// Special port left to right
// ==========================================================================
// Special port left to right
// ==========================================================================
// yellow disk, pushing up
// ==========================================================================
// yellow disk, pushing up
// ==========================================================================
// yellow disk, pushing left
// ==========================================================================
// yellow disk, pushing left
// ==========================================================================
// yellow disk, pushing down
// ==========================================================================
// yellow disk, pushing down
// ==========================================================================
// yellow disk pushing right
// ==========================================================================
// yellow disk pushing right
// ==========================================================================
// orange disk, pushing left
// ==========================================================================
// orange disk, pushing left
// ==========================================================================
// orange disk, pushing right
// ==========================================================================
// orange disk, pushing right
RedDiskCount = RedDiskCount - 1;
subDisplayRedDiskCount();
subSoundFXPush(); // Sound effects
RedDiskCount = RedDiskCount - 1;
subDisplayRedDiskCount();
subSoundFXPush(); // Sound effects
} // subAnimateMurphy
// ==========================================================================
// SUBROUTINE
// ==========================================================================
} // subAnimateMurphy
// ==========================================================================
// SUBROUTINE
// ==========================================================================
int ax;
ax = LowByte(PlayField16[si + FieldWidth]);
if (ax == 0x11 || ax == 0xBB)
ExplodeFieldSP(si + FieldWidth);
int ax;
ax = LowByte(PlayField16[si + FieldWidth]);
if (ax == 0x11 || ax == 0xBB)
ExplodeFieldSP(si + FieldWidth);
} // subExplodeSnikSnaksBelow
// ==========================================================================
} // subExplodeSnikSnaksBelow
// ==========================================================================
MovHighByte(&PlayField16[si - FieldWidth - 1], 0x60); // make roll right
PlayField16[si - FieldWidth] = 0x8888;
MovHighByte(&PlayField16[si - FieldWidth - 1], 0x60); // make roll right
PlayField16[si - FieldWidth] = 0x8888;
MovHighByte(&PlayField16[si - FieldWidth + 1], 0x50); // make roll left
PlayField16[si - FieldWidth] = 0x8888;
}
MovHighByte(&PlayField16[si - FieldWidth + 1], 0x50); // make roll left
PlayField16[si - FieldWidth] = 0x8888;
}