From 0d95c7df5f708c3f30e10cab3894082019f8cd6c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 30 Jul 2009 15:27:38 +0200 Subject: [PATCH] rnd-20090730-1-src --- src/conftime.h | 2 +- src/game_sp/DDScrollBuffer.c | 12 +++++++++--- src/game_sp/Demo.c | 20 +++++++++++++++++++ src/game_sp/Display.c | 12 ++++++++++++ src/game_sp/DoGameStuff.c | 4 ++-- src/game_sp/Globals.c | 4 ++++ src/game_sp/MainGameLoop.c | 18 ++++++++++++++++-- src/game_sp/Murphy.c | 37 +++++++++++++++++++++++++++++++++++- src/game_sp/modAnimations.h | 2 +- 9 files changed, 101 insertions(+), 10 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index a81ef143..1da4c6f8 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-07-29 02:12" +#define COMPILE_DATE_STRING "2009-07-30 15:25" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 028af542..e71f1f10 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -175,6 +175,7 @@ void DDScrollBuffer_Blt() } #if 1 + #if 0 printf("::: DDScrollBuffer.c: DDScrollBuffer_Blt(): blit from %d, %d [%ld, %ld] [%ld, %ld]\n", SR.left, SR.top, mScrollX, mScrollY, mDestXOff, mDestYOff); @@ -329,6 +330,11 @@ void DDScrollBuffer_ScrollTowards(int X, int Y, double Step) if (NoDisplayFlag) return; +#if 0 + printf("::: DDScrollBuffer.c: DDScrollBuffer_ScrollTowards(): (1) mScroll: %ld, %ld [%d, %d, %f]\n", + mScrollX, mScrollY, X, Y, Step); +#endif + X = X / Stretch; Y = Y / Stretch; dx = X - mScrollX; @@ -347,9 +353,9 @@ void DDScrollBuffer_ScrollTowards(int X, int Y, double Step) ScrollX = mScrollX; ScrollY = mScrollY; -#if 1 - printf("::: DDScrollBuffer.c: DDScrollBuffer_ScrollTowards(): mScroll: %ld, %ld\n", - mScrollX, mScrollY); +#if 0 + printf("::: DDScrollBuffer.c: DDScrollBuffer_ScrollTowards(): (2) mScroll: %ld, %ld [%d, %d, %f]\n", + mScrollX, mScrollY, X, Y, Step); #endif } diff --git a/src/game_sp/Demo.c b/src/game_sp/Demo.c index caa7441c..20b9298c 100644 --- a/src/game_sp/Demo.c +++ b/src/game_sp/Demo.c @@ -46,6 +46,26 @@ void subGetNextDemoKey() ExitToMenuFlag = 1; } } + +#if 1 + printf("::: %04d [%03ld, %02d] ----------> %s [%d] [%d, %d] [%d, %d]\n", + TimerVar, + DemoOffset - DemoPointer, DemoKeyRepeatCounter, + (DemoKeyCode == keyNone ? "(none)" : + DemoKeyCode == keyLeft ? "left" : + DemoKeyCode == keyRight ? "right" : + DemoKeyCode == keyUp ? "up" : + DemoKeyCode == keyDown ? "down" : + DemoKeyCode == keySpace ? "space" : + DemoKeyCode == keySpaceLeft ? "space + left" : + DemoKeyCode == keySpaceRight ? "space + right" : + DemoKeyCode == keySpaceUp ? "space + up" : + DemoKeyCode == keySpaceDown ? "space + down" : "(unknown)"), + DemoKeyCode, + MurphyScreenXPos, MurphyScreenYPos, + MurphyPosIndex % 60, MurphyPosIndex / 60); +#endif + } currency GetTotalFramesOfDemo() diff --git a/src/game_sp/Display.c b/src/game_sp/Display.c index 92cdcd99..c23e57ad 100644 --- a/src/game_sp/Display.c +++ b/src/game_sp/Display.c @@ -134,6 +134,10 @@ void ScrollTowards(int X, int Y) if (NoDisplayFlag) return; +#if 0 + printf("::: 1 ---> %d, %d\n", X, Y); +#endif + oldX = ScrollX; oldY = ScrollY; X = ScrollDelta * (X / ScrollDelta); @@ -145,7 +149,15 @@ void ScrollTowards(int X, int Y) // ScrollX = X // ScrollY = Y +#if 0 + printf("::: 2 ---> %d, %d\n", X, Y); +#endif + +#if 1 + Stage.ScrollTowards(X, Y, 2 * Stretch * ZoomFactor); +#else Stage.ScrollTowards(X, Y, 2 * Stretch); +#endif } void SoftScrollTo(int X, int Y, long TimeMS, int FPS) diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index 01d70744..458f8aa6 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -66,7 +66,7 @@ int subDoGameStuff() } // loop locloop_g_22B8 ' until all animatables done } -#if 1 +#if 0 printf("::: DoGameStuff.c: KillMurphyFlag == %d [%d]\n", KillMurphyFlag, MurphyMoveCounter); #endif @@ -77,7 +77,7 @@ int subDoGameStuff() { if (LeadOutCounter == 0) { -#if 1 +#if 0 printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag); #endif diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 67491f73..f8d52778 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -522,6 +522,10 @@ static void ReadDemo() GravityFlag = LInfo.InitialGravity; FreezeZonks = LInfo.InitialFreezeZonks; +#if 1 + printf("::: Globals.c: ReadDemo(): %d / %d\n", GravityFlag, FreezeZonks); +#endif + RandomSeed = LInfo.DemoRandomSeed; LevelLoaded = True; diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 6a5e0eaf..ddf3d4e2 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -35,7 +35,9 @@ int subMainGameLoop() if (DemoFlag != 0) { +#if 1 printf("::: playing demo ...\n"); +#endif // EP set level success byte: demo, not game WasDemoFlag = 1; @@ -43,7 +45,9 @@ int subMainGameLoop() } else // loc_g_1836: { +#if 1 printf("::: playing game ...\n"); +#endif // EP set level success byte: game, not demo WasDemoFlag = 0; @@ -142,11 +146,15 @@ locRepeatMainGameLoop: // start repeating game loop // ---------------------------------------------------------------------------- // - printf("::: MainGameLoop.c: subDoGameStuff() START\n"); +#if 0 + printf("::: >>>>>>>>>> MainGameLoop.c: subDoGameStuff() START\n"); +#endif subDoGameStuff(); // do all game stuff - printf("::: MainGameLoop.c: subDoGameStuff() END\n"); +#if 0 + printf("::: <<<<<<<<<< MainGameLoop.c: subDoGameStuff() END\n"); +#endif // // ---------------------------------------------------------------------------- @@ -166,7 +174,13 @@ locRepeatMainGameLoop: // start repeating game loop data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll if ((! UserDragFlag) && AutoScrollFlag) + { +#if 0 + printf("::: MainGameLoop.c: subMainGameLoop(): %d, %d\n", ScreenScrollXPos, ScreenScrollYPos); +#endif + ScrollTowards(ScreenScrollXPos, ScreenScrollYPos); + } if (ForcedExitFlag != 0) // Forced Exit?' yes--exit! goto locExitMainGameLoop; diff --git a/src/game_sp/Murphy.c b/src/game_sp/Murphy.c index 1d3c74c1..7ff39ab3 100644 --- a/src/game_sp/Murphy.c +++ b/src/game_sp/Murphy.c @@ -11,7 +11,17 @@ static boolean subMoveKillsMurphy(int si, int ax, int bl); // --- Option Explicit +#if 1 + +#define LocalStretch (2) +#define MurphyZoomFactor (ZoomFactor) + +#else + #define LocalStretch (1) +#define MurphyZoomFactor (1) + +#endif // ========================================================================== // SUBROUTINE @@ -39,7 +49,7 @@ int subAnimateMurphy(int *si) ax = PlayField16[*si]; al = LowByte(ax); -#if 1 +#if 0 printf("::: Murphy.c: subAnimateMurphy(): %d [%d, %d] %d, %d [%d]\n", *si, *si % 60, *si / 60, ax, al, (al == fiMurphy)); #endif @@ -78,6 +88,10 @@ int subAnimateMurphy(int *si) if (bl != 0) // a key was pressed! goto locKeyPressed5FCF; +#if 1 + printf("::: !!! %d [%d]\n", DemoKeyCode, GravityFlag); +#endif + RedDiskReleaseFlag = 1; if (ScratchGravity != 0) // gravity pulls & space below?'-> force Space up to down { @@ -1164,8 +1178,14 @@ loc_g_6A1F: // We only correct Murphies x-location here, when the sequence starts. // Remember that this is not the real bug-fix, but we must live with // this existing bug and correct for the consequences of it. + +#if 1 + if (0 == AllowEatRightRedDiskBug) // Murphy's screen x-position + MurphyScreenXPos = MurphyScreenXPos - 2 * MurphyZoomFactor; +#else if (0 == AllowEatRightRedDiskBug) // Murphy's screen x-position MurphyScreenXPos = MurphyScreenXPos - 2; +#endif SeqPos = -1; // FS: for me this means to blit the first animation frame twice @@ -1390,11 +1410,21 @@ loc_g_6C8F: { // ++++++++++++++++++++++++++ // Begin of normal movement +#if 1 + MurphyScreenXPos = MurphyScreenXPos + MurphyDX * MurphyZoomFactor; + MurphyScreenYPos = MurphyScreenYPos + MurphyDY * MurphyZoomFactor; +#else MurphyScreenXPos = MurphyScreenXPos + MurphyDX; MurphyScreenYPos = MurphyScreenYPos + MurphyDY; +#endif if (! ClearPos < 0) // clear field that murphy is leaving subCopyFieldToScreen(ClearPos, 0); +#if 0 + printf("::: ---------------> %d, %d [%d, %d]\n", + MurphyScreenXPos, MurphyScreenYPos, MurphyDX, MurphyDY); +#endif + if (dx2 == fiInfotron) // special case of infotron moving left or right { tDeltaX = 0; @@ -1432,8 +1462,13 @@ loc_g_6C8F: { // ++++++++++++++++++++++++++++++++ // Begin of split movement (port) +#if 1 + MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX * MurphyZoomFactor; + MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY * MurphyZoomFactor; +#else MurphyScreenXPos = MurphyScreenXPos + 2 * MurphyDX; MurphyScreenYPos = MurphyScreenYPos + 2 * MurphyDY; +#endif subCopyFieldToScreen(ClearPos, 0); // clear the field that murphy leaves tDeltaX = MurphyDX * LocalStretch * (SeqPos + 1); tDeltaY = MurphyDY * LocalStretch * (SeqPos + 1); diff --git a/src/game_sp/modAnimations.h b/src/game_sp/modAnimations.h index c0de60e1..13e6db66 100644 --- a/src/game_sp/modAnimations.h +++ b/src/game_sp/modAnimations.h @@ -27,7 +27,7 @@ typedef struct #ifndef HAS_LevelInfoType typedef struct { - byte UnUsed[4 + 1]; + byte UnUsed[4]; byte InitialGravity; // 1=on, anything else (0) = off byte Version; // SpeedFixVersion XOR &H20 char LevelTitle[23]; -- 2.34.1