+2010-03-15
+ * continued code cleanup of native Supaplex game engine
+
2010-03-14
* started code cleanup of native Supaplex game engine
-#define COMPILE_DATE_STRING "2010-03-15 01:21"
+#define COMPILE_DATE_STRING "2010-03-15 11:01"
if ((TimerVar & 3) == 0)
{
bl = bl + 1;
- if (bl >= 0xE)
+ if (bl >= 14) // bugs animation has 14 frames
{
bl = subGetRandomNumber(); // generate new random number
bl = -((bl & 0x3F) + 0x20);
void subAnimateTerminals(int si)
{
- short bl;
+ int bl;
int lx = GetX(si);
int ly = GetY(si);
GfxFrame[lx][ly]--;
/* get last random animation delay */
- bl = HighByte(PlayField16[si]);
- if ((bl & 0x80) == 0x80)
- bl = (bl | 0xFF00);
+ bl = SgnHighByte(PlayField16[si]);
bl = bl + 1;
if (bl <= 0) /* return if random animation delay not yet reached */
redraw[x][y] = FALSE;
redraw_tiles = 0;
-#if 1
DrawFrameIfNeeded();
-#endif
for (y = DisplayMinY; y <= DisplayMaxY; y++)
{
ScrollX = mScrollX;
ScrollY = mScrollY;
-#if 1
ScrollPlayfieldIfNeeded();
-#endif
}
void DDScrollBuffer_ScrollTowards(int X, int Y, double Step)
Y = Y / Stretch;
dx = X - mScrollX;
dY = Y - mScrollY;
+
r = Sqr(dx * dx + dY * dY);
- if (r == 0) // we are there already
+ if (r == 0) // we are there already
return;
if (Step < r)
ScrollX = mScrollX;
ScrollY = mScrollY;
-#if 1
ScrollPlayfieldIfNeeded();
-#endif
}
void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS)
return;
if (AlreadyRunning)
- {
return;
- }
AlreadyRunning = True;
X = X / Stretch;
dx = X - mScrollX;
dY = Y - mScrollY;
maxD = (Abs(dx) < Abs(dY) ? Abs(dY) : Abs(dx));
+
StepCount = FPS * (TimeMS / (double)1000);
if (StepCount > maxD)
StepCount = maxD;
tStep = (double)1 / StepCount;
oldX = mScrollX;
oldY = mScrollY;
- // R = Sqr(dX * dX + dY * dY)
- // If R = 0 Then Exit Sub 'we are there already
+
for (T = (double)tStep; T <= (double)1; T += tStep)
{
if (UserDragFlag)
SoftScrollEH:
AlreadyRunning = False;
-#if 1
ScrollPlayfieldIfNeeded();
-#endif
}
static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY)
{
- MyRECT DR, SR;
-
int scx = (mScrollX_last < 0 ? 0 : mScrollX_last);
int scy = (mScrollY_last < 0 ? 0 : mScrollY_last);
int sx1 = scx - 2 * TILEX;
if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2)
return;
- DR.left = pX + mDestXOff;
- DR.top = pY + mDestYOff;
- DR.right = pX + mSpriteWidth + mDestXOff;
- DR.bottom = pY + mSpriteHeight + mDestYOff;
-
- SR.left = SpriteX;
- SR.top = SpriteY;
- SR.right = SR.left + mSpriteWidth;
- SR.bottom = SR.top + mSpriteHeight;
-
- BlitBitmap(bitmap, screenBitmap,
- SR.left, SR.top,
- mSpriteWidth, mSpriteHeight,
- sx, sy);
+ BlitBitmap(bitmap, screenBitmap, SpriteX, SpriteY,
+ mSpriteWidth, mSpriteHeight, sx, sy);
}
void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)
#include "Demo.h"
-// static char *VB_Name = "modDemo";
-// --- Option Explicit
-//
-// Public Function subCloseDemoRecordingFile()
-//
-// End Function
int RecDemoRandomSeed;
byte FirstDemoByte;
char *MySignature;
GetTotalFramesOfDemo = nFrames;
return GetTotalFramesOfDemo;
- // GetTotalFramesOfDemoEH:
- // ReportError "GetTotalFramesOfDemo()", "invalid data detected in file " & OrigPath
GetTotalFramesOfDemo = 0;
DemoAvailable = False;
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DemoBufferObject.c
-// ----------------------------------------------------------------------------
-
-#include "DemoBufferObject.h"
-
-// static void Class_Terminate();
-// static int RemoveLastDemoKey();
-
-// --- VERSION 1.0 CLASS
-// --- BEGIN
-// --- MultiUse = -1 'True // True
-// --- Persistable = 0 'NotPersistable // NotPersistable
-// --- DataBindingBehavior = 0 'vbNone // vbNone
-// --- DataSourceBehavior = 0 'vbNone // vbNone
-// --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject
-// --- END
-
-// static char *VB_Name = "DemoBufferObject";
-// static boolean VB_GlobalNameSpace = False;
-// static boolean VB_Creatable = True;
-// static boolean VB_PredeclaredId = False;
-// static boolean VB_Exposed = False;
-
-// --- Option Explicit
-
-#define MaxPos ((long)1024)
-
-// Private Const MaxPos& = 20& 'debug only
-byte DemoByte[MaxPos + 1];
-DemoBufferObject SubBuffer;
-
-byte nFirstByte;
-
-char *mSignature;
-boolean bSignatureAvailable;
-
-long WritePos;
-int LastKey;
-int CheckSum;
-long nSize;
-
-#if 0
-
-static void Class_Initialize()
-{
- int lSize;
-
- Trace("DemoBufferObject", "Construction");
- DemoBufferObject_Reset();
- if (! IS_NOTHING(&DemoBuffer, sizeof(DemoBuffer)))
- {
- lSize = DemoBuffer_Size();
- Trace("DemoBufferObject", "Size == ...");
- Trace("DemoBufferObject", "BufferCount == ...");
- Trace("DemoBufferObject", "TimerVar == ...");
- }
-}
-
-static void Class_Terminate()
-{
- SET_TO_NOTHING(&SubBuffer, sizeof(SubBuffer));
-}
-
-#endif
-
-void DemoBufferObject_Reset()
-{
- nSize = 0;
- nFirstByte = 0x81;
- WritePos = 0;
- LastKey = -1;
- CheckSum = 0;
- bSignatureAvailable = False;
- mSignature = "";
- SET_TO_NOTHING(&SubBuffer, sizeof(SubBuffer));
-}
-
-long DemoBufferObject_Get_Size()
-{
- long Size;
-
- Size = (nSize < 1 ? 0 : nSize);
- if (! IS_NOTHING(&SubBuffer, sizeof(SubBuffer)))
- Size = Size + SubBuffer.Size;
-
- return Size;
-}
-
-byte DemoBufferObject_Get_CheckSumByte()
-{
- byte CheckSumByte;
-
- CheckSumByte = CheckSum & 0xFF;
-
- return CheckSumByte;
-}
-
-byte DemoBufferObject_Get_FirstByte()
-{
- byte FirstByte;
-
- FirstByte = nFirstByte;
-
- return FirstByte;
-}
-
-void DemoBufferObject_Let_FirstByte(byte NewVal)
-{
- nFirstByte = NewVal;
-}
-
-//
-// Public Property Get DemoAvailable() As Boolean
-// DemoAvailable = (0 < nSize)
-// End Property
-//
-// Public Property Get Signature() As String
-// If SubBuffer Is Nothing Then
-// Signature = mSignature
-// Else
-// Signature = SubBuffer.Signature
-// End If
-// End Property
-
-// Public Property Let Signature(NewSig$)
-// If SubBuffer Is Nothing Then
-// Signature = NewSig
-// Else
-// SubBuffer.Signature = NewSig
-// End If
-// End Property
-//
-// Public Property Get SignatureAvailable() As Boolean
-// If SubBuffer Is Nothing Then
-// SignatureAvailable = (mSignature <> "")
-// Else
-// SignatureAvailable = SubBuffer
-// End If
-// End Property
-
-boolean DemoBufferObject_Serialize(FILE *FNum)
-{
- boolean Serialize;
-
- int i; // , LKey%
-
- Serialize = True;
- if (! IS_NOTHING(&SubBuffer, sizeof(SubBuffer)))
- Serialize = SubBuffer.Serialize(FNum);
-
- if (nSize == 0)
- return Serialize;
-
- // LKey = RemoveLastDemoKey()
- if (! nSize < MaxPos) // this buffer is full
- {
-
- // --- On Error GoTo SerializeEH
- FILE_PUT(FNum, -1, &DemoByte, sizeof(DemoByte));
- // --- On Error GoTo 0
-
- }
- else // this is the last buffer in the recursive chain
- {
-
- // --- On Error GoTo SerializeEH
- for (i = 1; i <= WritePos; i++)
- {
- FILE_PUT(FNum, -1, &DemoByte[i], sizeof(DemoByte[i]));
- }
-
- // --- On Error GoTo 0
-
- }
-
- // AddDemoKey LKey
- return Serialize;
-
- // SerializeEH:
- Serialize = False;
-
- return Serialize;
-}
-
-void DemoBufferObject_AddDemoKey(int KeyCode)
-{
- CheckSum = (CheckSum + 1) & 0xFF; // increment checksum
- // If Not SubBuffer Is Nothing Then 'delegate
- // Debug.Assert False
- // 'SubBuffer.AddDemoKey KeyCode
- // Exit Sub
- // End If
- if (LastKey == KeyCode)
- {
- DemoByte[WritePos] = DemoByte[WritePos] + 0x10;
- if (0xEF < DemoByte[WritePos])
- LastKey = -1;
-
- }
- else // LastKey <> KeyCode
- {
- WritePos = WritePos + 1;
-
- if (MaxPos < WritePos) // if overflow then create new buffer, hang myself in list
- {
- DemoBufferObject Tmp;
-
- // Tmp = New DemoBufferObject; // (handle this later, if needed)
- Tmp.SetSubBuffer(&VB_OBJECT_SELF);
- Tmp.AddDemoKey(KeyCode); // and delegate
- DemoBuffer = Tmp;
- }
- else
- {
- nSize = nSize + 1; // increment size
- DemoByte[WritePos] = KeyCode;
- LastKey = KeyCode;
- }
- }
-}
-
-void DemoBufferObject_SetSubBuffer(DemoBufferObject SBuf)
-{
- SubBuffer = SBuf;
-}
-
-#if 0
-
-static int RemoveLastDemoKey()
-{
- static int RemoveLastDemoKey;
-
- RemoveLastDemoKey = (DemoByte[WritePos] & 0xF);
- if (DemoByte[WritePos] < 0x10)
- {
- WritePos = WritePos - 1;
- nSize = nSize - 1;
- LastKey = -1;
- }
- else
- {
- DemoByte[WritePos] = DemoByte[WritePos] - 0x10;
- }
-
- return RemoveLastDemoKey;
-}
-
-#endif
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DemoBufferObject.h
-// ----------------------------------------------------------------------------
-
-#ifndef DEMOBUFFEROBJECT_H
-#define DEMOBUFFEROBJECT_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-extern void DemoBufferObject_AddDemoKey(int KeyCode);
-extern byte DemoBufferObject_Get_CheckSumByte();
-extern byte DemoBufferObject_Get_FirstByte();
-extern long DemoBufferObject_Get_Size();
-extern void DemoBufferObject_Let_FirstByte(byte NewVal);
-extern void DemoBufferObject_Reset();
-extern boolean DemoBufferObject_Serialize(FILE *FNum);
-extern void DemoBufferObject_SetSubBuffer(DemoBufferObject SBuf);
-
-#endif /* DEMOBUFFEROBJECT_H */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DirectDrawGlobals.c
-// ----------------------------------------------------------------------------
-
-#include "DirectDrawGlobals.h"
-
-// static char *VB_Name = "DirectDrawGlobals";
-
-// --- Option Explicit
-
-#if 0
-
-DirectX7 DirectX;
-DirectDraw7 DirectDraw;
-DirectDrawSurface7 PrimarySurface;
-
-void InitDirectDraw(long hWndClip)
-{
- DDSURFACEDESC2 SD;
-
- // DirectX = New DirectX7; // (handle this later, if needed)
- DirectDraw = DirectX.DirectDrawCreate("");
- DirectDraw.SetCooperativeLevel(0, DDSCL_NORMAL);
- // Create PrimarySurface:
- {
- SD.lFlags = DDSD_CAPS;
- SD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE;
- }
- PrimarySurface = DirectDraw.CreateSurface(SD);
- if (hWndClip != 0)
- ClipToWindow(hWndClip);
-}
-
-void ReleaseDirectDraw()
-{
- SET_TO_NOTHING(&PrimarySurface, sizeof(PrimarySurface));
- SET_TO_NOTHING(&DirectDraw, sizeof(DirectDraw));
- SET_TO_NOTHING(&DirectX, sizeof(DirectX));
-}
-
-void ClipToWindow(long hWnd)
-{
- DirectDrawClipper Clipper;
-
- // create clipper
- Clipper = DirectDraw.CreateClipper(0);
- Clipper.SetHWnd(hWnd);
- PrimarySurface.SetClipper(Clipper);
- SET_TO_NOTHING(&Clipper, sizeof(Clipper));
-}
-
-#endif
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DirectDrawGlobals.h
-// ----------------------------------------------------------------------------
-
-#ifndef DIRECTDRAWGLOBALS_H
-#define DIRECTDRAWGLOBALS_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-#if 0
-
-extern void ClipToWindow(long hWnd);
-extern void InitDirectDraw(long hWndClip);
-extern void ReleaseDirectDraw();
-
-extern DirectDraw7 DirectDraw;
-extern DirectDrawSurface7 PrimarySurface;
-extern DirectX7 DirectX;
-
-#endif
-
-#endif /* DIRECTDRAWGLOBALS_H */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DirectXGlobals.c
-// ----------------------------------------------------------------------------
-
-#include "DirectXGlobals.h"
-
-// static char *VB_Name = "DirectXGlobals";
-
-// --- Option Explicit
-
-#if 0
-
-DirectX7 DirectX;
-DirectX7 DirectXS;
-DirectDraw7 DDraw;
-DirectSound DSound;
-
-// Public DInput As DirectInput
-// Public DKeyboard As DirectInputDevice
-DirectDrawSurface7 PrimarySurface;
-
-#endif
-
-#if 0
-
-void InitDirectX(long hWndForm, long hWndClip)
-{
- // DirectX = New DirectX7; // (handle this later, if needed)
- // DirectXS = New DirectX7; // (handle this later, if needed)
-
- // DirectSound:
-
- // --- On Error Resume Next
- DSound = DirectXS.DirectSoundCreate("");
- if (Err.Number != 0)
- {
- ReportError("InitDirectX()", "Unable to start DirectSound.");
- }
- else
- {
- DSound.SetCooperativeLevel(hWndForm, DSSCL_PRIORITY);
- LoadSoundFX();
- }
-
- // DirectDraw:
- DDraw = DirectX.DirectDrawCreate("");
- DDraw.SetCooperativeLevel(0, DDSCL_NORMAL);
- RestorePrimarySurface();
- if (hWndClip != 0)
- ClipToWindow(hWndClip);
-
- // 'DirectInput:
- // Set DInput = DirectX.DirectInputCreate()
- // Set DKeyboard = DInput.CreateDevice("GUID_SysKeyboard")
- // Call DKeyboard.SetCommonDataFormat(DIFORMAT_KEYBOARD)
- // Call DKeyboard.SetCooperativeLevel(hWndForm, DISCL_NONEXCLUSIVE Or DISCL_BACKGROUND)
- // Call DKeyboard.Acquire
-}
-
-void RestorePrimarySurface()
-{
- DDSURFACEDESC2 SD;
-
- // Create PrimarySurface:
- {
- SD.lFlags = DDSD_CAPS;
- SD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE;
- }
-
- // --- On Error Resume Next
- SET_TO_NOTHING(&PrimarySurface, sizeof(PrimarySurface));
- PrimarySurface = DDraw.CreateSurface(SD);
-}
-
-void ReleaseDirectDraw()
-{
- SET_TO_NOTHING(&PrimarySurface, sizeof(PrimarySurface));
- SET_TO_NOTHING(&DDraw, sizeof(DDraw));
- SET_TO_NOTHING(&DirectX, sizeof(DirectX));
-}
-
-void ClipToWindow(long hWnd)
-{
- DirectDrawClipper Clipper;
- long shWnd;
-
- if (hWnd != 0)
- shWnd = hWnd;
-
- // create clipper
- Clipper = DDraw.CreateClipper(0);
- Clipper.SetHWnd(shWnd);
- PrimarySurface.SetClipper(Clipper);
- SET_TO_NOTHING(&Clipper, sizeof(Clipper));
-}
-
-// Public Sub DimPrimary(Brightness&)
-// Dim Pal As DirectDrawPalette
-// Set Pal = PrimarySurface.GetPalette()
-// End Sub
-
-#endif
+++ /dev/null
-// ----------------------------------------------------------------------------
-// DirectXGlobals.h
-// ----------------------------------------------------------------------------
-
-#ifndef DIRECTXGLOBALS_H
-#define DIRECTXGLOBALS_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-#if 0
-
-extern void ClipToWindow(long hWnd);
-extern void InitDirectX(long hWndForm, long hWndClip);
-extern void ReleaseDirectDraw();
-extern void RestorePrimarySurface();
-
-extern DirectDraw7 DDraw;
-extern DirectDrawSurface7 PrimarySurface;
-extern DirectSound DSound;
-extern DirectX7 DirectX;
-extern DirectX7 DirectXS;
-
-#endif
-
-#endif /* DIRECTXGLOBALS_H */
#include "Display.h"
-// static char *VB_Name = "modDisplay";
-
-// --- Option Explicit
int ScreenScrollXPos, ScreenScrollYPos;
-int ScreenPosition, data_h_Xtmp, data_h_Ytmp;
+int ScreenPosition;
-int ShowRedDiskCounter, ShowPanel;
+int ShowPanel;
int ExplosionShake;
boolean NoDisplayFlag;
long DisplayMinY, DisplayMaxY, DisplayHeight;
-int subDisplayInfotronsNeeded()
-{
- int subDisplayInfotronsNeeded;
-
- if (NoDisplayFlag)
- return subDisplayInfotronsNeeded;
-
- {
-#if 0
- MainForm.lblInfoCount.Caption = InfotronsNeeded;
- MainForm.lblInfoCount.Refresh;
-#endif
- }
-
- return subDisplayInfotronsNeeded;
-}
-
-int subDisplayPlayingTime()
+void subDisplayLevel()
{
- int subDisplayPlayingTime;
-
-
- return subDisplayPlayingTime;
-}
-
-int subDisplayLevel()
-{
- int subDisplayLevel;
-
if (NoDisplayFlag || ! LevelLoaded)
- return subDisplayLevel;
-
-#if 1
- DisplayLevel();
-#else
- MainForm.DisplayLevel();
-#endif
-
- return subDisplayLevel;
-}
-
-void subDisplayPanel()
-{
-}
-
-int subCheckRestoreRedDiskCountDisplay()
-{
- int subCheckRestoreRedDiskCountDisplay;
-
- if (NoDisplayFlag)
- return subCheckRestoreRedDiskCountDisplay;
-
- if (ShowRedDiskCounter == 0)
- return subCheckRestoreRedDiskCountDisplay;
-
- ShowRedDiskCounter = ShowRedDiskCounter - 1;
- if (ShowRedDiskCounter == 0)
- {
- {
-#if 0
- MainForm.lblRedDiskCount.Caption = 0;
- MainForm.lblRedDiskCount.Refresh;
-#endif
- }
- }
-
- return subCheckRestoreRedDiskCountDisplay;
-}
-
-void subDisplayRedDiskCount()
-{
- if (NoDisplayFlag)
return;
- {
-#if 0
- MainForm.lblRedDiskCount.Caption = RedDiskCount;
- MainForm.lblRedDiskCount.Refresh;
-#endif
- }
- ShowRedDiskCounter = 0x46;
+ DisplayLevel();
}
void ScrollTo(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);
// 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)
if (NoDisplayFlag)
return;
-#if 0
- printf(":(: %d, %d [%d, %d - %d, %d] [%d]\n",
- X, Y, ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY,
- ScrollDelta);
-#endif
-
oldX = ScrollX;
oldY = ScrollY;
X = ScrollDelta * (X / ScrollDelta);
// ScrollX = X
// ScrollY = Y
-#if 0
- printf(":): %d, %d [%d, %d - %d, %d] [%d]\n",
- X, Y, ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY,
- ScrollDelta);
-#endif
-
Stage.SoftScrollTo(X, Y, TimeMS, FPS);
}
#include "global.h"
-extern void ScrollTo(int X, int Y);
-extern void ScrollTowards(int X, int Y);
-extern void SoftScrollTo(int X, int Y, long TimeMS, int FPS);
-extern int subCheckRestoreRedDiskCountDisplay();
-extern int subDisplayInfotronsNeeded();
-extern int subDisplayLevel();
-extern void subDisplayPanel();
-extern int subDisplayPlayingTime();
-extern void subDisplayRedDiskCount();
-extern boolean NoDisplayFlag;
-extern int ExplosionShake;
-extern int ScreenPosition, data_h_Xtmp, data_h_Ytmp;
extern int ScreenScrollXPos, ScreenScrollYPos;
-extern int ShowRedDiskCounter, ShowPanel;
+extern int ScreenPosition;
+
+extern int ShowPanel;
+extern int ExplosionShake;
+extern boolean NoDisplayFlag;
+
extern long DisplayMinX, DisplayMaxX, DisplayWidth;
extern long DisplayMinY, DisplayMaxY, DisplayHeight;
+extern void subDisplayLevel();
+extern void ScrollTo(int, int);
+extern void ScrollTowards(int, int);
+extern void SoftScrollTo(int, int, long, int);
+
#endif /* DISPLAY_H */
#include "DoGameStuff.h"
+
static void CallAnimation(int si, byte bl);
static boolean IsToBeAnimated(int bl);
-// static char *VB_Name = "modDoGameStuff";
-
-// --- Option Explicit
-
int *AnimationPosTable;
byte *AnimationSubTable;
+
// ==========================================================================
// SUBROUTINE
// Do game stuff
// ==========================================================================
-int subDoGameStuff()
+void subDoGameStuff()
{
- int subDoGameStuff;
-
int si, cx, dx, bl;
subAnimateMurphy(&MurphyPosIndex); // move Murphy in any direction
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Build a database of locations and subs-to-call of animatable fields only:
// Make a snapshot from the field before the animation cycle starts.
// first and last line are not animated.
}
while (0 < cx); // locloop_g_2282' until all lines scanned(not top- and bottom edge)
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Now use the database to animate all animatables the fastest way.
// All the other fields are not checked anymore: those have no database entry.
// The field from before animation is frozen in the database in order not to
} // loop locloop_g_22B8 ' until all animatables done
}
-#if 0
- printf("::: DoGameStuff.c: KillMurphyFlag == %d [%d]\n",
- KillMurphyFlag, MurphyMoveCounter);
-#endif
-
// All animations are done now
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (KillMurphyFlag == 1 || MurphyMoveCounter == 0)
{
-#if 1
if (LeadOutCounter == 0 &&
!game_sp.LevelSolved &&
!game_sp.GameOver)
-#else
- if (LeadOutCounter == 0)
-#endif
{
#if 1
printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag);
#endif
- KillMurphyFlag = 0; // no more "kill Murphy"
- ExplodeFieldSP(MurphyExplodePos); // Explode
- LeadOutCounter = 0x40; // quit: start lead-out
-
-#if 1
+ KillMurphyFlag = 0; // no more "kill Murphy"
+ ExplodeFieldSP(MurphyExplodePos); // Explode
+ LeadOutCounter = 0x40; // quit: start lead-out
#if 1
printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n");
printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag);
#endif
-#if 1
/* give Murphy some more time (LeadOutCounter) to reach the exit */
-#else
- game_sp.GameOver = TRUE;
-#endif
-
-#endif
}
-
-#if 1
-#if 0
- printf("::: *** %d, %d, %d\n", KillMurphyFlag,
- game_sp.LevelSolved, game_sp.GameOver);
-#endif
-
-#if 0
- if (KillMurphyFlag == 1 &&
- !game_sp.LevelSolved &&
- !game_sp.GameOver)
- {
-#if 1
- printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n");
-#endif
-
- game_sp.GameOver = TRUE;
- }
-#endif
-#endif
-
} // loc_g_22FB:
-
-
- return subDoGameStuff;
-} // subDoGameStuff
+}
static boolean IsToBeAnimated(int bl)
{
#include "global.h"
-extern int subDoGameStuff();
extern byte *AnimationSubTable;
extern int *AnimationPosTable;
+extern void subDoGameStuff();
+
#endif /* DOGAMESTUFF_H */
#include "Electrons.h"
-// static char *VB_Name = "modElectron";
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Animate/move Electrons
// ==========================================================================
-int subAnimateElectrons(int si)
+void subAnimateElectrons(int si)
{
- int subAnimateElectrons;
-
int bx, Tmp;
if (SnikSnaksElectronsFrozen == 1)
- return subAnimateElectrons;
+ return;
if (LowByte(PlayField16[si]) != fiElectron)
- return subAnimateElectrons;
+ return;
bx = HighByte(PlayField16[si]);
+
Tmp = bx / 8;
switch (Tmp)
{
subElectronFromLeft(si, bx); // access si from left
break;
}
+}
- return subAnimateElectrons;
-} // subAnimateElectrons
-
-int subDrawAnimatedElectrons(int si)
+void subDrawAnimatedElectrons(int si)
{
- int subDrawAnimatedElectrons;
-
int bx, Tmp;
// If SnikSnaksElectronsFrozen = 1 Then Exit Function
if (LowByte(PlayField16[si]) != fiElectron)
- return subDrawAnimatedElectrons;
+ return;
bx = HighByte(PlayField16[si]);
+
Tmp = bx / 8;
switch (Tmp)
{
subDrawElectronFromLeft(si, bx); // access si from left
break;
}
+}
- return subDrawAnimatedElectrons;
-} // subDrawAnimatedElectrons
-
-int subElectronTurnLeft(int si, int bx)
+void subElectronTurnLeft(int si, int bx)
{
- int subElectronTurnLeft;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
ax = (TimerVar & 3);
if (ax == 3)
goto loc_g_7ACD;
- return subElectronTurnLeft;
+ return;
} // loc_g_7A9F:
-#if 1
- subDrawElectronTurnLeft(si, bx);
-#else
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si);
- Y = GetStretchY(si);
- StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]);
+ subDrawElectronTurnLeft(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
bx = (bx + 1) & 0x7;
MovHighByte(&PlayField16[si], bx);
- return subElectronTurnLeft;
+
+ return;
loc_g_7ACD:
bl = HighByte(PlayField16[si]);
if (bl == 6)
goto loc_g_7B43;
- return subElectronTurnLeft;
+ return;
loc_g_7AE6: // pointing up
ax = PlayField16[si - FieldWidth];
if (LowByte(ax) == fiMurphy) // above is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnLeft;
+ return;
loc_g_7AF5: // above is empty -> go up
PlayField16[si] = 0x1BB;
si = si - FieldWidth; // 1 field up
PlayField16[si] = 0x1018;
- return subElectronTurnLeft;
+
+ return;
loc_g_7B05: // pointing left
ax = PlayField16[si - 1];
if (LowByte(ax) == fiMurphy) // left is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnLeft;
+ return;
loc_g_7B14: // left is empty -> go there
PlayField16[si] = 0x2BB;
si = si - 1; // 1 field left
PlayField16[si] = 0x1818;
- return subElectronTurnLeft;
+
+ return;
loc_g_7B24: // pointing down
ax = PlayField16[si + FieldWidth];
if (LowByte(ax) == fiMurphy) // below is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnLeft;
+ return;
loc_g_7B33: // below is empty -> go down
PlayField16[si] = 0x3BB;
si = si + FieldWidth; // 1 field down
PlayField16[si] = 0x2018;
- return subElectronTurnLeft;
+
+ return;
loc_g_7B43: // pointing Right
ax = PlayField16[si + 1];
if (LowByte(ax) == fiMurphy) // right is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnLeft;
+ return;
loc_g_7B55: // right is empty -> go there
PlayField16[si] = 0x4BB;
si = si + 1; // 1 field right
PlayField16[si] = 0x2818;
+}
- return subElectronTurnLeft;
-} // subElectronTurnLeft
-
-int subElectronTurnRight(int si, int bx)
+void subElectronTurnRight(int si, int bx)
{
- int subElectronTurnRight;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
ax = (TimerVar & 3);
if (ax == 3)
goto loc_g_7BA3;
- return subElectronTurnRight;
+ return;
} // loc_g_7B73:
-#if 1
- subDrawElectronTurnRight(si, bx);
-#else
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si);
- Y = GetStretchY(si);
- StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]);
+ subDrawElectronTurnRight(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
bx = ((bx + 1) & 0x7) | 8;
MovHighByte(&PlayField16[si], bx);
- return subElectronTurnRight;
+
+ return;
loc_g_7BA3:
bl = HighByte(PlayField16[si]);
if (bl == 0xE)
goto loc_g_7BDB;
- return subElectronTurnRight;
+ return;
loc_g_7BBC: // pointing up
ax = PlayField16[si - FieldWidth];
if (LowByte(ax) == fiMurphy) // above is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnRight;
+ return;
loc_g_7BCB: // above is empty -> go up
PlayField16[si] = 0x1BB;
si = si - FieldWidth; // 1 field up
PlayField16[si] = 0x1018;
- return subElectronTurnRight;
+
+ return;
loc_g_7BDB: // pointing left
ax = PlayField16[si - 1];
if (LowByte(ax) == fiMurphy) // left is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnRight;
+ return;
loc_g_7BEA: // left is empty -> go there
PlayField16[si] = 0x2BB;
si = si - 1; // 1 field left
PlayField16[si] = 0x1818;
- return subElectronTurnRight;
+
+ return;
loc_g_7BFA: // pointing down
ax = PlayField16[si + FieldWidth];
if (LowByte(ax) == fiMurphy) // below is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnRight;
+ return;
loc_g_7C09: // below is empty -> go down
PlayField16[si] = 0x3BB;
si = si + FieldWidth; // 1 field down
PlayField16[si] = 0x2018;
- return subElectronTurnRight;
+
+ return;
loc_g_7C19: // pointing Right
ax = PlayField16[si + 1];
if (LowByte(ax) == fiMurphy) // right is murphy -> explode
ExplodeFieldSP(si);
- return subElectronTurnRight;
+ return;
loc_g_7C2B: // right is empty -> go there
PlayField16[si] = 0x4BB;
si = si + 1; // 1 field right
PlayField16[si] = 0x2818;
+}
- return subElectronTurnRight;
-} // subElectronTurnRight
-
-int subElectronFromBelow(int si, int bx)
+void subElectronFromBelow(int si, int bx)
{
- int subElectronFromBelow;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
-#if 1
- subDrawElectronFromBelow(si, bx);
- bx = bx - 0xF; // get and increment sequence#
-#else
- bx = bx - 0xF; // get and increment sequence#
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si);
- Y = GetStretchY(si + FieldWidth);
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]);
+ subDrawElectronFromBelow(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
+ bx = bx - 0xF; // get and increment sequence#
bl = LowByte(bx);
if (bl == 7 && LowByte(PlayField16[si + FieldWidth]) != fiExplosion)
{
bl = bl + 0x10;
MovHighByte(&PlayField16[si], bl);
- return subElectronFromBelow;
+
+ return;
} // loc_g_7C84
PlayField16[si] = 0x18; // sequence#=8 -> arrived at the new field
if (ax == 0 || LowByte(ax) == fiMurphy) // check for empty or murphy
{
MovHighByte(&PlayField16[si], 1); // start to turn left
- return subElectronFromBelow;
+
+ return;
} // loc_g_7CA4:
ax = PlayField16[si - FieldWidth]; // cannot turn left -> check above
PlayField16[si] = 0x1BB; // mark as "electron leaving"
si = si - FieldWidth; // go up!
PlayField16[si] = 0x1018;
- return subElectronFromBelow;
+
+ return;
}
if (LowByte(ax) == fiMurphy) // check for murphy above
{
ExplodeFieldSP(si); // Explode
- return subElectronFromBelow;
+
+ return;
} // loc_g_7CC6:
ax = PlayField16[si + 1]; // check right field
if (ax == 0 || LowByte(ax) == fiMurphy) // check for empty or murphy
{
MovHighByte(&PlayField16[si], 9); // start to turn right
- return subElectronFromBelow;
+
+ return;
} // loc_g_7CE0:
// else: no way to go, start turning around
MovHighByte(&PlayField16[si], 1);
+}
- return subElectronFromBelow;
-} // subElectronFromBelow
-
-int subElectronFromRight(int si, int bx)
+void subElectronFromRight(int si, int bx)
{
- int subElectronFromRight;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
-#if 1
- subDrawElectronFromRight(si, bx);
- bx = bx - 0x17; // get and increment sequence#
-#else
- bx = bx - 0x17; // get and increment sequence#
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si + 1);
- Y = GetStretchY(si);
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]);
+ subDrawElectronFromRight(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
+ bx = bx - 0x17; // get and increment sequence#
bl = LowByte(bx);
if (bl == 7 && LowByte(PlayField16[si + 1]) != fiExplosion)
{
bl = bl + 0x18;
MovHighByte(&PlayField16[si], bl);
- return subElectronFromRight;
+
+ return;
} // loc_g_7D2A:
PlayField16[si] = 0x18; // sequence#=8 -> arrived at the new field
if (ax == 0 || LowByte(ax) == fiMurphy) // empty or murphy?
{
MovHighByte(&PlayField16[si], 3); // yes -> turn left down
- return subElectronFromRight;
+
+ return;
} // loc_g_7D4A:
ax = PlayField16[si - 1]; // check left, etc ... see the comments on subElectronFromBelow()
PlayField16[si] = 0x2BB;
si = si - 1; // 1 field left
PlayField16[si] = 0x1818;
- return subElectronFromRight;
+
+ return;
} // loc_g_7D61:
if (LowByte(ax) == fiMurphy)
{
ExplodeFieldSP(si); // Explode
- return subElectronFromRight;
+
+ return;
} // loc_g_7D6C:
ax = PlayField16[si - FieldWidth]; // check above
if (ax == 0 || LowByte(ax) == fiMurphy)
{
MovHighByte(&PlayField16[si], 0xF);
- return subElectronFromRight;
+
+ return;
} // loc_g_7D86:
MovHighByte(&PlayField16[si], 3);
+}
- return subElectronFromRight;
-} // subElectronFromRight
-
-int subElectronFromAbove(int si, int bx)
+void subElectronFromAbove(int si, int bx)
{
- int subElectronFromAbove;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
-#if 1
- subDrawElectronFromAbove(si, bx);
- bx = bx - 0x1F; // get and increment sequence#
-#else
- bx = bx - 0x1F; // get and increment sequence#
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si);
- Y = GetStretchY(si - FieldWidth);
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]);
+ subDrawElectronFromAbove(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
+ bx = bx - 0x1F; // get and increment sequence#
bl = LowByte(bx);
if (bl == 7 && LowByte(PlayField16[si - FieldWidth]) != fiExplosion)
{
bl = bl + 0x20;
MovHighByte(&PlayField16[si], bl);
- return subElectronFromAbove;
+
+ return;
} // loc_g_7DD7
PlayField16[si] = 0x18; // sequence#=8 -> arrived at the new field
if (ax == 0 || LowByte(ax) == fiMurphy)
{
MovHighByte(&PlayField16[si], 5);
- return subElectronFromAbove;
+
+ return;
} // loc_g_7DF7:
ax = PlayField16[si + FieldWidth]; // check below
PlayField16[si] = 0x3BB;
si = si + FieldWidth; // 1 field down
PlayField16[si] = 0x2018;
- return subElectronFromAbove;
+
+ return;
} // loc_g_7E0E:
if (LowByte(ax) == fiMurphy)
{
ExplodeFieldSP(si); // Explode
- return subElectronFromAbove;
+
+ return;
} // loc_g_7E19:
ax = PlayField16[si - 1]; // check left
if (ax == 0 || LowByte(ax) == fiMurphy)
{
MovHighByte(&PlayField16[si], 0xD);
- return subElectronFromAbove;
+
+ return;
} // loc_g_7E33:
MovHighByte(&PlayField16[si], 5);
+}
- return subElectronFromAbove;
-} // subElectronFromAbove
-
-int subElectronFromLeft(int si, int bx)
+void subElectronFromLeft(int si, int bx)
{
- int subElectronFromLeft;
-
- // int ax, ah, bl, dx, X, Y;
int ax, bl;
-#if 1
- subDrawElectronFromLeft(si, bx);
- bx = bx - 0x27; // get and increment sequence#
-#else
- bx = bx - 0x27; // get and increment sequence#
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
- X = GetStretchX(si - 1);
- Y = GetStretchY(si);
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]);
+ subDrawElectronFromLeft(si, bx);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-#endif
+ bx = bx - 0x27; // get and increment sequence#
bl = LowByte(bx);
if (bl == 7 && LowByte(PlayField16[si - 1]) != fiExplosion)
{
bl = bl + 0x28;
MovHighByte(&PlayField16[si], bl);
- return subElectronFromLeft;
+
+ return;
} // loc_g_7E7E:
PlayField16[si] = 0x18; // sequence#=8 -> arrived at the new field
if (ax == 0 || LowByte(ax) == fiMurphy)
{
MovHighByte(&PlayField16[si], 7);
- return subElectronFromLeft;
+
+ return;
} // loc_g_7E9E:
ax = PlayField16[si + 1]; // check right(straight on)
PlayField16[si] = 0x4BB;
si = si + 1; // 1 field right
PlayField16[si] = 0x2818;
- return subElectronFromLeft;
+
+ return;
} // loc_g_7EB5:
if (LowByte(ax) == fiMurphy)
{
ExplodeFieldSP(si); // Explode
- return subElectronFromLeft;
+
+ return;
} // loc_g_7EC0:
ax = PlayField16[si + FieldWidth]; // check below
if (ax == 0 || LowByte(ax) == fiMurphy)
{
MovHighByte(&PlayField16[si], 0xB);
- return subElectronFromLeft;
+
+ return;
} // loc_g_7A69:
MovHighByte(&PlayField16[si], 7);
+}
- return subElectronFromLeft;
-} // subElectronFromLeft
-
-int subDrawElectronTurnLeft(int si, int bx)
+void subDrawElectronTurnLeft(int si, int bx)
{
- int subDrawElectronTurnLeft;
-
int X, Y;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
StretchedSprites.BltImg(X, Y, aniElectron, bx);
-#else
- StretchedSprites.BltEx(X, Y, aniFramesElectron[bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronTurnLeft;
}
-int subDrawElectronTurnRight(int si, int bx)
+void subDrawElectronTurnRight(int si, int bx)
{
- int subDrawElectronTurnRight;
-
int X, Y;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
StretchedSprites.BltImg(X, Y, aniElectron, 0x10 - bx);
-#else
- StretchedSprites.BltEx(X, Y, aniFramesElectron[0x10 - bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronTurnRight;
}
-int subDrawElectronFromBelow(int si, int bx)
+void subDrawElectronFromBelow(int si, int bx)
{
- int subDrawElectronFromBelow;
-
int X, Y;
bx = bx - 0xF; // get and increment sequence#
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si + FieldWidth);
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X, Y - bx * TwoPixels, aniElectron, bx);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y - bx * TwoPixels, aniFramesElectron[bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronFromBelow;
}
-int subDrawElectronFromRight(int si, int bx)
+void subDrawElectronFromRight(int si, int bx)
{
- int subDrawElectronFromRight;
-
int X, Y;
bx = bx - 0x17; // get and increment sequence#
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si + 1);
Y = GetStretchY(si);
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X - bx * TwoPixels, Y, aniElectron, bx);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - bx * TwoPixels, Y, aniFramesElectron[bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronFromRight;
}
-int subDrawElectronFromAbove(int si, int bx)
+void subDrawElectronFromAbove(int si, int bx)
{
- int subDrawElectronFromAbove;
-
int X, Y;
bx = bx - 0x1F; // get and increment sequence#
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si - FieldWidth);
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X, Y + bx * TwoPixels, aniElectron, bx);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y + bx * TwoPixels, aniFramesElectron[bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronFromAbove;
}
-int subDrawElectronFromLeft(int si, int bx)
+void subDrawElectronFromLeft(int si, int bx)
{
- int subDrawElectronFromLeft;
-
int X, Y;
bx = bx - 0x27; // get and increment sequence#
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si - 1);
Y = GetStretchY(si);
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X + bx * TwoPixels, Y, aniElectron, bx);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + bx * TwoPixels, Y, aniFramesElectron[bx]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subDrawElectronFromLeft;
}
#include "global.h"
-extern int subAnimateElectrons(int si);
-extern int subDrawAnimatedElectrons(int si);
-extern int subDrawElectronFromAbove(int si, int bx);
-extern int subDrawElectronFromBelow(int si, int bx);
-extern int subDrawElectronFromLeft(int si, int bx);
-extern int subDrawElectronFromRight(int si, int bx);
-extern int subDrawElectronTurnLeft(int si, int bx);
-extern int subDrawElectronTurnRight(int si, int bx);
-extern int subElectronFromAbove(int si, int bx);
-extern int subElectronFromBelow(int si, int bx);
-extern int subElectronFromLeft(int si, int bx);
-extern int subElectronFromRight(int si, int bx);
-extern int subElectronTurnLeft(int si, int bx);
-extern int subElectronTurnRight(int si, int bx);
+
+extern void subAnimateElectrons(int);
+extern void subDrawAnimatedElectrons(int);
+extern void subDrawElectronFromAbove(int, int);
+extern void subDrawElectronFromBelow(int, int);
+extern void subDrawElectronFromLeft(int, int);
+extern void subDrawElectronFromRight(int, int);
+extern void subDrawElectronTurnLeft(int, int);
+extern void subDrawElectronTurnRight(int, int);
+extern void subElectronFromAbove(int, int);
+extern void subElectronFromBelow(int, int);
+extern void subElectronFromLeft(int, int);
+extern void subElectronFromRight(int, int);
+extern void subElectronTurnLeft(int, int);
+extern void subElectronTurnRight(int, int);
#endif /* ELECTRONS_H */
#include "ErrorReporting.h"
+
+
static char * GetErrLogPath();
static char * GetTraceLogPath();
return GetTraceLogPath;
}
-
-void Trace(char *Source, char *Message)
-{
- // Dim Path$, FNum%, bIsOpen As Boolean
- // Path = GetTraceLogPath()
- // FNum = FreeFile
- // bIsOpen = False
- // On Error GoTo TraceEH
- // Open Path For Append Access Write As FNum
- // bIsOpen = True
- // ' --- Print #FNum, Now & " " & Source & " : " & Message
- // On Error GoTo 0
- // TraceEH:
- // If bIsOpen Then Close FNum
-}
-
-void ReportError(char *Source, char *Message)
-{
- char *Path;
- FILE *FNum;
- boolean bIsOpen;
-
- Path = GetErrLogPath();
- // FNum = FreeFile();
- bIsOpen = False;
-
- // --- On Error GoTo ReportErrorEH
- FNum = fopen(Path, "ab");
- bIsOpen = True;
- // --- Print #FNum, Now & " SOURCE = " & Source & " ErrMessage = " & Message
- // --- On Error GoTo 0
-
-
- // ReportErrorEH:
- if (bIsOpen)
- fclose(FNum);
-}
-
-void InitErrorReporting()
-{
- char *Path;
-
- Path = GetErrLogPath();
- MayKill(Path);
- Path = GetTraceLogPath();
- MayKill(Path);
-}
#include "global.h"
extern void InitErrorReporting();
-extern void ReportError(char *Source, char *Message);
-extern void Trace(char *Source, char *Message);
#endif /* ERRORREPORTING_H */
#include "Explosions.h"
+
static void LetExplodeFieldSP(int tsi, int cx, int dh);
-static int subExplodeInfotron(int tsi, int cx);
-static int subExplodeZonk(int tsi, int cx);
+static void subExplodeInfotron(int tsi, int cx);
+static void subExplodeZonk(int tsi, int cx);
-// static char *VB_Name = "modExplosions";
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Animate explosion
// ==========================================================================
-int subAnimateExplosion(int si)
-{
- int subAnimateExplosion;
- // int ax, bx, bl, X, Y;
+void subAnimateExplosion(int si)
+{
int ax, bl, X, Y;
if (LowByte(PlayField16[si]) != fiExplosion)
- return subAnimateExplosion;
+ return;
ax = (TimerVar & 3);
if (ax != 0)
- return subAnimateExplosion;
+ return;
bl = HighByte(PlayField16[si]);
-#if 0
- printf("::: subAnimateExplosion: %d [%d, %d] [%d]\n",
- bl, PlayField16[si], si, FrameCounter);
-#endif
+
if ((bl & 0x80) != 0) // infotron explosion!
goto loc_g_28D0;
bl = bl + 1;
MovHighByte(&PlayField16[si], bl);
+
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniDefaultExplosion;
-#else
- StretchedSprites.BltImg(X, Y, aniDefaultExplosion, bl);
-#endif
-
-#else
- StretchedSprites.BltEx(X, Y, aniFramesExplosion[bl]);
-#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
if (bl == 8)
{
PlayField16[si] = 0;
ExplosionShake = 0; // nothing explodes
-#if 1
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
-#else
- StretchedSprites.BltImg(X, Y, aniSpace, 0);
-#endif
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
} // loc_ret_g_28CF:
- return subAnimateExplosion;
+ return;
loc_g_28D0: // explosion produces infotron
bl = bl + 1;
PlayField16[si] = fiInfotron;
MovLowByte(&ExplosionShake, 0); // nothing explodes
-#if 1
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniInfotron;
-#else
- X = GetStretchX(si);
- Y = GetStretchY(si);
- StretchedSprites.BltImg(X, Y, aniInfotron, 0);
-#endif
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- return subAnimateExplosion;
+ return;
} // loc_g_28E3:
MovHighByte(&PlayField16[si], bl);
+
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniElectronExplosion;
-#else
- StretchedSprites.BltImg(X, Y, aniElectronExplosion, bl - 0x80);
-#endif
-
-#else
- StretchedSprites.BltEx(X, Y, aniExplosionInfo + bl - 0x80);
-#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- return subAnimateExplosion;
-} // subAnimateExplosion
+}
// ==========================================================================
// SUBROUTINE
void ExplodeFieldSP(int si)
{
- // int ax, al, cx, dl, dh;
int ax, cx, dl;
ax = LowByte(PlayField16[si]);
GfxGraphic[GetX(si)][GetY(si)] = -1; // restart for chain-explosions
// loc_g_2C3B:
-#if 1
subSoundFX(si, ax, actExploding);
-#else
- subSoundFXExplosion();
-#endif
-} // ExplodeFieldSP
+}
static void LetExplodeFieldSP(int tsi, int cx, int dh)
{
return;
al = LowByte(PlayField16[tsi]);
-#if 0
- printf("::: LetExplodeFieldSP: got %d [%d, %d] [%d]\n",
- al, PlayField16[tsi], tsi, FrameCounter);
-#endif
switch (al)
{
case fiHardWare:
GfxGraphic[GetX(tsi)][GetY(tsi)] = -1; // restart for chain-explosions
}
-static int subExplodeZonk(int tsi, int cx)
+static void subExplodeZonk(int tsi, int cx)
{
- static int subExplodeZonk;
-
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
+}
- return subExplodeZonk;
-} // subExplodeZonk
-
-static int subExplodeInfotron(int tsi, int cx)
+static void subExplodeInfotron(int tsi, int cx)
{
- static int subExplodeInfotron;
-
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
+}
- return subExplodeInfotron;
-} // subExplodeInfotron
-
-int subClearFieldDueToExplosion(int si)
+void subClearFieldDueToExplosion(int si)
{
- int subClearFieldDueToExplosion;
-
int X, Y;
if (LowByte(PlayField16[si]) == fiExplosion)
- return subClearFieldDueToExplosion;
+ return;
PlayField16[si] = 0;
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
-#else
- StretchedSprites.BltImg(X, Y, aniSpace, 0);
-#endif
-
-#else
- StretchedSprites.BltEx(X, Y, fiSpace);
-#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+}
- return subClearFieldDueToExplosion;
-} // subClearFieldDueToExplosion
-
-int subRedDiskReleaseExplosion()
+void subRedDiskReleaseExplosion()
{
- int subRedDiskReleaseExplosion;
-
int al, X, Y, si;
al = RedDiskReleasePhase; // Red disk release phase
if (al <= 1)
- return subRedDiskReleaseExplosion;
+ return;
si = RedDiskReleaseMurphyPos;
if (PlayField16[si] == 0) // Release red disk
// +++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
#if 0
// !!! causes flicker -- fix in Murphy.c !!!
GfxGraphic[GetX(si)][GetY(si)] = aniRedDisk;
#else
StretchedSprites.BltImg(X, Y, aniRedDisk, 0);
#endif
-
-#else
- StretchedSprites.BltEx(X, Y, fiRedDisk);
-#endif
// +++++++++++++++++++++++++++++++++++++++++
+
RedDiskReleasePhase = RedDiskReleasePhase + 1;
if (RedDiskReleasePhase >= 0x28)
{
ExplodeFieldSP(si); // Explode
RedDiskReleasePhase = 0;
}
-
- return subRedDiskReleaseExplosion;
}
-int subFollowUpExplosions()
+void subFollowUpExplosions()
{
- int subFollowUpExplosions;
-
int ax, si;
// locloop_g_2919:
PlayField16[si] = 0xFF18;
ExplodeFieldSP(si); // Explode
}
-
}
else
{
}
}
}
-
- return subFollowUpExplosions;
-} // subFollowUpExplosions
+}
#include "global.h"
-extern void ExplodeFieldSP(int si);
-extern int subAnimateExplosion(int si);
-extern int subClearFieldDueToExplosion(int si);
-extern int subFollowUpExplosions();
-extern int subRedDiskReleaseExplosion();
+
+extern void ExplodeFieldSP(int);
+extern void subAnimateExplosion(int);
+extern void subClearFieldDueToExplosion(int);
+extern void subFollowUpExplosions();
+extern void subRedDiskReleaseExplosion();
#endif /* EXPLOSIONS_H */
#include "FakeDeclares.h"
-// static void subUpdateHallOfFame();
-
-// static char *VB_Name = "FakeDeclares";
-
-// --- Option Explicit
-// --- Option Compare Binary
int MurphyPosIndex, MurphyXPos, MurphyYPos;
int MurphyScreenXPos, MurphyScreenYPos;
int RedDiskReleaseFlag, MovingPictureSequencePhase;
int data_h_DemoDone, LevelStatus;
-int data_h_0DA7;
-int data_h_0DA8;
-int data_h_0DA9;
-int data_h_0D9E;
-int data_h_0D9F;
-int data_h_0DA0;
-int data_h_0DA1;
-int data_h_0DA2;
-int data_h_0DA4;
-int data_h_0DA5;
-int data_h_0DA6;
-
int data_h_165A;
int YellowDisksExploded;
int AllowRedDiskCheat, AllowEatRightRedDiskBug;
boolean EditFlag;
int EditMode;
-// --- const int edDraw = 1;
int edSelect = 2;
int edMove = 3;
int Data_SubRest, Data_SubRstFlg;
int keyEnter;
-int data_SPtorunavail; // ???????
-
int UpdateTimeFlag;
-// boolean bModified;
boolean ModifiedFlag;
-#if 0
-
-static void subUpdateHallOfFame()
-{
-}
-
-#endif
-
-boolean Get_ModifiedFlag()
-{
- // boolean ModifiedFlag;
-
- // Let_ModifiedFlag(bModified);
- Let_ModifiedFlag(ModifiedFlag);
-
- return ModifiedFlag;
-}
void Let_ModifiedFlag(boolean NewVal)
{
- // If bModified = NewVal Then Exit Property
- char *Cap;
-
- // bModified = NewVal;
- ModifiedFlag = NewVal;
- if (! LevelLoaded)
- return;
-
- if (NewVal)
- {
- Cap = ""; // !!! Cap = "MegaPlex - " & StripFileName(OrigPath) & "*"
- gSignature = "";
- bSignatureAvailable = False;
- }
- else
- {
- Cap = ""; // !!! Cap = "MegaPlex - " & StripFileName(OrigPath)
- }
-
-#if 0
- if (MainForm.Caption != Cap)
- MainForm.Caption = Cap;
-#endif
}
-
#include "global.h"
+
#define edDraw (1)
extern boolean ModifiedFlag;
-extern boolean Get_ModifiedFlag();
extern void Let_ModifiedFlag(boolean NewVal);
extern boolean EditFlag;
extern int UpdatedFlag;
extern int WasDemoFlag;
extern int YellowDisksExploded;
-extern int data_SPtorunavail;
-extern int data_h_0D9E;
-extern int data_h_0D9F;
-extern int data_h_0DA0;
-extern int data_h_0DA1;
-extern int data_h_0DA2;
-extern int data_h_0DA4;
-extern int data_h_0DA5;
-extern int data_h_0DA6;
-extern int data_h_0DA7;
-extern int data_h_0DA8;
-extern int data_h_0DA9;
-extern int data_h_165A;
extern int data_h_DemoDone, LevelStatus;
extern int edMove;
extern int edSelect;
+++ /dev/null
-// ----------------------------------------------------------------------------
-// FancyRestore.c
-// ----------------------------------------------------------------------------
-
-#include "FancyRestore.h"
-
-// static char *VB_Name = "modFancy";
-
-// --- Option Explicit
-
-// ==========================================================================
-// SUBROUTINE
-// Restore fancy stuff from sparelevel (and destroy registers ...)
-// ==========================================================================
-
-
-int subRestoreFancy()
-{
- int subRestoreFancy;
-
-
- return subRestoreFancy;
-}
+++ /dev/null
-// ----------------------------------------------------------------------------
-// FancyRestore.h
-// ----------------------------------------------------------------------------
-
-#ifndef FANCYRESTORE_H
-#define FANCYRESTORE_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-extern int subRestoreFancy();
-
-#endif /* FANCYRESTORE_H */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// GeneralTricks.c
-// ----------------------------------------------------------------------------
-
-#include "GeneralTricks.h"
-
-// static char *VB_Name = "GeneralTricks_Module";
-
-// --- Option Explicit
-// --- Option Compare Text
-
-double ValEx(char *TS)
-{
- double ValEx;
-
- // Extends the Val() function for
- // german-style number-representing strings
- int i;
- char *LS, *RS;
-
- i = InStr(1, TS, ",");
- if (i != 0)
- {
- LS = Left(TS, i - 1);
- RS = Right(TS, strlen(TS) - i);
- ValEx = Val(CAT(LS, ".", RS));
- }
- else
- {
- ValEx = Val(TS);
- }
-
- return ValEx;
-}
-
-void INC(int *VAR, int Delta)
-{
- *VAR = *VAR + Delta;
-}
-
-void DEC(int *VAR, int Delta)
-{
- *VAR = *VAR - Delta;
-}
-
-#if 0
-
-char *MySplit(char *TS, char *Sep, long SCount)
-{
- char *MySplit;
-
- char *T;
- long i, J, k, q, L, SL;
- char *RA;
-
- T = TS;
- L = strlen(TS);
- SL = strlen(Sep);
- J = SCount;
- if (J < 1)
- {
- J = 0;
- i = 1;
- while (i <= L)
- {
- k = InStr(i, T, Sep);
- if (k < i)
- break;
-
- if (i < k)
- J = J + 1;
-
- i = k + SL;
- }
-
- if (i <= L)
- J = J + 1;
- }
-
- if (0 < J)
- RA = REDIM_1D(sizeof(char), 0, J + 1 - 1);
- else
- return MySplit;
-
- i = 1;
- q = 0;
- while (i <= L)
- {
- k = InStr(i, T, Sep);
- if (k < i)
- break;
-
- if (i < k)
- {
- if (J <= q + 1)
- break;
-
- q = q + 1;
-#if 0
- /* !!! CHECK IF THIS IS REALLY NEEDED !!! */
- RA[q] = Mid(T, i, k - i);
-#endif
- }
-
- i = k + SL;
- }
-
- if (i <= L)
- {
- q = q + 1;
- T = Right(T, L - i + 1);
- do
- {
- if (Len(T) <= SL)
- break;
-
- if (Right(T, SL) == Sep)
- {
- T = Left(T, Len(T) - SL);
- }
- else
- {
- break;
- }
- }
- while (1);
-
- strcpy(&RA[q], T); // RA(q) = T
- }
-
- MySplit = RA;
-
- return MySplit;
-}
-
-#endif
-
-void MyReplace(char *TS, char *Pat1, char *Pat2)
-{
- long k, SL1, SL2, TL;
-
- TL = strlen(TS);
- SL1 = strlen(Pat1);
- SL2 = strlen(Pat2);
- k = InStr(1, TS, Pat1);
- if (k == 0)
- return;
-
- do
- {
- TS = CAT(Left(TS, k - 1), Pat2, Right(TS, TL - k - SL1 + 1));
- TL = TL + SL2 - SL1;
- k = InStr(k + SL2, TS, Pat1);
- }
- while (!(k == 0));
-}
-
+++ /dev/null
-// ----------------------------------------------------------------------------
-// GeneralTricks.h
-// ----------------------------------------------------------------------------
-
-#ifndef GENERALTRICKS_H
-#define GENERALTRICKS_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-extern void DEC(int *VAR, int Delta);
-extern void INC(int *VAR, int Delta);
-extern void MyReplace(char *TS, char *Pat1, char *Pat2);
-extern char *MySplit(char *TS, char *Sep, long SCount);
-extern double ValEx(char *TS);
-
-#endif /* GENERALTRICKS_H */
char *CurPath, *OrigPath, *TmpPath;
boolean LevelLoaded;
long SignatureDelay;
+boolean bSignatureAvailable;
boolean bCapturePane;
bSignatureAvailable = False;
FirstDemoByte = 0x81;
MySignature = "";
- InitErrorReporting();
}
void InitPseudoCompileFlags()
LevelLoaded = True;
}
+
+void Trace(char *Source, char *Message)
+{
+ printf("::: Trace: Source == '%s', Message == '%s'\n", Source, Message);
+}
+
+void ReportError(char *Source, char *Message)
+{
+ printf("::: ReportError: Source == '%s', Message == '%s'\n", Source, Message);
+}
+
+int Min(int A, int B)
+{
+ int Min;
+
+ if (A < B)
+ Min = A;
+ else
+ Min = B;
+
+ return Min;
+}
+
+int Max(int A, int B)
+{
+ int Max;
+
+ if (A < B)
+ Max = B;
+ else
+ Max = A;
+
+ return Max;
+}
extern int getSequenceLength(int sequence);
extern boolean isSnappingSequence(int sequence);
+extern void Trace(char *Source, char *Message);
+extern void ReportError(char *Source, char *Message);
+
+extern int Min(int A, int B);
+extern int Max(int A, int B);
+
extern int fiGraphic[];
extern int aniSnikSnakTurningLeft[];
extern int aniSnikSnakTurningRight[];
#include "Infotrons.h"
-// static char *VB_Name = "modInfotron";
-
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Animate Infotrons (falling)
// ==========================================================================
-int subAnimateInfotrons(int si)
+void subAnimateInfotrons(int si)
{
- int subAnimateInfotrons;
-
int tFld;
- // PseudoRegisters:
- // int ax, bx, cx, dx, di, X, Y;
- // int ah, bh, ch, dh, al, bl, cl, dl;
int ax, bx, dx, X, Y;
int al, bl;
tFld = PlayField16[si];
if ((tFld & 0xFF) != fiInfotron)
- return subAnimateInfotrons;
+ return;
if (tFld == fiInfotron)
{
if (ax == fiRAM)
goto loc_g_11A6;
- return subAnimateInfotrons;
+ return;
loc_g_11A6: // Case fiZonk, fiInfotron, fiRAM
ax = PlayField16[si + FieldWidth - 1];
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
goto loc_g_11F2;
- return subAnimateInfotrons;
+ return;
loc_g_11D5: // Case fiSpace
MovHighByte(&PlayField16[si], 0x40);
if (PlayField16[si + 1] == 0)
goto loc_g_11FA;
- return subAnimateInfotrons;
+ return;
loc_g_11FA:
MovHighByte(&PlayField16[si], 0x60);
bl = HighByte(PlayField16[si]);
bx = 0;
MovLowByte(&bx, bl);
+
al = bl & 0xF0;
if (al == 0x10) // infotron comes falling from above
goto loc_g_1242;
if (al == 0x70) // intermediate state
goto loc_g_154E;
- return subAnimateInfotrons;
+ return;
loc_g_1242: // infotron comes falling from above
// To Do: draw infotron falling from above
X = GetStretchX(si);
Y = GetStretchY(si - FieldWidth);
dx = bl & 0x7;
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X, Y + TwoPixels * (dx + 1), aniInfotron, dx);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X, Y + TwoPixels * (dx + 1), fiInfotron);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x16)
{
MovHighByte(&PlayField16[si], bl);
subCleanUpForInfotronsAbove(si - FieldWidth);
- return subAnimateInfotrons;
+
+ return;
} // loc_g_1285:
if (bl < 0x18)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
} // loc_g_128F:
MovHighByte(&PlayField16[si], 0); // infotron arrived at the field
#endif
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
- return subAnimateInfotrons;
+ return;
// infotron rolls somewhere
ax = PlayField16[si + FieldWidth - 1];
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
goto loc_g_1350;
- return subAnimateInfotrons;
+ return;
loc_g_132D: // go on falling down?
PlayField16[si] = 0x7004; // go into intermediate waitstate
PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
- return subAnimateInfotrons;
+
+ return;
loc_g_133A: // test if infotron may roll left
// This if(if true) jumps up far above
MovHighByte(&PlayField16[si], 0x50); // infotron rolls left
PlayField16[si - 1] = 0x8888;
- return subAnimateInfotrons;
+ return;
loc_g_1350: // test if infotron may roll right
if (PlayField16[si + 1] != 0)
- return subAnimateInfotrons;
+ return;
MovHighByte(&PlayField16[si], 0x60); // infotron rolls right
PlayField16[si + 1] = 0x8888;
- return subAnimateInfotrons;
+ return;
loc_g_1364: // Murphy dies, but not in any case
bl = HighByte(PlayField16[si + FieldWidth]);
if (bl == 0xE || bl == 0xF || bl == 0x28)
- return subAnimateInfotrons;
+ return;
if (bl == 0x29 || bl == 0x25 || bl == 0x26)
- return subAnimateInfotrons;
+ return;
loc_g_1386: // someone dies/explodes immediately
si = si + FieldWidth; // 1 field down
ExplodeFieldSP(si); // Explode
- return subAnimateInfotrons;
+
+ return;
loc_g_138D: // infotron comes rolling from right to left
// To Do: draw infotron rolling from right
X = GetStretchX(si + 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
if (bl == 0x24)
PlayField16[si + 1] = 0xAAAA;
PlayField16[si] = 0x7004; // go into intermediate state
}
- return subAnimateInfotrons;
+ return;
loc_g_13E9: // infotron comes rolling from left to right
// To Do: draw infotron rolling from left
X = GetStretchX(si - 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x34)
PlayField16[si - 1] = 0xAAAA;
PlayField16[si] = 0x7004; // go into intermediate state
}
- return subAnimateInfotrons;
+ return;
loc_g_1444: // infotron falls straight down
bl = bl + 1;
PlayField16[si] = 0x1004; // go falling
}
- return subAnimateInfotrons;
+ return;
loc_g_1472: // infotron rolls left
// To Do: draw infotron rolling to left
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0xF) + 1;
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X - (TwoPixels * dx), Y, aniInfotronRollLeft, dx - 1);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesInfotronRollLeft[dx - 1]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
if (bl < 0x52)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
}
if (PlayField16[si + FieldWidth - 1] != 0)
si = si - 1; // 1 field left
PlayField16[si] = 0x2204;
PlayField16[si + FieldWidth] = 0x9999;
- return subAnimateInfotrons;
+
+ return;
loc_g_14D9: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
loc_g_14E0: // infotron rolls right
// To Do: draw infotron rolling to right
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-#if 1
StretchedSprites.BltImg(X, Y, aniSpace, 0);
StretchedSprites.BltImg(X + (TwoPixels * dx), Y, aniInfotronRollRight, dx - 1);
-#else
- StretchedSprites.BltEx(X, Y, 0);
- StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesInfotronRollRight[dx - 1]);
-#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl < 0x62)
{
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
}
if (PlayField16[si + FieldWidth + 1] != 0)
si = si + 1;
PlayField16[si] = 0x3204;
PlayField16[si + FieldWidth] = 0x9999;
- return subAnimateInfotrons;
+
+ return;
loc_g_1547: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return subAnimateInfotrons;
+
+ return;
loc_g_154E: // intermediate state
ax = PlayField16[si + FieldWidth];
PlayField16[si] = 0x1004; // start falling down
goto loc_g_1242;
}
+}
- return subAnimateInfotrons;
-} // subAnimateInfotrons
-
-int subCleanUpForInfotronsAbove(int si)
+void subCleanUpForInfotronsAbove(int si)
{
- int subCleanUpForInfotronsAbove;
-
int ax;
if (LowByte(PlayField16[si]) != fiExplosion)
if (PlayField16[si - FieldWidth] != 0)
{
if (PlayField16[si - FieldWidth] != 0x9999)
- return subCleanUpForInfotronsAbove;
+ return;
if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiZonk)
- return subCleanUpForInfotronsAbove;
+ return;
}
if (PlayField16[si - FieldWidth - 1] == fiInfotron)
if (PlayField16[si - FieldWidth + 1] == fiInfotron)
goto loc_g_1722;
- return subCleanUpForInfotronsAbove;
+ return;
loc_g_16FE:
ax = PlayField16[si - 1];
{
PlayField16[si - FieldWidth - 1] = 0x6004;
PlayField16[si - FieldWidth] = 0x8888;
- return subCleanUpForInfotronsAbove;
+
+ return;
}
goto loc_g_16F6;
PlayField16[si - FieldWidth + 1] = 0x5004;
PlayField16[si - FieldWidth] = 0x8888;
}
-
- return subCleanUpForInfotronsAbove;
-} // subCleanUpForInfotronsAbove
+}
#include "global.h"
-extern int subAnimateInfotrons(int si);
-extern int subCleanUpForInfotronsAbove(int si);
+
+extern void subAnimateInfotrons(int);
+extern void subCleanUpForInfotronsAbove(int);
#endif /* INFOTRONS_H */
#include "InitGameConditions.h"
-// static char *VB_Name = "modInitGameConditions";
-
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Init game conditions (variables)
// ==========================================================================
-int subInitGameConditions()
+void subInitGameConditions()
{
- int subInitGameConditions;
-
bCapturePane = False;
MurphyVar0DAC = MurphyYPos;
ExitToMenuFlag = 0;
LeadOutCounter = 0; // quit flag: lead-out counter
RedDiskCount = 0; // Red disk counter
- ShowRedDiskCounter = 0; // show-red-disk time-out
- YawnSleepCounter = 0; // Wake up sleeping Murphy
+ // ShowRedDiskCounter = 0; // show-red-disk time-out
- data_h_0DA7 = 0xFF;
- data_h_0DA8 = 0xFF;
- data_h_0DA9 = 0xFF;
- data_h_0D9E = 1;
- data_h_0D9F = 0;
- data_h_0DA0 = 0;
- data_h_0DA1 = 0;
- data_h_0DA2 = 0;
- data_h_0DA4 = 0;
- data_h_0DA5 = 0;
- data_h_0DA6 = 0;
+ YawnSleepCounter = 0; // Wake up sleeping Murphy
ExplosionShake = 0; // Force explosion flag off
YellowDisksExploded = 0;
TimerVar = 0;
+
// ShowPanel = 1 ' Force Panel on
// MainForm.PanelVisible = True;
+
EnterRepeatCounter = 0; // restart Enter repeat counter
SnikSnaksElectronsFrozen = 0; // Snik-Snaks and Electr. move!
SplitMoveFlag = 0; // Reset Split-through-ports
RedDiskReleasePhase = 0; // (re-)enable red disk release
RedDiskReleaseMurphyPos = 0; // Red disk was released here
-
-
- return subInitGameConditions;
-} // subInitGameConditions
+}
// ==========================================================================
// Locate Murphy and init location.
// ==========================================================================
-int InitMurphyPos()
+void InitMurphyPos()
{
- int InitMurphyPos;
-
int si;
for (si = 0; si <= LevelMax - 1; si++)
- {
if (PlayField16[si] == fiMurphy)
break;
- }
InitMurphyPosB(si);
- MurphyPosIndex = si;
- return InitMurphyPos;
-} // InitMurphyPos
+ MurphyPosIndex = si;
+}
-int InitMurphyPosB(int si)
+void InitMurphyPosB(int si)
{
- int InitMurphyPosB;
-
MurphyYPos = GetStretchY(si) / Stretch;
MurphyXPos = GetStretchX(si) / Stretch;
MurphyScreenYPos = GetStretchY(si); // Murphy's screen y-position
// To Do: draw Murphy in location ax
-#if 1
StretchedSprites.BltImg(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0);
-#else
- StretchedSprites.BltEx(MurphyScreenXPos, MurphyScreenYPos, fiMurphy);
-#endif
MurphyScreenXPos = MurphyScreenXPos / Stretch;
MurphyScreenYPos = MurphyScreenYPos / Stretch;
subCalculateScreenScrollPos(); // calculate screen start addrs
-#if 0
- printf(":1: %d, %d [%d, %d] [%d, %d] [%d, %d]\n",
- mScrollX, mScrollY,
- mScrollX_last, mScrollY_last,
- ScreenScrollXPos, ScreenScrollYPos,
- ScrollX, ScrollY);
-#endif
-
if (AutoScrollFlag)
{
if (bPlaying)
- {
SoftScrollTo(ScreenScrollXPos, ScreenScrollYPos, 1000, 25);
- }
else
- {
ScrollTo(ScreenScrollXPos, ScreenScrollYPos);
- }
}
+}
-#if 0
- printf(":2: %d, %d [%d, %d] [%d, %d] [%d, %d]\n",
- mScrollX, mScrollY,
- mScrollX_last, mScrollY_last,
- ScreenScrollXPos, ScreenScrollYPos,
- ScrollX, ScrollY);
-#endif
-
- return InitMurphyPosB;
-} // InitMurphyPosB
// ==========================================================================
// SUBROUTINE
int subConvertToEasySymbols()
{
- int subConvertToEasySymbols;
-
- // int ax, bx, cx, dx, di, X, Y, i;
- // int ah, bh, ch, dh, al, bl, cl, dl, ZF;
int ax, bx, cx, dx, i;
int al;
if (0 < cx) // Until all done 'loc_g_2782:
goto loc_g_26C9;
- subConvertToEasySymbols = dx; // return InfotronCount
+ return dx; // return InfotronCount
+}
- return subConvertToEasySymbols;
-} // subConvertToEasySymbols
// ==========================================================================
// SUBROUTINE
// Reset Infotron count. Call immediately after subConvertToEasySymbols
// ==========================================================================
-int ResetInfotronsNeeded(int dx)
+void ResetInfotronsNeeded(int dx)
{
- int ResetInfotronsNeeded;
-
if (LInfo.InfotronsNeeded != 0) // Jump If equal (autodetect)
{
dx = LInfo.InfotronsNeeded;
InfotronsNeeded = LowByte(dx); // Remaining Infotrons needed
TotalInfotronsNeeded = InfotronsNeeded; // Number of Infotrons needed
- subDisplayInfotronsNeeded();
-
- return ResetInfotronsNeeded;
-} // ResetInfotronsNeeded
+}
// ==========================================================================
// Fetch and initialize a level
// ==========================================================================
-int subFetchAndInitLevelB()
+void subFetchAndInitLevelB()
{
- int subFetchAndInitLevelB;
-
boolean UpdatePlayTime;
- MovLowByte(&data_SPtorunavail, 0); // no SP file
data_scr_demo = 0;
UpdatePlayTime = (0 == demo_stopped ? True : False);
demo_stopped = 0;
- subFetchAndInitLevelA(UpdatePlayTime);
- return subFetchAndInitLevelB;
-} // subFetchAndInitLevelb
+ subFetchAndInitLevelA(UpdatePlayTime);
+}
-int subFetchAndInitLevelA(boolean UpdatePlayTime)
+void subFetchAndInitLevelA(boolean UpdatePlayTime)
{
- int subFetchAndInitLevelA;
-
if (UpdatePlayTime && (0 == demo_stopped))
{
subUpdatePlayingTime(); // update playing time
DemoKeyRepeatCounter = 1;
subGetNextDemoKey(); // get next demo byte
}
+}
- return subFetchAndInitLevelA;
-} // subFetchAndInitLevela
-
-int subFetchAndInitLevel()
+void subFetchAndInitLevel()
{
- int subFetchAndInitLevel;
-
int InfoCountInLevel;
Trace("modInitGameConditions", "--> subFetchAndInitLevel");
Trace("modInitGameConditions", "ReadLevel return subFetchAndInitLeveled");
if (RecordDemoFlag == 1)
- {
RecDemoRandomSeed = RandomSeed;
- // Debug.Print "FetchRec: " & Hex(RandomSeed)
- }
- // If DemoFlag = 1 Then
- // Debug.Print "FetchPlay: " & Hex(RandomSeed)
- // End If
GameBusyFlag = -GameBusyFlag; // make <>1
Trace("modInitGameConditions", "subConvertToEasySymbols");
Trace("modInitGameConditions", "subDisplayLevel");
subDisplayLevel(); // Paint (Init) game field
- subDisplayPanel(); // Paint (Init) Panel
ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count
InitMurphyPos(); // Locate Murphy + screen pos
Trace("modInitGameConditions", "<-- subFetchAndInitLevel");
-
- return subFetchAndInitLevel;
-} // subFetchAndInitLevel
+}
#include "global.h"
-extern int InitMurphyPos();
-extern int InitMurphyPosB(int si);
-extern int ResetInfotronsNeeded(int dx);
+
extern int subConvertToEasySymbols();
-extern int subFetchAndInitLevel();
-extern int subFetchAndInitLevelA(boolean UpdatePlayTime);
-extern int subFetchAndInitLevelB();
-extern int subInitGameConditions();
+
+extern void InitMurphyPos();
+extern void InitMurphyPosB(int);
+extern void ResetInfotronsNeeded(int);
+extern void subFetchAndInitLevel();
+extern void subFetchAndInitLevelA(boolean);
+extern void subFetchAndInitLevelB();
+extern void subInitGameConditions();
#endif /* INITGAMECONDITIONS_H */
#include "Input.h"
-// static char *VB_Name = "modInput";
-// --- Option Explicit
-
-boolean KeyState[255 + 1];
DemoBufferObject DemoBuffer;
-
-//
-// Public KeyFlagSpace As Boolean
-// Public KeyFlagUp As Boolean
-// Public KeyFlagLeft As Boolean
-// Public KeyFlagDown As Boolean
-// Public KeyFlagRight As Boolean
-// Public KeyFlagEnter As Boolean
-// Public KeyFlagESC As Boolean
-// Public KeyFlagR As Boolean
-// Public KeyFlagRShift As Boolean
-
-int KeyScanCode7;
+boolean KeyState[255 + 1];
int map_key_RND_to_SP(int key)
{
key == keySpace ? KEY_BUTTON : MV_NONE);
}
-void subCheckJoystick()
-{
-}
-
-int subCheckRightMouseButton()
+void subProcessKeyboardInput(byte action)
{
- int subCheckRightMouseButton;
-
- // return button state
-
- return subCheckRightMouseButton;
-}
-
-int subProcessKeyboardInput(byte action)
-{
- int subProcessKeyboardInput;
-
- static int LastKey = 0;
-
-#if 1
-
DemoKeyCode = map_key_RND_to_SP(action);
-
-#if 0
- printf("::: DemoKeyCode == %d\n", DemoKeyCode);
-#endif
-
- return subProcessKeyboardInput;
-
-#else
-
- // On Error GoTo NoKeyboardAccessEH
- // Call DKeyboard.Acquire
- // On Error GoTo 0
- // Call DKeyboard.GetDeviceStateKeyboard(KeyState)
- // With KeyState
- if (DemoFlag != 0)
- {
- subGetNextDemoKey();
-
-#if 0
- printf("::: DemoKeyCode == %d\n", DemoKeyCode);
-#endif
-
- if (ExitToMenuFlag != 0)
- return subProcessKeyboardInput;
- }
- else
- {
- if (KeyState[vbKeySpace])
- {
- if (KeyState[vbKeyUp])
- {
- DemoKeyCode = keySpaceUp;
- }
- else if (KeyState[vbKeyLeft])
- {
- DemoKeyCode = keySpaceLeft;
- }
- else if (KeyState[vbKeyDown])
- {
- DemoKeyCode = keySpaceDown;
- }
- else if (KeyState[vbKeyRight])
- {
- DemoKeyCode = keySpaceRight;
- }
- else
- {
- DemoKeyCode = keySpace;
- }
-
- }
- else
- {
- if (KeyState[vbKeyUp])
- {
- DemoKeyCode = keyUp;
- }
- else if (KeyState[vbKeyLeft])
- {
- DemoKeyCode = keyLeft;
- }
- else if (KeyState[vbKeyDown])
- {
- DemoKeyCode = keyDown;
- }
- else if (KeyState[vbKeyRight])
- {
- DemoKeyCode = keyRight;
- }
- else
- {
- DemoKeyCode = keyNone;
- }
- }
- }
-
-#endif
-
- // demo recording
- if (RecordDemoFlag == 1)
- DemoBuffer.AddDemoKey(DemoKeyCode);
-
- if (DemoKeyCode != LastKey && ! NoDisplayFlag)
- {
-#if 0
- MainForm.ShowKey(DemoKeyCode);
-#endif
- LastKey = DemoKeyCode;
- }
-
- if (KeyState[vbKeyEscape])
- {
- if (BlockingSpeed)
- {
- // Call MainForm.menSpeed_Click(4)
- }
- else
- {
-#if 1
- printf("::: Input.c: subProcessKeyboardInput(): kill murphy\n");
-#endif
-
- KillMurphyFlag = 1;
- // ExplodeFieldSP MurphyPosIndex
- // LeadOutCounter = &H20
- }
- }
-
- if (KeyState[vbKeyR])
- {
- subFetchAndInitLevelB();
- }
-
- if (KeyState[vbKeyShift])
- subDisplayRedDiskCount();
-
-#if 0
- if (KeyState[vbKeyReturn])
- MainForm.PanelVisible = (ShowPanel == 0);
-#endif
-
- // End With
- // Call DKeyboard.Unacquire
- return subProcessKeyboardInput;
-
- // NoKeyboardAccessEH:
- Debug.Print("! Keyboard access");
-
- return subProcessKeyboardInput;
}
#include "global.h"
-extern void subCheckJoystick();
-extern int subCheckRightMouseButton();
-extern int subProcessKeyboardInput(byte);
extern DemoBufferObject DemoBuffer;
extern boolean KeyState[255 + 1];
-extern int KeyScanCode7;
+
+extern void subProcessKeyboardInput(byte);
#endif /* INPUT_H */
// Call subDisplayPlayingTime ' playing time on screen
- subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole
+ // subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole
subRedDiskReleaseExplosion(); // Red Disk release and explode
subFollowUpExplosions(); // every explosion may cause up to 8 following explosions
ScreenPosition = bx;
// Now new X and new Y are calculated, and bx = screen position = ScreenPosition
- data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll
- data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll
+ // 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
// Call subDisplayPlayingTime ' playing time on screen
- subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole
+ // subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole
subRedDiskReleaseExplosion(); // Red Disk release and explode
subFollowUpExplosions(); // every explosion may cause up to 8 following explosions
ScreenPosition = bx;
// Now new X and new Y are calculated, and bx = screen position = ScreenPosition
- data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll
- data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll
+ // 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
DDScrollBuffer.c \
DDSpriteBuffer.c \
Demo.c \
- DemoBufferObject.c \
- DirectDrawGlobals.c \
- DirectXGlobals.c \
Display.c \
DoGameStuff.c \
Electrons.c \
- ErrorReporting.c \
Explosions.c \
FakeDeclares.c \
- FancyRestore.c \
- GeneralTricks.c \
Globals.c \
Infotrons.c \
InitGameConditions.c \
TopMost.c \
Zonk.c \
modAnimations.c \
- modGeneralTricks.c \
modMPX.c
OBJS = init.o \
DDScrollBuffer.o \
DDSpriteBuffer.o \
Demo.o \
- DemoBufferObject.o \
- DirectDrawGlobals.o \
- DirectXGlobals.o \
Display.o \
DoGameStuff.o \
Electrons.o \
- ErrorReporting.o \
Explosions.o \
FakeDeclares.o \
- FancyRestore.o \
- GeneralTricks.o \
Globals.o \
Infotrons.o \
InitGameConditions.o \
TopMost.o \
Zonk.o \
modAnimations.o \
- modGeneralTricks.o \
modMPX.o
GAME_SP = game_sp.a
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_6EC8: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + FieldWidth);
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_6EE6: // space, base
PlayField16[*si] = fiMurphy;
subAdjustZonksInfotronsAboveMurphy(*si + 1);
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_6F04: // space, base
if (LowByte(PlayField16[*si - FieldWidth]) != fiExplosion)
PlayField16[*si - FieldWidth] = 0;
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_71C4: // space, base
subAdjustZonksInfotronsAboveMurphy(*si - 1);
PlayField16[*si] = fiMurphy;
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_71E2: // base
if (LowByte(PlayField16[*si - FieldWidth]) != fiExplosion)
PlayField16[*si - FieldWidth] = 0;
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_71FE: // base
if (LowByte(PlayField16[*si - 1]) != fiExplosion)
PlayField16[*si - 1] = 0;
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_721A: // base
if (LowByte(PlayField16[*si + FieldWidth]) != fiExplosion)
PlayField16[*si + FieldWidth] = 0;
if (0 < LowByte(InfotronsNeeded))
InfotronsNeeded = InfotronsNeeded - 1;
- subDisplayInfotronsNeeded();
loc_g_7236: // base
if (LowByte(PlayField16[*si + 1]) != fiExplosion)
PlayField16[*si + 1] = 0;
PlayField16[*si] = fiMurphy;
RedDiskReleasePhase = 2;
RedDiskCount = RedDiskCount - 1;
- subDisplayRedDiskCount();
#if 1
subSoundFX(*si, fiRedDisk, actDropping);
}
RedDiskCount = (RedDiskCount + 1) % 256;
- subDisplayRedDiskCount();
}
void subAdjustZonksInfotronsAboveMurphy(int si)
#include "DDScrollBuffer.h"
#include "DDSpriteBuffer.h"
#include "Demo.h"
-#include "DemoBufferObject.h"
-#include "DirectDrawGlobals.h"
-#include "DirectXGlobals.h"
#include "Display.h"
#include "DoGameStuff.h"
#include "Electrons.h"
-#include "ErrorReporting.h"
#include "Explosions.h"
#include "FakeDeclares.h"
-#include "FancyRestore.h"
-#include "GeneralTricks.h"
#include "Globals.h"
#include "Infotrons.h"
#include "InitGameConditions.h"
#include "TopMost.h"
#include "Zonk.h"
#include "modAnimations.h"
-#include "modGeneralTricks.h"
#include "modMPX.h"
#endif /* GAME_SP_GLOBAL_H */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// modGeneralTricks.c
-// ----------------------------------------------------------------------------
-
-#include "modGeneralTricks.h"
-
-// static char *VB_Name = "modGeneralTricks";
-// --- Option Explicit
-
-void Inc(int *i)
-{
- *i = *i + 1;
-}
-
-void Dec(int *i)
-{
- *i = *i - 1;
-}
-
-/*
-double ValEx(char *TS)
-{
- double ValEx;
-
- // Extends the Val() function for
- // german-style number-representing strings
- int i;
- char *LS, *RS;
-
- i = InStr(1, TS, ",");
- if (i != 0)
- {
- LS = Left(TS, i - 1);
- RS = Right(TS, Len(TS) - i);
- ValEx = ValCAT(LS, ".", RS);
- }
- else
- {
- ValEx = Val(TS);
- }
-
- return ValEx;
-}
-*/
-
-int Min(int A, int B)
-{
- int Min;
-
- if (A < B)
- Min = A;
- else
- Min = B;
-
- return Min;
-}
-
-int Max(int A, int B)
-{
- int Max;
-
- if (A < B)
- Max = B;
- else
- Max = A;
-
- return Max;
-}
-
+++ /dev/null
-// ----------------------------------------------------------------------------
-// modGeneralTricks.h
-// ----------------------------------------------------------------------------
-
-#ifndef MODGENERALTRICKS_H
-#define MODGENERALTRICKS_H
-
-#include "vb_types.h"
-#include "vb_defs.h"
-#include "vb_vars.h"
-#include "vb_lib.h"
-
-#include "global.h"
-
-extern void Dec(int *i);
-extern void Inc(int *i);
-extern int Max(int A, int B);
-extern int Min(int A, int B);
-extern double ValEx(char *TS);
-
-#endif /* MODGENERALTRICKS_H */