1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
8 static void subEatRedDisk(int si);
9 static boolean subMoveKillsMurphy(int si, int ax, int bl);
13 #define LocalStretch (2)
14 #define MurphyZoomFactor (ZoomFactor)
18 #define LocalStretch (1)
19 #define MurphyZoomFactor (1)
23 // ==========================================================================
25 // Move Murphy in any direction
26 // ==========================================================================
28 void subAnimateMurphy(int *si)
30 int ax, al, bl, i, X, Y;
32 int tDeltaX, tDeltaY, tPos, Tmp;
34 // Variables that hold information about the animation sequence
35 static int dx1 = 0; // image/animation token
36 static int dx2 = 0; // an additional image position of a second sprite, for instance: yellow disk if pushed
37 static int MurphyDX = 0, MurphyDY = 0; // murphys move steps
38 static int SeqPos = 0; // index into dx()
39 static int ClearPos = 0; // Position to clear before blitting sprites, none=-1
40 static int dxPos = 0; // field-position to draw dx(SeqPos)
41 static int dx2Step = 0; // position of dx2 relative to dx-position
42 static int dx1SequenceLength = 0;
44 ax = PlayField16[*si];
49 MurphyMoveCounter = 0; // We have no Murphy! Exit!
54 MurphyMoveCounter = 1; // We have a Murphy!
55 MurphyExplodePos = *si;
57 // (check if high byte of PlayField16 has stored movement information)
58 if (ax != fiMurphy) // yes--go proceed moving murphy?
59 goto locProceedMovingMurphy;
61 // FS: reset moving sequence variables
71 ScratchGravity = 0; // scratch gravity off
72 if (GravityFlag != 0) // Gravity? (1=gravity on)
74 bl = LowByte(PlayField16[*si - FieldWidth]); // check above
75 if (! (bl == fiPortUp ||
76 bl == fiPortUpAndDown ||
77 bl == fiPortAllDirections))
79 if (PlayField16[*si + FieldWidth] == 0) // gravity on and space below!
85 if (bl != 0) // a key was pressed!
86 goto locKeyPressed5FCF;
88 RedDiskReleaseFlag = 1;
89 if (ScratchGravity != 0) // gravity pulls & space below?'-> force Space up to down
103 // ------------------------------------------------------------------
104 // Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter:
106 YawnSleepCounter = YawnSleepCounter + 1;
108 if (YawnSleepCounter < 16)
111 if (YawnSleepCounter < 2000)
114 // (default: single graphic, no animation)
115 subCopyAnimToScreen(*si, aniMurphy, YawnSleepCounter - 16);
120 if (YawnSleepCounter < 4000)
122 // yawn! and look depressed afterwards...
123 // (default: 12 animation frames with delay of 8)
124 subCopyAnimToScreen(*si, aniMurphyYawn, YawnSleepCounter - 2000);
129 if (YawnSleepCounter < 6400)
132 // (default: 12 animation frames with delay of 8)
133 subCopyAnimToScreen(*si, aniMurphyYawn, YawnSleepCounter - 4000);
138 // time1 = 6400 + 12 * 8; // (default: 6496 == 6400 + 12 * 8)
139 time1 = 6400 + 12 * 10;
141 if (YawnSleepCounter < time1)
143 // yawn again! - third time
144 // (default: 12 animation frames with delay of 8)
145 subCopyAnimToScreen(*si, aniMurphyYawn, YawnSleepCounter - 6400);
150 // time2 = 6496 + 3 * 64; // (default: 6688 == 6496 + 3 * 64)
151 time2 = 6496 + 3 * 100;
153 if (YawnSleepCounter > time2) // Murphy already went to sleep
156 if (PlayField16[*si - 1] == 0)
158 if (PlayField16[*si + 1] == 0)
160 // no sleep -- go back to "wait and start yawning" phase
161 YawnSleepCounter = 144;
167 // go to sleep (right side)
168 // (default: 3 animation frames with delay of 64)
169 subCopyAnimToScreen(*si, aniMurphySleepRight, YawnSleepCounter - time1);
175 // go to sleep (left side)
176 // (default: 3 animation frames with delay of 64)
177 subCopyAnimToScreen(*si, aniMurphySleepLeft, YawnSleepCounter - time1);
181 // end of YAWN-SLEEP-Sequence
189 // ------------------------------------------------------------------
190 // Murphy's YAWN & SLEEP sequence, counted down by YawnSleepCounter:
191 YawnSleepCounter = YawnSleepCounter + 1;
192 if (YawnSleepCounter == 4)
194 subCopyFieldToScreen(*si, fiMurphy); // normal grin
198 if (YawnSleepCounter <= 500) // loc_g_5ED7:
201 if (YawnSleepCounter <= 522)
203 bx = (YawnSleepCounter - 500) / 2;
204 subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn! and look depressed afterwards...
208 if (YawnSleepCounter <= 1000)
211 if (YawnSleepCounter <= 1022)
213 bx = (YawnSleepCounter - 1000) / 2;
214 subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again!
218 if (YawnSleepCounter <= 1600) // loc_g_5F3B:
221 if (YawnSleepCounter <= 1622)
223 bx = (YawnSleepCounter - 1600) / 2;
224 subCopyFieldToScreen(*si, aniMurphyYawn + bx); // yawn again! - third time
228 if (YawnSleepCounter > 1654)
231 if (PlayField16[*si - 1] == 0)
233 if (PlayField16[*si + 1] == 0)
235 YawnSleepCounter = 36;
241 bx = (YawnSleepCounter - 1622) / 16;
242 subCopyFieldToScreen(*si, aniMurphySleepRight + bx); // go to sleep
247 bx = (YawnSleepCounter - 1622) / 16;
248 subCopyFieldToScreen(*si, aniMurphySleepLeft + bx); // go to sleep
252 // end of YAWN-SLEEP-Sequence
256 // ------------------------------------------------------------------
257 // ==========================================================================
258 // (Direct Jump) a key was pressed
259 // ==========================================================================
262 if (ScratchGravity == 0)
265 if (PlayField16[*si + FieldWidth] != 0)
270 if (PlayField16[*si - FieldWidth] == fiBase)
274 else if (bl == keyLeft)
276 if (PlayField16[*si - 1] == fiBase)
280 else if (bl == keyRight)
282 if (PlayField16[*si + 1] == fiBase)
286 bl = keyDown; // force moving down!
291 RedDiskReleaseFlag = 0; // moving down to up ...
297 RedDiskReleaseFlag = 0; // moving right to left ...
303 RedDiskReleaseFlag = 0; // moving up to down ...
309 RedDiskReleaseFlag = 0; // moving left to right ...
314 case keySpaceUp: // 5
315 RedDiskReleaseFlag = 0; // touching down to up ...
320 case keySpaceLeft: // 6
321 RedDiskReleaseFlag = 0; // touching right to left ...
326 case keySpaceDown: // 7
327 RedDiskReleaseFlag = 0; // touching up to down ...
332 case keySpaceRight: // 8
333 RedDiskReleaseFlag = 0; // touching left to right ...
339 goto loc_g_62E2; // no move ...
344 RedDiskReleaseFlag = 0;
349 // ==========================================================================
350 // moving down to up ...
351 // ==========================================================================
357 ax = PlayField16[*si - FieldWidth];
368 if (ax == fiInfotron)
374 if (al == fiTerminal)
377 if (al == fiPortUp || al == fiPortUpAndDown || al == fiPortAllDirections)
383 if (al == fiYellowDisk)
386 if (! subMoveKillsMurphy(*si - FieldWidth, ax, bl))
391 // ==========================================================================
392 // moving right to left ...
393 // ==========================================================================
399 MurphyVarFaceLeft = 1;
400 ax = PlayField16[*si - 1];
411 if (ax == fiInfotron)
420 if (al == fiTerminal)
423 if (al == fiPortLeft || al == fiPortLeftAndRight || al == fiPortAllDirections)
429 if (ax == fiYellowDisk)
432 if (ax == fiOrangeDisk)
435 if (! subMoveKillsMurphy(*si - 1, ax, bl))
440 // ==========================================================================
441 // moving up to down ...
442 // ==========================================================================
448 ax = PlayField16[*si + FieldWidth];
459 if (ax == fiInfotron)
465 if (al == fiTerminal)
468 if (al == fiPortDown || al == fiPortUpAndDown || al == fiPortAllDirections)
474 if (al == fiYellowDisk)
477 if (! subMoveKillsMurphy(*si + FieldWidth, ax, bl))
482 // ==========================================================================
483 // moving left to right ...
484 // ==========================================================================
490 MurphyVarFaceLeft = 0;
491 ax = PlayField16[*si + 1];
502 if (ax == fiInfotron)
511 if (al == fiTerminal)
514 if (al == fiPortRight || al == fiPortLeftAndRight || al == fiPortAllDirections)
520 if (al == fiYellowDisk)
523 if (ax == fiOrangeDisk)
526 if (! subMoveKillsMurphy(*si + 1, ax, bl))
531 // ==========================================================================
532 // touching down to up ...
533 // ==========================================================================
538 dxPos = *si - FieldWidth;
540 ax = PlayField16[*si - FieldWidth];
549 if (ax == fiInfotron)
552 if (al == fiTerminal)
560 // ==========================================================================
561 // touching right to left ...
562 // ==========================================================================
569 MurphyVarFaceLeft = 1;
570 ax = PlayField16[*si - 1];
578 if (ax == fiInfotron)
581 if (al == fiTerminal)
589 // ==========================================================================
590 // touching up to down ...
591 // ==========================================================================
596 dxPos = *si + FieldWidth;
598 ax = PlayField16[*si + FieldWidth];
606 if (ax == fiInfotron)
609 if (al == fiTerminal)
617 // ==========================================================================
618 // touching left to right ...
619 // ==========================================================================
626 MurphyVarFaceLeft = 0;
627 ax = PlayField16[*si + 1];
635 if (ax == fiInfotron)
638 if (al == fiTerminal)
646 // ==========================================================================
647 // Release Red disk: no move ...
648 // ==========================================================================
654 if (LowByte(RedDiskCount) == 0)
657 if (LowByte(RedDiskReleasePhase) != 0)
660 if (LowByte(RedDiskReleaseFlag) != 1)
663 MovHighByte(&PlayField16[*si], 0x2A);
664 MovingPictureSequencePhase = 0x40; // init picture move sequence
666 MovLowByte(&RedDiskReleasePhase, 1);
667 RedDiskReleaseMurphyPos = *si; // remember Murphy's location
670 // ==========================================================================
671 // SPACE moving down to up
672 // ==========================================================================
675 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft);
676 PlayField16[*si - FieldWidth] = 0x103;
677 PlayField16[*si] = 0x300;
678 *si = *si - FieldWidth;
679 goto loc_StopNoSplit;
681 // ==========================================================================
682 // SPACE moving right to left
683 // ==========================================================================
686 dx1 = aniMurphyMoveLeft;
687 PlayField16[*si - 1] = 0x203;
688 PlayField16[*si] = 0x300;
690 goto loc_StopNoSplit;
692 // ==========================================================================
693 // SPACE moving up to down, and when gravity is pulling!
694 // ==========================================================================
697 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyMoveUpRight : aniMurphyMoveUpLeft);
698 PlayField16[*si + FieldWidth] = 0x303;
699 PlayField16[*si] = 0x300;
700 *si = *si + FieldWidth;
701 goto loc_StopNoSplit;
703 // ==========================================================================
704 // SPACE moving left to right
705 // ==========================================================================
708 dx1 = aniMurphyMoveRight;
709 PlayField16[*si + 1] = 0x403;
710 PlayField16[*si] = 0x300;
712 goto loc_StopNoSplit;
714 // ==========================================================================
715 // BUG moving down to up
716 // ==========================================================================
719 if (SgnHighByte(PlayField16[*si - FieldWidth]) >= 0)
721 ExplodeFieldSP(*si); // Explode
726 PlayField16[*si - FieldWidth] = fiBase;
727 // ==========================================================================
728 // BASE moving down to up
729 // ==========================================================================
732 subSoundFX(*si, fiBase, actDigging);
734 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
735 PlayField16[*si - FieldWidth] = 0x503;
736 PlayField16[*si] = 0x300;
737 *si = *si - FieldWidth;
738 goto loc_StopNoSplit;
740 // ==========================================================================
741 // BUG moving right to left
742 // ==========================================================================
745 if (SgnHighByte(PlayField16[*si - 1]) >= 0)
747 ExplodeFieldSP(*si); // Explode
752 PlayField16[*si - 1] = fiBase;
753 // ==========================================================================
754 // BASE moving right to left
755 // ==========================================================================
758 subSoundFX(*si, fiBase, actDigging);
760 dx1 = aniMurphyDigLeft;
761 PlayField16[*si - 1] = 0x203;
762 PlayField16[*si] = 0x300;
764 goto loc_StopNoSplit;
766 // ==========================================================================
767 // BUG moving up to down
768 // ==========================================================================
771 if (SgnHighByte(PlayField16[*si + FieldWidth]) >= 0)
773 ExplodeFieldSP(*si); // Explode
778 PlayField16[*si + FieldWidth] = fiBase;
779 // ==========================================================================
780 // BASE moving up to down
781 // ==========================================================================
784 subSoundFX(*si, fiBase, actDigging);
786 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
787 PlayField16[*si + FieldWidth] = 0x703;
788 PlayField16[*si] = 0x300;
789 *si = *si + FieldWidth;
790 goto loc_StopNoSplit;
792 // ==========================================================================
793 // BUG moving left to right
794 // ==========================================================================
797 if (SgnHighByte(PlayField16[*si + 1]) >= 0)
799 ExplodeFieldSP(*si); // Explode
804 PlayField16[*si + 1] = fiBase;
805 // ==========================================================================
806 // BASE moving left to right
807 // ==========================================================================
810 subSoundFX(*si, fiBase, actDigging);
812 dx1 = aniMurphyDigRight;
813 PlayField16[*si + 1] = 0x803;
814 PlayField16[*si] = 0x300;
816 goto loc_StopNoSplit;
818 // ==========================================================================
819 // BUG touching down to up
820 // ==========================================================================
823 if (SgnHighByte(PlayField16[*si - FieldWidth]) >= 0)
825 ExplodeFieldSP(*si); // Explode
830 PlayField16[*si - FieldWidth] = fiBase;
831 // ==========================================================================
832 // BASE touching down to up
833 // ==========================================================================
836 subCopyImageToScreen(*si, aniMurphyTouchUp);
837 subSoundFX(*si, fiBase, actDigging);
840 dxPos = *si - FieldWidth;
841 MovHighByte(&PlayField16[*si], 0x10);
842 goto loc_StopNoSplit;
844 // ==========================================================================
845 // BUG touching right to left
846 // ==========================================================================
849 if (SgnHighByte(PlayField16[*si - 1]) >= 0)
851 ExplodeFieldSP(*si); // Explode
856 PlayField16[*si - 1] = fiBase;
857 // ==========================================================================
858 // BASE touching right to left
859 // ==========================================================================
862 subCopyImageToScreen(*si, aniMurphyTouchLeft);
863 subSoundFX(*si, fiBase, actDigging);
867 MovHighByte(&PlayField16[*si], 0x11);
868 goto loc_StopNoSplit;
870 // ==========================================================================
871 // BUG touching up to down
872 // ==========================================================================
875 if (SgnHighByte(PlayField16[*si + FieldWidth]) >= 0)
877 ExplodeFieldSP(*si); // Explode
882 PlayField16[*si + FieldWidth] = fiBase;
883 // ==========================================================================
884 // BASE touching up to down
885 // ==========================================================================
888 subCopyImageToScreen(*si, aniMurphyTouchDown);
889 subSoundFX(*si, fiBase, actDigging);
892 dxPos = *si + FieldWidth;
893 MovHighByte(&PlayField16[*si], 0x12);
894 goto loc_StopNoSplit;
896 // ==========================================================================
897 // BUG touching left to right
898 // ==========================================================================
901 if (SgnHighByte(PlayField16[*si + 1]) >= 0)
903 ExplodeFieldSP(*si); // Explode
908 PlayField16[*si + 1] = fiBase;
909 // ==========================================================================
910 // BASE touching left to right
911 // ==========================================================================
914 subCopyImageToScreen(*si, aniMurphyTouchRight);
915 subSoundFX(*si, fiBase, actDigging);
919 MovHighByte(&PlayField16[*si], 0x13);
920 goto loc_StopNoSplit;
922 // ==========================================================================
923 // INFOTRON moving down to up
924 // ==========================================================================
927 subSoundFX(*si, fiInfotron, actCollecting);
929 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
930 PlayField16[*si - FieldWidth] = 0x903;
931 PlayField16[*si] = 0x300;
932 *si = *si - FieldWidth;
933 goto loc_StopNoSplit;
935 // ==========================================================================
936 // INFOTRON moving right to left
937 // ==========================================================================
940 subSoundFX(*si, fiInfotron, actCollecting);
942 dx1 = aniEatInfotronLeft;
948 PlayField16[*si - 1] = 0xA03;
949 PlayField16[*si] = 0x300;
951 goto loc_StopNoSplit;
953 // ==========================================================================
954 // INFOTRON moving up to down
955 // ==========================================================================
958 subSoundFX(*si, fiInfotron, actCollecting);
960 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
961 PlayField16[*si + FieldWidth] = 0xB03;
962 PlayField16[*si] = 0x300;
963 *si = *si + FieldWidth;
964 goto loc_StopNoSplit;
966 // ==========================================================================
967 // INFOTRON moving left to right
968 // ==========================================================================
971 subSoundFX(*si, fiInfotron, actCollecting);
973 dx1 = aniEatInfotronRight;
979 PlayField16[*si + 1] = 0xC03;
980 PlayField16[*si] = 0x300;
982 goto loc_StopNoSplit;
984 // ==========================================================================
985 // INFOTRON touching down to up
986 // ==========================================================================
989 subCopyImageToScreen(*si, aniMurphyTouchUp);
990 subSoundFX(*si, fiInfotron, actCollecting);
992 dx1 = aniTouchInfotron;
993 MovHighByte(&PlayField16[*si], 0x14);
994 MovHighByte(&PlayField16[*si - FieldWidth], 0xFF);
995 goto loc_StopNoSplit;
997 // ==========================================================================
998 // INFOTRON touching right to left
999 // ==========================================================================
1002 subCopyImageToScreen(*si, aniMurphyTouchLeft);
1003 subSoundFX(*si, fiInfotron, actCollecting);
1005 dx1 = aniTouchInfotron;
1006 MovHighByte(&PlayField16[*si], 0x15);
1007 MovHighByte(&PlayField16[*si - 1], 0xFF);
1008 goto loc_StopNoSplit;
1010 // ==========================================================================
1011 // INFOTRON touching up to down
1012 // ==========================================================================
1015 subCopyImageToScreen(*si, aniMurphyTouchDown);
1016 subSoundFX(*si, fiInfotron, actCollecting);
1018 dx1 = aniTouchInfotron;
1019 MovHighByte(&PlayField16[*si], 0x16);
1020 MovHighByte(&PlayField16[*si + FieldWidth], 0xFF);
1021 goto loc_StopNoSplit;
1023 // ==========================================================================
1024 // INFOTRON touching left to right
1025 // ==========================================================================
1028 subCopyImageToScreen(*si, aniMurphyTouchRight);
1029 subSoundFX(*si, fiInfotron, actCollecting);
1031 dx1 = aniTouchInfotron;
1032 MovHighByte(&PlayField16[*si], 0x17);
1033 MovHighByte(&PlayField16[*si + 1], 0xFF);
1034 goto loc_StopNoSplit;
1036 // ==========================================================================
1037 // EXIT pressed from any direction
1038 // ==========================================================================
1046 if (LowByte(InfotronsNeeded) != 0)
1050 if (!game_sp.LevelSolved)
1051 printf("::: Murphy.c: !!!!!!!!!! LEVEL %d SOLVED !!!!!!!!!!\n", level_nr);
1055 game_sp.LevelSolved = TRUE;
1058 subSoundFX(*si, fiExit, actPassing);
1060 LeadOutCounter = 0x40; // quit: start lead-out
1061 dx1 = aniMurphyExit;
1062 MovHighByte(&PlayField16[*si], 0xD);
1063 goto loc_StopNoSplit;
1065 // ==========================================================================
1066 // ZONK moving right to left
1067 // ==========================================================================
1070 ax = PlayField16[*si - 2];
1074 MovHighByte(&PlayField16[*si - 2], 1);
1075 subCopyImageToScreen(*si, aniPushLeft); // draw pushing murphy
1076 dx1 = aniZonkRollLeft;
1080 MovHighByte(&PlayField16[*si], 0xE);
1081 goto loc_MoveNoSplit;
1083 // ==========================================================================
1084 // ZONK moving left to right
1085 // ==========================================================================
1088 ax = PlayField16[*si + 2];
1092 ax = PlayField16[*si + FieldWidth + 1];
1093 if (ax == 0) // zonk falls
1096 MovHighByte(&PlayField16[*si + 2], 1);
1097 subCopyImageToScreen(*si, aniPushRight); // draw pushing murphy
1098 dx1 = aniZonkRollRight;
1102 MovHighByte(&PlayField16[*si], 0xF);
1103 goto loc_MoveNoSplit;
1105 // ==========================================================================
1106 // TERMINAL moving/touching down to up
1107 // ==========================================================================
1110 subCopyImageToScreen(*si, aniMurphyTouchUp);
1111 if (YellowDisksExploded != 0)
1113 YawnSleepCounter = 40; // stay hypnotized
1119 // draw new terminal type
1121 GfxGraphic[GetX(*si - FieldWidth)][GetY(*si - FieldWidth)] = aniTerminalActive;
1123 subCopyImageToScreen(*si - FieldWidth, aniTerminalActive);
1126 subCopyFieldToScreen(*si - FieldWidth, 0x88); // draw new terminal type
1128 TerminalState[*si - FieldWidth] = 8;
1131 // ==========================================================================
1132 // TERMINAL moving/touching right to left
1133 // ==========================================================================
1136 subCopyImageToScreen(*si, aniMurphyTouchLeft);
1137 if (YellowDisksExploded != 0)
1139 YawnSleepCounter = 40; // stay hypnotized
1145 // draw new terminal type
1147 GfxGraphic[GetX(*si - 1)][GetY(*si - 1)] = aniTerminalActive;
1149 subCopyImageToScreen(*si - 1, aniTerminalActive);
1152 subCopyFieldToScreen(*si - 1, 0x88); // draw new terminal type
1154 TerminalState[*si - 1] = 8;
1157 // ==========================================================================
1158 // TERMINAL moving/touching up to down
1159 // ==========================================================================
1162 subCopyImageToScreen(*si, aniMurphyTouchDown);
1163 if (YellowDisksExploded != 0)
1165 YawnSleepCounter = 40; // stay hypnotized
1171 // draw new terminal type
1173 GfxGraphic[GetX(*si + FieldWidth)][GetY(*si + FieldWidth)] = aniTerminalActive;
1175 subCopyImageToScreen(*si + FieldWidth, aniTerminalActive);
1178 subCopyFieldToScreen(*si + FieldWidth, 0x88); // draw new terminal type
1180 TerminalState[*si + FieldWidth] = 8;
1183 // ==========================================================================
1184 // TERMINAL moving/touching left to right
1185 // ==========================================================================
1188 subCopyImageToScreen(*si, aniMurphyTouchRight);
1189 if (YellowDisksExploded != 0)
1191 YawnSleepCounter = 40; // stay hypnotized
1197 // draw new terminal type
1199 GfxGraphic[GetX(*si + 1)][GetY(*si + 1)] = aniTerminalActive;
1201 subCopyImageToScreen(*si + 1, aniTerminalActive);
1204 subCopyFieldToScreen(*si + 1, 0x88); // draw new terminal type
1206 TerminalState[*si + 1] = 8;
1207 // ==========================================================================
1208 // common TERMINAL stuff moving/touching from all directions
1209 // ==========================================================================
1212 TerminalMaxCycles = 7;
1213 YellowDisksExploded = 1;
1214 for (i = 0; i <= LevelMax; i++)
1216 if (PlayField16[i] == fiYellowDisk)
1222 // ==========================================================================
1223 // PORT down to up, VERTICAL PORT, CROSS PORT all moving down to up
1224 // ==========================================================================
1227 if (PlayField16[*si - 2 * FieldWidth] != 0)
1230 dx1 = aniSplitUpDown;
1231 dx2Step = -FieldWidth;
1232 PlayField16[*si] = 0x1803;
1233 PlayField16[*si - 2 * FieldWidth] = 0x300;
1236 // ==========================================================================
1237 // PORT right to left, HORIZONTAL PORT, CROSS PORT all moving right to left
1238 // ==========================================================================
1241 if (PlayField16[*si - 2] != 0)
1244 dx1 = aniMurphyMoveLeft;
1246 PlayField16[*si] = 0x1903;
1247 PlayField16[*si - 2] = 0x300;
1250 // ==========================================================================
1251 // PORT up to down, VERTICAL PORT, CROSS PORT all moving up to down
1252 // ==========================================================================
1255 if (PlayField16[*si + 2 * FieldWidth] != 0)
1258 dx1 = aniSplitUpDown;
1259 dx2Step = FieldWidth;
1260 PlayField16[*si] = 0x1A03;
1261 PlayField16[*si + 2 * FieldWidth] = 0x300;
1264 // ==========================================================================
1265 // PORT left to right, HORIZONTAL PORT, CROSS PORT all moving left to right
1266 // ==========================================================================
1269 if (PlayField16[*si + 2] != 0)
1272 dx1 = aniMurphyMoveRight;
1274 PlayField16[*si] = 0x1B03;
1275 PlayField16[*si + 2] = 0x300;
1278 MovingPictureSequencePhase = 0; // stop picture move sequence
1279 SplitMoveFlag = 1; // port: split movement
1282 // ==========================================================================
1283 // RED DISK moving down to up
1284 // ==========================================================================
1287 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
1288 PlayField16[*si] = 0x1C03;
1289 PlayField16[*si - FieldWidth] = 0x300;
1290 goto loc_StopNoSplit;
1292 // ==========================================================================
1293 // RED DISK moving right to left
1294 // ==========================================================================
1297 dx1 = aniMurphyEatLeft;
1298 PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start!
1299 PlayField16[*si - 1] = 0x1D03;
1301 goto loc_StopNoSplit;
1303 // ==========================================================================
1304 // RED DISK moving up to down
1305 // ==========================================================================
1308 dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
1309 PlayField16[*si] = 0x1E03;
1310 PlayField16[*si + FieldWidth] = 0x300;
1311 goto loc_StopNoSplit;
1313 // ==========================================================================
1314 // RED DISK moving left to right
1315 // ==========================================================================
1318 // dx = aniMurphyEatRightRedDisk 'this sequence is 9 steps long!
1319 dx1 = aniMurphyEatRight;
1320 // --------------------------------------------------------------------------
1322 // Table data_h_145A, pointed to by table data_h_105E, has a severe bug:
1323 // The Red Disk sequence is 8 pictures long, but 9 are displayed, because it
1324 // has 1 extra entry, which causes Murphy to end slightly shifted to the left!
1325 // We may not fix the table, because then the timing of the game changes
1326 // and several existing demo's do not run properly anymore.
1327 // We only correct Murphies x-location here, when the sequence starts.
1328 // Remember that this is not the real bug-fix, but we must live with
1329 // this existing bug and correct for the consequences of it.
1331 if (AllowEatRightRedDiskBug == 0) // Murphy's screen x-position
1332 MurphyScreenXPos = MurphyScreenXPos - 2 * MurphyZoomFactor;
1335 // FS: for me this means to blit the first animation frame twice
1337 // --------------------------------------------------------------------------
1338 PlayField16[*si] = 0x300; // !!!!!! this time we move murphy at sequence-start!
1339 PlayField16[*si + 1] = 0x1F03;
1341 goto loc_StopNoSplit;
1343 // ==========================================================================
1344 // RED DISK touching down to up
1345 // ==========================================================================
1348 dx1 = aniTouchRedDisk;
1349 MovHighByte(&PlayField16[*si], 0x20);
1350 MovHighByte(&PlayField16[*si - FieldWidth], 3);
1351 goto loc_StopNoSplit;
1353 // ==========================================================================
1354 // RED DISK touching right to left
1355 // ==========================================================================
1358 dx1 = aniTouchRedDisk;
1359 MovHighByte(&PlayField16[*si], 0x21);
1360 MovHighByte(&PlayField16[*si - 1], 3);
1361 goto loc_StopNoSplit;
1363 // ==========================================================================
1364 // RED DISK touching up to down
1365 // ==========================================================================
1368 dx1 = aniTouchRedDisk;
1369 MovHighByte(&PlayField16[*si], 0x22);
1370 MovHighByte(&PlayField16[*si + FieldWidth], 3);
1371 goto loc_StopNoSplit;
1373 // ==========================================================================
1374 // RED DISK touching left to right
1375 // ==========================================================================
1378 dx1 = aniTouchRedDisk;
1379 MovHighByte(&PlayField16[*si], 0x23);
1380 MovHighByte(&PlayField16[*si + 1], 3);
1383 MovingPictureSequencePhase = 0; // stop picture move sequence
1386 // ==========================================================================
1387 // YELLOW DISK moving down to up
1388 // ==========================================================================
1391 if (PlayField16[*si - 2 * FieldWidth] != 0)
1394 PlayField16[*si - 2 * FieldWidth] = 0x1200;
1395 dx1 = aniYellowDisk;
1396 dxPos = *si - FieldWidth;
1397 dx2 = (MurphyVarFaceLeft == 0 ? aniPushRight : aniPushLeft);
1398 dx2Step = FieldWidth;
1399 PlayField16[*si] = 0x2403;
1400 subCopyImageToScreen(*si, dx2);
1401 goto loc_MoveNoSplit;
1403 // ==========================================================================
1404 // YELLOW DISK moving right to left
1405 // ==========================================================================
1408 if (PlayField16[*si - 2] != 0)
1411 PlayField16[*si - 2] = 0x1200;
1412 subCopyImageToScreen(*si, aniPushLeft);
1413 dx1 = aniYellowDisk;
1417 PlayField16[*si] = 0x2503;
1418 goto loc_MoveNoSplit;
1420 // ==========================================================================
1421 // YELLOW DISK moving up to down
1422 // ==========================================================================
1425 if (PlayField16[*si + 2 * FieldWidth] != 0)
1428 PlayField16[*si + 2 * FieldWidth] = 0x1200;
1429 dx1 = aniYellowDisk;
1430 dxPos = *si + FieldWidth;
1431 dx2 = (MurphyVarFaceLeft == 0 ? aniPushRight : aniPushLeft);
1432 dx2Step = -FieldWidth;
1433 PlayField16[*si] = 0x2703;
1434 subCopyImageToScreen(*si, dx2);
1435 goto loc_MoveNoSplit;
1437 // ==========================================================================
1438 // YELLOW DISK moving left to right
1439 // ==========================================================================
1442 if (PlayField16[*si + 2] != 0)
1445 PlayField16[*si + 2] = 0x1200;
1446 subCopyImageToScreen(*si, aniPushRight);
1447 dx1 = aniYellowDisk;
1451 PlayField16[*si] = 0x2603;
1452 goto loc_MoveNoSplit;
1454 // ==========================================================================
1455 // ORANGE DISK moving right to left
1456 // ==========================================================================
1459 if (PlayField16[*si - 2] != 0)
1462 PlayField16[*si - 2] = 0x800;
1463 subCopyImageToScreen(*si, aniPushLeft);
1464 dx1 = aniOrangeDisk;
1468 PlayField16[*si] = 0x2803;
1469 goto loc_MoveNoSplit;
1471 // ==========================================================================
1472 // ORANGE DISK moving left to right
1473 // ==========================================================================
1476 if (PlayField16[*si + 2] != 0)
1479 if (PlayField16[*si + FieldWidth + 1] == 0) // falling goes before pushing
1482 PlayField16[*si + 2] = 0x100;
1483 subCopyImageToScreen(*si, aniPushRight);
1484 dx1 = aniOrangeDisk;
1488 PlayField16[*si] = 0x2903;
1489 // ==========================================================================
1490 // Copy screen animation action table to action work space
1491 // (To paint sequence: Push Zonk/Disk / release red disk / Port passing)
1492 // ==========================================================================
1495 MovingPictureSequencePhase = 8; // init picture move sequence
1498 SplitMoveFlag = 0; // no port: no split movement
1501 // copy/store global move sequence info????????????????????????????????????
1502 // ... dont think so ...(FS)
1503 // ==========================================================================
1504 // Proceed with all movements
1505 // ==========================================================================
1507 locProceedMovingMurphy: // proceed moving murphy
1508 YawnSleepCounter = 0; // Wake up sleeping Murphy
1509 ax = MovingPictureSequencePhase; // sequence busy?
1510 if (ax == 0) // no -- start sequence!
1513 ax = ax - 1; // next picture of sequence
1514 MovingPictureSequencePhase = ax; // store for later
1516 if (ax == 0) // Sound effects
1518 switch (HighByte(PlayField16[*si]))
1522 subSoundFX(*si, fiZonk, actPushing);
1527 subSoundFX(*si, fiOrangeDisk, actPushing);
1534 subSoundFX(*si, fiYellowDisk, actPushing);
1542 bl = HighByte(PlayField16[*si]);
1543 if (bl == 0xE) // Push Zonk to left
1546 if (bl == 0xF) // Push Zonk to right
1549 if (bl == 0x28) // Push orange disk to left
1552 if (bl == 0x29) // Push orange disk to right
1555 if (bl == 0x24) // Push yellow disk up
1558 if (bl == 0x25) // Push yellow disk to left
1561 if (bl == 0x27) // Push yellow disk down
1564 if (bl == 0x26) // Push yellow disk to right
1567 if (bl == 0x2A) // Red disk release timer
1572 // ==========================================================================
1573 // Paint frame of MOVING.DAT sequence
1574 // ==========================================================================
1580 dx1SequenceLength = getSequenceLength(dx1);
1583 if (SplitMoveFlag == 0)
1585 // ++++++++++++++++++++++++++
1586 // Begin of normal movement
1587 MurphyScreenXPos = MurphyScreenXPos + MurphyDX * MurphyZoomFactor;
1588 MurphyScreenYPos = MurphyScreenYPos + MurphyDY * MurphyZoomFactor;
1590 if (!(ClearPos < 0)) // clear field that murphy is leaving
1591 subCopyImageToScreen(ClearPos, aniSpace);
1594 // !!! special two-tile animation currently not used !!!
1595 if (dx2 == fiInfotron) // special case of infotron moving left or right
1603 tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1);
1604 tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1);
1607 X = GetStretchX(dxPos) + tDeltaX;
1608 Y = GetStretchY(dxPos) + tDeltaY;
1609 Tmp = (SeqPos < 0 ? 0 : SeqPos); // 9StepBugFix!(red disk move right)
1612 if (isSnappingSequence(dx1) && SeqPos == dx1SequenceLength - 1)
1617 DDSpriteBuffer_BltImg(X, Y, dx1, Tmp);
1618 GfxGraphic[GetX(*si)][GetY(*si)] = -1; // (Murphy's position)
1619 GfxGraphic[GetX(dxPos)][GetY(dxPos)] = -1; // (snapping position)
1620 // printf("::: Tmp: %d\n", Tmp);
1622 StretchedSprites.BltEx(X, Y, dx[Tmp]);
1627 tPos = dxPos + dx2Step;
1628 X = GetStretchX(tPos);
1629 Y = GetStretchY(tPos);
1631 // !!! special two-tile animation currently not used !!!
1632 if (dx2 == fiInfotron) // special case of infotron moving left or right
1634 StretchedSprites.BltEx(X, Y, dx[SeqPos] + dx2Step);
1636 else // pushing something
1639 // (SeqPos iterates from 0 to 7 while pushing)
1640 DDSpriteBuffer_BltImg(X + tDeltaX, Y + tDeltaY, dx2, SeqPos);
1644 // End of normal movement
1645 // ------------------------
1649 // ++++++++++++++++++++++++++++++++
1650 // Begin of split movement (port)
1651 MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX * MurphyZoomFactor;
1652 MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY * MurphyZoomFactor;
1653 subCopyImageToScreen(ClearPos, aniSpace); // clear the field that murphy leaves
1654 tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1);
1655 tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1);
1656 X = GetStretchX(dxPos) + tDeltaX;
1657 Y = GetStretchY(dxPos) + tDeltaY;
1658 DDSpriteBuffer_BltImg(X, Y, dx1, SeqPos); // plot first murphy
1660 tPos = dxPos + dx2Step;
1661 X = GetStretchX(tPos);
1662 Y = GetStretchY(tPos);
1663 DDSpriteBuffer_BltImg(X + tDeltaX, Y + tDeltaY, dx1, SeqPos); // plot second murphy
1664 DDSpriteBuffer_BltImg(X, Y, fiGraphic[LowByte(PlayField16[tPos])], 0); // replot the port on top
1665 // End of split movement (port)
1666 // ------------------------------
1667 } // loc_g_6D1E:'loc_g_6D28:
1669 SeqPos = SeqPos + 1;
1671 if (SeqPos < dx1SequenceLength)
1674 if (dx[SeqPos] > -1)
1678 // Follow-up after movement completed 'loc_g_6D35:
1679 MurphyXPos = MurphyXPos + MurphyDX;
1680 MurphyYPos = MurphyYPos + MurphyDY;
1681 bl = HighByte(PlayField16[*si]); // animation phase
1682 MovHighByte(&PlayField16[*si], 0);
1684 if (bl == 0x1) // space, moving up
1687 if (bl == 0x2) // space, moving left
1690 if (bl == 0x3) // space, moving down
1693 if (bl == 0x4) // space, moving right
1696 if (bl == 0x5) // base , moving up
1699 if (bl == 0x6) // base , moving left -> 6 is not used, value is set to 2 instead of 6!
1702 if (bl == 0x7) // base , moving down
1705 if (bl == 0x8) // base , moving right
1708 if (bl == 0x9) // infotron, moving up
1711 if (bl == 0xA) // infotron, moving left
1714 if (bl == 0xB) // infotron, moving down
1717 if (bl == 0xC) // infotron, moving right
1720 if (bl == 0xD) // exit
1723 if (bl == 0xE) // zonk, pushing left
1726 if (bl == 0xF) // zonk, pushing right
1729 if (bl == 0x10) // base , touching up
1732 if (bl == 0x11) // base , touching left
1735 if (bl == 0x12) // base , touching down
1738 if (bl == 0x13) // base , touching right
1741 if (bl == 0x14) // infotron touching up
1744 if (bl == 0x15) // infotron touching left
1747 if (bl == 0x16) // infotron touching down
1750 if (bl == 0x17) // infotron touching right
1753 if (bl == 0x18) // port up
1756 if (bl == 0x19) // port left
1759 if (bl == 0x1A) // port down
1762 if (bl == 0x1B) // port right
1765 if (bl == 0x1C) // red disk, moving up
1768 if (bl == 0x1D) // red disk, moving left
1771 if (bl == 0x1E) // red disk, moving down
1774 if (bl == 0x1F) // red disk, moving right -> 9-Step-Bug!
1777 if (bl == 0x20) // red disk, touching up
1780 if (bl == 0x21) // red disk, touching left
1783 if (bl == 0x22) // red disk, touching down
1786 if (bl == 0x23) // red disk, touching right
1789 if (bl == 0x24) // yellow disk, pushing up
1792 if (bl == 0x25) // yellow disk, pushing left
1795 if (bl == 0x26) // yellow disk, pushing right -> order of "down" exchanged with "right"!
1798 if (bl == 0x27) // yellow disk, pushing down -> order of "down" exchanged with "right"!
1801 if (bl == 0x28) // orange disk, pushing left
1804 if (bl == 0x29) // orange disk, pushing right
1807 if (bl == 0x2A) // red disk, release
1814 // ==========================================================================
1815 // infotron, moving up
1816 // ==========================================================================
1819 if (0 < LowByte(InfotronsNeeded))
1820 InfotronsNeeded = InfotronsNeeded - 1;
1822 loc_g_6EC8: // space, base
1823 PlayField16[*si] = fiMurphy;
1824 subAdjustZonksInfotronsAboveMurphy(*si + FieldWidth);
1828 // ==========================================================================
1829 // infotron, moving left
1830 // ==========================================================================
1833 if (0 < LowByte(InfotronsNeeded))
1834 InfotronsNeeded = InfotronsNeeded - 1;
1836 loc_g_6EE6: // space, base
1837 PlayField16[*si] = fiMurphy;
1838 subAdjustZonksInfotronsAboveMurphy(*si + 1);
1842 // ==========================================================================
1843 // infotron, moving down
1844 // ==========================================================================
1847 if (0 < LowByte(InfotronsNeeded))
1848 InfotronsNeeded = InfotronsNeeded - 1;
1850 loc_g_6F04: // space, base
1851 if (LowByte(PlayField16[*si - FieldWidth]) != fiExplosion)
1852 PlayField16[*si - FieldWidth] = 0;
1854 PlayField16[*si] = fiMurphy;
1858 // ==========================================================================
1859 // infotron, moving right
1860 // ==========================================================================
1863 if (0 < LowByte(InfotronsNeeded))
1864 InfotronsNeeded = InfotronsNeeded - 1;
1866 loc_g_71C4: // space, base
1867 subAdjustZonksInfotronsAboveMurphy(*si - 1);
1868 PlayField16[*si] = fiMurphy;
1872 // ==========================================================================
1873 // infotron, touching up
1874 // ==========================================================================
1877 if (0 < LowByte(InfotronsNeeded))
1878 InfotronsNeeded = InfotronsNeeded - 1;
1881 if (LowByte(PlayField16[*si - FieldWidth]) != fiExplosion)
1882 PlayField16[*si - FieldWidth] = 0;
1886 // ==========================================================================
1887 // infotron, touching left
1888 // ==========================================================================
1891 if (0 < LowByte(InfotronsNeeded))
1892 InfotronsNeeded = InfotronsNeeded - 1;
1895 if (LowByte(PlayField16[*si - 1]) != fiExplosion)
1896 PlayField16[*si - 1] = 0;
1900 // ==========================================================================
1901 // infotron, touching down
1902 // ==========================================================================
1905 if (0 < LowByte(InfotronsNeeded))
1906 InfotronsNeeded = InfotronsNeeded - 1;
1909 if (LowByte(PlayField16[*si + FieldWidth]) != fiExplosion)
1910 PlayField16[*si + FieldWidth] = 0;
1914 // ==========================================================================
1915 // infotron, touching right
1916 // ==========================================================================
1919 if (0 < LowByte(InfotronsNeeded))
1920 InfotronsNeeded = InfotronsNeeded - 1;
1923 if (LowByte(PlayField16[*si + 1]) != fiExplosion)
1924 PlayField16[*si + 1] = 0;
1928 // ==========================================================================
1929 // zonk, pushing left
1930 // ==========================================================================
1933 if (LowByte(PlayField16[*si]) != fiExplosion)
1934 PlayField16[*si] = 0;
1936 PlayField16[*si - 1] = fiMurphy;
1937 PlayField16[*si - 2] = fiZonk;
1938 subExplodeSnikSnaksBelow(*si - 2);
1943 // ==========================================================================
1944 // zonk, pushing right
1945 // ==========================================================================
1948 if (LowByte(PlayField16[*si]) != fiExplosion)
1949 PlayField16[*si] = 0;
1951 PlayField16[*si + 1] = fiMurphy;
1952 PlayField16[*si + 2] = fiZonk;
1953 subExplodeSnikSnaksBelow(*si + 2);
1958 // ==========================================================================
1960 // ==========================================================================
1966 PlayField16[*si] = fiSpace; // remove Murphy from playfield after exiting
1971 // ==========================================================================
1972 // Push Zonk from right to left
1973 // ==========================================================================
1976 if (DemoKeyCode == keyLeft && PlayField16[*si - 1] == fiZonk)
1979 PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
1980 PlayField16[*si - 1] = fiZonk;
1981 if (LowByte(PlayField16[*si - 2]) != fiExplosion)
1982 PlayField16[*si - 2] = 0;
1984 subCopyImageToScreen(*si, aniMurphy);
1988 // ==========================================================================
1989 // Push Zonk from left to right
1990 // ==========================================================================
1993 if (DemoKeyCode == keyRight && PlayField16[*si + 1] == fiZonk)
1996 PlayField16[*si] = fiMurphy; // else restore - no more zonk pushing!
1997 PlayField16[*si + 1] = fiZonk;
1998 if (LowByte(PlayField16[*si + 2]) != fiExplosion)
1999 PlayField16[*si + 2] = 0;
2001 subCopyImageToScreen(*si, aniMurphy);
2005 // ==========================================================================
2006 // Push orange disk from right to left
2007 // ==========================================================================
2010 if (DemoKeyCode == keyLeft && PlayField16[*si - 1] == fiOrangeDisk)
2013 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2014 PlayField16[*si - 1] = fiOrangeDisk;
2015 if (LowByte(PlayField16[*si - 2]) != fiExplosion)
2016 PlayField16[*si - 2] = 0;
2018 subCopyImageToScreen(*si, aniMurphy);
2022 // ==========================================================================
2023 // Push orange disk from left to right
2024 // ==========================================================================
2027 if (DemoKeyCode == keyRight && PlayField16[*si + 1] == fiOrangeDisk)
2030 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2031 PlayField16[*si + 1] = fiOrangeDisk;
2032 if (LowByte(PlayField16[*si + 2]) != fiExplosion)
2033 PlayField16[*si + 2] = 0;
2035 subCopyImageToScreen(*si, aniMurphy);
2039 // ==========================================================================
2040 // Push yellow disk from down to up
2041 // ==========================================================================
2044 if (DemoKeyCode == keyUp && PlayField16[*si - FieldWidth] == fiYellowDisk)
2047 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2048 PlayField16[*si - FieldWidth] = fiYellowDisk;
2049 if (LowByte(PlayField16[*si - 2 * FieldWidth]) != fiExplosion)
2050 PlayField16[*si - 2 * FieldWidth] = 0;
2052 subCopyImageToScreen(*si, aniMurphy);
2056 // ==========================================================================
2057 // Push yellow disk from right to left
2058 // ==========================================================================
2061 if (DemoKeyCode == keyLeft && PlayField16[*si - 1] == fiYellowDisk)
2064 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2065 PlayField16[*si - 1] = fiYellowDisk;
2066 if (LowByte(PlayField16[*si - 2]) != fiExplosion)
2067 PlayField16[*si - 2] = 0;
2069 subCopyImageToScreen(*si, aniMurphy);
2073 // ==========================================================================
2074 // Push yellow disk from up to down
2075 // ==========================================================================
2078 if (DemoKeyCode == keyDown && PlayField16[*si + FieldWidth] == fiYellowDisk)
2081 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2082 PlayField16[*si + FieldWidth] = fiYellowDisk;
2083 if (LowByte(PlayField16[*si + 2 * FieldWidth]) != fiExplosion)
2084 PlayField16[*si + 2 * FieldWidth] = 0;
2086 subCopyImageToScreen(*si, aniMurphy);
2090 // ==========================================================================
2091 // Push yellow disk from left to right
2092 // ==========================================================================
2095 if (DemoKeyCode == keyRight && PlayField16[*si + 1] == fiYellowDisk)
2098 PlayField16[*si] = fiMurphy; // else restore - no more pushing!
2099 PlayField16[*si + 1] = fiYellowDisk;
2100 if (LowByte(PlayField16[*si + 2]) != fiExplosion)
2101 PlayField16[*si + 2] = 0;
2103 subCopyImageToScreen(*si, aniMurphy);
2107 // ==========================================================================
2108 // time red disk release (space)
2109 // ==========================================================================
2112 if (DemoKeyCode != keySpace)
2114 PlayField16[*si] = fiMurphy;
2115 subCopyImageToScreen(*si, aniMurphy);
2116 RedDiskReleasePhase = 0;
2118 else if (MovingPictureSequencePhase == 0x20)
2120 // anxious murphy, dropping red disk
2121 subCopyImageToScreen(*si, aniMurphyDropping);
2122 RedDiskReleasePhase = 1;
2127 // ==========================================================================
2128 // Special port down to up
2129 // ==========================================================================
2132 if (LowByte(PlayField16[*si]) != fiExplosion)
2133 PlayField16[*si] = 0;
2135 PlayField16[*si - 2 * FieldWidth] = fiMurphy;
2137 *si = *si - FieldWidth;
2138 if (HighByte(PlayField16[*si]) == 1)
2141 *si = *si - FieldWidth;
2145 // ==========================================================================
2146 // Special port right to left
2147 // ==========================================================================
2150 if (LowByte(PlayField16[*si]) != fiExplosion)
2151 PlayField16[*si] = 0;
2153 PlayField16[*si - 2] = fiMurphy;
2156 if (HighByte(PlayField16[*si]) == 1)
2163 // ==========================================================================
2164 // Special port up to down
2165 // ==========================================================================
2168 if (LowByte(PlayField16[*si]) != fiExplosion)
2169 PlayField16[*si] = 0;
2171 PlayField16[*si + 2 * FieldWidth] = fiMurphy;
2173 *si = *si + FieldWidth;
2174 if (HighByte(PlayField16[*si]) == 1)
2177 *si = *si + FieldWidth;
2181 // ==========================================================================
2182 // Special port left to right
2183 // ==========================================================================
2186 if (LowByte(PlayField16[*si]) != fiExplosion)
2187 PlayField16[*si] = 0;
2189 PlayField16[*si + 2] = fiMurphy;
2192 if (HighByte(PlayField16[*si]) == 1)
2199 // ==========================================================================
2201 // ==========================================================================
2204 if (LowByte(PlayField16[*si]) != fiExplosion)
2205 PlayField16[*si] = 0;
2207 *si = *si - FieldWidth;
2208 PlayField16[*si] = fiMurphy;
2209 subEatRedDisk(*si); // inc+show Murphy's red disks
2213 // ==========================================================================
2214 // Move Red Disk left
2215 // ==========================================================================
2218 if (LowByte(PlayField16[*si + 1]) != fiExplosion)
2219 PlayField16[*si + 1] = 0;
2221 PlayField16[*si] = fiMurphy;
2222 subEatRedDisk(*si); // inc+show Murphy's red disks
2226 // ==========================================================================
2227 // Move Red Disk down
2228 // ==========================================================================
2231 if (LowByte(PlayField16[*si]) != fiExplosion)
2232 PlayField16[*si] = 0;
2234 *si = *si + FieldWidth;
2235 PlayField16[*si] = fiMurphy;
2236 subEatRedDisk(*si); // inc+show Murphy's red disks
2240 // ==========================================================================
2241 // Move Red Disk right
2242 // ==========================================================================
2245 if (LowByte(PlayField16[*si - 1]) != fiExplosion)
2246 PlayField16[*si - 1] = 0;
2248 PlayField16[*si] = fiMurphy;
2249 subEatRedDisk(*si); // inc+show Murphy's red disks
2253 // ==========================================================================
2255 // ==========================================================================
2258 if (LowByte(PlayField16[*si - FieldWidth]) != fiExplosion)
2259 PlayField16[*si - FieldWidth] = 0;
2261 subEatRedDisk(*si - FieldWidth); // inc+show Murphy's red disks
2265 // ==========================================================================
2266 // Eat Red Disk left
2267 // ==========================================================================
2270 if (LowByte(PlayField16[*si - 1]) != fiExplosion)
2271 PlayField16[*si - 1] = 0;
2273 subEatRedDisk(*si - 1); // inc+show Murphy's red disks
2277 // ==========================================================================
2278 // Eat Red Disk down
2279 // ==========================================================================
2282 if (LowByte(PlayField16[*si + FieldWidth]) != fiExplosion)
2283 PlayField16[*si + FieldWidth] = 0;
2285 subEatRedDisk(*si + FieldWidth); // inc+show Murphy's red disks
2289 // ==========================================================================
2290 // Eat Red Disk right
2291 // ==========================================================================
2294 if (LowByte(PlayField16[*si + 1]) != fiExplosion)
2295 PlayField16[*si + 1] = 0;
2297 subEatRedDisk(*si + 1); // inc+show Murphy's red disks
2301 // ==========================================================================
2302 // yellow disk, pushing up
2303 // ==========================================================================
2306 if (LowByte(PlayField16[*si]) != fiExplosion)
2307 PlayField16[*si] = 0;
2309 *si = *si - FieldWidth;
2310 PlayField16[*si] = fiMurphy;
2311 PlayField16[*si - FieldWidth] = fiYellowDisk;
2315 // ==========================================================================
2316 // yellow disk, pushing left
2317 // ==========================================================================
2320 if (LowByte(PlayField16[*si]) != fiExplosion)
2321 PlayField16[*si] = 0;
2324 PlayField16[*si] = fiMurphy;
2325 PlayField16[*si - 1] = fiYellowDisk;
2329 // ==========================================================================
2330 // yellow disk, pushing down
2331 // ==========================================================================
2334 if (LowByte(PlayField16[*si]) != fiExplosion)
2335 PlayField16[*si] = 0;
2337 *si = *si + FieldWidth;
2338 PlayField16[*si] = fiMurphy;
2339 PlayField16[*si + FieldWidth] = fiYellowDisk;
2343 // ==========================================================================
2344 // yellow disk pushing right
2345 // ==========================================================================
2348 if (LowByte(PlayField16[*si]) != fiExplosion)
2349 PlayField16[*si] = 0;
2352 PlayField16[*si] = fiMurphy;
2353 PlayField16[*si + 1] = fiYellowDisk;
2357 // ==========================================================================
2358 // orange disk, pushing left
2359 // ==========================================================================
2362 if (LowByte(PlayField16[*si]) != fiExplosion)
2363 PlayField16[*si] = 0;
2366 PlayField16[*si] = fiMurphy;
2367 PlayField16[*si - 1] = fiOrangeDisk;
2371 // ==========================================================================
2372 // orange disk, pushing right
2373 // ==========================================================================
2376 if (LowByte(PlayField16[*si]) != fiExplosion)
2377 PlayField16[*si] = 0;
2380 PlayField16[*si] = fiMurphy;
2381 PlayField16[*si + 1] = fiOrangeDisk;
2382 if (PlayField16[*si + FieldWidth + 1] == 0) // make it fall down if below is empty
2384 MovHighByte(&PlayField16[*si + 1], 0x20);
2385 MovHighByte(&PlayField16[*si + FieldWidth + 1], fiOrangeDisk);
2390 // ==========================================================================
2391 // Release a red disk
2392 // ==========================================================================
2395 PlayField16[*si] = fiMurphy;
2396 RedDiskReleasePhase = 2;
2397 RedDiskCount = RedDiskCount - 1;
2399 subSoundFX(*si, fiRedDisk, actDropping);
2400 } // subAnimateMurphy
2402 // ==========================================================================
2404 // ==========================================================================
2405 void subExplodeSnikSnaksBelow(int si)
2409 ax = LowByte(PlayField16[si + FieldWidth]);
2410 if (ax == 0x11 || ax == 0xBB)
2411 ExplodeFieldSP(si + FieldWidth);
2412 } // subExplodeSnikSnaksBelow
2414 // ==========================================================================
2416 // Does pushing against an object kill Murphy?
2417 // ==========================================================================
2418 static boolean subMoveKillsMurphy(int si, int ax, int bl)
2420 static boolean subMoveKillsMurphy;
2426 if (ax == 0xFFFF || ax == 0xAAAA || ah == 0)
2432 if (al == fiExplosion)
2435 if (fiOrangeDisk <= al && al <= fiPortUp)
2438 ExplodeFieldSP(si); // Explode
2439 subMoveKillsMurphy = True;
2440 return subMoveKillsMurphy;
2449 ExplodeFieldSP(si); // Explode
2450 subMoveKillsMurphy = True;
2451 return subMoveKillsMurphy;
2453 loc_g_74F6: // zonk left
2455 if (! (ah == 0x20 || ah == 0x40 || ah == 0x50 || ah == 0x70))
2458 subMoveKillsMurphy = True; // Set carry flag
2459 return subMoveKillsMurphy;
2461 loc_g_7512: // zonk right
2463 if (! (ah == 0x30 || ah == 0x40 || ah == 0x60 || ah == 0x70))
2466 loc_g_752E: // Marked fields and Ports
2467 subMoveKillsMurphy = True; // Set carry flag
2468 return subMoveKillsMurphy;
2470 loc_g_7530: // explosion
2471 if ((ah & 0x80) != 0)
2478 ExplodeFieldSP(si); // Explode
2479 subMoveKillsMurphy = True; // Set carry flag
2480 return subMoveKillsMurphy;
2483 PlayField16[si] = 0;
2484 subMoveKillsMurphy = False;
2486 return subMoveKillsMurphy;
2487 } // subMoveKillsMurphy
2489 // ==========================================================================
2491 // Test If si 's a special (grav) port and If so Then fetch new values (see below)
2492 // change conditions to port specs
2493 // The 10-port data base is at data_h_0D28, 10 entries of 6 bytes each:
2494 // (hi),(lo),(gravity),(freeze zonks),(freeze enemies),(unused)
2495 // ==========================================================================
2497 void subSpPortTest(int si)
2501 for (i = 0; i < LInfo.SpecialPortCount; i++)
2503 if (LInfo.SpecialPort[i].PortLocation / 2 == si)
2505 GravityFlag = LInfo.SpecialPort[i].Gravity;
2506 FreezeZonks = LInfo.SpecialPort[i].FreezeZonks;
2507 SnikSnaksElectronsFrozen = LInfo.SpecialPort[i].FreezeEnemies;
2514 void subCopyAnimToScreen(int si, int graphic, int sync_frame)
2518 // +++++++++++++++++++++++++++++++++++++++++
2519 X = GetStretchX(si);
2520 Y = GetStretchY(si);
2521 DDSpriteBuffer_BltImg(X, Y, graphic, sync_frame);
2522 // +++++++++++++++++++++++++++++++++++++++++
2525 void subCopyImageToScreen(int si, int graphic)
2527 subCopyAnimToScreen(si, graphic, 0);
2530 static void subEatRedDisk(int si)
2532 if (AllowRedDiskCheat == 0)
2534 if (RedDiskReleasePhase != 0)
2536 if (RedDiskReleaseMurphyPos == si)
2541 RedDiskCount = (RedDiskCount + 1) % 256;
2544 void subAdjustZonksInfotronsAboveMurphy(int si)
2548 if (LowByte(PlayField16[si]) != fiExplosion)
2549 PlayField16[si] = 0;
2551 ax = PlayField16[si - FieldWidth];
2552 if (ax == 0 || ax == 0x9999)
2555 if (ax == fiZonk || ax == fiInfotron)
2557 MovHighByte(&PlayField16[si - FieldWidth], 0x40); // make falling straigt down
2562 loc_g_15A8: // empty above
2563 ax = PlayField16[si - FieldWidth - 1];
2564 if (ax == fiZonk || ax == fiInfotron)
2568 ax = PlayField16[si - FieldWidth + 1];
2569 if (ax == fiZonk || ax == fiInfotron)
2574 loc_g_15C5: // zonk/infotron above left
2575 ax = PlayField16[si - 1];
2576 if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM)) // continue testing right above
2579 MovHighByte(&PlayField16[si - FieldWidth - 1], 0x60); // make roll right
2580 PlayField16[si - FieldWidth] = 0x8888;
2584 loc_g_15E8: // zonk/infotron above right
2585 ax = PlayField16[si + 1];
2586 if (ax == fiZonk || ax == fiInfotron || ax == fiRAM)
2588 MovHighByte(&PlayField16[si - FieldWidth + 1], 0x50); // make roll left
2589 PlayField16[si - FieldWidth] = 0x8888;