From 3d31c6dd1b4f598453c3079d292f47f372f10151 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 14 Feb 2010 01:02:52 +0100 Subject: [PATCH] rnd-20100214-1-src * done integrating R'n'D graphics engine into file "Murphy.c" --- ChangeLog | 3 + src/conf_gfx.c | 12 ++- src/conftime.h | 2 +- src/game_sp/BugsTerminals.c | 2 +- src/game_sp/Electrons.c | 24 ++--- src/game_sp/Explosions.c | 2 +- src/game_sp/Globals.c | 89 +++++++++++++----- src/game_sp/Globals.h | 76 ++++++++++----- src/game_sp/Infotrons.c | 8 +- src/game_sp/Murphy.c | 180 +++++++++++++++++++++++++++--------- src/game_sp/SnikSnaks.c | 8 +- src/game_sp/Zonk.c | 8 +- 12 files changed, 296 insertions(+), 118 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3fddcfa..cb5ed1cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2010-02-14 + * done integrating R'n'D graphics engine into file "Murphy.c" + 2010-02-07 * started integrating R'n'D graphics engine into Supaplex game engine diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 81ae36ee..22cfe2ce 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -338,36 +338,42 @@ struct ConfigInfo image_config[] = { "sp_murphy.moving.left.frames", "3" }, { "sp_murphy.moving.left.anim_mode", "pingpong" }, { "sp_murphy.moving.left.delay", "2" }, + { "sp_murphy.moving.left.start_frame", "1" }, { "sp_murphy.moving.right", "RocksSP.pcx" }, { "sp_murphy.moving.right.xpos", "11" }, { "sp_murphy.moving.right.ypos", "0" }, { "sp_murphy.moving.right.frames", "3" }, { "sp_murphy.moving.right.anim_mode", "pingpong" }, { "sp_murphy.moving.right.delay", "2" }, + { "sp_murphy.moving.right.start_frame", "1" }, { "sp_murphy.digging.left", "RocksSP.pcx" }, { "sp_murphy.digging.left.xpos", "8" }, { "sp_murphy.digging.left.ypos", "0" }, { "sp_murphy.digging.left.frames", "3" }, { "sp_murphy.digging.left.anim_mode", "pingpong" }, { "sp_murphy.digging.left.delay", "2" }, + { "sp_murphy.digging.left.start_frame", "1" }, { "sp_murphy.digging.right", "RocksSP.pcx" }, { "sp_murphy.digging.right.xpos", "11" }, { "sp_murphy.digging.right.ypos", "0" }, { "sp_murphy.digging.right.frames", "3" }, { "sp_murphy.digging.right.anim_mode", "pingpong" }, { "sp_murphy.digging.right.delay", "2" }, + { "sp_murphy.digging.right.start_frame", "1" }, { "sp_murphy.collecting.left", "RocksSP.pcx" }, { "sp_murphy.collecting.left.xpos", "8" }, { "sp_murphy.collecting.left.ypos", "0" }, { "sp_murphy.collecting.left.frames", "3" }, { "sp_murphy.collecting.left.anim_mode", "pingpong" }, { "sp_murphy.collecting.left.delay", "2" }, + { "sp_murphy.collecting.left.start_frame", "1" }, { "sp_murphy.collecting.right", "RocksSP.pcx" }, { "sp_murphy.collecting.right.xpos", "11" }, { "sp_murphy.collecting.right.ypos", "0" }, { "sp_murphy.collecting.right.frames", "3" }, { "sp_murphy.collecting.right.anim_mode", "pingpong" }, { "sp_murphy.collecting.right.delay", "2" }, + { "sp_murphy.collecting.right.start_frame", "1" }, { "sp_murphy.pushing.left", "RocksSP.pcx" }, { "sp_murphy.pushing.left.xpos", "11" }, { "sp_murphy.pushing.left.ypos", "1" }, @@ -426,6 +432,8 @@ struct ConfigInfo image_config[] = { "sp_murphy.shrinking.xpos", "8" }, { "sp_murphy.shrinking.ypos", "14" }, { "sp_murphy.shrinking.frames", "8" }, + { "sp_murphy.shrinking.delay", "4" }, + { "sp_murphy.shrinking.anim_mode", "linear" }, { "sp_murphy_clone", "RocksSP.pcx" }, { "sp_murphy_clone.xpos", "3" }, @@ -529,9 +537,9 @@ struct ConfigInfo image_config[] = { "sp_disk_red.ypos", "2" }, { "sp_disk_red.frames", "1" }, { "sp_disk_red.collecting", "RocksSP.pcx" }, - { "sp_disk_red.collecting.xpos", "8" }, + { "sp_disk_red.collecting.xpos", "9" }, { "sp_disk_red.collecting.ypos", "5" }, - { "sp_disk_red.collecting.frames", "8" }, + { "sp_disk_red.collecting.frames", "7" }, { "sp_disk_red.collecting.anim_mode", "linear" }, { "sp_disk_red.active", "RocksSP.pcx" }, { "sp_disk_red.active.xpos", "4" }, diff --git a/src/conftime.h b/src/conftime.h index c3e5a903..4116b8f8 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-02-13 14:15" +#define COMPILE_DATE_STRING "2010-02-14 00:55" diff --git a/src/game_sp/BugsTerminals.c b/src/game_sp/BugsTerminals.c index 330b6f7a..374a6f48 100644 --- a/src/game_sp/BugsTerminals.c +++ b/src/game_sp/BugsTerminals.c @@ -81,7 +81,7 @@ markPlaySound: markDisplay: // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - cx = aniBug[bl]; + cx = aniFramesBug[bl]; StretchedSprites.BltEx(GetStretchX(si), GetStretchY(si), cx); // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/game_sp/Electrons.c b/src/game_sp/Electrons.c index 5f77e738..f678ab58 100644 --- a/src/game_sp/Electrons.c +++ b/src/game_sp/Electrons.c @@ -117,7 +117,7 @@ int subElectronTurnLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniElectron[bx]); + StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bx = (bx + 1) & 0x7; MovHighByte(&PlayField16[si], bx); @@ -224,7 +224,7 @@ int subElectronTurnRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniElectron[0x10 - bx]); + StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bx = ((bx + 1) & 0x7) | 8; MovHighByte(&PlayField16[si], bx); @@ -324,7 +324,7 @@ int subElectronFromBelow(int si, int bx) X = GetStretchX(si); Y = GetStretchY(si + FieldWidth); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniElectron[bx]); + StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si + FieldWidth]) != fiExplosion) @@ -387,7 +387,7 @@ int subElectronFromRight(int si, int bx) X = GetStretchX(si + 1); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniElectron[bx]); + StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si + 1]) != fiExplosion) @@ -449,7 +449,7 @@ int subElectronFromAbove(int si, int bx) X = GetStretchX(si); Y = GetStretchY(si - FieldWidth); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniElectron[bx]); + StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si - FieldWidth]) != fiExplosion) @@ -511,7 +511,7 @@ int subElectronFromLeft(int si, int bx) X = GetStretchX(si - 1); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniElectron[bx]); + StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = LowByte(bx); if (bl == 7 && LowByte(PlayField16[si - 1]) != fiExplosion) @@ -570,7 +570,7 @@ int subDrawElectronTurnLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniElectron[bx]); + StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronTurnLeft; @@ -585,7 +585,7 @@ int subDrawElectronTurnRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniElectron[0x10 - bx]); + StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronTurnRight; @@ -602,7 +602,7 @@ int subDrawElectronFromBelow(int si, int bx) X = GetStretchX(si); Y = GetStretchY(si + FieldWidth); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniElectron[bx]); + StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromBelow; @@ -619,7 +619,7 @@ int subDrawElectronFromRight(int si, int bx) X = GetStretchX(si + 1); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniElectron[bx]); + StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromRight; @@ -636,7 +636,7 @@ int subDrawElectronFromAbove(int si, int bx) X = GetStretchX(si); Y = GetStretchY(si - FieldWidth); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniElectron[bx]); + StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromAbove; @@ -653,7 +653,7 @@ int subDrawElectronFromLeft(int si, int bx) X = GetStretchX(si - 1); Y = GetStretchY(si); StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniElectron[bx]); + StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawElectronFromLeft; diff --git a/src/game_sp/Explosions.c b/src/game_sp/Explosions.c index cf1d7297..629e4818 100644 --- a/src/game_sp/Explosions.c +++ b/src/game_sp/Explosions.c @@ -38,7 +38,7 @@ int subAnimateExplosion(int si) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniExplosion[bl]); + StretchedSprites.BltEx(X, Y, aniFramesExplosion[bl]); // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if (bl == 8) { diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index ebf59fd6..b59125bc 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -172,29 +172,72 @@ int *aniEatInfotronLeft, *aniEatInfotronRight; #endif #if 1 -int aniBug[] = { 74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25 }; -int aniZonkRollRight[] = { 198, 197, 196, 195, 194, 193, 192, 1, -1 }; -int aniZonkRollLeft[] = { 192, 193, 194, 195, 196, 197, 198, 1, -1 }; -int aniInfotronRollRight[] = { 206, 205, 204, 203, 202, 201, 200, 4 }; -int aniInfotronRollLeft[] = { 200, 201, 202, 203, 204, 205, 206, 4 }; -int aniSnikSnak[] = { 121, 122, 123, 124, 125, 126, 127, 120, 121 }; -int aniElectron[] = { 144, 145, 146, 147, 148, 149, 150, 151, 144 }; -int aniExplosion[] = { 3, 103, 104, 105, 106, 107, 108, 109, 0 }; -int aniTouchBase[] = { 80, 81, 82, 83, 84, 85, 86, 0, -1 }; -int aniTouchInfotron[] = { 87, 88, 89, 91, 92, 93, 0, -1 }; // Only seven frames!!!! -int aniTouchRedDisk[] = { 96, 97, 98, 99, 100, 101, 102, 0, -1 }; -int aniMurphyExit[] = { 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 0, 0, 0, 0, -1 }; -int aniMurphyEatLeft[] = { 176, 177, 178, 179, 180, 181, 182, 183, -1 }; -int aniMurphyEatRight[] = { 184, 185, 186, 187, 188, 189, 190, 191, -1 }; -int aniMurphyEatUpLeft[] = { 183, 182, 181, 180, 179, 178, 177, 176, -1 }; -int aniMurphyEatUpRight[] = { 191, 190, 189, 188, 187, 186, 185, 184, -1 }; - // aniMurphyEatRightRedDisk = { 184, 184, 185, 186, 187, 188, 189, 190, 191, -1) '9 frames! -int aniEatInfotronLeft[] = { 209, 211, 213, 215, 217, 219, 221, 223, -1 }; -int aniEatInfotronRight[] = { 224, 226, 228, 230, 232, 234, 236, 238, -1 }; -int aniSplitUpDown[] = { 3, 3, 3, 3, 3, 3, 3, 3, -1 }; -int aniYellowDisk[] = { 18, 18, 18, 18, 18, 18, 18, 18, -1 }; -int aniOrangeDisk[] = { 8, 8, 8, 8, 8, 8, 8, 8, -1 }; -int aniRedDisk[] = { 20, -1 }; +int aniFramesBug[] = { 74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25 }; +int aniFramesZonkRollRight[] = { 198, 197, 196, 195, 194, 193, 192, 1, -1 }; +int aniFramesZonkRollLeft[] = { 192, 193, 194, 195, 196, 197, 198, 1, -1 }; +int aniFramesInfotronRollRight[] = { 206, 205, 204, 203, 202, 201, 200, 4 }; +int aniFramesInfotronRollLeft[] = { 200, 201, 202, 203, 204, 205, 206, 4 }; +int aniFramesSnikSnak[] = { 121, 122, 123, 124, 125, 126, 127, 120, 121 }; +int aniFramesElectron[] = { 144, 145, 146, 147, 148, 149, 150, 151, 144 }; +int aniFramesExplosion[] = { 3, 103, 104, 105, 106, 107, 108, 109, 0 }; +int aniFramesTouchBase[] = { 80, 81, 82, 83, 84, 85, 86, 0, -1 }; +int aniFramesTouchInfotron[] = { 87, 88, 89, 91, 92, 93, 0, -1 }; // Only seven frames!!!! +int aniFramesTouchRedDisk[] = { 96, 97, 98, 99, 100, 101, 102, 0, -1 }; +int aniFramesMurphyExit[] = { 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 0, 0, 0, 0, -1 }; +int aniFramesMurphyEatLeft[] = { 176, 177, 178, 179, 180, 181, 182, 183, -1 }; +int aniFramesMurphyEatRight[] = { 184, 185, 186, 187, 188, 189, 190, 191, -1 }; +int aniFramesMurphyEatUpLeft[] = { 183, 182, 181, 180, 179, 178, 177, 176, -1 }; +int aniFramesMurphyEatUpRight[] = { 191, 190, 189, 188, 187, 186, 185, 184, -1 }; + // aniFramesMurphyEatRightRedDisk = { 184, 184, 185, 186, 187, 188, 189, 190, 191, -1) '9 frames! +int aniFramesEatInfotronLeft[] = { 209, 211, 213, 215, 217, 219, 221, 223, -1 }; +int aniFramesEatInfotronRight[] = { 224, 226, 228, 230, 232, 234, 236, 238, -1 }; +int aniFramesSplitUpDown[] = { 3, 3, 3, 3, 3, 3, 3, 3, -1 }; +int aniFramesYellowDisk[] = { 18, 18, 18, 18, 18, 18, 18, 18, -1 }; +int aniFramesOrangeDisk[] = { 8, 8, 8, 8, 8, 8, 8, 8, -1 }; +int aniFramesRedDisk[] = { 20, -1 }; +#endif + +#if 1 + +int getSequenceLength(int sequence) +{ + switch (sequence) + { + case aniBug: + return 14; + + case aniElectron: + case aniExplosion: + return 9; + + case aniTouchInfotron: + return 7; + + case aniMurphyExit: + return 40; + + case aniRedDisk: + return 1; + + default: + return 8; + } +} + +boolean isSnappingSequence(int sequence) +{ + switch (sequence) + { + case aniTouchBase: + case aniTouchInfotron: + case aniTouchRedDisk: + return TRUE; + + default: + return FALSE; + } +} + #endif void InitGlobals() diff --git a/src/game_sp/Globals.h b/src/game_sp/Globals.h index deb4afd1..54d7aaaa 100644 --- a/src/game_sp/Globals.h +++ b/src/game_sp/Globals.h @@ -66,18 +66,16 @@ #define fiRAMLeft (26) #define fiRAMRight (27) #define fiHWFirst (28) - -#define fiHW_0 (fiHWFirst + 0) -#define fiHW_1 (fiHWFirst + 1) -#define fiHW_2 (fiHWFirst + 2) -#define fiHW_3 (fiHWFirst + 3) -#define fiHW_4 (fiHWFirst + 4) -#define fiHW_5 (fiHWFirst + 5) -#define fiHW_6 (fiHWFirst + 6) -#define fiHW_7 (fiHWFirst + 7) -#define fiHW_8 (fiHWFirst + 8) -#define fiHW_9 (fiHWFirst + 9) - +#define fiHW0 (fiHWFirst + 0) // fiHWFirst +#define fiHW1 (fiHWFirst + 1) +#define fiHW2 (fiHWFirst + 2) +#define fiHW3 (fiHWFirst + 3) +#define fiHW4 (fiHWFirst + 4) +#define fiHW5 (fiHWFirst + 5) +#define fiHW6 (fiHWFirst + 6) +#define fiHW7 (fiHWFirst + 7) +#define fiHW8 (fiHWFirst + 8) +#define fiHW9 (fiHWFirst + 9) // fiHWLast #define fiHWLast (37) #define fiRAMTop (38) #define fiRAMBottom (39) @@ -144,15 +142,46 @@ #define aniMurphySleepLeft IMG_SP_MURPHY_SLEEPING_LEFT #define aniMurphySleepRight IMG_SP_MURPHY_SLEEPING_RIGHT -#define aniMurphyTouchDown IMG_SP_MURPHY_SNAPPING_DOWN #define aniMurphyTouchLeft IMG_SP_MURPHY_SNAPPING_LEFT #define aniMurphyTouchRight IMG_SP_MURPHY_SNAPPING_RIGHT #define aniMurphyTouchUp IMG_SP_MURPHY_SNAPPING_UP +#define aniMurphyTouchDown IMG_SP_MURPHY_SNAPPING_DOWN #define aniMurphyYawn IMG_SP_MURPHY_BORING_1 #define aniPushLeft IMG_SP_MURPHY_PUSHING_LEFT #define aniPushRight IMG_SP_MURPHY_PUSHING_RIGHT #define aniPushUpDown IMG_SP_MURPHY_PUSHING_RIGHT +#define aniBug IMG_SP_BUGGY_BASE +#define aniBugActive IMG_SP_BUGGY_BASE_ACTIVE +#define aniZonkRollLeft IMG_SP_ZONK_MOVING_LEFT +#define aniZonkRollRight IMG_SP_ZONK_MOVING_RIGHT +#define aniEatInfotronLeft IMG_SP_MURPHY_COLLECTING_LEFT +#define aniEatInfotronRight IMG_SP_MURPHY_COLLECTING_RIGHT +#define aniInfotronRollLeft IMG_SP_INFOTRON_MOVING_LEFT +#define aniInfotronRollRight IMG_SP_INFOTRON_MOVING_RIGHT +#define aniMurphyMoveLeft IMG_SP_MURPHY_MOVING_LEFT +#define aniMurphyMoveRight IMG_SP_MURPHY_MOVING_RIGHT +#define aniMurphyMoveUpLeft IMG_SP_MURPHY_MOVING_LEFT +#define aniMurphyMoveUpRight IMG_SP_MURPHY_MOVING_RIGHT +#define aniMurphyDigLeft IMG_SP_MURPHY_DIGGING_LEFT +#define aniMurphyDigRight IMG_SP_MURPHY_DIGGING_RIGHT +#define aniMurphyDigUpLeft IMG_SP_MURPHY_DIGGING_LEFT +#define aniMurphyDigUpRight IMG_SP_MURPHY_DIGGING_RIGHT +#define aniMurphyEatLeft IMG_SP_MURPHY_COLLECTING_LEFT +#define aniMurphyEatRight IMG_SP_MURPHY_COLLECTING_RIGHT +#define aniMurphyEatUpLeft IMG_SP_MURPHY_COLLECTING_LEFT +#define aniMurphyEatUpRight IMG_SP_MURPHY_COLLECTING_RIGHT +#define aniSplitUpDown IMG_SP_MURPHY +#define aniMurphyExit IMG_SP_MURPHY_SHRINKING +#define aniElectron IMG_SP_ELECTRON +#define aniExplosion IMG_SP_DEFAULT_EXPLODING +#define aniTouchBase IMG_SP_BASE_SNAPPING +#define aniTouchInfotron IMG_SP_INFOTRON_COLLECTING +#define aniTouchRedDisk IMG_SP_DISK_RED_COLLECTING +#define aniYellowDisk IMG_SP_DISK_YELLOW +#define aniOrangeDisk IMG_SP_DISK_ORANGE +#define aniRedDisk IMG_SP_DISK_RED + #define aniSnikSnakDown 167 #define aniSnikSnakLeft 239 #define aniSnikSnakRight 247 @@ -195,15 +224,15 @@ #if 1 -extern int aniBug[], aniZonkRollRight[], aniZonkRollLeft[]; -extern int aniEatInfotronLeft[], aniEatInfotronRight[]; -extern int aniInfotronRollRight[], aniInfotronRollLeft[]; -extern int aniMurphyEatLeft[], aniMurphyEatRight[]; -extern int aniMurphyEatUpLeft[], aniMurphyEatUpRight[], aniSplitUpDown[]; -extern int aniMurphyExit[]; -extern int aniSnikSnak[], aniElectron[], aniExplosion[]; -extern int aniTouchBase[], aniTouchInfotron[], aniTouchRedDisk[]; -extern int aniYellowDisk[], aniOrangeDisk[], aniRedDisk[]; +extern int aniFramesBug[], aniFramesZonkRollRight[], aniFramesZonkRollLeft[]; +extern int aniFramesEatInfotronLeft[], aniFramesEatInfotronRight[]; +extern int aniFramesInfotronRollRight[], aniFramesInfotronRollLeft[]; +extern int aniFramesMurphyEatLeft[], aniFramesMurphyEatRight[]; +extern int aniFramesMurphyEatUpLeft[], aniFramesMurphyEatUpRight[], aniFramesSplitUpDown[]; +extern int aniFramesMurphyExit[]; +extern int aniFramesSnikSnak[], aniFramesElectron[], aniFramesExplosion[]; +extern int aniFramesTouchBase[], aniFramesTouchInfotron[], aniFramesTouchRedDisk[]; +extern int aniFramesYellowDisk[], aniFramesOrangeDisk[], aniFramesRedDisk[]; #else @@ -263,6 +292,9 @@ extern void InitPseudoCompileFlags(); extern void ReadLevel(); +extern int getSequenceLength(int sequence); +extern boolean isSnappingSequence(int sequence); + extern boolean Alignments; extern boolean BlockingSpeed; extern boolean Cracked; diff --git a/src/game_sp/Infotrons.c b/src/game_sp/Infotrons.c index 75c18a8e..366a007c 100644 --- a/src/game_sp/Infotrons.c +++ b/src/game_sp/Infotrons.c @@ -242,7 +242,7 @@ loc_g_138D: // infotron comes rolling from right to left Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniInfotronRollLeft[dx - 1]); + StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; // get and increment sequence# if (bl == 0x24) @@ -272,7 +272,7 @@ loc_g_13E9: // infotron comes rolling from left to right Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniInfotronRollRight[dx - 1]); + StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; if (bl == 0x34) @@ -322,7 +322,7 @@ loc_g_1472: // infotron rolls left Y = GetStretchY(si); dx = (bl & 0xF) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniInfotronRollLeft[dx - 1]); + StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence# if (bl < 0x52) @@ -359,7 +359,7 @@ loc_g_14E0: // infotron rolls right Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniInfotronRollRight[dx - 1]); + StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; if (bl < 0x62) diff --git a/src/game_sp/Murphy.c b/src/game_sp/Murphy.c index 1c9cd8f5..ff03ea27 100644 --- a/src/game_sp/Murphy.c +++ b/src/game_sp/Murphy.c @@ -42,12 +42,14 @@ void subAnimateMurphy(int *si) // 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); @@ -71,7 +73,9 @@ void subAnimateMurphy(int *si) 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 @@ -79,6 +83,7 @@ void subAnimateMurphy(int *si) MurphyDY = 0; ClearPos = *si; dxPos = *si; + dx1 = -1; dx2 = -1; SeqPos = 0; // end of FS @@ -678,7 +683,8 @@ loc_g_62E2: 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; @@ -688,7 +694,8 @@ loc_g_62E2: // ========================================================================== 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; @@ -699,7 +706,8 @@ loc_g_6312: // ========================================================================== loc_g_6341: - dx = aniMurphyEatLeft; + dx = aniFramesMurphyEatLeft; + dx1 = aniMurphyMoveLeft; PlayField16[*si - 1] = 0x203; PlayField16[*si] = 0x300; *si = *si - 1; @@ -710,7 +718,8 @@ loc_g_6341: // ========================================================================== 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; @@ -721,7 +730,8 @@ loc_g_6364: // ========================================================================== loc_g_6399: - dx = aniMurphyEatRight; + dx = aniFramesMurphyEatRight; + dx1 = aniMurphyMoveRight; PlayField16[*si + 1] = 0x403; PlayField16[*si] = 0x300; *si = *si + 1; @@ -746,7 +756,8 @@ loc_g_63C2: 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; @@ -771,7 +782,8 @@ loc_g_640B: loc_g_641C: subSoundFXBase(); - dx = aniMurphyEatLeft; + dx = aniFramesMurphyEatLeft; + dx1 = aniMurphyDigLeft; PlayField16[*si - 1] = 0x203; PlayField16[*si] = 0x300; *si = *si - 1; @@ -796,7 +808,8 @@ loc_g_6448: 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; @@ -821,7 +834,8 @@ loc_g_6491: loc_g_64A2: subSoundFXBase(); - dx = aniMurphyEatRight; + dx = aniFramesMurphyEatRight; + dx1 = aniMurphyDigRight; PlayField16[*si + 1] = 0x803; PlayField16[*si] = 0x300; *si = *si + 1; @@ -847,7 +861,8 @@ loc_g_64CE: loc_g_64DF: subCopyImageToScreen(*si, aniMurphyTouchUp); subSoundFXBase(); - dx = aniTouchBase; + dx = aniFramesTouchBase; + dx1 = aniTouchBase; dxPos = *si - FieldWidth; MovHighByte(&PlayField16[*si], 0x10); goto loc_StopNoSplit; @@ -872,7 +887,8 @@ loc_g_650C: loc_g_651D: subCopyImageToScreen(*si, aniMurphyTouchLeft); subSoundFXBase(); - dx = aniTouchBase; + dx = aniFramesTouchBase; + dx1 = aniTouchBase; dxPos = *si - 1; MovHighByte(&PlayField16[*si], 0x11); goto loc_StopNoSplit; @@ -897,7 +913,8 @@ loc_g_654A: loc_g_655B: subCopyImageToScreen(*si, aniMurphyTouchDown); subSoundFXBase(); - dx = aniTouchBase; + dx = aniFramesTouchBase; + dx1 = aniTouchBase; dxPos = *si + FieldWidth; MovHighByte(&PlayField16[*si], 0x12); goto loc_StopNoSplit; @@ -922,7 +939,8 @@ loc_g_6588: loc_g_6599: subCopyImageToScreen(*si, aniMurphyTouchRight); subSoundFXBase(); - dx = aniTouchBase; + dx = aniFramesTouchBase; + dx1 = aniTouchBase; dxPos = *si + 1; MovHighByte(&PlayField16[*si], 0x13); goto loc_StopNoSplit; @@ -933,7 +951,8 @@ loc_g_6599: 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; @@ -945,10 +964,13 @@ loc_g_65C6: 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; @@ -960,7 +982,8 @@ loc_g_65FE: 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; @@ -972,10 +995,13 @@ loc_g_662A: 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; @@ -988,7 +1014,8 @@ loc_g_6662: 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; @@ -1000,7 +1027,8 @@ loc_g_668E: 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; @@ -1012,7 +1040,8 @@ loc_g_66C0: 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; @@ -1024,7 +1053,8 @@ loc_g_66F2: 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; @@ -1069,7 +1099,8 @@ loc_g_6756: #endif LeadOutCounter = 0x40; // quit: start lead-out - dx = aniMurphyExit; + dx = aniFramesMurphyExit; + dx1 = aniMurphyExit; MovHighByte(&PlayField16[*si], 0xD); goto loc_StopNoSplit; @@ -1084,7 +1115,8 @@ loc_g_679B: MovHighByte(&PlayField16[*si - 2], 1); subCopyImageToScreen(*si, aniPushLeft); // draw pushing murphy - dx = aniZonkRollLeft; + dx = aniFramesZonkRollLeft; + dx1 = aniZonkRollLeft; dxPos = *si - 1; dx2 = aniPushLeft; dx2Step = 1; @@ -1106,7 +1138,8 @@ loc_g_67D4: MovHighByte(&PlayField16[*si + 2], 1); subCopyImageToScreen(*si, aniPushRight); // draw pushing murphy - dx = aniZonkRollRight; + dx = aniFramesZonkRollRight; + dx1 = aniZonkRollRight; dxPos = *si + 1; dx2 = aniPushRight; dx2Step = -1; @@ -1222,7 +1255,8 @@ loc_g_6916: if (PlayField16[*si - 2 * FieldWidth] != 0) return; - dx = aniSplitUpDown; + dx = aniFramesSplitUpDown; + dx1 = aniSplitUpDown; dx2Step = -FieldWidth; PlayField16[*si] = 0x1803; PlayField16[*si - 2 * FieldWidth] = 0x300; @@ -1236,7 +1270,8 @@ loc_g_693A: if (PlayField16[*si - 2] != 0) return; - dx = aniMurphyEatLeft; + dx = aniFramesMurphyEatLeft; + dx1 = aniMurphyMoveLeft; dx2Step = -1; PlayField16[*si] = 0x1903; PlayField16[*si - 2] = 0x300; @@ -1250,7 +1285,8 @@ loc_g_695E: if (PlayField16[*si + 2 * FieldWidth] != 0) return; - dx = aniSplitUpDown; + dx = aniFramesSplitUpDown; + dx1 = aniSplitUpDown; dx2Step = FieldWidth; PlayField16[*si] = 0x1A03; PlayField16[*si + 2 * FieldWidth] = 0x300; @@ -1264,7 +1300,8 @@ loc_g_6982: if (PlayField16[*si + 2] != 0) return; - dx = aniMurphyEatRight; + dx = aniFramesMurphyEatRight; + dx1 = aniMurphyMoveRight; dx2Step = 1; PlayField16[*si] = 0x1B03; PlayField16[*si + 2] = 0x300; @@ -1279,7 +1316,8 @@ loc_StopSplit: // ========================================================================== 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; @@ -1289,7 +1327,8 @@ loc_g_69A6: // ========================================================================== 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; @@ -1300,7 +1339,8 @@ loc_g_69CE: // ========================================================================== 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; @@ -1310,8 +1350,9 @@ loc_g_69F7: // ========================================================================== 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: @@ -1345,7 +1386,8 @@ loc_g_6A1F: // ========================================================================== loc_g_6A48: - dx = aniTouchRedDisk; + dx = aniFramesTouchRedDisk; + dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x20); MovHighByte(&PlayField16[*si - FieldWidth], 3); goto loc_StopNoSplit; @@ -1355,7 +1397,8 @@ loc_g_6A48: // ========================================================================== loc_g_6A64: - dx = aniTouchRedDisk; + dx = aniFramesTouchRedDisk; + dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x21); MovHighByte(&PlayField16[*si - 1], 3); goto loc_StopNoSplit; @@ -1365,7 +1408,8 @@ loc_g_6A64: // ========================================================================== loc_g_6A80: - dx = aniTouchRedDisk; + dx = aniFramesTouchRedDisk; + dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x22); MovHighByte(&PlayField16[*si + FieldWidth], 3); goto loc_StopNoSplit; @@ -1375,7 +1419,8 @@ loc_g_6A80: // ========================================================================== loc_g_6A9C: - dx = aniTouchRedDisk; + dx = aniFramesTouchRedDisk; + dx1 = aniTouchRedDisk; MovHighByte(&PlayField16[*si], 0x23); MovHighByte(&PlayField16[*si + 1], 3); @@ -1392,12 +1437,22 @@ loc_g_6AB8: 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; // ========================================================================== @@ -1410,7 +1465,8 @@ loc_g_6AF1: PlayField16[*si - 2] = 0x1200; subCopyImageToScreen(*si, aniPushLeft); - dx = aniYellowDisk; + dx = aniFramesYellowDisk; + dx1 = aniYellowDisk; dxPos = *si - 1; dx2 = aniPushLeft; dx2Step = 1; @@ -1426,12 +1482,22 @@ loc_g_6B2A: 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; // ========================================================================== @@ -1444,7 +1510,8 @@ loc_g_6B63: PlayField16[*si + 2] = 0x1200; subCopyImageToScreen(*si, aniPushRight); - dx = aniYellowDisk; + dx = aniFramesYellowDisk; + dx1 = aniYellowDisk; dxPos = *si + 1; dx2 = aniPushRight; dx2Step = -1; @@ -1461,7 +1528,8 @@ loc_g_6B9B: PlayField16[*si - 2] = 0x800; subCopyImageToScreen(*si, aniPushLeft); - dx = aniOrangeDisk; + dx = aniFramesOrangeDisk; + dx1 = aniOrangeDisk; dxPos = *si - 1; dx2 = aniPushLeft; dx2Step = 1; @@ -1481,7 +1549,8 @@ loc_g_6BD3: PlayField16[*si + 2] = 0x100; subCopyImageToScreen(*si, aniPushRight); - dx = aniOrangeDisk; + dx = aniFramesOrangeDisk; + dx1 = aniOrangeDisk; dxPos = *si + 1; dx2 = aniPushRight; dx2Step = -1; @@ -1550,6 +1619,12 @@ locProceedMovingMurphy: // proceed moving murphy // ========================================================================== loc_g_6C8F: + +#if 1 + if (SeqPos <= 0) + dx1SequenceLength = getSequenceLength(dx1); +#endif + if (SplitMoveFlag == 0) { // ++++++++++++++++++++++++++ @@ -1614,7 +1689,18 @@ loc_g_6C8F: 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)) @@ -1634,6 +1720,7 @@ loc_g_6C8F: #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 @@ -1670,8 +1757,13 @@ loc_g_6C8F: } // 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; diff --git a/src/game_sp/SnikSnaks.c b/src/game_sp/SnikSnaks.c index f19039b2..46543184 100644 --- a/src/game_sp/SnikSnaks.c +++ b/src/game_sp/SnikSnaks.c @@ -133,7 +133,7 @@ static int subSnikSnakTurnLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniSnikSnak[bx]); + StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bx = (bx + 1) & 0x7; MovHighByte(&PlayField16[si], bx); @@ -257,7 +257,7 @@ static int subSnikSnakTurnRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniSnikSnak[0x10 - bx]); + StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bx = ((bx + 1) & 0x7) | 8; MovHighByte(&PlayField16[si], bx); @@ -620,7 +620,7 @@ static int subDrawSnikSnakTurnLeft(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniSnikSnak[bx]); + StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawSnikSnakTurnLeft; @@ -635,7 +635,7 @@ static int subDrawSnikSnakTurnRight(int si, int bx) // +++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniSnikSnak[0x10 - bx]); + StretchedSprites.BltEx(X, Y, aniFramesSnikSnak[0x10 - bx]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ return subDrawSnikSnakTurnRight; diff --git a/src/game_sp/Zonk.c b/src/game_sp/Zonk.c index fc6f5d96..0c00be8e 100644 --- a/src/game_sp/Zonk.c +++ b/src/game_sp/Zonk.c @@ -263,7 +263,7 @@ loc_g_0F83: // zonk comes rolling from right to left Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniZonkRollLeft[dx - 1]); + StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesZonkRollLeft[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; // get and increment sequence# if (bl == 0x24) @@ -295,7 +295,7 @@ loc_g_0FE8: // zonk comes rolling from left to right Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniZonkRollRight[dx - 1]); + StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesZonkRollRight[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; if (bl == 0x34) @@ -347,7 +347,7 @@ loc_g_107B: // zonk rolls left Y = GetStretchY(si); dx = (bl & 0xF) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniZonkRollLeft[dx - 1]); + StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesZonkRollLeft[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence# if (bl < 0x52) @@ -384,7 +384,7 @@ loc_g_10E9: // zonk rolls right Y = GetStretchY(si); dx = (bl & 0x7) + 1; StretchedSprites.BltEx(X, Y, 0); - StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniZonkRollRight[dx - 1]); + StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesZonkRollRight[dx - 1]); // +++++++++++++++++++++++++++++++++++++++++++++++++++++ bl = HighByte(PlayField16[si]) + 1; if (bl < 0x62) -- 2.34.1