X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMurphy.c;h=39826cbc83c81dda90b87693570fca5b4923b1b4;hb=98d421667c21a07ab69dd881f1435c2f595ddd4c;hp=0bc114ff869a72c15d55aa7342bdbe396a824a78;hpb=34e8c8894f9aa655a87577c946c31a3f9b6134c5;p=rocksndiamonds.git diff --git a/src/game_sp/Murphy.c b/src/game_sp/Murphy.c index 0bc114ff..39826cbc 100644 --- a/src/game_sp/Murphy.c +++ b/src/game_sp/Murphy.c @@ -8,17 +8,34 @@ static void subEatRedDisk(int si); static boolean subMoveKillsMurphy(int si, int ax, int bl); -#if 1 - #define LocalStretch (2) #define MurphyZoomFactor (ZoomFactor) -#else -#define LocalStretch (1) -#define MurphyZoomFactor (1) +// Variables that hold information about the animation sequence +static int dx1 = 0; // 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; + + +void SaveEngineSnapshotValues_SP_Murphy(ListNode **buffers) +{ + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(dx1)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(dx2)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyDX)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyDY)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(SeqPos)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ClearPos)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(dxPos)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(dx2Step)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(dx1SequenceLength)); +} -#endif // ========================================================================== // SUBROUTINE @@ -31,17 +48,6 @@ void subAnimateMurphy(int *si) int time1, time2; int tDeltaX, tDeltaY, tPos, Tmp; - // 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); @@ -86,10 +92,6 @@ void subAnimateMurphy(int *si) if (bl != 0) // a key was pressed! goto locKeyPressed5FCF; -#if 0 - printf("::: Murphy.c: !!! %d [%d]\n", DemoKeyCode, GravityFlag); -#endif - RedDiskReleaseFlag = 1; if (ScratchGravity != 0) // gravity pulls & space below?'-> force Space up to down { @@ -97,14 +99,6 @@ void subAnimateMurphy(int *si) goto loc_g_6364; } -#if 1 - -#if 0 - ax = (TimerVar & 3); - if (ax != 0) - return; -#endif - // ------------------------------------------------------------------ // Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter: @@ -185,79 +179,6 @@ void subAnimateMurphy(int *si) // end of YAWN-SLEEP-Sequence -#else - - ax = (TimerVar & 3); - if (ax != 0) - return; - - // ------------------------------------------------------------------ - // Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter: - YawnSleepCounter = YawnSleepCounter + 1; - if (YawnSleepCounter == 4) - { - subCopyFieldToScreen(*si, fiMurphy); // normal grin - return; - } // loc_g_5ECE: - - if (YawnSleepCounter <= 500) // loc_g_5ED7: - return; - - if (YawnSleepCounter <= 522) - { - bx = (YawnSleepCounter - 500) / 2; - subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn! and look depressed afterwards... - return; - } // loc_g_5F00: - - if (YawnSleepCounter <= 1000) - return; - - if (YawnSleepCounter <= 1022) - { - bx = (YawnSleepCounter - 1000) / 2; - subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again! - return; - } // loc_g_5F32: - - if (YawnSleepCounter <= 1600) // loc_g_5F3B: - return; - - if (YawnSleepCounter <= 1622) - { - bx = (YawnSleepCounter - 1600) / 2; - subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again! - third time - return; - } // loc_g_5F64: - - if (YawnSleepCounter > 1654) - return; - - if (PlayField16[*si - 1] == 0) - { - if (PlayField16[*si + 1] == 0) - { - YawnSleepCounter = 36; - return; - - } - else - { - bx = (YawnSleepCounter - 1622) / 16; - subCopyFieldToScreen(*si, aniMurphySleepRight + bx); // go to sleep - return; - } - } // loc_g_5F81: - - bx = (YawnSleepCounter - 1622) / 16; - subCopyFieldToScreen(*si, aniMurphySleepLeft + bx); // go to sleep - - return; - - // end of YAWN-SLEEP-Sequence - -#endif - // ------------------------------------------------------------------ // ========================================================================== // (Direct Jump) a key was pressed @@ -667,7 +588,6 @@ loc_g_62E2: MovHighByte(&PlayField16[*si], 0x2A); MovingPictureSequencePhase = 0x40; // init picture move sequence - dx = aniFramesRedDisk; dx1 = aniRedDisk; MovLowByte(&RedDiskReleasePhase, 1); RedDiskReleaseMurphyPos = *si; // remember Murphy's location @@ -678,7 +598,6 @@ loc_g_62E2: // ========================================================================== loc_g_6312: - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft); PlayField16[*si - FieldWidth] = 0x103; PlayField16[*si] = 0x300; @@ -690,7 +609,6 @@ loc_g_6312: // ========================================================================== loc_g_6341: - dx = aniFramesMurphyEatLeft; dx1 = aniMurphyMoveLeft; PlayField16[*si - 1] = 0x203; PlayField16[*si] = 0x300; @@ -702,7 +620,6 @@ loc_g_6341: // ========================================================================== loc_g_6364: - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft); PlayField16[*si + FieldWidth] = 0x303; PlayField16[*si] = 0x300; @@ -714,7 +631,6 @@ loc_g_6364: // ========================================================================== loc_g_6399: - dx = aniFramesMurphyEatRight; dx1 = aniMurphyMoveRight; PlayField16[*si + 1] = 0x403; PlayField16[*si] = 0x300; @@ -739,13 +655,8 @@ loc_g_63C2: // ========================================================================== loc_g_63D3: -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft); PlayField16[*si - FieldWidth] = 0x503; PlayField16[*si] = 0x300; @@ -770,13 +681,8 @@ loc_g_640B: // ========================================================================== loc_g_641C: -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesMurphyEatLeft; dx1 = aniMurphyDigLeft; PlayField16[*si - 1] = 0x203; PlayField16[*si] = 0x300; @@ -801,13 +707,8 @@ loc_g_6448: // ========================================================================== loc_g_6459: -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft); PlayField16[*si + FieldWidth] = 0x703; PlayField16[*si] = 0x300; @@ -832,13 +733,8 @@ loc_g_6491: // ========================================================================== loc_g_64A2: -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesMurphyEatRight; dx1 = aniMurphyDigRight; PlayField16[*si + 1] = 0x803; PlayField16[*si] = 0x300; @@ -864,13 +760,8 @@ loc_g_64CE: loc_g_64DF: subCopyImageToScreen(*si, aniMurphyTouchUp); -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesTouchBase; dx1 = aniTouchBase; dxPos = *si - FieldWidth; MovHighByte(&PlayField16[*si], 0x10); @@ -895,13 +786,8 @@ loc_g_650C: loc_g_651D: subCopyImageToScreen(*si, aniMurphyTouchLeft); -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesTouchBase; dx1 = aniTouchBase; dxPos = *si - 1; MovHighByte(&PlayField16[*si], 0x11); @@ -926,13 +812,8 @@ loc_g_654A: loc_g_655B: subCopyImageToScreen(*si, aniMurphyTouchDown); -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesTouchBase; dx1 = aniTouchBase; dxPos = *si + FieldWidth; MovHighByte(&PlayField16[*si], 0x12); @@ -957,13 +838,8 @@ loc_g_6588: loc_g_6599: subCopyImageToScreen(*si, aniMurphyTouchRight); -#if 1 subSoundFX(*si, fiBase, actDigging); -#else - subSoundFXBase(); -#endif - dx = aniFramesTouchBase; dx1 = aniTouchBase; dxPos = *si + 1; MovHighByte(&PlayField16[*si], 0x13); @@ -974,13 +850,8 @@ loc_g_6599: // ========================================================================== loc_g_65C6: -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft); PlayField16[*si - FieldWidth] = 0x903; PlayField16[*si] = 0x300; @@ -992,19 +863,9 @@ loc_g_65C6: // ========================================================================== loc_g_65FE: -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesEatInfotronLeft; dx1 = aniEatInfotronLeft; -#if 0 - dx2 = fiInfotron; - dx2Step = -1; - ClearPos = -1; -#endif PlayField16[*si - 1] = 0xA03; PlayField16[*si] = 0x300; *si = *si - 1; @@ -1015,13 +876,8 @@ loc_g_65FE: // ========================================================================== loc_g_662A: -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft); PlayField16[*si + FieldWidth] = 0xB03; PlayField16[*si] = 0x300; @@ -1033,19 +889,9 @@ loc_g_662A: // ========================================================================== loc_g_6662: -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesEatInfotronRight; dx1 = aniEatInfotronRight; -#if 0 - dx2 = fiInfotron; - dx2Step = 1; - ClearPos = -1; -#endif PlayField16[*si + 1] = 0xC03; PlayField16[*si] = 0x300; *si = *si + 1; @@ -1057,13 +903,8 @@ loc_g_6662: loc_g_668E: subCopyImageToScreen(*si, aniMurphyTouchUp); -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesTouchInfotron; dx1 = aniTouchInfotron; MovHighByte(&PlayField16[*si], 0x14); MovHighByte(&PlayField16[*si - FieldWidth], 0xFF); @@ -1075,13 +916,8 @@ loc_g_668E: loc_g_66C0: subCopyImageToScreen(*si, aniMurphyTouchLeft); -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesTouchInfotron; dx1 = aniTouchInfotron; MovHighByte(&PlayField16[*si], 0x15); MovHighByte(&PlayField16[*si - 1], 0xFF); @@ -1093,13 +929,8 @@ loc_g_66C0: loc_g_66F2: subCopyImageToScreen(*si, aniMurphyTouchDown); -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesTouchInfotron; dx1 = aniTouchInfotron; MovHighByte(&PlayField16[*si], 0x16); MovHighByte(&PlayField16[*si + FieldWidth], 0xFF); @@ -1111,13 +942,8 @@ loc_g_66F2: loc_g_6724: subCopyImageToScreen(*si, aniMurphyTouchRight); -#if 1 subSoundFX(*si, fiInfotron, actCollecting); -#else - subSoundFXInfotron(); -#endif - dx = aniFramesTouchInfotron; dx1 = aniTouchInfotron; MovHighByte(&PlayField16[*si], 0x17); MovHighByte(&PlayField16[*si + 1], 0xFF); @@ -1136,38 +962,11 @@ loc_g_6756: if (LowByte(InfotronsNeeded) != 0) return; -#if 1 - if (!game_sp.LevelSolved) - printf("::: Murphy.c: !!!!!!!!!! LEVEL %d SOLVED !!!!!!!!!!\n",LevelNumber); -#endif - -#if 1 - game_sp.LevelSolved = TRUE; -#endif + game_sp.level_solved = TRUE; -#if 1 subSoundFX(*si, fiExit, actPassing); -#else - subSoundFXExit(); -#endif - - data_h_DemoDone = 1; // EP set level success bytes - LevelStatus = 1; // set Level Status DONE - EP_GameDemoVar0DAA = 0; // force demo for lead-out - if (SavedGameFlag == 0) // saved game running? - { - if (UpdateTimeFlag != 0) // update time? - { - UpdatedFlag = 1; // prevent double update - } - } - -#if 0 - subUpdateHallOfFame(); // update time + Hall-Of-Fame -#endif LeadOutCounter = 0x40; // quit: start lead-out - dx = aniFramesMurphyExit; dx1 = aniMurphyExit; MovHighByte(&PlayField16[*si], 0xD); goto loc_StopNoSplit; @@ -1183,7 +982,6 @@ loc_g_679B: MovHighByte(&PlayField16[*si - 2], 1); subCopyImageToScreen(*si, aniPushLeft); // draw pushing murphy - dx = aniFramesZonkRollLeft; dx1 = aniZonkRollLeft; dxPos = *si - 1; dx2 = aniPushLeft; @@ -1206,7 +1004,6 @@ loc_g_67D4: MovHighByte(&PlayField16[*si + 2], 1); subCopyImageToScreen(*si, aniPushRight); // draw pushing murphy - dx = aniFramesZonkRollRight; dx1 = aniZonkRollRight; dxPos = *si + 1; dx2 = aniPushRight; @@ -1227,16 +1024,8 @@ loc_g_6817: return; } // loc_g_6838: -#if 1 // draw new terminal type -#if 1 GfxGraphic[GetX(*si - FieldWidth)][GetY(*si - FieldWidth)] = aniTerminalActive; -#else - subCopyImageToScreen(*si - FieldWidth, aniTerminalActive); -#endif -#else - subCopyFieldToScreen(*si - FieldWidth, 0x88); // draw new terminal type -#endif TerminalState[*si - FieldWidth] = 8; goto loc_g_68F0; @@ -1253,16 +1042,8 @@ loc_g_684E: return; } // loc_g_6838: -#if 1 // draw new terminal type -#if 1 GfxGraphic[GetX(*si - 1)][GetY(*si - 1)] = aniTerminalActive; -#else - subCopyImageToScreen(*si - 1, aniTerminalActive); -#endif -#else - subCopyFieldToScreen(*si - 1, 0x88); // draw new terminal type -#endif TerminalState[*si - 1] = 8; goto loc_g_68F0; @@ -1279,16 +1060,8 @@ loc_g_6884: return; } // loc_g_6838: -#if 1 // draw new terminal type -#if 1 GfxGraphic[GetX(*si + FieldWidth)][GetY(*si + FieldWidth)] = aniTerminalActive; -#else - subCopyImageToScreen(*si + FieldWidth, aniTerminalActive); -#endif -#else - subCopyFieldToScreen(*si + FieldWidth, 0x88); // draw new terminal type -#endif TerminalState[*si + FieldWidth] = 8; goto loc_g_68F0; @@ -1305,16 +1078,8 @@ loc_g_68BA: return; } // loc_g_6838: -#if 1 // draw new terminal type -#if 1 GfxGraphic[GetX(*si + 1)][GetY(*si + 1)] = aniTerminalActive; -#else - subCopyImageToScreen(*si + 1, aniTerminalActive); -#endif -#else - subCopyFieldToScreen(*si + 1, 0x88); // draw new terminal type -#endif TerminalState[*si + 1] = 8; // ========================================================================== // common TERMINAL stuff moving/touching from all directions @@ -1339,7 +1104,6 @@ loc_g_6916: if (PlayField16[*si - 2 * FieldWidth] != 0) return; - dx = aniFramesSplitUpDown; dx1 = aniSplitUpDown; dx2Step = -FieldWidth; PlayField16[*si] = 0x1803; @@ -1354,7 +1118,6 @@ loc_g_693A: if (PlayField16[*si - 2] != 0) return; - dx = aniFramesMurphyEatLeft; dx1 = aniMurphyMoveLeft; dx2Step = -1; PlayField16[*si] = 0x1903; @@ -1369,7 +1132,6 @@ loc_g_695E: if (PlayField16[*si + 2 * FieldWidth] != 0) return; - dx = aniFramesSplitUpDown; dx1 = aniSplitUpDown; dx2Step = FieldWidth; PlayField16[*si] = 0x1A03; @@ -1384,7 +1146,6 @@ loc_g_6982: if (PlayField16[*si + 2] != 0) return; - dx = aniFramesMurphyEatRight; dx1 = aniMurphyMoveRight; dx2Step = 1; PlayField16[*si] = 0x1B03; @@ -1400,7 +1161,6 @@ loc_StopSplit: // ========================================================================== loc_g_69A6: - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft); PlayField16[*si] = 0x1C03; PlayField16[*si - FieldWidth] = 0x300; @@ -1411,7 +1171,6 @@ loc_g_69A6: // ========================================================================== loc_g_69CE: - dx = aniFramesMurphyEatLeft; dx1 = aniMurphyEatLeft; PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start! PlayField16[*si - 1] = 0x1D03; @@ -1423,7 +1182,6 @@ loc_g_69CE: // ========================================================================== loc_g_69F7: - dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft); dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft); PlayField16[*si] = 0x1E03; PlayField16[*si + FieldWidth] = 0x300; @@ -1434,8 +1192,7 @@ loc_g_69F7: // ========================================================================== loc_g_6A1F: - // dx = aniFramesMurphyEatRightRedDisk 'this sequence is 9 steps long! - dx = aniFramesMurphyEatRight; + // dx = aniMurphyEatRightRedDisk 'this sequence is 9 steps long! dx1 = aniMurphyEatRight; // -------------------------------------------------------------------------- // BugFix @@ -1448,13 +1205,8 @@ loc_g_6A1F: // Remember that this is not the real bug-fix, but we must live with // this existing bug and correct for the consequences of it. -#if 1 - if (0 == AllowEatRightRedDiskBug) // Murphy's screen x-position + if (AllowEatRightRedDiskBug == 0) // Murphy's screen x-position MurphyScreenXPos = MurphyScreenXPos - 2 * MurphyZoomFactor; -#else - if (0 == AllowEatRightRedDiskBug) // Murphy's screen x-position - MurphyScreenXPos = MurphyScreenXPos - 2; -#endif SeqPos = -1; // FS: for me this means to blit the first animation frame twice @@ -1470,7 +1222,6 @@ loc_g_6A1F: // ========================================================================== loc_g_6A48: - dx = aniFramesTouchRedDisk; dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x20); MovHighByte(&PlayField16[*si - FieldWidth], 3); @@ -1481,7 +1232,6 @@ loc_g_6A48: // ========================================================================== loc_g_6A64: - dx = aniFramesTouchRedDisk; dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x21); MovHighByte(&PlayField16[*si - 1], 3); @@ -1492,7 +1242,6 @@ loc_g_6A64: // ========================================================================== loc_g_6A80: - dx = aniFramesTouchRedDisk; dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x22); MovHighByte(&PlayField16[*si + FieldWidth], 3); @@ -1503,7 +1252,6 @@ loc_g_6A80: // ========================================================================== loc_g_6A9C: - dx = aniFramesTouchRedDisk; dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x23); MovHighByte(&PlayField16[*si + 1], 3); @@ -1521,22 +1269,12 @@ loc_g_6AB8: return; PlayField16[*si - 2 * FieldWidth] = 0x1200; -#if 0 - subCopyImageToScreen(*si, aniPushRight); -#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; // ========================================================================== @@ -1549,7 +1287,6 @@ loc_g_6AF1: PlayField16[*si - 2] = 0x1200; subCopyImageToScreen(*si, aniPushLeft); - dx = aniFramesYellowDisk; dx1 = aniYellowDisk; dxPos = *si - 1; dx2 = aniPushLeft; @@ -1566,22 +1303,12 @@ loc_g_6B2A: return; PlayField16[*si + 2 * FieldWidth] = 0x1200; -#if 0 - subCopyImageToScreen(*si, aniPushRight); -#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; // ========================================================================== @@ -1594,7 +1321,6 @@ loc_g_6B63: PlayField16[*si + 2] = 0x1200; subCopyImageToScreen(*si, aniPushRight); - dx = aniFramesYellowDisk; dx1 = aniYellowDisk; dxPos = *si + 1; dx2 = aniPushRight; @@ -1612,7 +1338,6 @@ loc_g_6B9B: PlayField16[*si - 2] = 0x800; subCopyImageToScreen(*si, aniPushLeft); - dx = aniFramesOrangeDisk; dx1 = aniOrangeDisk; dxPos = *si - 1; dx2 = aniPushLeft; @@ -1633,7 +1358,6 @@ loc_g_6BD3: PlayField16[*si + 2] = 0x100; subCopyImageToScreen(*si, aniPushRight); - dx = aniFramesOrangeDisk; dx1 = aniOrangeDisk; dxPos = *si + 1; dx2 = aniPushRight; @@ -1667,7 +1391,6 @@ locProceedMovingMurphy: // proceed moving murphy MovingPictureSequencePhase = ax; // store for later if (ax == 0) // Sound effects -#if 1 { switch (HighByte(PlayField16[*si])) { @@ -1692,9 +1415,6 @@ locProceedMovingMurphy: // proceed moving murphy break; } } -#else - subSoundFXPush(); -#endif bl = HighByte(PlayField16[*si]); if (bl == 0xE) // Push Zonk to left @@ -1732,119 +1452,41 @@ locProceedMovingMurphy: // proceed moving murphy loc_g_6C8F: -#if 1 if (SeqPos <= 0) dx1SequenceLength = getSequenceLength(dx1); -#endif if (SplitMoveFlag == 0) { // ++++++++++++++++++++++++++ // Begin of normal movement -#if 1 MurphyScreenXPos = MurphyScreenXPos + MurphyDX * MurphyZoomFactor; MurphyScreenYPos = MurphyScreenYPos + MurphyDY * MurphyZoomFactor; -#else - MurphyScreenXPos = MurphyScreenXPos + MurphyDX; - MurphyScreenYPos = MurphyScreenYPos + MurphyDY; -#endif - - -#if 0 - printf("::: %04d [%03ld, %02d] ----------> %s [%d] [%d, %d] [%d, %d] [%d]\n", - TimerVar, - DemoOffset - DemoPointer, DemoKeyRepeatCounter, - (DemoKeyCode == keyNone ? "(none)" : - DemoKeyCode == keyLeft ? "left" : - DemoKeyCode == keyRight ? "right" : - DemoKeyCode == keyUp ? "up" : - DemoKeyCode == keyDown ? "down" : - DemoKeyCode == keySpace ? "space" : - DemoKeyCode == keySpaceLeft ? "space + left" : - DemoKeyCode == keySpaceRight ? "space + right" : - DemoKeyCode == keySpaceUp ? "space + up" : - DemoKeyCode == keySpaceDown ? "space + down" : "(unknown)"), - DemoKeyCode, - MurphyScreenXPos, MurphyScreenYPos, - MurphyPosIndex % 60, MurphyPosIndex / 60, - ClearPos); -#endif - -#if 0 - Delay(500); -#endif - -#if 1 + if (!(ClearPos < 0)) // clear field that murphy is leaving subCopyImageToScreen(ClearPos, aniSpace); -#else - if (! ClearPos < 0) // clear field that murphy is leaving - subCopyFieldToScreen(ClearPos, 0); -#endif - -#if 0 - printf("::: ---------------> %d, %d [%d, %d]\n", - MurphyScreenXPos, MurphyScreenYPos, MurphyDX, MurphyDY); -#endif - -#if 0 - // !!! special two-tile animation currently not used !!! - if (dx2 == fiInfotron) // special case of infotron moving left or right - { - tDeltaX = 0; - tDeltaY = 0; - } - else -#endif - { - tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1); - tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1); - } + + tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1); + tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1); 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); + DDSpriteBuffer_BltImg(X, Y, dx1, Tmp); GfxGraphic[GetX(*si)][GetY(*si)] = -1; // (Murphy's position) GfxGraphic[GetX(dxPos)][GetY(dxPos)] = -1; // (snapping position) - // printf("::: Tmp: %d\n", Tmp); -#else - StretchedSprites.BltEx(X, Y, dx[Tmp]); -#endif -#if 1 if (!(dx2 < 0)) -#else - if (! dx2 < 0) -#endif { tPos = dxPos + dx2Step; X = GetStretchX(tPos); Y = GetStretchY(tPos); -#if 0 - // !!! special two-tile animation currently not used !!! - if (dx2 == fiInfotron) // special case of infotron moving left or right - { - StretchedSprites.BltEx(X, Y, dx[SeqPos] + dx2Step); - } - else // pushing something -#endif - { -#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 - } + + // (SeqPos iterates from 0 to 7 while pushing) + DDSpriteBuffer_BltImg(X + tDeltaX, Y + tDeltaY, dx2, SeqPos); } // End of normal movement @@ -1854,45 +1496,27 @@ loc_g_6C8F: { // ++++++++++++++++++++++++++++++++ // Begin of split movement (port) -#if 1 MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX * MurphyZoomFactor; MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY * MurphyZoomFactor; -#else - MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX; - MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY; -#endif subCopyImageToScreen(ClearPos, aniSpace); // clear the field that murphy leaves tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1); tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1); X = GetStretchX(dxPos) + tDeltaX; Y = GetStretchY(dxPos) + tDeltaY; -#if 1 - StretchedSprites.BltImg(X, Y, dx1, SeqPos); // plot first murphy -#else - StretchedSprites.BltEx(X, Y, dx[SeqPos]); // plot first murphy -#endif + DDSpriteBuffer_BltImg(X, Y, dx1, SeqPos); // plot first murphy + tPos = dxPos + dx2Step; X = GetStretchX(tPos); Y = GetStretchY(tPos); -#if 1 - StretchedSprites.BltImg(X + tDeltaX, Y + tDeltaY, dx1, SeqPos); // plot second murphy - StretchedSprites.BltImg(X, Y, fiGraphic[LowByte(PlayField16[tPos])], 0); // replot the port on top -#else - StretchedSprites.BltEx(X + tDeltaX, Y + tDeltaY, dx[SeqPos]); // plot second murphy - StretchedSprites.BltEx(X, Y, LowByte(PlayField16[tPos])); // replot the port on top -#endif + DDSpriteBuffer_BltImg(X + tDeltaX, Y + tDeltaY, dx1, SeqPos); // plot second murphy + DDSpriteBuffer_BltImg(X, Y, fiGraphic[LowByte(PlayField16[tPos])], 0); // replot the port on top // End of split movement (port) // ------------------------------ } // 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; @@ -2181,9 +1805,7 @@ loc_g_6F3B: loc_g_6F77: ExitToMenuFlag = 1; -#if 1 PlayField16[*si] = fiSpace; // remove Murphy from playfield after exiting -#endif return; @@ -2336,12 +1958,8 @@ loc_g_716E: } else if (MovingPictureSequencePhase == 0x20) { -#if 1 // anxious murphy, dropping red disk subCopyImageToScreen(*si, aniMurphyDropping); -#else - subCopyFieldToScreen(*si, 43); // anxious murphy -#endif RedDiskReleasePhase = 1; } @@ -2619,11 +2237,7 @@ loc_g_747F: RedDiskReleasePhase = 2; RedDiskCount = RedDiskCount - 1; -#if 1 subSoundFX(*si, fiRedDisk, actDropping); -#else - subSoundFXPush(); // Sound effects -#endif } // subAnimateMurphy // ========================================================================== @@ -2720,76 +2334,24 @@ loc_g_753F: // The 10-port data base is at data_h_0D28, 10 entries of 6 bytes each: // (hi),(lo),(gravity),(freeze zonks),(freeze enemies),(unused) // ========================================================================== -int subSpPortTest(int si) -{ - int subSpPortTest; - int i, cx, bx; - -#if 1 - cx = LInfo.SpecialPortCount; // number of special ports +void subSpPortTest(int si) +{ + int i; - for (i = 0; i < cx; i++) + for (i = 0; i < LInfo.SpecialPortCount; i++) { -#if 1 - /* this assumes that PortLocation is stored as big endian */ - bx = LInfo.SpecialPort[i].PortLocation; -#else - /* this assumes that PortLocation is stored as little endian */ - bx = HighByte(LInfo.SpecialPort[i].PortLocation); - MovHighByte(&bx, LowByte(LInfo.SpecialPort[i].PortLocation)); -#endif - - if (bx / 2 == si) + if (LInfo.SpecialPort[i].PortLocation / 2 == si) { - GravityFlag = LInfo.SpecialPort[i].Gravity; - FreezeZonks = LInfo.SpecialPort[i].FreezeZonks; + GravityFlag = LInfo.SpecialPort[i].Gravity; + FreezeZonks = LInfo.SpecialPort[i].FreezeZonks; SnikSnaksElectronsFrozen = LInfo.SpecialPort[i].FreezeEnemies; - // RandomTime = RandomTime Xor RandomSeed 'is RandomTime used at all? no! - break; } } - -#else - - cx = LInfo.SpecialPortCount; // number of special ports - for (i = 1; i <= cx; i++) - { - { - bx = HighByte(LInfo.SpecialPort[i].PortLocation); - MovHighByte(&bx, LowByte(LInfo.SpecialPort[i].PortLocation)); - if (bx / 2 == si) - { - GravityFlag = LInfo.SpecialPort[i].Gravity; - FreezeZonks = LInfo.SpecialPort[i].FreezeZonks; - SnikSnaksElectronsFrozen = LInfo.SpecialPort[i].FreezeEnemies; - // RandomTime = RandomTime Xor RandomSeed 'is RandomTime used at all? no! - i = cx + 1; - } - } - } -#endif - - return subSpPortTest; -} // subSpPortTest - -#if 0 - -void subCopyFieldToScreen(int si, int fi) -{ - int X, Y; - - // +++++++++++++++++++++++++++++++++++++++++ - X = GetStretchX(si); - Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, fi); - // +++++++++++++++++++++++++++++++++++++++++ } -#endif - void subCopyAnimToScreen(int si, int graphic, int sync_frame) { int X, Y; @@ -2797,7 +2359,7 @@ void subCopyAnimToScreen(int si, int graphic, int sync_frame) // +++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltImg(X, Y, graphic, sync_frame); + DDSpriteBuffer_BltImg(X, Y, graphic, sync_frame); // +++++++++++++++++++++++++++++++++++++++++ } @@ -2867,4 +2429,4 @@ loc_g_15E8: // zonk/infotron above right MovHighByte(&PlayField16[si - FieldWidth + 1], 0x50); // make roll left PlayField16[si - FieldWidth] = 0x8888; } -} // subAdjustZonksInfotronsAboveMurphy +}