// 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 dx1 = 0; // same as "*dx" above, but as image/animation token
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 dx1SequenceLength = 0;
ax = PlayField16[*si];
al = LowByte(ax);
MurphyMoveCounter = 1; // We have a Murphy!
MurphyExplodePos = *si;
- if (ax != 3) // yes--go proceed moving murphy?
+
+ // (check if high byte of PlayField16 has stored movement information)
+ if (ax != fiMurphy) // yes--go proceed moving murphy?
goto locProceedMovingMurphy;
// FS: reset moving sequence variables
MurphyDY = 0;
ClearPos = *si;
dxPos = *si;
+ dx1 = -1;
dx2 = -1;
SeqPos = 0;
// end of FS
MovHighByte(&PlayField16[*si], 0x2A);
MovingPictureSequencePhase = 0x40; // init picture move sequence
- dx = aniRedDisk;
+ dx = aniFramesRedDisk;
+ dx1 = aniRedDisk;
MovLowByte(&RedDiskReleasePhase, 1);
Mov(&RedDiskReleaseMurphyPos, *si); // remember Murphy's location
goto loc_Split;
// ==========================================================================
loc_g_6312:
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft);
PlayField16[*si - FieldWidth] = 0x103;
PlayField16[*si] = 0x300;
*si = *si - FieldWidth;
// ==========================================================================
loc_g_6341:
- dx = aniMurphyEatLeft;
+ dx = aniFramesMurphyEatLeft;
+ dx1 = aniMurphyMoveLeft;
PlayField16[*si - 1] = 0x203;
PlayField16[*si] = 0x300;
*si = *si - 1;
// ==========================================================================
loc_g_6364:
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft);
PlayField16[*si + FieldWidth] = 0x303;
PlayField16[*si] = 0x300;
*si = *si + FieldWidth;
// ==========================================================================
loc_g_6399:
- dx = aniMurphyEatRight;
+ dx = aniFramesMurphyEatRight;
+ dx1 = aniMurphyMoveRight;
PlayField16[*si + 1] = 0x403;
PlayField16[*si] = 0x300;
*si = *si + 1;
loc_g_63D3:
subSoundFXBase();
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
PlayField16[*si - FieldWidth] = 0x503;
PlayField16[*si] = 0x300;
*si = *si - FieldWidth;
loc_g_641C:
subSoundFXBase();
- dx = aniMurphyEatLeft;
+ dx = aniFramesMurphyEatLeft;
+ dx1 = aniMurphyDigLeft;
PlayField16[*si - 1] = 0x203;
PlayField16[*si] = 0x300;
*si = *si - 1;
loc_g_6459:
subSoundFXBase();
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
PlayField16[*si + FieldWidth] = 0x703;
PlayField16[*si] = 0x300;
*si = *si + FieldWidth;
loc_g_64A2:
subSoundFXBase();
- dx = aniMurphyEatRight;
+ dx = aniFramesMurphyEatRight;
+ dx1 = aniMurphyDigRight;
PlayField16[*si + 1] = 0x803;
PlayField16[*si] = 0x300;
*si = *si + 1;
loc_g_64DF:
subCopyImageToScreen(*si, aniMurphyTouchUp);
subSoundFXBase();
- dx = aniTouchBase;
+ dx = aniFramesTouchBase;
+ dx1 = aniTouchBase;
dxPos = *si - FieldWidth;
MovHighByte(&PlayField16[*si], 0x10);
goto loc_StopNoSplit;
loc_g_651D:
subCopyImageToScreen(*si, aniMurphyTouchLeft);
subSoundFXBase();
- dx = aniTouchBase;
+ dx = aniFramesTouchBase;
+ dx1 = aniTouchBase;
dxPos = *si - 1;
MovHighByte(&PlayField16[*si], 0x11);
goto loc_StopNoSplit;
loc_g_655B:
subCopyImageToScreen(*si, aniMurphyTouchDown);
subSoundFXBase();
- dx = aniTouchBase;
+ dx = aniFramesTouchBase;
+ dx1 = aniTouchBase;
dxPos = *si + FieldWidth;
MovHighByte(&PlayField16[*si], 0x12);
goto loc_StopNoSplit;
loc_g_6599:
subCopyImageToScreen(*si, aniMurphyTouchRight);
subSoundFXBase();
- dx = aniTouchBase;
+ dx = aniFramesTouchBase;
+ dx1 = aniTouchBase;
dxPos = *si + 1;
MovHighByte(&PlayField16[*si], 0x13);
goto loc_StopNoSplit;
loc_g_65C6:
subSoundFXInfotron();
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si - FieldWidth] = 0x903;
PlayField16[*si] = 0x300;
*si = *si - FieldWidth;
loc_g_65FE:
subSoundFXInfotron();
- dx = aniEatInfotronLeft;
+ dx = aniFramesEatInfotronLeft;
+ dx1 = aniEatInfotronLeft;
+#if 0
dx2 = fiInfotron;
dx2Step = -1;
ClearPos = -1;
+#endif
PlayField16[*si - 1] = 0xA03;
PlayField16[*si] = 0x300;
*si = *si - 1;
loc_g_662A:
subSoundFXInfotron();
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si + FieldWidth] = 0xB03;
PlayField16[*si] = 0x300;
*si = *si + FieldWidth;
loc_g_6662:
subSoundFXInfotron();
- dx = aniEatInfotronRight;
+ dx = aniFramesEatInfotronRight;
+ dx1 = aniEatInfotronRight;
+#if 0
dx2 = fiInfotron;
dx2Step = 1;
ClearPos = -1;
+#endif
PlayField16[*si + 1] = 0xC03;
PlayField16[*si] = 0x300;
*si = *si + 1;
loc_g_668E:
subCopyImageToScreen(*si, aniMurphyTouchUp);
subSoundFXInfotron();
- dx = aniTouchInfotron;
+ dx = aniFramesTouchInfotron;
+ dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x14);
MovHighByte(&PlayField16[*si - FieldWidth], 0xFF);
goto loc_StopNoSplit;
loc_g_66C0:
subCopyImageToScreen(*si, aniMurphyTouchLeft);
subSoundFXInfotron();
- dx = aniTouchInfotron;
+ dx = aniFramesTouchInfotron;
+ dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x15);
MovHighByte(&PlayField16[*si - 1], 0xFF);
goto loc_StopNoSplit;
loc_g_66F2:
subCopyImageToScreen(*si, aniMurphyTouchDown);
subSoundFXInfotron();
- dx = aniTouchInfotron;
+ dx = aniFramesTouchInfotron;
+ dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x16);
MovHighByte(&PlayField16[*si + FieldWidth], 0xFF);
goto loc_StopNoSplit;
loc_g_6724:
subCopyImageToScreen(*si, aniMurphyTouchRight);
subSoundFXInfotron();
- dx = aniTouchInfotron;
+ dx = aniFramesTouchInfotron;
+ dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x17);
MovHighByte(&PlayField16[*si + 1], 0xFF);
goto loc_StopNoSplit;
#endif
LeadOutCounter = 0x40; // quit: start lead-out
- dx = aniMurphyExit;
+ dx = aniFramesMurphyExit;
+ dx1 = aniMurphyExit;
MovHighByte(&PlayField16[*si], 0xD);
goto loc_StopNoSplit;
MovHighByte(&PlayField16[*si - 2], 1);
subCopyImageToScreen(*si, aniPushLeft); // draw pushing murphy
- dx = aniZonkRollLeft;
+ dx = aniFramesZonkRollLeft;
+ dx1 = aniZonkRollLeft;
dxPos = *si - 1;
dx2 = aniPushLeft;
dx2Step = 1;
MovHighByte(&PlayField16[*si + 2], 1);
subCopyImageToScreen(*si, aniPushRight); // draw pushing murphy
- dx = aniZonkRollRight;
+ dx = aniFramesZonkRollRight;
+ dx1 = aniZonkRollRight;
dxPos = *si + 1;
dx2 = aniPushRight;
dx2Step = -1;
if (PlayField16[*si - 2 * FieldWidth] != 0)
return;
- dx = aniSplitUpDown;
+ dx = aniFramesSplitUpDown;
+ dx1 = aniSplitUpDown;
dx2Step = -FieldWidth;
PlayField16[*si] = 0x1803;
PlayField16[*si - 2 * FieldWidth] = 0x300;
if (PlayField16[*si - 2] != 0)
return;
- dx = aniMurphyEatLeft;
+ dx = aniFramesMurphyEatLeft;
+ dx1 = aniMurphyMoveLeft;
dx2Step = -1;
PlayField16[*si] = 0x1903;
PlayField16[*si - 2] = 0x300;
if (PlayField16[*si + 2 * FieldWidth] != 0)
return;
- dx = aniSplitUpDown;
+ dx = aniFramesSplitUpDown;
+ dx1 = aniSplitUpDown;
dx2Step = FieldWidth;
PlayField16[*si] = 0x1A03;
PlayField16[*si + 2 * FieldWidth] = 0x300;
if (PlayField16[*si + 2] != 0)
return;
- dx = aniMurphyEatRight;
+ dx = aniFramesMurphyEatRight;
+ dx1 = aniMurphyMoveRight;
dx2Step = 1;
PlayField16[*si] = 0x1B03;
PlayField16[*si + 2] = 0x300;
// ==========================================================================
loc_g_69A6:
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si] = 0x1C03;
PlayField16[*si - FieldWidth] = 0x300;
goto loc_StopNoSplit;
// ==========================================================================
loc_g_69CE:
- dx = aniMurphyEatLeft;
+ dx = aniFramesMurphyEatLeft;
+ dx1 = aniMurphyEatLeft;
PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start!
PlayField16[*si - 1] = 0x1D03;
*si = *si - 1;
// ==========================================================================
loc_g_69F7:
- dx = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
+ dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
+ dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si] = 0x1E03;
PlayField16[*si + FieldWidth] = 0x300;
goto loc_StopNoSplit;
// ==========================================================================
loc_g_6A1F:
- // 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:
// ==========================================================================
loc_g_6A48:
- dx = aniTouchRedDisk;
+ dx = aniFramesTouchRedDisk;
+ dx1 = aniTouchRedDisk;
MovHighByte(&PlayField16[*si], 0x20);
MovHighByte(&PlayField16[*si - FieldWidth], 3);
goto loc_StopNoSplit;
// ==========================================================================
loc_g_6A64:
- dx = aniTouchRedDisk;
+ dx = aniFramesTouchRedDisk;
+ dx1 = aniTouchRedDisk;
MovHighByte(&PlayField16[*si], 0x21);
MovHighByte(&PlayField16[*si - 1], 3);
goto loc_StopNoSplit;
// ==========================================================================
loc_g_6A80:
- dx = aniTouchRedDisk;
+ dx = aniFramesTouchRedDisk;
+ dx1 = aniTouchRedDisk;
MovHighByte(&PlayField16[*si], 0x22);
MovHighByte(&PlayField16[*si + FieldWidth], 3);
goto loc_StopNoSplit;
// ==========================================================================
loc_g_6A9C:
- dx = aniTouchRedDisk;
+ dx = aniFramesTouchRedDisk;
+ dx1 = aniTouchRedDisk;
MovHighByte(&PlayField16[*si], 0x23);
MovHighByte(&PlayField16[*si + 1], 3);
return;
PlayField16[*si - 2 * FieldWidth] = 0x1200;
+#if 0
subCopyImageToScreen(*si, aniPushRight);
- dx = aniYellowDisk;
+#endif
+ dx = aniFramesYellowDisk;
+ dx1 = aniYellowDisk;
dxPos = *si - FieldWidth;
+#if 1
+ dx2 = (MurphyVarFaceLeft == 0 ? aniPushRight : aniPushLeft);
+#else
dx2 = aniPushUpDown;
+#endif
dx2Step = FieldWidth;
PlayField16[*si] = 0x2403;
+#if 1
+ subCopyImageToScreen(*si, dx2);
+#endif
goto loc_MoveNoSplit;
// ==========================================================================
PlayField16[*si - 2] = 0x1200;
subCopyImageToScreen(*si, aniPushLeft);
- dx = aniYellowDisk;
+ dx = aniFramesYellowDisk;
+ dx1 = aniYellowDisk;
dxPos = *si - 1;
dx2 = aniPushLeft;
dx2Step = 1;
return;
PlayField16[*si + 2 * FieldWidth] = 0x1200;
+#if 0
subCopyImageToScreen(*si, aniPushRight);
- dx = aniYellowDisk;
+#endif
+ dx = aniFramesYellowDisk;
+ dx1 = aniYellowDisk;
dxPos = *si + FieldWidth;
+#if 1
+ dx2 = (MurphyVarFaceLeft == 0 ? aniPushRight : aniPushLeft);
+#else
dx2 = aniPushUpDown;
+#endif
dx2Step = -FieldWidth;
PlayField16[*si] = 0x2703;
+#if 1
+ subCopyImageToScreen(*si, dx2);
+#endif
goto loc_MoveNoSplit;
// ==========================================================================
PlayField16[*si + 2] = 0x1200;
subCopyImageToScreen(*si, aniPushRight);
- dx = aniYellowDisk;
+ dx = aniFramesYellowDisk;
+ dx1 = aniYellowDisk;
dxPos = *si + 1;
dx2 = aniPushRight;
dx2Step = -1;
PlayField16[*si - 2] = 0x800;
subCopyImageToScreen(*si, aniPushLeft);
- dx = aniOrangeDisk;
+ dx = aniFramesOrangeDisk;
+ dx1 = aniOrangeDisk;
dxPos = *si - 1;
dx2 = aniPushLeft;
dx2Step = 1;
PlayField16[*si + 2] = 0x100;
subCopyImageToScreen(*si, aniPushRight);
- dx = aniOrangeDisk;
+ dx = aniFramesOrangeDisk;
+ dx1 = aniOrangeDisk;
dxPos = *si + 1;
dx2 = aniPushRight;
dx2Step = -1;
// ==========================================================================
loc_g_6C8F:
+
+#if 1
+ if (SeqPos <= 0)
+ dx1SequenceLength = getSequenceLength(dx1);
+#endif
+
if (SplitMoveFlag == 0)
{
// ++++++++++++++++++++++++++
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
StretchedSprites.BltEx(X, Y, dx[Tmp]);
+#endif
#if 1
if (!(dx2 < 0))
#if 1
// (SeqPos iterates from 0 to 7 while pushing)
StretchedSprites.BltImg(X + tDeltaX, Y + tDeltaY, dx2, SeqPos);
+ // printf("::: SeqPos: %d\n", SeqPos);
#else
StretchedSprites.BltEx(X + tDeltaX, Y + tDeltaY, dx2);
#endif
} // loc_g_6D1E:'loc_g_6D28:
SeqPos = SeqPos + 1;
+#if 1
+ if (SeqPos < dx1SequenceLength)
+ return;
+#else
if (dx[SeqPos] > -1)
return;
+#endif
// Follow-up after movement completed 'loc_g_6D35:
MurphyXPos = MurphyXPos + MurphyDX;